diff --git a/app.json b/app.json
index 225097d..1ed971e 100644
--- a/app.json
+++ b/app.json
@@ -1,107 +1,110 @@
-{
- "pages": [
- "pages/index/index",
- "pages/category/category",
- "pages/pick-user/pick-user",
- "pages/messages/messages",
- "pages/mine/mine",
- "pages/product-detail/product-detail",
- "pages/submit/submit",
- "pages/edit/edit",
- "pages/fighter/fighter",
- "pages/merchant/merchant",
- "pages/manager/manager",
- "pages/orders/orders",
- "pages/order-detail/order-detail",
- "pages/fighter-rules/fighter-rules",
- "pages/fighter-edit/fighter-edit",
- "pages/fighter-rank/fighter-rank",
- "pages/fighter-recharge/fighter-recharge",
- "pages/fighter-msg/fighter-msg",
- "pages/fighter-orders/fighter-orders",
- "pages/accept-order/accept-order",
- "pages/withdraw/withdraw",
- "pages/invite-fighter/invite-fighter",
- "pages/my-fighter/my-fighter",
- "pages/recharge-log/recharge-log",
- "pages/manager-rank/manager-rank",
- "pages/merchant-dispatch/merchant-dispatch",
- "pages/merchant-orders/merchant-orders",
- "pages/merchant-msg/merchant-msg",
- "pages/merchant-rank/merchant-rank",
- "pages/merchant-recharge/merchant-recharge",
- "pages/merchant-order-detail/merchant-order-detail",
- "pages/fighter-order-detail/fighter-order-detail",
- "pages/chat/chat",
- "pages/express-order/express-order",
- "pages/order-pool/order-pool",
- "pages/poster/poster",
- "pages/gold-fighter/gold-fighter",
- "pages/leader/leader",
- "pages/manager-assign/manager-assign",
- "pages/leader-bonus-log/leader-bonus-log",
- "pages/invite-manager/invite-manager",
- "pages/order-pool2/order-pool2",
- "pages/group-chat/group-chat",
- "pages/cs-chat/cs-chat",
- "pages/verify/verify",
- "components/global-notification/global-notification",
- "components/popup-notice/popup-notice",
- "components/order-card/order-card",
- "components/order-sender/order-sender",
- "pages/penalty/penalty/penalty",
- "pages/penalty/components/fakuan-list/fakuan-list",
- "pages/penalty/components/jifen-list/jifen-list",
- "pages/penalty/components/fakuan-pay/fakuan-pay",
- "pages/phone-auth/phone-auth",
- "components/chenghao-tag/chenghao-tag",
- "pages/assessor/assessor",
- "pages/assess-score/assess-score",
- "pages/assess-log/assess-log",
- "pages/assess-center/assess-center",
- "pages/assess-gold/assess-gold",
- "pages/escort-orders/escort-orders",
- "pages/withdraw/components/mode1/mode1",
- "pages/withdraw/components/mode2/mode2"
-
-
- ],
-
- "usingComponents": {
- "popup-notice": "/components/popup-notice/popup-notice",
- "tab-bar": "/tab-bar/index"
- },
-
- "window": {
- "navigationBarTextStyle": "black",
- "navigationStyle": "default",
- "backgroundTextStyle": "light",
- "navigationBarBackgroundColor": "#fff",
- "navigationBarTitleText": "星阙网络"
- },
- "tabBar": {
- "custom": true,
- "list": [
-
-
- {
- "pagePath": "pages/order-pool/order-pool",
- "text": "接单池",
- "iconPath": "/images/order-pool.png",
- "selectedIconPath": "/images/order-pool.png"
- },
- {
- "pagePath": "pages/order-pool2/order-pool2",
- "text": "接单池",
- "iconPath": "/images/order-pool.png",
- "selectedIconPath": "/images/order-pool.png"
- }
-
- ]
- },
-
-
- "style": "v2",
- "sitemapLocation": "sitemap.json",
- "lazyCodeLoading": "requiredComponents"
+{
+ "pages": [
+ "pages/index/index",
+ "pages/category/category",
+ "pages/pick-user/pick-user",
+ "pages/messages/messages",
+ "pages/mine/mine",
+ "pages/product-detail/product-detail",
+ "pages/submit/submit",
+ "pages/edit/edit",
+ "pages/fighter/fighter",
+ "pages/merchant/merchant",
+ "pages/merchant-home/merchant-home",
+ "pages/merchant-kefu-key/merchant-kefu-key",
+ "pages/merchant-kefu-list/merchant-kefu-list",
+ "pages/manager/manager",
+ "pages/orders/orders",
+ "pages/order-detail/order-detail",
+ "pages/fighter-rules/fighter-rules",
+ "pages/fighter-edit/fighter-edit",
+ "pages/fighter-rank/fighter-rank",
+ "pages/fighter-recharge/fighter-recharge",
+ "pages/fighter-msg/fighter-msg",
+ "pages/fighter-orders/fighter-orders",
+ "pages/accept-order/accept-order",
+ "pages/withdraw/withdraw",
+ "pages/invite-fighter/invite-fighter",
+ "pages/my-fighter/my-fighter",
+ "pages/recharge-log/recharge-log",
+ "pages/manager-rank/manager-rank",
+ "pages/merchant-dispatch/merchant-dispatch",
+ "pages/merchant-orders/merchant-orders",
+ "pages/merchant-msg/merchant-msg",
+ "pages/merchant-rank/merchant-rank",
+ "pages/merchant-recharge/merchant-recharge",
+ "pages/merchant-order-detail/merchant-order-detail",
+ "pages/fighter-order-detail/fighter-order-detail",
+ "pages/chat/chat",
+ "pages/express-order/express-order",
+ "pages/order-pool/order-pool",
+ "pages/poster/poster",
+ "pages/gold-fighter/gold-fighter",
+ "pages/leader/leader",
+ "pages/manager-assign/manager-assign",
+ "pages/leader-bonus-log/leader-bonus-log",
+ "pages/invite-manager/invite-manager",
+ "pages/order-pool2/order-pool2",
+ "pages/group-chat/group-chat",
+ "pages/cs-chat/cs-chat",
+ "pages/verify/verify",
+ "components/global-notification/global-notification",
+ "components/popup-notice/popup-notice",
+ "components/order-card/order-card",
+ "components/order-sender/order-sender",
+ "pages/penalty/penalty/penalty",
+ "pages/penalty/components/fakuan-list/fakuan-list",
+ "pages/penalty/components/jifen-list/jifen-list",
+ "pages/penalty/components/fakuan-pay/fakuan-pay",
+ "pages/phone-auth/phone-auth",
+ "components/chenghao-tag/chenghao-tag",
+ "pages/assessor/assessor",
+ "pages/assess-score/assess-score",
+ "pages/assess-log/assess-log",
+ "pages/assess-center/assess-center",
+ "pages/assess-gold/assess-gold",
+ "pages/escort-orders/escort-orders",
+ "pages/withdraw/components/mode1/mode1",
+ "pages/withdraw/components/mode2/mode2"
+
+
+ ],
+
+ "usingComponents": {
+ "popup-notice": "/components/popup-notice/popup-notice",
+ "tab-bar": "/tab-bar/index"
+ },
+
+ "window": {
+ "navigationBarTextStyle": "black",
+ "navigationStyle": "default",
+ "backgroundTextStyle": "light",
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTitleText": "星阙网络"
+ },
+ "tabBar": {
+ "custom": true,
+ "list": [
+
+
+ {
+ "pagePath": "pages/order-pool/order-pool",
+ "text": "接单池",
+ "iconPath": "/images/order-pool.png",
+ "selectedIconPath": "/images/order-pool.png"
+ },
+ {
+ "pagePath": "pages/order-pool2/order-pool2",
+ "text": "接单池",
+ "iconPath": "/images/order-pool.png",
+ "selectedIconPath": "/images/order-pool.png"
+ }
+
+ ]
+ },
+
+
+ "style": "v2",
+ "sitemapLocation": "sitemap.json",
+ "lazyCodeLoading": "requiredComponents"
}
\ No newline at end of file
diff --git a/pages/accept-order/accept-order.js b/pages/accept-order/accept-order.js
index d06af4a..749dfe7 100644
--- a/pages/accept-order/accept-order.js
+++ b/pages/accept-order/accept-order.js
@@ -1,577 +1,592 @@
-// pages/qiangdan/qiangdan.js
-const app = getApp();
-import request from '../../utils/request.js';
-import PopupService from '../../services/popupService.js';
-import { reconnectForRole } from '../../utils/role-tab-bar.js';
-
-Page({
- data: {
- // 1. 商品类型相关
- shangpinleixing: [],
- xuanzhongLeixingId: null,
-
- // 2. 订单列表与分页相关
- dingdanList: [],
- page: 1,
- pageSize: 5,
- hasMore: true,
- isLoading: false,
-
- // 3. 全局状态字段
- dashoustatus: null,
- zhuanghaoStatus: null,
- dashouzhuangtai: null,
- uid: null,
- huiyuanList: [],
- yajin: 0,
- jifen: 0,
-
- // 4. 刷新控制字段
- scrollViewRefreshing: false,
- lastRefreshTime: 0,
- refreshCooldown: 2000,
- isLoadingMore: false,
-
- // 5. 切换类型冷却
- lastSwitchTime: 0,
- switchCooldown: 1500,
- isSwitching: false,
-
- // 6. OSS地址
- ossImageUrl: app.globalData.ossImageUrl || '',
-
- // 🆕 7. 标签筛选相关
- bankuaiBiaoqian: [], // 当前商品类型所属板块的全部标签
- xuanzhongBiaoqianId: 0, // 0=全部
- },
-
- async onLoad(options) {
- this.loadGlobalStatus();
- await this.loadShangpinLeixing();
- PopupService.checkAndShow(this, 'jiedan');
- },
-
- onHide: function () {
- const popupComp = this.selectComponent('#popupNotice');
- if (popupComp && popupComp.cleanup) {
- popupComp.cleanup();
- }
- },
-
- onShow() {
- this.registerNotificationComponent();
- this.loadGlobalStatus();
- if (wx.getStorageSync('uid')) {
- reconnectForRole('dashou');
- if (app.startImWhenReady) app.startImWhenReady();
- this.refreshDashouProfileSilent();
- }
- if (this.data.xuanzhongLeixingId) {
- this.loadDingdanList(true);
- }
- },
-
- async refreshDashouProfileSilent() {
- try {
- const res = await request({ url: '/yonghu/dashouxinxi', method: 'POST' });
- if (!res || res.data.code != 200) return;
- const data = res.data.data || {};
- const patch = {
- dashouNicheng: data.dashounicheng || '',
- zhanghaoStatus: data.zhanghaostatus || '',
- dashouzhuangtai: data.dashouzhuangtai || '',
- yajin: data.yajin || 0,
- jifen: data.jifen || 0,
- clumber: data.clumber || [],
- };
- Object.assign(app.globalData, {
- dashouNicheng: patch.dashouNicheng,
- zhanghaoStatus: patch.zhanghaoStatus,
- dashouzhuangtai: patch.dashouzhuangtai,
- yajin: patch.yajin,
- jinfen: patch.jifen,
- clumber: patch.clumber,
- });
- if (data.dashoustatus !== undefined) {
- wx.setStorageSync('dashoustatus', data.dashoustatus);
- app.globalData.dashoustatus = data.dashoustatus;
- }
- this.setData({
- zhuanghaoStatus: patch.zhanghaoStatus,
- dashouzhuangtai: patch.dashouzhuangtai,
- huiyuanList: patch.clumber,
- yajin: patch.yajin,
- jifen: patch.jifen,
- });
- } catch (e) {}
- },
-
- registerNotificationComponent() {
- const notificationComp = this.selectComponent('#global-notification');
- if (notificationComp && notificationComp.showNotification) {
- app.globalData.globalNotification = {
- show: (data) => notificationComp.showNotification(data),
- hide: () => notificationComp.hideNotification()
- };
- }
- },
-
- loadGlobalStatus() {
- const globalData = app.globalData;
- this.setData({
- dashoustatus: wx.getStorageSync('dashoustatus'),
- zhuanghaoStatus: globalData.zhanghaoStatus,
- dashouzhuangtai: globalData.dashouzhuangtai,
- uid: wx.getStorageSync('uid'),
- huiyuanList: globalData.clumber || [],
- yajin: globalData.yajin || 0,
- jifen: globalData.jinfen || 0
- });
- },
-
- // 加载商品类型
- async loadShangpinLeixing() {
- wx.showLoading({ title: '加载商品类型...' });
- try {
- const res = await request({
- url: '/dingdan/dsqdhqddlx',
- method: 'POST',
- header: { 'content-type': 'application/json' }
- });
- if (res.statusCode === 200 && res.data) {
- const data = res.data;
- let list = [];
- if (data.code === 200 || data.code === 0) {
- if (data.data && Array.isArray(data.data.list)) list = data.data.list;
- else if (data.data && Array.isArray(data.data)) list = data.data;
- else if (Array.isArray(data.list)) list = data.list;
- else if (Array.isArray(data)) list = data;
- }
- const processedList = this.processTupianUrl(list);
- this.setData({
- shangpinleixing: processedList,
- xuanzhongLeixingId: processedList[0]?.id || null
- });
- if (this.data.xuanzhongLeixingId) {
- this.loadDingdanList(true);
- // 🆕 加载板块标签
- this.loadBankuaiBiaoqian();
- }
- } else {
- wx.showToast({ title: res.data?.msg || '加载商品类型失败', icon: 'none' });
- }
- } catch (error) {
- wx.showToast({ title: '网络错误,加载失败', icon: 'none' });
- } finally {
- wx.hideLoading();
- }
- },
-
- // 处理图片URL
- processTupianUrl(list) {
- const ossUrl = app.globalData.ossImageUrl || '';
- return list.map(item => ({
- ...item,
- full_tupian_url: item.tupian_url && !item.tupian_url.startsWith('http')
- ? ossUrl + item.tupian_url
- : (item.tupian_url || '/images/default-type.png')
- }));
- },
-
- // 🆕 加载板块标签
- async loadBankuaiBiaoqian() {
- const leixingId = this.data.xuanzhongLeixingId;
- if (!leixingId) return;
- try {
- const res = await request({
- url: '/dengji/bkqhbq',
- method: 'POST',
- data: { leixing_id: leixingId }
- });
- if (res && res.data.code === 0) {
- this.setData({
- bankuaiBiaoqian: res.data.data.biaoqian_list || [],
- xuanzhongBiaoqianId: 0
- });
- }
- } catch (e) {
- // 标签加载失败不影响主流程
- }
- },
-
- // 选择商品类型
- async selectLeixing(e) {
- const now = Date.now();
- const lastSwitchTime = this.data.lastSwitchTime;
- const switchCooldown = this.data.switchCooldown;
-
- if (now - lastSwitchTime < switchCooldown) {
- wx.showToast({
- title: `操作太快,请${Math.ceil((switchCooldown - (now - lastSwitchTime)) / 1000)}秒后再试`,
- icon: 'none',
- duration: 1500
- });
- return;
- }
- if (this.data.isSwitching) return;
-
- const leixingId = e.currentTarget.dataset.id;
- if (leixingId === this.data.xuanzhongLeixingId) return;
-
- this.setData({ isSwitching: true, lastSwitchTime: now });
- wx.showLoading({ title: '切换中...' });
-
- try {
- this.setData({
- xuanzhongLeixingId: leixingId,
- dingdanList: [],
- page: 1,
- hasMore: true,
- xuanzhongBiaoqianId: 0 // 重置标签筛选
- });
- await this.loadDingdanList(true);
- // 🆕 切换类型后加载新标签
- await this.loadBankuaiBiaoqian();
- } catch (error) {
- console.error('切换类型失败:', error);
- } finally {
- this.setData({ isSwitching: false });
- wx.hideLoading();
- }
- },
-
- // 🆕 选择标签筛选
- async selectBiaoqian(e) {
- const id = e.currentTarget.dataset.id;
- if (id === this.data.xuanzhongBiaoqianId) return;
- this.setData({
- xuanzhongBiaoqianId: id,
- dingdanList: [],
- page: 1,
- hasMore: true
- });
- await this.loadDingdanList(true);
- },
-
- // 加载订单列表
- async loadDingdanList(isRefresh = false) {
- if (this.data.isLoading || !this.data.xuanzhongLeixingId) return;
-
- const loadPage = isRefresh ? 1 : this.data.page;
- if (!isRefresh && !this.data.hasMore) return;
-
- this.setData({
- isLoading: true,
- isLoadingMore: !isRefresh
- });
-
- try {
- const res = await request({
- url: '/dingdan/ddhq',
- method: 'POST',
- data: {
- leixing_id: this.data.xuanzhongLeixingId,
- page: loadPage,
- page_size: this.data.pageSize,
- // 🆕 传递标签筛选参数(0时不传)
- biaoqian_id: this.data.xuanzhongBiaoqianId || undefined
- }
- });
-
- this.setData({
- isLoading: false,
- isLoadingMore: false,
- scrollViewRefreshing: false
- });
-
- if (res.data.code === 200 || res.data.code === 0) {
- const newList = res.data.data.list || [];
- const hasMore = res.data.data.has_more || false;
-
- // 🆕 处理每条订单,增加 hasRequiredMember 字段
- const processedList = newList.map(item => this.processDingdanItem(item));
- const updatedList = isRefresh ? processedList : [...this.data.dingdanList, ...processedList];
- updatedList.sort((a, b) => (b.creat_time || '').localeCompare(a.creat_time || ''));
-
- this.setData({
- dingdanList: updatedList,
- page: loadPage,
- hasMore: hasMore
- });
-
- if (isRefresh) {
- this.setData({ lastRefreshTime: Date.now() });
- }
- } else {
- wx.showToast({ title: res.data.msg || '加载失败', icon: 'none' });
- }
- } catch (error) {
- console.error('加载订单失败:', error);
- this.setData({
- isLoading: false,
- isLoadingMore: false,
- scrollViewRefreshing: false
- });
- wx.showToast({ title: '网络请求失败', icon: 'none' });
- }
- },
-
- // 处理单条订单数据(包含标签、会员判断)
- processDingdanItem(item) {
- const ossUrl = app.globalData.ossImageUrl || '';
- let fullTupianUrl = '';
-
- if (item.tupian) {
- fullTupianUrl = !item.tupian.startsWith('http') ? ossUrl + item.tupian : item.tupian;
- } else {
- const leixing = this.data.shangpinleixing.find(l => l.id === item.leixing_id);
- fullTupianUrl = leixing ? leixing.full_tupian_url : '/images/default-order.png';
- }
-
- const isZhiding = item.zhuangtai === 7;
-
- let zhidingAvatar = '';
- if (item.zhiding_avatar) {
- zhidingAvatar = !item.zhiding_avatar.startsWith('http')
- ? ossUrl + item.zhiding_avatar
- : item.zhiding_avatar;
- }
- const zhidingNicheng = item.zhiding_nicheng || '';
-
- // 🆕 判断用户是否有订单所需的会员(仅当订单要求会员类型且存在huiyuan_id)
- let hasRequiredMember = true;
- if (item.yaoqiuleixing == 1 && item.huiyuan_id) {
- const userHasIt = this.data.huiyuanList.some(h => h.huiyuanid == item.huiyuan_id);
- hasRequiredMember = userHasIt;
- }
-
- return {
- ...item,
- full_tupian_url: fullTupianUrl,
- isZhiding: isZhiding,
- isPingtai: item.pingtai == 1,
- isShangjia: item.pingtai == 2,
- zhiding_avatar_full: zhidingAvatar,
- zhiding_nicheng: zhidingNicheng,
- // 🆕 三层标签(后端返回,直接保留)
- xuqiu_biaoqian: item.xuqiu_biaoqian || [],
- dashou_biaoqian: item.dashou_biaoqian || [],
- shangjia_biaoqian: item.shangjia_biaoqian || [],
- // 🆕 是否有查看价格的权限
- hasRequiredMember: hasRequiredMember,
- };
- },
-
- // 跳转到充值页面(原封不动)
- goToChongzhiPage(failureType, huiyuanId = null, requiredYajin = 0) {
- let url = '/pages/fighter-recharge/fighter-recharge';
- let params = {};
-
- switch (failureType) {
- case 'huiyuan':
- params = { needScroll: '0', scrollTo: 'member' };
- break;
- case 'yajin':
- params = { needScroll: '1', scrollTo: 'bottom', requiredYajin: requiredYajin };
- break;
- case 'jifen':
- params = { needScroll: '1', scrollTo: 'bottom' };
- break;
- }
-
- if (huiyuanId) params.huiyuanId = huiyuanId;
-
- const queryString = Object.keys(params)
- .map(key => `${key}=${encodeURIComponent(params[key])}`)
- .join('&');
-
- wx.navigateTo({
- url: `${url}?${queryString}`,
- fail: (err) => {
- console.error('跳转失败:', err);
- wx.showToast({ title: '跳转失败,请稍后重试', icon: 'none' });
- }
- });
- },
-
- // 抢单按钮(原封不动)
- async onQiangdanTap(e) {
- const dingdanItem = e.currentTarget.dataset.item;
- if (!dingdanItem) return;
-
- // 校验1: 打手身份
- if (!this.data.dashoustatus || this.data.dashoustatus != 1) {
- wx.showToast({ title: '请先开启接单员身份', icon: 'none' });
- return;
- }
- // 校验2: 账号状态
- if (this.data.zhuanghaoStatus != 1) {
- wx.showToast({ title: '账号异常,无法接单', icon: 'none' });
- return;
- }
- // 校验3: 接单员接单状态
- if (this.data.dashouzhuangtai != 1) {
- wx.showToast({ title: '您有订单正在接待中', icon: 'none' });
- return;
- }
- // 校验4: 指定订单
- if (dingdanItem.isZhiding) {
- if (!this.data.uid || this.data.uid != dingdanItem.zhiding_uid) {
- wx.showToast({ title: '此订单为指定单', icon: 'none' });
- return;
- }
- }
- // 校验5: 会员要求
- if (dingdanItem.yaoqiuleixing == 1) {
- const hasHuiyuan = this.data.huiyuanList.some(h => h.huiyuanid == dingdanItem.huiyuan_id);
- if (!hasHuiyuan) {
- wx.showToast({
- title: '未开通对应会员,无法抢单',
- icon: 'none',
- duration: 2000
- });
- setTimeout(() => {
- this.goToChongzhiPage('huiyuan', dingdanItem.huiyuan_id);
- }, 500);
- return;
- }
- }
- // 校验6: 押金要求
- if (dingdanItem.yaoqiuleixing == 2) {
- if (this.data.yajin < dingdanItem.yajin) {
- wx.showToast({
- title: `押金不足,需${dingdanItem.yajin}`,
- icon: 'none',
- duration: 2000
- });
- setTimeout(() => {
- this.goToChongzhiPage('yajin', null, dingdanItem.yajin);
- }, 500);
- return;
- }
- }
- // 校验7: 积分要求
- if (this.data.jifen < 5) {
- wx.showToast({
- title: '积分不足,至少需要5积分',
- icon: 'none',
- duration: 2000
- });
- setTimeout(() => {
- this.goToChongzhiPage('jifen');
- }, 500);
- return;
- }
-
- // 确认框
- const that = this;
- wx.showModal({
- title: '确认抢单',
- content: `确定要抢此订单吗?${dingdanItem.isZhiding ? '(指定订单)' : ''}`,
- success: async function (res) {
- if (res.confirm) {
- wx.showLoading({ title: '抢单中...', mask: true });
- try {
- const qiangdanRes = await request({
- url: '/dingdan/qiangdan',
- method: 'POST',
- data: { dingdan_id: dingdanItem.dingdan_id }
- });
- wx.hideLoading();
-
- if (qiangdanRes.data.code === 200 || qiangdanRes.data.code === 0) {
- that.showQiangdanSuccessEffect();
- if (app.globalData) {
- app.globalData.dashouzhuangtai = 0;
- that.setData({ dashouzhuangtai: 0 });
- }
- const newList = that.data.dingdanList.filter(
- item => item.dingdan_id !== dingdanItem.dingdan_id
- );
- that.setData({ dingdanList: newList });
- } else {
- wx.showToast({
- title: qiangdanRes.data.msg || '抢单失败',
- icon: 'none'
- });
- }
- } catch (error) {
- wx.hideLoading();
- console.error('抢单请求失败:', error);
- wx.showToast({ title: '网络错误,抢单失败', icon: 'none' });
- }
- }
- }
- });
- },
-
- showQiangdanSuccessEffect() {
- wx.showToast({ title: '抢单成功!', icon: 'success', duration: 2000 });
- },
-
- onViewDetail(e) {
- const { type, content } = e.currentTarget.dataset;
- wx.showModal({
- title: type === 'jieshao' ? '订单介绍' : '订单备注',
- content: content,
- showCancel: false,
- confirmText: '知道了'
- });
- },
-
- onReachBottom() {
- const now = Date.now();
- const lastTime = this.data.lastRefreshTime;
- const cooldown = this.data.refreshCooldown;
-
- if (now - lastTime < cooldown) {
- wx.showToast({
- title: `操作太快,请${Math.ceil((cooldown - (now - lastTime)) / 1000)}秒后再试`,
- icon: 'none',
- duration: 1500
- });
- return;
- }
-
- if (this.data.isLoading || this.data.isLoadingMore) return;
-
- if (this.data.hasMore && !this.data.isLoading && this.data.xuanzhongLeixingId) {
- this.setData({ page: this.data.page + 1 });
- this.loadDingdanList(false);
- }
- },
-
- onPullDownRefresh() {
- const now = Date.now();
- const lastTime = this.data.lastRefreshTime;
- const cooldown = this.data.refreshCooldown;
-
- if (now - lastTime < cooldown) {
- this.setData({ scrollViewRefreshing: false });
- wx.showToast({
- title: `操作太快,请${Math.ceil((cooldown - (now - lastTime)) / 1000)}秒后再试`,
- icon: 'none',
- duration: 1500
- });
- return;
- }
-
- if (this.data.isLoading) {
- this.setData({ scrollViewRefreshing: false });
- return;
- }
-
- this.setData({
- scrollViewRefreshing: true,
- lastRefreshTime: now,
- page: 1,
- hasMore: true
- });
-
- if (this.data.xuanzhongLeixingId) {
- this.loadDingdanList(true);
- } else {
- this.setData({ scrollViewRefreshing: false });
- }
- }
+// pages/qiangdan/qiangdan.js
+const app = getApp();
+import request from '../../utils/request.js';
+import PopupService from '../../services/popupService.js';
+import { reconnectForRole } from '../../utils/role-tab-bar.js';
+
+Page({
+ data: {
+ // 1. 商品类型相关
+ shangpinleixing: [],
+ xuanzhongLeixingId: null,
+
+ // 2. 订单列表与分页相关
+ dingdanList: [],
+ page: 1,
+ pageSize: 5,
+ hasMore: true,
+ isLoading: false,
+
+ // 3. 全局状态字段
+ dashoustatus: null,
+ zhuanghaoStatus: null,
+ dashouzhuangtai: null,
+ uid: null,
+ huiyuanList: [],
+ yajin: 0,
+ jifen: 0,
+
+ // 4. 刷新控制字段
+ scrollViewRefreshing: false,
+ lastRefreshTime: 0,
+ refreshCooldown: 2000,
+ isLoadingMore: false,
+
+ // 5. 切换类型冷却
+ lastSwitchTime: 0,
+ switchCooldown: 1500,
+ isSwitching: false,
+
+ // 6. OSS地址
+ ossImageUrl: app.globalData.ossImageUrl || '',
+
+ // 🆕 7. 标签筛选相关
+ bankuaiBiaoqian: [], // 当前商品类型所属板块的全部标签
+ xuanzhongBiaoqianId: 0, // 0=全部
+
+ // 商品轮播展示(只读 globalData,无额外接口)
+ lunboList: [],
+ },
+
+ async onLoad(options) {
+ this.syncShopBannerFromGlobal();
+ this.loadGlobalStatus();
+ await this.loadShangpinLeixing();
+ PopupService.checkAndShow(this, 'jiedan');
+ },
+
+ onHide: function () {
+ const popupComp = this.selectComponent('#popupNotice');
+ if (popupComp && popupComp.cleanup) {
+ popupComp.cleanup();
+ }
+ },
+
+ onShow() {
+ this.syncShopBannerFromGlobal();
+ this.registerNotificationComponent();
+ this.loadGlobalStatus();
+ if (wx.getStorageSync('uid')) {
+ reconnectForRole('dashou');
+ if (app.startImWhenReady) app.startImWhenReady();
+ this.refreshDashouProfileSilent();
+ }
+ if (this.data.xuanzhongLeixingId) {
+ this.loadDingdanList(true);
+ }
+ },
+
+ /** 同步点单端已加载的商品轮播图,仅展示用 */
+ syncShopBannerFromGlobal() {
+ const oss = app.globalData.ossImageUrl || '';
+ const lunboList = (app.globalData.shangpinlunbo || []).map((url) => {
+ if (!url) return '';
+ return url.startsWith('http') ? url : oss + url;
+ }).filter(Boolean);
+ this.setData({ lunboList });
+ },
+
+ async refreshDashouProfileSilent() {
+ try {
+ const res = await request({ url: '/yonghu/dashouxinxi', method: 'POST' });
+ if (!res || res.data.code != 200) return;
+ const data = res.data.data || {};
+ const patch = {
+ dashouNicheng: data.dashounicheng || '',
+ zhanghaoStatus: data.zhanghaostatus || '',
+ dashouzhuangtai: data.dashouzhuangtai || '',
+ yajin: data.yajin || 0,
+ jifen: data.jifen || 0,
+ clumber: data.clumber || [],
+ };
+ Object.assign(app.globalData, {
+ dashouNicheng: patch.dashouNicheng,
+ zhanghaoStatus: patch.zhanghaoStatus,
+ dashouzhuangtai: patch.dashouzhuangtai,
+ yajin: patch.yajin,
+ jinfen: patch.jifen,
+ clumber: patch.clumber,
+ });
+ if (data.dashoustatus !== undefined) {
+ wx.setStorageSync('dashoustatus', data.dashoustatus);
+ app.globalData.dashoustatus = data.dashoustatus;
+ }
+ this.setData({
+ zhuanghaoStatus: patch.zhanghaoStatus,
+ dashouzhuangtai: patch.dashouzhuangtai,
+ huiyuanList: patch.clumber,
+ yajin: patch.yajin,
+ jifen: patch.jifen,
+ });
+ } catch (e) {}
+ },
+
+ registerNotificationComponent() {
+ const notificationComp = this.selectComponent('#global-notification');
+ if (notificationComp && notificationComp.showNotification) {
+ app.globalData.globalNotification = {
+ show: (data) => notificationComp.showNotification(data),
+ hide: () => notificationComp.hideNotification()
+ };
+ }
+ },
+
+ loadGlobalStatus() {
+ const globalData = app.globalData;
+ this.setData({
+ dashoustatus: wx.getStorageSync('dashoustatus'),
+ zhuanghaoStatus: globalData.zhanghaoStatus,
+ dashouzhuangtai: globalData.dashouzhuangtai,
+ uid: wx.getStorageSync('uid'),
+ huiyuanList: globalData.clumber || [],
+ yajin: globalData.yajin || 0,
+ jifen: globalData.jinfen || 0
+ });
+ },
+
+ // 加载商品类型
+ async loadShangpinLeixing() {
+ wx.showLoading({ title: '加载商品类型...' });
+ try {
+ const res = await request({
+ url: '/dingdan/dsqdhqddlx',
+ method: 'POST',
+ header: { 'content-type': 'application/json' }
+ });
+ if (res.statusCode === 200 && res.data) {
+ const data = res.data;
+ let list = [];
+ if (data.code === 200 || data.code === 0) {
+ if (data.data && Array.isArray(data.data.list)) list = data.data.list;
+ else if (data.data && Array.isArray(data.data)) list = data.data;
+ else if (Array.isArray(data.list)) list = data.list;
+ else if (Array.isArray(data)) list = data;
+ }
+ const processedList = this.processTupianUrl(list);
+ this.setData({
+ shangpinleixing: processedList,
+ xuanzhongLeixingId: processedList[0]?.id || null
+ });
+ if (this.data.xuanzhongLeixingId) {
+ this.loadDingdanList(true);
+ // 🆕 加载板块标签
+ this.loadBankuaiBiaoqian();
+ }
+ } else {
+ wx.showToast({ title: res.data?.msg || '加载商品类型失败', icon: 'none' });
+ }
+ } catch (error) {
+ wx.showToast({ title: '网络错误,加载失败', icon: 'none' });
+ } finally {
+ wx.hideLoading();
+ }
+ },
+
+ // 处理图片URL
+ processTupianUrl(list) {
+ const ossUrl = app.globalData.ossImageUrl || '';
+ return list.map(item => ({
+ ...item,
+ full_tupian_url: item.tupian_url && !item.tupian_url.startsWith('http')
+ ? ossUrl + item.tupian_url
+ : (item.tupian_url || '/images/default-type.png')
+ }));
+ },
+
+ // 🆕 加载板块标签
+ async loadBankuaiBiaoqian() {
+ const leixingId = this.data.xuanzhongLeixingId;
+ if (!leixingId) return;
+ try {
+ const res = await request({
+ url: '/dengji/bkqhbq',
+ method: 'POST',
+ data: { leixing_id: leixingId }
+ });
+ if (res && res.data.code === 0) {
+ this.setData({
+ bankuaiBiaoqian: res.data.data.biaoqian_list || [],
+ xuanzhongBiaoqianId: 0
+ });
+ }
+ } catch (e) {
+ // 标签加载失败不影响主流程
+ }
+ },
+
+ // 选择商品类型
+ async selectLeixing(e) {
+ const now = Date.now();
+ const lastSwitchTime = this.data.lastSwitchTime;
+ const switchCooldown = this.data.switchCooldown;
+
+ if (now - lastSwitchTime < switchCooldown) {
+ wx.showToast({
+ title: `操作太快,请${Math.ceil((switchCooldown - (now - lastSwitchTime)) / 1000)}秒后再试`,
+ icon: 'none',
+ duration: 1500
+ });
+ return;
+ }
+ if (this.data.isSwitching) return;
+
+ const leixingId = e.currentTarget.dataset.id;
+ if (leixingId === this.data.xuanzhongLeixingId) return;
+
+ this.setData({ isSwitching: true, lastSwitchTime: now });
+ wx.showLoading({ title: '切换中...' });
+
+ try {
+ this.setData({
+ xuanzhongLeixingId: leixingId,
+ dingdanList: [],
+ page: 1,
+ hasMore: true,
+ xuanzhongBiaoqianId: 0 // 重置标签筛选
+ });
+ await this.loadDingdanList(true);
+ // 🆕 切换类型后加载新标签
+ await this.loadBankuaiBiaoqian();
+ } catch (error) {
+ console.error('切换类型失败:', error);
+ } finally {
+ this.setData({ isSwitching: false });
+ wx.hideLoading();
+ }
+ },
+
+ // 🆕 选择标签筛选
+ async selectBiaoqian(e) {
+ const id = e.currentTarget.dataset.id;
+ if (id === this.data.xuanzhongBiaoqianId) return;
+ this.setData({
+ xuanzhongBiaoqianId: id,
+ dingdanList: [],
+ page: 1,
+ hasMore: true
+ });
+ await this.loadDingdanList(true);
+ },
+
+ // 加载订单列表
+ async loadDingdanList(isRefresh = false) {
+ if (this.data.isLoading || !this.data.xuanzhongLeixingId) return;
+
+ const loadPage = isRefresh ? 1 : this.data.page;
+ if (!isRefresh && !this.data.hasMore) return;
+
+ this.setData({
+ isLoading: true,
+ isLoadingMore: !isRefresh
+ });
+
+ try {
+ const res = await request({
+ url: '/dingdan/ddhq',
+ method: 'POST',
+ data: {
+ leixing_id: this.data.xuanzhongLeixingId,
+ page: loadPage,
+ page_size: this.data.pageSize,
+ // 🆕 传递标签筛选参数(0时不传)
+ biaoqian_id: this.data.xuanzhongBiaoqianId || undefined
+ }
+ });
+
+ this.setData({
+ isLoading: false,
+ isLoadingMore: false,
+ scrollViewRefreshing: false
+ });
+
+ if (res.data.code === 200 || res.data.code === 0) {
+ const newList = res.data.data.list || [];
+ const hasMore = res.data.data.has_more || false;
+
+ // 🆕 处理每条订单,增加 hasRequiredMember 字段
+ const processedList = newList.map(item => this.processDingdanItem(item));
+ const updatedList = isRefresh ? processedList : [...this.data.dingdanList, ...processedList];
+ updatedList.sort((a, b) => (b.creat_time || '').localeCompare(a.creat_time || ''));
+
+ this.setData({
+ dingdanList: updatedList,
+ page: loadPage,
+ hasMore: hasMore
+ });
+
+ if (isRefresh) {
+ this.setData({ lastRefreshTime: Date.now() });
+ }
+ } else {
+ wx.showToast({ title: res.data.msg || '加载失败', icon: 'none' });
+ }
+ } catch (error) {
+ console.error('加载订单失败:', error);
+ this.setData({
+ isLoading: false,
+ isLoadingMore: false,
+ scrollViewRefreshing: false
+ });
+ wx.showToast({ title: '网络请求失败', icon: 'none' });
+ }
+ },
+
+ // 处理单条订单数据(包含标签、会员判断)
+ processDingdanItem(item) {
+ const ossUrl = app.globalData.ossImageUrl || '';
+ let fullTupianUrl = '';
+
+ if (item.tupian) {
+ fullTupianUrl = !item.tupian.startsWith('http') ? ossUrl + item.tupian : item.tupian;
+ } else {
+ const leixing = this.data.shangpinleixing.find(l => l.id === item.leixing_id);
+ fullTupianUrl = leixing ? leixing.full_tupian_url : '/images/default-order.png';
+ }
+
+ const isZhiding = item.zhuangtai === 7;
+
+ let zhidingAvatar = '';
+ if (item.zhiding_avatar) {
+ zhidingAvatar = !item.zhiding_avatar.startsWith('http')
+ ? ossUrl + item.zhiding_avatar
+ : item.zhiding_avatar;
+ }
+ const zhidingNicheng = item.zhiding_nicheng || '';
+
+ // 🆕 判断用户是否有订单所需的会员(仅当订单要求会员类型且存在huiyuan_id)
+ let hasRequiredMember = true;
+ if (item.yaoqiuleixing == 1 && item.huiyuan_id) {
+ const userHasIt = this.data.huiyuanList.some(h => h.huiyuanid == item.huiyuan_id);
+ hasRequiredMember = userHasIt;
+ }
+
+ return {
+ ...item,
+ full_tupian_url: fullTupianUrl,
+ isZhiding: isZhiding,
+ isPingtai: item.pingtai == 1,
+ isShangjia: item.pingtai == 2,
+ zhiding_avatar_full: zhidingAvatar,
+ zhiding_nicheng: zhidingNicheng,
+ // 🆕 三层标签(后端返回,直接保留)
+ xuqiu_biaoqian: item.xuqiu_biaoqian || [],
+ dashou_biaoqian: item.dashou_biaoqian || [],
+ shangjia_biaoqian: item.shangjia_biaoqian || [],
+ // 🆕 是否有查看价格的权限
+ hasRequiredMember: hasRequiredMember,
+ };
+ },
+
+ // 跳转到充值页面(原封不动)
+ goToChongzhiPage(failureType, huiyuanId = null, requiredYajin = 0) {
+ let url = '/pages/fighter-recharge/fighter-recharge';
+ let params = {};
+
+ switch (failureType) {
+ case 'huiyuan':
+ params = { needScroll: '0', scrollTo: 'member' };
+ break;
+ case 'yajin':
+ params = { needScroll: '1', scrollTo: 'bottom', requiredYajin: requiredYajin };
+ break;
+ case 'jifen':
+ params = { needScroll: '1', scrollTo: 'bottom' };
+ break;
+ }
+
+ if (huiyuanId) params.huiyuanId = huiyuanId;
+
+ const queryString = Object.keys(params)
+ .map(key => `${key}=${encodeURIComponent(params[key])}`)
+ .join('&');
+
+ wx.navigateTo({
+ url: `${url}?${queryString}`,
+ fail: (err) => {
+ console.error('跳转失败:', err);
+ wx.showToast({ title: '跳转失败,请稍后重试', icon: 'none' });
+ }
+ });
+ },
+
+ // 抢单按钮(原封不动)
+ async onQiangdanTap(e) {
+ const dingdanItem = e.currentTarget.dataset.item;
+ if (!dingdanItem) return;
+
+ // 校验1: 打手身份
+ if (!this.data.dashoustatus || this.data.dashoustatus != 1) {
+ wx.showToast({ title: '请先开启接单员身份', icon: 'none' });
+ return;
+ }
+ // 校验2: 账号状态
+ if (this.data.zhuanghaoStatus != 1) {
+ wx.showToast({ title: '账号异常,无法接单', icon: 'none' });
+ return;
+ }
+ // 校验3: 接单员接单状态
+ if (this.data.dashouzhuangtai != 1) {
+ wx.showToast({ title: '您有订单正在接待中', icon: 'none' });
+ return;
+ }
+ // 校验4: 指定订单
+ if (dingdanItem.isZhiding) {
+ if (!this.data.uid || this.data.uid != dingdanItem.zhiding_uid) {
+ wx.showToast({ title: '此订单为指定单', icon: 'none' });
+ return;
+ }
+ }
+ // 校验5: 会员要求
+ if (dingdanItem.yaoqiuleixing == 1) {
+ const hasHuiyuan = this.data.huiyuanList.some(h => h.huiyuanid == dingdanItem.huiyuan_id);
+ if (!hasHuiyuan) {
+ wx.showToast({
+ title: '未开通对应会员,无法抢单',
+ icon: 'none',
+ duration: 2000
+ });
+ setTimeout(() => {
+ this.goToChongzhiPage('huiyuan', dingdanItem.huiyuan_id);
+ }, 500);
+ return;
+ }
+ }
+ // 校验6: 押金要求
+ if (dingdanItem.yaoqiuleixing == 2) {
+ if (this.data.yajin < dingdanItem.yajin) {
+ wx.showToast({
+ title: `押金不足,需${dingdanItem.yajin}`,
+ icon: 'none',
+ duration: 2000
+ });
+ setTimeout(() => {
+ this.goToChongzhiPage('yajin', null, dingdanItem.yajin);
+ }, 500);
+ return;
+ }
+ }
+ // 校验7: 积分要求
+ if (this.data.jifen < 5) {
+ wx.showToast({
+ title: '积分不足,至少需要5积分',
+ icon: 'none',
+ duration: 2000
+ });
+ setTimeout(() => {
+ this.goToChongzhiPage('jifen');
+ }, 500);
+ return;
+ }
+
+ // 确认框
+ const that = this;
+ wx.showModal({
+ title: '确认抢单',
+ content: `确定要抢此订单吗?${dingdanItem.isZhiding ? '(指定订单)' : ''}`,
+ success: async function (res) {
+ if (res.confirm) {
+ wx.showLoading({ title: '抢单中...', mask: true });
+ try {
+ const qiangdanRes = await request({
+ url: '/dingdan/qiangdan',
+ method: 'POST',
+ data: { dingdan_id: dingdanItem.dingdan_id }
+ });
+ wx.hideLoading();
+
+ if (qiangdanRes.data.code === 200 || qiangdanRes.data.code === 0) {
+ that.showQiangdanSuccessEffect();
+ if (app.globalData) {
+ app.globalData.dashouzhuangtai = 0;
+ that.setData({ dashouzhuangtai: 0 });
+ }
+ const newList = that.data.dingdanList.filter(
+ item => item.dingdan_id !== dingdanItem.dingdan_id
+ );
+ that.setData({ dingdanList: newList });
+ } else {
+ wx.showToast({
+ title: qiangdanRes.data.msg || '抢单失败',
+ icon: 'none'
+ });
+ }
+ } catch (error) {
+ wx.hideLoading();
+ console.error('抢单请求失败:', error);
+ wx.showToast({ title: '网络错误,抢单失败', icon: 'none' });
+ }
+ }
+ }
+ });
+ },
+
+ showQiangdanSuccessEffect() {
+ wx.showToast({ title: '抢单成功!', icon: 'success', duration: 2000 });
+ },
+
+ onViewDetail(e) {
+ const { type, content } = e.currentTarget.dataset;
+ wx.showModal({
+ title: type === 'jieshao' ? '订单介绍' : '订单备注',
+ content: content,
+ showCancel: false,
+ confirmText: '知道了'
+ });
+ },
+
+ onReachBottom() {
+ const now = Date.now();
+ const lastTime = this.data.lastRefreshTime;
+ const cooldown = this.data.refreshCooldown;
+
+ if (now - lastTime < cooldown) {
+ wx.showToast({
+ title: `操作太快,请${Math.ceil((cooldown - (now - lastTime)) / 1000)}秒后再试`,
+ icon: 'none',
+ duration: 1500
+ });
+ return;
+ }
+
+ if (this.data.isLoading || this.data.isLoadingMore) return;
+
+ if (this.data.hasMore && !this.data.isLoading && this.data.xuanzhongLeixingId) {
+ this.setData({ page: this.data.page + 1 });
+ this.loadDingdanList(false);
+ }
+ },
+
+ onPullDownRefresh() {
+ const now = Date.now();
+ const lastTime = this.data.lastRefreshTime;
+ const cooldown = this.data.refreshCooldown;
+
+ if (now - lastTime < cooldown) {
+ this.setData({ scrollViewRefreshing: false });
+ wx.showToast({
+ title: `操作太快,请${Math.ceil((cooldown - (now - lastTime)) / 1000)}秒后再试`,
+ icon: 'none',
+ duration: 1500
+ });
+ return;
+ }
+
+ if (this.data.isLoading) {
+ this.setData({ scrollViewRefreshing: false });
+ return;
+ }
+
+ this.setData({
+ scrollViewRefreshing: true,
+ lastRefreshTime: now,
+ page: 1,
+ hasMore: true
+ });
+
+ if (this.data.xuanzhongLeixingId) {
+ this.loadDingdanList(true);
+ } else {
+ this.setData({ scrollViewRefreshing: false });
+ }
+ }
});
\ No newline at end of file
diff --git a/pages/accept-order/accept-order.json b/pages/accept-order/accept-order.json
index eee9b81..e7e7be0 100644
--- a/pages/accept-order/accept-order.json
+++ b/pages/accept-order/accept-order.json
@@ -1,10 +1,10 @@
{
"navigationBarTitleText": "抢单大厅",
- "navigationBarBackgroundColor": "#0b0f1a",
- "navigationBarTextStyle": "white",
+ "navigationBarBackgroundColor": "#f7dc51",
+ "navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"backgroundTextStyle": "dark",
- "backgroundColor": "#0b0f1a",
+ "backgroundColor": "#fff8e1",
"usingComponents": {
"chenghao-tag": "/components/chenghao-tag/chenghao-tag",
"global-notification": "/components/global-notification/global-notification"
diff --git a/pages/accept-order/accept-order.wxml b/pages/accept-order/accept-order.wxml
index 890d9fd..389b531 100644
--- a/pages/accept-order/accept-order.wxml
+++ b/pages/accept-order/accept-order.wxml
@@ -1,220 +1,393 @@
+
-
-
-
-
-
-
-
-
- {{item.jieshao}}
-
-
-
-
-
-
-
-
-
-
- 全部
-
-
-
-
-
-
-
-
-
+
+ class="page-main-scroll"
-
-
-
-
- ⚡️ 正在刷新...
- ▼ 下拉刷新订单
-
+ scroll-y
-
-
-
- 请先选择上方订单类型
-
-
-
- 当前类型暂无待抢订单
-
+ enhanced
-
-
-
-
- {{item.creat_time}}
-
- ⚙️ 平台订单
-
+ show-scrollbar="{{false}}"
-
-
- 指定
-
- {{item.zhiding_nicheng || '指定接单员'}}
- UID: {{item.zhiding_uid || '未知'}}
-
-
-
-
-
+ refresher-enabled="{{xuanzhongLeixingId != null}}"
-
-
-
- 介绍:
- {{item.jieshao || '暂无介绍'}}
- [点击查看]
-
-
+ refresher-threshold="80"
-
- 备注:
- {{item.beizhu}}
- [点击查看]
-
+ refresher-default-style="black"
-
-
- 需求标签:
-
-
-
-
+ refresher-background="#fff8e1"
-
-
- 💰
- 分佣
-
-
- {{item.dashou_fencheng || 0}}
- 元
-
-
- 未开通会员
-
-
-
- ⚡ 立即抢单
-
-
-
-
-
-
+ refresher-triggered="{{scrollViewRefreshing}}"
-
-
-
- {{item.creat_time}}
-
- 🏪 商家发单
-
+ bindrefresherrefresh="onPullDownRefresh"
-
-
- 指定
-
- {{item.zhiding_nicheng || '指定接单员'}}
- UID: {{item.zhiding_uid || '未知'}}
-
-
-
-
-
+ bindscrolltolower="onReachBottom"
-
-
- {{item.sjnicheng || '未知商家'}}
-
-
-
-
-
+ >
-
- 订单介绍:
- {{item.jieshao || '暂无介绍'}}
- [点击查看]
-
+
-
- 商家备注:
- {{item.beizhu}}
- [点击查看]
-
+ 正在刷新...
-
-
- 需求标签:
-
-
-
-
+ 下拉刷新订单
-
-
- 💰
- 分佣
-
-
- {{item.dashou_fencheng || 0}}
- 元
-
-
- 未开通会员
-
-
-
- ⚡ 立即抢单
-
-
-
-
-
-
-
-
- ⚙️ 加载更多订单中...
- —— 没有更多订单了 ——
-
-
-
-
-
- ⚡ 订单加载中...
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.jieshao}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 全部
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 请先选择上方订单类型
+
+
+
+
+
+
+
+ 当前类型暂无待抢订单
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.creat_time}}
+
+ 平台订单
+
+
+
+
+
+
+
+
+
+ 指定
+
+
+
+ {{item.zhiding_nicheng || '指定接单员'}}
+
+
+
+
+
+
+
+
+
+ {{item.jieshao || '暂无介绍'}}
+
+
+
+
+
+
+
+ ¥
+
+ {{item.dashou_fencheng || 0}}
+
+
+
+
+
+ 未开通会员
+
+
+
+
+
+
+
+ 需求标签
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.creat_time}}
+
+ 商家发单
+
+
+
+
+
+
+
+
+
+ 指定
+
+
+
+ {{item.zhiding_nicheng || '指定接单员'}}
+
+
+
+
+
+
+
+ {{item.sjnicheng || '未知商家'}}
+
+
+
+
+
+
+
+ {{item.jieshao || '暂无介绍'}}
+
+
+
+
+
+
+
+ ¥
+
+ {{item.dashou_fencheng || 0}}
+
+
+
+
+
+ 未开通会员
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 加载更多订单中...
+
+ —— 没有更多订单了 ——
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 订单加载中...
+
+
+
+
+
-
\ No newline at end of file
+
+
+
+
diff --git a/pages/accept-order/accept-order.wxss b/pages/accept-order/accept-order.wxss
index 52ed1a3..cecbb2b 100644
--- a/pages/accept-order/accept-order.wxss
+++ b/pages/accept-order/accept-order.wxss
@@ -1,4 +1,5 @@
/* pages/qiangdan/qiangdan.wxss - 高级机甲风格重构版(对称优化) */
+@import '../../styles/dashou-xym-theme.wxss';
.qiangdan-page {
height: 100vh;
display: flex;
@@ -120,20 +121,23 @@
opacity: 0.5;
}
- /* ====== 3. 订单列表容器 ====== */
- .dingdan-container {
+ /* ====== 3. 页面主滚动(下拉刷新在顶部) ====== */
+ .page-main-scroll {
flex: 1;
- overflow: hidden;
- position: relative;
- z-index: 1;
- padding: 0 20rpx; /* 统一左右内边距 */
- }
-
- .dingdan-scroll-view {
- height: 100%;
+ height: 0;
-webkit-overflow-scrolling: touch;
}
-
+
+ .scroll-bottom-spacer {
+ height: 24rpx;
+ }
+
+ .dingdan-list {
+ padding: 0 20rpx;
+ position: relative;
+ z-index: 1;
+ }
+
.refresher-container {
height: 100rpx;
display: flex;
@@ -760,3 +764,4 @@
max-width: 50%;
}
+@import '../../styles/dashou-xym-order-card.wxss';
diff --git a/pages/express-order/express-order.json b/pages/express-order/express-order.json
index e0c0695..7682a2b 100644
--- a/pages/express-order/express-order.json
+++ b/pages/express-order/express-order.json
@@ -4,9 +4,9 @@
"chenghao-tag": "/components/chenghao-tag/chenghao-tag"
},
"backgroundTextStyle": "dark",
- "navigationBarBackgroundColor": "#0a0a0f",
- "navigationBarTitleText": "极速派单",
- "navigationBarTextStyle": "white",
- "backgroundColor": "#0a0a0f",
+ "navigationBarBackgroundColor": "#fff8e1",
+ "navigationBarTitleText": "常规发单",
+ "navigationBarTextStyle": "black",
+ "backgroundColor": "#f5f5f5",
"enablePullDownRefresh": false
}
\ No newline at end of file
diff --git a/pages/express-order/express-order.wxml b/pages/express-order/express-order.wxml
index fe89a26..64cfa0a 100644
--- a/pages/express-order/express-order.wxml
+++ b/pages/express-order/express-order.wxml
@@ -1,230 +1,230 @@
-
-
-
-
- 可用余额
-
- {{sjyue}}
- 元
-
- 生成链接将从此余额扣除
-
-
-
-
- 选择订单类型
-
-
-
- {{item.jieshao}}
-
-
-
-
-
-
-
-
- 🔍
-
-
- 搜索
-
-
-
-
- 金额≥
-
-
-
- 标签
-
-
- {{searchLabelName || '全部'}}
-
-
-
- 清空
-
-
-
-
-
-
-
-
-
-
- {{item.jieshao || '无介绍'}}
-
-
-
-
-
- 价格:
- {{item.jiage || '0.00'}}元
-
-
-
- {{item.hasGenerated ? '获取新链接' : '生成链接'}}
-
-
- {{item.isCopied ? '已复制' : '一键复制'}}
-
-
-
-
-
- ➕
- 添加模板
- 点击创建新模板
-
-
- ...
- 没有更多模板了
- 暂无模板
-
-
-
-
-
-
-
- ×
-
-
-
- 订单介绍
- {{currentTemplate.jieshao || '无介绍'}}
-
-
- 关联标签
-
-
-
- 价格{{currentTemplate.jiage || '0.00'}}元
- |
- 发布数量{{currentTemplate.fabushuliang || 0}}次
- |
- 模板ID{{currentTemplate.mobanId || 'N/A'}}
-
-
- 佣金要求
- {{currentTemplate.commissionValue}}元(建议≤50)
-
-
-
- 链接状态:
- 未使用
- 已使用
-
-
-
-
- {{item.lianjie}}
- {{item.is_used ? '已使用' : '未使用'}}
- 复制
-
-
-
- 获取更多链接
-
- 加载中...
- 暂无链接
-
-
-
- {{currentTemplate.hasGenerated ? '获取新链接' : '生成链接'}}
- {{currentTemplate.isCopied ? '已复制' : '复制链接'}}
- {{isEditing ? '保存修改' : '立即修改'}}
- 删除模板
-
-
-
-
- 订单介绍
-
- {{editJieshao.length}}/100
-
-
- 价格(元)
-
-
-
- 标签
-
- {{editLabelName || '无'}}
-
-
-
- 佣金要求(建议≤50)
-
-
-
-
-
-
-
-
-
-
- ×
-
-
-
- 订单介绍
-
- {{addJieshao.length}}/100
-
-
- 价格(元)
-
-
-
- 标签
-
- {{addLabelName || '可选'}}
-
-
-
- 佣金要求(建议≤50)
-
-
-
-
-
- 取消
- 确认添加
-
-
-
-
-
-
-
- 确认删除
- 确定要删除这个模板吗?此操作不可恢复。
-
- 取消
- 确定删除
-
-
-
-
-
-
-
- 获取新链接
- {{currentTemplate.isCopied ? '确定要获取新链接吗?旧链接将失效。' : '您还没有复制当前链接,确定要获取新链接吗?'}}
-
- 取消
- 确定
-
-
-
-
+
+
+
+
+ 可用余额
+
+ {{sjyue}}
+ 元
+
+ 生成链接将从此余额扣除
+
+
+
+
+ 选择订单类型
+
+
+
+ {{item.jieshao}}
+
+
+
+
+
+
+
+
+ 🔍
+
+
+ 搜索
+
+
+
+
+ 金额≥
+
+
+
+ 标签
+
+
+ {{searchLabelName || '全部'}}
+
+
+
+ 清空
+
+
+
+
+
+
+
+
+
+
+ {{item.jieshao || '无介绍'}}
+
+
+
+
+
+ 价格:
+ {{item.jiage || '0.00'}}元
+
+
+
+ {{item.hasGenerated ? '获取新链接' : '生成链接'}}
+
+
+ {{item.isCopied ? '已复制' : '一键复制'}}
+
+
+
+
+
+ ➕
+ 添加模板
+ 点击创建新模板
+
+
+ ...
+ 没有更多模板了
+ 暂无模板
+
+
+
+
+
+
+
+ ×
+
+
+
+ 订单介绍
+ {{currentTemplate.jieshao || '无介绍'}}
+
+
+ 关联标签
+
+
+
+ 价格{{currentTemplate.jiage || '0.00'}}元
+ |
+ 发布数量{{currentTemplate.fabushuliang || 0}}次
+ |
+ 模板ID{{currentTemplate.mobanId || 'N/A'}}
+
+
+ 佣金要求
+ {{currentTemplate.commissionValue}}元(建议≤50)
+
+
+
+ 链接状态:
+ 未使用
+ 已使用
+
+
+
+
+ {{item.lianjie}}
+ {{item.is_used ? '已使用' : '未使用'}}
+ 复制
+
+
+
+ 获取更多链接
+
+ 加载中...
+ 暂无链接
+
+
+
+ {{currentTemplate.hasGenerated ? '获取新链接' : '生成链接'}}
+ {{currentTemplate.isCopied ? '已复制' : '复制链接'}}
+ {{isEditing ? '保存修改' : '立即修改'}}
+ 删除模板
+
+
+
+
+ 订单介绍
+
+ {{editJieshao.length}}/100
+
+
+ 价格(元)
+
+
+
+ 标签
+
+ {{editLabelName || '无'}}
+
+
+
+ 佣金要求(建议≤50)
+
+
+
+
+
+
+
+
+
+
+ ×
+
+
+
+ 订单介绍
+
+ {{addJieshao.length}}/100
+
+
+ 价格(元)
+
+
+
+ 标签
+
+ {{addLabelName || '可选'}}
+
+
+
+ 佣金要求(建议≤50)
+
+
+
+
+
+ 取消
+ 确认添加
+
+
+
+
+
+
+
+ 确认删除
+ 确定要删除这个模板吗?此操作不可恢复。
+
+ 取消
+ 确定删除
+
+
+
+
+
+
+
+ 获取新链接
+ {{currentTemplate.isCopied ? '确定要获取新链接吗?旧链接将失效。' : '您还没有复制当前链接,确定要获取新链接吗?'}}
+
+ 取消
+ 确定
+
+
+
+
\ No newline at end of file
diff --git a/pages/express-order/express-order.wxss b/pages/express-order/express-order.wxss
index 0193931..4584d49 100644
--- a/pages/express-order/express-order.wxss
+++ b/pages/express-order/express-order.wxss
@@ -1,222 +1,586 @@
-/* pages/express-order/express-order.wxss - 增强版,包含标签展示 */
-.page-container {
- min-height: 100vh;
- background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
- padding: 30rpx;
- box-sizing: border-box;
- padding-bottom: 40rpx;
- font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
- }
- .balance-card {
- background: linear-gradient(135deg, rgba(20,20,30,0.9), rgba(30,30,50,0.9));
- border-radius: 24rpx;
- padding: 36rpx;
- margin-bottom: 40rpx;
- color: #fff;
- box-shadow: 0 15rpx 35rpx rgba(0,0,0,0.4), 0 0 40rpx rgba(0,150,255,0.15);
- text-align: center;
- border: 1.5rpx solid rgba(0,180,255,0.2);
- backdrop-filter: blur(10rpx);
- position: relative;
- overflow: hidden;
- }
- .balance-card::before {
- content: '';
- position: absolute;
- top: -50%; left: -50%;
- width: 200%; height: 200%;
- background: linear-gradient(45deg, transparent 30%, rgba(0,180,255,0.1) 50%, transparent 70%);
- animation: cardShine 6s infinite linear;
- z-index: 1;
- }
- @keyframes cardShine {
- 0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
- 100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
- }
- .balance-label { font-size: 28rpx; color: rgba(255,255,255,0.8); margin-bottom: 18rpx; font-weight: 500; position: relative; z-index: 2; }
- .balance-amount { display: flex; align-items: baseline; justify-content: center; margin-bottom: 15rpx; position: relative; z-index: 2; }
- .amount-value { font-size: 64rpx; font-weight: bold; color: #00B4FF; text-shadow: 0 0 20rpx rgba(0,180,255,0.7), 0 0 40rpx rgba(0,180,255,0.4); animation: amountGlow 3s infinite alternate; }
- @keyframes amountGlow {
- 0% { color: #00B4FF; text-shadow: 0 0 15rpx rgba(0,180,255,0.6); }
- 100% { color: #00E0FF; text-shadow: 0 0 25rpx rgba(0,180,255,0.8), 0 0 50rpx rgba(0,180,255,0.5); }
- }
- .amount-unit { font-size: 36rpx; color: #00B4FF; margin-left: 12rpx; font-weight: 500; z-index: 2; }
- .balance-tip { font-size: 24rpx; color: rgba(255,255,255,0.6); z-index: 2; }
-
- .section { margin-bottom: 35rpx; }
- .section-title { font-size: 32rpx; font-weight: 700; color: #FFFFFF; margin-bottom: 25rpx; padding-left: 12rpx; border-left: 6rpx solid #9C27B0; text-shadow: 0 2rpx 4rpx rgba(0,0,0,0.3); }
-
- .type-scroll { white-space: nowrap; display: flex; height: 90rpx; }
- .type-item {
- display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center;
- height: 85rpx; padding: 0 40rpx; margin-right: 20rpx;
- background: rgba(255,255,255,0.08); border-radius: 45rpx; border: 2rpx solid rgba(255,255,255,0.15);
- font-size: 28rpx; color: rgba(255,255,255,0.8);
- transition: all 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
- backdrop-filter: blur(10rpx);
- }
- .type-active {
- background: linear-gradient(135deg, #9C27B0 0%, #673AB7 100%);
- border-color: #9C27B0; color: white; transform: scale(1.05);
- box-shadow: 0 10rpx 25rpx rgba(156,39,176,0.4), 0 0 30rpx rgba(156,39,176,0.3);
- }
- .type-text { max-width: 220rpx; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
-
- /* 搜索区域 */
- .search-section { margin-bottom: 35rpx; }
- .search-box {
- display: flex; align-items: center;
- background: rgba(255,255,255,0.1); border-radius: 50rpx;
- padding: 20rpx 30rpx; border: 2rpx solid rgba(255,255,255,0.2);
- backdrop-filter: blur(10rpx); transition: all 0.3s ease;
- }
- .search-box:focus-within { border-color: #9C27B0; background: rgba(255,255,255,0.15); box-shadow: 0 0 25rpx rgba(156,39,176,0.3); }
- .search-icon { font-size: 32rpx; color: rgba(255,255,255,0.7); margin-right: 20rpx; flex-shrink: 0; }
- .search-input { flex: 1; font-size: 28rpx; color: #FFFFFF; background: transparent; border: none; outline: none; min-height: 40rpx; }
- .search-input::placeholder { color: rgba(255,255,255,0.4); }
- .search-btn { background: linear-gradient(135deg, #9C27B0 0%, #673AB7 100%); border-radius: 40rpx; padding: 15rpx 30rpx; margin-left: 20rpx; flex-shrink: 0; box-shadow: 0 8rpx 20rpx rgba(156,39,176,0.3); }
- .search-btn:active { transform: scale(0.95); }
- .search-btn-text { font-size: 26rpx; color: white; font-weight: 600; }
-
- .filter-row { display: flex; align-items: center; margin-top: 20rpx; gap: 15rpx; }
- .filter-item { display: flex; align-items: center; background: rgba(255,255,255,0.08); border-radius: 30rpx; padding: 10rpx 20rpx; border: 1rpx solid rgba(255,255,255,0.15); }
- .filter-label { font-size: 24rpx; color: rgba(255,255,255,0.7); margin-right: 10rpx; }
- .filter-input { width: 120rpx; height: 50rpx; background: transparent; color: #fff; font-size: 26rpx; }
- .picker-view { padding: 10rpx 0; color: rgba(255,255,255,0.9); font-size: 26rpx; max-width: 160rpx; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
- .clear-search { margin-left: auto; padding: 10rpx 20rpx; background: rgba(255,255,255,0.1); border-radius: 20rpx; color: rgba(255,255,255,0.7); font-size: 24rpx; }
-
- /* 模板区域 */
- .template-section { height: calc(100vh - 600rpx); position: relative; }
- .template-scroll { height: 100%; }
- .template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25rpx; padding-bottom: 30rpx; }
- .template-card {
- background: linear-gradient(145deg, rgba(30,30,45,0.9), rgba(40,40,60,0.9));
- border-radius: 20rpx; padding: 25rpx;
- border: 1.5rpx solid rgba(255,255,255,0.1);
- box-shadow: 0 10rpx 30rpx rgba(0,0,0,0.3), 0 0 25rpx rgba(0,180,255,0.1);
- transition: all 0.3s ease; backdrop-filter: blur(10rpx);
- display: flex; flex-direction: column; min-height: 280rpx; position: relative; overflow: hidden;
- }
- .template-card::before { content: ''; position: absolute; top:0; left:0; right:0; height:4rpx; background: linear-gradient(90deg, #9C27B0, #00B4FF, #9C27B0); opacity:0.6; }
- .template-intro { flex:1; margin-bottom:10rpx; min-height:70rpx; overflow:hidden; }
- .intro-text { font-size:24rpx; line-height:1.4; color:rgba(255,255,255,0.9); display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden; font-weight:500; }
- .template-label { margin-bottom: 10rpx; }
- .template-price-row { display:flex; align-items:center; margin-bottom:20rpx; padding:10rpx 0; border-bottom:1rpx solid rgba(255,255,255,0.1); }
- .template-price-label { font-size:22rpx; color:rgba(255,255,255,0.7); margin-right:10rpx; }
- .template-price-value { font-size:26rpx; font-weight:bold; color:#FFD700; text-shadow:0 0 10rpx rgba(255,215,0,0.3); flex:1; }
- .template-actions-grid { display:flex; flex-direction:column; gap:12rpx; margin-top:10rpx; }
- .action-grid-btn {
- height:65rpx; border-radius:32rpx; font-size:24rpx; font-weight:600; transition:all 0.3s ease;
- border:none; padding:0 20rpx; box-shadow:0 4rpx 12rpx rgba(0,0,0,0.2), inset 0 1rpx 0 rgba(255,255,255,0.1);
- display:flex !important; align-items:center !important; justify-content:center !important; text-align:center !important;
- }
- .generate-grid-btn { background:linear-gradient(135deg, #00B4FF, #0091EA); color:white; }
- .generate-grid-btn.generated { background:linear-gradient(135deg, #4CAF50, #2E7D32); }
- .copy-grid-btn { background:linear-gradient(135deg, #9C27B0, #673AB7); color:white; }
- .copy-grid-btn.copied { background:linear-gradient(135deg, #FF9800, #F57C00); }
- .add-card { background: linear-gradient(145deg, rgba(40,40,60,0.7), rgba(60,60,80,0.7)); border:2rpx dashed rgba(255,255,255,0.3); display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:280rpx; }
- .add-icon { font-size:60rpx; color:rgba(255,255,255,0.6); margin-bottom:20rpx; }
- .add-text { font-size:30rpx; color:rgba(255,255,255,0.8); font-weight:600; margin-bottom:8rpx; }
- .add-subtext { font-size:24rpx; color:rgba(255,255,255,0.5); }
-
- /* 弹窗通用 */
- .modal-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.75); display:flex; align-items:center; justify-content:center; z-index:9999; padding:30rpx; backdrop-filter:blur(10rpx); animation:fadeIn 0.3s ease; }
- @keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
- .modal-content {
- background:linear-gradient(145deg, rgba(30,30,45,0.95), rgba(40,40,60,0.95));
- border-radius:30rpx; width:100%; max-width:700rpx; max-height:85vh; overflow-y:auto;
- border:1.5rpx solid rgba(255,255,255,0.15);
- box-shadow:0 25rpx 80rpx rgba(0,0,0,0.6), 0 0 60rpx rgba(0,180,255,0.2);
- animation:slideUp 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
- position:relative;
- }
- @keyframes slideUp { from{transform:translateY(100rpx) scale(0.9); opacity:0;} to{transform:translateY(0) scale(1); opacity:1;} }
- .modal-close { position:absolute; top:25rpx; right:25rpx; width:60rpx; height:60rpx; border-radius:50%; background:rgba(255,255,255,0.1); display:flex; align-items:center; justify-content:center; font-size:40rpx; color:rgba(255,255,255,0.7); z-index:10; }
- .modal-header { padding:40rpx 40rpx 20rpx; text-align:center; }
- .modal-title { font-size:36rpx; font-weight:bold; color:#FFFFFF; }
-
- .detail-info { padding:30rpx 40rpx; }
- .detail-item { margin-bottom:30rpx; }
- .detail-label { font-size:26rpx; color:rgba(255,255,255,0.7); margin-bottom:10rpx; font-weight:500; }
- .detail-value { font-size:28rpx; color:#FFFFFF; word-break:break-word; }
- .intro-value { background:rgba(255,255,255,0.05); border-radius:15rpx; padding:20rpx; border:1rpx solid rgba(255,255,255,0.1); max-height:200rpx; overflow-y:auto; }
- .detail-meta-row { display:flex; align-items:center; justify-content:space-between; padding:25rpx 0; margin:20rpx 0; border-top:1rpx solid rgba(255,255,255,0.1); border-bottom:1rpx solid rgba(255,255,255,0.1); }
- .meta-item { display:flex; flex-direction:column; align-items:center; flex:1; }
- .meta-label { font-size:22rpx; color:rgba(255,255,255,0.6); margin-bottom:8rpx; }
- .meta-value { font-size:26rpx; font-weight:600; }
- .price-meta { color:#FFD700; text-shadow:0 0 10rpx rgba(255,215,0,0.3); }
- .count-meta { color:#00B4FF; }
- .id-meta { color:#4CAF50; font-family:'Courier New',monospace; font-size:24rpx; }
- .meta-divider { color:rgba(255,255,255,0.2); font-size:24rpx; margin:0 15rpx; }
-
- .link-filter-bar { display:flex; align-items:center; margin-top:30rpx; margin-bottom:20rpx; }
- .filter-switch {
- padding:10rpx 25rpx; margin-left:10rpx; border-radius:20rpx; background:rgba(255,255,255,0.1);
- font-size:24rpx; color:rgba(255,255,255,0.7); transition:all 0.3s;
- }
- .filter-switch.active { background:linear-gradient(135deg, #00B4FF, #0091EA); color:white; }
- .link-list { background:rgba(0,0,0,0.2); border-radius:15rpx; padding:15rpx; }
- .link-item { display:flex; align-items:center; justify-content:space-between; padding:15rpx 0; border-bottom:1rpx solid rgba(255,255,255,0.1); }
- .link-url { flex:1; font-size:22rpx; color:rgba(255,255,255,0.8); word-break:break-all; margin-right:15rpx; }
- .link-status { font-size:20rpx; color:rgba(255,255,255,0.5); margin-right:15rpx; }
- .copy-link-btn { padding:8rpx 20rpx; background:#00B4FF; color:white; border-radius:15rpx; font-size:22rpx; }
- .load-more-links { text-align:center; padding:20rpx 0; }
- .load-more-btn { display:inline-block; padding:15rpx 40rpx; background:linear-gradient(135deg, #9C27B0, #673AB7); border-radius:30rpx; color:white; font-size:26rpx; }
- .link-loading, .link-empty { text-align:center; padding:30rpx; color:rgba(255,255,255,0.5); font-size:24rpx; }
-
- /* 弹窗按钮 */
- .modal-actions-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:18rpx; padding:30rpx 40rpx 40rpx; border-top:1rpx solid rgba(255,255,255,0.1); }
- .modal-grid-btn {
- height:85rpx; border-radius:42rpx; font-size:28rpx; font-weight:600; transition:all 0.3s;
- border:none; padding:0 20rpx; box-shadow:0 8rpx 25rpx rgba(0,0,0,0.3), inset 0 1rpx 0 rgba(255,255,255,0.2);
- display:flex !important; align-items:center !important; justify-content:center !important;
- }
- .generate-modal-grid-btn { background:linear-gradient(145deg, #00B4FF, #0091EA); color:white; }
- .copy-modal-grid-btn { background:linear-gradient(145deg, #9C27B0, #673AB7); color:white; }
- .copy-modal-grid-btn.copied { background:linear-gradient(145deg, #FF9800, #F57C00); }
- .edit-modal-grid-btn { background:linear-gradient(145deg, #4CAF50, #2E7D32); color:white; }
- .delete-modal-grid-btn { background:linear-gradient(145deg, #FF4444, #CC0000); color:white; }
-
- /* 编辑区 */
- .edit-section { padding:30rpx 40rpx 20rpx; border-top:1rpx solid rgba(255,255,255,0.1); margin-top:20rpx; }
- .edit-item { margin-bottom:30rpx; }
- .edit-label { font-size:26rpx; color:rgba(255,255,255,0.8); margin-bottom:15rpx; font-weight:600; }
- .edit-input { width:100%; background:rgba(255,255,255,0.08); border:1.5rpx solid rgba(255,255,255,0.2); border-radius:15rpx; padding:25rpx; font-size:28rpx; color:#FFFFFF; }
- .intro-edit { min-height:150rpx; }
- .price-edit { text-align:center; font-size:32rpx; font-weight:600; height:90rpx; line-height:90rpx; }
- .picker-view { padding:25rpx; background:rgba(255,255,255,0.08); border-radius:15rpx; border:1.5rpx solid rgba(255,255,255,0.2); color:#fff; }
- .commission-item { display:flex; align-items:center; gap:20rpx; }
- .commission-input { flex:1; background:rgba(255,255,255,0.08); border-radius:15rpx; padding:20rpx; color:#fff; }
-
- /* 添加表单 */
- .add-form { padding:30rpx 40rpx 20rpx; }
- .form-item { margin-bottom:35rpx; }
- .form-label { font-size:28rpx; color:rgba(255,255,255,0.8); margin-bottom:18rpx; font-weight:600; }
- .intro-input, .price-input { width:100%; background:rgba(255,255,255,0.08); border:1.5rpx solid rgba(255,255,255,0.2); border-radius:15rpx; padding:25rpx; font-size:28rpx; color:#FFFFFF; }
- .intro-input { min-height:180rpx; }
- .price-input { height:90rpx; line-height:90rpx; text-align:center; font-weight:600; }
- .add-actions-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:25rpx; padding:30rpx 40rpx 40rpx; border-top:1rpx solid rgba(255,255,255,0.1); }
- .cancel-grid-btn { background:rgba(255,255,255,0.1); color:rgba(255,255,255,0.8); border:1.5rpx solid rgba(255,255,255,0.2); }
- .confirm-add-grid-btn { background:linear-gradient(145deg, #9C27B0, #673AB7); color:white; }
-
- /* 确认弹窗 */
- .confirm-content {
- background:linear-gradient(145deg, rgba(40,40,60,0.95), rgba(50,50,70,0.95));
- border-radius:25rpx; padding:50rpx 40rpx 40rpx; width:85%; max-width:550rpx;
- border:1.5rpx solid rgba(255,255,255,0.15); box-shadow:0 30rpx 90rpx rgba(0,0,0,0.7); text-align:center;
- animation:scaleIn 0.3s ease;
- }
- @keyframes scaleIn { from{transform:scale(0.8); opacity:0;} to{transform:scale(1); opacity:1;} }
- .confirm-title { font-size:34rpx; font-weight:bold; color:#FFFFFF; margin-bottom:25rpx; }
- .confirm-text { font-size:28rpx; color:rgba(255,255,255,0.8); margin-bottom:40rpx; }
- .confirm-actions-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:25rpx; }
- .confirm-grid-btn { height:85rpx; border-radius:42rpx; font-size:28rpx; font-weight:600; display:flex; align-items:center; justify-content:center; }
- .cancel-confirm-grid-btn { background:rgba(255,255,255,0.1); color:rgba(255,255,255,0.8); border:1.5rpx solid rgba(255,255,255,0.2); }
- .delete-confirm-grid-btn { background:linear-gradient(145deg, #FF4444, #CC0000); color:white; }
- .confirm-new-link-grid-btn { background:linear-gradient(145deg, #00B4FF, #0091EA); color:white; }
-
- .loading-mask { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(18,18,24,0.95); display:flex; align-items:center; justify-content:center; z-index:10000; }
- .loading-content { background:rgba(40,40,60,0.95); padding:60rpx 80rpx; border-radius:30rpx; display:flex; flex-direction:column; align-items:center; box-shadow:0 25rpx 70rpx rgba(0,0,0,0.6); }
- .loading-spinner { width:90rpx; height:90rpx; border:8rpx solid rgba(0,180,255,0.2); border-top:8rpx solid #00B4FF; border-radius:50%; animation:spin 1.2s linear infinite; margin-bottom:35rpx; }
- .loading-text { font-size:30rpx; color:#00B4FF; font-weight:600; }
- @keyframes spin { 0%{transform:rotate(0deg);} 100%{transform:rotate(360deg);} }
\ No newline at end of file
+@import '../../styles/shangjia-xym-form.wxss';
+
+page {
+ background: #f5f5f5;
+}
+
+.balance-amount {
+ display: flex;
+ align-items: baseline;
+ justify-content: center;
+ margin-bottom: 15rpx;
+}
+
+.type-scroll {
+ white-space: nowrap;
+ display: flex;
+ height: 90rpx;
+}
+
+.type-text {
+ max-width: 220rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-weight: 500;
+}
+
+.filter-row {
+ display: flex;
+ align-items: center;
+ margin-top: 20rpx;
+ gap: 15rpx;
+}
+
+.filter-item {
+ display: flex;
+ align-items: center;
+ border-radius: 30rpx;
+ padding: 10rpx 20rpx;
+}
+
+.filter-label {
+ font-size: 24rpx;
+ margin-right: 10rpx;
+}
+
+.filter-input {
+ width: 120rpx;
+ height: 50rpx;
+ background: transparent;
+ font-size: 26rpx;
+}
+
+.clear-search {
+ margin-left: auto;
+ padding: 10rpx 20rpx;
+ border-radius: 20rpx;
+ font-size: 24rpx;
+}
+
+.template-section {
+ height: calc(100vh - 600rpx);
+ position: relative;
+}
+
+.template-scroll {
+ height: 100%;
+}
+
+.template-grid {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 25rpx;
+ padding-bottom: 30rpx;
+}
+
+.template-card {
+ padding: 25rpx;
+ display: flex;
+ flex-direction: column;
+ min-height: 280rpx;
+ position: relative;
+ overflow: hidden;
+}
+
+.template-intro {
+ flex: 1;
+ margin-bottom: 10rpx;
+ min-height: 70rpx;
+ overflow: hidden;
+}
+
+.intro-text {
+ font-size: 24rpx;
+ line-height: 1.4;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 3;
+ overflow: hidden;
+ font-weight: 500;
+}
+
+.template-label {
+ margin-bottom: 10rpx;
+}
+
+.template-price-row {
+ display: flex;
+ align-items: center;
+ margin-bottom: 20rpx;
+ padding: 10rpx 0;
+ border-bottom: 1rpx solid #eee;
+}
+
+.template-actions-grid {
+ display: flex;
+ flex-direction: column;
+ gap: 12rpx;
+ margin-top: 10rpx;
+}
+
+.action-grid-btn {
+ height: 65rpx;
+ border-radius: 32rpx;
+ font-size: 24rpx;
+ font-weight: 600;
+ border: none;
+ padding: 0 20rpx;
+ display: flex !important;
+ align-items: center !important;
+ justify-content: center !important;
+}
+
+.add-card {
+ border: 2rpx dashed #ddd;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ min-height: 280rpx;
+}
+
+.add-icon {
+ font-size: 60rpx;
+ color: #bbb;
+ margin-bottom: 20rpx;
+}
+
+.add-text {
+ font-size: 30rpx;
+ color: #666;
+ font-weight: 600;
+ margin-bottom: 8rpx;
+}
+
+.add-subtext {
+ font-size: 24rpx;
+ color: #999;
+}
+
+.modal-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, 0.45);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 9999;
+ padding: 30rpx;
+}
+
+.modal-content {
+ background: #fff;
+ border-radius: 24rpx;
+ width: 100%;
+ max-width: 700rpx;
+ max-height: 85vh;
+ overflow-y: auto;
+ box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.15);
+}
+
+.modal-close {
+ position: absolute;
+ top: 25rpx;
+ right: 25rpx;
+ width: 60rpx;
+ height: 60rpx;
+ border-radius: 50%;
+ background: #f5f5f5;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 40rpx;
+ color: #999;
+ z-index: 10;
+}
+
+.modal-header {
+ padding: 40rpx 40rpx 20rpx;
+ text-align: center;
+}
+
+.modal-title {
+ font-size: 36rpx;
+ font-weight: bold;
+ color: #222;
+}
+
+.detail-info {
+ padding: 30rpx 40rpx;
+}
+
+.detail-item {
+ margin-bottom: 30rpx;
+}
+
+.detail-label {
+ font-size: 26rpx;
+ color: #888;
+ margin-bottom: 10rpx;
+}
+
+.detail-value {
+ font-size: 28rpx;
+ color: #333;
+ word-break: break-word;
+}
+
+.intro-value {
+ background: #f9f9f9;
+ border-radius: 15rpx;
+ padding: 20rpx;
+ max-height: 200rpx;
+ overflow-y: auto;
+}
+
+.detail-meta-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 25rpx 0;
+ margin: 20rpx 0;
+ border-top: 1rpx solid #eee;
+ border-bottom: 1rpx solid #eee;
+}
+
+.meta-item {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ flex: 1;
+}
+
+.meta-label {
+ font-size: 22rpx;
+ color: #999;
+ margin-bottom: 8rpx;
+}
+
+.meta-value {
+ font-size: 26rpx;
+ font-weight: 600;
+ color: #333;
+}
+
+.meta-divider {
+ color: #ddd;
+ font-size: 24rpx;
+ margin: 0 15rpx;
+}
+
+.link-filter-bar {
+ display: flex;
+ align-items: center;
+ margin-top: 30rpx;
+ margin-bottom: 20rpx;
+}
+
+.filter-switch {
+ padding: 10rpx 25rpx;
+ margin-left: 10rpx;
+ border-radius: 20rpx;
+ background: #f5f5f5;
+ font-size: 24rpx;
+ color: #666;
+}
+
+.filter-switch.active {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ color: #492f00;
+}
+
+.link-list {
+ background: #f9f9f9;
+ border-radius: 15rpx;
+ padding: 15rpx;
+}
+
+.link-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 15rpx 0;
+ border-bottom: 1rpx solid #eee;
+}
+
+.link-url {
+ flex: 1;
+ font-size: 22rpx;
+ color: #666;
+ word-break: break-all;
+ margin-right: 15rpx;
+}
+
+.link-status {
+ font-size: 20rpx;
+ color: #999;
+ margin-right: 15rpx;
+}
+
+.copy-link-btn {
+ padding: 8rpx 20rpx;
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ color: #492f00;
+ border-radius: 15rpx;
+ font-size: 22rpx;
+}
+
+.load-more-links {
+ text-align: center;
+ padding: 20rpx 0;
+}
+
+.load-more-btn {
+ display: inline-block;
+ padding: 15rpx 40rpx;
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ border-radius: 30rpx;
+ color: #492f00;
+ font-size: 26rpx;
+}
+
+.link-loading,
+.link-empty {
+ text-align: center;
+ padding: 30rpx;
+ color: #999;
+ font-size: 24rpx;
+}
+
+.modal-actions-grid {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 18rpx;
+ padding: 30rpx 40rpx 40rpx;
+ border-top: 1rpx solid #eee;
+}
+
+.modal-grid-btn {
+ height: 85rpx;
+ border-radius: 42rpx;
+ font-size: 28rpx;
+ font-weight: 600;
+ border: none;
+ display: flex !important;
+ align-items: center !important;
+ justify-content: center !important;
+}
+
+.generate-modal-grid-btn,
+.copy-modal-grid-btn,
+.edit-modal-grid-btn {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ color: #492f00;
+}
+
+.delete-modal-grid-btn {
+ background: #ffebee;
+ color: #c62828;
+}
+
+.edit-section {
+ padding: 30rpx 40rpx 20rpx;
+ border-top: 1rpx solid #eee;
+ margin-top: 20rpx;
+}
+
+.edit-item {
+ margin-bottom: 30rpx;
+}
+
+.edit-label {
+ font-size: 26rpx;
+ color: #666;
+ margin-bottom: 15rpx;
+ font-weight: 600;
+}
+
+.edit-input {
+ width: 100%;
+ background: #f5f5f5;
+ border-radius: 15rpx;
+ padding: 25rpx;
+ font-size: 28rpx;
+ color: #333;
+}
+
+.intro-edit {
+ min-height: 150rpx;
+}
+
+.price-edit {
+ text-align: center;
+ font-size: 32rpx;
+ font-weight: 600;
+ height: 90rpx;
+ line-height: 90rpx;
+}
+
+.commission-item {
+ display: flex;
+ align-items: center;
+ gap: 20rpx;
+}
+
+.commission-input {
+ flex: 1;
+ background: #f5f5f5;
+ border-radius: 15rpx;
+ padding: 20rpx;
+ color: #333;
+}
+
+.add-form {
+ padding: 30rpx 40rpx 20rpx;
+}
+
+.form-item {
+ margin-bottom: 35rpx;
+}
+
+.form-label {
+ font-size: 28rpx;
+ color: #666;
+ margin-bottom: 18rpx;
+ font-weight: 600;
+}
+
+.intro-input,
+.price-input {
+ width: 100%;
+ background: #f5f5f5;
+ border-radius: 15rpx;
+ padding: 25rpx;
+ font-size: 28rpx;
+ color: #333;
+}
+
+.intro-input {
+ min-height: 180rpx;
+}
+
+.price-input {
+ height: 90rpx;
+ line-height: 90rpx;
+ text-align: center;
+ font-weight: 600;
+}
+
+.add-actions-grid {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 25rpx;
+ padding: 30rpx 40rpx 40rpx;
+ border-top: 1rpx solid #eee;
+}
+
+.cancel-grid-btn {
+ background: #f5f5f5;
+ color: #666;
+}
+
+.confirm-add-grid-btn {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ color: #492f00;
+}
+
+.confirm-content {
+ background: #fff;
+ border-radius: 25rpx;
+ padding: 50rpx 40rpx 40rpx;
+ width: 85%;
+ max-width: 550rpx;
+ box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.15);
+ text-align: center;
+}
+
+.confirm-title {
+ font-size: 34rpx;
+ font-weight: bold;
+ color: #222;
+ margin-bottom: 25rpx;
+}
+
+.confirm-text {
+ font-size: 28rpx;
+ color: #666;
+ margin-bottom: 40rpx;
+}
+
+.confirm-actions-grid {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 25rpx;
+}
+
+.confirm-grid-btn {
+ height: 85rpx;
+ border-radius: 42rpx;
+ font-size: 28rpx;
+ font-weight: 600;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.cancel-confirm-grid-btn {
+ background: #f5f5f5;
+ color: #666;
+}
+
+.delete-confirm-grid-btn {
+ background: #ffebee;
+ color: #c62828;
+}
+
+.confirm-new-link-grid-btn {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ color: #492f00;
+}
+
+.loading-mask {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(255, 255, 255, 0.85);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 10000;
+}
+
+.loading-content {
+ background: #fff;
+ padding: 60rpx 80rpx;
+ border-radius: 30rpx;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ box-shadow: 0 10rpx 40rpx rgba(0, 0, 0, 0.08);
+}
+
+.loading-spinner {
+ width: 90rpx;
+ height: 90rpx;
+ border: 8rpx solid #eee;
+ border-top: 8rpx solid #ffd061;
+ border-radius: 50%;
+ animation: spin 1.2s linear infinite;
+ margin-bottom: 35rpx;
+}
+
+.loading-text {
+ font-size: 30rpx;
+ font-weight: 600;
+}
+
+@keyframes spin {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(360deg); }
+}
diff --git a/pages/fighter-orders/fighter-orders.wxml b/pages/fighter-orders/fighter-orders.wxml
index b74e1e4..b828c30 100644
--- a/pages/fighter-orders/fighter-orders.wxml
+++ b/pages/fighter-orders/fighter-orders.wxml
@@ -57,8 +57,8 @@
lower-threshold="50"
>
- ⚡ 正在刷新...
- ▼ 下拉刷新
+ 正在刷新...
+ 下拉刷新
diff --git a/pages/fighter-orders/fighter-orders.wxss b/pages/fighter-orders/fighter-orders.wxss
index ee1f8ea..a523181 100644
--- a/pages/fighter-orders/fighter-orders.wxss
+++ b/pages/fighter-orders/fighter-orders.wxss
@@ -344,4 +344,6 @@ page {
padding: 40rpx 0;
font-size: 26rpx;
color: #999;
- }
\ No newline at end of file
+ }
+
+@import '../../styles/dashou-xym-orders-theme.wxss';
\ No newline at end of file
diff --git a/pages/fighter-recharge/fighter-recharge.wxss b/pages/fighter-recharge/fighter-recharge.wxss
index e2536bf..2f808eb 100644
--- a/pages/fighter-recharge/fighter-recharge.wxss
+++ b/pages/fighter-recharge/fighter-recharge.wxss
@@ -1702,4 +1702,6 @@
display: flex !important;
align-items: center !important;
justify-content: center !important;
- }
\ No newline at end of file
+ }
+
+@import '../../styles/dashou-xym-recharge-theme.wxss';
\ No newline at end of file
diff --git a/pages/fighter/fighter.js b/pages/fighter/fighter.js
index beed7f0..99a60b9 100644
--- a/pages/fighter/fighter.js
+++ b/pages/fighter/fighter.js
@@ -1,1068 +1,1076 @@
-// pages/dashouzhongxin/dashouzhongxin.js
-import { createPage, request, isRoleStatusActive, isCenterPageActive, syncRoleStatuses, syncProfileFields, syncGroupFields, ensureRoleOnCenterPage, clearCacheAndEnterNormal, lockPrimaryRole, migrateLegacyCenterRole, enterLockedRole, parseSceneOptions } from '../../utils/base-page.js'
-import { resolveAvatarUrl } from '../../utils/avatar.js'
-import { openPrivateChat, buildInviterPeerId } from '../../utils/im-user.js'
-
-const PLATFORM_INVITE_CODE = '0000008RffVgKHMj7kQC'
-
-Page(createPage({
- data: {
- // 图片路径对象
- imgUrls: {},
-
- isDashou: false,
- isGuanshi: false,
- isZuzhang: false,
- isKaoheguan: false,
- isShangjia: false,
- shangjiaCertified: false,
- totalAssets: '0.00',
- assetBreakdown: [],
- pendingAuthList: [],
- showAuthSection: false,
- inviteCode: '',
- guanshiInviteCode: '',
- zuzhangInviteCode: '',
- uid: '',
- touxiang: '',
- avatarUrl: '',
- dashouNicheng: '',
- zhanghaoStatus: '',
- yongjin: '',
- zonge: '',
- yajin: '',
- chenghao: '',
- jinfen: '',
- clumber: [],
- chengjiaoliang: '',
- zaixianZhuangtai: 0,
- isAutoRegistering: false,
- inviterCache: null,
- zuzhangInviterCache: null,
- chenghaoList: [],
- guanshiChenghaoList: [],
- gszhstatus: '',
- yaoqingzongshu: 0,
- fenyongzonge: '0.00',
- fenyongtixian: '0.00',
- yichongzhiDashou: 0,
- zhuanhualv: 0,
- ketixian: '0.00',
- guanshiCount: 0,
- fenhongZonge: '0.00',
- kaoheYue: '0.00',
- kaoheZonge: '0.00',
- shenheZongshu: 0,
- tongguoZongshu: 0,
- pendingShenheCount: 0,
- layoutSparse: false,
- rankBoardList: [
- { type: 'dashou', name: '接单员榜', sub: '接单成交', icon: '', shapeClass: 'rank-shape-left', themeClass: 'rank-theme-blue' },
- { type: 'guanshi', name: '管事榜', sub: '邀请收入', icon: '', shapeClass: 'rank-shape-right', themeClass: 'rank-theme-gold' },
- { type: 'zuzhang', name: '组长榜', sub: '团队分红', icon: '', shapeClass: 'rank-shape-left', themeClass: 'rank-theme-purple' },
- { type: 'shangjia', name: '商家榜', sub: '派单流水', icon: '', shapeClass: 'rank-shape-right', themeClass: 'rank-theme-orange' },
- ],
- },
-
- _buildImgUrls(ossImageUrl) {
- const dsBase = ossImageUrl + 'beijing/dashouduan/';
- const iconBase = ossImageUrl + 'beijing/dashouduan/dashoutubiaobeijing/';
- const gsBase = ossImageUrl + 'beijing/guanshiduan/';
- const khBase = ossImageUrl + 'beijing/kaohe/';
- return {
- pageBg: dsBase + 'page-bg.jpg',
- userCardBg: dsBase + 'user-card-bg.png',
- vipCardBg: dsBase + 'vip-card-bg.jpg',
- assetPanelBg: dsBase + 'asset-panel-bg.png',
- rankHubBg: dsBase + 'rank-hub-bg.png',
- rankTileBg: dsBase + 'rank-tile-bg.png',
- funcPanelBg: dsBase + 'func-panel-bg.png',
- listBg: dsBase + 'list-card-bg.png',
- topBg: iconBase + 'top-bg.jpg',
- cardBg: iconBase + 'card-bg.jpg',
- iconRefresh: gsBase + 'icon-refresh.png',
- iconCopy: gsBase + 'icon-copy.png',
- iconVip: dsBase + 'icon-vip.png',
- iconArrowLight: dsBase + 'icon-arrow-light.png',
- iconSectionAsset: dsBase + 'icon-section-asset.png',
- iconSectionRank: dsBase + 'icon-section-rank.png',
- iconSectionFunc: dsBase + 'icon-section-func.png',
- iconSectionGuanshi: dsBase + 'icon-section-guanshi.png',
- iconSectionZuzhang: dsBase + 'icon-section-zuzhang.png',
- iconSectionKaohe: dsBase + 'icon-section-kaohe.png',
- iconSectionMore: dsBase + 'icon-section-more.png',
- iconRankDashou: dsBase + 'rank-dashou.png',
- iconRankGuanshi: dsBase + 'rank-guanshi.png',
- iconRankZuzhang: dsBase + 'rank-zuzhang.png',
- iconRankShangjia: dsBase + 'rank-shangjia.png',
- iconGame: iconBase + 'icon-game.jpg',
- iconRecharge: iconBase + 'icon-recharge.jpg',
- iconOrders: iconBase + 'icon-orders.jpg',
- iconPunish: iconBase + 'icon-punish.jpg',
- iconRank: iconBase + 'icon-rank.jpg',
- iconInvite: gsBase + 'icon-invite.png',
- iconMedal: iconBase + 'icon-medal.jpg',
- iconEdit: iconBase + 'icon-edit.jpg',
- iconBook: iconBase + 'icon-book.jpg',
- iconArrow: gsBase + 'icon-arrow.png',
- iconSub: gsBase + 'icon-sub.png',
- iconRecord: gsBase + 'icon-record.png',
- iconPoster: gsBase + 'icon-poster.png',
- iconWithdraw: gsBase + 'icon-withdraw.png',
- iconContact: gsBase + 'icon-contact.png',
- avatarDefault: ossImageUrl + 'avatar/default.jpg',
- iconClear: ossImageUrl + 'beijing/tubiao/grzx_qingchu.jpg',
- iconSwitch: '/images/_exit.png',
- iconKefu: ossImageUrl + 'beijing/tubiao/grzx_kefu.jpg',
- iconKuaishou: ossImageUrl + 'beijing/tubiao/grzx_guanzhualong.jpg',
- iconKaoheDafen: khBase + 'daofen.png',
- iconKaoheJilu: khBase + 'jilu.png',
- iconKaoheZhongxin: khBase + 'zhongxin.png',
- iconShangjia: ossImageUrl + 'beijing/tubiao/grzx_shangjia.jpg',
- iconDashouAuth: ossImageUrl + 'beijing/tubiao/grzx_dashou.jpg',
- iconGuanshiAuth: ossImageUrl + 'beijing/tubiao/grzx_guanshi.jpg',
- iconZuzhangAuth: ossImageUrl + 'beijing/tubiao/grzx_zuzhang.jpg',
- kefuBannerBg: dsBase + 'kefu-banner-bg.png',
- totalAssetBg: dsBase + 'total-asset-bg.png',
- authPanelBg: dsBase + 'auth-panel-bg.png',
- };
- },
-
- _applyRankBoardIcons(imgUrls) {
- const iconMap = {
- dashou: imgUrls.iconRankDashou,
- guanshi: imgUrls.iconRankGuanshi,
- zuzhang: imgUrls.iconRankZuzhang,
- shangjia: imgUrls.iconRankShangjia,
- };
- return (this.data.rankBoardList || []).map((item) => ({
- ...item,
- icon: iconMap[item.type] || imgUrls.iconRank,
- }));
- },
-
- onLoad(options) {
- const app = getApp();
- const ossImageUrl = app.globalData.ossImageUrl || '';
- const imgUrls = this._buildImgUrls(ossImageUrl);
- this.setData({
- imgUrls,
- rankBoardList: this._applyRankBoardIcons(imgUrls),
- });
- this.checkRoleStatuses();
-
- const parsed = parseSceneOptions(options);
- const registerType = parsed.registerType || 'dashou';
- const { inviteCode } = parsed;
- this.checkDashouStatus();
- if (inviteCode) {
- if (registerType === 'guanshi') {
- this.setData({ guanshiInviteCode: inviteCode });
- setTimeout(() => {
- this.handleGuanshiInviteCodeWithLoginCheck(inviteCode);
- }, 500);
- } else {
- this.setData({ inviteCode });
- setTimeout(() => {
- this.handleInviteCodeWithLoginCheck(inviteCode);
- }, 500);
- }
- }
- this.checkColdStartPopup('dashouduan');
- },
-
- onShow() {
- migrateLegacyCenterRole(getApp());
- lockPrimaryRole('dashou', getApp());
- wx.setStorageSync('isJinpai', 0);
- ensureRoleOnCenterPage(this, 'dashou');
-
- const inviterCache = wx.getStorageSync('inviterCache') || null;
- const zuzhangInviterCache = wx.getStorageSync('zuzhangInviterCache') || null;
- this.setData({ inviterCache, zuzhangInviterCache });
-
- this.registerNotificationComponent();
- this.checkRoleStatuses();
- if (isCenterPageActive(this, 'isDashou', 'dashoustatus')) {
- if (!this.data.isDashou) this.setData({ isDashou: true });
- ensureRoleOnCenterPage(this, 'dashou');
- setTimeout(() => this.refreshAllInfo(false), 300);
- } else if (isRoleStatusActive(wx.getStorageSync('guanshistatus')) ||
- isRoleStatusActive(wx.getStorageSync('zuzhangstatus')) ||
- isRoleStatusActive(wx.getStorageSync('kaoheguanstatus'))) {
- ensureRoleOnCenterPage(this, 'dashou');
- setTimeout(() => this.refreshAllInfo(false), 300);
- }
- const pages = getCurrentPages();
- const currentPage = pages[pages.length - 1];
- const options = currentPage.options || {};
- const registerType = options.registerType || 'dashou';
- if (options.inviteCode) {
- if (registerType === 'guanshi' && !isRoleStatusActive(wx.getStorageSync('guanshistatus'))) {
- setTimeout(() => {
- this.handleGuanshiInviteCodeWithLoginCheck(options.inviteCode);
- }, 300);
- } else if (registerType !== 'guanshi' && !isCenterPageActive(this, 'isDashou', 'dashoustatus')) {
- setTimeout(() => {
- this.handleInviteCodeWithLoginCheck(options.inviteCode);
- }, 300);
- }
- }
- },
-
- checkRoleStatuses() {
- const isDashou = isRoleStatusActive(wx.getStorageSync('dashoustatus'));
- const isGuanshi = isRoleStatusActive(wx.getStorageSync('guanshistatus'));
- const isZuzhang = isRoleStatusActive(wx.getStorageSync('zuzhangstatus'));
- const isKaoheguan = isRoleStatusActive(wx.getStorageSync('kaoheguanstatus'));
- const isShangjia = isRoleStatusActive(wx.getStorageSync('shangjiastatus'));
- const subRoleCount = [isGuanshi, isZuzhang, isKaoheguan].filter(Boolean).length;
- this.setData({
- isDashou, isGuanshi, isZuzhang, isKaoheguan,
- isShangjia,
- shangjiaCertified: isShangjia,
- layoutSparse: subRoleCount === 0,
- }, () => {
- this._updateTotalAssets();
- this._updatePendingAuth();
- });
- if (isDashou) {
- const uid = wx.getStorageSync('uid') || '';
- const touxiang = wx.getStorageSync('touxiang') || '';
- this.setData({ uid, touxiang });
- this.loadAvatar();
- }
- },
-
- _parseMoney(val) {
- return parseFloat(String(val || '0').replace(/,/g, '')) || 0;
- },
-
- _updateTotalAssets() {
- const d = this.data;
- const breakdown = [{ label: '接单员佣金', amount: d.yongjin || '0.00' }];
- let total = this._parseMoney(d.yongjin);
- if (d.isGuanshi) {
- total += this._parseMoney(d.fenyongtixian);
- breakdown.push({ label: '管事分成', amount: d.fenyongtixian || '0.00' });
- }
- if (d.isZuzhang) {
- total += this._parseMoney(d.ketixian);
- breakdown.push({ label: '组长余额', amount: d.ketixian || '0.00' });
- }
- if (d.isKaoheguan) {
- total += this._parseMoney(d.kaoheYue);
- breakdown.push({ label: '考核余额', amount: d.kaoheYue || '0.00' });
- }
- this.setData({ totalAssets: total.toFixed(2), assetBreakdown: breakdown });
- },
-
- /** 打手端:已认证不展示;商家始终第一位 */
- _updatePendingAuth() {
- const d = this.data;
- const img = d.imgUrls || {};
- const list = [];
- list.push({
- type: 'shangjia',
- name: '商家',
- icon: img.iconShangjia,
- tag: d.shangjiaCertified ? '进入商家端' : '去认证',
- done: d.shangjiaCertified,
- });
- if (!d.isGuanshi) {
- list.push({ type: 'guanshi', name: '管事', icon: img.iconGuanshiAuth, tag: '去认证' });
- }
- if (!d.isZuzhang) {
- list.push({ type: 'zuzhang', name: '组长', icon: img.iconZuzhangAuth, tag: '去认证' });
- }
- if (!d.isDashou) {
- list.push({ type: 'dashou', name: '接单员', icon: img.iconDashouAuth, tag: '去认证' });
- }
- this.setData({
- pendingAuthList: list,
- showAuthSection: list.length > 0,
- });
- },
-
- async refreshAllInfo(showToast = true) {
- this.throttledRefresh(async () => {
- this.setData({ isLoading: true });
- try {
- this.checkRoleStatuses();
- const results = await Promise.allSettled([
- this._fetchDashouInfoSilent(),
- this.fetchChenghaoList(),
- this._fetchGuanshiInfoSilent(),
- this.fetchGuanshiChenghaoList(),
- this._fetchZuzhangInfoSilent(),
- this._fetchKaoheguanInfoSilent(),
- ]);
- this.checkRoleStatuses();
- const dashouOk = results[0].status === 'fulfilled';
- if (showToast) {
- wx.showToast({
- title: dashouOk ? '刷新成功' : '刷新失败',
- icon: dashouOk ? 'success' : 'none',
- duration: 1500,
- });
- }
- } catch (e) {
- if (showToast) {
- wx.showToast({ title: '刷新失败', icon: 'none' });
- }
- } finally {
- this.setData({ isLoading: false });
- }
- }, 3000);
- },
-
- refreshDashouInfo() {
- this.refreshAllInfo(true);
- },
-
- onTapRefresh() {
- this.refreshAllInfo(true);
- },
-
- async _fetchDashouInfoSilent() {
- const res = await request({ url: '/yonghu/dashouxinxi', method: 'POST' });
- if (res && res.data.code == 200) {
- const data = res.data.data;
- const app = getApp();
- const updateData = {
- dashouNicheng: data.dashounicheng || '',
- zhanghaoStatus: data.zhanghaostatus || '',
- yongjin: data.yongjin || '0.00',
- zonge: data.zonge || '0.00',
- yajin: data.yajin || '0.00',
- chenghao: data.chenghao || '',
- jinfen: data.jifen || '0',
- clumber: data.clumber || [],
- chengjiaoliang: data.chengjiaoliang || '0',
- zaixianZhuangtai: data.zaixianzhuangtai || 0,
- dashouzhuangtai: data.dashouzhuangtai || '',
- };
- Object.assign(app.globalData, updateData);
- if (data.dashoustatus !== undefined) {
- wx.setStorageSync('dashoustatus', data.dashoustatus);
- app.globalData.dashoustatus = data.dashoustatus;
- }
- if (data.guanshistatus !== undefined) {
- wx.setStorageSync('guanshistatus', data.guanshistatus);
- app.globalData.guanshistatus = data.guanshistatus;
- }
- if (data.zuzhangstatus !== undefined) {
- wx.setStorageSync('zuzhangstatus', data.zuzhangstatus);
- app.globalData.zuzhangstatus = data.zuzhangstatus;
- }
- this.setData({ ...updateData, isLoading: false });
- this._updateTotalAssets();
- return;
- }
- throw new Error('打手信息获取失败');
- },
-
- async _fetchGuanshiInfoSilent() {
- const res = await request({ url: '/yonghu/guanshixinxi', method: 'POST' });
- if (res && this._isApiSuccess(res.data)) {
- const data = this._extractUserData(res.data);
- if (data.guanshistatus !== undefined) {
- wx.setStorageSync('guanshistatus', data.guanshistatus);
- getApp().globalData.guanshistatus = data.guanshistatus;
- }
- if (!isRoleStatusActive(data.guanshistatus ?? wx.getStorageSync('guanshistatus'))) {
- return;
- }
- const app = getApp();
- if (!app.globalData.guanshi) app.globalData.guanshi = {};
- const updateData = {
- gszhstatus: data.gszhstatus || '',
- yaoqingzongshu: data.yaoqingzongshu || 0,
- fenyongzonge: data.fenyongzonge || '0.00',
- fenyongtixian: data.fenyongtixian || '0.00',
- yichongzhiDashou: data.yichongzhiDashou || 0,
- };
- Object.assign(app.globalData.guanshi, updateData);
- const zhuanhualv = updateData.yaoqingzongshu > 0
- ? (updateData.yichongzhiDashou / updateData.yaoqingzongshu * 100).toFixed(1)
- : 0;
- this.setData({ isGuanshi: true, ...updateData, zhuanhualv });
- this._updateTotalAssets();
- return;
- }
- },
-
- async _fetchZuzhangInfoSilent() {
- const res = await request({ url: '/yonghu/zuzhangxinxi', method: 'POST' });
- if (res && res.data.code === 200) {
- const data = res.data.data || {};
- if (data.zuzhangstatus !== undefined) {
- wx.setStorageSync('zuzhangstatus', data.zuzhangstatus);
- getApp().globalData.zuzhangstatus = data.zuzhangstatus;
- }
- if (!isRoleStatusActive(data.zuzhangstatus ?? wx.getStorageSync('zuzhangstatus'))) {
- return;
- }
- this.setData({
- isZuzhang: true,
- ketixian: data.ketixian || '0.00',
- guanshiCount: data.guanshiCount || 0,
- fenhongZonge: data.fenhongZonge || '0.00',
- });
- this._updateTotalAssets();
- return;
- }
- },
-
- async _fetchKaoheguanInfoSilent() {
- const res = await request({ url: '/dengji/khgsx', method: 'POST' });
- if (res && res.data.code === 200) {
- const data = res.data.data || {};
- if (data.zhuangtai === 0 || data.zhuangtai === 2) {
- wx.setStorageSync('kaoheguanstatus', 0);
- getApp().globalData.kaoheguanstatus = 0;
- this.setData({ isKaoheguan: false });
- return;
- }
- wx.setStorageSync('kaoheguanstatus', 1);
- getApp().globalData.kaoheguanstatus = 1;
- const app = getApp();
- if (!app.globalData.kaoheguan) app.globalData.kaoheguan = {};
- Object.assign(app.globalData.kaoheguan, {
- shenhe_zongshu: data.shenhe_zongshu || 0,
- tongguo_zongshu: data.tongguo_zongshu || 0,
- yue: data.yue || '0.00',
- zonge: data.zonge || '0.00',
- pending_shenhe_count: data.pending_shenhe_count || 0,
- });
- this.setData({
- isKaoheguan: true,
- shenheZongshu: data.shenhe_zongshu || 0,
- tongguoZongshu: data.tongguo_zongshu || 0,
- kaoheYue: data.yue || '0.00',
- kaoheZonge: data.zonge || '0.00',
- pendingShenheCount: data.pending_shenhe_count || 0,
- });
- this._updateTotalAssets();
- }
- },
-
- async fetchGuanshiChenghaoList() {
- try {
- const res = await request({
- url: '/dengji/chenghao',
- method: 'POST',
- data: { role: 'guanshi' },
- });
- if (res && res.data.code === 0 && res.data.data) {
- this.setData({ guanshiChenghaoList: res.data.data.chenghao_list || [] });
- }
- } catch (e) {}
- },
-
- _isAlreadyGuanshiMsg(msg) {
- if (!msg || typeof msg !== 'string') return false;
- return msg.includes('已是管事') || msg.includes('已经是管事');
- },
-
- async _applyGuanshiRegisterSuccess(userData, toastMsg) {
- const data = userData || {};
- syncRoleStatuses(data);
- syncProfileFields(data);
- syncGroupFields(data);
- if (data.token) {
- wx.setStorageSync('token', data.token);
- getApp().globalData.token = data.token;
- }
- if (!Object.prototype.hasOwnProperty.call(data, 'guanshistatus') &&
- !isRoleStatusActive(wx.getStorageSync('guanshistatus'))) {
- wx.setStorageSync('guanshistatus', 1);
- getApp().globalData.guanshistatus = 1;
- }
- const app = getApp();
- if (!app.globalData.guanshi) app.globalData.guanshi = {};
- const guanshiData = {
- gszhstatus: data.gszhstatus ?? '',
- yaoqingzongshu: data.yaoqingzongshu ?? 0,
- fenyongzonge: data.fenyongzonge ?? '0.00',
- fenyongtixian: data.fenyongtixian ?? '0.00',
- yichongzhiDashou: data.yichongzhiDashou ?? 0,
- };
- Object.assign(app.globalData.guanshi, guanshiData);
- const zhuanhualv = guanshiData.yaoqingzongshu > 0
- ? (guanshiData.yichongzhiDashou / guanshiData.yaoqingzongshu * 100).toFixed(1)
- : 0;
- this.checkRoleStatuses();
- if (isRoleStatusActive(wx.getStorageSync('dashoustatus'))) {
- this.setData({ isDashou: true, uid: data.uid || wx.getStorageSync('uid') || '' });
- this.loadAvatar();
- }
- this.setData({
- isGuanshi: true,
- ...guanshiData,
- zhuanhualv,
- isLoading: false,
- guanshiInviteCode: '',
- });
- lockPrimaryRole('dashou');
- ensureRoleOnCenterPage(this, 'dashou');
- await this.refreshAllInfo(false);
- wx.hideLoading();
- wx.showToast({ title: toastMsg || '管事注册成功', icon: 'success', duration: 2000 });
- },
-
- handleGuanshiInviteCodeWithLoginCheck(inviteCode) {
- const token = wx.getStorageSync('token');
- const uid = wx.getStorageSync('uid');
- if (!token || !uid) {
- this.loginAndRegisterGuanshiWithInviteCode(inviteCode);
- } else if (!this.data.isGuanshi) {
- wx.showLoading({ title: '管事注册中...', mask: true });
- this.callGuanshiRegisterApi(inviteCode);
- } else {
- lockPrimaryRole('dashou');
- ensureRoleOnCenterPage(this, 'dashou');
- wx.showToast({ title: '您已是管事', icon: 'success' });
- }
- },
-
- loginAndRegisterGuanshiWithInviteCode(inviteCode) {
- const that = this;
- wx.showLoading({ title: '登录注册中...', mask: true });
- wx.login({
- success: (loginRes) => {
- if (loginRes.code) {
- that.callGuanshiLoginRegisterApi(loginRes.code, inviteCode);
- } else {
- wx.hideLoading();
- wx.showToast({ title: '微信登录失败', icon: 'none' });
- }
- },
- fail: () => {
- wx.hideLoading();
- wx.showToast({ title: '微信登录失败', icon: 'none' });
- },
- });
- },
-
- callGuanshiLoginRegisterApi(code, inviteCode) {
- const that = this;
- const app = getApp();
- const apiBaseUrl = app.globalData.apiBaseUrl;
- if (!apiBaseUrl) {
- wx.hideLoading();
- wx.showToast({ title: '服务器配置错误', icon: 'none' });
- return;
- }
- wx.request({
- url: apiBaseUrl + '/yonghu/zuzhangyqmzc',
- method: 'POST',
- data: { code, inviteCode },
- header: { 'content-type': 'application/json' },
- success: (res) => {
- const body = res.data || {};
- if (res.statusCode === 200 && that._isApiSuccess(body)) {
- const userData = that._extractUserData(body);
- const toastMsg = that._isAlreadyGuanshiMsg(that._getApiMsg(body))
- ? that._getApiMsg(body)
- : '管事注册成功';
- that._applyGuanshiRegisterSuccess(userData, toastMsg);
- } else if (res.statusCode === 200 && that._isAlreadyGuanshiMsg(that._getApiMsg(body))) {
- that._applyGuanshiRegisterSuccess(that._extractUserData(body), that._getApiMsg(body) || '您已是管事');
- } else {
- wx.hideLoading();
- wx.showToast({ title: that._getApiMsg(body) || '注册失败', icon: 'none' });
- }
- },
- fail: () => {
- wx.hideLoading();
- wx.showToast({ title: '网络请求失败', icon: 'none' });
- },
- });
- },
-
- async callGuanshiRegisterApi(inviteCode) {
- try {
- const res = await request({
- url: '/yonghu/guanshizhuce',
- method: 'POST',
- data: { inviteCode },
- });
- const body = res?.data || {};
- if (res && this._isApiSuccess(body)) {
- const userData = this._extractUserData(body);
- const toastMsg = this._isAlreadyGuanshiMsg(this._getApiMsg(body))
- ? this._getApiMsg(body)
- : '管事注册成功';
- await this._applyGuanshiRegisterSuccess(userData, toastMsg);
- } else if (this._isAlreadyGuanshiMsg(this._getApiMsg(body))) {
- await this._applyGuanshiRegisterSuccess(this._extractUserData(body), this._getApiMsg(body) || '您已是管事');
- } else {
- wx.hideLoading();
- wx.showToast({ title: this._getApiMsg(body) || '注册失败', icon: 'none' });
- }
- } catch (e) {
- wx.hideLoading();
- wx.showToast({ title: e.message || '注册失败', icon: 'none' });
- }
- },
-
- goToGuanshiWithdraw() {
- wx.navigateTo({ url: '/pages/withdraw/withdraw' });
- },
-
- goToZuzhangWithdraw() {
- wx.navigateTo({ url: `/pages/withdraw/withdraw?from=zuzhang&amount=${this.data.ketixian}` });
- },
-
- goToInviteUser() { wx.navigateTo({ url: '/pages/invite-fighter/invite-fighter' }); },
- goToMySubordinate() { wx.navigateTo({ url: '/pages/my-fighter/my-fighter' }); },
- goToRechargeRecord() { wx.navigateTo({ url: '/pages/recharge-log/recharge-log' }); },
- goToGuanshiRanking() {
- wx.navigateTo({ url: '/pages/fighter-rank/fighter-rank?type=guanshi' });
- },
- goToPromoPoster() { wx.navigateTo({ url: '/pages/poster/poster' }); },
- goToFenhongJilu() { wx.navigateTo({ url: '/pages/leader-bonus-log/leader-bonus-log' }); },
- goToYaoqingGuanshi() { wx.navigateTo({ url: '/pages/invite-manager/invite-manager' }); },
- goToGuanshiAuthPage() { wx.navigateTo({ url: '/pages/verify/verify?type=guanshi' }); },
-
- async contactZuzhang() {
- wx.showLoading({ title: '获取组长信息...', mask: true });
- try {
- const res = await request({ url: '/yonghu/guanshi_contact', method: 'POST' });
- if (res && res.data.code === 200 && res.data.data) {
- const inviter = res.data.data;
- const fullAvatar = resolveAvatarUrl(inviter.touxiang);
- const cacheData = { uid: inviter.uid, nicheng: inviter.nicheng || '', avatar: fullAvatar };
- wx.setStorageSync('zuzhangInviterCache', cacheData);
- this.setData({ zuzhangInviterCache: cacheData });
- await openPrivateChat(this, {
- toUserId: buildInviterPeerId(inviter.uid),
- toName: inviter.nicheng || '组长',
- toAvatar: fullAvatar,
- });
- } else {
- wx.showToast({ title: '未绑定邀请人', icon: 'none' });
- }
- } catch (e) {
- wx.showToast({ title: '网络错误', icon: 'none' });
- } finally {
- wx.hideLoading();
- }
- },
-
- async fetchChenghaoList() {
- try {
- const res = await request({
- url: '/dengji/dsbqhq',
- method: 'POST'
- });
- if (res && res.data.code === 0 && res.data.data) {
- const list = res.data.data.chenghao_list || [];
- this.setData({ chenghaoList: list });
- const app = getApp();
- app.globalData.chenghaoList = list;
- } else {
- this.setData({ chenghaoList: [] });
- }
- } catch (e) {
- }
- },
-
- // 联系邀请人
- async contactInviter() {
- wx.showLoading({ title: '获取邀请人...', mask: true });
- try {
- const res = await request({ url: '/yonghu/hqwdyqr', method: 'POST' });
- if (res && res.data.code === 200 && res.data.data) {
- const inviter = res.data.data;
- const fullAvatar = resolveAvatarUrl(inviter.touxiang);
- const cacheData = {
- uid: inviter.uid,
- nicheng: inviter.nicheng || '',
- avatar: fullAvatar,
- };
- wx.setStorageSync('inviterCache', cacheData);
- this.setData({ inviterCache: cacheData });
- await openPrivateChat(this, {
- toUserId: buildInviterPeerId(inviter.uid),
- toName: inviter.nicheng || '管事',
- toAvatar: fullAvatar,
- });
- } else {
- wx.showToast({ title: res?.data?.msg || '获取失败', icon: 'none' });
- }
- } catch (e) {
- wx.showToast({ title: '网络错误', icon: 'none' });
- } finally {
- wx.hideLoading();
- }
- },
-
- handleInviteCodeWithLoginCheck(inviteCode) {
- const that = this;
- const token = wx.getStorageSync('token');
- const uid = wx.getStorageSync('uid');
- if (!token || !uid) {
- this.loginAndRegisterWithInviteCode(inviteCode);
- } else {
- if (!that.data.isDashou) {
- wx.showLoading({ title: '自动注册中...', mask: true });
- that.setData({ isAutoRegistering: true });
- that.onRegister();
- } else {
- wx.showToast({ title: '您已是接单员', icon: 'success', duration: 2000 });
- }
- }
- },
-
- loginAndRegisterWithInviteCode(inviteCode) {
- const that = this;
- wx.showLoading({ title: '登录注册中...', mask: true });
- wx.login({
- success: (loginRes) => {
- if (loginRes.code) {
- that.callLoginRegisterApi(loginRes.code, inviteCode);
- } else {
- wx.hideLoading();
- wx.showToast({ title: '微信登录失败', icon: 'none' });
- }
- },
- fail: () => {
- wx.hideLoading();
- console.error('微信登录失败');
- wx.reLaunch({ url: '/pages/mine/mine' });
- }
- });
- },
-
- callLoginRegisterApi(code, inviteCode) {
- const that = this;
- const app = getApp();
- const apiBaseUrl = app.globalData.apiBaseUrl;
- if (!apiBaseUrl) {
- wx.hideLoading();
- wx.showToast({ title: '服务器配置错误', icon: 'none' });
- return;
- }
- wx.request({
- url: apiBaseUrl + '/yonghu/wdlyhdl',
- method: 'POST',
- data: { code: code, inviteCode: inviteCode },
- header: { 'content-type': 'application/json' },
- success: (res) => {
- if (res.statusCode === 200 && res.data && res.data.code === 0 && res.data.data) {
- const userData = res.data.data;
- syncProfileFields(userData);
- syncRoleStatuses(userData);
- syncGroupFields(userData);
- if (userData.token) wx.setStorageSync('token', userData.token);
- const identityFields = ['nicheng', 'uid', 'touxiang', 'dashoustatus', 'guanshistatus', 'shangjiastatus', 'zuzhangstatus'];
- identityFields.forEach(field => {
- if (userData[field] !== undefined) {
- wx.setStorageSync(field, userData[field]);
- app.globalData[field] = userData[field];
- }
- });
- const groupFields = ['dashouqun', 'dashouqunid', 'guanshiqun', 'guanshiqunid'];
- groupFields.forEach(field => {
- if (userData[field] !== undefined) {
- wx.setStorageSync(field, userData[field]);
- app.globalData[field] = userData[field];
- }
- });
- if (userData.dashounicheng || userData.yongjin) {
- const updateData = {
- dashouNicheng: userData.dashounicheng || '',
- zhanghaoStatus: userData.zhanghaostatus || '',
- yongjin: userData.yongjin || '0.00',
- zonge: userData.zonge || '0.00',
- yajin: userData.yajin || '0.00',
- chenghao: userData.chenghao || '',
- jinfen: userData.jifen || userData.jinfen || '0',
- clumber: userData.clumber || [],
- chengjiaoliang: userData.chengjiaoliang || '0',
- zaixianZhuangtai: userData.zaixianzhuangtai || 0,
- dashouzhuangtai: userData.dashouzhuangtai || '',
- };
- Object.assign(app.globalData, updateData);
- }
- that.setData({
- isDashou: true,
- uid: userData.uid || '',
- touxiang: userData.touxiang || '',
- isAutoRegistering: false
- });
- that.loadAvatar();
- that.getDashouInfo();
- that.switchToDashouRole();
- lockPrimaryRole('dashou');
- wx.hideLoading();
- wx.showToast({ title: '登录注册成功!', icon: 'success', duration: 2000 });
- } else {
- wx.hideLoading();
- wx.showToast({ title: (res.data && res.data.msg) || '登录注册失败', icon: 'none' });
- }
- },
- fail: () => {
- wx.hideLoading();
- wx.showToast({ title: '网络请求失败', icon: 'none' });
- }
- });
- },
-
- checkDashouStatus() {
- try {
- const dashoustatus = wx.getStorageSync('dashoustatus');
- const uid = wx.getStorageSync('uid');
- const touxiang = wx.getStorageSync('touxiang');
- if (isRoleStatusActive(dashoustatus)) {
- this.setData({ isDashou: true, uid: uid || '', touxiang: touxiang || '' });
- this.loadAvatar();
- this.checkGlobalData();
- ensureRoleOnCenterPage(this, 'dashou');
- } else {
- this.setData({ isDashou: false });
- }
- } catch (error) {
- console.error('读取缓存失败:', error);
- this.setData({ isDashou: false });
- }
- },
-
- checkGlobalData() {
- const app = getApp();
- const globalData = app.globalData || {};
- const needRefresh = !globalData.dashouNicheng || globalData.dashouNicheng === '' || !globalData.yongjin;
- if (needRefresh) {
- this.getDashouInfo();
- } else {
- this.setDataFromGlobalData();
- }
- },
-
- setDataFromGlobalData() {
- const app = getApp();
- const {
- dashouNicheng = '', zhanghaoStatus = '', yongjin = '0.00', zonge = '0.00',
- yajin = '0.00', chenghao = '', jinfen = '0', clumber = [],
- chengjiaoliang = '0', zaixianZhuangtai = 0
- } = app.globalData || {};
- this.setData({
- dashouNicheng, zhanghaoStatus, yongjin, zonge, yajin,
- chenghao, jinfen,
- clumber: Array.isArray(clumber) ? clumber : [],
- chengjiaoliang,
- zaixianZhuangtai: zaixianZhuangtai === 1 ? 1 : 0
- });
- },
-
- async getDashouInfo() {
- this.setData({ isLoading: true });
- try {
- const res = await request({ url: '/yonghu/dashouxinxi', method: 'POST' });
- if (res && res.data.code == 200) {
- const data = res.data.data;
- const app = getApp();
- const updateData = {
- dashouNicheng: data.dashounicheng || '',
- zhanghaoStatus: data.zhanghaostatus || '',
- yongjin: data.yongjin || '0.00',
- zonge: data.zonge || '0.00',
- yajin: data.yajin || '0.00',
- chenghao: data.chenghao || '',
- jinfen: data.jifen || '0',
- clumber: data.clumber || [],
- chengjiaoliang: data.chengjiaoliang || '0',
- zaixianZhuangtai: data.zaixianzhuangtai || 0,
- dashouzhuangtai: data.dashouzhuangtai || '',
- };
- Object.assign(app.globalData, updateData);
- if (data.dashoustatus !== undefined) {
- wx.setStorageSync('dashoustatus', data.dashoustatus);
- app.globalData.dashoustatus = data.dashoustatus;
- }
- if (data.guanshistatus !== undefined) {
- wx.setStorageSync('guanshistatus', data.guanshistatus);
- app.globalData.guanshistatus = data.guanshistatus;
- }
- this.setData({ ...updateData, isLoading: false });
- this._updateTotalAssets();
- if (this.data.isAutoRegistering) {
- this.setData({ isAutoRegistering: false });
- wx.showToast({ title: '注册成功!', icon: 'success', duration: 2000 });
- } else {
- wx.showToast({ title: '信息已更新', icon: 'success', duration: 1500 });
- }
- }
- } catch (error) {
- console.error('获取打手信息失败:', error);
- this.setData({ isLoading: false, isAutoRegistering: false });
- wx.showToast({ title: '获取信息失败', icon: 'error', duration: 2000 });
- }
- },
-
- onInviteCodeInput(e) {
- this.setData({ inviteCode: e.detail.value.trim() });
- },
-
- async onRegister() {
- const { inviteCode } = this.data;
- if (!inviteCode) {
- wx.showToast({ title: '请输入邀请码', icon: 'none', duration: 2000 });
- return;
- }
- if (inviteCode.length > 100) {
- wx.showToast({ title: '邀请码不能超过100字符', icon: 'none', duration: 2000 });
- return;
- }
- this.setData({ isLoading: true });
- try {
- const res = await request({
- url: '/yonghu/dashouzhuce',
- method: 'POST',
- data: { inviteCode: inviteCode }
- });
- if (res && res.data.code == 200) {
- const data = res.data.data || {};
- const app = getApp();
- syncRoleStatuses(data);
- syncProfileFields(data);
- if (data.dashoustatus === undefined && !isRoleStatusActive(wx.getStorageSync('dashoustatus'))) {
- wx.setStorageSync('dashoustatus', 1);
- app.globalData.dashoustatus = 1;
- }
- const identityFields = ['dashoustatus', 'guanshistatus', 'shangjiastatus', 'zuzhangstatus'];
- identityFields.forEach(field => {
- if (data[field] !== undefined) {
- wx.setStorageSync(field, data[field]);
- app.globalData[field] = data[field];
- }
- });
- const updateData = {
- dashouNicheng: data.dashounicheng || '',
- zhanghaoStatus: data.zhanghaostatus || '',
- yongjin: data.yongjin || '0.00',
- zonge: data.zonge || '0.00',
- yajin: data.yajin || '0.00',
- chenghao: data.chenghao || '',
- jinfen: data.jinfen || '0',
- clumber: data.clumber || [],
- chengjiaoliang: data.chengjiaoliang || '0',
- zaixianZhuangtai: data.zaixianzhuangtai || 0,
- dashouzhuangtai: data.dashouzhuangtai || '',
- };
- Object.assign(app.globalData, updateData);
- this.setData({
- isDashou: true,
- ...updateData,
- isLoading: false,
- isAutoRegistering: false
- });
- this.loadAvatar();
- ensureRoleOnCenterPage(this, 'dashou');
- lockPrimaryRole('dashou');
- wx.showToast({ title: '注册成功!', icon: 'success', duration: 2000 });
- } else {
- this.setData({ isLoading: false, isAutoRegistering: false });
- wx.showToast({ title: (res.data && res.data.message) || '注册失败', icon: 'error', duration: 2000 });
- }
- } catch (error) {
- console.error('注册失败:', error);
- this.setData({ isLoading: false, isAutoRegistering: false });
- wx.showToast({ title: error.message || '注册失败', icon: 'error', duration: 2000 });
- }
- },
-
- switchToDashouRole() {
- ensureRoleOnCenterPage(this, 'dashou');
- },
-
- previewAvatar() {
- const { avatarUrl } = this.data;
- if (avatarUrl) wx.previewImage({ urls: [avatarUrl] });
- },
-
- goToWithdraw() { wx.navigateTo({ url: '/pages/withdraw/withdraw' }) },
- goToTotalWithdraw() { this.goToWithdraw(); },
-
- goToAuth(e) {
- const type = e.currentTarget.dataset.type;
- if (!type || !['dashou', 'shangjia', 'guanshi', 'zuzhang'].includes(type)) return;
- const statusMap = {
- dashou: 'dashoustatus',
- shangjia: 'shangjiastatus',
- guanshi: 'guanshistatus',
- zuzhang: 'zuzhangstatus',
- };
- const statusKey = statusMap[type];
- if (isRoleStatusActive(wx.getStorageSync(statusKey))) {
- if (type === 'shangjia') {
- enterLockedRole('shangjia', getApp());
- }
- return;
- }
- wx.navigateTo({ url: `/pages/verify/verify?type=${type}` });
- },
-
- onTapAuthItem(e) {
- const type = e.currentTarget.dataset.type;
- if (type === 'shangjia') {
- this.onTapShangjiaAuth();
- return;
- }
- this.goToAuth(e);
- },
-
- enterShangjiaCenter() {
- if (!this.data.shangjiaCertified) {
- wx.navigateTo({ url: '/pages/verify/verify?type=shangjia' });
- return;
- }
- enterLockedRole('shangjia', getApp());
- },
-
- onTapShangjiaAuth() {
- if (this.data.shangjiaCertified) {
- this.enterShangjiaCenter();
- return;
- }
- wx.navigateTo({ url: '/pages/verify/verify?type=shangjia' });
- },
- goToReceiveOrder() { wx.navigateTo({ url: '/pages/accept-order/accept-order' }) },
- goToMyOrders() { wx.navigateTo({ url: '/pages/fighter-orders/fighter-orders' }) },
- goToMyPunishment() { wx.navigateTo({ url: '/pages/penalty/penalty/penalty' }) },
- goToRecharge() { wx.navigateTo({ url: '/pages/fighter-recharge/fighter-recharge' }) },
- goToRanking(e) {
- const type = e?.currentTarget?.dataset?.type || 'dashou';
- wx.navigateTo({ url: `/pages/fighter-rank/fighter-rank?type=${type}` });
- },
- goToGuanzhuKs() { wx.navigateTo({ url: '/pages/manager-assign/manager-assign' }) },
- goToKaoheDafen() { wx.navigateTo({ url: '/pages/assess-score/assess-score' }) },
- goToKaoheJilu() { wx.navigateTo({ url: '/pages/assess-log/assess-log' }) },
- goToKaoheZhongxin() { wx.navigateTo({ url: '/pages/assess-center/assess-center' }) },
- goToKaoheWithdraw() {
- const yue = this.data.kaoheYue || '0.00';
- wx.navigateTo({ url: `/pages/withdraw/withdraw?amount=${yue}&from=kaoheguan` });
- },
- goToModifyInfo() { wx.navigateTo({ url: '/pages/fighter-edit/fighter-edit' }) },
- goToRules() { wx.navigateTo({ url: '/pages/fighter-rules/fighter-rules' }) },
- goToKaohe() {
- wx.navigateTo({ url: '/pages/assess-gold/assess-gold' });
- },
-
- quickRegisterAsPlatform() {
- const that = this;
- wx.showModal({
- title: '提示',
- content: '使用此功能后,您将不属于任何管事,确认注册吗?',
- success: (res) => {
- if (res.confirm) {
- that.setData({ inviteCode: PLATFORM_INVITE_CODE });
- that.onRegister();
- }
- }
- });
- },
-
-}, { roleConfig: { role: 'dashou', statusKey: 'dashoustatus', dataFlag: 'isDashou', pageId: 'dashouduan', apiUrl: '/yonghu/dashouxinxi' } }))
+// pages/dashouzhongxin/dashouzhongxin.js
+import { createPage, request, isRoleStatusActive, isCenterPageActive, syncRoleStatuses, syncProfileFields, syncGroupFields, ensureRoleOnCenterPage, clearCacheAndEnterNormal, lockPrimaryRole, migrateLegacyCenterRole, enterLockedRole, parseSceneOptions } from '../../utils/base-page.js'
+import { resolveAvatarUrl } from '../../utils/avatar.js'
+import { openPrivateChat, buildInviterPeerId } from '../../utils/im-user.js'
+
+const PLATFORM_INVITE_CODE = '0000008RffVgKHMj7kQC'
+
+Page(createPage({
+ data: {
+ // 图片路径对象
+ imgUrls: {},
+
+ isDashou: false,
+ isGuanshi: false,
+ isZuzhang: false,
+ isKaoheguan: false,
+ isShangjia: false,
+ shangjiaCertified: false,
+ totalAssets: '0.00',
+ assetBreakdown: [],
+ pendingAuthList: [],
+ showAuthSection: false,
+ inviteCode: '',
+ guanshiInviteCode: '',
+ zuzhangInviteCode: '',
+ uid: '',
+ touxiang: '',
+ avatarUrl: '',
+ dashouNicheng: '',
+ zhanghaoStatus: '',
+ yongjin: '',
+ zonge: '',
+ yajin: '',
+ chenghao: '',
+ jinfen: '',
+ clumber: [],
+ chengjiaoliang: '',
+ zaixianZhuangtai: 0,
+ isAutoRegistering: false,
+ inviterCache: null,
+ zuzhangInviterCache: null,
+ chenghaoList: [],
+ guanshiChenghaoList: [],
+ gszhstatus: '',
+ yaoqingzongshu: 0,
+ fenyongzonge: '0.00',
+ fenyongtixian: '0.00',
+ yichongzhiDashou: 0,
+ zhuanhualv: 0,
+ ketixian: '0.00',
+ guanshiCount: 0,
+ fenhongZonge: '0.00',
+ kaoheYue: '0.00',
+ kaoheZonge: '0.00',
+ shenheZongshu: 0,
+ tongguoZongshu: 0,
+ pendingShenheCount: 0,
+ layoutSparse: false,
+ rankBoardList: [
+ { type: 'dashou', name: '接单员榜', sub: '接单成交', icon: '', shapeClass: 'rank-shape-left', themeClass: 'rank-theme-blue' },
+ { type: 'guanshi', name: '管事榜', sub: '邀请收入', icon: '', shapeClass: 'rank-shape-right', themeClass: 'rank-theme-gold' },
+ { type: 'zuzhang', name: '组长榜', sub: '团队分红', icon: '', shapeClass: 'rank-shape-left', themeClass: 'rank-theme-purple' },
+ { type: 'shangjia', name: '商家榜', sub: '派单流水', icon: '', shapeClass: 'rank-shape-right', themeClass: 'rank-theme-orange' },
+ ],
+
+ statusBar: 20,
+ navBar: 44,
+ },
+
+ _buildImgUrls(ossImageUrl) {
+ const dsBase = ossImageUrl + 'beijing/dashouduan/';
+ const iconBase = ossImageUrl + 'beijing/dashouduan/dashoutubiaobeijing/';
+ const gsBase = ossImageUrl + 'beijing/guanshiduan/';
+ const khBase = ossImageUrl + 'beijing/kaohe/';
+ return {
+ pageBg: dsBase + 'page-bg.jpg',
+ userCardBg: dsBase + 'user-card-bg.png',
+ vipCardBg: dsBase + 'vip-card-bg.jpg',
+ assetPanelBg: dsBase + 'asset-panel-bg.png',
+ rankHubBg: dsBase + 'rank-hub-bg.png',
+ rankTileBg: dsBase + 'rank-tile-bg.png',
+ funcPanelBg: dsBase + 'func-panel-bg.png',
+ listBg: dsBase + 'list-card-bg.png',
+ topBg: iconBase + 'top-bg.jpg',
+ cardBg: iconBase + 'card-bg.jpg',
+ iconRefresh: gsBase + 'icon-refresh.png',
+ iconCopy: gsBase + 'icon-copy.png',
+ iconVip: dsBase + 'icon-vip.png',
+ iconArrowLight: dsBase + 'icon-arrow-light.png',
+ iconSectionAsset: dsBase + 'icon-section-asset.png',
+ iconSectionRank: dsBase + 'icon-section-rank.png',
+ iconSectionFunc: dsBase + 'icon-section-func.png',
+ iconSectionGuanshi: dsBase + 'icon-section-guanshi.png',
+ iconSectionZuzhang: dsBase + 'icon-section-zuzhang.png',
+ iconSectionKaohe: dsBase + 'icon-section-kaohe.png',
+ iconSectionMore: dsBase + 'icon-section-more.png',
+ iconRankDashou: dsBase + 'rank-dashou.png',
+ iconRankGuanshi: dsBase + 'rank-guanshi.png',
+ iconRankZuzhang: dsBase + 'rank-zuzhang.png',
+ iconRankShangjia: dsBase + 'rank-shangjia.png',
+ iconGame: iconBase + 'icon-game.jpg',
+ iconRecharge: iconBase + 'icon-recharge.jpg',
+ iconOrders: iconBase + 'icon-orders.jpg',
+ iconPunish: iconBase + 'icon-punish.jpg',
+ iconRank: iconBase + 'icon-rank.jpg',
+ iconInvite: gsBase + 'icon-invite.png',
+ iconMedal: iconBase + 'icon-medal.jpg',
+ iconEdit: iconBase + 'icon-edit.jpg',
+ iconBook: iconBase + 'icon-book.jpg',
+ iconArrow: gsBase + 'icon-arrow.png',
+ iconSub: gsBase + 'icon-sub.png',
+ iconRecord: gsBase + 'icon-record.png',
+ iconPoster: gsBase + 'icon-poster.png',
+ iconWithdraw: gsBase + 'icon-withdraw.png',
+ iconContact: gsBase + 'icon-contact.png',
+ avatarDefault: ossImageUrl + 'avatar/default.jpg',
+ iconClear: ossImageUrl + 'beijing/tubiao/grzx_qingchu.jpg',
+ iconSwitch: '/images/_exit.png',
+ iconKefu: ossImageUrl + 'beijing/tubiao/grzx_kefu.jpg',
+ iconKuaishou: ossImageUrl + 'beijing/tubiao/grzx_guanzhualong.jpg',
+ iconKaoheDafen: khBase + 'daofen.png',
+ iconKaoheJilu: khBase + 'jilu.png',
+ iconKaoheZhongxin: khBase + 'zhongxin.png',
+ iconShangjia: ossImageUrl + 'beijing/tubiao/grzx_shangjia.jpg',
+ iconDashouAuth: ossImageUrl + 'beijing/tubiao/grzx_dashou.jpg',
+ iconGuanshiAuth: ossImageUrl + 'beijing/tubiao/grzx_guanshi.jpg',
+ iconZuzhangAuth: ossImageUrl + 'beijing/tubiao/grzx_zuzhang.jpg',
+ kefuBannerBg: dsBase + 'kefu-banner-bg.png',
+ totalAssetBg: dsBase + 'total-asset-bg.png',
+ authPanelBg: dsBase + 'auth-panel-bg.png',
+ bannerVip: 'https://bintao-1308403501.cos.ap-guangzhou.myqcloud.com/uploads/images/20260512123427531240452.png',
+ bannerDeposit: 'https://bintao-1308403501.cos.ap-guangzhou.myqcloud.com/uploads/images/202605121234283091d3980.png',
+ };
+ },
+
+ _applyRankBoardIcons(imgUrls) {
+ const iconMap = {
+ dashou: imgUrls.iconRankDashou,
+ guanshi: imgUrls.iconRankGuanshi,
+ zuzhang: imgUrls.iconRankZuzhang,
+ shangjia: imgUrls.iconRankShangjia,
+ };
+ return (this.data.rankBoardList || []).map((item) => ({
+ ...item,
+ icon: iconMap[item.type] || imgUrls.iconRank,
+ }));
+ },
+
+ onLoad(options) {
+ const app = getApp();
+ const sys = wx.getSystemInfoSync();
+ const ossImageUrl = app.globalData.ossImageUrl || '';
+ const imgUrls = this._buildImgUrls(ossImageUrl);
+ this.setData({
+ imgUrls,
+ rankBoardList: this._applyRankBoardIcons(imgUrls),
+ statusBar: sys.statusBarHeight || 20,
+ navBar: (sys.statusBarHeight || 20) + 44,
+ });
+ this.checkRoleStatuses();
+
+ const parsed = parseSceneOptions(options);
+ const registerType = parsed.registerType || 'dashou';
+ const { inviteCode } = parsed;
+ this.checkDashouStatus();
+ if (inviteCode) {
+ if (registerType === 'guanshi') {
+ this.setData({ guanshiInviteCode: inviteCode });
+ setTimeout(() => {
+ this.handleGuanshiInviteCodeWithLoginCheck(inviteCode);
+ }, 500);
+ } else {
+ this.setData({ inviteCode });
+ setTimeout(() => {
+ this.handleInviteCodeWithLoginCheck(inviteCode);
+ }, 500);
+ }
+ }
+ this.checkColdStartPopup('dashouduan');
+ },
+
+ onShow() {
+ migrateLegacyCenterRole(getApp());
+ lockPrimaryRole('dashou', getApp());
+ wx.setStorageSync('isJinpai', 0);
+ ensureRoleOnCenterPage(this, 'dashou');
+
+ const inviterCache = wx.getStorageSync('inviterCache') || null;
+ const zuzhangInviterCache = wx.getStorageSync('zuzhangInviterCache') || null;
+ this.setData({ inviterCache, zuzhangInviterCache });
+
+ this.registerNotificationComponent();
+ this.checkRoleStatuses();
+ if (isCenterPageActive(this, 'isDashou', 'dashoustatus')) {
+ if (!this.data.isDashou) this.setData({ isDashou: true });
+ ensureRoleOnCenterPage(this, 'dashou');
+ setTimeout(() => this.refreshAllInfo(false), 300);
+ } else if (isRoleStatusActive(wx.getStorageSync('guanshistatus')) ||
+ isRoleStatusActive(wx.getStorageSync('zuzhangstatus')) ||
+ isRoleStatusActive(wx.getStorageSync('kaoheguanstatus'))) {
+ ensureRoleOnCenterPage(this, 'dashou');
+ setTimeout(() => this.refreshAllInfo(false), 300);
+ }
+ const pages = getCurrentPages();
+ const currentPage = pages[pages.length - 1];
+ const options = currentPage.options || {};
+ const registerType = options.registerType || 'dashou';
+ if (options.inviteCode) {
+ if (registerType === 'guanshi' && !isRoleStatusActive(wx.getStorageSync('guanshistatus'))) {
+ setTimeout(() => {
+ this.handleGuanshiInviteCodeWithLoginCheck(options.inviteCode);
+ }, 300);
+ } else if (registerType !== 'guanshi' && !isCenterPageActive(this, 'isDashou', 'dashoustatus')) {
+ setTimeout(() => {
+ this.handleInviteCodeWithLoginCheck(options.inviteCode);
+ }, 300);
+ }
+ }
+ },
+
+ checkRoleStatuses() {
+ const isDashou = isRoleStatusActive(wx.getStorageSync('dashoustatus'));
+ const isGuanshi = isRoleStatusActive(wx.getStorageSync('guanshistatus'));
+ const isZuzhang = isRoleStatusActive(wx.getStorageSync('zuzhangstatus'));
+ const isKaoheguan = isRoleStatusActive(wx.getStorageSync('kaoheguanstatus'));
+ const isShangjia = isRoleStatusActive(wx.getStorageSync('shangjiastatus'));
+ const subRoleCount = [isGuanshi, isZuzhang, isKaoheguan].filter(Boolean).length;
+ this.setData({
+ isDashou, isGuanshi, isZuzhang, isKaoheguan,
+ isShangjia,
+ shangjiaCertified: isShangjia,
+ layoutSparse: subRoleCount === 0,
+ }, () => {
+ this._updateTotalAssets();
+ this._updatePendingAuth();
+ });
+ if (isDashou) {
+ const uid = wx.getStorageSync('uid') || '';
+ const touxiang = wx.getStorageSync('touxiang') || '';
+ this.setData({ uid, touxiang });
+ this.loadAvatar();
+ }
+ },
+
+ _parseMoney(val) {
+ return parseFloat(String(val || '0').replace(/,/g, '')) || 0;
+ },
+
+ _updateTotalAssets() {
+ const d = this.data;
+ const breakdown = [{ label: '接单员佣金', amount: d.yongjin || '0.00' }];
+ let total = this._parseMoney(d.yongjin);
+ if (d.isGuanshi) {
+ total += this._parseMoney(d.fenyongtixian);
+ breakdown.push({ label: '管事分成', amount: d.fenyongtixian || '0.00' });
+ }
+ if (d.isZuzhang) {
+ total += this._parseMoney(d.ketixian);
+ breakdown.push({ label: '组长余额', amount: d.ketixian || '0.00' });
+ }
+ if (d.isKaoheguan) {
+ total += this._parseMoney(d.kaoheYue);
+ breakdown.push({ label: '考核余额', amount: d.kaoheYue || '0.00' });
+ }
+ this.setData({ totalAssets: total.toFixed(2), assetBreakdown: breakdown });
+ },
+
+ /** 打手端:已认证不展示;商家始终第一位 */
+ _updatePendingAuth() {
+ const d = this.data;
+ const img = d.imgUrls || {};
+ const list = [];
+ list.push({
+ type: 'shangjia',
+ name: '商家',
+ icon: img.iconShangjia,
+ tag: d.shangjiaCertified ? '进入商家端' : '去认证',
+ done: d.shangjiaCertified,
+ });
+ if (!d.isGuanshi) {
+ list.push({ type: 'guanshi', name: '管事', icon: img.iconGuanshiAuth, tag: '去认证' });
+ }
+ if (!d.isZuzhang) {
+ list.push({ type: 'zuzhang', name: '组长', icon: img.iconZuzhangAuth, tag: '去认证' });
+ }
+ if (!d.isDashou) {
+ list.push({ type: 'dashou', name: '接单员', icon: img.iconDashouAuth, tag: '去认证' });
+ }
+ this.setData({
+ pendingAuthList: list,
+ showAuthSection: list.length > 0,
+ });
+ },
+
+ async refreshAllInfo(showToast = true) {
+ this.throttledRefresh(async () => {
+ this.setData({ isLoading: true });
+ try {
+ this.checkRoleStatuses();
+ const results = await Promise.allSettled([
+ this._fetchDashouInfoSilent(),
+ this.fetchChenghaoList(),
+ this._fetchGuanshiInfoSilent(),
+ this.fetchGuanshiChenghaoList(),
+ this._fetchZuzhangInfoSilent(),
+ this._fetchKaoheguanInfoSilent(),
+ ]);
+ this.checkRoleStatuses();
+ const dashouOk = results[0].status === 'fulfilled';
+ if (showToast) {
+ wx.showToast({
+ title: dashouOk ? '刷新成功' : '刷新失败',
+ icon: dashouOk ? 'success' : 'none',
+ duration: 1500,
+ });
+ }
+ } catch (e) {
+ if (showToast) {
+ wx.showToast({ title: '刷新失败', icon: 'none' });
+ }
+ } finally {
+ this.setData({ isLoading: false });
+ }
+ }, 3000);
+ },
+
+ refreshDashouInfo() {
+ this.refreshAllInfo(true);
+ },
+
+ onTapRefresh() {
+ this.refreshAllInfo(true);
+ },
+
+ async _fetchDashouInfoSilent() {
+ const res = await request({ url: '/yonghu/dashouxinxi', method: 'POST' });
+ if (res && res.data.code == 200) {
+ const data = res.data.data;
+ const app = getApp();
+ const updateData = {
+ dashouNicheng: data.dashounicheng || '',
+ zhanghaoStatus: data.zhanghaostatus || '',
+ yongjin: data.yongjin || '0.00',
+ zonge: data.zonge || '0.00',
+ yajin: data.yajin || '0.00',
+ chenghao: data.chenghao || '',
+ jinfen: data.jifen || '0',
+ clumber: data.clumber || [],
+ chengjiaoliang: data.chengjiaoliang || '0',
+ zaixianZhuangtai: data.zaixianzhuangtai || 0,
+ dashouzhuangtai: data.dashouzhuangtai || '',
+ };
+ Object.assign(app.globalData, updateData);
+ if (data.dashoustatus !== undefined) {
+ wx.setStorageSync('dashoustatus', data.dashoustatus);
+ app.globalData.dashoustatus = data.dashoustatus;
+ }
+ if (data.guanshistatus !== undefined) {
+ wx.setStorageSync('guanshistatus', data.guanshistatus);
+ app.globalData.guanshistatus = data.guanshistatus;
+ }
+ if (data.zuzhangstatus !== undefined) {
+ wx.setStorageSync('zuzhangstatus', data.zuzhangstatus);
+ app.globalData.zuzhangstatus = data.zuzhangstatus;
+ }
+ this.setData({ ...updateData, isLoading: false });
+ this._updateTotalAssets();
+ return;
+ }
+ throw new Error('打手信息获取失败');
+ },
+
+ async _fetchGuanshiInfoSilent() {
+ const res = await request({ url: '/yonghu/guanshixinxi', method: 'POST' });
+ if (res && this._isApiSuccess(res.data)) {
+ const data = this._extractUserData(res.data);
+ if (data.guanshistatus !== undefined) {
+ wx.setStorageSync('guanshistatus', data.guanshistatus);
+ getApp().globalData.guanshistatus = data.guanshistatus;
+ }
+ if (!isRoleStatusActive(data.guanshistatus ?? wx.getStorageSync('guanshistatus'))) {
+ return;
+ }
+ const app = getApp();
+ if (!app.globalData.guanshi) app.globalData.guanshi = {};
+ const updateData = {
+ gszhstatus: data.gszhstatus || '',
+ yaoqingzongshu: data.yaoqingzongshu || 0,
+ fenyongzonge: data.fenyongzonge || '0.00',
+ fenyongtixian: data.fenyongtixian || '0.00',
+ yichongzhiDashou: data.yichongzhiDashou || 0,
+ };
+ Object.assign(app.globalData.guanshi, updateData);
+ const zhuanhualv = updateData.yaoqingzongshu > 0
+ ? (updateData.yichongzhiDashou / updateData.yaoqingzongshu * 100).toFixed(1)
+ : 0;
+ this.setData({ isGuanshi: true, ...updateData, zhuanhualv });
+ this._updateTotalAssets();
+ return;
+ }
+ },
+
+ async _fetchZuzhangInfoSilent() {
+ const res = await request({ url: '/yonghu/zuzhangxinxi', method: 'POST' });
+ if (res && res.data.code === 200) {
+ const data = res.data.data || {};
+ if (data.zuzhangstatus !== undefined) {
+ wx.setStorageSync('zuzhangstatus', data.zuzhangstatus);
+ getApp().globalData.zuzhangstatus = data.zuzhangstatus;
+ }
+ if (!isRoleStatusActive(data.zuzhangstatus ?? wx.getStorageSync('zuzhangstatus'))) {
+ return;
+ }
+ this.setData({
+ isZuzhang: true,
+ ketixian: data.ketixian || '0.00',
+ guanshiCount: data.guanshiCount || 0,
+ fenhongZonge: data.fenhongZonge || '0.00',
+ });
+ this._updateTotalAssets();
+ return;
+ }
+ },
+
+ async _fetchKaoheguanInfoSilent() {
+ const res = await request({ url: '/dengji/khgsx', method: 'POST' });
+ if (res && res.data.code === 200) {
+ const data = res.data.data || {};
+ if (data.zhuangtai === 0 || data.zhuangtai === 2) {
+ wx.setStorageSync('kaoheguanstatus', 0);
+ getApp().globalData.kaoheguanstatus = 0;
+ this.setData({ isKaoheguan: false });
+ return;
+ }
+ wx.setStorageSync('kaoheguanstatus', 1);
+ getApp().globalData.kaoheguanstatus = 1;
+ const app = getApp();
+ if (!app.globalData.kaoheguan) app.globalData.kaoheguan = {};
+ Object.assign(app.globalData.kaoheguan, {
+ shenhe_zongshu: data.shenhe_zongshu || 0,
+ tongguo_zongshu: data.tongguo_zongshu || 0,
+ yue: data.yue || '0.00',
+ zonge: data.zonge || '0.00',
+ pending_shenhe_count: data.pending_shenhe_count || 0,
+ });
+ this.setData({
+ isKaoheguan: true,
+ shenheZongshu: data.shenhe_zongshu || 0,
+ tongguoZongshu: data.tongguo_zongshu || 0,
+ kaoheYue: data.yue || '0.00',
+ kaoheZonge: data.zonge || '0.00',
+ pendingShenheCount: data.pending_shenhe_count || 0,
+ });
+ this._updateTotalAssets();
+ }
+ },
+
+ async fetchGuanshiChenghaoList() {
+ try {
+ const res = await request({
+ url: '/dengji/chenghao',
+ method: 'POST',
+ data: { role: 'guanshi' },
+ });
+ if (res && res.data.code === 0 && res.data.data) {
+ this.setData({ guanshiChenghaoList: res.data.data.chenghao_list || [] });
+ }
+ } catch (e) {}
+ },
+
+ _isAlreadyGuanshiMsg(msg) {
+ if (!msg || typeof msg !== 'string') return false;
+ return msg.includes('已是管事') || msg.includes('已经是管事');
+ },
+
+ async _applyGuanshiRegisterSuccess(userData, toastMsg) {
+ const data = userData || {};
+ syncRoleStatuses(data);
+ syncProfileFields(data);
+ syncGroupFields(data);
+ if (data.token) {
+ wx.setStorageSync('token', data.token);
+ getApp().globalData.token = data.token;
+ }
+ if (!Object.prototype.hasOwnProperty.call(data, 'guanshistatus') &&
+ !isRoleStatusActive(wx.getStorageSync('guanshistatus'))) {
+ wx.setStorageSync('guanshistatus', 1);
+ getApp().globalData.guanshistatus = 1;
+ }
+ const app = getApp();
+ if (!app.globalData.guanshi) app.globalData.guanshi = {};
+ const guanshiData = {
+ gszhstatus: data.gszhstatus ?? '',
+ yaoqingzongshu: data.yaoqingzongshu ?? 0,
+ fenyongzonge: data.fenyongzonge ?? '0.00',
+ fenyongtixian: data.fenyongtixian ?? '0.00',
+ yichongzhiDashou: data.yichongzhiDashou ?? 0,
+ };
+ Object.assign(app.globalData.guanshi, guanshiData);
+ const zhuanhualv = guanshiData.yaoqingzongshu > 0
+ ? (guanshiData.yichongzhiDashou / guanshiData.yaoqingzongshu * 100).toFixed(1)
+ : 0;
+ this.checkRoleStatuses();
+ if (isRoleStatusActive(wx.getStorageSync('dashoustatus'))) {
+ this.setData({ isDashou: true, uid: data.uid || wx.getStorageSync('uid') || '' });
+ this.loadAvatar();
+ }
+ this.setData({
+ isGuanshi: true,
+ ...guanshiData,
+ zhuanhualv,
+ isLoading: false,
+ guanshiInviteCode: '',
+ });
+ lockPrimaryRole('dashou');
+ ensureRoleOnCenterPage(this, 'dashou');
+ await this.refreshAllInfo(false);
+ wx.hideLoading();
+ wx.showToast({ title: toastMsg || '管事注册成功', icon: 'success', duration: 2000 });
+ },
+
+ handleGuanshiInviteCodeWithLoginCheck(inviteCode) {
+ const token = wx.getStorageSync('token');
+ const uid = wx.getStorageSync('uid');
+ if (!token || !uid) {
+ this.loginAndRegisterGuanshiWithInviteCode(inviteCode);
+ } else if (!this.data.isGuanshi) {
+ wx.showLoading({ title: '管事注册中...', mask: true });
+ this.callGuanshiRegisterApi(inviteCode);
+ } else {
+ lockPrimaryRole('dashou');
+ ensureRoleOnCenterPage(this, 'dashou');
+ wx.showToast({ title: '您已是管事', icon: 'success' });
+ }
+ },
+
+ loginAndRegisterGuanshiWithInviteCode(inviteCode) {
+ const that = this;
+ wx.showLoading({ title: '登录注册中...', mask: true });
+ wx.login({
+ success: (loginRes) => {
+ if (loginRes.code) {
+ that.callGuanshiLoginRegisterApi(loginRes.code, inviteCode);
+ } else {
+ wx.hideLoading();
+ wx.showToast({ title: '微信登录失败', icon: 'none' });
+ }
+ },
+ fail: () => {
+ wx.hideLoading();
+ wx.showToast({ title: '微信登录失败', icon: 'none' });
+ },
+ });
+ },
+
+ callGuanshiLoginRegisterApi(code, inviteCode) {
+ const that = this;
+ const app = getApp();
+ const apiBaseUrl = app.globalData.apiBaseUrl;
+ if (!apiBaseUrl) {
+ wx.hideLoading();
+ wx.showToast({ title: '服务器配置错误', icon: 'none' });
+ return;
+ }
+ wx.request({
+ url: apiBaseUrl + '/yonghu/zuzhangyqmzc',
+ method: 'POST',
+ data: { code, inviteCode },
+ header: { 'content-type': 'application/json' },
+ success: (res) => {
+ const body = res.data || {};
+ if (res.statusCode === 200 && that._isApiSuccess(body)) {
+ const userData = that._extractUserData(body);
+ const toastMsg = that._isAlreadyGuanshiMsg(that._getApiMsg(body))
+ ? that._getApiMsg(body)
+ : '管事注册成功';
+ that._applyGuanshiRegisterSuccess(userData, toastMsg);
+ } else if (res.statusCode === 200 && that._isAlreadyGuanshiMsg(that._getApiMsg(body))) {
+ that._applyGuanshiRegisterSuccess(that._extractUserData(body), that._getApiMsg(body) || '您已是管事');
+ } else {
+ wx.hideLoading();
+ wx.showToast({ title: that._getApiMsg(body) || '注册失败', icon: 'none' });
+ }
+ },
+ fail: () => {
+ wx.hideLoading();
+ wx.showToast({ title: '网络请求失败', icon: 'none' });
+ },
+ });
+ },
+
+ async callGuanshiRegisterApi(inviteCode) {
+ try {
+ const res = await request({
+ url: '/yonghu/guanshizhuce',
+ method: 'POST',
+ data: { inviteCode },
+ });
+ const body = res?.data || {};
+ if (res && this._isApiSuccess(body)) {
+ const userData = this._extractUserData(body);
+ const toastMsg = this._isAlreadyGuanshiMsg(this._getApiMsg(body))
+ ? this._getApiMsg(body)
+ : '管事注册成功';
+ await this._applyGuanshiRegisterSuccess(userData, toastMsg);
+ } else if (this._isAlreadyGuanshiMsg(this._getApiMsg(body))) {
+ await this._applyGuanshiRegisterSuccess(this._extractUserData(body), this._getApiMsg(body) || '您已是管事');
+ } else {
+ wx.hideLoading();
+ wx.showToast({ title: this._getApiMsg(body) || '注册失败', icon: 'none' });
+ }
+ } catch (e) {
+ wx.hideLoading();
+ wx.showToast({ title: e.message || '注册失败', icon: 'none' });
+ }
+ },
+
+ goToGuanshiWithdraw() {
+ wx.navigateTo({ url: '/pages/withdraw/withdraw' });
+ },
+
+ goToZuzhangWithdraw() {
+ wx.navigateTo({ url: `/pages/withdraw/withdraw?from=zuzhang&amount=${this.data.ketixian}` });
+ },
+
+ goToInviteUser() { wx.navigateTo({ url: '/pages/invite-fighter/invite-fighter' }); },
+ goToMySubordinate() { wx.navigateTo({ url: '/pages/my-fighter/my-fighter' }); },
+ goToRechargeRecord() { wx.navigateTo({ url: '/pages/recharge-log/recharge-log' }); },
+ goToGuanshiRanking() {
+ wx.navigateTo({ url: '/pages/fighter-rank/fighter-rank?type=guanshi' });
+ },
+ goToPromoPoster() { wx.navigateTo({ url: '/pages/poster/poster' }); },
+ goToFenhongJilu() { wx.navigateTo({ url: '/pages/leader-bonus-log/leader-bonus-log' }); },
+ goToYaoqingGuanshi() { wx.navigateTo({ url: '/pages/invite-manager/invite-manager' }); },
+ goToGuanshiAuthPage() { wx.navigateTo({ url: '/pages/verify/verify?type=guanshi' }); },
+
+ async contactZuzhang() {
+ wx.showLoading({ title: '获取组长信息...', mask: true });
+ try {
+ const res = await request({ url: '/yonghu/guanshi_contact', method: 'POST' });
+ if (res && res.data.code === 200 && res.data.data) {
+ const inviter = res.data.data;
+ const fullAvatar = resolveAvatarUrl(inviter.touxiang);
+ const cacheData = { uid: inviter.uid, nicheng: inviter.nicheng || '', avatar: fullAvatar };
+ wx.setStorageSync('zuzhangInviterCache', cacheData);
+ this.setData({ zuzhangInviterCache: cacheData });
+ await openPrivateChat(this, {
+ toUserId: buildInviterPeerId(inviter.uid),
+ toName: inviter.nicheng || '组长',
+ toAvatar: fullAvatar,
+ });
+ } else {
+ wx.showToast({ title: '未绑定邀请人', icon: 'none' });
+ }
+ } catch (e) {
+ wx.showToast({ title: '网络错误', icon: 'none' });
+ } finally {
+ wx.hideLoading();
+ }
+ },
+
+ async fetchChenghaoList() {
+ try {
+ const res = await request({
+ url: '/dengji/dsbqhq',
+ method: 'POST'
+ });
+ if (res && res.data.code === 0 && res.data.data) {
+ const list = res.data.data.chenghao_list || [];
+ this.setData({ chenghaoList: list });
+ const app = getApp();
+ app.globalData.chenghaoList = list;
+ } else {
+ this.setData({ chenghaoList: [] });
+ }
+ } catch (e) {
+ }
+ },
+
+ // 联系邀请人
+ async contactInviter() {
+ wx.showLoading({ title: '获取邀请人...', mask: true });
+ try {
+ const res = await request({ url: '/yonghu/hqwdyqr', method: 'POST' });
+ if (res && res.data.code === 200 && res.data.data) {
+ const inviter = res.data.data;
+ const fullAvatar = resolveAvatarUrl(inviter.touxiang);
+ const cacheData = {
+ uid: inviter.uid,
+ nicheng: inviter.nicheng || '',
+ avatar: fullAvatar,
+ };
+ wx.setStorageSync('inviterCache', cacheData);
+ this.setData({ inviterCache: cacheData });
+ await openPrivateChat(this, {
+ toUserId: buildInviterPeerId(inviter.uid),
+ toName: inviter.nicheng || '管事',
+ toAvatar: fullAvatar,
+ });
+ } else {
+ wx.showToast({ title: res?.data?.msg || '获取失败', icon: 'none' });
+ }
+ } catch (e) {
+ wx.showToast({ title: '网络错误', icon: 'none' });
+ } finally {
+ wx.hideLoading();
+ }
+ },
+
+ handleInviteCodeWithLoginCheck(inviteCode) {
+ const that = this;
+ const token = wx.getStorageSync('token');
+ const uid = wx.getStorageSync('uid');
+ if (!token || !uid) {
+ this.loginAndRegisterWithInviteCode(inviteCode);
+ } else {
+ if (!that.data.isDashou) {
+ wx.showLoading({ title: '自动注册中...', mask: true });
+ that.setData({ isAutoRegistering: true });
+ that.onRegister();
+ } else {
+ wx.showToast({ title: '您已是接单员', icon: 'success', duration: 2000 });
+ }
+ }
+ },
+
+ loginAndRegisterWithInviteCode(inviteCode) {
+ const that = this;
+ wx.showLoading({ title: '登录注册中...', mask: true });
+ wx.login({
+ success: (loginRes) => {
+ if (loginRes.code) {
+ that.callLoginRegisterApi(loginRes.code, inviteCode);
+ } else {
+ wx.hideLoading();
+ wx.showToast({ title: '微信登录失败', icon: 'none' });
+ }
+ },
+ fail: () => {
+ wx.hideLoading();
+ console.error('微信登录失败');
+ wx.reLaunch({ url: '/pages/mine/mine' });
+ }
+ });
+ },
+
+ callLoginRegisterApi(code, inviteCode) {
+ const that = this;
+ const app = getApp();
+ const apiBaseUrl = app.globalData.apiBaseUrl;
+ if (!apiBaseUrl) {
+ wx.hideLoading();
+ wx.showToast({ title: '服务器配置错误', icon: 'none' });
+ return;
+ }
+ wx.request({
+ url: apiBaseUrl + '/yonghu/wdlyhdl',
+ method: 'POST',
+ data: { code: code, inviteCode: inviteCode },
+ header: { 'content-type': 'application/json' },
+ success: (res) => {
+ if (res.statusCode === 200 && res.data && res.data.code === 0 && res.data.data) {
+ const userData = res.data.data;
+ syncProfileFields(userData);
+ syncRoleStatuses(userData);
+ syncGroupFields(userData);
+ if (userData.token) wx.setStorageSync('token', userData.token);
+ const identityFields = ['nicheng', 'uid', 'touxiang', 'dashoustatus', 'guanshistatus', 'shangjiastatus', 'zuzhangstatus'];
+ identityFields.forEach(field => {
+ if (userData[field] !== undefined) {
+ wx.setStorageSync(field, userData[field]);
+ app.globalData[field] = userData[field];
+ }
+ });
+ const groupFields = ['dashouqun', 'dashouqunid', 'guanshiqun', 'guanshiqunid'];
+ groupFields.forEach(field => {
+ if (userData[field] !== undefined) {
+ wx.setStorageSync(field, userData[field]);
+ app.globalData[field] = userData[field];
+ }
+ });
+ if (userData.dashounicheng || userData.yongjin) {
+ const updateData = {
+ dashouNicheng: userData.dashounicheng || '',
+ zhanghaoStatus: userData.zhanghaostatus || '',
+ yongjin: userData.yongjin || '0.00',
+ zonge: userData.zonge || '0.00',
+ yajin: userData.yajin || '0.00',
+ chenghao: userData.chenghao || '',
+ jinfen: userData.jifen || userData.jinfen || '0',
+ clumber: userData.clumber || [],
+ chengjiaoliang: userData.chengjiaoliang || '0',
+ zaixianZhuangtai: userData.zaixianzhuangtai || 0,
+ dashouzhuangtai: userData.dashouzhuangtai || '',
+ };
+ Object.assign(app.globalData, updateData);
+ }
+ that.setData({
+ isDashou: true,
+ uid: userData.uid || '',
+ touxiang: userData.touxiang || '',
+ isAutoRegistering: false
+ });
+ that.loadAvatar();
+ that.getDashouInfo();
+ that.switchToDashouRole();
+ lockPrimaryRole('dashou');
+ wx.hideLoading();
+ wx.showToast({ title: '登录注册成功!', icon: 'success', duration: 2000 });
+ } else {
+ wx.hideLoading();
+ wx.showToast({ title: (res.data && res.data.msg) || '登录注册失败', icon: 'none' });
+ }
+ },
+ fail: () => {
+ wx.hideLoading();
+ wx.showToast({ title: '网络请求失败', icon: 'none' });
+ }
+ });
+ },
+
+ checkDashouStatus() {
+ try {
+ const dashoustatus = wx.getStorageSync('dashoustatus');
+ const uid = wx.getStorageSync('uid');
+ const touxiang = wx.getStorageSync('touxiang');
+ if (isRoleStatusActive(dashoustatus)) {
+ this.setData({ isDashou: true, uid: uid || '', touxiang: touxiang || '' });
+ this.loadAvatar();
+ this.checkGlobalData();
+ ensureRoleOnCenterPage(this, 'dashou');
+ } else {
+ this.setData({ isDashou: false });
+ }
+ } catch (error) {
+ console.error('读取缓存失败:', error);
+ this.setData({ isDashou: false });
+ }
+ },
+
+ checkGlobalData() {
+ const app = getApp();
+ const globalData = app.globalData || {};
+ const needRefresh = !globalData.dashouNicheng || globalData.dashouNicheng === '' || !globalData.yongjin;
+ if (needRefresh) {
+ this.getDashouInfo();
+ } else {
+ this.setDataFromGlobalData();
+ }
+ },
+
+ setDataFromGlobalData() {
+ const app = getApp();
+ const {
+ dashouNicheng = '', zhanghaoStatus = '', yongjin = '0.00', zonge = '0.00',
+ yajin = '0.00', chenghao = '', jinfen = '0', clumber = [],
+ chengjiaoliang = '0', zaixianZhuangtai = 0
+ } = app.globalData || {};
+ this.setData({
+ dashouNicheng, zhanghaoStatus, yongjin, zonge, yajin,
+ chenghao, jinfen,
+ clumber: Array.isArray(clumber) ? clumber : [],
+ chengjiaoliang,
+ zaixianZhuangtai: zaixianZhuangtai === 1 ? 1 : 0
+ });
+ },
+
+ async getDashouInfo() {
+ this.setData({ isLoading: true });
+ try {
+ const res = await request({ url: '/yonghu/dashouxinxi', method: 'POST' });
+ if (res && res.data.code == 200) {
+ const data = res.data.data;
+ const app = getApp();
+ const updateData = {
+ dashouNicheng: data.dashounicheng || '',
+ zhanghaoStatus: data.zhanghaostatus || '',
+ yongjin: data.yongjin || '0.00',
+ zonge: data.zonge || '0.00',
+ yajin: data.yajin || '0.00',
+ chenghao: data.chenghao || '',
+ jinfen: data.jifen || '0',
+ clumber: data.clumber || [],
+ chengjiaoliang: data.chengjiaoliang || '0',
+ zaixianZhuangtai: data.zaixianzhuangtai || 0,
+ dashouzhuangtai: data.dashouzhuangtai || '',
+ };
+ Object.assign(app.globalData, updateData);
+ if (data.dashoustatus !== undefined) {
+ wx.setStorageSync('dashoustatus', data.dashoustatus);
+ app.globalData.dashoustatus = data.dashoustatus;
+ }
+ if (data.guanshistatus !== undefined) {
+ wx.setStorageSync('guanshistatus', data.guanshistatus);
+ app.globalData.guanshistatus = data.guanshistatus;
+ }
+ this.setData({ ...updateData, isLoading: false });
+ this._updateTotalAssets();
+ if (this.data.isAutoRegistering) {
+ this.setData({ isAutoRegistering: false });
+ wx.showToast({ title: '注册成功!', icon: 'success', duration: 2000 });
+ } else {
+ wx.showToast({ title: '信息已更新', icon: 'success', duration: 1500 });
+ }
+ }
+ } catch (error) {
+ console.error('获取打手信息失败:', error);
+ this.setData({ isLoading: false, isAutoRegistering: false });
+ wx.showToast({ title: '获取信息失败', icon: 'error', duration: 2000 });
+ }
+ },
+
+ onInviteCodeInput(e) {
+ this.setData({ inviteCode: e.detail.value.trim() });
+ },
+
+ async onRegister() {
+ const { inviteCode } = this.data;
+ if (!inviteCode) {
+ wx.showToast({ title: '请输入邀请码', icon: 'none', duration: 2000 });
+ return;
+ }
+ if (inviteCode.length > 100) {
+ wx.showToast({ title: '邀请码不能超过100字符', icon: 'none', duration: 2000 });
+ return;
+ }
+ this.setData({ isLoading: true });
+ try {
+ const res = await request({
+ url: '/yonghu/dashouzhuce',
+ method: 'POST',
+ data: { inviteCode: inviteCode }
+ });
+ if (res && res.data.code == 200) {
+ const data = res.data.data || {};
+ const app = getApp();
+ syncRoleStatuses(data);
+ syncProfileFields(data);
+ if (data.dashoustatus === undefined && !isRoleStatusActive(wx.getStorageSync('dashoustatus'))) {
+ wx.setStorageSync('dashoustatus', 1);
+ app.globalData.dashoustatus = 1;
+ }
+ const identityFields = ['dashoustatus', 'guanshistatus', 'shangjiastatus', 'zuzhangstatus'];
+ identityFields.forEach(field => {
+ if (data[field] !== undefined) {
+ wx.setStorageSync(field, data[field]);
+ app.globalData[field] = data[field];
+ }
+ });
+ const updateData = {
+ dashouNicheng: data.dashounicheng || '',
+ zhanghaoStatus: data.zhanghaostatus || '',
+ yongjin: data.yongjin || '0.00',
+ zonge: data.zonge || '0.00',
+ yajin: data.yajin || '0.00',
+ chenghao: data.chenghao || '',
+ jinfen: data.jinfen || '0',
+ clumber: data.clumber || [],
+ chengjiaoliang: data.chengjiaoliang || '0',
+ zaixianZhuangtai: data.zaixianzhuangtai || 0,
+ dashouzhuangtai: data.dashouzhuangtai || '',
+ };
+ Object.assign(app.globalData, updateData);
+ this.setData({
+ isDashou: true,
+ ...updateData,
+ isLoading: false,
+ isAutoRegistering: false
+ });
+ this.loadAvatar();
+ ensureRoleOnCenterPage(this, 'dashou');
+ lockPrimaryRole('dashou');
+ wx.showToast({ title: '注册成功!', icon: 'success', duration: 2000 });
+ } else {
+ this.setData({ isLoading: false, isAutoRegistering: false });
+ wx.showToast({ title: (res.data && res.data.message) || '注册失败', icon: 'error', duration: 2000 });
+ }
+ } catch (error) {
+ console.error('注册失败:', error);
+ this.setData({ isLoading: false, isAutoRegistering: false });
+ wx.showToast({ title: error.message || '注册失败', icon: 'error', duration: 2000 });
+ }
+ },
+
+ switchToDashouRole() {
+ ensureRoleOnCenterPage(this, 'dashou');
+ },
+
+ previewAvatar() {
+ const { avatarUrl } = this.data;
+ if (avatarUrl) wx.previewImage({ urls: [avatarUrl] });
+ },
+
+ goToWithdraw() { wx.navigateTo({ url: '/pages/withdraw/withdraw' }) },
+ goToTotalWithdraw() { this.goToWithdraw(); },
+
+ goToAuth(e) {
+ const type = e.currentTarget.dataset.type;
+ if (!type || !['dashou', 'shangjia', 'guanshi', 'zuzhang'].includes(type)) return;
+ const statusMap = {
+ dashou: 'dashoustatus',
+ shangjia: 'shangjiastatus',
+ guanshi: 'guanshistatus',
+ zuzhang: 'zuzhangstatus',
+ };
+ const statusKey = statusMap[type];
+ if (isRoleStatusActive(wx.getStorageSync(statusKey))) {
+ if (type === 'shangjia') {
+ enterLockedRole('shangjia', getApp());
+ }
+ return;
+ }
+ wx.navigateTo({ url: `/pages/verify/verify?type=${type}` });
+ },
+
+ onTapAuthItem(e) {
+ const type = e.currentTarget.dataset.type;
+ if (type === 'shangjia') {
+ this.onTapShangjiaAuth();
+ return;
+ }
+ this.goToAuth(e);
+ },
+
+ enterShangjiaCenter() {
+ if (!this.data.shangjiaCertified) {
+ wx.navigateTo({ url: '/pages/verify/verify?type=shangjia' });
+ return;
+ }
+ enterLockedRole('shangjia', getApp());
+ },
+
+ onTapShangjiaAuth() {
+ if (this.data.shangjiaCertified) {
+ this.enterShangjiaCenter();
+ return;
+ }
+ wx.navigateTo({ url: '/pages/verify/verify?type=shangjia' });
+ },
+ goToReceiveOrder() { wx.navigateTo({ url: '/pages/accept-order/accept-order' }) },
+ goToMyOrders() { wx.navigateTo({ url: '/pages/fighter-orders/fighter-orders' }) },
+ goToMyPunishment() { wx.navigateTo({ url: '/pages/penalty/penalty/penalty' }) },
+ goToRecharge() { wx.navigateTo({ url: '/pages/fighter-recharge/fighter-recharge' }) },
+ goToRanking(e) {
+ const type = e?.currentTarget?.dataset?.type || 'dashou';
+ wx.navigateTo({ url: `/pages/fighter-rank/fighter-rank?type=${type}` });
+ },
+ goToGuanzhuKs() { wx.navigateTo({ url: '/pages/manager-assign/manager-assign' }) },
+ goToKaoheDafen() { wx.navigateTo({ url: '/pages/assess-score/assess-score' }) },
+ goToKaoheJilu() { wx.navigateTo({ url: '/pages/assess-log/assess-log' }) },
+ goToKaoheZhongxin() { wx.navigateTo({ url: '/pages/assess-center/assess-center' }) },
+ goToKaoheWithdraw() {
+ const yue = this.data.kaoheYue || '0.00';
+ wx.navigateTo({ url: `/pages/withdraw/withdraw?amount=${yue}&from=kaoheguan` });
+ },
+ goToModifyInfo() { wx.navigateTo({ url: '/pages/fighter-edit/fighter-edit' }) },
+ goToRules() { wx.navigateTo({ url: '/pages/fighter-rules/fighter-rules' }) },
+ goToKaohe() {
+ wx.navigateTo({ url: '/pages/assess-gold/assess-gold' });
+ },
+
+ quickRegisterAsPlatform() {
+ const that = this;
+ wx.showModal({
+ title: '提示',
+ content: '使用此功能后,您将不属于任何管事,确认注册吗?',
+ success: (res) => {
+ if (res.confirm) {
+ that.setData({ inviteCode: PLATFORM_INVITE_CODE });
+ that.onRegister();
+ }
+ }
+ });
+ },
+
+}, { roleConfig: { role: 'dashou', statusKey: 'dashoustatus', dataFlag: 'isDashou', pageId: 'dashouduan', apiUrl: '/yonghu/dashouxinxi' } }))
diff --git a/pages/fighter/fighter.json b/pages/fighter/fighter.json
index 42b7954..8458bf8 100644
--- a/pages/fighter/fighter.json
+++ b/pages/fighter/fighter.json
@@ -1,14 +1,12 @@
{
- "usingComponents": {
- "global-notification": "/components/global-notification/global-notification",
- "chenghao-tag": "/components/chenghao-tag/chenghao-tag",
- "tab-bar": "/tab-bar/index"
- },
- "navigationBarBackgroundColor": "#e8ecf4",
- "navigationBarTextStyle": "black",
- "navigationBarTitleText": "我的",
- "backgroundColor": "#e8ecf4",
- "backgroundTextStyle": "light",
- "enablePullDownRefresh": false,
- "onReachBottomDistance": 50
-}
\ No newline at end of file
+ "usingComponents": {
+ "global-notification": "/components/global-notification/global-notification",
+ "chenghao-tag": "/components/chenghao-tag/chenghao-tag",
+ "tab-bar": "/tab-bar/index"
+ },
+ "navigationStyle": "custom",
+ "backgroundColor": "#fff8e1",
+ "backgroundTextStyle": "dark",
+ "enablePullDownRefresh": false,
+ "onReachBottomDistance": 50
+}
diff --git a/pages/fighter/fighter.wxml b/pages/fighter/fighter.wxml
index 9141c8a..8f9bf1a 100644
--- a/pages/fighter/fighter.wxml
+++ b/pages/fighter/fighter.wxml
@@ -1,395 +1,238 @@
-
+
-
+
-
-
- 接单员认证
-
-
- 立即注册
+
+
-
- 平台直签注册
-
-
-
- 返回点单端
-
-
-
- 清除缓存,重新登录
+
+
+ 接单员认证
+
+ 立即注册
+ 平台直签注册
+ 返回点单端
+ 清除缓存,重新登录
+
+
-
-
-
-
-
-
-
-
-
-
-
-
- {{dashouNicheng || '接单员'}}
-
- 接单员
- 管事
- 组长
- 考核
-
-
-
- UID: {{uid || '--'}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 在线客服
- 企业微信 · 即时响应
-
-
- 联系
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 会员充值
- VIP 专属权益 · 尊享服务
-
-
- 去充值
-
-
+
+
-
-
-
-
-
-
- 我的资产
-
-
-
-
-
-
- 总资产(可提现)
- ¥{{totalAssets}}
-
-
- {{item.label}}
- ¥{{item.amount}}
-
+
+
+
+
+
+
+
+
+
+
+
+ {{dashouNicheng || '接单员'}}
+ 保证金
+
+ 接单员
+ 管事
+ 组长
+ 考核
- 提现
-
-
-
-
- {{jinfen || '0'}}
- 积分
-
-
- {{yajin || '0.00'}}
- 保证金
-
-
- {{yaoqingzongshu || 0}}
- 邀请总数
-
-
- {{yichongzhiDashou || 0}}
- 已充值
-
-
- {{fenyongzonge || '0.00'}}
- 分成总额
-
-
- {{zhuanhualv || 0}}%
- 有效率
-
-
- {{guanshiCount || 0}}
- 邀请管事
-
-
- {{fenhongZonge || '0.00'}}
- 分红总额
-
-
- {{shenheZongshu || 0}}
- 审核总数
-
-
- {{tongguoZongshu || 0}}
- 通过总数
-
-
- {{pendingShenheCount || 0}}
- 待审核
+
+ ID: {{uid || '--'}}
+
+
+
-
-
-
-
-
-
-
- 荣耀排行榜
- 四榜实时更新
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
- {{item.name}}
- {{item.sub}}
+
+
+
+
+ 我的佣金(元)
+ ¥{{totalAssets}}
+ 可提现 ¥{{yongjin || '0.00'}} · 查看
+
+
+ 充值
+ 去提现
+
+
+
+
+
+
+
+
+
+
+
+
+ {{jinfen || '0'}}
+ 积分
+
+
+ {{yajin || '0.00'}}
+ 保证金
+
+
+ {{yongjin || '0.00'}}
+ 佣金
+
+
+
+
+
+ {{yaoqingzongshu || 0}}邀请总数
+ {{yichongzhiDashou || 0}}已充值
+ {{fenyongzonge || '0.00'}}分成总额
+ {{zhuanhualv || 0}}%有效率
+ {{guanshiCount || 0}}邀请管事
+ {{fenhongZonge || '0.00'}}分红总额
+ {{shenheZongshu || 0}}审核总数
+ {{tongguoZongshu || 0}}通过总数
+ {{pendingShenheCount || 0}}待审核
+
+
+
+
+ 接单服务
+
+
+ 抢单大厅
+
+
+ 我的订单
+
+
+ 我的处罚
+
+
+ 考核金牌
-
-
-
-
-
-
- 接单员功能
-
-
-
-
-
-
- 抢单大厅
+
+
+
+ 荣耀排行榜
+ TOP50
-
-
- 我的订单
-
-
-
- 我的处罚
-
-
-
- 考核金牌
-
-
-
- 关注快手
+
+
+
+
+
+
+ {{item.name}}
+ {{item.sub}}
+
+ 进入
+
+
+
+
+
+
+
+
+ 管事功能
+
+ 邀请用户
+ 我的下级
+ 会员记录
+ 推广海报
+ 联系组长
-
-
-
-
-
-
- 管事功能
-
-
-
-
-
-
- 邀请用户
-
-
-
- 我的下级
-
-
-
- 会员记录
-
-
-
- 推广海报
-
-
-
- 联系组长
+
+
+ 组长功能
+
+ 分红记录
+ 邀请管事
-
-
-
-
-
-
- 组长功能
-
-
-
-
-
-
- 分红记录
-
-
-
- 邀请管事
+
+
+ 考核官功能
+
+ 考核打分
+ 考核记录
+ 考核中心
+ 考核提现
-
-
-
-
-
-
- 考核官功能
-
-
-
-
-
-
- 考核打分
-
-
-
- 考核记录
-
-
-
- 考核中心
-
-
-
- 考核提现
+
+
+ 身份认证
+
+
+
+ {{item.name}}
+ {{item.tag}}
+
-
-
-
-
-
-
- 身份认证
-
-
-
-
-
-
- {{item.name}}
- {{item.tag}}
+
+
+ 更多功能
+
+ 在线客服
+ 关注快手
+ 联系邀请人
+ 用户规则
+ 返回点单端
+ 清除缓存
-
-
-
-
-
-
- 更多
-
-
-
-
-
-
- 联系邀请人
-
-
-
-
- 修改个人信息
-
-
-
-
- 用户规则
-
-
-
-
- 返回点单端
-
-
-
-
- 清除缓存
- 重新登录
-
-
-
-
+
+
+
-
-
-
-
+
+
diff --git a/pages/fighter/fighter.wxss b/pages/fighter/fighter.wxss
index 1d80262..d10bfb2 100644
--- a/pages/fighter/fighter.wxss
+++ b/pages/fighter/fighter.wxss
@@ -1,46 +1,523 @@
-/* 打手端 */
+/* 打手端个人中心 - 逍遥梦 UI(逻辑不变) */
page {
- background: #f5f5f5;
- color: #1A1A1A;
+ background: #fff8e1;
+ color: #333;
}
-.page-bg {
- opacity: 0.42;
+.flex { display: flex; align-items: center; }
+.flexb { display: flex; align-items: center; justify-content: space-between; }
+.flexa { display: flex; align-items: center; justify-content: space-around; }
+.flexmc { display: flex; flex-direction: column; align-items: center; justify-content: center; }
+
+.user-page {
+ height: 100vh;
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+ box-sizing: border-box;
+ background: linear-gradient(180deg, #f7dc51 0%, #fff 28%, #fff8e1 100%);
+ position: relative;
}
-/* 未注册 */
+.page-header {
+ position: relative;
+ z-index: 2;
+ flex-shrink: 0;
+}
+
+.status-bar,
+.nav-bar,
+.content,
.unreg-area {
position: relative;
z-index: 2;
+}
+
+.nav-bar {
display: flex;
align-items: center;
justify-content: center;
- min-height: 100vh;
- padding: 0 40rpx;
+}
+
+.nav-title {
+ font-size: 34rpx;
+ font-weight: 700;
+ color: #343434;
+}
+
+.content {
+ flex: 1;
+ height: 0;
+ padding-bottom: 0;
+}
+
+.content-bottom {
+ height: 12rpx;
+}
+
+.refresh-float {
+ position: fixed;
+ right: 24rpx;
+ top: calc(env(safe-area-inset-top) + 100rpx);
+ z-index: 10;
+ width: 56rpx;
+ height: 56rpx;
+ background: rgba(255, 255, 255, 0.85);
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
+}
+
+.refresh-float-ico {
+ width: 32rpx;
+ height: 32rpx;
+}
+
+.user-info {
+ padding: 10rpx 30rpx;
+}
+
+.avatar {
+ width: 110rpx;
+ height: 110rpx;
+ border-radius: 50%;
+ border: 4rpx solid #f1f7ff;
+ margin-right: 20rpx;
+ flex-shrink: 0;
+}
+
+.nickname {
+ font-size: 38rpx;
+ font-weight: 700;
+ color: #222;
+}
+
+.nickname-row {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 8rpx;
+}
+
+.role-tags {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 6rpx;
+}
+
+.role-tag {
+ font-size: 20rpx;
+ padding: 2rpx 12rpx;
+ border-radius: 8rpx;
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ color: #492f00;
+}
+
+.sn-row {
+ display: flex;
+ align-items: center;
+ margin-top: 8rpx;
+}
+
+.sn {
+ color: #999;
+ font-size: 24rpx;
+}
+
+.copy-ico {
+ width: 24rpx;
+ height: 24rpx;
+ margin-left: 8rpx;
+ opacity: 0.6;
+}
+
+.setting-ico {
+ width: 53rpx;
+ height: 53rpx;
+ flex-shrink: 0;
+}
+
+.badge-zone {
+ padding: 0 24rpx 8rpx;
+}
+
+.badge-scroll {
+ white-space: nowrap;
+ width: 100%;
+}
+
+.badge-tag-wrap {
+ display: inline-block;
+ transform: scale(0.72);
+ transform-origin: left center;
+ margin-right: -8rpx;
+}
+
+.deposit-tag {
+ margin-left: 8rpx;
+ font-size: 20rpx;
+ padding: 4rpx 12rpx;
+ border-radius: 8rpx;
+ background: linear-gradient(90deg, #e8c547, #8b6914);
+ color: #fff;
+}
+
+.wallet-card {
+ margin: 15rpx 30rpx 0;
+ padding: 24rpx 20rpx;
+ border-radius: 26rpx;
+ background: #fef6d4;
+ align-items: center;
+}
+
+.wallet-left {
+ flex: 1;
+ min-width: 0;
+}
+
+.w-label {
+ color: #666;
+ font-size: 26rpx;
+}
+
+.w-num {
+ font-size: 44rpx;
+ font-weight: 700;
+ color: #222;
+ margin-top: 10rpx;
+}
+
+.w-sub {
+ color: #666;
+ font-size: 26rpx;
+ margin-top: 8rpx;
+}
+
+.wallet-btns {
+ flex-shrink: 0;
+}
+
+.wallet-btns .btn-outline {
+ margin-left: 12rpx;
+}
+
+.btn-outline {
+ padding: 10rpx 24rpx;
+ font-size: 26rpx;
+ font-weight: 700;
+ border: 2rpx solid #fff;
+ border-radius: 60rpx;
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ color: #492f00;
+ white-space: nowrap;
+}
+
+.banner-row {
+ margin: 20rpx 24rpx 0;
+ align-items: flex-start;
+}
+
+.banner-row .banner-img {
+ width: 48%;
+ height: auto;
+ display: block;
+ border-radius: 16rpx;
+ overflow: hidden;
+ background: transparent;
+}
+
+.banner-row .banner-img:first-child {
+ margin-right: 2%;
+}
+
+.freeze-row {
+ margin: 16rpx 30rpx 0;
+ padding: 20rpx 10rpx;
+ border-radius: 15rpx;
+ background: #fef6d4;
+}
+
+.freeze-col {
+ flex: 1;
+ min-width: 0;
+}
+
+.freeze-num {
+ font-size: 32rpx;
+ font-weight: 700;
+ color: #7e893c;
+}
+
+.freeze-lbl {
+ font-size: 24rpx;
+ color: #7e893c;
+ font-weight: 700;
+ margin-top: 4rpx;
+}
+
+.btn-bg {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ border-radius: 30px;
+ color: #492f00;
+}
+
+.withdraw {
+ padding: 14rpx 28rpx;
+ font-size: 26rpx;
+ font-weight: 700;
+ border: 2rpx solid #fff;
+ flex-shrink: 0;
+ margin-left: 16rpx;
+}
+
+.vip-strip {
+ margin: 16rpx 30rpx 0;
+ padding: 20rpx 24rpx;
+ border-radius: 20rpx;
+ background: linear-gradient(135deg, #3d3428, #1a1a2e);
+}
+
+.vip-strip-title {
+ display: block;
+ font-size: 28rpx;
+ font-weight: 700;
+ color: #fcd270;
+}
+
+.vip-strip-sub {
+ display: block;
+ font-size: 22rpx;
+ color: rgba(252, 210, 112, 0.65);
+ margin-top: 4rpx;
+}
+
+.vip-strip-btn {
+ padding: 10rpx 24rpx;
+ font-size: 24rpx;
+ font-weight: 700;
+}
+
+.stats-bar {
+ margin: 12rpx 30rpx 0;
+ padding: 16rpx 16rpx 8rpx;
+ background: #fdfcfa;
+ border-radius: 16rpx;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: flex-start;
+ align-content: flex-start;
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
+}
+
+.stat-cell {
+ width: 25%;
+ padding: 8rpx 0 12rpx;
+ box-sizing: border-box;
+ text-align: center;
+}
+
+.stat-val {
+ display: block;
+ font-size: 28rpx;
+ font-weight: 700;
+ color: #222;
+}
+
+.stat-lbl {
+ display: block;
+ font-size: 22rpx;
+ color: #999;
+ margin-top: 4rpx;
+}
+
+.panel {
+ margin: 20rpx 20rpx 12rpx;
+ background: #fdfcfa;
+ border-radius: 20rpx;
+ padding: 20rpx 10rpx 10rpx;
+}
+
+.shadow {
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
+}
+
+.panel-title {
+ padding: 8rpx 25rpx 10rpx;
+}
+
+.lg {
+ font-size: 32rpx;
+ font-weight: 700;
+ color: #343434;
+}
+
+.order-nav {
+ padding: 10rpx 0 20rpx;
+}
+
+.nav-item {
+ width: 25%;
+ padding: 10rpx 0;
+}
+
+.nav-icon {
+ width: 62rpx;
+ height: 62rpx;
+ margin-bottom: 10rpx;
+ border-radius: 16rpx;
+}
+
+.sm {
+ font-size: 24rpx;
+ color: #666;
+}
+
+.func-grid {
+ display: flex;
+ flex-wrap: wrap;
+ padding: 10rpx 0;
+}
+
+.func-item {
+ width: 25%;
+ padding: 20rpx 0;
+}
+
+.func-icon {
+ width: 48rpx;
+ height: 48rpx;
+ margin-bottom: 8rpx;
+}
+
+.func-txt {
+ font-size: 24rpx;
+ color: #666;
+ text-align: center;
+}
+
+.func-tag {
+ font-size: 20rpx;
+ color: #bbb;
+ margin-top: 4rpx;
+}
+
+.func-tag-done {
+ color: #c9a962;
+}
+
+.rank-hub-tip {
+ font-size: 22rpx;
+ color: #999;
+ font-weight: 500;
+}
+
+.rank-hub-scroll {
+ width: 100%;
+ white-space: nowrap;
+}
+
+.rank-hub-track {
+ display: inline-flex;
+ padding: 8rpx 16rpx 20rpx;
+ gap: 16rpx;
+}
+
+.rank-tile {
+ display: inline-block;
+ width: 280rpx;
+ border-radius: 20rpx;
+ overflow: hidden;
+ box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.1);
+}
+
+.rank-tile-inner {
+ display: flex;
+ align-items: center;
+ padding: 24rpx 20rpx;
+ min-height: 120rpx;
+ box-sizing: border-box;
+}
+
+.rank-tile-icon {
+ width: 64rpx;
+ height: 64rpx;
+ border-radius: 16rpx;
+ background: rgba(255, 255, 255, 0.25);
+ flex-shrink: 0;
+ margin-right: 16rpx;
+}
+
+.rank-tile-text {
+ flex: 1;
+ min-width: 0;
+}
+
+.rank-tile-name {
+ display: block;
+ font-size: 28rpx;
+ font-weight: 700;
+ color: #fff;
+}
+
+.rank-tile-sub {
+ display: block;
+ font-size: 22rpx;
+ color: rgba(255, 255, 255, 0.82);
+ margin-top: 6rpx;
+}
+
+.rank-tile-go {
+ font-size: 22rpx;
+ color: rgba(255, 255, 255, 0.9);
+ font-weight: 600;
+ flex-shrink: 0;
+ padding: 6rpx 14rpx;
+ border-radius: 20rpx;
+ background: rgba(255, 255, 255, 0.2);
+}
+
+.rank-theme-blue {
+ background: linear-gradient(135deg, #3d6eb5 0%, #6ba3f7 100%);
+}
+
+.rank-theme-gold {
+ background: linear-gradient(135deg, #a8842a 0%, #f5d563 100%);
+}
+
+.rank-theme-gold .rank-tile-name,
+.rank-theme-gold .rank-tile-sub,
+.rank-theme-gold .rank-tile-go {
+ color: #3d2a00;
+}
+
+.rank-theme-purple {
+ background: linear-gradient(135deg, #6b4fbf 0%, #9b7fe8 100%);
+}
+
+.rank-theme-orange {
+ background: linear-gradient(135deg, #d4652a 0%, #f5a962 100%);
+}
+
+/* 未注册 */
+.unreg-page .unreg-area {
+ flex: 1;
+ padding: 40rpx 30rpx 16rpx;
+ overflow-y: auto;
}
.unreg-card {
- width: 100%;
- background: #fff;
- border-radius: 16rpx;
- padding: 48rpx 36rpx;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
+ padding: 40rpx 30rpx !important;
}
-.unreg-title,
-.section-title {
- font-size: 30rpx;
+.unreg-title {
+ font-size: 32rpx;
font-weight: 700;
- color: #1A1A1A;
display: block;
- margin-bottom: 20rpx;
-}
-
-.section-title-sm {
- font-size: 26rpx;
- margin-bottom: 0;
- color: #333;
+ text-align: center;
+ margin-bottom: 24rpx;
}
.unreg-input {
@@ -50,746 +527,60 @@ page {
background: #f7f7f7;
padding: 0 24rpx;
font-size: 28rpx;
- border: 1rpx solid #e8e8e8;
+ border: 1rpx solid #eee;
}
.ph { color: #bbb; }
.unreg-btn {
- width: 100%;
- height: 80rpx;
- background: #333;
- border-radius: 12rpx;
+ text-align: center;
+ padding: 20rpx;
+ font-size: 28rpx;
+ font-weight: 700;
margin-bottom: 16rpx;
- display: flex;
- align-items: center;
- justify-content: center;
}
+.unreg-btn-text { color: #492f00; }
+
.unreg-btn-secondary {
- margin-bottom: 0;
- background: #f5f5f5;
- border: 1rpx solid #e0e0e0;
-}
-
-.unreg-btn-secondary .unreg-btn-text {
- color: #555;
-}
-
-.unreg-btn-text {
- font-size: 28rpx;
- font-weight: 600;
- color: #fff;
-}
-
-.unreg-clear {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 24rpx;
- padding-top: 20rpx;
- border-top: 1rpx solid #f0f0f0;
-}
-
-.unreg-clear-icon {
- width: 28rpx;
- height: 28rpx;
- margin-right: 8rpx;
- opacity: 0.5;
-}
-
-.unreg-clear-text {
- font-size: 22rpx;
- color: #999;
-}
-
-/* 主体 */
-.main-body {
- position: relative;
- z-index: 2;
- padding: 0 24rpx 150rpx;
-}
-
-/* 用户卡片 */
-.user-card {
- position: relative;
- margin-top: 24rpx;
- margin-bottom: 16rpx;
- border-radius: 16rpx;
- overflow: hidden;
- background: #fff;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.05);
-}
-
-.user-card-bg {
- display: none;
-}
-
-.user-card-inner {
- display: flex;
- align-items: center;
- padding: 24rpx;
-}
-
-.user-avatar {
- width: 88rpx;
- height: 88rpx;
- border-radius: 50%;
- border: 2rpx solid #f0f0f0;
- object-fit: cover;
- flex-shrink: 0;
- margin-right: 20rpx;
-}
-
-.user-info { flex: 1; min-width: 0; }
-
-.name-row {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- margin-bottom: 6rpx;
-}
-
-.user-name {
- font-size: 30rpx;
- font-weight: 700;
- margin-right: 8rpx;
-}
-
-.role-tags {
- display: flex;
- flex-wrap: wrap;
- gap: 6rpx;
- align-items: center;
-}
-
-.role-tag {
- font-size: 18rpx;
- padding: 2rpx 10rpx;
- border-radius: 6rpx;
- font-weight: 500;
- line-height: 1.4;
-}
-
-.role-tag-dashou { background: #eef1f5; color: #4a5568; }
-.role-tag-guanshi { background: #eef5ee; color: #3d6b3d; }
-.role-tag-zuzhang { background: #f5f0eb; color: #7c5e3a; }
-.role-tag-kaohe { background: #eef0f5; color: #4a5070; }
-
-.uid-row {
- display: inline-flex;
- align-items: center;
- background: #f7f7f7;
- border-radius: 8rpx;
- padding: 4rpx 12rpx;
-}
-
-.uid-text { font-size: 22rpx; color: #999; margin-right: 6rpx; }
-.copy-icon { width: 22rpx; height: 22rpx; }
-
-/* 称号 */
-.badge-zone { margin-bottom: 12rpx; }
-.badge-scroll { white-space: nowrap; }
-.badge-scroll-sub { margin-top: 6rpx; }
-
-.badge-tag-wrap {
- display: inline-block;
- transform: scale(0.68);
- transform-origin: left center;
- margin-right: -12rpx;
-}
-
-/* 分区卡片 */
-.section-card { margin-bottom: 16rpx; }
-.section-last { margin-bottom: 24rpx; }
-
-.section-head-line {
- display: flex;
- align-items: center;
- margin-bottom: 10rpx;
- padding: 0 4rpx;
-}
-
-.section-head-icon {
- width: 28rpx;
- height: 28rpx;
- margin-right: 8rpx;
- opacity: 0.6;
-}
-
-/* VIP充值 */
-.vip-black-card {
- position: relative;
- height: 140rpx;
- border-radius: 16rpx;
- overflow: hidden;
- margin-bottom: 12rpx;
- background: #1a1a2e;
-}
-
-.vip-black-bg {
- position: absolute;
- top: 0; left: 0;
- width: 100%; height: 100%;
- z-index: 0;
-}
-
-.vip-black-overlay { display: none; }
-
-.vip-black-body {
- position: relative;
- z-index: 2;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 28rpx;
- box-sizing: border-box;
-}
-
-.vip-black-text { flex: 1; min-width: 0; }
-
-.vip-black-title {
- display: block;
- font-size: 28rpx;
- font-weight: 700;
- color: #f0e6c8;
-}
-
-.vip-black-sub {
- display: block;
- font-size: 20rpx;
- color: rgba(240,230,200,0.5);
- margin-top: 4rpx;
-}
-
-.vip-black-action {
- flex-shrink: 0;
- padding: 10rpx 24rpx;
- border: 1rpx solid rgba(240,230,200,0.3);
- border-radius: 999rpx;
-}
-
-.vip-black-go {
- font-size: 22rpx;
- font-weight: 600;
- color: #f0e6c8;
-}
-
-/* 资产面板 */
-.asset-panel {
- position: relative;
- border-radius: 16rpx;
- overflow: hidden;
- background: #fff;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
-}
-
-.asset-panel-fallback { display: none; }
-.asset-panel-bg { display: none; }
-
-.asset-panel-inner {
- padding: 20rpx 20rpx 14rpx;
-}
-
-.asset-panel-head {
- display: flex;
- align-items: center;
- margin-bottom: 12rpx;
-}
-
-.asset-panel-head-icon {
- width: 28rpx;
- height: 28rpx;
- margin-right: 8rpx;
-}
-
-.asset-panel-head-title {
+ text-align: center;
+ padding: 18rpx;
font-size: 26rpx;
- font-weight: 700;
- color: #333;
-}
-
-/* 总资产 */
-.total-asset-row {
+ color: #666;
+ background: #f5f5f5;
border-radius: 12rpx;
- overflow: hidden;
margin-bottom: 12rpx;
- background: #faf8f4;
- border: 1rpx solid #efe8d8;
}
-.total-asset-fallback { display: none; }
-.total-asset-bg { display: none; }
-
-.total-asset-inner {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 20rpx;
-}
-
-.total-asset-left {
- flex: 1;
- min-width: 0;
- padding-right: 16rpx;
-}
-
-.total-asset-label {
- display: block;
- font-size: 22rpx;
+.unreg-link {
+ text-align: center;
+ padding: 16rpx;
+ font-size: 24rpx;
color: #999;
}
-.total-asset-val {
- display: block;
- font-size: 44rpx;
- font-weight: 800;
- color: #2c2416;
- margin: 4rpx 0 8rpx;
- line-height: 1.1;
-}
-
-.asset-breakdown-list {
- display: flex;
- flex-direction: column;
- gap: 2rpx;
-}
-
-.asset-breakdown-line {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding-right: 8rpx;
-}
-
-.breakdown-name { font-size: 20rpx; color: #aaa; }
-.breakdown-amt { font-size: 20rpx; color: #777; font-weight: 500; }
-
-.withdraw-btn {
- flex-shrink: 0;
- min-width: 110rpx;
- height: 64rpx;
- line-height: 64rpx;
- text-align: center;
- padding: 0 24rpx;
- font-weight: 700;
- font-size: 24rpx;
- border-radius: 999rpx;
- background: #333;
- color: #fff;
-}
-
-/* 统计格子 */
-.stats-grid {
- display: flex;
- flex-wrap: wrap;
- border-top: 1rpx solid #f0f0f0;
- padding-top: 10rpx;
-}
-
-.mini-stat {
- width: 20%;
- text-align: center;
- padding: 8rpx 0;
- box-sizing: border-box;
-}
-
-.mini-val {
- font-size: 24rpx;
- font-weight: 700;
- color: #333;
- display: block;
-}
-
-.mini-lbl {
- font-size: 18rpx;
- color: #aaa;
- display: block;
- margin-top: 2rpx;
-}
-
-/* 排行榜 */
-.rank-section {
- margin-bottom: 16rpx;
- padding: 0 2rpx;
-}
-
-.rank-hub-head {
- display: flex;
- align-items: center;
- margin-bottom: 12rpx;
- padding: 0 4rpx;
-}
-
-.rank-hub-head-icon {
- width: 28rpx;
- height: 28rpx;
- margin-right: 8rpx;
-}
-
-.rank-hub-title {
- font-size: 26rpx;
- font-weight: 700;
- color: #333;
- display: block;
-}
-
-.rank-hub-sub {
- font-size: 20rpx;
- color: #bbb;
- margin-top: 2rpx;
- display: block;
-}
-
-/* ===== 荣耀排行榜 ===== */
-.rank-grid {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- gap: 20rpx;
-}
-
-.rank-card {
- width: 48%;
- height: 180rpx;
- border-radius: 20rpx;
- position: relative;
- overflow: hidden;
- box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.12);
-}
-
-/* 左列卡片:右侧倾斜切角 */
-.rank-card:nth-child(odd) {
- clip-path: polygon(0% 0%, 100% 0%, 92% 100%, 0% 100%);
-}
-/* 右列卡片:左侧倾斜切角 */
-.rank-card:nth-child(even) {
- clip-path: polygon(8% 0%, 100% 0%, 100% 100%, 0% 100%);
-}
-
-/* 背景水印 */
-.rank-card-watermark {
- position: absolute;
- width: 150rpx;
- height: 150rpx;
- opacity: 0.16;
- z-index: 0;
- pointer-events: none;
-}
-/* 左列卡片水印在右下角 */
-.rank-card:nth-child(odd) .rank-card-watermark {
- right: -20rpx;
- bottom: -20rpx;
- transform: rotate(-15deg);
-}
-/* 右列卡片水印在左下角 */
-.rank-card:nth-child(even) .rank-card-watermark {
- left: -20rpx;
- bottom: -20rpx;
- transform: rotate(15deg);
-}
-
-/* 内容区 */
-.rank-card-body {
- position: relative;
- z-index: 1;
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- padding: 24rpx 28rpx;
- box-sizing: border-box;
-}
-/* 左列靠左对齐,右列靠右对齐 */
-.rank-card:nth-child(odd) .rank-card-body {
- justify-content: flex-start;
- padding-right: 50rpx; /* 给斜边留空间 */
-}
-.rank-card:nth-child(even) .rank-card-body {
- justify-content: flex-end;
- padding-left: 50rpx; /* 给斜边留空间 */
-}
-
-.rank-card-info {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
-}
-.rank-card:nth-child(even) .rank-card-info {
- align-items: flex-end;
-}
-
-.rank-card-icon {
- width: 56rpx;
- height: 56rpx;
- margin-bottom: 10rpx;
-}
-
-.rank-card-title {
- font-size: 32rpx;
- font-weight: 700;
- color: #fff;
- line-height: 1.3;
-}
-
-.rank-card-desc {
- font-size: 22rpx;
- color: rgba(255,255,255,0.8);
- margin-top: 4rpx;
-}
-
-/* 四种主题色 */
-.rank-theme-blue { background: linear-gradient(135deg, #5BA3E6, #3B82E8); }
-.rank-theme-gold { background: linear-gradient(135deg, #F5C850, #E8A520); }
-.rank-theme-purple { background: linear-gradient(135deg, #A78BFA, #7C6BE8); }
-.rank-theme-orange { background: linear-gradient(135deg, #F08860, #E05A38); }
-
-/* 功能面板 */
-.func-panel {
- position: relative;
- border-radius: 16rpx;
- overflow: hidden;
- background: #fff;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
-}
-
-.func-panel-bg { display: none; }
-
-.func-grid {
- display: flex;
- flex-wrap: wrap;
- padding: 8rpx 4rpx;
-}
-
-.func-cell {
- width: 25%;
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 16rpx 0;
- box-sizing: border-box;
-}
-
-.func-icon {
- width: 48rpx;
- height: 48rpx;
- margin-bottom: 8rpx;
-}
-
-.func-label {
- font-size: 20rpx;
- color: #555;
- text-align: center;
- line-height: 1.25;
- padding: 0 4rpx;
-}
-
-.func-grid-sparse .func-cell {
- padding: 20rpx 0;
-}
-
-.func-grid-sparse .func-icon {
- width: 52rpx;
- height: 52rpx;
- margin-bottom: 10rpx;
-}
-
-.func-grid-sparse .func-label {
- font-size: 22rpx;
-}
-
-.layout-sparse-padding {
- padding-bottom: 80rpx;
-}
-
-/* 列表卡片 */
-.list-card {
- position: relative;
- border-radius: 16rpx;
- overflow: hidden;
- background: #fff;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
-}
-
-.list-card-bg { display: none; }
-
-.list-card-inner {
- position: relative;
- z-index: 1;
-}
-
-.list-item {
- display: flex;
- align-items: center;
- padding: 22rpx 20rpx;
- border-bottom: 1rpx solid #f5f5f5;
-}
-
-.list-item:last-child { border-bottom: none; }
-
-.list-icon {
- width: 36rpx;
- height: 36rpx;
- margin-right: 16rpx;
- flex-shrink: 0;
-}
-
-.list-text {
- flex: 1;
- font-size: 26rpx;
- color: #333;
-}
-
-.list-sub {
- font-size: 20rpx;
- color: #bbb;
- margin-right: 8rpx;
-}
-
-.list-arrow {
- width: 20rpx;
- height: 20rpx;
- opacity: 0.3;
- flex-shrink: 0;
-}
-
-/* 客服入口 */
-.kefu-banner {
- position: relative;
- margin-bottom: 16rpx;
- border-radius: 16rpx;
- overflow: hidden;
- background: #2c3e50;
-}
-
-.kefu-banner-bg {
- position: absolute;
- top: 0; left: 0;
- width: 100%; height: 100%;
- z-index: 0;
-}
-
-.kefu-banner-overlay { display: none; }
-
-.kefu-banner-content {
- position: relative;
- z-index: 2;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 20rpx 24rpx;
-}
-
-.kefu-banner-left {
- display: flex;
- align-items: center;
- flex: 1;
- min-width: 0;
-}
-
-.kefu-banner-icon {
- width: 40rpx;
- height: 40rpx;
- margin-right: 14rpx;
- flex-shrink: 0;
-}
-
-.kefu-banner-title {
- display: block;
- font-size: 26rpx;
- font-weight: 700;
- color: #fff;
-}
-
-.kefu-banner-sub {
- display: block;
- font-size: 20rpx;
- color: rgba(255,255,255,0.6);
- margin-top: 2rpx;
-}
-
-.kefu-banner-btn {
- flex-shrink: 0;
- padding: 10rpx 22rpx;
- font-size: 22rpx;
- color: #2c3e50;
- font-weight: 600;
- background: #fff;
- border-radius: 999rpx;
- margin-left: 16rpx;
-}
-
-/* 身份认证 */
-.auth-grid {
- position: relative;
- z-index: 1;
- display: flex;
- padding: 12rpx 8rpx;
-}
-
-.auth-grid-dynamic {
- flex-wrap: wrap;
- justify-content: flex-start;
- gap: 0 24rpx;
-}
-
-.auth-grid-dynamic .auth-cell {
- width: auto;
- flex: 0 0 auto;
- min-width: 140rpx;
- box-sizing: border-box;
-}
-
-.auth-cell {
- flex: 1;
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 14rpx 6rpx;
-}
-
-.auth-cell-icon {
- width: 44rpx;
- height: 44rpx;
- margin-bottom: 8rpx;
-}
-
-.auth-cell-name {
- font-size: 22rpx;
- color: #555;
- margin-bottom: 4rpx;
-}
-
-.auth-cell-tag {
- font-size: 18rpx;
- color: #bbb;
- padding: 2rpx 10rpx;
- border-radius: 999rpx;
- background: #f5f5f5;
-}
-
-.auth-cell-tag-done {
- color: #5a6b57;
- background: #eef5ee;
-}
-
-/* 加载 */
.loading-mask {
position: fixed;
- top: 0; left: 0; right: 0; bottom: 0;
- background: rgba(255,255,255,0.7);
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(255, 255, 255, 0.6);
display: flex;
align-items: center;
justify-content: center;
- z-index: 10000;
+ z-index: 999;
}
.loading-spinner {
- width: 48rpx;
- height: 48rpx;
- border: 4rpx solid #e8e8e8;
- border-top-color: #333;
+ width: 60rpx;
+ height: 60rpx;
+ border: 4rpx solid rgba(0, 0, 0, 0.08);
+ border-top-color: #ffd061;
border-radius: 50%;
- animation: spin 0.8s linear infinite;
+ animation: fighterSpin 0.8s linear infinite;
+}
+
+@keyframes fighterSpin {
+ to { transform: rotate(360deg); }
}
diff --git a/pages/merchant-dispatch/merchant-dispatch.json b/pages/merchant-dispatch/merchant-dispatch.json
index 174aa76..c01f2ef 100644
--- a/pages/merchant-dispatch/merchant-dispatch.json
+++ b/pages/merchant-dispatch/merchant-dispatch.json
@@ -4,9 +4,9 @@
"popup-notice": "/components/popup-notice/popup-notice"
},
"backgroundTextStyle": "dark",
- "navigationBarBackgroundColor": "#0a0a0f",
- "navigationBarTitleText": "商家派单",
- "navigationBarTextStyle": "white",
- "backgroundColor": "#0a0a0f",
+ "navigationBarBackgroundColor": "#fff8e1",
+ "navigationBarTitleText": "自定义发单",
+ "navigationBarTextStyle": "black",
+ "backgroundColor": "#f5f5f5",
"enablePullDownRefresh": false
}
\ No newline at end of file
diff --git a/pages/merchant-dispatch/merchant-dispatch.wxml b/pages/merchant-dispatch/merchant-dispatch.wxml
index e6bebe8..947aba1 100644
--- a/pages/merchant-dispatch/merchant-dispatch.wxml
+++ b/pages/merchant-dispatch/merchant-dispatch.wxml
@@ -1,5 +1,5 @@
-
+
可用余额
@@ -144,7 +144,7 @@
选填
-
+
{{commissionEnabled ? '已开启' : '未开启'}}
{
+ wx.stopPullDownRefresh();
+ });
+ },
+
+ waitForConfigAndLoadBanner() {
+ if (app.globalData.ossImageUrl || app.globalData.apiBaseUrl) {
+ this.loadBannerData(true);
+ return;
+ }
+ setTimeout(() => this.waitForConfigAndLoadBanner(), 100);
+ },
+
+ processImageUrls(urlList) {
+ if (!urlList || !Array.isArray(urlList)) return [];
+ const oss = app.globalData.ossImageUrl || '';
+ return urlList.map((url) => (url && url.startsWith('http') ? url : oss + url));
+ },
+
+ checkRole() {
+ const ok = Number(wx.getStorageSync('shangjiastatus')) === 1;
+ this.setData({ isShangjia: ok });
+ },
+
+ loadBannerData(forceFetch) {
+ const g = app.globalData || {};
+ const cachedList = g.shangpinlunbo || [];
+ if (!forceFetch && cachedList.length) {
+ this.setData({
+ lunboList: this.processImageUrls(cachedList),
+ gonggao: g.shangpingonggao || '',
+ lunbozhanwei: g.lunbozhanwei || this.data.lunbozhanwei,
+ });
+ return Promise.resolve();
+ }
+ if (!forceFetch && g.shangpingonggao) {
+ this.setData({
+ lunboList: this.processImageUrls(cachedList),
+ gonggao: g.shangpingonggao,
+ });
+ return Promise.resolve();
+ }
+ const apiBase = g.apiBaseUrl || '';
+ if (!apiBase) return Promise.resolve();
+ return new Promise((resolve) => {
+ wx.request({
+ url: `${apiBase}/peizhi/shangpingonggao/`,
+ method: 'POST',
+ header: { 'content-type': 'application/json' },
+ success: (res) => {
+ if (res.statusCode === 200 && res.data) {
+ const data = res.data;
+ app.globalData.shangpingonggao = data.shangpingonggao || '';
+ app.globalData.shangpinlunbo = data.shangpinlunbo || [];
+ this.setData({
+ lunboList: this.processImageUrls(app.globalData.shangpinlunbo),
+ gonggao: app.globalData.shangpingonggao,
+ });
+ }
+ },
+ complete: resolve,
+ });
+ });
+ },
+
+ async loadDashboard() {
+ await Promise.all([
+ this.loadShangjiaBrief(),
+ this.loadPendingStats(),
+ this.loadRecentOrders(),
+ ]);
+ },
+
+ async loadShangjiaBrief() {
+ try {
+ const res = await request({
+ url: '/yonghu/shangjiaxinxi',
+ method: 'POST',
+ });
+ if (res.data && res.data.code === 200) {
+ const d = res.data.data || {};
+ app.globalData.shangjia = d;
+ this.setData({
+ stats: {
+ ...this.data.stats,
+ todayDispatch: d.jinripaidan || 0,
+ todayRefund: d.jinrituikuan || 0,
+ },
+ });
+ }
+ } catch (e) {
+ console.error('商家信息加载失败', e);
+ }
+ },
+
+ async loadPendingStats() {
+ try {
+ const res = await request({
+ url: '/dingdan/sjdingdanhq',
+ method: 'POST',
+ data: { zhuangtai_list: [8], page: 1, page_size: 20 },
+ });
+ if (res.data && (res.data.code === 0 || res.data.code === 200)) {
+ const data = res.data.data || {};
+ const list = data.list || [];
+ let amount = 0;
+ list.forEach((item) => {
+ const v = parseFloat(item.jine || item.dingdan_jine || 0);
+ if (!Number.isNaN(v)) amount += v;
+ });
+ this.setData({
+ stats: {
+ ...this.data.stats,
+ pendingCount: data.pending_count != null ? data.pending_count : list.length,
+ pendingAmount: amount.toFixed(2),
+ },
+ });
+ }
+ } catch (e) {
+ console.error('待结算统计失败', e);
+ }
+ },
+
+ /** 最近订单:同订单页「全部」筛选,取最新若干条 */
+ async loadRecentOrders() {
+ if (this.data.recentLoading) return;
+ this.setData({ recentLoading: true });
+ try {
+ const res = await request({
+ url: '/dingdan/sjdingdanhq',
+ method: 'POST',
+ data: {
+ zhuangtai_list: ALL_ORDER_ZHUANGTAI,
+ page: 1,
+ page_size: RECENT_ORDER_SIZE,
+ },
+ });
+ if (res.data && (res.data.code === 0 || res.data.code === 200)) {
+ const oss = app.globalData.ossImageUrl || '';
+ const list = (res.data.data.list || []).map((item) => {
+ let tupian = item.tupian || '';
+ if (tupian && !tupian.startsWith('http')) {
+ tupian = oss + tupian;
+ }
+ const raw = { ...item, tupian };
+ return {
+ dingdan_id: item.dingdan_id,
+ title: item.jieshao || '暂无描述',
+ time: item.create_time || '',
+ status: getOrderStatusText(item.zhuangtai),
+ money: item.jine || '0.00',
+ raw,
+ };
+ });
+ this.setData({ recentOrders: list });
+ }
+ } catch (e) {
+ console.error('最近订单加载失败', e);
+ } finally {
+ this.setData({ recentLoading: false });
+ }
+ },
+
+ onSwiperChange(e) {
+ this.setData({ swiperCurrent: e.detail.current });
+ },
+
+ goDispatch() {
+ wx.navigateTo({ url: '/pages/merchant-dispatch/merchant-dispatch' });
+ },
+
+ goExpress() {
+ wx.navigateTo({ url: '/pages/express-order/express-order' });
+ },
+
+ goOrdersTab() {
+ wx.redirectTo({ url: '/pages/merchant-orders/merchant-orders' });
+ },
+
+ goPendingOrders() {
+ wx.redirectTo({ url: '/pages/merchant-orders/merchant-orders' });
+ },
+
+ goOrderDetail(e) {
+ const index = e.currentTarget.dataset.index;
+ const row = this.data.recentOrders[index];
+ if (!row || !row.raw) return;
+ const dataStr = encodeURIComponent(JSON.stringify(row.raw));
+ wx.navigateTo({
+ url: `/pages/merchant-order-detail/merchant-order-detail?dingdanData=${dataStr}`,
+ });
+ },
+
+ goKefuKey() {
+ wx.navigateTo({ url: '/pages/merchant-kefu-key/merchant-kefu-key' });
+ },
+
+ goKefuList() {
+ wx.navigateTo({ url: '/pages/merchant-kefu-list/merchant-kefu-list' });
+ },
+
+ goMerchantProfile() {
+ wx.redirectTo({ url: '/pages/merchant/merchant' });
+ },
+
+ goRegister() {
+ wx.redirectTo({ url: '/pages/merchant/merchant' });
+ },
+}, {
+ roleConfig: {
+ role: 'shangjia',
+ statusKey: 'shangjiastatus',
+ dataFlag: 'isShangjia',
+ pageId: 'shangjiaduan',
+ },
+}));
diff --git a/pages/merchant-home/merchant-home.json b/pages/merchant-home/merchant-home.json
new file mode 100644
index 0000000..17e5366
--- /dev/null
+++ b/pages/merchant-home/merchant-home.json
@@ -0,0 +1,11 @@
+{
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": true,
+ "backgroundColor": "#fff8e1",
+ "backgroundTextStyle": "dark",
+ "usingComponents": {
+ "global-notification": "/components/global-notification/global-notification",
+ "popup-notice": "/components/popup-notice/popup-notice",
+ "tab-bar": "/tab-bar/index"
+ }
+}
diff --git a/pages/merchant-home/merchant-home.wxml b/pages/merchant-home/merchant-home.wxml
new file mode 100644
index 0000000..354e576
--- /dev/null
+++ b/pages/merchant-home/merchant-home.wxml
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+ 商家入驻
+ 完成入驻后可发单、管理订单
+ 去入驻
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{gonggao}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 查看更多
+
+
+
+ 待结算订单(数)
+ {{stats.pendingCount}}
+
+
+
+ 待结算金额(元)
+ {{stats.pendingAmount}}
+
+
+
+
+ 今日派单(数)
+ {{stats.todayDispatch}}
+
+
+
+ 今日退款(数)
+ {{stats.todayRefund}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 最近订单
+ 查看更多
+
+ 加载中...
+
+
+
+ {{item.title}}
+ {{item.time}} · {{item.status}}
+
+ ¥{{item.money}}
+
+
+ 暂无最近订单
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/merchant-home/merchant-home.wxss b/pages/merchant-home/merchant-home.wxss
new file mode 100644
index 0000000..1945741
--- /dev/null
+++ b/pages/merchant-home/merchant-home.wxss
@@ -0,0 +1,309 @@
+@import '../../styles/shangjia-xym-common.wxss';
+
+page {
+ background: #fff8e1;
+}
+
+.sj-page--home {
+ overflow: visible;
+ padding-bottom: calc(110rpx + env(safe-area-inset-bottom));
+}
+
+.nav-bar {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.guest-box {
+ margin-top: 80rpx;
+ padding: 48rpx 32rpx;
+ text-align: center;
+}
+
+.guest-title {
+ display: block;
+ font-size: 34rpx;
+ font-weight: 700;
+ color: #343434;
+}
+
+.guest-desc {
+ display: block;
+ font-size: 26rpx;
+ color: #888;
+ margin: 16rpx 0 32rpx;
+}
+
+.guest-btn {
+ height: 88rpx;
+ font-size: 30rpx;
+}
+
+.sj-main-body {
+ position: relative;
+ z-index: 3;
+ padding-bottom: 24rpx;
+}
+
+.swiper-wrap {
+ box-sizing: border-box;
+ overflow: hidden;
+ margin: 12rpx 24rpx 16rpx;
+}
+
+.swiper-con {
+ position: relative;
+ overflow: hidden;
+}
+
+.banner-swiper,
+.slide-image,
+.banner-placeholder {
+ width: 100%;
+ height: 300rpx;
+ border-radius: 20rpx;
+}
+
+.dots {
+ position: absolute;
+ bottom: 20rpx;
+ left: 50%;
+ transform: translateX(-50%);
+ z-index: 3;
+ gap: 10rpx;
+}
+
+.dot {
+ width: 8rpx;
+ height: 8rpx;
+ border-radius: 50%;
+ background: #fff;
+ transition: all 0.3s;
+}
+
+.dot.active {
+ width: 16rpx;
+ border-radius: 8rpx;
+ background: #ffd061;
+}
+
+.sj-notice-bar {
+ display: flex;
+ align-items: center;
+ background: #fdf9db;
+ margin: 0 24rpx;
+ border-radius: 10rpx;
+ padding: 10rpx 16rpx;
+}
+
+.notice-ico {
+ width: 56rpx;
+ height: 56rpx;
+ flex-shrink: 0;
+ margin-right: 12rpx;
+}
+
+.sj-notice-txt {
+ font-size: 24rpx;
+ color: #666;
+ line-height: 1.5;
+ flex: 1;
+}
+
+.sj-fadan-row {
+ display: flex;
+ margin: 24rpx 20rpx 0;
+ padding: 10rpx;
+ gap: 8rpx;
+}
+
+.sj-fadan-img-btn {
+ flex: 1;
+ height: 150rpx;
+ background-size: 100% 100%;
+ background-repeat: no-repeat;
+}
+
+.sj-fadan-img-btn--left {
+ background-image: url('https://bintao.xmxym88.com/xcx/bintao/74.png');
+ margin-right: 8rpx;
+}
+
+.sj-fadan-img-btn--right {
+ background-image: url('https://bintao.xmxym88.com/xcx/bintao/76.png');
+ margin-left: 8rpx;
+}
+
+.merchant-stats {
+ margin: 32rpx 25rpx 0;
+ border-radius: 26rpx;
+ padding-bottom: 24rpx;
+ position: relative;
+ overflow: hidden;
+ background: #fff;
+ box-shadow: 0 6rpx 22rpx rgba(0, 0, 0, 0.08);
+}
+
+.merchant-stats-bg {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-size: 100% auto;
+ background-repeat: no-repeat;
+ pointer-events: none;
+ z-index: 0;
+}
+
+.merchant-stats-inner {
+ position: relative;
+ z-index: 2;
+ padding: 0 0 10rpx;
+}
+
+.stats-hd {
+ padding: 24rpx 25rpx 10rpx;
+}
+
+.stats-hd-sp {
+ flex: 1;
+}
+
+.stats-more {
+ font-size: 28rpx;
+ font-weight: 700;
+ color: #fff;
+}
+
+.stats-row {
+ align-items: stretch;
+ background: #fff;
+ border-radius: 20rpx;
+ margin: 0 16rpx;
+}
+
+.stats-row--gap {
+ margin-top: 12rpx;
+}
+
+.stat-col {
+ flex: 1;
+ min-width: 0;
+ padding: 36rpx 24rpx;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+}
+
+.stat-lbl {
+ font-size: 24rpx;
+ color: #666;
+ opacity: 0.85;
+ margin-bottom: 12rpx;
+}
+
+.stat-num {
+ font-size: 44rpx;
+ font-weight: 700;
+ color: #222;
+}
+
+.stat-divider {
+ width: 2rpx;
+ background: #eee;
+ height: 80rpx;
+ align-self: center;
+ flex-shrink: 0;
+}
+
+.stats-kefu-wrap {
+ margin: 20rpx 24rpx 0;
+}
+
+.kefu-row-inset {
+ align-items: flex-start;
+ width: 100%;
+ gap: 20rpx;
+}
+
+.kefu-btn-inset {
+ flex: 1;
+ line-height: 0;
+}
+
+.kefu-inset-img {
+ width: 100%;
+ display: block;
+}
+
+.recent-box {
+ margin: 28rpx 24rpx 0;
+ border-radius: 26rpx;
+ background: #fff;
+ padding-bottom: 10rpx;
+ box-shadow: 0 6rpx 22rpx rgba(0, 0, 0, 0.06);
+}
+
+.recent-hd {
+ padding: 24rpx;
+}
+
+.recent-title {
+ font-size: 32rpx;
+ font-weight: 700;
+ color: #222;
+}
+
+.recent-more {
+ font-size: 24rpx;
+ color: #999;
+}
+
+.recent-item {
+ padding: 20rpx 24rpx;
+ border-top: 1rpx solid #f0f0f0;
+ align-items: center;
+}
+
+.recent-name {
+ font-size: 28rpx;
+ font-weight: 700;
+ color: #333;
+}
+
+.recent-sub {
+ font-size: 22rpx;
+ color: #999;
+ margin-top: 8rpx;
+ display: block;
+}
+
+.recent-money {
+ font-size: 30rpx;
+ color: #e67e22;
+ font-weight: 700;
+ flex-shrink: 0;
+ margin-left: 16rpx;
+}
+
+.recent-main {
+ flex: 1;
+ min-width: 0;
+}
+
+.recent-empty {
+ text-align: center;
+ padding: 48rpx;
+ font-size: 26rpx;
+ color: #999;
+}
+
+.line2 {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+}
diff --git a/pages/merchant-kefu-key/merchant-kefu-key.js b/pages/merchant-kefu-key/merchant-kefu-key.js
new file mode 100644
index 0000000..07716c2
--- /dev/null
+++ b/pages/merchant-kefu-key/merchant-kefu-key.js
@@ -0,0 +1,60 @@
+/** 客服邀请码/秘钥 - UI 预览,后端接入前使用 mock 数据 */
+Page({
+ data: {
+ statusBar: 20,
+ gudingCode: 'XQKF2026',
+ kefuTips: '客服秘钥用于绑定子客服账号,后端接口就绪后将自动替换为真实数据。',
+ sublist: [{ name: '全部' }, { name: '未使用' }, { name: '已使用' }],
+ subCurrent: 0,
+ list: [
+ { id: 1, typeName: '财务', code: 'CW-8X2K9P', status: 0, adddate: '2026-06-10' },
+ { id: 2, typeName: '总管', code: 'ZG-3M7N1Q', status: 1, adddate: '2026-06-08', usedate: '2026-06-12', user: { nickname: '客服小张', avatar: '/images/default-avatar.png' } },
+ ],
+ showQrcodeTips: false,
+ },
+
+ onLoad() {
+ const sys = wx.getSystemInfoSync();
+ this.setData({ statusBar: sys.statusBarHeight || 20 });
+ },
+
+ goBack() {
+ wx.navigateBack();
+ },
+
+ copyFixed() {
+ wx.setClipboardData({ data: this.data.gudingCode });
+ },
+
+ switchSub(e) {
+ this.setData({ subCurrent: Number(e.currentTarget.dataset.idx) });
+ },
+
+ addKey() {
+ wx.showToast({ title: '后端接入后可添加', icon: 'none' });
+ },
+
+ copyCode(e) {
+ wx.setClipboardData({ data: e.currentTarget.dataset.code || '' });
+ },
+
+ delKey() {
+ wx.showToast({ title: '预览数据不可删除', icon: 'none' });
+ },
+
+ showTips() {
+ this.setData({ showQrcodeTips: true });
+ },
+
+ closeTips() {
+ this.setData({ showQrcodeTips: false });
+ },
+
+ previewQr() {
+ wx.previewImage({
+ urls: ['https://xy-1314784552.cos.ap-guangzhou.myqcloud.com/uploads/images/ewm.png'],
+ });
+ },
+
+ noop() {},
+});
diff --git a/pages/merchant-kefu-key/merchant-kefu-key.json b/pages/merchant-kefu-key/merchant-kefu-key.json
new file mode 100644
index 0000000..d977dfc
--- /dev/null
+++ b/pages/merchant-kefu-key/merchant-kefu-key.json
@@ -0,0 +1,5 @@
+{
+ "navigationStyle": "custom",
+ "backgroundColor": "#fff8e1",
+ "usingComponents": {}
+}
diff --git a/pages/merchant-kefu-key/merchant-kefu-key.wxml b/pages/merchant-kefu-key/merchant-kefu-key.wxml
new file mode 100644
index 0000000..76ea3a5
--- /dev/null
+++ b/pages/merchant-kefu-key/merchant-kefu-key.wxml
@@ -0,0 +1,69 @@
+
+
+
+
+
+ ‹
+ 邀请码
+
+
+
+
+
+
+ 固定邀请码:
+ {{gudingCode}}
+
+ 复制
+
+
+ {{kefuTips}}
+
+
+
+ {{item.name}}
+
+ 添加
+
+
+
+ 秘钥使用方法
+ ›
+
+
+
+
+ {{item.typeName}}
+ {{item.code}}
+ {{item.status==0?'未使用':'已使用'}}
+
+ 生成日期:{{item.adddate}}
+ 使用日期:{{item.usedate}}
+
+
+ 使用人:{{item.user.nickname}}
+
+
+ 复制秘钥
+ 删除
+
+
+
+ 暂无卡密
+ 预览 · 接口就绪后对接真实数据
+
+
+
+
+
+
+
diff --git a/pages/merchant-kefu-key/merchant-kefu-key.wxss b/pages/merchant-kefu-key/merchant-kefu-key.wxss
new file mode 100644
index 0000000..b51a295
--- /dev/null
+++ b/pages/merchant-kefu-key/merchant-kefu-key.wxss
@@ -0,0 +1,335 @@
+.pagebg {
+ min-height: 100vh;
+ background: #f5f5f5;
+ position: relative;
+ overflow: hidden;
+}
+
+.page-bg-img {
+ width: 100%;
+ position: absolute;
+ top: 0;
+ left: 50%;
+ transform: translateX(-50%);
+ z-index: 0;
+ max-height: 420rpx;
+}
+
+.page-body {
+ position: relative;
+ z-index: 2;
+ display: flex;
+ flex-direction: column;
+ min-height: 100vh;
+ box-sizing: border-box;
+}
+
+.status-bar,
+.nav-bar {
+ flex-shrink: 0;
+}
+
+.nav-bar {
+ padding: 0 24rpx;
+ height: 88rpx;
+ align-items: center;
+}
+
+.nav-title {
+ font-size: 34rpx;
+ font-weight: 700;
+ color: #343434;
+}
+
+.back {
+ width: 60rpx;
+ font-size: 48rpx;
+ color: #333;
+}
+
+.back.placeholder {
+ opacity: 0;
+}
+
+.flex { display: flex; align-items: center; }
+.flexb { display: flex; align-items: center; justify-content: space-between; }
+.flexa { display: flex; align-items: center; justify-content: space-around; }
+
+.list-scroll {
+ flex: 1;
+ height: calc(100vh - 88rpx);
+ padding: 0 20rpx 30rpx;
+ box-sizing: border-box;
+}
+
+.fixed-code-card {
+ background: #fff;
+ border-radius: 20rpx;
+ padding: 24rpx;
+ margin: 10rpx 0 16rpx;
+ align-items: center;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
+}
+
+.fixed-code-main {
+ flex: 1;
+ min-width: 0;
+}
+
+.fixed-code-lbl {
+ font-size: 28rpx;
+ color: #333;
+ font-weight: 700;
+}
+
+.fixed-code-val {
+ display: block;
+ margin-top: 8rpx;
+ font-size: 32rpx;
+ color: #f00;
+ font-weight: 700;
+ word-break: break-all;
+}
+
+.copy-btn {
+ padding: 16rpx 32rpx;
+ min-height: 64rpx;
+ border-radius: 10rpx;
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ color: #492f00;
+ font-size: 28rpx;
+ font-weight: 700;
+ flex-shrink: 0;
+ margin-left: 16rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+}
+
+.tips-bar {
+ background: #fff7e6;
+ border: 1rpx solid #ffd591;
+ border-radius: 12rpx;
+ padding: 18rpx 20rpx;
+ font-size: 26rpx;
+ color: #ad6800;
+ line-height: 1.5;
+ margin-bottom: 16rpx;
+}
+
+.toolbar {
+ margin-bottom: 12rpx;
+ padding: 6rpx 0;
+ align-items: center;
+}
+
+.sub-tabs {
+ flex: 1;
+ background: #fff;
+ border-radius: 12rpx;
+ padding: 6rpx;
+}
+
+.sub-tab {
+ padding: 16rpx 24rpx;
+ font-size: 26rpx;
+ color: #666;
+ border-radius: 8rpx;
+}
+
+.sub-tab.on {
+ background: #1b6ef3;
+ color: #fff;
+}
+
+.add-btn {
+ margin-left: 16rpx;
+ padding: 16rpx 32rpx;
+ min-height: 64rpx;
+ background: #1b6ef3;
+ color: #fff;
+ border-radius: 10rpx;
+ font-size: 28rpx;
+ font-weight: 700;
+ flex-shrink: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+}
+
+.help-row {
+ background: #fff;
+ border-radius: 12rpx;
+ padding: 22rpx 24rpx;
+ margin-bottom: 16rpx;
+ align-items: center;
+}
+
+.help-link {
+ font-size: 28rpx;
+ color: #1b6ef3;
+ font-weight: 700;
+}
+
+.help-arrow {
+ font-size: 36rpx;
+ color: #999;
+}
+
+.key-item {
+ background: #fff;
+ border-radius: 16rpx;
+ padding: 24rpx;
+ margin-bottom: 16rpx;
+ box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
+}
+
+.key-row {
+ align-items: flex-start;
+ margin-bottom: 10rpx;
+}
+
+.tag-type {
+ font-size: 22rpx;
+ color: #fff;
+ background: #1b6ef3;
+ padding: 6rpx 14rpx;
+ border-radius: 6rpx;
+ margin-right: 12rpx;
+ flex-shrink: 0;
+}
+
+.key-code {
+ flex: 1;
+ font-size: 30rpx;
+ font-weight: 700;
+ color: #333;
+ word-break: break-all;
+ padding-right: 12rpx;
+}
+
+.status-txt {
+ font-size: 24rpx;
+ flex-shrink: 0;
+}
+
+.status-txt.unused { color: #0a0; }
+.status-txt.used { color: #aaa; }
+
+.key-meta {
+ font-size: 24rpx;
+ color: #aaa;
+ margin-top: 8rpx;
+}
+
+.key-user {
+ align-items: center;
+ margin-top: 10rpx;
+ font-size: 24rpx;
+ color: #666;
+}
+
+.user-av {
+ width: 48rpx;
+ height: 48rpx;
+ border-radius: 50%;
+ margin-right: 10rpx;
+}
+
+.key-actions {
+ margin-top: 16rpx;
+ padding-top: 16rpx;
+ border-top: 1rpx dashed #eee;
+}
+
+.act-copy,
+.act-del {
+ font-size: 28rpx;
+ padding: 12rpx 24rpx;
+ border-radius: 8rpx;
+}
+
+.act-copy {
+ color: #007aff;
+ background: #eef6ff;
+}
+
+.act-del {
+ color: #fff;
+ background: #f56c6c;
+}
+
+.empty-tip {
+ text-align: center;
+ color: #999;
+ padding: 80rpx 0;
+ font-size: 28rpx;
+}
+
+.load-tip {
+ text-align: center;
+ padding: 32rpx;
+ font-size: 22rpx;
+ color: #bbb;
+}
+
+.mask {
+ position: fixed;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, 0.45);
+ z-index: 99;
+ display: flex;
+ align-items: flex-end;
+}
+
+.popup {
+ width: 100%;
+ background: #fff;
+ border-radius: 26rpx 26rpx 0 0;
+ padding-bottom: calc(30rpx + env(safe-area-inset-bottom));
+}
+
+.popup-title {
+ font-size: 32rpx;
+ font-weight: 700;
+ padding: 30rpx;
+}
+
+.popup-scroll {
+ max-height: 60vh;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+}
+
+.popup-txt {
+ font-size: 28rpx;
+ line-height: 1.6;
+ color: #333;
+}
+
+.qr-wrap {
+ background: #f9f9f9;
+ margin-top: 30rpx;
+ text-align: center;
+ padding: 20rpx;
+}
+
+.qr-img {
+ width: 100%;
+}
+
+.popup-close {
+ margin: 20rpx 30rpx 0;
+ text-align: center;
+ padding: 24rpx;
+ background: #1b6ef3;
+ color: #fff;
+ border-radius: 12rpx;
+ font-size: 30rpx;
+ font-weight: 700;
+}
diff --git a/pages/merchant-kefu-list/merchant-kefu-list.js b/pages/merchant-kefu-list/merchant-kefu-list.js
new file mode 100644
index 0000000..20e28fe
--- /dev/null
+++ b/pages/merchant-kefu-list/merchant-kefu-list.js
@@ -0,0 +1,47 @@
+/** 客服列表 - UI 预览,mock 数据 */
+Page({
+ data: {
+ statusBar: 20,
+ list: [
+ {
+ id: 1,
+ nickname: '客服总管-阿星',
+ avatar: '/images/default-avatar.png',
+ uid: '1008601',
+ isChief: true,
+ isFinance: false,
+ orderCount: 128,
+ settleCount: 96,
+ settleAmount: '12800.00',
+ },
+ {
+ id: 2,
+ nickname: '财务-小李',
+ avatar: '/images/default-avatar.png',
+ uid: '1008602',
+ isChief: false,
+ isFinance: true,
+ orderCount: 56,
+ settleCount: 52,
+ settleAmount: '6800.00',
+ },
+ ],
+ },
+
+ onLoad() {
+ const sys = wx.getSystemInfoSync();
+ this.setData({ statusBar: sys.statusBarHeight || 20 });
+ },
+
+ goBack() {
+ wx.navigateBack();
+ },
+
+ copyUid(e) {
+ wx.setClipboardData({ data: e.currentTarget.dataset.uid || '' });
+ },
+
+ onAction(e) {
+ wx.showToast({ title: '后端接入后生效', icon: 'none' });
+ },
+});
diff --git a/pages/merchant-kefu-list/merchant-kefu-list.json b/pages/merchant-kefu-list/merchant-kefu-list.json
new file mode 100644
index 0000000..d977dfc
--- /dev/null
+++ b/pages/merchant-kefu-list/merchant-kefu-list.json
@@ -0,0 +1,5 @@
+{
+ "navigationStyle": "custom",
+ "backgroundColor": "#fff8e1",
+ "usingComponents": {}
+}
diff --git a/pages/merchant-kefu-list/merchant-kefu-list.wxml b/pages/merchant-kefu-list/merchant-kefu-list.wxml
new file mode 100644
index 0000000..db7b934
--- /dev/null
+++ b/pages/merchant-kefu-list/merchant-kefu-list.wxml
@@ -0,0 +1,47 @@
+
+
+
+ ‹
+ 客服列表
+
+
+
+
+
+
+
+
+
+ {{item.nickname}}
+ 总管
+ 财务
+
+
+ ID: {{item.uid}}
+ 复制
+
+
+
+
+
+ {{item.orderCount}}
+ 接单数
+
+
+ {{item.settleCount}}
+ 结算数
+
+
+ ¥{{item.settleAmount}}
+ 结算金额
+
+
+
+ 查看订单
+ 权限管理
+ 删除
+
+
+ 预览 · 接口就绪后对接真实数据
+
+
diff --git a/pages/merchant-kefu-list/merchant-kefu-list.wxss b/pages/merchant-kefu-list/merchant-kefu-list.wxss
new file mode 100644
index 0000000..effefea
--- /dev/null
+++ b/pages/merchant-kefu-list/merchant-kefu-list.wxss
@@ -0,0 +1,109 @@
+@import '../../styles/shangjia-xym-common.wxss';
+
+.sub-nav {
+ padding: 0 24rpx 12rpx;
+}
+
+.back {
+ width: 60rpx;
+ font-size: 48rpx;
+ color: #333;
+}
+
+.back.placeholder { opacity: 0; }
+
+.sub-nav-title {
+ font-size: 34rpx;
+ font-weight: 700;
+ color: #343434;
+}
+
+.sub-scroll {
+ height: calc(100vh - 120rpx);
+}
+
+.kefu-card {
+ background: #fff;
+ border-radius: 20rpx;
+ padding: 24rpx;
+ margin-bottom: 16rpx;
+ margin-top: 12rpx;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
+}
+
+.kefu-av {
+ width: 88rpx;
+ height: 88rpx;
+ border-radius: 50%;
+ margin-right: 16rpx;
+ background: #eee;
+}
+
+.kefu-name {
+ font-size: 30rpx;
+ font-weight: 700;
+ color: #333;
+}
+
+.badge {
+ margin-left: 8rpx;
+ font-size: 20rpx;
+ padding: 2rpx 10rpx;
+ border-radius: 6rpx;
+ color: #fff;
+}
+
+.badge-chief { background: #ffb508; }
+.badge-finance { background: #1b6ef3; }
+
+.kefu-uid {
+ font-size: 24rpx;
+ color: #999;
+ margin-top: 8rpx;
+}
+
+.copy-link {
+ margin-left: 12rpx;
+ font-size: 22rpx;
+ color: #1b6ef3;
+}
+
+.kefu-stats {
+ margin-top: 20rpx;
+ padding: 16rpx 0;
+ border-top: 1rpx solid #f5f5f5;
+ border-bottom: 1rpx solid #f5f5f5;
+}
+
+.stat-n {
+ font-size: 28rpx;
+ font-weight: 700;
+ color: #e67e22;
+}
+
+.stat-l {
+ font-size: 22rpx;
+ color: #999;
+ margin-top: 4rpx;
+}
+
+.kefu-actions {
+ margin-top: 16rpx;
+ gap: 24rpx;
+}
+
+.act {
+ font-size: 24rpx;
+ color: #1b6ef3;
+}
+
+.act-del {
+ color: #e64340;
+}
+
+.load-tip {
+ text-align: center;
+ padding: 32rpx;
+ font-size: 22rpx;
+ color: #bbb;
+}
diff --git a/pages/merchant/merchant.js b/pages/merchant/merchant.js
index 70d676e..2d5a1bb 100644
--- a/pages/merchant/merchant.js
+++ b/pages/merchant/merchant.js
@@ -1,242 +1,288 @@
-// pages/shangjiazhongxin/shangjiiazhongxin.js
-
-import { createPage, ensureRoleOnCenterPage, lockPrimaryRole, parseSceneOptions } from '../../utils/base-page.js';
-import { ensureLogin } from '../../utils/login.js';
-
-const app = getApp();
-
-Page(createPage({
- data: {
- // 图片资源
- imgUrls: {
- pageBg: '',
- avatarCardBg: '',
- assetCardBg: '',
- statCardBg: '',
- funcItemBg: '',
- primaryFuncBg: '',
- highlightFuncBg: '',
- iconRelease: '',
- iconFast: '',
- iconOrders: '',
- iconService: '',
- iconPunish: '',
- iconRank: '',
- iconRecharge: '',
- iconWithdraw: '',
- iconRefresh: '',
- iconCopy: '',
- avatarFrame: '',
- iconClear: '',
- },
-
- // 商家状态
- isShangjia: false,
- isAutoRegistering: false,
-
- // 用户基础信息
- uid: '',
- avatarUrl: '',
- nicheng: '',
-
- // 商家核心数据
- sjyue: '0.00',
- fabu: 0,
- tuikuan: 0,
- jinriliushui: '0.00',
- jinyueliushui: '0.00',
- jinridingdan: 0,
- jinrituikuan: 0,
- chenghaoList: [],
-
- // 交互控制
- inviteCode: '',
- },
-
- onLoad(options) {
- const parsed = parseSceneOptions(options);
- this.setupImageUrls();
- this.checkRoleStatus();
-
- const inviteCode = parsed.inviteCode;
- if (inviteCode) {
- this.setData({ inviteCode });
- setTimeout(() => this.handleInviteCodeWithLoginCheck({
- inviteCode,
- role: 'shangjia',
- statusKey: 'shangjiastatus',
- alreadyMsg: '您已是商家',
- onNeedLogin: (code) => {
- this.setData({ inviteCode: code });
- ensureLogin({ silent: false, page: this })
- .then(() => {
- if (!this.data.isShangjia) {
- wx.showLoading({ title: '商家注册中...', mask: true });
- this.setData({ isAutoRegistering: true });
- this.onRegister();
- }
- })
- .catch(() => {});
- },
- onAlreadyRegistered: () => {
- wx.showToast({ title: '您已是商家', icon: 'success' });
- ensureRoleOnCenterPage(this, 'shangjia');
- },
- }), 500);
- }
-
- this.checkColdStartPopup('shangjiaduan');
- },
-
- onShow() {
- this.registerNotificationComponent();
- if (this.data.isShangjia) {
- ensureRoleOnCenterPage(this, 'shangjia');
- this.refreshShangjiaInfo();
- }
- },
-
- // 图片路径初始化
- setupImageUrls() {
- const ossBase = app.globalData.ossImageUrl || '';
- const imgDir = `${ossBase}beijing/shangjiaduan/`;
- this.setData({
- imgUrls: this.initImageUrls({
- pageBg: `${imgDir}page_bg.png`,
- avatarCardBg: `${imgDir}avatar_card_bg.png`,
- assetCardBg: `${imgDir}asset_card_bg.png`,
- statCardBg: `${imgDir}stat_card_bg.png`,
- funcItemBg: `${imgDir}func_item_bg.png`,
- primaryFuncBg: `${imgDir}primary_func_bg.png`,
- highlightFuncBg: `${imgDir}highlight_func_bg.png`,
- iconRelease: `${imgDir}icon_release.png`,
- iconFast: `${imgDir}icon_fast.png`,
- iconOrders: `${imgDir}icon_orders.png`,
- iconService: `${imgDir}icon_service.png`,
- iconPunish: `${imgDir}icon_punish.png`,
- iconRank: `${imgDir}icon_rank.png`,
- iconRecharge: `${imgDir}icon_recharge.png`,
- iconWithdraw: `${imgDir}icon_withdraw.png`,
- iconRefresh: `${imgDir}icon_refresh.png`,
- iconCopy: `${imgDir}icon_copy.png`,
- avatarFrame: `${imgDir}avatar_frame.png`,
- iconClear: `${ossBase}beijing/tubiao/grzx_qingchu.jpg`,
- iconSwitch: '/images/_exit.png',
- })
- });
- },
-
- // 商家状态检查(覆盖基类 checkRoleStatus,增加 getShangjiaInfo 调用)
- checkRoleStatus() {
- try {
- const shangjiastatus = wx.getStorageSync('shangjiastatus');
- const uid = wx.getStorageSync('uid');
- if (shangjiastatus) {
- this.setData({ isShangjia: true, uid: uid || '' });
- this.loadAvatar();
- this.getShangjiaInfo();
- ensureRoleOnCenterPage(this, 'shangjia');
- } else {
- this.setData({ isShangjia: false });
- }
- } catch (error) {
- console.error('读取商家状态失败', error);
- this.setData({ isShangjia: false });
- }
- },
-
- // 获取商家信息
- async getShangjiaInfo() {
- await this.loadData({
- url: '/yonghu/shangjiaxinxi',
- method: 'POST',
- successCode: 200,
- errorMsg: '获取商家信息失败',
- onSuccess: (data) => {
- // 更新全局缓存
- app.globalData.shangjia = data;
- wx.setStorageSync('shangjiastatus', 1);
-
- const chenghaoList = data.chenghao_list || [];
-
- this.setData({
- nicheng: data.nicheng || '',
- sjyue: data.sjyue || '0.00',
- fabu: data.fadanzong || 0,
- tuikuan: data.tuikuanzong || 0,
- jinriliushui: data.riliushui || '0.00',
- jinyueliushui: data.yueliushui || '0.00',
- jinridingdan: data.jinripaidan || 0,
- jinrituikuan: data.jinrituikuan || 0,
- chenghaoList: chenghaoList,
- isLoading: false,
- });
-
- if (this.data.isAutoRegistering) {
- this.setData({ isAutoRegistering: false });
- wx.showToast({ title: '商家注册成功', icon: 'success' });
- }
- },
- });
- },
-
- refreshShangjiaInfo() {
- this.throttledRefresh(() => this.getShangjiaInfo());
- },
-
- async onRegister() {
- const { inviteCode } = this.data;
- await this.registerWithInviteCode({
- inviteCode,
- apiUrl: '/yonghu/shangjiahuce',
- role: 'shangjia',
- statusKey: 'shangjiastatus',
- successMsg: '商家注册成功',
- onSuccess: (userData) => {
- app.globalData.shangjia = userData;
- const chenghaoList = userData.chenghao_list || [];
- this.setData({
- isShangjia: true,
- nicheng: userData.nicheng || '',
- sjyue: userData.sjyue || '0.00',
- fabu: userData.fabu || 0,
- tuikuan: userData.tuikuan || 0,
- jinriliushui: userData.jinriliushui || '0.00',
- jinyueliushui: userData.jinyueliushui || '0.00',
- jinridingdan: userData.jinridingdan || 0,
- chenghaoList: chenghaoList,
- isAutoRegistering: false,
- });
- this.loadAvatar();
- ensureRoleOnCenterPage(this, 'shangjia');
- lockPrimaryRole('shangjia');
- },
- });
- },
-
- previewAvatar() {
- if (this.data.avatarUrl) {
- wx.previewImage({ urls: [this.data.avatarUrl] });
- }
- },
-
- // 页面跳转
- goToPaiDan() { wx.navigateTo({ url: '/pages/merchant-dispatch/merchant-dispatch' }); },
- goToJiSuPaiDan() {
- wx.vibrateShort({ type: 'medium' });
- wx.navigateTo({ url: '/pages/express-order/express-order' });
- },
- goToMyOrders() { wx.navigateTo({ url: '/pages/merchant-orders/merchant-orders' }); },
- goToRecharge() { wx.navigateTo({ url: '/pages/merchant-recharge/merchant-recharge' }); },
- goToWithdraw() { wx.navigateTo({ url: '/pages/withdraw/withdraw' }); },
- goToRanking() { wx.navigateTo({ url: '/pages/fighter-rank/fighter-rank?type=shangjia' }); },
- goToMessages() { wx.navigateTo({ url: '/pages/merchant-msg/merchant-msg' }); },
-}, {
- roleConfig: {
- role: 'shangjia',
- statusKey: 'shangjiastatus',
- dataFlag: 'isShangjia',
- pageId: 'shangjiaduan',
- apiUrl: '/yonghu/shangjiaxinxi',
- },
-}));
+// pages/shangjiazhongxin/shangjiiazhongxin.js
+
+import { createPage, ensureRoleOnCenterPage, lockPrimaryRole, parseSceneOptions, request } from '../../utils/base-page.js';
+import { ensureLogin } from '../../utils/login.js';
+
+const app = getApp();
+
+Page(createPage({
+ data: {
+ // 图片资源
+ imgUrls: {
+ pageBg: '',
+ avatarCardBg: '',
+ assetCardBg: '',
+ statCardBg: '',
+ funcItemBg: '',
+ primaryFuncBg: '',
+ highlightFuncBg: '',
+ iconRelease: '',
+ iconFast: '',
+ iconOrders: '',
+ iconService: '',
+ iconPunish: '',
+ iconRank: '',
+ iconRecharge: '',
+ iconWithdraw: '',
+ iconRefresh: '',
+ iconCopy: '',
+ avatarFrame: '',
+ iconClear: '',
+ },
+
+ // 商家状态
+ isShangjia: false,
+ isAutoRegistering: false,
+
+ // 用户基础信息
+ uid: '',
+ avatarUrl: '',
+ nicheng: '',
+
+ // 商家核心数据
+ sjyue: '0.00',
+ fabu: 0,
+ tuikuan: 0,
+ jinriliushui: '0.00',
+ jinyueliushui: '0.00',
+ jinridingdan: 0,
+ jinrituikuan: 0,
+ chenghaoList: [],
+
+ // 交互控制
+ inviteCode: '',
+ pendingCount: 0,
+ punishPending: 0,
+ statusBar: 20,
+ navBar: 44,
+ },
+
+ onLoad(options) {
+ const sys = wx.getSystemInfoSync();
+ this.setData({
+ statusBar: sys.statusBarHeight || 20,
+ navBar: (sys.statusBarHeight || 20) + 44,
+ });
+ const parsed = parseSceneOptions(options);
+ this.setupImageUrls();
+ this.checkRoleStatus();
+
+ const inviteCode = parsed.inviteCode;
+ if (inviteCode) {
+ this.setData({ inviteCode });
+ setTimeout(() => this.handleInviteCodeWithLoginCheck({
+ inviteCode,
+ role: 'shangjia',
+ statusKey: 'shangjiastatus',
+ alreadyMsg: '您已是商家',
+ onNeedLogin: (code) => {
+ this.setData({ inviteCode: code });
+ ensureLogin({ silent: false, page: this })
+ .then(() => {
+ if (!this.data.isShangjia) {
+ wx.showLoading({ title: '商家注册中...', mask: true });
+ this.setData({ isAutoRegistering: true });
+ this.onRegister();
+ }
+ })
+ .catch(() => {});
+ },
+ onAlreadyRegistered: () => {
+ wx.showToast({ title: '您已是商家', icon: 'success' });
+ ensureRoleOnCenterPage(this, 'shangjia');
+ },
+ }), 500);
+ }
+
+ this.checkColdStartPopup('shangjiaduan');
+ },
+
+ onShow() {
+ this.registerNotificationComponent();
+ if (this.data.isShangjia) {
+ ensureRoleOnCenterPage(this, 'shangjia');
+ this.refreshShangjiaInfo();
+ this.loadPendingCount();
+ this.loadPunishPending();
+ }
+ },
+
+ // 图片路径初始化
+ setupImageUrls() {
+ const ossBase = app.globalData.ossImageUrl || '';
+ const imgDir = `${ossBase}beijing/shangjiaduan/`;
+ this.setData({
+ imgUrls: this.initImageUrls({
+ pageBg: `${imgDir}page_bg.png`,
+ avatarCardBg: `${imgDir}avatar_card_bg.png`,
+ assetCardBg: `${imgDir}asset_card_bg.png`,
+ statCardBg: `${imgDir}stat_card_bg.png`,
+ funcItemBg: `${imgDir}func_item_bg.png`,
+ primaryFuncBg: `${imgDir}primary_func_bg.png`,
+ highlightFuncBg: `${imgDir}highlight_func_bg.png`,
+ iconRelease: `${imgDir}icon_release.png`,
+ iconFast: `${imgDir}icon_fast.png`,
+ iconOrders: `${imgDir}icon_orders.png`,
+ iconService: `${imgDir}icon_service.png`,
+ iconPunish: `${imgDir}icon_punish.png`,
+ iconRank: `${imgDir}icon_rank.png`,
+ iconRecharge: `${imgDir}icon_recharge.png`,
+ iconWithdraw: `${imgDir}icon_withdraw.png`,
+ iconRefresh: `${imgDir}icon_refresh.png`,
+ iconCopy: `${imgDir}icon_copy.png`,
+ avatarFrame: `${imgDir}avatar_frame.png`,
+ iconClear: `${ossBase}beijing/tubiao/grzx_qingchu.jpg`,
+ iconSwitch: '/images/_exit.png',
+ })
+ });
+ },
+
+ // 商家状态检查(覆盖基类 checkRoleStatus,增加 getShangjiaInfo 调用)
+ checkRoleStatus() {
+ try {
+ const shangjiastatus = wx.getStorageSync('shangjiastatus');
+ const uid = wx.getStorageSync('uid');
+ if (shangjiastatus) {
+ this.setData({ isShangjia: true, uid: uid || '' });
+ this.loadAvatar();
+ this.getShangjiaInfo();
+ ensureRoleOnCenterPage(this, 'shangjia');
+ } else {
+ this.setData({ isShangjia: false });
+ }
+ } catch (error) {
+ console.error('读取商家状态失败', error);
+ this.setData({ isShangjia: false });
+ }
+ },
+
+ // 获取商家信息
+ async getShangjiaInfo() {
+ await this.loadData({
+ url: '/yonghu/shangjiaxinxi',
+ method: 'POST',
+ successCode: 200,
+ errorMsg: '获取商家信息失败',
+ onSuccess: (data) => {
+ // 更新全局缓存
+ app.globalData.shangjia = data;
+ wx.setStorageSync('shangjiastatus', 1);
+
+ const chenghaoList = data.chenghao_list || [];
+
+ this.setData({
+ nicheng: data.nicheng || '',
+ sjyue: data.sjyue || '0.00',
+ fabu: data.fadanzong || 0,
+ tuikuan: data.tuikuanzong || 0,
+ jinriliushui: data.riliushui || '0.00',
+ jinyueliushui: data.yueliushui || '0.00',
+ jinridingdan: data.jinripaidan || 0,
+ jinrituikuan: data.jinrituikuan || 0,
+ chenghaoList: chenghaoList,
+ isLoading: false,
+ });
+
+ if (this.data.isAutoRegistering) {
+ this.setData({ isAutoRegistering: false });
+ wx.showToast({ title: '商家注册成功', icon: 'success' });
+ }
+ },
+ });
+ },
+
+ refreshShangjiaInfo() {
+ this.throttledRefresh(() => this.getShangjiaInfo());
+ },
+
+ async loadPendingCount() {
+ try {
+ const res = await request({
+ url: '/dingdan/sjdingdanhq',
+ method: 'POST',
+ data: { zhuangtai_list: [8], page: 1, page_size: 1 },
+ });
+ if (res && res.data && (res.data.code === 0 || res.data.code === 200)) {
+ this.setData({ pendingCount: res.data.data.pending_count || 0 });
+ }
+ } catch (e) {
+ console.error('待结算数量失败', e);
+ }
+ },
+
+ async loadPunishPending() {
+ try {
+ const res = await request({
+ url: '/yonghu/sjcfjlhq',
+ method: 'POST',
+ data: { page: 1, page_size: 1, zhuangtai: 0 },
+ });
+ if (res && res.data && (res.data.code === 0 || res.data.code === 200)) {
+ const d = res.data.data || {};
+ this.setData({ punishPending: d.daichuli_count || d.pending_count || 0 });
+ }
+ } catch (e) {
+ /* 接口字段未定时静默 */
+ }
+ },
+
+ async onRegister() {
+ const { inviteCode } = this.data;
+ await this.registerWithInviteCode({
+ inviteCode,
+ apiUrl: '/yonghu/shangjiahuce',
+ role: 'shangjia',
+ statusKey: 'shangjiastatus',
+ successMsg: '商家注册成功',
+ onSuccess: (userData) => {
+ app.globalData.shangjia = userData;
+ const chenghaoList = userData.chenghao_list || [];
+ this.setData({
+ isShangjia: true,
+ nicheng: userData.nicheng || '',
+ sjyue: userData.sjyue || '0.00',
+ fabu: userData.fabu || 0,
+ tuikuan: userData.tuikuan || 0,
+ jinriliushui: userData.jinriliushui || '0.00',
+ jinyueliushui: userData.jinyueliushui || '0.00',
+ jinridingdan: userData.jinridingdan || 0,
+ chenghaoList: chenghaoList,
+ isAutoRegistering: false,
+ });
+ this.loadAvatar();
+ ensureRoleOnCenterPage(this, 'shangjia');
+ lockPrimaryRole('shangjia');
+ },
+ });
+ },
+
+ previewAvatar() {
+ if (this.data.avatarUrl) {
+ wx.previewImage({ urls: [this.data.avatarUrl] });
+ }
+ },
+
+ // 页面跳转
+ goToPaiDan() { wx.navigateTo({ url: '/pages/merchant-dispatch/merchant-dispatch' }); },
+ goToJiSuPaiDan() {
+ wx.vibrateShort({ type: 'medium' });
+ wx.navigateTo({ url: '/pages/express-order/express-order' });
+ },
+ goToMyOrders() { wx.redirectTo({ url: '/pages/merchant-orders/merchant-orders' }); },
+ goToPendingOrders() { wx.redirectTo({ url: '/pages/merchant-orders/merchant-orders' }); },
+ goToHome() { wx.redirectTo({ url: '/pages/merchant-home/merchant-home' }); },
+ goToKefuKey() { wx.navigateTo({ url: '/pages/merchant-kefu-key/merchant-kefu-key' }); },
+ goToKefuList() { wx.navigateTo({ url: '/pages/merchant-kefu-list/merchant-kefu-list' }); },
+ goToRecharge() { wx.navigateTo({ url: '/pages/merchant-recharge/merchant-recharge' }); },
+ goToWithdraw() { wx.navigateTo({ url: '/pages/withdraw/withdraw' }); },
+ goToRanking() { wx.navigateTo({ url: '/pages/fighter-rank/fighter-rank?type=shangjia' }); },
+ goToMessages() { wx.navigateTo({ url: '/pages/merchant-msg/merchant-msg' }); },
+}, {
+ roleConfig: {
+ role: 'shangjia',
+ statusKey: 'shangjiastatus',
+ dataFlag: 'isShangjia',
+ pageId: 'shangjiaduan',
+ apiUrl: '/yonghu/shangjiaxinxi',
+ },
+}));
diff --git a/pages/merchant/merchant.json b/pages/merchant/merchant.json
index 2e9bbe2..efe08a9 100644
--- a/pages/merchant/merchant.json
+++ b/pages/merchant/merchant.json
@@ -5,10 +5,8 @@
"tab-bar": "/tab-bar/index",
"chenghao-tag": "/components/chenghao-tag/chenghao-tag"
},
- "navigationBarTitleText": "商家中心",
- "navigationBarBackgroundColor": "#ffffff",
- "navigationBarTextStyle": "black",
- "backgroundColor": "#f8f9fc",
- "backgroundTextStyle": "light",
+ "navigationStyle": "custom",
+ "backgroundColor": "#fff8e1",
+ "backgroundTextStyle": "dark",
"enablePullDownRefresh": false
}
\ No newline at end of file
diff --git a/pages/merchant/merchant.wxml b/pages/merchant/merchant.wxml
index 33044ce..308544e 100644
--- a/pages/merchant/merchant.wxml
+++ b/pages/merchant/merchant.wxml
@@ -1,199 +1,166 @@
-
-
-
-
-
-
-
-
-
-
- 商家入驻
- 输入邀请码,解锁专属商家权益
-
-
-
-
- 已有邀请码?点击上方注册
-
-
- 返回点单端
-
-
-
- 清除缓存
- 重新登录
+
+
+
+
+
+
+ 商家入驻
+
+ 立即注册
+ 返回点单端
+ 清除缓存,重新登录
+
-
+
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
- {{nicheng || '商家'}}
-
- UID
- {{uid || '------'}}
-
+
+
+
+
+
+
+
+
+
+
+ {{nicheng || '商家'}}
+ 商家
+
+
+ ID: {{uid || '--'}}
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ 商家余额(元)
+ ¥{{sjyue}}
+ 发单总量 {{fabu}} · 退款 {{tuikuan}}
+
+
+ 充值
+ 去提现
+
+
+
+
+
+ {{jinriliushui}}
+ 今日流水
+
+
+ {{jinyueliushui}}
+ 今月流水
+
+
+ {{jinridingdan}}
+ 今日派单
+
+
+
+
+ 我的订单
+
+
+ {{pendingCount}}
+ 待结算
+
+
+ {{jinrituikuan}}
+ 今日退款
+
+
+ {{punishPending}}
+ 处罚待处理
+
+
+ ›
+ 全部订单
+
+
+
+
+
+ 交易与发单
+
+
+
+ 自定义单
+
+
+
+ 常规单
+
+
+
+ 客服邀请码
+
+
+
+ 客服列表
+
+
+
+ 处罚记录
+
+
+
+ 商家排行
+
+
+
+ 在线客服
+
+
+
+ 商家首页
+
+
+
+
+
+
+ 返回点单端
+ ›
+
+
+ 清除缓存
+ 重新登录
+
+
+
+
+
+
-
-
-
-
- 账户余额(元)
-
- {{sjyue}}
- ¥
-
-
-
-
- 充值
-
-
-
- 提现
-
-
-
-
-
-
- 发单总量
- {{fabu}}
-
-
- 退款总量
- {{tuikuan}}
-
-
- 今日流水
- {{jinriliushui}}
-
-
- 今月流水
- {{jinyueliushui}}
-
-
-
-
-
-
-
-
-
-
- {{jinridingdan}}
- 今日派单
-
-
-
-
-
- {{jinrituikuan}}
- 今日退款
-
-
-
-
-
-
-
-
-
- 发布订单
- 快速派单
-
-
-
-
-
- 极速派单
- 闪电体验
-
-
-
-
-
- 我的订单
- 管理派单
-
-
-
-
-
- 处罚记录
- 违规查询
-
-
-
-
-
- 商家排行
- 业绩排名
-
-
-
-
-
- 在线客服
- 帮助中心
-
-
-
-
-
-
-
- 返回点单端
-
-
-
- 清除缓存
- 重新登录
-
-
-
-
-
-
-
-
-
- 加载中...
-
+
-
-
-
-
\ No newline at end of file
+
+
diff --git a/pages/merchant/merchant.wxss b/pages/merchant/merchant.wxss
index bf20f32..cd8ffe8 100644
--- a/pages/merchant/merchant.wxss
+++ b/pages/merchant/merchant.wxss
@@ -1,425 +1,226 @@
-/* pages/shangjiazhongxin/shangjiazhongxin.wxss */
-
-page {
- background-color: #f5f7fb;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
- }
-
- /* .page-bg 与全局类似,仅保留差异 */
- .page-bg {
- opacity: 0.15;
- filter: blur(8rpx);
- }
-
- /* .page-container 与全局类似,仅保留差异 */
- .page-container {
- z-index: 1;
- padding: 0 32rpx;
- box-sizing: border-box;
- background-color: transparent;
- }
-
- /* 未注册卡片 */
- .unregistered {
- display: flex;
- align-items: center;
- justify-content: center;
- padding-top: 200rpx;
- }
- /* .unreg-card 与 .card 类似,仅保留差异 */
- .unreg-card {
- width: 90%;
- border-radius: 48rpx;
- box-shadow: 0 8rpx 20rpx rgba(0,0,0,0.2);
- background-color: transparent;
- }
- .unreg-content {
- padding: 60rpx 40rpx;
- text-align: center;
- background: rgba(0,0,0,0.65);
- backdrop-filter: blur(16rpx);
- border-radius: 48rpx;
- }
- .status-title {
- font-size: 44rpx;
- font-weight: 700;
- color: #fff;
- margin-bottom: 16rpx;
- }
- .status-desc {
- font-size: 28rpx;
- color: #ddd;
- margin-bottom: 50rpx;
- }
- .input-group {
- margin-bottom: 40rpx;
- }
- /* .invite-input 与 .input-rounded--dark 类似,仅保留差异 */
- .invite-input {
- height: 96rpx;
- background: rgba(255,255,255,0.2);
- border-radius: 48rpx;
- font-size: 30rpx;
- }
- /* .register-btn 与 .btn .btn-primary .btn-primary--orange 完全相同,删除 */
-
- .register-tip {
- margin-top: 32rpx;
- font-size: 24rpx;
- color: #ddd;
- }
-
- /* 已注册页面 */
- .registered {
- padding-top: 30rpx;
- padding-bottom: 40rpx;
- }
-
- /* .refresh-btn 与全局 .refresh-btn .refresh-btn--dark 类似,仅保留差异 */
- .refresh-btn {
- position: absolute;
- top: 30rpx;
- width: 72rpx;
- height: 72rpx;
- border-radius: 36rpx;
- }
- .refresh-icon {
- width: 40rpx;
- height: 40rpx;
- filter: brightness(0) invert(1);
- }
-
- /* 头像卡片 */
- .avatar-card {
- border-radius: 60rpx;
- overflow: hidden;
- margin-bottom: 36rpx;
- box-shadow: 0 6rpx 18rpx rgba(0,0,0,0.2);
- background-color: transparent;
- }
- .avatar-content {
- display: flex;
- align-items: center;
- padding: 28rpx 32rpx;
- background: rgba(0,0,0,0.55);
- backdrop-filter: blur(20rpx);
- }
- .avatar-wrapper {
- position: relative;
- width: 110rpx;
- height: 110rpx;
- margin-right: 28rpx;
- }
- /* .avatar-img 与 .avatar-circle 类似,仅保留差异 */
- .avatar-img {
- width: 100%;
- height: 100%;
- border: 2rpx solid rgba(255,255,255,0.3);
- }
- .avatar-frame {
- position: absolute;
- top: -8rpx;
- left: -8rpx;
- width: 126rpx;
- height: 126rpx;
- pointer-events: none;
- }
- .user-info {
- flex: 1;
- }
- .nicheng {
- font-size: 40rpx;
- font-weight: 700;
- color: #fff;
- margin-bottom: 16rpx;
- text-shadow: 0 2rpx 6rpx rgba(0,0,0,0.5);
- background: rgba(0,0,0,0.6);
- display: inline-block;
- padding: 6rpx 20rpx;
- border-radius: 40rpx;
- }
- .uid-area {
- display: flex;
- align-items: center;
- }
- .uid-label {
- font-size: 26rpx;
- color: #fff;
- background: rgba(0,0,0,0.7);
- padding: 6rpx 16rpx;
- border-radius: 28rpx;
- margin-right: 16rpx;
- backdrop-filter: blur(4rpx);
- }
- .uid-value {
- font-size: 28rpx;
- color: #fff;
- font-family: monospace;
- background: rgba(0,0,0,0.6);
- padding: 6rpx 16rpx;
- border-radius: 28rpx;
- }
- .copy-icon {
- width: 40rpx;
- height: 40rpx;
- margin-left: 20rpx;
- opacity: 0.9;
- filter: drop-shadow(0 2rpx 2rpx rgba(0,0,0,0.5));
- }
-
- /* 荣誉标签 */
- .badge-area {
- margin-bottom: 36rpx;
- }
- .badge-scroll {
- white-space: nowrap;
- }
- .badge-row {
- display: inline-flex;
- gap: 16rpx;
- padding: 8rpx 0;
- }
-
- /* 资产卡片 */
- .asset-card {
- border-radius: 48rpx;
- overflow: hidden;
- margin-bottom: 36rpx;
- box-shadow: 0 10rpx 24rpx rgba(0,0,0,0.2);
- background-color: transparent;
- }
- .glass-effect {
- padding: 44rpx 36rpx;
- background: rgba(0,0,0,0.55);
- backdrop-filter: blur(20rpx);
- }
- .balance-area {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- flex-wrap: wrap;
- margin-bottom: 32rpx;
- }
- .balance-label {
- font-size: 28rpx;
- color: #ffdebc;
- font-weight: 500;
- }
- .balance-value {
- display: flex;
- align-items: baseline;
- }
- .value-num {
- font-size: 64rpx;
- font-weight: 800;
- color: #ffd966;
- font-family: 'DIN', monospace;
- }
- .value-unit {
- font-size: 32rpx;
- color: #ffdebc;
- margin-left: 6rpx;
- }
- .action-buttons {
- display: flex;
- gap: 24rpx;
- }
- .action-btn {
- display: flex;
- align-items: center;
- gap: 10rpx;
- background: rgba(255,255,255,0.9);
- padding: 12rpx 28rpx;
- border-radius: 60rpx;
- font-size: 26rpx;
- font-weight: 500;
- }
- .action-btn.recharge {
- color: #ff8c1a;
- }
- .action-btn.withdraw {
- color: #2d3e6e;
- }
- .btn-icon {
- width: 32rpx;
- height: 32rpx;
- }
- /* .divider 与全局 .divider-gradient 类似,仅保留差异 */
- .divider {
- background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
- margin: 24rpx 0;
- }
- .stats-row {
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
- }
- .stat-item {
- flex: 1;
- text-align: center;
- }
- .stat-label {
- font-size: 24rpx;
- color: #ddd;
- margin-bottom: 12rpx;
- display: block;
- }
- .stat-number {
- font-size: 34rpx;
- font-weight: 700;
- color: #fff;
- }
-
- /* 核心指标卡片组 */
- .metrics-section {
- display: flex;
- gap: 24rpx;
- margin-bottom: 40rpx;
- }
- .metric-card {
- flex: 1;
- border-radius: 36rpx;
- overflow: hidden;
- box-shadow: 0 6rpx 16rpx rgba(0,0,0,0.2);
- background-color: transparent;
- }
- .metric-content {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 24rpx 0;
- background: rgba(0,0,0,0.55);
- backdrop-filter: blur(12rpx);
- }
- .metric-icon {
- width: 48rpx;
- height: 48rpx;
- margin-bottom: 16rpx;
- filter: brightness(0) invert(1);
- }
- .metric-value {
- font-size: 44rpx;
- font-weight: 800;
- color: #ffd966;
- margin-bottom: 8rpx;
- }
- .metric-label {
- font-size: 24rpx;
- color: #eee;
- }
-
- /* 功能宫格 */
- .function-grid {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- gap: 24rpx;
- margin-top: 12rpx;
- }
- .func-item {
- border-radius: 32rpx;
- overflow: hidden;
- box-shadow: 0 6rpx 14rpx rgba(0,0,0,0.2);
- background-color: transparent;
- }
- .func-content {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 32rpx 12rpx 28rpx;
- background: rgba(0,0,0,0.55);
- backdrop-filter: blur(12rpx);
- transition: all 0.2s ease;
- }
- .func-icon {
- width: 64rpx;
- height: 64rpx;
- margin-bottom: 20rpx;
- filter: brightness(0) invert(1);
- }
- .func-name {
- font-size: 28rpx;
- font-weight: 600;
- color: #fff;
- margin-bottom: 8rpx;
- }
- .func-desc {
- font-size: 22rpx;
- color: #ddd;
- }
-
- /* 底部安全区 */
- .safe-bottom {
- height: 40rpx;
- }
-
- /* .sys-list 无全局对应,保留 */
- .sys-list {
- margin: 24rpx 32rpx 0;
- background: rgba(255, 255, 255, 0.92);
- border-radius: 20rpx;
- overflow: hidden;
- border: 1rpx solid rgba(0, 0, 0, 0.06);
- box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08);
- }
-
- /* .sys-item 与 .list-item 类似,仅保留差异(无 border-bottom) */
- .sys-item {
- padding: 24rpx 28rpx;
- }
-
- .sys-item-unreg {
- margin-top: 28rpx;
- padding-top: 24rpx;
- border-top: 1rpx solid rgba(0, 0, 0, 0.08);
- justify-content: center;
- background: rgba(255, 255, 255, 0.55);
- border-radius: 16rpx;
- }
-
- /* .sys-icon 与 .list-icon 类似,仅保留差异 */
- .sys-icon {
- width: 32rpx;
- height: 32rpx;
- margin-right: 14rpx;
- }
-
- /* .sys-text 与 .list-text 类似,仅保留差异 */
- .sys-text {
- font-size: 28rpx;
- color: #1A1A1A;
- font-weight: 600;
- }
-
- /* .sys-sub 无全局对应,保留 */
- .sys-sub {
- flex: 1;
- text-align: right;
- font-size: 22rpx;
- color: #888;
- margin-left: 12rpx;
- }
-
- /* .loading-mask 与全局 .loading-mask .loading-mask--dark 类似,仅保留差异 */
- .loading-mask {
- backdrop-filter: blur(10px);
- }
- .loading-content {
- background: rgba(0,0,0,0.8);
- padding: 48rpx 64rpx;
- border-radius: 32rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- /* .loading-spinner 与 .spinner--md 类似,仅保留差异 */
- .loading-spinner {
- width: 72rpx;
- height: 72rpx;
- border: 6rpx solid rgba(255,255,255,0.3);
- border-top-color: #ffd966;
- margin-bottom: 24rpx;
- }
- /* .loading-text 与全局 .loading-text 类似,仅保留差异 */
- .loading-text {
- font-size: 28rpx;
- }
+@import '../../styles/shangjia-xym-common.wxss';
+
+page {
+ background: #fff8e1;
+}
+
+.user-page {
+ height: 100vh;
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+}
+
+.nav-bar {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.content {
+ flex: 1;
+ height: 0;
+}
+
+.refresh-float {
+ position: fixed;
+ right: 24rpx;
+ top: calc(env(safe-area-inset-top) + 100rpx);
+ z-index: 10;
+ width: 56rpx;
+ height: 56rpx;
+ background: rgba(255, 255, 255, 0.85);
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
+}
+
+.refresh-float-ico {
+ width: 32rpx;
+ height: 32rpx;
+}
+
+.user-info {
+ padding: 10rpx 30rpx;
+}
+
+.avatar {
+ width: 110rpx;
+ height: 110rpx;
+ border-radius: 50%;
+ border: 4rpx solid #f1f7ff;
+ margin-right: 20rpx;
+ background: #eee;
+}
+
+.nickname {
+ font-size: 38rpx;
+ font-weight: 700;
+ color: #222;
+}
+
+.nickname-row {
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 8rpx;
+}
+
+.sn-row {
+ margin-top: 8rpx;
+ align-items: center;
+}
+
+.sn {
+ color: #999;
+ font-size: 24rpx;
+}
+
+.copy-ico {
+ width: 24rpx;
+ height: 24rpx;
+ margin-left: 8rpx;
+ opacity: 0.6;
+}
+
+.badge-zone {
+ padding: 0 24rpx 8rpx;
+}
+
+.badge-scroll {
+ white-space: nowrap;
+ width: 100%;
+}
+
+.badge-tag-wrap {
+ display: inline-block;
+ transform: scale(0.72);
+ transform-origin: left center;
+ margin-right: -8rpx;
+}
+
+.wallet-btns .sj-btn-outline {
+ margin-left: 12rpx;
+}
+
+.freeze-row {
+ margin: 16rpx 30rpx 0;
+ padding: 20rpx 10rpx;
+ border-radius: 15rpx;
+ background: #fef6d4;
+}
+
+.freeze-col {
+ flex: 1;
+}
+
+.freeze-num {
+ font-size: 32rpx;
+ font-weight: 700;
+ color: #7e893c;
+}
+
+.freeze-lbl {
+ font-size: 24rpx;
+ color: #7e893c;
+ font-weight: 700;
+ margin-top: 4rpx;
+}
+
+.order-nav-box {
+ margin-top: 16rpx;
+}
+
+.unreg-area {
+ flex: 1;
+ padding: 40rpx 0 16rpx;
+}
+
+.unreg-card {
+ padding: 40rpx 30rpx;
+}
+
+.unreg-title {
+ display: block;
+ font-size: 32rpx;
+ font-weight: 700;
+ text-align: center;
+ margin-bottom: 24rpx;
+}
+
+.unreg-input {
+ height: 80rpx;
+ border-radius: 12rpx;
+ margin-bottom: 20rpx;
+ background: #f7f7f7;
+ padding: 0 24rpx;
+ font-size: 28rpx;
+ border: 1rpx solid #eee;
+}
+
+.unreg-btn {
+ height: 80rpx;
+ font-size: 28rpx;
+ margin-bottom: 16rpx;
+}
+
+.unreg-link {
+ text-align: center;
+ padding: 16rpx;
+ font-size: 24rpx;
+ color: #999;
+}
+
+.sys-panel {
+ margin-top: 16rpx;
+ margin-bottom: 16rpx;
+ padding: 0 8rpx;
+}
+
+.sys-item {
+ padding: 24rpx 20rpx;
+ border-bottom: 1rpx solid rgba(0, 0, 0, 0.04);
+}
+
+.sys-item:last-child {
+ border-bottom: none;
+}
+
+.sys-text {
+ font-size: 28rpx;
+ color: #333;
+}
+
+.sys-sub {
+ font-size: 22rpx;
+ color: #999;
+}
+
+.sys-arrow {
+ color: #ccc;
+ font-size: 32rpx;
+}
+
+.loading-mask {
+ position: fixed;
+ inset: 0;
+ background: rgba(255, 255, 255, 0.6);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 999;
+}
+
+.loading-spinner {
+ width: 60rpx;
+ height: 60rpx;
+ border: 4rpx solid rgba(0, 0, 0, 0.08);
+ border-top-color: #ffd061;
+ border-radius: 50%;
+ animation: sjSpin 0.8s linear infinite;
+}
+
+@keyframes sjSpin {
+ to { transform: rotate(360deg); }
+}
diff --git a/pages/mine/mine.wxss b/pages/mine/mine.wxss
index 3c9db8d..f7f99a6 100644
--- a/pages/mine/mine.wxss
+++ b/pages/mine/mine.wxss
@@ -1,7 +1,7 @@
/* 我的页面 */
page {
- background: #F7F3ED;
+ background: #f5f5f5;
height: 100vh;
overflow: hidden;
}
@@ -18,8 +18,7 @@ page {
position: fixed;
top: 0; left: 0;
width: 100vw; height: 100vh;
- background: radial-gradient(ellipse at 30% 20%, rgba(201,169,98,0.08) 0%, transparent 60%),
- radial-gradient(ellipse at 80% 70%, rgba(201,169,98,0.05) 0%, transparent 50%);
+ background: linear-gradient(180deg, #fef6d4 0%, #f5f5f5 40%, #f5f5f5 100%);
z-index: 0;
pointer-events: none;
}
@@ -49,7 +48,7 @@ page {
height: 48rpx;
}
.icon-bg {
- background: rgba(201,169,98,0.08);
+ background: #fef6d4;
border-radius: 22rpx;
display: flex;
align-items: center;
@@ -125,7 +124,7 @@ page {
line-height: 1.2;
}
.gradient-bg {
- background: linear-gradient(to right, rgba(201,169,98,0.01), rgba(201,169,98,0.10));
+ background: linear-gradient(to right, rgba(255, 208, 97, 0.05), rgba(255, 208, 97, 0.15));
}
.title-text {
font-size: 34rpx;
@@ -134,15 +133,15 @@ page {
letter-spacing: 1rpx;
}
-/* 毛玻璃容器 */
+/* 卡片容器 */
.frosted-box {
- background: rgba(255, 255, 255, 0.52);
- backdrop-filter: blur(20px);
- -webkit-backdrop-filter: blur(20px);
- border-radius: 28rpx;
+ background: #fdfcfa;
+ backdrop-filter: none;
+ -webkit-backdrop-filter: none;
+ border-radius: 20rpx;
padding: 36rpx 20rpx;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04), inset 0 1rpx 0 rgba(255,255,255,0.8);
- border: 1rpx solid rgba(255,255,255,0.5);
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
+ border: none;
}
/* 订单行 */
diff --git a/pages/order-pool/order-pool.js b/pages/order-pool/order-pool.js
index 058450b..8c6206a 100644
--- a/pages/order-pool/order-pool.js
+++ b/pages/order-pool/order-pool.js
@@ -1,458 +1,473 @@
-// pages/order-pool/order-pool.js
-const app = getApp();
-import request from '../../utils/request.js';
-import PopupService from '../../services/popupService.js';
-
-Page({
- data: {
- // 1. 商品类型相关
- shangpinleixing: [],
- xuanzhongLeixingId: null,
-
- // 2. 订单列表与分页相关
- dingdanList: [],
- page: 1,
- pageSize: 10,
- hasMore: true,
- isLoading: false,
-
- // 3. 全局状态字段
- dashoustatus: null,
- zhuanghaoStatus: null,
- dashouzhuangtai: null,
- uid: null,
- huiyuanList: [],
- yajin: 0,
- jifen: 0,
-
- // 4. 刷新控制字段
- scrollViewRefreshing: false,
- lastRefreshTime: 0,
- refreshCooldown: 2000,
- isLoadingMore: false,
-
- // 5. 切换类型冷却时间控制
- lastSwitchTime: 0,
- switchCooldown: 1500,
- isSwitching: false,
-
- // 6. 全局OSS地址
- ossImageUrl: app.globalData.ossImageUrl || '',
-
- // 7. 授权状态控制
- showUnauthorized: false,
- unauthorizedMsg: '您尚未开启此功能',
- },
-
- async onLoad(options) {
- this.loadGlobalStatus();
- this.checkAuthorization();
- },
- // 页面隐藏时清理弹窗视图
- onHide: function () {
- const popupComp = this.selectComponent('#popupNotice');
- if (popupComp && popupComp.cleanup) {
- popupComp.cleanup();
- }
-},
-
- onShow() {
- this.registerNotificationComponent();
- this.loadGlobalStatus();
- this.checkAuthorization();
- },
-
- registerNotificationComponent() {
- const notificationComp = this.selectComponent('#global-notification');
- if (notificationComp && notificationComp.showNotification) {
- app.globalData.globalNotification = {
- show: (data) => notificationComp.showNotification(data),
- hide: () => notificationComp.hideNotification()
- };
- }
- },
-
- loadGlobalStatus() {
- const globalData = app.globalData;
- const dashoustatusCache = wx.getStorageSync('dashoustatus');
- const dashoustatus = dashoustatusCache !== '' ? dashoustatusCache : null;
-
- let zhuanghaoStatus = globalData.zhanghaoStatus;
- if (zhuanghaoStatus === undefined || zhuanghaoStatus === null) {
- zhuanghaoStatus = wx.getStorageSync('zhanghaoStatus');
- }
-
- this.setData({
- dashoustatus: dashoustatus,
- zhuanghaoStatus: zhuanghaoStatus,
- dashouzhuangtai: globalData.dashouzhuangtai,
- uid: wx.getStorageSync('uid'),
- huiyuanList: globalData.clumber || [],
- yajin: globalData.yajin || 0,
- jifen: globalData.jinfen || 0
- });
- },
-
- checkAuthorization() {
- const { dashoustatus, zhuanghaoStatus } = this.data;
-
- const isDashouValid = (dashoustatus && dashoustatus == 1) || false;
- const isZhuanghaoValid = (zhuanghaoStatus == 1);
-
- const isAuthorized = isDashouValid && isZhuanghaoValid;
-
- if (!isAuthorized) {
- this.setData({ showUnauthorized: true });
- let msg = '';
- if (!isDashouValid) msg = '您尚未开启身份';
- this.setData({ unauthorizedMsg: msg || '无法使用抢单功能' });
- } else {
- this.setData({ showUnauthorized: false });
- if (!this.data.shangpinleixing.length) {
- this.loadShangpinLeixing();
- } else if (this.data.xuanzhongLeixingId) {
- this.loadDingdanList(true);
- }
- PopupService.checkAndShow(this, 'jiedanchi');
- }
- },
-
- async loadShangpinLeixing() {
- wx.showLoading({ title: '加载商品类型...' });
- try {
- const res = await request({
- url: '/dingdan/dsqdhqddlx',
- method: 'POST',
- header: { 'content-type': 'application/json' }
- });
-
- if (res.statusCode === 200 && res.data) {
- const data = res.data;
- let list = [];
- if (data.code === 200 || data.code === 0) {
- if (data.data && Array.isArray(data.data.list)) {
- list = data.data.list;
- } else if (data.data && Array.isArray(data.data)) {
- list = data.data;
- } else if (Array.isArray(data.list)) {
- list = data.list;
- } else if (Array.isArray(data)) {
- list = data;
- }
- }
- const processedList = this.processTupianUrl(list);
- this.setData({
- shangpinleixing: processedList,
- xuanzhongLeixingId: processedList[0]?.id || null
- });
- if (this.data.xuanzhongLeixingId) {
- this.loadDingdanList(true);
- }
- } else {
- wx.showToast({ title: res.data?.msg || '加载商品类型失败', icon: 'none', duration: 2000 });
- }
- } catch (error) {
- console.error('加载商品类型失败:', error);
- wx.showToast({ title: '网络错误,加载失败', icon: 'none', duration: 2000 });
- } finally {
- wx.hideLoading();
- }
- },
-
- processTupianUrl(list) {
- const ossUrl = app.globalData.ossImageUrl || '';
- return list.map(item => ({
- ...item,
- full_tupian_url: item.tupian_url && !item.tupian_url.startsWith('http') ? ossUrl + item.tupian_url : (item.tupian_url || '/images/default-type.png')
- }));
- },
-
- async selectLeixing(e) {
- const now = Date.now();
- if (now - this.data.lastSwitchTime < this.data.switchCooldown) {
- wx.showToast({
- title: `操作太快,请${Math.ceil((this.data.switchCooldown - (now - this.data.lastSwitchTime)) / 1000)}秒后再试`,
- icon: 'none',
- duration: 1500
- });
- return;
- }
- if (this.data.isSwitching) return;
- const leixingId = e.currentTarget.dataset.id;
- if (leixingId === this.data.xuanzhongLeixingId) return;
- this.setData({ isSwitching: true, lastSwitchTime: now });
- wx.showLoading({ title: '切换中...' });
- try {
- this.setData({
- xuanzhongLeixingId: leixingId,
- dingdanList: [],
- page: 1,
- hasMore: true
- });
- await this.loadDingdanList(true);
- } catch (error) {
- console.error('切换类型失败:', error);
- } finally {
- this.setData({ isSwitching: false });
- wx.hideLoading();
- }
- },
-
- async loadDingdanList(isRefresh = false) {
- if (this.data.isLoading || !this.data.xuanzhongLeixingId) return;
-
- const loadPage = isRefresh ? 1 : this.data.page;
- if (!isRefresh && !this.data.hasMore) return;
-
- this.setData({
- isLoading: true,
- isLoadingMore: !isRefresh
- });
-
- try {
- const res = await request({
- url: '/dingdan/ddhq',
- method: 'POST',
- data: {
- leixing_id: this.data.xuanzhongLeixingId,
- page: loadPage,
- page_size: this.data.pageSize
- }
- });
-
- this.setData({
- isLoading: false,
- isLoadingMore: false,
- scrollViewRefreshing: false
- });
-
- if (res.data.code === 200 || res.data.code === 0) {
- const newList = res.data.data.list || [];
- const hasMore = res.data.data.has_more || false;
-
- const processedList = newList.map(item => this.processDingdanItem(item));
-
- const updatedList = isRefresh ? processedList : [...this.data.dingdanList, ...processedList];
-
- updatedList.sort((a, b) => (b.creat_time || '').localeCompare(a.creat_time || ''));
-
- this.setData({
- dingdanList: updatedList,
- page: loadPage,
- hasMore: hasMore
- });
-
- if (isRefresh) {
- this.setData({ lastRefreshTime: Date.now() });
- }
- } else {
- wx.showToast({ title: res.data.msg || '加载失败', icon: 'none' });
- }
- } catch (error) {
- console.error('加载订单失败:', error);
- this.setData({
- isLoading: false,
- isLoadingMore: false,
- scrollViewRefreshing: false
- });
- wx.showToast({ title: '网络请求失败', icon: 'none' });
- }
- },
-
- processDingdanItem(item) {
- const ossUrl = app.globalData.ossImageUrl || '';
- let fullTupianUrl = '';
- if (item.tupian) {
- fullTupianUrl = !item.tupian.startsWith('http') ? ossUrl + item.tupian : item.tupian;
- } else {
- const leixing = this.data.shangpinleixing.find(l => l.id === item.leixing_id);
- fullTupianUrl = leixing ? leixing.full_tupian_url : '/images/default-order.png';
- }
-
- const isZhiding = item.zhuangtai === 7;
-
- let zhidingAvatar = '';
- if (item.zhiding_avatar) {
- zhidingAvatar = !item.zhiding_avatar.startsWith('http') ? ossUrl + item.zhiding_avatar : item.zhiding_avatar;
- }
- const zhidingNicheng = item.zhiding_nicheng || '';
-
- return {
- ...item,
- full_tupian_url: fullTupianUrl,
- isZhiding: isZhiding,
- isPingtai: item.pingtai == 1,
- isShangjia: item.pingtai == 2,
- zhiding_avatar_full: zhidingAvatar,
- zhiding_nicheng: zhidingNicheng
- };
- },
-
- goToChongzhiPage(failureType, huiyuanId = null, requiredYajin = 0) {
- let url = '/pages/fighter-recharge/fighter-recharge';
- let params = {};
- switch (failureType) {
- case 'huiyuan':
- params = { needScroll: '0', scrollTo: 'member' };
- break;
- case 'yajin':
- params = { needScroll: '1', scrollTo: 'bottom', requiredYajin: requiredYajin };
- break;
- case 'jifen':
- params = { needScroll: '1', scrollTo: 'bottom' };
- break;
- }
- if (huiyuanId) params.huiyuanId = huiyuanId;
- const queryString = Object.keys(params).map(key => `${key}=${encodeURIComponent(params[key])}`).join('&');
- const fullUrl = `${url}?${queryString}`;
- wx.navigateTo({
- url: fullUrl,
- fail: (err) => {
- console.error('跳转失败:', err);
- wx.showToast({ title: '跳转失败,请稍后重试', icon: 'none' });
- }
- });
- },
-
- async onQiangdanTap(e) {
- const dingdanItem = e.currentTarget.dataset.item;
- if (!dingdanItem) return;
-
- if (!this.data.dashoustatus || this.data.dashoustatus != 1) {
- wx.showToast({ title: '请先开启接单员身份', icon: 'none' });
- return;
- }
- if (this.data.zhuanghaoStatus != 1) {
- wx.showToast({ title: '账号异常,无法接单', icon: 'none' });
- return;
- }
- if (this.data.dashouzhuangtai != 1) {
- wx.showToast({ title: '您有订单正在接待中', icon: 'none' });
- return;
- }
- if (dingdanItem.isZhiding) {
- if (!this.data.uid || this.data.uid != dingdanItem.zhiding_uid) {
- wx.showToast({ title: '此订单为指定单', icon: 'none' });
- return;
- }
- }
- if (dingdanItem.yaoqiuleixing == 1) {
- const hasHuiyuan = this.data.huiyuanList.some(h => h.huiyuanid == dingdanItem.huiyuan_id);
- if (!hasHuiyuan) {
- wx.showToast({ title: '未开通对应会员,无法抢单', icon: 'none', duration: 2000 });
- setTimeout(() => this.goToChongzhiPage('huiyuan', dingdanItem.huiyuan_id), 500);
- return;
- }
- }
- if (dingdanItem.yaoqiuleixing == 2) {
- if (this.data.yajin < dingdanItem.yajin) {
- wx.showToast({ title: `押金不足,需${dingdanItem.yajin}`, icon: 'none', duration: 2000 });
- setTimeout(() => this.goToChongzhiPage('yajin', null, dingdanItem.yajin), 500);
- return;
- }
- }
- if (this.data.jifen < 5) {
- wx.showToast({ title: '积分不足,至少需要5积分', icon: 'none', duration: 2000 });
- setTimeout(() => this.goToChongzhiPage('jifen'), 500);
- return;
- }
-
- const that = this;
- wx.showModal({
- title: '确认抢单',
- content: `确定要抢此订单吗?${dingdanItem.isZhiding ? '(指定订单)' : ''}`,
- success: async function (res) {
- if (res.confirm) {
- wx.showLoading({ title: '抢单中...', mask: true });
- try {
- const qiangdanRes = await request({
- url: '/dingdan/qiangdan',
- method: 'POST',
- data: { dingdan_id: dingdanItem.dingdan_id }
- });
- wx.hideLoading();
- if (qiangdanRes.data.code === 200 || qiangdanRes.data.code === 0) {
- that.showQiangdanSuccessEffect();
- if (app.globalData) {
- app.globalData.dashouzhuangtai = 0;
- that.setData({ dashouzhuangtai: 0 });
- }
- const newList = that.data.dingdanList.filter(item => item.dingdan_id !== dingdanItem.dingdan_id);
- that.setData({ dingdanList: newList });
- } else {
- wx.showToast({ title: qiangdanRes.data.msg || '抢单失败', icon: 'none' });
- }
- } catch (error) {
- wx.hideLoading();
- console.error('抢单请求失败:', error);
- wx.showToast({ title: '网络错误,抢单失败', icon: 'none' });
- }
- }
- }
- });
- },
-
- showQiangdanSuccessEffect() {
- wx.showToast({ title: '抢单成功!', icon: 'success', duration: 2000 });
- },
-
- onViewDetail(e) {
- const { type, content } = e.currentTarget.dataset;
- wx.showModal({
- title: type === 'jieshao' ? '订单介绍' : '订单备注',
- content: content,
- showCancel: false,
- confirmText: '知道了'
- });
- },
-
- onReachBottom() {
- const now = Date.now();
- if (now - this.data.lastRefreshTime < this.data.refreshCooldown) {
- wx.showToast({
- title: `操作太快,请${Math.ceil((this.data.refreshCooldown - (now - this.data.lastRefreshTime)) / 1000)}秒后再试`,
- icon: 'none',
- duration: 1500
- });
- return;
- }
- if (this.data.isLoading || this.data.isLoadingMore) return;
- if (this.data.hasMore && !this.data.isLoading && this.data.xuanzhongLeixingId) {
- this.setData({ page: this.data.page + 1 });
- this.loadDingdanList(false);
- }
- },
-
- onPullDownRefresh() {
- const now = Date.now();
- if (now - this.data.lastRefreshTime < this.data.refreshCooldown) {
- this.setData({ scrollViewRefreshing: false });
- wx.showToast({
- title: `操作太快,请${Math.ceil((this.data.refreshCooldown - (now - this.data.lastRefreshTime)) / 1000)}秒后再试`,
- icon: 'none',
- duration: 1500
- });
- return;
- }
- if (this.data.isLoading) {
- this.setData({ scrollViewRefreshing: false });
- return;
- }
- this.setData({
- scrollViewRefreshing: true,
- lastRefreshTime: now
- });
- if (this.data.xuanzhongLeixingId) {
- this.setData({ page: 1, hasMore: true });
- this.loadDingdanList(true);
- } else {
- this.setData({ scrollViewRefreshing: false });
- }
- },
-
- goToDashouRegister() {
- wx.navigateTo({
- url: '/pages/fighter/fighter'
- });
- }
+// pages/order-pool/order-pool.js
+const app = getApp();
+import request from '../../utils/request.js';
+import PopupService from '../../services/popupService.js';
+
+Page({
+ data: {
+ // 1. 商品类型相关
+ shangpinleixing: [],
+ xuanzhongLeixingId: null,
+
+ // 2. 订单列表与分页相关
+ dingdanList: [],
+ page: 1,
+ pageSize: 10,
+ hasMore: true,
+ isLoading: false,
+
+ // 3. 全局状态字段
+ dashoustatus: null,
+ zhuanghaoStatus: null,
+ dashouzhuangtai: null,
+ uid: null,
+ huiyuanList: [],
+ yajin: 0,
+ jifen: 0,
+
+ // 4. 刷新控制字段
+ scrollViewRefreshing: false,
+ lastRefreshTime: 0,
+ refreshCooldown: 2000,
+ isLoadingMore: false,
+
+ // 5. 切换类型冷却时间控制
+ lastSwitchTime: 0,
+ switchCooldown: 1500,
+ isSwitching: false,
+
+ // 6. 全局OSS地址
+ ossImageUrl: app.globalData.ossImageUrl || '',
+
+ // 7. 授权状态控制
+ showUnauthorized: false,
+ unauthorizedMsg: '您尚未开启此功能',
+
+ // 商品轮播展示(只读 globalData,无额外接口)
+ lunboList: [],
+ },
+
+ async onLoad(options) {
+ this.syncShopBannerFromGlobal();
+ this.loadGlobalStatus();
+ this.checkAuthorization();
+ },
+ // 页面隐藏时清理弹窗视图
+ onHide: function () {
+ const popupComp = this.selectComponent('#popupNotice');
+ if (popupComp && popupComp.cleanup) {
+ popupComp.cleanup();
+ }
+},
+
+ onShow() {
+ this.syncShopBannerFromGlobal();
+ this.registerNotificationComponent();
+ this.loadGlobalStatus();
+ this.checkAuthorization();
+ },
+
+ registerNotificationComponent() {
+ const notificationComp = this.selectComponent('#global-notification');
+ if (notificationComp && notificationComp.showNotification) {
+ app.globalData.globalNotification = {
+ show: (data) => notificationComp.showNotification(data),
+ hide: () => notificationComp.hideNotification()
+ };
+ }
+ },
+
+ /** 同步点单端已加载的商品轮播图,仅展示用 */
+ syncShopBannerFromGlobal() {
+ const oss = app.globalData.ossImageUrl || '';
+ const lunboList = (app.globalData.shangpinlunbo || []).map((url) => {
+ if (!url) return '';
+ return url.startsWith('http') ? url : oss + url;
+ }).filter(Boolean);
+ this.setData({ lunboList });
+ },
+
+ loadGlobalStatus() {
+ const globalData = app.globalData;
+ const dashoustatusCache = wx.getStorageSync('dashoustatus');
+ const dashoustatus = dashoustatusCache !== '' ? dashoustatusCache : null;
+
+ let zhuanghaoStatus = globalData.zhanghaoStatus;
+ if (zhuanghaoStatus === undefined || zhuanghaoStatus === null) {
+ zhuanghaoStatus = wx.getStorageSync('zhanghaoStatus');
+ }
+
+ this.setData({
+ dashoustatus: dashoustatus,
+ zhuanghaoStatus: zhuanghaoStatus,
+ dashouzhuangtai: globalData.dashouzhuangtai,
+ uid: wx.getStorageSync('uid'),
+ huiyuanList: globalData.clumber || [],
+ yajin: globalData.yajin || 0,
+ jifen: globalData.jinfen || 0
+ });
+ },
+
+ checkAuthorization() {
+ const { dashoustatus, zhuanghaoStatus } = this.data;
+
+ const isDashouValid = (dashoustatus && dashoustatus == 1) || false;
+ const isZhuanghaoValid = (zhuanghaoStatus == 1);
+
+ const isAuthorized = isDashouValid && isZhuanghaoValid;
+
+ if (!isAuthorized) {
+ this.setData({ showUnauthorized: true });
+ let msg = '';
+ if (!isDashouValid) msg = '您尚未开启身份';
+ this.setData({ unauthorizedMsg: msg || '无法使用抢单功能' });
+ } else {
+ this.setData({ showUnauthorized: false });
+ if (!this.data.shangpinleixing.length) {
+ this.loadShangpinLeixing();
+ } else if (this.data.xuanzhongLeixingId) {
+ this.loadDingdanList(true);
+ }
+ PopupService.checkAndShow(this, 'jiedanchi');
+ }
+ },
+
+ async loadShangpinLeixing() {
+ wx.showLoading({ title: '加载商品类型...' });
+ try {
+ const res = await request({
+ url: '/dingdan/dsqdhqddlx',
+ method: 'POST',
+ header: { 'content-type': 'application/json' }
+ });
+
+ if (res.statusCode === 200 && res.data) {
+ const data = res.data;
+ let list = [];
+ if (data.code === 200 || data.code === 0) {
+ if (data.data && Array.isArray(data.data.list)) {
+ list = data.data.list;
+ } else if (data.data && Array.isArray(data.data)) {
+ list = data.data;
+ } else if (Array.isArray(data.list)) {
+ list = data.list;
+ } else if (Array.isArray(data)) {
+ list = data;
+ }
+ }
+ const processedList = this.processTupianUrl(list);
+ this.setData({
+ shangpinleixing: processedList,
+ xuanzhongLeixingId: processedList[0]?.id || null
+ });
+ if (this.data.xuanzhongLeixingId) {
+ this.loadDingdanList(true);
+ }
+ } else {
+ wx.showToast({ title: res.data?.msg || '加载商品类型失败', icon: 'none', duration: 2000 });
+ }
+ } catch (error) {
+ console.error('加载商品类型失败:', error);
+ wx.showToast({ title: '网络错误,加载失败', icon: 'none', duration: 2000 });
+ } finally {
+ wx.hideLoading();
+ }
+ },
+
+ processTupianUrl(list) {
+ const ossUrl = app.globalData.ossImageUrl || '';
+ return list.map(item => ({
+ ...item,
+ full_tupian_url: item.tupian_url && !item.tupian_url.startsWith('http') ? ossUrl + item.tupian_url : (item.tupian_url || '/images/default-type.png')
+ }));
+ },
+
+ async selectLeixing(e) {
+ const now = Date.now();
+ if (now - this.data.lastSwitchTime < this.data.switchCooldown) {
+ wx.showToast({
+ title: `操作太快,请${Math.ceil((this.data.switchCooldown - (now - this.data.lastSwitchTime)) / 1000)}秒后再试`,
+ icon: 'none',
+ duration: 1500
+ });
+ return;
+ }
+ if (this.data.isSwitching) return;
+ const leixingId = e.currentTarget.dataset.id;
+ if (leixingId === this.data.xuanzhongLeixingId) return;
+ this.setData({ isSwitching: true, lastSwitchTime: now });
+ wx.showLoading({ title: '切换中...' });
+ try {
+ this.setData({
+ xuanzhongLeixingId: leixingId,
+ dingdanList: [],
+ page: 1,
+ hasMore: true
+ });
+ await this.loadDingdanList(true);
+ } catch (error) {
+ console.error('切换类型失败:', error);
+ } finally {
+ this.setData({ isSwitching: false });
+ wx.hideLoading();
+ }
+ },
+
+ async loadDingdanList(isRefresh = false) {
+ if (this.data.isLoading || !this.data.xuanzhongLeixingId) return;
+
+ const loadPage = isRefresh ? 1 : this.data.page;
+ if (!isRefresh && !this.data.hasMore) return;
+
+ this.setData({
+ isLoading: true,
+ isLoadingMore: !isRefresh
+ });
+
+ try {
+ const res = await request({
+ url: '/dingdan/ddhq',
+ method: 'POST',
+ data: {
+ leixing_id: this.data.xuanzhongLeixingId,
+ page: loadPage,
+ page_size: this.data.pageSize
+ }
+ });
+
+ this.setData({
+ isLoading: false,
+ isLoadingMore: false,
+ scrollViewRefreshing: false
+ });
+
+ if (res.data.code === 200 || res.data.code === 0) {
+ const newList = res.data.data.list || [];
+ const hasMore = res.data.data.has_more || false;
+
+ const processedList = newList.map(item => this.processDingdanItem(item));
+
+ const updatedList = isRefresh ? processedList : [...this.data.dingdanList, ...processedList];
+
+ updatedList.sort((a, b) => (b.creat_time || '').localeCompare(a.creat_time || ''));
+
+ this.setData({
+ dingdanList: updatedList,
+ page: loadPage,
+ hasMore: hasMore
+ });
+
+ if (isRefresh) {
+ this.setData({ lastRefreshTime: Date.now() });
+ }
+ } else {
+ wx.showToast({ title: res.data.msg || '加载失败', icon: 'none' });
+ }
+ } catch (error) {
+ console.error('加载订单失败:', error);
+ this.setData({
+ isLoading: false,
+ isLoadingMore: false,
+ scrollViewRefreshing: false
+ });
+ wx.showToast({ title: '网络请求失败', icon: 'none' });
+ }
+ },
+
+ processDingdanItem(item) {
+ const ossUrl = app.globalData.ossImageUrl || '';
+ let fullTupianUrl = '';
+ if (item.tupian) {
+ fullTupianUrl = !item.tupian.startsWith('http') ? ossUrl + item.tupian : item.tupian;
+ } else {
+ const leixing = this.data.shangpinleixing.find(l => l.id === item.leixing_id);
+ fullTupianUrl = leixing ? leixing.full_tupian_url : '/images/default-order.png';
+ }
+
+ const isZhiding = item.zhuangtai === 7;
+
+ let zhidingAvatar = '';
+ if (item.zhiding_avatar) {
+ zhidingAvatar = !item.zhiding_avatar.startsWith('http') ? ossUrl + item.zhiding_avatar : item.zhiding_avatar;
+ }
+ const zhidingNicheng = item.zhiding_nicheng || '';
+
+ return {
+ ...item,
+ full_tupian_url: fullTupianUrl,
+ isZhiding: isZhiding,
+ isPingtai: item.pingtai == 1,
+ isShangjia: item.pingtai == 2,
+ zhiding_avatar_full: zhidingAvatar,
+ zhiding_nicheng: zhidingNicheng
+ };
+ },
+
+ goToChongzhiPage(failureType, huiyuanId = null, requiredYajin = 0) {
+ let url = '/pages/fighter-recharge/fighter-recharge';
+ let params = {};
+ switch (failureType) {
+ case 'huiyuan':
+ params = { needScroll: '0', scrollTo: 'member' };
+ break;
+ case 'yajin':
+ params = { needScroll: '1', scrollTo: 'bottom', requiredYajin: requiredYajin };
+ break;
+ case 'jifen':
+ params = { needScroll: '1', scrollTo: 'bottom' };
+ break;
+ }
+ if (huiyuanId) params.huiyuanId = huiyuanId;
+ const queryString = Object.keys(params).map(key => `${key}=${encodeURIComponent(params[key])}`).join('&');
+ const fullUrl = `${url}?${queryString}`;
+ wx.navigateTo({
+ url: fullUrl,
+ fail: (err) => {
+ console.error('跳转失败:', err);
+ wx.showToast({ title: '跳转失败,请稍后重试', icon: 'none' });
+ }
+ });
+ },
+
+ async onQiangdanTap(e) {
+ const dingdanItem = e.currentTarget.dataset.item;
+ if (!dingdanItem) return;
+
+ if (!this.data.dashoustatus || this.data.dashoustatus != 1) {
+ wx.showToast({ title: '请先开启接单员身份', icon: 'none' });
+ return;
+ }
+ if (this.data.zhuanghaoStatus != 1) {
+ wx.showToast({ title: '账号异常,无法接单', icon: 'none' });
+ return;
+ }
+ if (this.data.dashouzhuangtai != 1) {
+ wx.showToast({ title: '您有订单正在接待中', icon: 'none' });
+ return;
+ }
+ if (dingdanItem.isZhiding) {
+ if (!this.data.uid || this.data.uid != dingdanItem.zhiding_uid) {
+ wx.showToast({ title: '此订单为指定单', icon: 'none' });
+ return;
+ }
+ }
+ if (dingdanItem.yaoqiuleixing == 1) {
+ const hasHuiyuan = this.data.huiyuanList.some(h => h.huiyuanid == dingdanItem.huiyuan_id);
+ if (!hasHuiyuan) {
+ wx.showToast({ title: '未开通对应会员,无法抢单', icon: 'none', duration: 2000 });
+ setTimeout(() => this.goToChongzhiPage('huiyuan', dingdanItem.huiyuan_id), 500);
+ return;
+ }
+ }
+ if (dingdanItem.yaoqiuleixing == 2) {
+ if (this.data.yajin < dingdanItem.yajin) {
+ wx.showToast({ title: `押金不足,需${dingdanItem.yajin}`, icon: 'none', duration: 2000 });
+ setTimeout(() => this.goToChongzhiPage('yajin', null, dingdanItem.yajin), 500);
+ return;
+ }
+ }
+ if (this.data.jifen < 5) {
+ wx.showToast({ title: '积分不足,至少需要5积分', icon: 'none', duration: 2000 });
+ setTimeout(() => this.goToChongzhiPage('jifen'), 500);
+ return;
+ }
+
+ const that = this;
+ wx.showModal({
+ title: '确认抢单',
+ content: `确定要抢此订单吗?${dingdanItem.isZhiding ? '(指定订单)' : ''}`,
+ success: async function (res) {
+ if (res.confirm) {
+ wx.showLoading({ title: '抢单中...', mask: true });
+ try {
+ const qiangdanRes = await request({
+ url: '/dingdan/qiangdan',
+ method: 'POST',
+ data: { dingdan_id: dingdanItem.dingdan_id }
+ });
+ wx.hideLoading();
+ if (qiangdanRes.data.code === 200 || qiangdanRes.data.code === 0) {
+ that.showQiangdanSuccessEffect();
+ if (app.globalData) {
+ app.globalData.dashouzhuangtai = 0;
+ that.setData({ dashouzhuangtai: 0 });
+ }
+ const newList = that.data.dingdanList.filter(item => item.dingdan_id !== dingdanItem.dingdan_id);
+ that.setData({ dingdanList: newList });
+ } else {
+ wx.showToast({ title: qiangdanRes.data.msg || '抢单失败', icon: 'none' });
+ }
+ } catch (error) {
+ wx.hideLoading();
+ console.error('抢单请求失败:', error);
+ wx.showToast({ title: '网络错误,抢单失败', icon: 'none' });
+ }
+ }
+ }
+ });
+ },
+
+ showQiangdanSuccessEffect() {
+ wx.showToast({ title: '抢单成功!', icon: 'success', duration: 2000 });
+ },
+
+ onViewDetail(e) {
+ const { type, content } = e.currentTarget.dataset;
+ wx.showModal({
+ title: type === 'jieshao' ? '订单介绍' : '订单备注',
+ content: content,
+ showCancel: false,
+ confirmText: '知道了'
+ });
+ },
+
+ onReachBottom() {
+ const now = Date.now();
+ if (now - this.data.lastRefreshTime < this.data.refreshCooldown) {
+ wx.showToast({
+ title: `操作太快,请${Math.ceil((this.data.refreshCooldown - (now - this.data.lastRefreshTime)) / 1000)}秒后再试`,
+ icon: 'none',
+ duration: 1500
+ });
+ return;
+ }
+ if (this.data.isLoading || this.data.isLoadingMore) return;
+ if (this.data.hasMore && !this.data.isLoading && this.data.xuanzhongLeixingId) {
+ this.setData({ page: this.data.page + 1 });
+ this.loadDingdanList(false);
+ }
+ },
+
+ onPullDownRefresh() {
+ const now = Date.now();
+ if (now - this.data.lastRefreshTime < this.data.refreshCooldown) {
+ this.setData({ scrollViewRefreshing: false });
+ wx.showToast({
+ title: `操作太快,请${Math.ceil((this.data.refreshCooldown - (now - this.data.lastRefreshTime)) / 1000)}秒后再试`,
+ icon: 'none',
+ duration: 1500
+ });
+ return;
+ }
+ if (this.data.isLoading) {
+ this.setData({ scrollViewRefreshing: false });
+ return;
+ }
+ this.setData({
+ scrollViewRefreshing: true,
+ lastRefreshTime: now
+ });
+ if (this.data.xuanzhongLeixingId) {
+ this.setData({ page: 1, hasMore: true });
+ this.loadDingdanList(true);
+ } else {
+ this.setData({ scrollViewRefreshing: false });
+ }
+ },
+
+ goToDashouRegister() {
+ wx.navigateTo({
+ url: '/pages/fighter/fighter'
+ });
+ }
});
\ No newline at end of file
diff --git a/pages/order-pool/order-pool.wxml b/pages/order-pool/order-pool.wxml
index 0b2bf70..69d5832 100644
--- a/pages/order-pool/order-pool.wxml
+++ b/pages/order-pool/order-pool.wxml
@@ -5,7 +5,7 @@
- 🔒
+
功能未开启
{{unauthorizedMsg}}
请先注册为服务者,即可使用抢单功能
@@ -19,6 +19,25 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -143,7 +162,7 @@
- 💰
+ 佣
分佣
{{item.dashou_fencheng || 0}}
元
@@ -223,7 +242,7 @@
- 💰
+ 佣
分佣
{{item.dashou_fencheng || 0}}
元
diff --git a/pages/order-pool/order-pool.wxss b/pages/order-pool/order-pool.wxss
index 863351b..648f067 100644
--- a/pages/order-pool/order-pool.wxss
+++ b/pages/order-pool/order-pool.wxss
@@ -1,4 +1,5 @@
/* pages/qiangdan/qiangdan.wxss */
+@import '../../styles/dashou-xym-theme.wxss';
.qiangdan-page {
height: 100vh;
display: flex;
@@ -59,18 +60,27 @@
}
.icon-lock {
- font-size: 100rpx;
+ position: relative;
+ width: 72rpx;
+ height: 52rpx;
margin-bottom: 30rpx;
- background: rgba(255, 255, 255, 0.1);
- width: 160rpx;
- height: 160rpx;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- border: 4rpx solid #00f7ff;
- box-shadow: 0 0 50rpx #00f7ff;
- text-shadow: 0 0 20rpx #00f7ff;
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ border-radius: 10rpx;
+ box-shadow: 0 8rpx 24rpx rgba(180, 130, 20, 0.25);
+ }
+
+ .icon-lock::before {
+ content: '';
+ position: absolute;
+ top: -34rpx;
+ left: 50%;
+ transform: translateX(-50%);
+ width: 44rpx;
+ height: 36rpx;
+ border: 8rpx solid #ffd061;
+ border-bottom: none;
+ border-radius: 22rpx 22rpx 0 0;
+ box-sizing: border-box;
}
.title {
diff --git a/styles/dashou-xym-order-card.wxss b/styles/dashou-xym-order-card.wxss
new file mode 100644
index 0000000..88ee7dc
--- /dev/null
+++ b/styles/dashou-xym-order-card.wxss
@@ -0,0 +1,341 @@
+/* 抢单订单卡片 - 逍遥梦布局(星阙数据) */
+
+.flex { display: flex; align-items: center; }
+.flexb { display: flex; align-items: center; justify-content: space-between; }
+.flexa { display: flex; align-items: center; justify-content: center; }
+.myflex { display: flex; align-items: center; }
+
+.dingdan-list {
+ padding: 0 0 24rpx;
+}
+
+.xym-order-item {
+ margin-bottom: 24rpx;
+ position: relative;
+ overflow: visible;
+ border-radius: 30rpx;
+ box-shadow: 0 10rpx 28rpx rgba(0, 0, 0, 0.09);
+}
+
+/* 平台订单 */
+.xym-pingtai-order {
+ padding-bottom: 5rpx;
+ background: #927a46;
+}
+
+.xym-pingtai-head {
+ height: 72rpx;
+ padding: 0 24rpx;
+ background: linear-gradient(50deg, #957c48, #5c4a28);
+ border-radius: 30rpx 30rpx 0 0;
+}
+
+.xym-head-time {
+ font-size: 24rpx;
+ color: #fcd270;
+}
+
+.xym-head-tag {
+ font-size: 22rpx;
+ padding: 4rpx 16rpx;
+ border-radius: 8rpx;
+ font-weight: 600;
+ background: rgba(252, 210, 112, 0.22);
+ color: #fcd270;
+ border: 1rpx solid rgba(252, 210, 112, 0.4);
+}
+
+.xym-pingtai-body {
+ border-radius: 40rpx 10rpx 30rpx 30rpx;
+ padding: 0 20rpx 24rpx;
+ background: linear-gradient(to bottom, #3a3220, #cec180);
+}
+
+/* 商家订单 */
+.xym-shangjia-order {
+ padding-bottom: 5rpx;
+ background: linear-gradient(to bottom, #fff8e1, #ffe0b2);
+ overflow: hidden;
+}
+
+.xym-shangjia-body {
+ border-radius: 10rpx 10rpx 30rpx 30rpx;
+ padding: 0 20rpx 24rpx;
+}
+
+.xym-shangjia-head {
+ padding: 16rpx 24rpx 8rpx;
+}
+
+.xym-shangjia-head .xym-head-time {
+ color: #888;
+}
+
+.xym-shangjia-head .xym-head-tag {
+ background: rgba(255, 255, 255, 0.65);
+ color: #492f00;
+ border-color: rgba(255, 208, 97, 0.5);
+}
+
+.order-con {
+ position: relative;
+ min-height: 108rpx;
+}
+
+.order-row {
+ align-items: flex-start;
+ padding: 24rpx 10rpx 14rpx;
+}
+
+.o-logo {
+ width: 88rpx;
+ height: 88rpx;
+ border-radius: 12rpx;
+ margin-right: 14rpx;
+ flex-shrink: 0;
+ background: #eee;
+}
+
+.o-col {
+ flex: 1;
+ min-width: 0;
+ padding-right: 136rpx;
+ box-sizing: border-box;
+}
+
+.o-goods {
+ font-weight: 700;
+ font-size: 30rpx;
+ line-height: 1.5;
+ color: #333;
+}
+
+.o-goods.light {
+ color: #fff;
+}
+
+.line2 {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+}
+
+.merchant-line {
+ display: flex;
+ align-items: center;
+ padding: 0 10rpx 12rpx;
+ gap: 12rpx;
+}
+
+.m-avatar-sm {
+ width: 56rpx;
+ height: 56rpx;
+ border-radius: 50%;
+ flex-shrink: 0;
+ background: #eee;
+}
+
+.m-name-sm {
+ font-size: 26rpx;
+ font-weight: 600;
+ color: #333;
+}
+
+.zhiding-strip {
+ margin: 0 10rpx 12rpx;
+ padding: 10rpx 16rpx;
+ background: rgba(255, 77, 109, 0.12);
+ border-radius: 12rpx;
+ flex-wrap: wrap;
+ gap: 8rpx;
+}
+
+.zhiding-strip.light {
+ background: rgba(255, 255, 255, 0.35);
+}
+
+.zhiding-strip .zhiding-label {
+ font-size: 22rpx;
+ color: #ff4d6d;
+ font-weight: 700;
+ padding: 2rpx 12rpx;
+ background: rgba(255, 77, 109, 0.15);
+ border-radius: 8rpx;
+}
+
+.zhiding-strip .zhiding-avatar {
+ width: 40rpx;
+ height: 40rpx;
+ border-radius: 50%;
+}
+
+.zhiding-strip .zhiding-name {
+ font-size: 24rpx;
+ color: #666;
+ max-width: 200rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.xym-pingtai-body .zhiding-strip .zhiding-name {
+ color: #f5e6b8;
+}
+
+.reward-badge {
+ position: absolute;
+ right: 0;
+ top: 18rpx;
+ font-size: 24rpx;
+ padding: 6rpx 20rpx;
+ border-radius: 30rpx 10rpx 0 30rpx;
+ display: flex;
+ align-items: baseline;
+ z-index: 3;
+ box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
+}
+
+.reward-badge.normal-reward {
+ color: #492f00;
+ background: linear-gradient(to bottom, #fae04d, #ffc0a3);
+}
+
+.reward-badge.platform-reward {
+ color: #fff;
+ background: linear-gradient(to right, #dabd83, #704029);
+}
+
+.xym-shangjia-body .reward-badge:not(.member-tip) {
+ top: 76rpx;
+}
+
+.reward-badge.member-tip {
+ background: rgba(255, 255, 255, 0.85);
+ padding: 8rpx 16rpx;
+ border-radius: 20rpx;
+ top: 16rpx;
+ right: 10rpx;
+}
+
+.reward-yen {
+ font-size: 28rpx;
+}
+
+.reward-num {
+ font-weight: 700;
+ font-size: 34rpx;
+}
+
+.reward-num.dark {
+ color: #c00;
+}
+
+.reward-tip {
+ font-size: 22rpx;
+ color: #c0392b;
+ font-weight: 600;
+}
+
+.reward-yen.sm {
+ font-size: 26rpx;
+}
+
+.remark-block {
+ font-size: 24rpx;
+ margin: 8rpx 10rpx 0;
+ padding: 12rpx 16rpx;
+ border-left: 4rpx solid;
+ border-radius: 0 8rpx 8rpx 0;
+ overflow: hidden;
+}
+
+.remark-block.gold {
+ color: #fff;
+ border-color: #ffd700;
+ background: rgba(255, 215, 0, 0.12);
+}
+
+.remark-block.dark {
+ color: #666;
+ border-color: #87ceeb;
+ background: rgba(135, 206, 235, 0.12);
+}
+
+.remark-label {
+ font-weight: 600;
+}
+
+.remark-block.gold .remark-label {
+ color: #ffd700;
+}
+
+.remark-block.dark .remark-label {
+ color: #87ceeb;
+}
+
+.xuqiu-tags-row {
+ margin: 12rpx 10rpx 0;
+ padding-top: 12rpx;
+ border-top: 2rpx dotted rgba(255, 255, 255, 0.35);
+}
+
+.xym-shangjia-body .xuqiu-tags-row {
+ border-top-color: rgba(0, 0, 0, 0.08);
+}
+
+.xuqiu-tags-row .xuqiu-label {
+ font-size: 22rpx;
+ color: #87ceeb;
+ margin-bottom: 8rpx;
+ display: block;
+}
+
+.o-foot {
+ margin-top: 18rpx;
+ padding: 0 10rpx 8rpx;
+}
+
+.o-amt {
+ font-size: 26rpx;
+ color: #999;
+}
+
+.o-amt.light {
+ color: #f5e6b8;
+}
+
+.btn-bg {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ border-radius: 60rpx;
+ color: #492f00;
+}
+
+.qiangdan {
+ color: #492f00;
+ width: 180rpx;
+ min-width: 100rpx;
+ padding: 15rpx 10rpx;
+ border: 2rpx solid #fff;
+ box-sizing: border-box;
+ font-size: 26rpx;
+ font-weight: 700;
+ flex-shrink: 0;
+}
+
+.qiangdan.btn-qiang-brown {
+ background: linear-gradient(to right, #7a4a2d 0%, #e4ce94 100%) !important;
+ color: #000 !important;
+}
+
+.view-more-inline {
+ font-size: 22rpx;
+ color: #87ceeb;
+ margin-left: 4rpx;
+}
+
+.biaoqian-inline-scroll {
+ white-space: nowrap;
+ width: 100%;
+}
diff --git a/styles/dashou-xym-orders-theme.wxss b/styles/dashou-xym-orders-theme.wxss
new file mode 100644
index 0000000..75fe04d
--- /dev/null
+++ b/styles/dashou-xym-orders-theme.wxss
@@ -0,0 +1,84 @@
+/* 打手我的订单 - 逍遥梦风格视觉覆盖 */
+
+.ds-page {
+ background: #f5f5f5 !important;
+}
+
+.leixing-area {
+ background: #fff !important;
+ border-bottom: none !important;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06) !important;
+ margin: 12rpx 20rpx 0 !important;
+ border-radius: 28rpx !important;
+}
+
+.leixing-item.leixing-active {
+ background: linear-gradient(180deg, #fff0c2, #f5d563) !important;
+ box-shadow: 0 4rpx 12rpx rgba(255, 208, 97, 0.35) !important;
+}
+
+.leixing-active .leixing-name {
+ color: #492f00 !important;
+ font-weight: 700 !important;
+}
+
+.filter-row {
+ background: transparent !important;
+ border-bottom: none !important;
+}
+
+.type-switch {
+ background: rgba(255, 255, 255, 0.8) !important;
+}
+
+.type-btn.type-active {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3) !important;
+ color: #492f00 !important;
+ box-shadow: 0 2rpx 8rpx rgba(180, 130, 20, 0.2) !important;
+}
+
+.search-box {
+ background: #fff !important;
+ border: 1rpx solid rgba(255, 208, 97, 0.3) !important;
+}
+
+.left-status {
+ background: rgba(255, 255, 255, 0.92) !important;
+ border-right: none !important;
+}
+
+.status-item.status-active {
+ background: #fff8e1 !important;
+}
+
+.status-active .status-name {
+ color: #492f00 !important;
+}
+
+.status-dot {
+ background: #ffd061 !important;
+}
+
+.right-list {
+ background: #f5f5f5 !important;
+}
+
+.order-card {
+ background: #fdfcfa !important;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06) !important;
+}
+
+.card-price {
+ color: #c0392b !important;
+}
+
+.loading-spinner,
+.mini-spinner {
+ border-top-color: #ffd061 !important;
+}
+
+.load-more-btn {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3) !important;
+ color: #492f00 !important;
+ border: 2rpx solid #fff !important;
+}
diff --git a/styles/dashou-xym-rank-theme.wxss b/styles/dashou-xym-rank-theme.wxss
new file mode 100644
index 0000000..e6eaa43
--- /dev/null
+++ b/styles/dashou-xym-rank-theme.wxss
@@ -0,0 +1,92 @@
+/* 打手排行榜 - 逍遥梦风格视觉覆盖 */
+
+page {
+ background: #f5f5f5 !important;
+ color: #333 !important;
+}
+
+.rank-page {
+ background: #f5f5f5 !important;
+}
+
+.page-bg {
+ opacity: 0.35 !important;
+}
+
+.page-title {
+ color: #343434 !important;
+}
+
+.refresh-wrap {
+ background: rgba(255, 255, 255, 0.85) !important;
+}
+
+.role-chip {
+ background: rgba(255, 255, 255, 0.8) !important;
+ color: #666 !important;
+ border: 2rpx solid rgba(255, 208, 97, 0.25) !important;
+}
+
+.role-chip.on {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3) !important;
+ color: #492f00 !important;
+ border-color: #ffd061 !important;
+ font-weight: 700 !important;
+}
+
+.date-chip {
+ background: rgba(255, 255, 255, 0.7) !important;
+ color: #666 !important;
+}
+
+.date-chip.on {
+ background: #fef6d4 !important;
+ color: #492f00 !important;
+ font-weight: 700 !important;
+}
+
+.sort-tip {
+ color: #999 !important;
+}
+
+.podium-panel {
+ background: #fdfcfa !important;
+ box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06) !important;
+}
+
+.p-name {
+ color: #222 !important;
+}
+
+.p-score {
+ color: #c0392b !important;
+}
+
+.rank-row {
+ background: #fdfcfa !important;
+ box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04) !important;
+}
+
+.rank-row .r-name {
+ color: #333 !important;
+}
+
+.rank-row .r-score {
+ color: #492f00 !important;
+}
+
+.my-rank-bar {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3) !important;
+}
+
+.my-rank-bar text {
+ color: #492f00 !important;
+}
+
+.state-wrap text {
+ color: #999 !important;
+}
+
+.loader {
+ border-top-color: #ffd061 !important;
+}
diff --git a/styles/dashou-xym-recharge-theme.wxss b/styles/dashou-xym-recharge-theme.wxss
new file mode 100644
index 0000000..4b2d43a
--- /dev/null
+++ b/styles/dashou-xym-recharge-theme.wxss
@@ -0,0 +1,213 @@
+/* 打手充值页 - 逍遥梦风格视觉覆盖(不改 wxml/逻辑) */
+
+.page-container {
+ background: linear-gradient(180deg, #f7dc51 0%, #fff 22%, #fff8e1 100%) !important;
+}
+
+.page-container::before {
+ display: none !important;
+}
+
+.vip-section {
+ background: transparent !important;
+}
+
+.section-header .dec-text,
+.section-subtitle {
+ color: #492f00 !important;
+}
+
+.dec-line,
+.dec-diamond {
+ background: #ffd061 !important;
+}
+
+.vip-card {
+ background: #fdfcfa !important;
+ border: 2rpx solid rgba(255, 208, 97, 0.5) !important;
+ box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08) !important;
+}
+
+.vip-card.active {
+ border-color: #ffd061 !important;
+ box-shadow: 0 8rpx 28rpx rgba(255, 208, 97, 0.35) !important;
+}
+
+.card-frame,
+.frame-corner,
+.frame-line {
+ display: none !important;
+}
+
+.vip-title .title-text,
+.vip-price .price-number,
+.detail-title .title-text {
+ color: #222 !important;
+}
+
+.vip-price .price-symbol,
+.vip-price .price-unit {
+ color: #666 !important;
+}
+
+.feature-text {
+ color: #666 !important;
+}
+
+.vip-detail {
+ background: #fdfcfa !important;
+ border-radius: 20rpx !important;
+ margin: 0 24rpx !important;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06) !important;
+}
+
+.detail-text,
+.rule-text {
+ color: #666 !important;
+}
+
+.tech-buy-btn,
+.tech-btn,
+.modal-btn.confirm-btn {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3) !important;
+ border: 2rpx solid #fff !important;
+ border-radius: 44rpx !important;
+ box-shadow: 0 4rpx 12rpx rgba(180, 130, 20, 0.25) !important;
+}
+
+.buy-btn-text,
+.btn-text,
+.tech-btn .btn-text {
+ color: #492f00 !important;
+}
+
+.buy-btn-bg,
+.buy-btn-glow,
+.btn-bg,
+.btn-glow,
+.btn-energy,
+.btn-shine,
+.btn-sparkle {
+ display: none !important;
+}
+
+.tech-grid {
+ flex-wrap: wrap !important;
+}
+
+.tech-card {
+ background: #fdfcfa !important;
+ border: none !important;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06) !important;
+ min-height: 240rpx !important;
+}
+
+.tech-card::before {
+ display: none !important;
+}
+
+.card-title .title-text,
+.amount-number,
+.jifen-value {
+ color: #222 !important;
+}
+
+.amount-unit,
+.amount-symbol,
+.jifen-label,
+.footer-text,
+.empty-text {
+ color: #666 !important;
+}
+
+.huiyuan-tag,
+.tech-tag {
+ background: #fef6d4 !important;
+ border: 1rpx solid rgba(255, 208, 97, 0.4) !important;
+}
+
+.tag-name {
+ color: #492f00 !important;
+}
+
+.tag-time {
+ color: #999 !important;
+}
+
+.tech-line {
+ background: linear-gradient(90deg, transparent, #ffd061, transparent) !important;
+}
+
+.tech-modal .modal-container {
+ background: #fdfcfa !important;
+ border: none !important;
+ box-shadow: 0 12rpx 40rpx rgba(0, 0, 0, 0.12) !important;
+}
+
+.modal-corner {
+ display: none !important;
+}
+
+.modal-title {
+ color: #222 !important;
+}
+
+.modal-subtitle,
+.input-tip,
+.detail-label {
+ color: #666 !important;
+}
+
+.modal-btn.cancel-btn {
+ background: #f5f5f5 !important;
+ color: #666 !important;
+}
+
+.yajin-input {
+ color: #222 !important;
+}
+
+.quick-btn {
+ background: #fef6d4 !important;
+ border: 2rpx solid rgba(255, 208, 97, 0.4) !important;
+}
+
+.quick-btn.active {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3) !important;
+ border-color: #ffd061 !important;
+}
+
+.quick-text {
+ color: #492f00 !important;
+}
+
+.pay-method-item {
+ background: #fef6d4 !important;
+ border-radius: 16rpx !important;
+}
+
+.method-name {
+ color: #222 !important;
+}
+
+.method-desc {
+ color: #999 !important;
+}
+
+.tech-loading .loading-backdrop {
+ background: rgba(255, 248, 225, 0.85) !important;
+}
+
+.loading-text,
+.loading-subtext {
+ color: #666 !important;
+}
+
+.spinner-ring {
+ border-color: rgba(255, 208, 97, 0.3) !important;
+ border-top-color: #ffd061 !important;
+}
+
+.tech-footer .footer-text {
+ color: #999 !important;
+}
diff --git a/styles/dashou-xym-theme.wxss b/styles/dashou-xym-theme.wxss
new file mode 100644
index 0000000..50985c8
--- /dev/null
+++ b/styles/dashou-xym-theme.wxss
@@ -0,0 +1,288 @@
+/* 打手端抢单页 - 逍遥梦风格视觉覆盖(不改 wxml 结构/class) */
+
+.xym-lunbo-container {
+ margin: 16rpx 24rpx 0;
+ border-radius: 20rpx;
+ overflow: hidden;
+ flex-shrink: 0;
+}
+
+.xym-lunbo-swiper {
+ height: 300rpx;
+ border-radius: 20rpx;
+}
+
+.xym-lunbo-image {
+ width: 100%;
+ height: 300rpx;
+ border-radius: 20rpx;
+}
+
+.qiangdan-page {
+ background: linear-gradient(180deg, #f7dc51 0%, #fff 28%, #fff8e1 100%) !important;
+}
+
+.qiangdan-page::before {
+ display: none !important;
+}
+
+.leixing-quyu {
+ background: #fff !important;
+ border-bottom: none !important;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06) !important;
+ margin: 12rpx 20rpx 0 !important;
+ border-radius: 28rpx !important;
+ padding: 14rpx 0 8rpx !important;
+}
+
+.leixing-scroll {
+ height: 132rpx !important;
+}
+
+.leixing-item {
+ width: 120rpx !important;
+}
+
+.leixing-tupian {
+ width: 88rpx !important;
+ height: 88rpx !important;
+ border-radius: 20rpx !important;
+ border: none !important;
+ box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08) !important;
+}
+
+.leixing-active .leixing-tupian {
+ border: 3rpx solid #ffd061 !important;
+ box-shadow: 0 6rpx 16rpx rgba(255, 208, 97, 0.45) !important;
+}
+
+.leixing-jieshao {
+ margin-top: 8rpx !important;
+ font-size: 22rpx !important;
+ color: #666 !important;
+ text-shadow: none !important;
+}
+
+.leixing-active .leixing-jieshao {
+ color: #492f00 !important;
+ font-weight: 700 !important;
+}
+
+.guangyun-effect {
+ background: radial-gradient(circle, rgba(255, 208, 97, 0.35) 0%, transparent 70%) !important;
+}
+
+.biaoqian-quyu {
+ background: transparent !important;
+ padding: 8rpx 20rpx 0 !important;
+}
+
+.biaoqian-item {
+ background: rgba(255, 255, 255, 0.65) !important;
+ border: 2rpx solid rgba(201, 162, 39, 0.25) !important;
+}
+
+.biaoqian-active {
+ background: linear-gradient(180deg, #fff0c2, #f5d563) !important;
+ border-color: rgba(180, 130, 20, 0.85) !important;
+}
+
+.fenge-xian {
+ background: linear-gradient(90deg, transparent, #ffd061, transparent) !important;
+ opacity: 0.6 !important;
+ margin: 6rpx 30rpx 0 !important;
+}
+
+.dingdan-list {
+ padding: 16rpx 20rpx 0 !important;
+ margin-top: 8rpx !important;
+}
+
+.refreshing-text,
+.pull-down-text {
+ color: #6b5420 !important;
+ text-shadow: none !important;
+}
+
+.tip-text {
+ color: #999 !important;
+}
+
+.tip-icon {
+ filter: none !important;
+}
+
+.dingdan-card {
+ border-radius: 28rpx !important;
+ box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08) !important;
+ border: none !important;
+ backdrop-filter: none !important;
+}
+
+.pingtai-card {
+ background: linear-gradient(to bottom, #927a46, #cec180) !important;
+ padding: 0 0 16rpx !important;
+}
+
+.pingtai-card::before,
+.shangjia-card::before {
+ display: none !important;
+}
+
+.pingtai-card .card-top,
+.shangjia-card .card-top {
+ background: linear-gradient(50deg, #957c48, #5c4a28) !important;
+ border-radius: 28rpx 28rpx 0 0 !important;
+ margin: -28rpx -24rpx 16rpx !important;
+ padding: 16rpx 24rpx !important;
+}
+
+.pingtai-tag,
+.creat-time {
+ color: #fcd270 !important;
+}
+
+.shangjia-card {
+ background: linear-gradient(to bottom, #fff8e1, #ffe0b2) !important;
+}
+
+.card-content,
+.jieshao-box,
+.beizhu-box,
+.shangjia-jieshao,
+.shangjia-beizhu {
+ background: rgba(255, 255, 255, 0.55) !important;
+ border-radius: 12rpx !important;
+}
+
+.jieshao-label,
+.beizhu-label,
+.xuqiu-label {
+ color: #87ceeb !important;
+}
+
+.jieshao-text,
+.beizhu-text {
+ color: #333 !important;
+}
+
+.fenyong-box {
+ background: linear-gradient(to bottom, #fae04d, #ffc0a3) !important;
+ border-radius: 30rpx !important;
+}
+
+.fenyong-text,
+.fenyong-price,
+.fenyong-unit {
+ color: #492f00 !important;
+}
+
+.qiangdan-btn,
+.mecha-btn {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3) !important;
+ border: 2rpx solid #fff !important;
+ box-shadow: 0 4rpx 12rpx rgba(180, 130, 20, 0.25) !important;
+}
+
+.qiangdan-btn .btn-text,
+.mecha-btn .btn-text {
+ color: #492f00 !important;
+}
+
+.btn-shine,
+.btn-glow,
+.mecha-overlay {
+ display: none !important;
+}
+
+.loading-mask {
+ background: rgba(255, 248, 225, 0.85) !important;
+}
+
+.loading-mask-text,
+.loading-text,
+.no-more-text {
+ color: #999 !important;
+}
+
+.unauthorized-container {
+ background: linear-gradient(180deg, #f7dc51, #fff 50%) !important;
+}
+
+.unauthorized-card {
+ background: #fdfcfa !important;
+ border: none !important;
+ box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.08) !important;
+}
+
+.unauthorized-card .title {
+ color: #343434 !important;
+}
+
+.unauthorized-card .message,
+.unauthorized-card .description {
+ color: #666 !important;
+}
+
+.btn-register {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3) !important;
+ border-radius: 44rpx !important;
+}
+
+.btn-register .btn-text {
+ color: #492f00 !important;
+}
+
+.card-glow {
+ display: none !important;
+}
+
+.order-type-tag {
+ font-size: 22rpx;
+ padding: 6rpx 16rpx;
+ border-radius: 8rpx;
+ font-weight: 600;
+ line-height: 1.4;
+}
+
+.tag-platform {
+ background: rgba(252, 210, 112, 0.22);
+ color: #fcd270;
+ border: 1rpx solid rgba(252, 210, 112, 0.45);
+}
+
+.tag-merchant {
+ background: rgba(255, 255, 255, 0.45);
+ color: #492f00;
+ border: 1rpx solid rgba(255, 208, 97, 0.55);
+}
+
+.fenyong-mark {
+ width: 36rpx;
+ height: 36rpx;
+ line-height: 36rpx;
+ text-align: center;
+ font-size: 22rpx;
+ font-weight: 700;
+ color: #492f00;
+ background: rgba(255, 255, 255, 0.72);
+ border-radius: 50%;
+ margin-right: 8rpx;
+ flex-shrink: 0;
+}
+
+.fenyong-icon {
+ display: none !important;
+}
+
+.qiangdan-btn {
+ min-width: 180rpx !important;
+ height: 68rpx !important;
+ border-radius: 34rpx !important;
+}
+
+.qiangdan-btn .btn-text {
+ font-size: 28rpx !important;
+ font-weight: 700 !important;
+ letter-spacing: 1rpx;
+}
diff --git a/styles/shangjia-xym-common.wxss b/styles/shangjia-xym-common.wxss
new file mode 100644
index 0000000..b32fef4
--- /dev/null
+++ b/styles/shangjia-xym-common.wxss
@@ -0,0 +1,307 @@
+/* 商家端逍遥梦风格 - 公共布局/色板(仅 UI) */
+
+.flex { display: flex; align-items: center; }
+.flexb { display: flex; align-items: center; justify-content: space-between; }
+.flexa { display: flex; align-items: center; justify-content: space-around; }
+.flexm { display: flex; align-items: center; justify-content: center; }
+.flexmc { display: flex; flex-direction: column; align-items: center; justify-content: center; }
+
+.sj-page {
+ min-height: 100vh;
+ display: flex;
+ flex-direction: column;
+ background: linear-gradient(180deg, #f7dc51 0%, #fff 28%, #fff8e1 100%);
+ box-sizing: border-box;
+ overflow: hidden;
+}
+
+.sj-page-header {
+ flex-shrink: 0;
+ position: relative;
+ z-index: 2;
+}
+
+.sj-nav-title {
+ font-size: 34rpx;
+ font-weight: 700;
+ color: #343434;
+}
+
+.sj-scroll {
+ flex: 1;
+ height: 0;
+}
+
+.sj-mx20 {
+ margin-left: 24rpx;
+ margin-right: 24rpx;
+}
+
+.sj-panel {
+ background: #fdfcfa;
+ border-radius: 20rpx;
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
+}
+
+.sj-btn-outline {
+ padding: 10rpx 24rpx;
+ font-size: 26rpx;
+ font-weight: 700;
+ border: 2rpx solid #fff;
+ border-radius: 60rpx;
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ color: #492f00;
+ white-space: nowrap;
+}
+
+.sj-btn-bg {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3);
+ border-radius: 60rpx;
+ color: #492f00;
+ font-weight: 700;
+}
+
+.sj-identity-tag {
+ margin-left: 8rpx;
+ font-size: 20rpx;
+ padding: 4rpx 12rpx;
+ border-radius: 8rpx;
+ background: #ff9900;
+ color: #fff;
+}
+
+.sj-wallet-card {
+ margin: 0 30rpx;
+ padding: 24rpx 20rpx;
+ border-radius: 26rpx;
+ background: #fef6d4;
+}
+
+.sj-w-label {
+ color: #666;
+ font-size: 26rpx;
+}
+
+.sj-w-num {
+ font-size: 44rpx;
+ font-weight: 700;
+ color: #222;
+ margin-top: 10rpx;
+}
+
+.sj-w-sub {
+ color: #666;
+ font-size: 26rpx;
+ margin-top: 8rpx;
+}
+
+.sj-section-hd {
+ padding: 16rpx 24rpx 8rpx;
+ font-size: 32rpx;
+ font-weight: 700;
+ color: #343434;
+}
+
+.sj-fadan-row {
+ display: flex;
+ gap: 16rpx;
+ margin: 16rpx 0 0;
+}
+
+.sj-fadan-btn {
+ flex: 1;
+ height: 150rpx;
+ border-radius: 20rpx;
+ overflow: hidden;
+ position: relative;
+ box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.08);
+}
+
+.sj-fadan-btn-inner {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 16rpx;
+ box-sizing: border-box;
+}
+
+.sj-fadan-btn--regular {
+ background: linear-gradient(135deg, #fff8e1, #ffe0b2);
+}
+
+.sj-fadan-btn--custom {
+ background: linear-gradient(135deg, #fef6d4, #f5d563);
+}
+
+.sj-fadan-title {
+ font-size: 30rpx;
+ font-weight: 700;
+ color: #492f00;
+}
+
+.sj-fadan-sub {
+ font-size: 22rpx;
+ color: #886633;
+ margin-top: 8rpx;
+}
+
+.sj-notice-bar {
+ display: flex;
+ align-items: center;
+ background: #fdf9db;
+ margin: 14rpx 24rpx 0;
+ border-radius: 10rpx;
+ padding: 10rpx 16rpx;
+}
+
+.sj-notice-txt {
+ font-size: 24rpx;
+ color: #4a3000;
+ line-height: 1.4;
+ flex: 1;
+}
+
+.sj-stat-card {
+ margin: 16rpx 24rpx 0;
+ padding: 20rpx 16rpx 16rpx;
+ border-radius: 20rpx;
+ background: #fff;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
+ position: relative;
+ overflow: hidden;
+}
+
+.sj-stat-row {
+ display: flex;
+ align-items: stretch;
+ padding: 12rpx 8rpx;
+}
+
+.sj-stat-col {
+ flex: 1;
+ text-align: center;
+ padding: 8rpx 4rpx;
+}
+
+.sj-stat-divider {
+ width: 1rpx;
+ background: rgba(0, 0, 0, 0.06);
+ margin: 8rpx 0;
+}
+
+.sj-stat-lbl {
+ display: block;
+ font-size: 22rpx;
+ color: #888;
+}
+
+.sj-stat-num {
+ display: block;
+ font-size: 36rpx;
+ font-weight: 700;
+ color: #e67e22;
+ margin-top: 8rpx;
+}
+
+.sj-kefu-row {
+ display: flex;
+ gap: 16rpx;
+ margin-top: 16rpx;
+ padding-top: 12rpx;
+ border-top: 1rpx dashed rgba(0, 0, 0, 0.08);
+}
+
+.sj-kefu-entry {
+ flex: 1;
+ text-align: center;
+ padding: 16rpx 8rpx;
+ border-radius: 12rpx;
+ background: linear-gradient(180deg, #fff8e1, #fef6d4);
+ font-size: 24rpx;
+ color: #492f00;
+ font-weight: 600;
+}
+
+.sj-recent-item {
+ padding: 20rpx 24rpx;
+ border-bottom: 1rpx solid rgba(0, 0, 0, 0.04);
+}
+
+.sj-recent-name {
+ font-size: 28rpx;
+ font-weight: 600;
+ color: #333;
+}
+
+.sj-recent-sub {
+ font-size: 22rpx;
+ color: #999;
+ margin-top: 6rpx;
+}
+
+.sj-recent-money {
+ font-size: 30rpx;
+ font-weight: 700;
+ color: #e67e22;
+ flex-shrink: 0;
+ margin-left: 16rpx;
+}
+
+.sj-order-nav {
+ display: flex;
+ flex-wrap: wrap;
+ padding: 8rpx 0 16rpx;
+}
+
+.sj-order-nav-item {
+ width: 25%;
+ padding: 16rpx 0;
+ text-align: center;
+}
+
+.sj-order-nav-num {
+ display: block;
+ font-size: 32rpx;
+ font-weight: 700;
+ color: #222;
+}
+
+.sj-order-nav-lbl {
+ display: block;
+ font-size: 22rpx;
+ color: #999;
+ margin-top: 6rpx;
+}
+
+.sj-func-grid {
+ display: flex;
+ flex-wrap: wrap;
+ padding: 8rpx 0 16rpx;
+}
+
+.sj-func-item {
+ width: 25%;
+ padding: 20rpx 0;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.sj-func-icon {
+ width: 48rpx;
+ height: 48rpx;
+ margin-bottom: 8rpx;
+}
+
+.sj-func-txt {
+ font-size: 24rpx;
+ color: #666;
+ text-align: center;
+}
+
+.sj-scroll-bottom {
+ height: 24rpx;
+}
diff --git a/styles/shangjia-xym-form.wxss b/styles/shangjia-xym-form.wxss
new file mode 100644
index 0000000..0de0015
--- /dev/null
+++ b/styles/shangjia-xym-form.wxss
@@ -0,0 +1,256 @@
+/* 商家发单页 - 逍遥梦 addorder 风格(常规单/自定义单共用) */
+
+.sj-form-page,
+.page.sj-form-theme,
+.page-container.sj-form-theme {
+ min-height: 100vh;
+ padding: 24rpx;
+ padding-bottom: 160rpx;
+ box-sizing: border-box;
+ background: linear-gradient(180deg, #f7dc51 0%, #f5f5f5 18%, #f5f5f5 100%);
+}
+
+.sj-form-theme .balance-card {
+ background: #fef6d4 !important;
+ border-radius: 26rpx !important;
+ padding: 28rpx 24rpx !important;
+ margin-bottom: 20rpx !important;
+ text-align: center !important;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06) !important;
+ border: none !important;
+ backdrop-filter: none !important;
+ position: relative !important;
+ overflow: visible !important;
+}
+
+.sj-form-theme .balance-card::before {
+ display: none !important;
+}
+
+.sj-form-theme .balance-label {
+ font-size: 26rpx !important;
+ color: #666 !important;
+}
+
+.sj-form-theme .balance-value,
+.sj-form-theme .amount-value {
+ font-size: 48rpx !important;
+ font-weight: 700 !important;
+ color: #222 !important;
+ text-shadow: none !important;
+ animation: none !important;
+}
+
+.sj-form-theme .balance-unit,
+.sj-form-theme .amount-unit {
+ font-size: 28rpx !important;
+ color: #666 !important;
+}
+
+.sj-form-theme .balance-tip {
+ font-size: 22rpx !important;
+ color: #999 !important;
+}
+
+.sj-form-theme .balance-row,
+.sj-form-theme .balance-amount {
+ justify-content: center !important;
+}
+
+.sj-form-theme .card,
+.sj-form-theme .section {
+ background: #fdfcfa !important;
+ border-radius: 20rpx !important;
+ padding: 24rpx !important;
+ margin-bottom: 20rpx !important;
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06) !important;
+ border: none !important;
+}
+
+.sj-form-theme .card-header,
+.sj-form-theme .section-title {
+ margin-bottom: 16rpx !important;
+ padding-left: 0 !important;
+ border-left: none !important;
+ text-shadow: none !important;
+}
+
+.sj-form-theme .card-dot {
+ background: #ffd061 !important;
+}
+
+.sj-form-theme .card-title,
+.sj-form-theme .section-title {
+ font-size: 30rpx !important;
+ font-weight: 700 !important;
+ color: #222 !important;
+}
+
+.sj-form-theme .type-chip,
+.sj-form-theme .type-item {
+ display: inline-flex !important;
+ align-items: center !important;
+ justify-content: center !important;
+ padding: 12rpx 24rpx !important;
+ margin-right: 16rpx !important;
+ border-radius: 30rpx !important;
+ background: #f5f5f5 !important;
+ border: none !important;
+ font-size: 26rpx !important;
+ color: #666 !important;
+ opacity: 1 !important;
+ transform: none !important;
+ box-shadow: none !important;
+ backdrop-filter: none !important;
+ height: auto !important;
+ min-height: 64rpx !important;
+}
+
+.sj-form-theme .type-chip--active,
+.sj-form-theme .type-active {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3) !important;
+ color: #492f00 !important;
+ font-weight: 700 !important;
+ border: none !important;
+ transform: none !important;
+ box-shadow: 0 4rpx 12rpx rgba(255, 208, 97, 0.35) !important;
+}
+
+.sj-form-theme .type-text {
+ color: inherit !important;
+}
+
+.sj-form-theme .field {
+ padding: 20rpx 0 !important;
+ border-bottom: 1rpx dashed #eee !important;
+}
+
+.sj-form-theme .field-label {
+ font-size: 28rpx !important;
+ color: #333 !important;
+}
+
+.sj-form-theme .field-input {
+ font-size: 28rpx !important;
+ color: #333 !important;
+ background: transparent !important;
+}
+
+.sj-form-theme .field-required {
+ color: #f00 !important;
+}
+
+.sj-form-theme .field-hint,
+.sj-form-theme .field-optional {
+ color: #999 !important;
+ font-size: 22rpx !important;
+}
+
+.sj-form-theme .field-picker {
+ background: #f5f5f5 !important;
+ border-radius: 12rpx !important;
+ color: #333 !important;
+}
+
+.sj-form-theme .price-prefix {
+ color: #333 !important;
+}
+
+.sj-form-theme .price-input {
+ color: #333 !important;
+}
+
+.sj-form-theme .submit-btn {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3) !important;
+ color: #492f00 !important;
+ border-radius: 44rpx !important;
+ font-weight: 700 !important;
+ box-shadow: 0 6rpx 16rpx rgba(255, 208, 97, 0.35) !important;
+}
+
+.sj-form-theme .submit-bar {
+ background: rgba(255, 255, 255, 0.96) !important;
+ border-top: 1rpx solid #eee !important;
+}
+
+.sj-form-theme switch {
+ color: #ffd061 !important;
+}
+
+.sj-form-theme .search-section {
+ margin-bottom: 20rpx !important;
+}
+
+.sj-form-theme .search-box {
+ background: #fff !important;
+ border: 1rpx solid #eee !important;
+ border-radius: 50rpx !important;
+ box-shadow: none !important;
+}
+
+.sj-form-theme .search-input {
+ color: #333 !important;
+}
+
+.sj-form-theme .search-icon {
+ color: #999 !important;
+}
+
+.sj-form-theme .search-btn {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3) !important;
+ box-shadow: none !important;
+}
+
+.sj-form-theme .search-btn-text {
+ color: #492f00 !important;
+}
+
+.sj-form-theme .filter-row,
+.sj-form-theme .filter-item {
+ color: #666 !important;
+}
+
+.sj-form-theme .filter-input,
+.sj-form-theme .picker-view {
+ background: #f5f5f5 !important;
+ color: #333 !important;
+ border-radius: 8rpx !important;
+}
+
+.sj-form-theme .template-card {
+ background: #fdfcfa !important;
+ border: 1rpx solid rgba(0, 0, 0, 0.06) !important;
+ border-radius: 20rpx !important;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06) !important;
+}
+
+.sj-form-theme .intro-text,
+.sj-form-theme .template-price-label,
+.sj-form-theme .template-price-value {
+ color: #333 !important;
+}
+
+.sj-form-theme .generate-grid-btn,
+.sj-form-theme .copy-grid-btn,
+.sj-form-theme .action-grid-btn {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3) !important;
+ color: #492f00 !important;
+ border: 2rpx solid #fff !important;
+ box-shadow: none !important;
+}
+
+.sj-form-theme .template-section,
+.sj-form-theme .template-scroll {
+ background: transparent !important;
+}
+
+.sj-form-theme .empty-tip,
+.sj-form-theme .loading-text {
+ color: #999 !important;
+}
+
+.sj-form-theme .tutorial-btn {
+ background: linear-gradient(180deg, #fae04d, #ffc0a3) !important;
+ color: #492f00 !important;
+ box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1) !important;
+}
diff --git a/tab-bar/index.js b/tab-bar/index.js
index 13e52d6..d3e09a0 100644
--- a/tab-bar/index.js
+++ b/tab-bar/index.js
@@ -1,109 +1,110 @@
-// tab-bar/index.js — 三端固定,无身份切换
-const app = getApp();
-import { getTabRole } from '../utils/primary-role.js';
-
-const roleCfg = {
- normal: {
- name: '点单老板',
- tabList: [
- { pagePath: 'pages/index/index', text: '商城', iconPath: '/images/home.png', selectedIconPath: '/images/home.png' },
- { pagePath: 'pages/category/category', text: '分类', iconPath: '/images/category.png', selectedIconPath: '/images/category.png' },
- { pagePath: 'pages/messages/messages', text: '消息', iconPath: '/images/messages.png', selectedIconPath: '/images/messages.png' },
- { pagePath: 'pages/mine/mine', text: '我的', iconPath: '/images/mine.png', selectedIconPath: '/images/mine.png' },
- ],
- },
- dashou: {
- name: '接单员',
- tabList: [
- { pagePath: 'pages/accept-order/accept-order', text: '接单池', iconPath: '/images/order-pool.png', selectedIconPath: '/images/order-pool.png' },
- { pagePath: 'pages/fighter-orders/fighter-orders', text: '订单', iconPath: '/images/orders.png', selectedIconPath: '/images/orders.png' },
- { pagePath: 'pages/messages/messages', text: '消息', iconPath: '/images/messages.png', selectedIconPath: '/images/messages.png' },
- { pagePath: 'pages/fighter/fighter', text: '我的', iconPath: '/images/mine.png', selectedIconPath: '/images/mine.png' },
- ],
- },
- shangjia: {
- name: '商家',
- tabList: [
- { pagePath: 'pages/merchant-orders/merchant-orders', text: '订单', iconPath: '/images/orders.png', selectedIconPath: '/images/orders.png' },
- { pagePath: 'pages/messages/messages', text: '消息', iconPath: '/images/messages.png', selectedIconPath: '/images/messages.png' },
- { pagePath: 'pages/merchant/merchant', text: '我的', iconPath: '/images/mine.png', selectedIconPath: '/images/mine.png' },
- ],
- },
-};
-
-Component({
- data: {
- selectedIndex: 0,
- tabList: [],
- currentRole: 'normal',
- badgeText: '',
- },
-
- lifetimes: {
- attached() {
- this.refresh();
- this._badgeListener = (data) => {
- if (data.badgeText !== undefined) {
- this.setData({ badgeText: data.badgeText });
- }
- };
- this._roleListener = () => this.refresh();
- app.on('tabBarBadgeChanged', this._badgeListener);
- app.on('currentRoleChanged', this._roleListener);
- },
- detached() {
- if (this._badgeListener) app.off('tabBarBadgeChanged', this._badgeListener);
- if (this._roleListener) app.off('currentRoleChanged', this._roleListener);
- },
- },
-
- pageLifetimes: {
- show() {
- this.refresh();
- const globalBadge = app.globalData.messageManager?.tabBarBadgeText || '';
- if (this.data.badgeText !== globalBadge) {
- this.setData({ badgeText: globalBadge });
- }
- this._syncUnreadWithDebounce();
- },
- },
-
- methods: {
- _syncUnreadWithDebounce() {
- if (this._syncTimer) clearTimeout(this._syncTimer);
- this._syncTimer = setTimeout(() => {
- if (app && app.loadConversations) app.loadConversations();
- }, 300);
- },
-
- refresh() {
- const token = wx.getStorageSync('token');
- let role = getTabRole(app);
- if (!token) {
- role = 'normal';
- }
- app.globalData.currentRole = role;
- wx.setStorageSync('currentRole', role);
-
- let cfg = roleCfg[role];
- if (!cfg) {
- cfg = roleCfg.normal;
- role = 'normal';
- }
-
- const list = cfg.tabList.map((v, i) => ({ ...v, index: i }));
- const pages = getCurrentPages();
- const curRoute = pages.length ? pages[pages.length - 1].route : '';
- let idx = list.findIndex((t) => t.pagePath === curRoute);
- if (idx === -1) idx = 0;
- this.setData({ currentRole: role, tabList: list, selectedIndex: idx });
- },
-
- switchTab(e) {
- const path = e.currentTarget.dataset.path;
- const idx = e.currentTarget.dataset.index;
- if (idx === this.data.selectedIndex) return;
- wx.redirectTo({ url: '/' + path });
- },
- },
-});
+// tab-bar/index.js — 三端固定,无身份切换
+const app = getApp();
+import { getTabRole } from '../utils/primary-role.js';
+
+const roleCfg = {
+ normal: {
+ name: '点单老板',
+ tabList: [
+ { pagePath: 'pages/index/index', text: '商城', iconPath: '/images/home.png', selectedIconPath: '/images/home.png' },
+ { pagePath: 'pages/category/category', text: '分类', iconPath: '/images/category.png', selectedIconPath: '/images/category.png' },
+ { pagePath: 'pages/messages/messages', text: '消息', iconPath: '/images/messages.png', selectedIconPath: '/images/messages.png' },
+ { pagePath: 'pages/mine/mine', text: '我的', iconPath: '/images/mine.png', selectedIconPath: '/images/mine.png' },
+ ],
+ },
+ dashou: {
+ name: '接单员',
+ tabList: [
+ { pagePath: 'pages/accept-order/accept-order', text: '接单池', iconPath: '/images/order-pool.png', selectedIconPath: '/images/order-pool.png' },
+ { pagePath: 'pages/fighter-orders/fighter-orders', text: '订单', iconPath: '/images/orders.png', selectedIconPath: '/images/orders.png' },
+ { pagePath: 'pages/messages/messages', text: '消息', iconPath: '/images/messages.png', selectedIconPath: '/images/messages.png' },
+ { pagePath: 'pages/fighter/fighter', text: '我的', iconPath: '/images/mine.png', selectedIconPath: '/images/mine.png' },
+ ],
+ },
+ shangjia: {
+ name: '商家',
+ tabList: [
+ { pagePath: 'pages/merchant-home/merchant-home', text: '首页', iconPath: '/images/home.png', selectedIconPath: '/images/home.png' },
+ { pagePath: 'pages/messages/messages', text: '消息', iconPath: '/images/messages.png', selectedIconPath: '/images/messages.png' },
+ { pagePath: 'pages/merchant-orders/merchant-orders', text: '订单', iconPath: '/images/orders.png', selectedIconPath: '/images/orders.png' },
+ { pagePath: 'pages/merchant/merchant', text: '我的', iconPath: '/images/mine.png', selectedIconPath: '/images/mine.png' },
+ ],
+ },
+};
+
+Component({
+ data: {
+ selectedIndex: 0,
+ tabList: [],
+ currentRole: 'normal',
+ badgeText: '',
+ },
+
+ lifetimes: {
+ attached() {
+ this.refresh();
+ this._badgeListener = (data) => {
+ if (data.badgeText !== undefined) {
+ this.setData({ badgeText: data.badgeText });
+ }
+ };
+ this._roleListener = () => this.refresh();
+ app.on('tabBarBadgeChanged', this._badgeListener);
+ app.on('currentRoleChanged', this._roleListener);
+ },
+ detached() {
+ if (this._badgeListener) app.off('tabBarBadgeChanged', this._badgeListener);
+ if (this._roleListener) app.off('currentRoleChanged', this._roleListener);
+ },
+ },
+
+ pageLifetimes: {
+ show() {
+ this.refresh();
+ const globalBadge = app.globalData.messageManager?.tabBarBadgeText || '';
+ if (this.data.badgeText !== globalBadge) {
+ this.setData({ badgeText: globalBadge });
+ }
+ this._syncUnreadWithDebounce();
+ },
+ },
+
+ methods: {
+ _syncUnreadWithDebounce() {
+ if (this._syncTimer) clearTimeout(this._syncTimer);
+ this._syncTimer = setTimeout(() => {
+ if (app && app.loadConversations) app.loadConversations();
+ }, 300);
+ },
+
+ refresh() {
+ const token = wx.getStorageSync('token');
+ let role = getTabRole(app);
+ if (!token) {
+ role = 'normal';
+ }
+ app.globalData.currentRole = role;
+ wx.setStorageSync('currentRole', role);
+
+ let cfg = roleCfg[role];
+ if (!cfg) {
+ cfg = roleCfg.normal;
+ role = 'normal';
+ }
+
+ const list = cfg.tabList.map((v, i) => ({ ...v, index: i }));
+ const pages = getCurrentPages();
+ const curRoute = pages.length ? pages[pages.length - 1].route : '';
+ let idx = list.findIndex((t) => t.pagePath === curRoute);
+ if (idx === -1) idx = 0;
+ this.setData({ currentRole: role, tabList: list, selectedIndex: idx });
+ },
+
+ switchTab(e) {
+ const path = e.currentTarget.dataset.path;
+ const idx = e.currentTarget.dataset.index;
+ if (idx === this.data.selectedIndex) return;
+ wx.redirectTo({ url: '/' + path });
+ },
+ },
+});
diff --git a/tab-bar/index.wxml b/tab-bar/index.wxml
index 1dc5ac0..ef4cbe2 100644
--- a/tab-bar/index.wxml
+++ b/tab-bar/index.wxml
@@ -1,24 +1,23 @@
-
-
-
-
-
-
- {{badgeText}}
-
-
- {{item.text}}
-
-
-
-
-
+
+
+
+
+
+
+ {{badgeText}}
+
+
+ {{item.text}}
+
+
+
+
diff --git a/tab-bar/index.wxss b/tab-bar/index.wxss
index 3c7ae1f..b348446 100644
--- a/tab-bar/index.wxss
+++ b/tab-bar/index.wxss
@@ -1,124 +1,73 @@
-/* tab-bar — 三端固定,全宽 Tab 胶囊 */
+.c-tab-spacer {
+ flex-shrink: 0;
+ width: 100%;
+ height: calc(100rpx + env(safe-area-inset-bottom));
+}
-.tab-bar {
- position: fixed;
+.c-tab-outer {
+ background: #fff;
+ border-top: 1rpx solid #e5e5e5;
bottom: 0;
left: 0;
+ position: fixed;
right: 0;
- z-index: 9999;
- display: flex;
- justify-content: center;
- align-items: flex-end;
+ z-index: 99999;
padding-bottom: env(safe-area-inset-bottom);
- background: transparent;
}
-.bar-row {
- display: flex;
- align-items: center;
- margin-bottom: 15rpx;
- padding: 0 24rpx;
- width: 100%;
+.c-tab-bar {
+ align-items: flex-end;
box-sizing: border-box;
-}
-
-.tab-capsule {
- flex: 1;
display: flex;
- align-items: center;
+ flex-direction: row;
justify-content: space-around;
- height: 100rpx;
- background: #000000;
- border-radius: 50rpx;
- border: 1px solid rgba(255, 255, 255, 0.15);
- box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.8);
- padding: 0 20rpx;
- position: relative;
- overflow: hidden;
+ min-height: 100rpx;
+ padding-top: 8rpx;
}
-.tab-capsule::before {
- content: '';
- position: absolute;
- top: 0;
- left: -100%;
- width: 60%;
- height: 100%;
- background: linear-gradient(
- 90deg,
- transparent 0%,
- rgba(255, 255, 255, 0.15) 20%,
- rgba(255, 255, 255, 0.22) 50%,
- rgba(255, 255, 255, 0.15) 80%,
- transparent 100%
- );
- animation: shine 8s infinite;
- z-index: 1;
-}
-
-@keyframes shine {
- 0% { left: -60%; }
- 15% { left: 100%; }
- 100% { left: 100%; }
-}
-
-.tab-item {
- position: relative;
- z-index: 2;
- display: flex;
- flex-direction: column;
+.c-tab-item {
align-items: center;
- justify-content: center;
- min-width: 70rpx;
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ justify-content: flex-end;
+ padding-bottom: 4rpx;
+ position: relative;
}
-.tab-icon {
- width: 44rpx;
- height: 44rpx;
- margin-bottom: 4rpx;
- filter: brightness(0) invert(1);
- opacity: 0.9;
+.c-tab-ico {
+ height: 48rpx;
+ width: 48rpx;
}
-.tab-text {
+.c-tab-txt {
+ color: #999;
font-size: 20rpx;
- color: #aaa;
+ margin-top: 4rpx;
+}
+
+.c-tab-txt-on {
+ color: #ffd061;
+ font-weight: 600;
+}
+
+.c-tab-dot {
+ align-items: center;
+ background: #fa3534;
+ border-radius: 16rpx;
+ display: flex;
+ height: 32rpx;
+ justify-content: center;
+ min-width: 32rpx;
+ padding: 0 6rpx;
+ position: absolute;
+ right: 18%;
+ top: 0;
z-index: 2;
}
-.active .tab-icon {
- opacity: 1;
- filter: brightness(0) invert(1) drop-shadow(0 0 8rpx #00aaff);
-}
-
-.active .tab-text {
- color: #00aaff;
- font-weight: 500;
-}
-
-.badge-container {
- position: absolute;
- top: -10rpx;
- right: -15rpx;
- z-index: 100;
- pointer-events: none;
-}
-
-.tab-badge {
- min-width: 36rpx;
- height: 36rpx;
- line-height: 36rpx;
- padding: 0 10rpx;
- background: #ff3b30;
+.c-tab-dot-t {
color: #fff;
- font-size: 22rpx;
- font-weight: bold;
- border-radius: 36rpx;
- text-align: center;
- box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3);
- border: 1rpx solid rgba(255, 255, 255, 0.4);
-}
-
-page {
- padding-bottom: 100rpx;
+ font-size: 20rpx;
+ line-height: 1;
}
diff --git a/utils/primary-role.js b/utils/primary-role.js
index 29005ba..fa13257 100644
--- a/utils/primary-role.js
+++ b/utils/primary-role.js
@@ -1,105 +1,105 @@
-/** 三端固定:normal | dashou | shangjia,认证后不可回退 */
-
-const VALID = ['normal', 'dashou', 'shangjia'];
-const LEGACY_CENTER_ROLES = ['guanshi', 'zuzhang', 'kaoheguan'];
-
-/** 旧版管事/组长/考核官主端标识 → 统一回落打手 Tab */
-export function migrateLegacyCenterRole(app) {
- app = app || getApp();
- const cur = wx.getStorageSync('currentRole') || app.globalData.currentRole || '';
- const pri = wx.getStorageSync('primaryRole') || '';
- const isLegacy = LEGACY_CENTER_ROLES.includes(cur) || LEGACY_CENTER_ROLES.includes(pri);
- if (!isLegacy) return false;
-
- const hasDashouSide =
- isRoleStatusActive(wx.getStorageSync('dashoustatus'))
- || isRoleStatusActive(wx.getStorageSync('guanshistatus'))
- || isRoleStatusActive(wx.getStorageSync('zuzhangstatus'))
- || isRoleStatusActive(wx.getStorageSync('kaoheguanstatus'));
-
- if (hasDashouSide) {
- lockPrimaryRole('dashou', app);
- return true;
- }
- return false;
-}
-
-export function isRoleStatusActive(status) {
- return Number(status) === 1;
-}
-
-/** 读取主端(兼容旧 currentRole / 管事组长落地页) */
-export function getPrimaryRole(app) {
- app = app || getApp();
- const stored = wx.getStorageSync('primaryRole');
- if (VALID.includes(stored)) {
- return stored;
- }
- const legacy = wx.getStorageSync('currentRole') || app.globalData.currentRole || 'normal';
- if (legacy === 'dashou' || legacy === 'shangjia') {
- return legacy;
- }
- if (legacy === 'guanshi' || legacy === 'zuzhang' || legacy === 'kaoheguan') {
- if (isRoleStatusActive(wx.getStorageSync('dashoustatus'))) {
- return 'dashou';
- }
- if (isRoleStatusActive(wx.getStorageSync('shangjiastatus'))) {
- return 'shangjia';
- }
- }
- if (isRoleStatusActive(wx.getStorageSync('dashoustatus'))) {
- return 'dashou';
- }
- if (isRoleStatusActive(wx.getStorageSync('shangjiastatus'))) {
- return 'shangjia';
- }
- return 'normal';
-}
-
-/** 锁定主端并同步 TabBar 角色 */
-export function lockPrimaryRole(role, app) {
- if (!VALID.includes(role)) return;
- app = app || getApp();
- wx.setStorageSync('primaryRole', role);
- wx.setStorageSync('currentRole', role);
- app.globalData.primaryRole = role;
- app.globalData.currentRole = role;
- if (app.emitEvent) {
- app.emitEvent('currentRoleChanged', { role });
- }
-}
-
-/** TabBar / IM 使用的有效角色(仅三端) */
-export function getTabRole(app) {
- return getPrimaryRole(app);
-}
-
-export function clearPrimaryRole(app) {
- app = app || getApp();
- wx.removeStorageSync('primaryRole');
- lockPrimaryRole('normal', app);
-}
-
-export const PRIMARY_DEFAULT_PAGES = {
- normal: '/pages/mine/mine',
- dashou: '/pages/accept-order/accept-order',
- shangjia: '/pages/merchant-orders/merchant-orders',
-};
-
-/** 锁定主端并跳转到该端默认首页,同时建立 IM 长连接 */
-export function enterLockedRole(role, app) {
- if (!VALID.includes(role) || role === 'normal') return false;
- app = app || getApp();
- lockPrimaryRole(role, app);
- wx.reLaunch({ url: PRIMARY_DEFAULT_PAGES[role] });
- setTimeout(() => {
- if (app.switchRoleAndReconnect) {
- app.switchRoleAndReconnect(role).catch(() => {
- if (app.connectForCurrentRole) app.connectForCurrentRole();
- });
- } else if (app.connectForCurrentRole) {
- app.connectForCurrentRole();
- }
- }, 600);
- return true;
-}
+/** 三端固定:normal | dashou | shangjia,认证后不可回退 */
+
+const VALID = ['normal', 'dashou', 'shangjia'];
+const LEGACY_CENTER_ROLES = ['guanshi', 'zuzhang', 'kaoheguan'];
+
+/** 旧版管事/组长/考核官主端标识 → 统一回落打手 Tab */
+export function migrateLegacyCenterRole(app) {
+ app = app || getApp();
+ const cur = wx.getStorageSync('currentRole') || app.globalData.currentRole || '';
+ const pri = wx.getStorageSync('primaryRole') || '';
+ const isLegacy = LEGACY_CENTER_ROLES.includes(cur) || LEGACY_CENTER_ROLES.includes(pri);
+ if (!isLegacy) return false;
+
+ const hasDashouSide =
+ isRoleStatusActive(wx.getStorageSync('dashoustatus'))
+ || isRoleStatusActive(wx.getStorageSync('guanshistatus'))
+ || isRoleStatusActive(wx.getStorageSync('zuzhangstatus'))
+ || isRoleStatusActive(wx.getStorageSync('kaoheguanstatus'));
+
+ if (hasDashouSide) {
+ lockPrimaryRole('dashou', app);
+ return true;
+ }
+ return false;
+}
+
+export function isRoleStatusActive(status) {
+ return Number(status) === 1;
+}
+
+/** 读取主端(兼容旧 currentRole / 管事组长落地页) */
+export function getPrimaryRole(app) {
+ app = app || getApp();
+ const stored = wx.getStorageSync('primaryRole');
+ if (VALID.includes(stored)) {
+ return stored;
+ }
+ const legacy = wx.getStorageSync('currentRole') || app.globalData.currentRole || 'normal';
+ if (legacy === 'dashou' || legacy === 'shangjia') {
+ return legacy;
+ }
+ if (legacy === 'guanshi' || legacy === 'zuzhang' || legacy === 'kaoheguan') {
+ if (isRoleStatusActive(wx.getStorageSync('dashoustatus'))) {
+ return 'dashou';
+ }
+ if (isRoleStatusActive(wx.getStorageSync('shangjiastatus'))) {
+ return 'shangjia';
+ }
+ }
+ if (isRoleStatusActive(wx.getStorageSync('dashoustatus'))) {
+ return 'dashou';
+ }
+ if (isRoleStatusActive(wx.getStorageSync('shangjiastatus'))) {
+ return 'shangjia';
+ }
+ return 'normal';
+}
+
+/** 锁定主端并同步 TabBar 角色 */
+export function lockPrimaryRole(role, app) {
+ if (!VALID.includes(role)) return;
+ app = app || getApp();
+ wx.setStorageSync('primaryRole', role);
+ wx.setStorageSync('currentRole', role);
+ app.globalData.primaryRole = role;
+ app.globalData.currentRole = role;
+ if (app.emitEvent) {
+ app.emitEvent('currentRoleChanged', { role });
+ }
+}
+
+/** TabBar / IM 使用的有效角色(仅三端) */
+export function getTabRole(app) {
+ return getPrimaryRole(app);
+}
+
+export function clearPrimaryRole(app) {
+ app = app || getApp();
+ wx.removeStorageSync('primaryRole');
+ lockPrimaryRole('normal', app);
+}
+
+export const PRIMARY_DEFAULT_PAGES = {
+ normal: '/pages/mine/mine',
+ dashou: '/pages/accept-order/accept-order',
+ shangjia: '/pages/merchant-home/merchant-home',
+};
+
+/** 锁定主端并跳转到该端默认首页,同时建立 IM 长连接 */
+export function enterLockedRole(role, app) {
+ if (!VALID.includes(role) || role === 'normal') return false;
+ app = app || getApp();
+ lockPrimaryRole(role, app);
+ wx.reLaunch({ url: PRIMARY_DEFAULT_PAGES[role] });
+ setTimeout(() => {
+ if (app.switchRoleAndReconnect) {
+ app.switchRoleAndReconnect(role).catch(() => {
+ if (app.connectForCurrentRole) app.connectForCurrentRole();
+ });
+ } else if (app.connectForCurrentRole) {
+ app.connectForCurrentRole();
+ }
+ }, 600);
+ return true;
+}