Browse Source

style: 金币管理部分的切换按钮的样式

milestone-20250913-现金管理
lihui 16 hours ago
parent
commit
6fd20d27ab
  1. 4
      src/components/workspace/GoldGraph.vue
  2. 8
      src/components/workspace/GoldManagement.vue
  3. 39
      src/css/btn.css
  4. 8
      src/main.ts
  5. 3
      src/views/audit/bean/beanAudit.vue
  6. 16
      src/views/audit/gold/audit.vue
  7. 12
      src/views/consume/bean/beanConsume.vue
  8. 20
      src/views/consume/gold/coinConsume.vue
  9. 40
      src/views/recharge/bean/beanRecharge.vue
  10. 29
      src/views/recharge/gold/coinRecharge.vue
  11. 16
      src/views/refund/gold/coinRefund.vue
  12. 19
      src/views/usergold/gold/clientCount.vue
  13. 24
      src/views/workspace/index.vue

4
src/components/workspace/GoldGraph.vue

@ -810,10 +810,11 @@ onUnmounted(() => {
.el-select-dropdown__item { .el-select-dropdown__item {
background: #ffffff; background: #ffffff;
} }
/* select hover状态*/ /* select hover状态*/
.el-select-dropdown__item:hover { .el-select-dropdown__item:hover {
border-radius: 8px; border-radius: 8px;
margin-left: 2px;
margin-right: 2px;
background: #E5EBFE; background: #E5EBFE;
height: 32px; height: 32px;
} }
@ -823,6 +824,7 @@ onUnmounted(() => {
color: #2549E0; color: #2549E0;
border-radius: 8px; border-radius: 8px;
} }
/* tabs的样式 */ /* tabs的样式 */
/* 选中 tab 的文字颜色 */ /* 选中 tab 的文字颜色 */
:deep(.el-tabs__item.is-active) { :deep(.el-tabs__item.is-active) {

8
src/components/workspace/GoldManagement.vue

@ -63,7 +63,7 @@
<el-col :span="12"> <el-col :span="12">
<!-- 第二个卡片 --> <!-- 第二个卡片 -->
<div class="card-item-row1"> <div class="card-item-row1">
<div class="card-title">全年累计充值金币数{{ yearlyRecharge / 100 }}</div>
<div class="card-title">全年累计充值金币数{{ yearlyRecharge / 100 }}</div>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<div class="center-card">折合新币累计金额</div> <div class="center-card">折合新币累计金额</div>
@ -85,7 +85,7 @@
<el-col :span="12"> <el-col :span="12">
<!-- 第三个卡片 --> <!-- 第三个卡片 -->
<div class="card-item"> <div class="card-item">
<div class="card-title">全年累计消费金币数{{ yearlyReduce / 100 }}</div>
<div class="card-title">全年累计消费金币数{{ yearlyReduce / 100 }}</div>
<el-row style="height: 200px;"> <el-row style="height: 200px;">
<el-col :span="12"> <el-col :span="12">
<div ref="consumeChart" style="width:100%; height: 68%;"></div> <div ref="consumeChart" style="width:100%; height: 68%;"></div>
@ -98,8 +98,8 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<!-- 第四个卡片 --> <!-- 第四个卡片 -->
<div class="card-item">
<div class="card-title">全年累计充值人头数{{ yearlyRechargeNum }}</div>
<div class="card-item" >
<div class="card-title">全年累计充值人头数{{ yearlyRechargeNum }}</div>
<el-row style="height: 200px;"> <el-row style="height: 200px;">
<el-col :span="12" style="border-right: 2px solid #CFE6FE; height: 150px"> <el-col :span="12" style="border-right: 2px solid #CFE6FE; height: 150px">
<div class="chart5"> <div class="chart5">

39
src/css/btn.css

@ -0,0 +1,39 @@
/*各个页面的按钮激活*/
/*使用示例
import '@/css/btn.css';
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'rechargeAudit' }"
@click="navigateTo('rechargeAudit')"
v-if="hasRecharge"
>
充值审核
</el-button>
*/
/* 默认按钮样式 */
.no-active-btn {
background-color: #E5EBFE; /* 未激活背景色 */
color: #666; /* 未激活文字色 */
/* 确保激活状态下 hover 也不变化 */
&:hover {
background-color: #E5EBFE !important; /* 保持默认背景色 */
color: #666 !important; /* 保持默认文字色 */
border-color: transparent; /* 若有边框,保持默认 */
}
}
/* 激活状态样式 */
.active-btn {
background-color: #2741DE; /* 激活背景色 */
color: white; /* 激活文字色 */
/* 确保激活状态下 hover 也不变化 */
&:hover {
background-color: #2741DE !important;
color: white !important;
border-color: transparent;
}
}

8
src/main.ts

@ -1,4 +1,4 @@
import { createApp } from 'vue'
import {createApp} from 'vue'
import App from './App.vue' import App from './App.vue'
import router from './router' import router from './router'
import ElementPlus from 'element-plus' import ElementPlus from 'element-plus'
@ -7,15 +7,17 @@ import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue' import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './assets/css/common.css' // 引入公共CSS文件 import './assets/css/common.css' // 引入公共CSS文件
import JsonExcel from 'vue-json-excel' import JsonExcel from 'vue-json-excel'
import { createPinia } from 'pinia'
import {createPinia} from 'pinia'
import VxeUI from 'vxe-pc-ui' import VxeUI from 'vxe-pc-ui'
import 'vxe-pc-ui/lib/style.css' import 'vxe-pc-ui/lib/style.css'
import VxeUITable from 'vxe-table' import VxeUITable from 'vxe-table'
import 'vxe-table/lib/style.css' import 'vxe-table/lib/style.css'
// 修正导入路径 // 修正导入路径
import { useAdminStore } from './store'
import {useAdminStore} from './store'
import request from "@/util/request"; import request from "@/util/request";
import "./global.css"; import "./global.css";
import '@/css/btn.css';
const app = createApp(App) const app = createApp(App)
const pinia = createPinia() const pinia = createPinia()

3
src/views/audit/bean/beanAudit.vue

@ -17,8 +17,7 @@
<div class="select"> <div class="select">
<div class="selectRow" style="width: 36vw;"> <div class="selectRow" style="width: 36vw;">
<el-text class="text" size="large" v-show="checkTab === 'pending'">提交时间</el-text> <el-text class="text" size="large" v-show="checkTab === 'pending'">提交时间</el-text>
<el-text size="large" style="width: 25vw;margin-right:1vw"
v-show="checkTab === 'reject' || checkTab === 'pass'">审核时间</el-text>
<el-text class="text" size="large" v-show="checkTab === 'reject' || checkTab === 'pass'">审核时间</el-text>
<el-date-picker v-model="dateRange" type="datetimerange" range-separator="" start-placeholder="开始时间" <el-date-picker v-model="dateRange" type="datetimerange" range-separator="" start-placeholder="开始时间"
end-placeholder="结束时间" style="width: 25vw;margin-right:1vw" @change="handleDatePickerChange" end-placeholder="结束时间" style="width: 25vw;margin-right:1vw" @change="handleDatePickerChange"
:default-time="defaultTime" /> :default-time="defaultTime" />

16
src/views/audit/gold/audit.vue

@ -2,12 +2,20 @@
<div> <div>
<div style="height:4vh;width:82vw;"> <div style="height:4vh;width:82vw;">
<el-button-group> <el-button-group>
<el-button :type="activeTab === 'rechargeAudit' ? 'primary' : 'default'" @click="navigateTo('rechargeAudit')"
v-if="hasRecharge">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'rechargeAudit' }"
@click="navigateTo('rechargeAudit')"
v-if="hasRecharge"
>
充值审核 充值审核
</el-button> </el-button>
<el-button :type="activeTab === 'refundAudit' ? 'primary' : 'default'" @click="navigateTo('refundAudit')"
v-if="hasRefund">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'refundAudit' }"
@click="navigateTo('refundAudit')"
v-if="hasRefund"
>
退款审核 退款审核
</el-button> </el-button>
</el-button-group> </el-button-group>

12
src/views/consume/bean/beanConsume.vue

@ -2,7 +2,8 @@
<div class="father"> <div class="father">
<el-button-group> <el-button-group>
<el-button <el-button
:type="activeTab === 'addBeanConsume' ? 'primary' : 'default'"
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'addBeanConsume' }"
@click="navigateTo('addBeanConsume')" @click="navigateTo('addBeanConsume')"
v-if="hasAdd" v-if="hasAdd"
style="width: 120px;" style="width: 120px;"
@ -10,7 +11,8 @@
新增消耗 新增消耗
</el-button> </el-button>
<el-button <el-button
:type="activeTab === 'liveStream' ? 'primary' : 'default'"
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'liveStream' }"
@click="navigateTo('liveStream')" @click="navigateTo('liveStream')"
v-if="hasLive" v-if="hasLive"
style="width: 120px;" style="width: 120px;"
@ -18,7 +20,8 @@
直播 直播
</el-button> </el-button>
<el-button <el-button
:type="activeTab === 'dieHardFan' ? 'primary' : 'default'"
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'dieHardFan' }"
@click="navigateTo('dieHardFan')" @click="navigateTo('dieHardFan')"
v-if="hasFan" v-if="hasFan"
style="width: 120px;" style="width: 120px;"
@ -26,7 +29,8 @@
铁粉 铁粉
</el-button> </el-button>
<el-button <el-button
:type="activeTab === 'articleVideo' ? 'primary' : 'default'"
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'articleVideo' }"
@click="navigateTo('articleVideo')" @click="navigateTo('articleVideo')"
v-if="hasArticleVideo" v-if="hasArticleVideo"
style="width: 120px;" style="width: 120px;"

20
src/views/consume/gold/coinConsume.vue

@ -2,12 +2,22 @@
<div class="fatherTop"> <div class="fatherTop">
<el-button-group> <el-button-group>
<el-button :type="activeTab === 'coinConsumeDetail' ? 'primary' : 'default'"
@click="navigateTo('coinConsumeDetail')" v-if="hasDetail">
金币消耗明细
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'coinConsumeDetail' }"
@click="navigateTo('coinConsumeDetail')"
v-if="hasDetail"
>
充值审核
</el-button> </el-button>
<el-button :type="activeTab === 'addCoinConsume' ? 'primary' : 'default'" @click="navigateTo('addCoinConsume')"
v-if="hasAdd">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'addCoinConsume' }"
@click="navigateTo('addCoinConsume')"
v-if="hasAdd"
>
新增消耗 新增消耗
</el-button> </el-button>
</el-button-group> </el-button-group>

40
src/views/recharge/bean/beanRecharge.vue

@ -1,35 +1,47 @@
<template> <template>
<div class="father"> <div class="father">
<el-button-group> <el-button-group>
<el-button :type="activeTab === 'addBeanRecharge' ? 'primary' : 'default'" @click="navigateTo('addBeanRecharge')"
v-if="hasAdd" style="width: 6.5vw">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'addBeanRecharge' }"
@click="navigateTo('addBeanRecharge')"
v-if="hasAdd"
style="width: 6.5vw">
新增充值 新增充值
</el-button> </el-button>
<el-button :type="activeTab === 'beanSystemRecharge' ? 'primary' : 'default'"
@click="navigateTo('beanSystemRecharge')" v-if="hasSystem" style="width: 6.5vw;">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'beanSystemRecharge' }"
@click="navigateTo('beanSystemRecharge')"
v-if="hasSystem"
style="width: 6.5vw;">
系统充值 系统充值
</el-button> </el-button>
<el-button :type="activeTab === 'beanOnlineRecharge' ? 'primary' : 'default'"
@click="navigateTo('beanOnlineRecharge')" v-if="hasOnline" style="width: 6.5vw;">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'beanOnlineRecharge' }"
@click="navigateTo('beanOnlineRecharge')"
v-if="hasOnline"
style="width: 6.5vw;">
线上充值 线上充值
</el-button> </el-button>
</el-button-group> </el-button-group>
</div> </div>
<router-view></router-view>
<router-view></router-view>
</template> </template>
<script setup> <script setup>
import { ref, watch, onMounted } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { storeToRefs } from 'pinia';
import { useAdminStore } from '@/store/index.js';
import { hasMenuPermission, permissionMapping } from "@/utils/menuTreePermission.js";
import {ref, watch, onMounted} from 'vue';
import {useRouter, useRoute} from 'vue-router';
import {storeToRefs} from 'pinia';
import {useAdminStore} from '@/store/index.js';
import {hasMenuPermission, permissionMapping} from "@/utils/menuTreePermission.js";
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const adminStore = useAdminStore(); const adminStore = useAdminStore();
const { menuTree } = storeToRefs(adminStore);
const {menuTree} = storeToRefs(adminStore);
const activeTab = ref(''); const activeTab = ref('');
const hasAdd = ref(false); const hasAdd = ref(false);
@ -38,7 +50,7 @@ const hasOnline = ref(false);
// //
const navigateTo = (name) => { const navigateTo = (name) => {
activeTab.value = name; activeTab.value = name;
router.push({ name });
router.push({name});
}; };

29
src/views/recharge/gold/coinRecharge.vue

@ -1,30 +1,35 @@
<template> <template>
<div style="height:4vh;"> <div style="height:4vh;">
<el-button-group> <el-button-group>
<el-button :type="activeTab === 'coinRechargeDetail' ? 'primary' : 'default'"
@click="navigateTo('coinRechargeDetail')" v-if="hasDetail">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'coinRechargeDetail' }"
@click="navigateTo('coinRechargeDetail')"
v-if="hasDetail">
金币充值明细 金币充值明细
</el-button> </el-button>
<el-button :type="activeTab === 'addCoinRecharge' ? 'primary' : 'default'" @click="navigateTo('addCoinRecharge')"
v-if="hasAdd">
<el-button class="no-active-btn"
:class="{ 'active-btn': activeTab === 'addCoinRecharge' }"
@click="navigateTo('addCoinRecharge')"
v-if="hasAdd">
新增充值 新增充值
</el-button> </el-button>
</el-button-group> </el-button-group>
</div> </div>
<router-view></router-view>
<router-view></router-view>
</template> </template>
<script setup> <script setup>
import { onMounted, ref, watch } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { storeToRefs } from "pinia";
import { useAdminStore } from "@/store/index.js";
import { hasMenuPermission, permissionMapping } from "@/utils/menuTreePermission.js";
import {onMounted, ref, watch} from 'vue';
import {useRoute, useRouter} from 'vue-router';
import {storeToRefs} from "pinia";
import {useAdminStore} from "@/store/index.js";
import {hasMenuPermission, permissionMapping} from "@/utils/menuTreePermission.js";
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const adminStore = useAdminStore(); const adminStore = useAdminStore();
const { menuTree } = storeToRefs(adminStore);
const {menuTree} = storeToRefs(adminStore);
const activeTab = ref(''); const activeTab = ref('');
const hasAdd = ref(false); const hasAdd = ref(false);
@ -32,7 +37,7 @@ const hasDetail = ref(false);
// //
const navigateTo = (name) => { const navigateTo = (name) => {
activeTab.value = name; activeTab.value = name;
router.push({ name });
router.push({name});
}; };

16
src/views/refund/gold/coinRefund.vue

@ -2,13 +2,21 @@
<div class="father"> <div class="father">
<!-- 这里放置标签切换的按钮 --> <!-- 这里放置标签切换的按钮 -->
<el-button-group> <el-button-group>
<el-button :type="activeTab === 'coinRefundDetail' ? 'primary' : 'default'"
@click="navigateTo('coinRefundDetail')" :disabled="!hasDetail" v-if="hasDetail">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'coinRefundDetail' }"
@click="navigateTo('coinRefundDetail')"
:disabled="!hasDetail"
v-if="hasDetail">
金币退款明细 金币退款明细
</el-button> </el-button>
<!-- 切换后状态显示 primary 样式否则是默认样式 --> <!-- 切换后状态显示 primary 样式否则是默认样式 -->
<el-button :type="activeTab === 'addCoinRefund' ? 'primary' : 'default'" @click="navigateTo('addCoinRefund')"
:disabled="!hasAdd" v-if="hasAdd">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'addCoinRefund' }"
@click="navigateTo('addCoinRefund')"
:disabled="!hasAdd"
v-if="hasAdd">
新增退款 新增退款
</el-button> </el-button>
</el-button-group> </el-button-group>

19
src/views/usergold/gold/clientCount.vue

@ -4,14 +4,17 @@
<el-button-group> <el-button-group>
<!-- 切换后状态显示 primary 样式否则是默认样式 --> <!-- 切换后状态显示 primary 样式否则是默认样式 -->
<el-button <el-button
:type="activeTab === 'clientCountDetail' ? 'primary' : 'default'"
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'clientCountDetail' }"
@click="navigateTo('clientCountDetail')" @click="navigateTo('clientCountDetail')"
:disabled="!hasDetail" v-if="hasDetail"
:disabled="!hasDetail"
v-if="hasDetail"
> >
金币明细 金币明细
</el-button> </el-button>
<el-button <el-button
:type="activeTab === 'clientCountBalance' ? 'primary' : 'default'"
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'clientCountBalance' }"
@click="navigateTo('clientCountBalance')" @click="navigateTo('clientCountBalance')"
:disabled="!hasBalance" v-if="hasBalance" :disabled="!hasBalance" v-if="hasBalance"
> >
@ -19,8 +22,8 @@
</el-button> </el-button>
</el-button-group> </el-button-group>
<!-- 渲染子路由组件 --> <!-- 渲染子路由组件 -->
</div>
<div>
</div>
<div>
<router-view></router-view> <router-view></router-view>
</div> </div>
</template> </template>
@ -90,8 +93,8 @@ onMounted(() => {
}); });
</script> </script>
<style> <style>
.father{
width:82vw;
height:4vh;
.father {
width: 82vw;
height: 4vh;
} }
</style> </style>

24
src/views/workspace/index.vue

@ -1,16 +1,16 @@
<template> <template>
<!-- 头部 --> <!-- 头部 -->
<el-header class="header">
<div class="title">数据总览</div>
</el-header>
<el-header class="header">
<div class="title">数据总览</div>
</el-header>
<div style="height: 100vh;"> <div style="height: 100vh;">
<el-row class="cards" >
<el-row class="cards">
<el-col :span="14"> <el-col :span="14">
<GoldManagement/> <GoldManagement/>
</el-col> </el-col>
<!-- 右上格子占12列 --> <!-- 右上格子占12列 -->
<el-col :span="10"> <el-col :span="10">
<CashManagement />
<CashManagement/>
</el-col> </el-col>
</el-row> </el-row>
<el-row class="graphs"> <el-row class="graphs">
@ -22,7 +22,7 @@
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from 'vue'
import {ref, onMounted} from 'vue'
import API from '@/util/http' import API from '@/util/http'
import GoldManagement from "@/components/workspace/GoldManagement.vue" import GoldManagement from "@/components/workspace/GoldManagement.vue"
@ -37,10 +37,10 @@ import GoldGraph from "@/components/workspace/GoldGraph.vue"
.header { .header {
/* 将纯色背景替换为线性渐变 */ /* 将纯色背景替换为线性渐变 */
background: linear-gradient( background: linear-gradient(
90deg,
rgba(228, 240, 252, 1) 20%,
rgba(190, 218, 247, 1) 50%,
rgba(228, 240, 252, 1) 100%
90deg,
rgba(228, 240, 252, 1) 20%,
rgba(190, 218, 247, 1) 50%,
rgba(228, 240, 252, 1) 100%
); );
height: 6vh; height: 6vh;
border-radius: 12px; border-radius: 12px;
@ -64,5 +64,7 @@ import GoldGraph from "@/components/workspace/GoldGraph.vue"
text-align: center; text-align: center;
} }
.graphs {
padding-bottom: 10px;
}
</style> </style>
Loading…
Cancel
Save