This commit is contained in:
BAKEYi 2026-05-22 15:51:48 +08:00
parent af91692ba6
commit c2978b30db
1 changed files with 171 additions and 48 deletions

View File

@ -18,7 +18,7 @@
</view>
<view class="quick-actions card-box" v-if="isLogin && isSettled">
<view class="action-item" v-for="(item, index) in quickActions" :key="index">
<view class="action-item" v-for="(item, index) in quickActions" :key="index" @tap="handleQuickAction(item)">
<image class="action-icon" :src="item.icon"></image>
<text class="action-text">{{ item.name }}</text>
</view>
@ -29,7 +29,7 @@
<view class="header-left">
<text class="title">接单管理</text>
<text class="update-time">更新时间{{ orderBasic.updateTime }}</text>
<image class="refresh-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/31c6eebc-5538-4c66-9b32-24dced170a99.png"></image>
<image class="refresh-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/31c6eebc-5538-4c66-9b32-24dced170a99.png" @tap="fetchOrderNum"></image>
</view>
<view class="header-right">更多数据 <image class="more-right-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/ee119e24-1cb2-43df-86e6-61af8e9fd0ad.png"></image></view>
</view>
@ -54,7 +54,7 @@
<view class="header-left">
<text class="title">当日实时数据</text>
<text class="update-time">更新时间{{ orderDetail.updateTime }}</text>
<image class="refresh-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/31c6eebc-5538-4c66-9b32-24dced170a99.png"></image>
<image class="refresh-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/31c6eebc-5538-4c66-9b32-24dced170a99.png" @tap="fetchRealTimeData"></image>
</view>
</view>
<view class="detail-content">
@ -177,38 +177,26 @@ export default {
displayScore: 0,
animationTimer: null,
// 6
//
noticeList: [
{ id: 1, title: '商家券更新了!品牌专区上新了!', url: '/pages/...' },
{ id: 2, title: '系统维护通知:今晚凌晨将进行升级', url: '/pages/...' },
{ id: 3, title: '平台新政策发布,请及时查看', url: '/pages/...' }
{ id: 0, title: '暂无最新公告', url: '' }
],
quickActions: [
{ name: '扫码验券', icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/b128e423-e4b5-4ad6-bdf5-522de7a9bc68.png' },
{ name: '服务管理', icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/a90f02a2-9d39-440a-ad20-a4337bcd1b38.png' },
{ name: '工位管理', icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/4c503603-6c2f-4a7a-9329-5e54b8ca769e.png' },
{ name: '财务管理', icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/728c659e-e395-4473-b83e-7e04539f7ec6.png' }
{ name: '扫码验券', icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/b128e423-e4b5-4ad6-bdf5-522de7a9bc68.png' , path: 'scan'},
{ name: '服务管理', icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/a90f02a2-9d39-440a-ad20-a4337bcd1b38.png' , path: '/pages/artisan/service-list'},
{ name: '工位管理', icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/4c503603-6c2f-4a7a-9329-5e54b8ca769e.png' , path: '/pages/shop/workSpace/list'},
{ name: '财务管理', icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/728c659e-e395-4473-b83e-7e04539f7ec6.png' , path: '/pages/wallet/wallet'}
],
orderBasic: { updateTime: '15:30', waitStart: 23, waitFinish: 43, finished: 234 },
orderDetail: { updateTime: '15:30', score: '82.2', visitors: 0, yVisitors: 100, orders: 234, yOrders: 1000, amount: '1.34', yAmount: '1.4' },
orderBasic: { updateTime: '--:--', waitStart: 0, waitFinish: 0, finished: 0 },
orderDetail: { updateTime: '--:--', score: '0.0', visitors: 0, yVisitors: 0, orders: 0, yOrders: 0, amount: '0.00', yAmount: '0.00' },
brands: [
{ name: '蜜丝卡伦美甲美睫', bgSrc: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/d02b2d8b-0e01-4c6d-bbee-c60dccf4867c.jpg', avatar: 'https://dummyimage.com/100x100/ccc/fff.png&text=Avatar', tagKeys: ['franchise', 'recruit'] },
{ name: 'ALNL 清莲爱丽', bgSrc: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/d02b2d8b-0e01-4c6d-bbee-c60dccf4867c.jpg', avatar: 'https://dummyimage.com/100x100/ccc/fff.png&text=Avatar', tagKeys: ['recruit'] },
{ name: 'IL COLPO依宝美容', bgSrc: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/d02b2d8b-0e01-4c6d-bbee-c60dccf4867c.jpg', avatar: 'https://dummyimage.com/100x100/ccc/fff.png&text=Avatar', tagKeys: ['franchise'] },
{ name: '蜜丝卡伦美甲美睫', bgSrc: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/d02b2d8b-0e01-4c6d-bbee-c60dccf4867c.jpg', avatar: 'https://dummyimage.com/100x100/ccc/fff.png&text=Avatar', tagKeys: ['more'] }
],
skills: [
{ title: '穿戴甲的操作视频扫码验券操作123564798', type: '平台课程', views: '83.6万', time: '7小时前', coverSrc: 'https://dummyimage.com/200x150/ccc/fff.png&text=Video' },
{ title: '脸部按摩操作步骤详情', type: '脸缘品牌', views: '8334', time: '1天前', coverSrc: 'https://dummyimage.com/200x150/ccc/fff.png&text=Video' },
{ title: '全身SPA的操作视频操作教程', type: '平台课程', views: '2344', time: '3天前', coverSrc: 'https://dummyimage.com/200x150/ccc/fff.png&text=Video' },
{ title: '穿戴甲的操作视频扫码验券操作...', type: '平台课程', views: '836', time: '4月26日', coverSrc: 'https://dummyimage.com/200x150/ccc/fff.png&text=Video' }
]
brands: [],
skills: []
};
},
computed: {
//
// 💡
// (0: , -1: , >0: ) 0
isSettled() {
if (!this.isLogin || !this.userInfo) return false;
@ -251,18 +239,18 @@ export default {
}
},
onShow() {
//
// 1.0
this.isLogin = uni.getStorageSync("accessToken") ? true : false;
if (this.isLogin) {
this.getUserInfo();
}
//
this.fetchNoticeList();
this.fetchBrandList();
this.fetchSkillList();
},
onLoad() {
uni.hideTabBar();
this.getNoticeList(); //
},
mounted() {
this.animateScore();
},
watch: {
'orderDetail.score'() {
@ -270,28 +258,160 @@ export default {
}
},
methods: {
// ()
handleQuickAction(item) {
if (item.name === '扫码验券') {
uni.scanCode({
success: (res) => {
const code = res.result;
if (code) {
uni.showLoading({ title: '查询订单中...' });
request.post('/sj/poster/getOrderByCode', { server_code: code }).then(result => {
uni.hideLoading();
if (result.code === 200 && result.data) {
// TODO: (result.data)
// : request.post('/sj/poster/useOrderServerCode', { id: result.data.order_id, order_type: result.data.order_type, server_code: code })
uni.showToast({ title: '获取订单成功', icon: 'success' });
} else {
uni.showToast({ title: result.msg || '未找到该订单', icon: 'none' });
}
}).catch(() => {
uni.hideLoading();
uni.showToast({ title: '网络异常', icon: 'none' });
});
}
}
});
} // 2.
else if (item.path) {
uni.navigateTo({
url: item.path,
fail: () => {
uni.showToast({ title: '页面开发中...', icon: 'none' });
}
});
}
},
// ( HH:mm)
formatTime(dateTimeStr) {
if (!dateTimeStr) return '--:--';
const arr = dateTimeStr.split(' ');
if (arr.length > 1) {
return arr[1].substring(0, 5); // HH:mm
}
return dateTimeStr;
},
getUserInfo() {
request.post("/sj/user/getUser").then((result) => {
this.userInfo = result.data;
uni.setStorageSync("syrId", result.data.id);
this.syrId = result.data.id;
if(result.code === 200 && result.data) {
this.userInfo = result.data;
uni.setStorageSync("syrId", result.data.id);
this.syrId = result.data.id;
//
this.initStoreStatus();
//
this.initStoreStatus();
//
if (this.isSettled) {
this.fetchOrderNum();
this.fetchRealTimeData();
}
}
});
},
// 6
getNoticeList() {
// request.post('/api/notice/getLatest', { role: 'merchant', limit: 6 }).then(res => {
// this.noticeList = res.data;
// })
//
fetchOrderNum() {
request.post("/sj/poster/orderNum").then(res => {
if(res.code === 200 && res.data) {
this.orderBasic = {
updateTime: this.formatTime(res.data.now_date),
waitStart: res.data.dfw || 0,
waitFinish: res.data.dwc || 0,
finished: res.data.yqx || 0 // dfw, dwc, yqx()yqx
};
}
});
},
//
fetchRealTimeData() {
request.post("/sj/poster/realTimeData").then(res => {
if(res.code === 200 && res.data) {
const today = res.data.today || {};
const yesterday = res.data.yesterday || {};
this.orderDetail = {
updateTime: this.formatTime(res.data.now_date),
score: today.rating_num || 0,
visitors: today.visitor_num || 0,
yVisitors: yesterday.visitor_num || 0,
orders: today.place_order || 0,
yOrders: yesterday.place_order || 0,
amount: today.deal_money || 0,
yAmount: yesterday.deal_money || 0
};
}
});
},
//
fetchNoticeList() {
request.post('/sj/notice/list', { page: 1, limit: 6 }).then(res => {
if(res.code === 200 && res.data && res.data.list.length > 0) {
this.noticeList = res.data.list;
}
});
},
//
fetchBrandList() {
// 4
request.post('/sj/brand/list', { page: 1, limit: 4 }).then(res => {
if(res.code === 200 && res.data && res.data.list) {
this.brands = res.data.list.map(item => {
let tags = [];
//
if (item.franchise_state === 1) tags.push('franchise');
if (item.student_state === 1) tags.push('recruit');
if (tags.length === 0) tags.push('more');
return {
id: item.id,
name: item.name,
bgSrc: item.cover_img || 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/d02b2d8b-0e01-4c6d-bbee-c60dccf4867c.jpg',
avatar: item.logo_img || 'https://dummyimage.com/100x100/ccc/fff.png&text=Avatar',
tagKeys: tags
};
});
}
});
},
//
fetchSkillList() {
request.post('/sj/skill/list', { page: 1, limit: 4 }).then(res => {
if(res.code === 200 && res.data && res.data.list) {
this.skills = res.data.list.map(item => {
return {
id: item.id,
title: item.name,
type: item.link_name || '平台课程',
views: item.browse_num || 0,
time: item.create_time ? item.create_time.split(' ')[0] : '', //
coverSrc: item.cover_img || 'https://dummyimage.com/200x150/ccc/fff.png&text=Video'
};
});
}
});
},
//
// 💡
goToNotice(msg) {
if(msg.url) {
uni.navigateTo({ url: msg.url });
if(msg.id) {
uni.navigateTo({ url: `/pages/notice/detail?id=${msg.id}` });
}
},
@ -316,7 +436,7 @@ export default {
}
},
// /
// 💡 /
toggleStatus() {
// 1 (id_type == -1)
if (!this.isCertified) {
@ -345,8 +465,11 @@ export default {
// 3
if (this.isCertified && this.hasBusinessTime) {
this.isOpenStore = !this.isOpenStore;
//
// request.post('/api/store/toggleStatus', { status: this.isOpenStore ? 1 : 0 });
//
const newState = this.isOpenStore ? 1 : 0;
// request.post('/api/store/toggleStatus', { self_state: newState }).then(() => {
// uni.showToast({ title: this.isOpenStore ? '' : '', icon: 'none' });
// });
}
},
@ -591,7 +714,7 @@ export default {
.guide-btn {
width: 534rpx;
height: 70rpx;
border-radius: 55rpx;
border-radius: 35rpx;
border: 1rpx solid #FF4767;
color: #FF4767;