This commit is contained in:
hrx 2025-11-13 17:41:37 +08:00
parent ddf377b23c
commit 1e7a7e8f57
2 changed files with 40 additions and 6 deletions

View File

@ -94,3 +94,10 @@ export const reqQuickNav = () => {
method: 'post', method: 'post',
}) })
} }
// 待办数量
export const todoCount = () => {
return request({
url: '/bz_order/todo_info.dspy',
method: 'post',
})
}

View File

@ -5,7 +5,6 @@
<div class="bigTitle">快捷导航</div> <div class="bigTitle">快捷导航</div>
<ul class="recUl"> <ul class="recUl">
<li v-for="(item,index) in navList" :key="index" @click="goBaidu(item)"> <li v-for="(item,index) in navList" :key="index" @click="goBaidu(item)">
<!-- 修改这里使用img标签替换i标签 -->
<img :src="getNavIcon(index)" class="nav-icon" alt="icon" /> <img :src="getNavIcon(index)" class="nav-icon" alt="icon" />
{{ item.name }} {{ item.name }}
</li> </li>
@ -71,7 +70,7 @@
<div class="price card"> <div class="price card">
<div class="title">账户余额</div> <div class="title">账户余额</div>
<div class="content"> <div class="content">
<span class="balance">{{ this.mybalance }}</span> <span class="balance">{{ mybalance }}</span>
<el-button size="mini" type="primary" @click="$router.push('/kbossCharge')"> <el-button size="mini" type="primary" @click="$router.push('/kbossCharge')">
立即充值 立即充值
</el-button> </el-button>
@ -105,7 +104,7 @@
<script> <script>
import Vue from 'vue' import Vue from 'vue'
import { mapState } from "vuex"; import { mapState } from "vuex";
import { reqNewHomeResource, reqNewHomeResourceWarning, reqQuickNav } from "@/api/newHome"; import { reqNewHomeResource, reqNewHomeResourceWarning, reqQuickNav, todoCount } from "@/api/newHome";
import { editReachargelogAPI } from "@/api/finance/customerRechargeManagement"; import { editReachargelogAPI } from "@/api/finance/customerRechargeManagement";
import { getUnreadmsgAPI } from "@/api/login"; import { getUnreadmsgAPI } from "@/api/login";
import MessageCenter from '@/components/MessageCenter/MessageCenter.vue'; import MessageCenter from '@/components/MessageCenter/MessageCenter.vue';
@ -113,6 +112,7 @@ import icon1 from '@/assets/image/icon1.png';
import icon2 from '@/assets/image/icon2.png'; import icon2 from '@/assets/image/icon2.png';
import icon3 from '@/assets/image/icon3.png'; import icon3 from '@/assets/image/icon3.png';
import icon4 from '@/assets/image/icon4.png'; import icon4 from '@/assets/image/icon4.png';
export default Vue.extend({ export default Vue.extend({
name: "mainPage", name: "mainPage",
components: { components: {
@ -131,9 +131,9 @@ export default Vue.extend({
navList: [], navList: [],
mybalance: 0, mybalance: 0,
todoList: [ todoList: [
{ name: '待支付', count: 7 }, { name: '待支付', count: 0 },
{ name: '待续费', count: 3 }, { name: '待续费', count: 0 },
{ name: '处理中', count: 7 }, { name: '处理中', count: 0 },
{ name: '站内信', count: 0 } { name: '站内信', count: 0 }
], ],
messageCenterVisible: false, messageCenterVisible: false,
@ -144,6 +144,7 @@ export default Vue.extend({
created() { created() {
this.initMybalance(); this.initMybalance();
this.getUnreadMsgCount(); this.getUnreadMsgCount();
this.fetchTodoCount();
}, },
mounted() { mounted() {
reqQuickNav().then(res => { reqQuickNav().then(res => {
@ -206,6 +207,32 @@ export default Vue.extend({
this.$message.error('获取未读消息失败'); this.$message.error('获取未读消息失败');
} }
}, },
//
async fetchTodoCount() {
try {
const res = await todoCount();
if (res.status && res.data) {
//
this.todoList = this.todoList.map(item => {
switch(item.name) {
case '待支付':
return { ...item, count: res.data.pending_payment_orders || 0 };
case '待续费':
return { ...item, count: res.data.pending_renew_orders || 0 };
case '处理中':
return { ...item, count: res.data.processing_orders || 0 };
default:
return item;
}
});
} else {
this.$message.error(res.msg || '获取待办事项数量失败');
}
} catch (error) {
console.error('获取待办事项数量失败:', error);
this.$message.error('获取待办事项数量失败');
}
},
handleTodoClick(todoName) { handleTodoClick(todoName) {
if (todoName === '站内信') { if (todoName === '站内信') {
this.openMessageCenter(); this.openMessageCenter();