main #34

Merged
charles merged 191 commits from main into prod 2025-11-19 16:18:39 +08:00
2 changed files with 40 additions and 6 deletions
Showing only changes of commit 1e7a7e8f57 - Show all commits

View File

@ -94,3 +94,10 @@ export const reqQuickNav = () => {
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>
<ul class="recUl">
<li v-for="(item,index) in navList" :key="index" @click="goBaidu(item)">
<!-- 修改这里使用img标签替换i标签 -->
<img :src="getNavIcon(index)" class="nav-icon" alt="icon" />
{{ item.name }}
</li>
@ -71,7 +70,7 @@
<div class="price card">
<div class="title">账户余额</div>
<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>
@ -105,7 +104,7 @@
<script>
import Vue from 'vue'
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 { getUnreadmsgAPI } from "@/api/login";
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 icon3 from '@/assets/image/icon3.png';
import icon4 from '@/assets/image/icon4.png';
export default Vue.extend({
name: "mainPage",
components: {
@ -131,9 +131,9 @@ export default Vue.extend({
navList: [],
mybalance: 0,
todoList: [
{ name: '待支付', count: 7 },
{ name: '待续费', count: 3 },
{ name: '处理中', count: 7 },
{ name: '待支付', count: 0 },
{ name: '待续费', count: 0 },
{ name: '处理中', count: 0 },
{ name: '站内信', count: 0 }
],
messageCenterVisible: false,
@ -144,6 +144,7 @@ export default Vue.extend({
created() {
this.initMybalance();
this.getUnreadMsgCount();
this.fetchTodoCount();
},
mounted() {
reqQuickNav().then(res => {
@ -206,6 +207,32 @@ export default Vue.extend({
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) {
if (todoName === '站内信') {
this.openMessageCenter();