This commit is contained in:
hrx 2025-10-21 16:48:15 +08:00
parent 834c11882c
commit c1f987c145
4 changed files with 130 additions and 66 deletions

View File

@ -345,7 +345,7 @@ export const asyncRoutes = [
name: 'BaiduOrder', name: 'BaiduOrder',
meta: { meta: {
title: "百度订单", title: "百度订单",
fullPath: "/orderManagement/baidu", fullPath: "/product/overview",
noCache: true noCache: true
} }
} }

View File

@ -2,6 +2,8 @@
<div class="orderManagement"> <div class="orderManagement">
<!-- 移动端搜索框 --> <!-- 移动端搜索框 -->
<el-card class="mobileCaed" v-if="isMobile"> <el-card class="mobileCaed" v-if="isMobile">
<!-- 已移除路由参数提示 -->
<el-row :span="24"> <el-row :span="24">
<el-col :span="24" class="search"> <el-col :span="24" class="search">
<el-select v-model="select" filterable @change="selectSearch" class="searchSelect" placeholder="请选择" <el-select v-model="select" filterable @change="selectSearch" class="searchSelect" placeholder="请选择"
@ -81,6 +83,8 @@
<!-- PC端头部 --> <!-- PC端头部 -->
<el-card class="pcCard" v-else> <el-card class="pcCard" v-else>
<!-- 已移除路由参数提示 -->
<!-- --> <!-- -->
<div class="top"> <div class="top">
<div class="header-container"> <div class="header-container">
@ -295,6 +299,9 @@ export default {
userId: sessionStorage.getItem("userId"), userId: sessionStorage.getItem("userId"),
dialogVisible: false, dialogVisible: false,
//
activeFilterType: null,
// //
businessOpFilter: null, businessOpFilter: null,
// //
@ -331,25 +338,69 @@ export default {
computed: { computed: {
// //
hasActiveFilters() { hasActiveFilters() {
return this.businessOpFilter || this.orderStatusFilter; return this.businessOpFilter || this.orderStatusFilter || this.activeFilterType;
} }
}, },
created() { created() {
this.getOrder();
this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.userAgent); this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.userAgent);
this.initFromRouteQuery();
},
watch: {
//
'$route'(to, from) {
this.initFromRouteQuery();
}
}, },
methods: { methods: {
//
initFromRouteQuery() {
const query = this.$route.query;
console.log('路由参数:', query);
if (query.filterType) {
this.activeFilterType = query.filterType;
//
switch(query.filterType) {
case 'pendingPayment':
//
this.orderStatusFilter = '0';
this.businessOpFilter = 'RENEW';
break;
case 'pendingRenewal':
//
this.businessOpFilter = 'RENEW';
this.orderStatusFilter = null;
break;
case 'processing':
//
this.orderStatusFilter = '0';
this.businessOpFilter = null;
break;
}
//
this.value1 = null;
this.searchValue = null;
this.select = null;
this.pagination.page = 1;
this.getOrder();
} else {
// 使
this.pagination.page = 1;
this.getOrder();
}
},
// XXXX-XX-XX // XXXX-XX-XX
formatOrderDate(dateString) { formatOrderDate(dateString) {
if (!dateString) return '-'; if (!dateString) return '-';
try { try {
//
const date = new Date(dateString); const date = new Date(dateString);
if (isNaN(date.getTime())) { if (isNaN(date.getTime())) {
// Date
if (typeof dateString === 'string') { if (typeof dateString === 'string') {
//
const datePart = dateString.split(' ')[0]; const datePart = dateString.split(' ')[0];
const parts = datePart.split('-'); const parts = datePart.split('-');
if (parts.length === 3) { if (parts.length === 3) {
@ -359,17 +410,16 @@ export default {
return `${year}-${month}-${day}`; return `${year}-${month}-${day}`;
} }
} }
return dateString; // return dateString;
} }
//
const year = date.getFullYear().toString(); const year = date.getFullYear().toString();
const month = (date.getMonth() + 1).toString().padStart(2, '0'); const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0'); const day = date.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`; return `${year}-${month}-${day}`;
} catch (error) { } catch (error) {
console.error('日期格式化错误:', error, dateString); console.error('日期格式化错误:', error, dateString);
return dateString; // return dateString;
} }
}, },
@ -405,8 +455,8 @@ export default {
// //
handleBusinessOpFilter(type) { handleBusinessOpFilter(type) {
console.log("订单类型筛选:", type, this.getOrderTypeConfig(type).text); console.log("订单类型筛选:", type, this.getOrderTypeConfig(type).text);
this.activeFilterType = null;
//
if (this.businessOpFilter === type) { if (this.businessOpFilter === type) {
this.businessOpFilter = null; this.businessOpFilter = null;
} else { } else {
@ -419,6 +469,7 @@ export default {
// //
clearBusinessOpFilter() { clearBusinessOpFilter() {
this.businessOpFilter = null; this.businessOpFilter = null;
this.activeFilterType = null;
this.pagination.page = 1; this.pagination.page = 1;
this.getOrder(); this.getOrder();
}, },
@ -426,8 +477,8 @@ export default {
// //
handleOrderStatusFilter(status) { handleOrderStatusFilter(status) {
console.log("订单状态筛选:", status, this.getOrderStatusText(status)); console.log("订单状态筛选:", status, this.getOrderStatusText(status));
this.activeFilterType = null;
//
if (this.orderStatusFilter === status) { if (this.orderStatusFilter === status) {
this.orderStatusFilter = null; this.orderStatusFilter = null;
} else { } else {
@ -440,6 +491,7 @@ export default {
// //
clearOrderStatusFilter() { clearOrderStatusFilter() {
this.orderStatusFilter = null; this.orderStatusFilter = null;
this.activeFilterType = null;
this.pagination.page = 1; this.pagination.page = 1;
this.getOrder(); this.getOrder();
}, },
@ -451,8 +503,12 @@ export default {
this.select = null; this.select = null;
this.businessOpFilter = null; this.businessOpFilter = null;
this.orderStatusFilter = null; this.orderStatusFilter = null;
this.activeFilterType = null;
this.pagination.page = 1; this.pagination.page = 1;
this.getOrder(); this.getOrder();
//
this.$router.replace({ path: '/product/overview', query: {} });
}, },
// //
@ -460,7 +516,7 @@ export default {
let params = { let params = {
page: this.pagination.page, page: this.pagination.page,
size: this.pagination.size, size: this.pagination.size,
type: '200' // type type: '200'
}; };
// //
@ -544,6 +600,7 @@ export default {
selectSearch(e) { selectSearch(e) {
this.select = e; this.select = e;
this.activeFilterType = null;
// //
if (['0', '1', '3'].includes(e)) { if (['0', '1', '3'].includes(e)) {
this.getOrder(); this.getOrder();
@ -560,6 +617,7 @@ export default {
input(e) { input(e) {
this.searchValue = e; this.searchValue = e;
this.activeFilterType = null;
this.pagination.page = 1; this.pagination.page = 1;
this.getOrder(); this.getOrder();
}, },
@ -663,6 +721,7 @@ export default {
// PC // PC
.pcCard { .pcCard {
margin-bottom: 10px; margin-bottom: 10px;
.btm{ .btm{
display: flex; display: flex;
margin-top: 10px; margin-top: 10px;
@ -708,7 +767,6 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
// height: 60px;
flex-wrap: wrap; flex-wrap: wrap;
.search-group { .search-group {
@ -804,11 +862,11 @@ export default {
::v-deep .el-table { ::v-deep .el-table {
.el-table__row { .el-table__row {
width: 100%; width: 100%;
height: 56px; // height: 56px;
} }
.el-table__cell { .el-table__cell {
padding: 12px 0; // padding: 12px 0;
} }
.cell-content { .cell-content {
@ -821,7 +879,6 @@ export default {
.el-button { .el-button {
height: 32px; height: 32px;
// line-height: 32px;
} }
} }

View File

@ -25,7 +25,6 @@
<div class="section"> <div class="section">
<div class="bigTitle">到期预警</div> <div class="bigTitle">到期预警</div>
<!-- 表格容器用于控制宽度和溢出 -->
<div class="table-container"> <div class="table-container">
<el-table <el-table
height="250px" height="250px"
@ -54,7 +53,6 @@
</div> </div>
<div class="rightBox"> <div class="rightBox">
<!-- 用户信息 -->
<div class="user card"> <div class="user card">
<div class="userImg"> <div class="userImg">
<div class="imgUser">{{ userInfo.username.charAt(0) }}</div> <div class="imgUser">{{ userInfo.username.charAt(0) }}</div>
@ -79,7 +77,6 @@
</div> </div>
</div> </div>
<!-- 待办事项组件 -->
<div class="todos card"> <div class="todos card">
<div class="title">待办事项</div> <div class="title">待办事项</div>
<ul class="todo-list"> <ul class="todo-list">
@ -96,7 +93,6 @@
</div> </div>
</div> </div>
<!-- 消息中心弹窗 -->
<MessageCenter <MessageCenter
ref="messageCenter" ref="messageCenter"
:visible.sync="messageCenterVisible" :visible.sync="messageCenterVisible"
@ -110,8 +106,8 @@ import Vue from 'vue'
import { mapState } from "vuex"; import { mapState } from "vuex";
import { reqNewHomeResource, reqNewHomeResourceWarning, reqQuickNav } from "@/api/newHome"; import { reqNewHomeResource, reqNewHomeResourceWarning, reqQuickNav } from "@/api/newHome";
import { editReachargelogAPI } from "@/api/finance/customerRechargeManagement"; import { editReachargelogAPI } from "@/api/finance/customerRechargeManagement";
import { getUnreadmsgAPI } from "@/api/login"; // API import { getUnreadmsgAPI } from "@/api/login";
import MessageCenter from '@/components/MessageCenter/MessageCenter.vue'; // import MessageCenter from '@/components/MessageCenter/MessageCenter.vue';
export default Vue.extend({ export default Vue.extend({
name: "mainPage", name: "mainPage",
@ -129,19 +125,19 @@ export default Vue.extend({
}, },
viewList: [], viewList: [],
navList: [], navList: [],
mybalance: 0, // mybalance: 0,
todoList: [ todoList: [
{ name: '待支付', count: 1 }, { name: '待支付', count: 7 },
{ name: '待续费', count: 2 }, { name: '待续费', count: 3 },
{ name: '处理中', count: 2 }, { name: '处理中', count: 7 },
{ name: '站内信', count: 0 } // 0API { name: '站内信', count: 0 }
], ],
messageCenterVisible: false // messageCenterVisible: false
} }
}, },
created() { created() {
this.initMybalance(); this.initMybalance();
this.getUnreadMsgCount(); // this.getUnreadMsgCount();
}, },
mounted() { mounted() {
reqQuickNav().then(res => { reqQuickNav().then(res => {
@ -182,12 +178,10 @@ export default Vue.extend({
this.mybalance = res.data this.mybalance = res.data
} }
}, },
//
async getUnreadMsgCount() { async getUnreadMsgCount() {
try { try {
const res = await getUnreadmsgAPI(); const res = await getUnreadmsgAPI();
if (res.status) { if (res.status) {
//
const messageItem = this.todoList.find(item => item.name === '站内信'); const messageItem = this.todoList.find(item => item.name === '站内信');
if (messageItem) { if (messageItem) {
messageItem.count = res.data || 0; messageItem.count = res.data || 0;
@ -200,24 +194,45 @@ export default Vue.extend({
this.$message.error('获取未读消息失败'); this.$message.error('获取未读消息失败');
} }
}, },
//
handleTodoClick(todoName) { handleTodoClick(todoName) {
//
if (todoName === '站内信') { if (todoName === '站内信') {
//
this.openMessageCenter(); this.openMessageCenter();
} else { } else {
// let query = {};
this.$router.push('/product/overview');
switch(todoName) {
case '待支付':
//
query = {
filterType: 'processing' // 使
};
break;
case '待续费':
//
query = {
filterType: 'pendingPayment'
};
break;
case '处理中':
//
query = {
filterType: 'processing'
};
break;
}
console.log(`跳转到资源概览,筛选类型: ${todoName}`, query);
this.$router.push({
path: '/product/overview',
query: query
});
} }
}, },
//
openMessageCenter() { openMessageCenter() {
this.messageCenterVisible = true; this.messageCenterVisible = true;
}, },
//
handleUnreadCountUpdate(count) { handleUnreadCountUpdate(count) {
//
const messageItem = this.todoList.find(item => item.name === '站内信'); const messageItem = this.todoList.find(item => item.name === '站内信');
if (messageItem) { if (messageItem) {
messageItem.count = count || 0; messageItem.count = count || 0;
@ -233,71 +248,63 @@ export default Vue.extend({
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/* 样式保持不变,与之前相同 */
.mainBox { .mainBox {
background: #f5f7fa; background: #f5f7fa;
width: 100%; width: 100%;
/* 使用视口高度减去一个固定值来适应不同屏幕 */ height: calc(100vh - 100px);
height: calc(100vh - 100px); /* 假设顶部导航栏等占 100px */
display: flex; display: flex;
padding: 10px; padding: 10px;
padding-bottom: 20px; padding-bottom: 20px;
box-sizing: border-box; box-sizing: border-box;
gap: 20px; gap: 20px;
/* 移除 overflow-x: auto; 防止出现横向滚动条 */
overflow-y: auto; overflow-y: auto;
/* 确保主容器不产生横向溢出 */
overflow-x: hidden; overflow-x: hidden;
} }
.leftBox { .leftBox {
/* 使用百分比宽度,更适应容器 */
width: 65%; width: 65%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 20px; gap: 20px;
min-width: 0; /* 防止 flex 项目溢出 */ min-width: 0;
.section { .section {
background: white; background: white;
border-radius: 10px; border-radius: 10px;
padding: 20px; padding: 20px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
/* 移除 flex-shrink: 0; 允许在必要时轻微收缩 */
} }
} }
.rightBox { .rightBox {
/* 使用百分比宽度 */
width: 35%; width: 35%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 20px; gap: 20px;
min-width: 0; /* 防止 flex 项目溢出 */ min-width: 0;
.card { .card {
background: white; background: white;
border-radius: 10px; border-radius: 10px;
padding: 20px; padding: 20px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
/* 移除 flex-shrink: 0; 允许在必要时轻微收缩 */
} }
} }
/* 表格容器样式,用于处理内部可能的溢出 */
.table-container { .table-container {
width: 100%; width: 100%;
overflow-x: auto; /* 表格内部可能出现滚动条 */ overflow-x: auto;
border-radius: 4px; /* 与表格圆角匹配 */ border-radius: 4px;
} }
/* 表格样式微调确保宽度100% */
.table-container ::v-deep .el-table { .table-container ::v-deep .el-table {
width: 100% !important; width: 100% !important;
} }
.recUl { .recUl {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* 使用 auto-fit 和 minmax 实现更好的自适应 */ grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 15px; gap: 15px;
list-style: none; list-style: none;
padding: 0; padding: 0;
@ -314,7 +321,7 @@ export default Vue.extend({
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
min-width: 0; /* 防止内部内容撑开 */ min-width: 0;
i { i {
font-size: 24px; font-size: 24px;
@ -331,8 +338,7 @@ export default Vue.extend({
} }
.overView { .overView {
/* 覆盖默认的 grid-template-columns */ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* 资源概览项更宽 */
li { li {
cursor: default; cursor: default;
@ -347,7 +353,7 @@ export default Vue.extend({
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
width: 100%; width: 100%;
min-width: 0; /* 防止内部内容撑开 */ min-width: 0;
.title { .title {
font-size: 16px; font-size: 16px;
@ -382,7 +388,7 @@ export default Vue.extend({
.userImg { .userImg {
margin-right: 20px; margin-right: 20px;
flex-shrink: 0; /* 防止头像被压缩 */ flex-shrink: 0;
.imgUser { .imgUser {
width: 80px; width: 80px;
@ -399,8 +405,8 @@ export default Vue.extend({
} }
.userBox { .userBox {
flex: 1; /* 占据剩余空间 */ flex: 1;
min-width: 0; /* 防止内容溢出 */ min-width: 0;
h3 { h3 {
margin-top: 0; margin-top: 0;
@ -434,7 +440,7 @@ export default Vue.extend({
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
flex-wrap: wrap; /* 在小屏幕上换行 */ flex-wrap: wrap;
.balance { .balance {
font-size: 28px; font-size: 28px;
@ -444,8 +450,10 @@ export default Vue.extend({
} }
} }
/* 待办事项样式 */
.todos { .todos {
.title {
margin-bottom: 15px;
}
.todo-list { .todo-list {
list-style: none; list-style: none;
padding: 0; padding: 0;
@ -505,12 +513,11 @@ export default Vue.extend({
text-overflow: ellipsis; text-overflow: ellipsis;
} }
/* 响应式调整 */
@media (max-width: 768px) { @media (max-width: 768px) {
.mainBox { .mainBox {
flex-direction: column; flex-direction: column;
height: auto; height: auto;
overflow-x: hidden; /* 小屏幕也隐藏横向滚动 */ overflow-x: hidden;
} }
.leftBox, .rightBox { .leftBox, .rightBox {