diff --git a/app.json b/app.json
index 8aef6eb..f6a20d4 100644
--- a/app.json
+++ b/app.json
@@ -218,6 +218,15 @@
"components/fakuan-pay/fakuan-pay"
]
},
+ {
+ "root": "pages/gongdan",
+ "pages": [
+ "create/create",
+ "list/list",
+ "detail/detail",
+ "chongzhi-list/chongzhi-list"
+ ]
+ },
{
"root": "pages/phone-auth",
"pages": ["phone-auth"]
@@ -257,7 +266,7 @@
"navigationStyle": "default",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
- "navigationBarTitleText": "星阙网络"
+ "navigationBarTitleText": "龙先生电竞"
},
"tabBar": {
"custom": true,
diff --git a/components/tousu-float/tousu-float.js b/components/tousu-float/tousu-float.js
new file mode 100644
index 0000000..0ba4514
--- /dev/null
+++ b/components/tousu-float/tousu-float.js
@@ -0,0 +1,58 @@
+const STORAGE_KEY = 'tousuFloatHidden';
+
+Component({
+ data: {
+ hidden: false,
+ },
+
+ lifetimes: {
+ attached() {
+ this._syncHidden();
+ },
+ },
+
+ pageLifetimes: {
+ show() {
+ this._syncHidden();
+ },
+ },
+
+ methods: {
+ _syncHidden() {
+ let hidden = false;
+ try {
+ hidden = wx.getStorageSync(STORAGE_KEY) === 1 || wx.getStorageSync(STORAGE_KEY) === '1';
+ } catch (e) {}
+ if (hidden !== this.data.hidden) {
+ this.setData({ hidden });
+ }
+ },
+
+ go() {
+ wx.navigateTo({
+ url: '/pages/gongdan/create/create',
+ fail: (err) => {
+ console.error('打开投诉页失败', err);
+ wx.showToast({ title: '打开失败,请重试', icon: 'none' });
+ },
+ });
+ },
+
+ onDismiss(e) {
+ if (e && e.stopPropagation) e.stopPropagation();
+ wx.showModal({
+ title: '隐藏投诉入口',
+ content: '隐藏后可在「我的 / 工单」中继续投诉。需要恢复时可清除小程序缓存。',
+ confirmText: '不再显示',
+ cancelText: '取消',
+ success: (res) => {
+ if (!res.confirm) return;
+ try {
+ wx.setStorageSync(STORAGE_KEY, 1);
+ } catch (err) {}
+ this.setData({ hidden: true });
+ },
+ });
+ },
+ },
+});
diff --git a/components/tousu-float/tousu-float.json b/components/tousu-float/tousu-float.json
new file mode 100644
index 0000000..d80dd20
--- /dev/null
+++ b/components/tousu-float/tousu-float.json
@@ -0,0 +1 @@
+{"component":true}
diff --git a/components/tousu-float/tousu-float.wxml b/components/tousu-float/tousu-float.wxml
new file mode 100644
index 0000000..c0f25ca
--- /dev/null
+++ b/components/tousu-float/tousu-float.wxml
@@ -0,0 +1,6 @@
+
+ 投诉
+
+ 不再显示
+
+
diff --git a/components/tousu-float/tousu-float.wxss b/components/tousu-float/tousu-float.wxss
new file mode 100644
index 0000000..5bcc81b
--- /dev/null
+++ b/components/tousu-float/tousu-float.wxss
@@ -0,0 +1,37 @@
+.tousu-wrap {
+ position: fixed;
+ right: 24rpx;
+ bottom: 280rpx;
+ z-index: 999;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ gap: 6rpx;
+}
+
+.float {
+ min-width: 96rpx;
+ height: 72rpx;
+ padding: 0 22rpx;
+ border-radius: 36rpx;
+ background: rgba(55, 55, 55, 0.72);
+ color: #f5f5f5;
+ font-size: 26rpx;
+ font-weight: 500;
+ letter-spacing: 1rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.12);
+}
+
+.dismiss-row {
+ padding: 4rpx 8rpx;
+}
+
+.dismiss-label {
+ font-size: 20rpx;
+ color: rgba(120, 120, 120, 0.9);
+ text-decoration: underline;
+ text-underline-offset: 4rpx;
+}
diff --git a/config/club-config.js b/config/club-config.js
index 3343581..20772b1 100644
--- a/config/club-config.js
+++ b/config/club-config.js
@@ -1,11 +1,11 @@
/**
* 小程序所属俱乐部配置 — 每个小程序工程编译前改这里即可。
- * 星阙 = xq;星之界 = xzj;与 club 表 club_id 一致。
+ * 星阙 = xq;星之界 = xzj;龙先生 = lxs(与后台 club 表 club_id 一致,勿写成 lsx)。
* 不要依赖后端猜测:前端必须明确所属 club。
*/
-export const CLUB_ID = 'xzj';
+export const CLUB_ID = 'lxs';
/** 与 club 表 wx_appid 一致,登录时可传给后端反查 club */
-export const WX_APP_ID = 'wxdefa454152e78a03';
+export const WX_APP_ID = 'wx7ff90e9d024fcdb8';
-export const CLUB_NAME = '星之界电竞';
+export const CLUB_NAME = '龙先生电竞';
diff --git a/pages/accept-order/accept-order.js b/pages/accept-order/accept-order.js
index ca6d6fd..f3c6e84 100644
--- a/pages/accept-order/accept-order.js
+++ b/pages/accept-order/accept-order.js
@@ -884,6 +884,10 @@ Page({
noop() {},
+ goToComplaintCreate() {
+ wx.navigateTo({ url: '/pages/gongdan/create/create' });
+ },
+
onReachBottom() {
if (this.data.isLoading || this.data.isLoadingMore) return;
if (this.data.hasMore && !this.data.isLoading && this.data.xuanzhongLeixingId) {
diff --git a/pages/accept-order/accept-order.wxml b/pages/accept-order/accept-order.wxml
index 5dfa720..9531fdc 100644
--- a/pages/accept-order/accept-order.wxml
+++ b/pages/accept-order/accept-order.wxml
@@ -39,6 +39,12 @@
+
+ 投诉 / 反馈
+ 点这里提交工单
+ ›
+
+
{{gonggao}}
diff --git a/pages/accept-order/accept-order.wxss b/pages/accept-order/accept-order.wxss
index 8ebdb0a..45675ae 100644
--- a/pages/accept-order/accept-order.wxss
+++ b/pages/accept-order/accept-order.wxss
@@ -14,6 +14,34 @@ page {
overflow: hidden;
position: relative;
}
+
+.tousu-top-bar {
+ display: flex;
+ align-items: center;
+ gap: 12rpx;
+ margin: 16rpx 24rpx 8rpx;
+ padding: 18rpx 24rpx;
+ border-radius: 14rpx;
+ background: linear-gradient(90deg, #e85a3a 0%, #f07858 100%);
+ box-shadow: 0 6rpx 18rpx rgba(232, 90, 58, 0.28);
+ z-index: 5;
+ position: relative;
+}
+.tousu-top-bar-txt {
+ color: #fff;
+ font-size: 28rpx;
+ font-weight: 600;
+}
+.tousu-top-bar-sub {
+ flex: 1;
+ color: rgba(255,255,255,0.88);
+ font-size: 22rpx;
+}
+.tousu-top-bar-arrow {
+ color: #fff;
+ font-size: 36rpx;
+ line-height: 1;
+}
/* 背景动态纹理,增加层次感 */
.qiangdan-page::before {
diff --git a/pages/fighter-recharge/fighter-deposit.js b/pages/fighter-recharge/fighter-deposit.js
index d6fdce4..b562131 100644
--- a/pages/fighter-recharge/fighter-deposit.js
+++ b/pages/fighter-recharge/fighter-deposit.js
@@ -31,6 +31,9 @@ Page({
yajinActive: false,
depositRules: DEFAULT_RULES,
depositBenefits: DEFAULT_BENEFITS,
+ rulesTitle: '履约金规则',
+ benefitsTitle: '平台履约金权益',
+ pageCopy: null,
agreed: false,
payAmountLabel: '',
yajinAmount: '100',
@@ -52,6 +55,7 @@ Page({
this._jumpParams = options || {};
this.initImages();
this.loadUserInfo();
+ this.fetchPageCopy();
},
onHide() {
@@ -64,6 +68,9 @@ Page({
this.registerNotification();
this.loadYajin();
this.refreshConfiguredIcons();
+ if (!this.data.pageCopy) {
+ this.fetchPageCopy();
+ }
PopupService.checkAndShow(this, 'dashouchongzhi');
const preset = this._jumpParams?.presetAmount || this._jumpParams?.requiredYajin;
if (preset && parseFloat(preset) > 0) {
@@ -81,6 +88,73 @@ Page({
}
},
+ resolveOssUrl(path) {
+ if (!path) return '';
+ if (path.startsWith('http')) return path;
+ return (app.globalData.ossImageUrl || '') + path;
+ },
+
+ async fetchPageCopy() {
+ try {
+ const res = await request({
+ url: '/jituan/recharge-page-copy',
+ method: 'POST',
+ data: { page_key: 'yajin' },
+ });
+ if (res.data && res.data.code === 0 && res.data.data) {
+ this.setData({ pageCopy: res.data.data.regions || {} });
+ } else {
+ this.setData({ pageCopy: {} });
+ }
+ } catch (e) {
+ console.warn('fetchPageCopy failed', e);
+ this.setData({ pageCopy: {} });
+ }
+ this.applyPageCopy();
+ },
+
+ applyPageCopy() {
+ const copy = this.data.pageCopy || {};
+ const patch = {};
+
+ const rulesRegion = copy.rules;
+ if (rulesRegion && Array.isArray(rulesRegion.items) && rulesRegion.items.length > 0) {
+ patch.depositRules = rulesRegion.items
+ .map((it) => (typeof it === 'string' ? it : (it && it.text) || ''))
+ .filter(Boolean);
+ if (rulesRegion.title) patch.rulesTitle = rulesRegion.title;
+ } else {
+ patch.depositRules = DEFAULT_RULES;
+ patch.rulesTitle = '履约金规则';
+ }
+
+ const benefitsRegion = copy.benefits;
+ const fb = (key) => `${ICON_FOLDER}/${key}.png`;
+ if (benefitsRegion && Array.isArray(benefitsRegion.items) && benefitsRegion.items.length > 0) {
+ patch.depositBenefits = benefitsRegion.items.map((item, i) => {
+ const fallback = DEFAULT_BENEFITS[i];
+ const iconUrl = item.icon_url
+ ? this.resolveOssUrl(item.icon_url)
+ : (fallback
+ ? resolveMiniappIcon(app, fallback.key, fb(fallback.key))
+ : '');
+ return {
+ label: item.label || item.title || '',
+ iconUrl,
+ };
+ });
+ if (benefitsRegion.title) patch.benefitsTitle = benefitsRegion.title;
+ } else {
+ patch.depositBenefits = DEFAULT_BENEFITS.map((item) => ({
+ label: item.label,
+ iconUrl: resolveMiniappIcon(app, item.key, fb(item.key)),
+ }));
+ patch.benefitsTitle = '平台履约金权益';
+ }
+
+ this.setData(patch);
+ },
+
initImages() {
const fb = (key) => `${ICON_FOLDER}/${key}.png`;
const depositBenefits = DEFAULT_BENEFITS.map((item) => ({
@@ -94,6 +168,9 @@ Page({
},
depositBenefits,
});
+ if (this.data.pageCopy) {
+ this.applyPageCopy();
+ }
},
async refreshConfiguredIcons() {
diff --git a/pages/fighter-recharge/fighter-deposit.wxml b/pages/fighter-recharge/fighter-deposit.wxml
index f000291..fdc8741 100644
--- a/pages/fighter-recharge/fighter-deposit.wxml
+++ b/pages/fighter-recharge/fighter-deposit.wxml
@@ -31,7 +31,7 @@
- 履约金规则
+ {{rulesTitle || '履约金规则'}}
{{index + 1}}.
@@ -41,7 +41,7 @@
- 平台履约金权益
+ {{benefitsTitle || '平台履约金权益'}}
diff --git a/pages/fighter-recharge/fighter-recharge.js b/pages/fighter-recharge/fighter-recharge.js
index 288a857..0c864fb 100644
--- a/pages/fighter-recharge/fighter-recharge.js
+++ b/pages/fighter-recharge/fighter-recharge.js
@@ -34,6 +34,10 @@ Page({
loadingText: '支付中...',
currentDingdanid: '',
detailRules: [],
+ rulesTitle: '',
+ benefitsTitle: '',
+ advantagesTitle: '平台优势',
+ pageCopy: null,
jumpParams: {},
showPayMethodModal: false,
currentBuyType: null,
@@ -100,9 +104,28 @@ onHide() {
// ========== 初始化页面 ==========
async initPage() {
this.loadFromGlobalData();
+ await this.fetchPageCopy();
await this.fetchHuiyuanList();
},
+ async fetchPageCopy() {
+ try {
+ const res = await request({
+ url: '/jituan/recharge-page-copy',
+ method: 'POST',
+ data: { page_key: 'huiyuan' },
+ });
+ if (res.data && res.data.code === 0 && res.data.data) {
+ this.setData({ pageCopy: res.data.data.regions || {} });
+ } else {
+ this.setData({ pageCopy: {} });
+ }
+ } catch (e) {
+ console.warn('fetchPageCopy failed', e);
+ this.setData({ pageCopy: {} });
+ }
+ },
+
initImages() {
this.setData({
imgUrls: {
@@ -133,6 +156,25 @@ onHide() {
buildPlatformAdvantages() {
const fb = (name) => `${ICON_FOLDER}/${name}.png`;
+ const region = (this.data.pageCopy || {}).advantages;
+ if (region && Array.isArray(region.items) && region.items.length > 0) {
+ return region.items.map((item, i) => {
+ const fallbackKey = [
+ ICON_KEYS.FIGHTER_RECHARGE_ADVANTAGE_1,
+ ICON_KEYS.FIGHTER_RECHARGE_ADVANTAGE_2,
+ ICON_KEYS.FIGHTER_RECHARGE_ADVANTAGE_3,
+ ICON_KEYS.FIGHTER_RECHARGE_ADVANTAGE_4,
+ ][i];
+ const iconUrl = item.icon_url
+ ? this.resolveOssUrl(item.icon_url)
+ : (fallbackKey ? this._icon(fallbackKey, fb(fallbackKey)) : '');
+ return {
+ title: item.title || '',
+ desc: item.desc || '',
+ iconUrl,
+ };
+ });
+ }
const keys = [
ICON_KEYS.FIGHTER_RECHARGE_ADVANTAGE_1,
ICON_KEYS.FIGHTER_RECHARGE_ADVANTAGE_2,
@@ -166,10 +208,31 @@ onHide() {
},
buildMemberBenefits(huiyuan = {}) {
+ const region = (this.data.pageCopy || {}).benefits;
+ const fb = (name) => `${ICON_FOLDER}/${name}.png`;
+ if (region && Array.isArray(region.items) && region.items.length > 0) {
+ const fallbackKeys = [
+ ICON_KEYS.FIGHTER_RECHARGE_BENEFIT_1,
+ ICON_KEYS.FIGHTER_RECHARGE_BENEFIT_2,
+ ICON_KEYS.FIGHTER_RECHARGE_BENEFIT_3,
+ ];
+ return region.items.map((item, i) => {
+ const key = fallbackKeys[i];
+ const iconUrl = item.icon_url
+ ? this.resolveOssUrl(item.icon_url)
+ : (key ? this._icon(key, fb(key)) : '');
+ return {
+ title: item.title || '',
+ desc: item.desc || '',
+ iconUrl,
+ accentColor: item.accent_color || '',
+ accentStyle: item.accent_color ? `color:${item.accent_color}` : '',
+ };
+ });
+ }
const name = huiyuan.mingzi || '会员';
const formalPrice = huiyuan.jiage || '0';
const trialPrice = huiyuan.trial_price || '0';
- const fb = (name) => `${ICON_FOLDER}/${name}.png`;
const meta = [
{
key: ICON_KEYS.FIGHTER_RECHARGE_BENEFIT_1,
@@ -197,11 +260,23 @@ onHide() {
},
applyCurrentHuiyuan(huiyuan, index) {
+ const copy = this.data.pageCopy || {};
+ const name = huiyuan.mingzi || '会员';
+ const rulesTitle = (copy.rules && copy.rules.title)
+ || `${name}规则`;
+ const benefitsTitle = (copy.benefits && copy.benefits.title)
+ || `${name}专属权益`;
+ const advantagesTitle = (copy.advantages && copy.advantages.title)
+ || '平台优势';
this.setData({
currentHuiyuanIndex: index,
currentHuiyuan: huiyuan,
detailRules: this.buildDetailRules(huiyuan),
memberBenefits: this.buildMemberBenefits(huiyuan),
+ platformAdvantages: this.buildPlatformAdvantages(),
+ rulesTitle,
+ benefitsTitle,
+ advantagesTitle,
memberBadge: huiyuan.mingzi || '会员',
});
},
@@ -315,6 +390,13 @@ onHide() {
},
buildDetailRules(huiyuan = {}) {
+ const region = (this.data.pageCopy || {}).rules;
+ if (region && Array.isArray(region.items) && region.items.length > 0) {
+ return region.items
+ .map((it) => (typeof it === 'string' ? it : (it && it.text) || ''))
+ .filter(Boolean)
+ .slice(0, 4);
+ }
const formalDays = huiyuan.formal_days || 30;
const rules = [
`有效期${formalDays}天`,
diff --git a/pages/fighter-recharge/fighter-recharge.wxml b/pages/fighter-recharge/fighter-recharge.wxml
index 642d5d6..ea99552 100644
--- a/pages/fighter-recharge/fighter-recharge.wxml
+++ b/pages/fighter-recharge/fighter-recharge.wxml
@@ -53,7 +53,7 @@
- {{currentHuiyuan.mingzi || '会员'}}规则
+ {{rulesTitle || ((currentHuiyuan.mingzi || '会员') + '规则')}}
@@ -66,7 +66,7 @@
- {{currentHuiyuan.mingzi || '会员'}}专属权益
+ {{benefitsTitle || ((currentHuiyuan.mingzi || '会员') + '专属权益')}}
@@ -74,13 +74,13 @@
{{item.title}}
- {{item.desc}}
+ {{item.desc}}
- 平台优势
+ {{advantagesTitle || '平台优势'}}
diff --git a/pages/fighter/fighter.js b/pages/fighter/fighter.js
index eceb432..3bd62d5 100644
--- a/pages/fighter/fighter.js
+++ b/pages/fighter/fighter.js
@@ -126,6 +126,7 @@ Page(createPage({
iconKaoheZhongxin: icon(ICON_KEYS.FIGHTER_MINE_KAOHE_ZHONGXIN, 'beijing/kaohe/zhongxin.png'),
iconShangjia: icon(ICON_KEYS.FIGHTER_MINE_SHANGJIA, 'beijing/tubiao/grzx_shangjia.jpg'),
iconDashouAuth: icon(ICON_KEYS.FIGHTER_MINE_DASHOU_AUTH, 'beijing/tubiao/grzx_dashou.jpg'),
+ iconComplaint: icon(ICON_KEYS.FIGHTER_COMPLAINT_RECORD, 'beijing/guanshiduan/icon-contact.png'),
iconClear: icon(ICON_KEYS.FIGHTER_MINE_CLEAR, 'beijing/tubiao/grzx_qingchu.jpg'),
iconSwitch: icon(ICON_KEYS.FIGHTER_MINE_SWITCH, `${ICON_FOLDER}/fighter_mine_switch.png`),
iconRecord: icon(ICON_KEYS.FIGHTER_MINE_RECORD, 'beijing/guanshiduan/icon-record.png'),
@@ -329,7 +330,12 @@ Page(createPage({
push('contactZuzhang', '联系组长', img.iconContact);
}
push('goToKefu', '在线客服', img.iconKefu);
- push('onTapShangjiaAuth', d.shangjiaCertified ? '进入商家端' : '商家认证', img.iconShangjia);
+ push('goToComplaintCreate', '投诉反馈', img.iconComplaint || img.iconContact);
+ push('goToComplaintList', '投诉记录', img.iconComplaint || img.iconRecord);
+ // 龙先生:不提供前端商家认证,仅已开通时进入商家端
+ if (d.shangjiaCertified) {
+ push('onTapShangjiaAuth', '进入商家端', img.iconShangjia);
+ }
push('onTapStaffAuth', isStaffMode() ? '商家客服工作台' : '商家客服入驻', img.iconKefu || img.iconShangjia);
if (d.showPindaoEntry) {
push('openPindaoModal', '频道', img.iconPindao);
@@ -1166,7 +1172,7 @@ Page(createPage({
enterShangjiaCenter() {
if (!this.data.shangjiaCertified) {
- wx.navigateTo({ url: '/pages/verify/verify?type=shangjia' });
+ wx.showToast({ title: '请联系客服开通商家', icon: 'none' });
return;
}
enterLockedRole('shangjia', getApp());
@@ -1177,10 +1183,13 @@ Page(createPage({
this.enterShangjiaCenter();
return;
}
- wx.navigateTo({ url: '/pages/verify/verify?type=shangjia' });
+ wx.showToast({ title: '请联系客服开通商家', icon: 'none' });
},
goToReceiveOrder() { wx.switchTab({ url: '/pages/accept-order/accept-order' }) },
+ goToComplaintList() { wx.navigateTo({ url: '/pages/gongdan/list/list' }) },
+ goToComplaintCreate() { wx.navigateTo({ url: '/pages/gongdan/create/create' }) },
+
async loadMyZhidingOrders() {
if (!isCenterPageActive(this, 'isDashou', 'dashoustatus')) return;
try {
diff --git a/pages/fighter/fighter.json b/pages/fighter/fighter.json
index a31615c..04d6a90 100644
--- a/pages/fighter/fighter.json
+++ b/pages/fighter/fighter.json
@@ -3,7 +3,8 @@
"global-notification": "/components/global-notification/global-notification",
"chenghao-tag": "/components/chenghao-tag/chenghao-tag",
"tab-bar": "/tab-bar/index",
- "pindao-modal": "/components/pindao-modal/pindao-modal"
+ "pindao-modal": "/components/pindao-modal/pindao-modal",
+ "tousu-float": "/components/tousu-float/tousu-float"
},
"navigationStyle": "custom",
"backgroundColor": "#fff8e1",
diff --git a/pages/fighter/fighter.wxml b/pages/fighter/fighter.wxml
index 32e9115..22a7684 100644
--- a/pages/fighter/fighter.wxml
+++ b/pages/fighter/fighter.wxml
@@ -18,6 +18,7 @@
+
@@ -27,6 +28,7 @@
@@ -194,12 +196,13 @@
-
+
关注快手
+
diff --git a/pages/fighter/fighter.wxss b/pages/fighter/fighter.wxss
index 94bd2ed..ebff2bf 100644
--- a/pages/fighter/fighter.wxss
+++ b/pages/fighter/fighter.wxss
@@ -28,6 +28,24 @@ page {
background: linear-gradient(180deg, #f7dc51 0%, #ffd061 100%);
}
+.nav-tousu {
+ position: absolute;
+ left: 24rpx;
+ top: 50%;
+ transform: translateY(-50%);
+ min-width: 88rpx;
+ height: 48rpx;
+ line-height: 48rpx;
+ text-align: center;
+ padding: 0 16rpx;
+ border-radius: 24rpx;
+ background: rgba(55, 55, 55, 0.55);
+ color: #f5f5f5;
+ font-size: 22rpx;
+ font-weight: 500;
+ z-index: 5;
+}
+
.status-bar,
.nav-bar,
.content,
diff --git a/pages/gongdan/chongzhi-list/chongzhi-list.js b/pages/gongdan/chongzhi-list/chongzhi-list.js
new file mode 100644
index 0000000..316a4e6
--- /dev/null
+++ b/pages/gongdan/chongzhi-list/chongzhi-list.js
@@ -0,0 +1,27 @@
+import request from '../../../utils/request.js'
+
+Page({
+ data: { list: [], loading: false, page: 1 },
+ onShow() { this.load(true) },
+ copy(e) { wx.setClipboardData({ data: String(e.currentTarget.dataset.t || '') }) },
+ complain(e) {
+ const id = e.currentTarget.dataset.id
+ wx.navigateTo({ url: `/pages/gongdan/create/create?leixing=2&chongzhi_id=${encodeURIComponent(id)}` })
+ },
+ async load(reset) {
+ if (this.data.loading) return
+ this.setData({ loading: true })
+ try {
+ const page = reset ? 1 : this.data.page
+ const res = await request({ url: '/gongdan/chongzhi-list/', method: 'POST', data: { page, page_size: 20 } })
+ const body = res.data || {}
+ if (body.code === 200 || body.code === 0) {
+ const rows = (body.data && body.data.list) || []
+ this.setData({ list: reset ? rows : this.data.list.concat(rows), page: page + 1 })
+ }
+ } finally {
+ this.setData({ loading: false })
+ }
+ },
+ onReachBottom() { this.load(false) },
+})
diff --git a/pages/gongdan/chongzhi-list/chongzhi-list.json b/pages/gongdan/chongzhi-list/chongzhi-list.json
new file mode 100644
index 0000000..667d0a5
--- /dev/null
+++ b/pages/gongdan/chongzhi-list/chongzhi-list.json
@@ -0,0 +1 @@
+{"navigationBarTitleText":"充值记录","usingComponents":{}}
diff --git a/pages/gongdan/chongzhi-list/chongzhi-list.wxml b/pages/gongdan/chongzhi-list/chongzhi-list.wxml
new file mode 100644
index 0000000..1705336
--- /dev/null
+++ b/pages/gongdan/chongzhi-list/chongzhi-list.wxml
@@ -0,0 +1,13 @@
+
+ 暂无充值记录
+
+
+ {{item.leixing_label}}
+ {{item.zhuangtai_label}}
+
+ ¥{{item.jine}}
+ 充值ID:{{item.dingdan_id}}(点复制)
+ {{item.CreateTime}}
+ 投诉此笔充值
+
+
diff --git a/pages/gongdan/chongzhi-list/chongzhi-list.wxss b/pages/gongdan/chongzhi-list/chongzhi-list.wxss
new file mode 100644
index 0000000..d77a9ad
--- /dev/null
+++ b/pages/gongdan/chongzhi-list/chongzhi-list.wxss
@@ -0,0 +1,9 @@
+.page{padding:24rpx;background:#f5f6f8;min-height:100vh}
+.empty{text-align:center;color:#999;padding:80rpx}
+.card{background:#fff;border-radius:16rpx;padding:24rpx;margin-bottom:16rpx}
+.row{display:flex;justify-content:space-between}
+.t{font-size:30rpx;font-weight:600}
+.s{font-size:22rpx;color:#856404}
+.amt{font-size:36rpx;margin-top:8rpx;color:#111}
+.id,.time{font-size:22rpx;color:#888;margin-top:8rpx}
+.act{margin-top:16rpx;color:#2b6de5;font-size:26rpx}
diff --git a/pages/gongdan/create/create.js b/pages/gongdan/create/create.js
new file mode 100644
index 0000000..4554425
--- /dev/null
+++ b/pages/gongdan/create/create.js
@@ -0,0 +1,154 @@
+import request from '../../../utils/request.js'
+import { openCustomerServiceChat } from '../../../utils/kefu-nav.js'
+
+const TYPES = [
+ { value: 1, label: '订单投诉' },
+ { value: 2, label: '充值投诉' },
+ { value: 3, label: '罚款投诉' },
+ { value: 4, label: '管事投诉' },
+ { value: 5, label: '被骗投诉' },
+]
+
+Page({
+ data: {
+ types: TYPES,
+ leixing: 1,
+ order_id: '',
+ chongzhi_id: '',
+ fadan_id: '',
+ guanshi_id: '',
+ shuoming: '',
+ images: [],
+ maxImages: 9,
+ submitting: false,
+ },
+
+ onLoad(q) {
+ const patch = {}
+ if (q.leixing) patch.leixing = Number(q.leixing) || 1
+ if (q.order_id) patch.order_id = decodeURIComponent(q.order_id)
+ if (q.chongzhi_id) patch.chongzhi_id = decodeURIComponent(q.chongzhi_id)
+ if (q.fadan_id) patch.fadan_id = decodeURIComponent(q.fadan_id)
+ if (Object.keys(patch).length) this.setData(patch)
+ },
+
+ onPickType(e) { this.setData({ leixing: Number(e.currentTarget.dataset.v) }) },
+ onOrderId(e) { this.setData({ order_id: e.detail.value }) },
+ onChongzhiId(e) { this.setData({ chongzhi_id: e.detail.value }) },
+ onFadanId(e) { this.setData({ fadan_id: e.detail.value }) },
+ onGuanshiId(e) { this.setData({ guanshi_id: e.detail.value }) },
+ onShuoming(e) { this.setData({ shuoming: e.detail.value }) },
+
+ openMiniKefu() { openCustomerServiceChat() },
+ openWxKefu() {
+ const app = getApp()
+ const cfg = app.globalData.kefuConfig || {}
+ if (!cfg.link || !cfg.enterpriseId) {
+ wx.showToast({ title: '微信客服未配置', icon: 'none' })
+ return
+ }
+ wx.openCustomerServiceChat({
+ extInfo: { url: cfg.link },
+ corpId: cfg.enterpriseId,
+ fail: () => wx.showToast({ title: '打开微信客服失败', icon: 'none' }),
+ })
+ },
+
+ goChongzhiList() { wx.navigateTo({ url: '/pages/gongdan/chongzhi-list/chongzhi-list' }) },
+ goPenalty() { wx.navigateTo({ url: '/pages/penalty/penalty/penalty' }) },
+ goMyList() { wx.navigateTo({ url: '/pages/gongdan/list/list' }) },
+
+ chooseImg() {
+ const left = this.data.maxImages - this.data.images.length
+ wx.chooseMedia({
+ count: left,
+ mediaType: ['image'],
+ success: async (res) => {
+ wx.showLoading({ title: '上传中' })
+ try {
+ const urls = [...this.data.images]
+ for (const f of res.tempFiles || []) {
+ const url = await this.uploadOne(f.tempFilePath)
+ if (url) urls.push(url)
+ }
+ this.setData({ images: urls.slice(0, this.data.maxImages) })
+ } catch (e) {
+ wx.showToast({ title: '上传失败', icon: 'none' })
+ } finally {
+ wx.hideLoading()
+ }
+ },
+ })
+ },
+
+ uploadOne(filePath) {
+ const app = getApp()
+ const base = (app.globalData.apiBaseUrl || '').replace(/\/$/, '')
+ const token = wx.getStorageSync('token') || ''
+ return new Promise((resolve, reject) => {
+ wx.uploadFile({
+ url: `${base}/gongdan/upload-image/`,
+ filePath,
+ name: 'file',
+ header: { Authorization: token ? `Bearer ${token}` : '' },
+ success: (res) => {
+ try {
+ const body = JSON.parse(res.data || '{}')
+ if ((body.code === 200 || body.code === 0) && body.data && body.data.url) {
+ resolve(body.data.url)
+ } else reject(new Error(body.message || '上传失败'))
+ } catch (e) { reject(e) }
+ },
+ fail: reject,
+ })
+ })
+ },
+
+ delImg(e) {
+ const i = e.currentTarget.dataset.i
+ const images = this.data.images.slice()
+ images.splice(i, 1)
+ this.setData({ images })
+ },
+
+ preview(e) {
+ wx.previewImage({ current: e.currentTarget.dataset.url, urls: this.data.images })
+ },
+
+ async submit() {
+ if (this.data.submitting) return
+ if (!(this.data.shuoming || '').trim()) {
+ wx.showToast({ title: '请填写投诉说明', icon: 'none' })
+ return
+ }
+ this.setData({ submitting: true })
+ try {
+ const res = await request({
+ url: '/gongdan/create/',
+ method: 'POST',
+ data: {
+ leixing: this.data.leixing,
+ shuoming: this.data.shuoming,
+ order_id: this.data.order_id,
+ chongzhi_id: this.data.chongzhi_id,
+ fadan_id: this.data.fadan_id,
+ guanshi_id: this.data.guanshi_id,
+ images: this.data.images,
+ },
+ })
+ const body = res.data || {}
+ if (body.code === 200 || body.code === 0) {
+ wx.showToast({ title: '提交成功', icon: 'success' })
+ setTimeout(() => {
+ wx.redirectTo({ url: '/pages/gongdan/list/list' })
+ }, 500)
+ } else {
+ wx.showToast({ title: body.message || body.msg || '提交失败', icon: 'none' })
+ }
+ } catch (e) {
+ wx.showToast({ title: '网络错误', icon: 'none' })
+ } finally {
+ this.setData({ submitting: false })
+ }
+ },
+})
diff --git a/pages/gongdan/create/create.json b/pages/gongdan/create/create.json
new file mode 100644
index 0000000..57b7adb
--- /dev/null
+++ b/pages/gongdan/create/create.json
@@ -0,0 +1 @@
+{"navigationBarTitleText":"我要投诉","usingComponents":{}}
diff --git a/pages/gongdan/create/create.wxml b/pages/gongdan/create/create.wxml
new file mode 100644
index 0000000..fef6ca9
--- /dev/null
+++ b/pages/gongdan/create/create.wxml
@@ -0,0 +1,57 @@
+
+
+ 小程序客服
+ 微信客服
+
+
+
+ 投诉类型
+
+ {{item.label}}
+
+
+
+
+ 订单ID *
+
+
+
+ 充值记录ID *
+
+ 去充值记录复制 →
+
+
+ 罚单ID *
+
+ 去罚款页查看 →
+
+
+ 管事ID(选填)
+
+
+
+
+ 投诉说明 *
+
+
+
+
+ 证据图片(最多{{maxImages}}张)
+
+
+
+ ×
+
+ +
+
+
+
+
+
+
diff --git a/pages/gongdan/create/create.wxss b/pages/gongdan/create/create.wxss
new file mode 100644
index 0000000..4de91e4
--- /dev/null
+++ b/pages/gongdan/create/create.wxss
@@ -0,0 +1,20 @@
+.page{padding:24rpx 28rpx 80rpx;background:#f5f6f8;min-height:100vh;box-sizing:border-box}
+.cs-bar{display:flex;gap:16rpx;margin-bottom:24rpx}
+.cs-btn{flex:1;text-align:center;padding:20rpx 0;border-radius:12rpx;background:#fff;font-size:28rpx;color:#1a1a1a;border:1rpx solid #e5e5e5}
+.cs-wx{background:#07c160;color:#fff;border-color:#07c160}
+.section{background:#fff;border-radius:16rpx;padding:24rpx;margin-bottom:20rpx}
+.label{font-size:28rpx;color:#333;margin-bottom:16rpx;font-weight:500}
+.req{color:#e54}
+.type-row{display:flex;flex-wrap:wrap;gap:12rpx}
+.type-chip{padding:12rpx 22rpx;border-radius:999rpx;background:#f0f1f3;font-size:24rpx;color:#666}
+.type-chip.on{background:#1a1a1a;color:#fff}
+.input{height:72rpx;background:#f7f8fa;border-radius:10rpx;padding:0 20rpx;font-size:28rpx}
+.textarea{width:100%;min-height:180rpx;background:#f7f8fa;border-radius:10rpx;padding:16rpx 20rpx;font-size:28rpx;box-sizing:border-box}
+.link{margin-top:12rpx;font-size:24rpx;color:#2b6de5}
+.img-row{display:flex;flex-wrap:wrap;gap:16rpx}
+.img-item,.img-add{width:160rpx;height:160rpx;border-radius:12rpx;position:relative;overflow:hidden;background:#f0f1f3}
+.img-item image{width:100%;height:100%}
+.del{position:absolute;right:0;top:0;width:40rpx;height:40rpx;background:rgba(0,0,0,.55);color:#fff;text-align:center;line-height:40rpx;font-size:28rpx}
+.img-add{display:flex;align-items:center;justify-content:center;font-size:64rpx;color:#bbb}
+.submit{margin-top:32rpx;background:#1a1a1a;color:#fff;border-radius:12rpx;font-size:30rpx}
+.foot-link{text-align:center;margin-top:28rpx;color:#666;font-size:26rpx}
diff --git a/pages/gongdan/detail/detail.js b/pages/gongdan/detail/detail.js
new file mode 100644
index 0000000..c9fd6ca
--- /dev/null
+++ b/pages/gongdan/detail/detail.js
@@ -0,0 +1,63 @@
+import request from '../../../utils/request.js'
+
+Page({
+ data: {
+ detail: null,
+ imageList: [],
+ shengjiList: [],
+ escShow: false,
+ escText: '',
+ escLoading: false,
+ id: '',
+ },
+ onLoad(q) {
+ this.setData({ id: q.id || '' })
+ this.load()
+ },
+ async load() {
+ const res = await request({ url: '/gongdan/detail/', method: 'POST', data: { gongdan_id: this.data.id } })
+ const body = res.data || {}
+ if (body.code === 200 || body.code === 0) {
+ const d = body.data || {}
+ this.setData({
+ detail: d,
+ imageList: Array.isArray(d.images) ? d.images : [],
+ shengjiList: Array.isArray(d.shengji_list) ? d.shengji_list : [],
+ })
+ }
+ },
+ copy(e) {
+ wx.setClipboardData({ data: String(e.currentTarget.dataset.t || '') })
+ },
+ preview(e) {
+ const urls = (this.data.imageList || []).map(i => i.url).filter(Boolean)
+ wx.previewImage({ current: e.currentTarget.dataset.url, urls })
+ },
+ async markBad() {
+ const res = await request({ url: '/gongdan/dissatisfied/', method: 'POST', data: { gongdan_id: this.data.id } })
+ if ((res.data || {}).code === 200) {
+ wx.showToast({ title: '已标记', icon: 'success' })
+ this.load()
+ } else wx.showToast({ title: (res.data || {}).message || '失败', icon: 'none' })
+ },
+ showEsc() { this.setData({ escShow: true }) },
+ onEsc(e) { this.setData({ escText: e.detail.value }) },
+ async doEsc() {
+ if (!this.data.escText.trim()) return wx.showToast({ title: '请填写补充说明', icon: 'none' })
+ this.setData({ escLoading: true })
+ try {
+ const res = await request({
+ url: '/gongdan/escalate/',
+ method: 'POST',
+ data: { gongdan_id: this.data.id, shuoming: this.data.escText },
+ })
+ if ((res.data || {}).code === 200) {
+ wx.showToast({ title: '已提交', icon: 'success' })
+ this.setData({ escShow: false, escText: '' })
+ this.load()
+ } else wx.showToast({ title: (res.data || {}).message || '失败', icon: 'none' })
+ } finally {
+ this.setData({ escLoading: false })
+ }
+ },
+})
diff --git a/pages/gongdan/detail/detail.json b/pages/gongdan/detail/detail.json
new file mode 100644
index 0000000..4d7bf19
--- /dev/null
+++ b/pages/gongdan/detail/detail.json
@@ -0,0 +1 @@
+{"navigationBarTitleText":"工单详情","usingComponents":{}}
diff --git a/pages/gongdan/detail/detail.wxml b/pages/gongdan/detail/detail.wxml
new file mode 100644
index 0000000..3049403
--- /dev/null
+++ b/pages/gongdan/detail/detail.wxml
@@ -0,0 +1,34 @@
+
+
+ {{detail.leixing_label}}{{detail.zhuangtai_label}}
+ 工单号:{{detail.gongdan_id}} 复制
+ 订单ID:{{detail.order_id}}
+ 充值ID:{{detail.chongzhi_id}}
+ 罚单ID:{{detail.fadan_id}}
+ {{detail.shuoming}}
+
+
+
+ 处理结果:{{detail.chuli_jieguo}}
+ 处理人:{{detail.chuliren_name}}
+
+
+
+ 补充说明记录
+
+ 第{{item.cishu}}次:{{item.shuoming}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/gongdan/detail/detail.wxss b/pages/gongdan/detail/detail.wxss
new file mode 100644
index 0000000..eb25c2f
--- /dev/null
+++ b/pages/gongdan/detail/detail.wxss
@@ -0,0 +1,14 @@
+.page{padding:24rpx;background:#f5f6f8;min-height:100vh}
+.card{background:#fff;border-radius:16rpx;padding:24rpx;margin-bottom:20rpx}
+.row{display:flex;justify-content:space-between;font-size:30rpx;font-weight:600}
+.status{font-size:24rpx;font-weight:400;color:#856404}
+.line{font-size:24rpx;color:#666;margin-top:12rpx}
+.block{margin-top:16rpx;font-size:28rpx;color:#333;line-height:1.5}
+.imgs{display:flex;flex-wrap:wrap;gap:12rpx;margin-top:16rpx}
+.imgs image{width:160rpx;height:160rpx;border-radius:10rpx}
+.h{font-size:28rpx;font-weight:600;margin-bottom:12rpx}
+.sj{font-size:26rpx;color:#555;margin-bottom:8rpx}
+.actions{margin-top:12rpx}
+.primary{background:#1a1a1a;color:#fff}
+.esc{background:#fff;padding:24rpx;border-radius:16rpx;margin-top:20rpx}
+.esc textarea{width:100%;min-height:160rpx;background:#f7f8fa;padding:16rpx;box-sizing:border-box;margin-bottom:16rpx}
diff --git a/pages/gongdan/list/list.js b/pages/gongdan/list/list.js
new file mode 100644
index 0000000..940908d
--- /dev/null
+++ b/pages/gongdan/list/list.js
@@ -0,0 +1,26 @@
+import request from '../../../utils/request.js'
+
+Page({
+ data: { list: [], loading: false, page: 1 },
+ onShow() { this.load(true) },
+ goCreate() { wx.navigateTo({ url: '/pages/gongdan/create/create' }) },
+ goDetail(e) {
+ wx.navigateTo({ url: `/pages/gongdan/detail/detail?id=${e.currentTarget.dataset.id}` })
+ },
+ async load(reset) {
+ if (this.data.loading) return
+ this.setData({ loading: true })
+ try {
+ const page = reset ? 1 : this.data.page
+ const res = await request({ url: '/gongdan/my-list/', method: 'POST', data: { page, page_size: 20 } })
+ const body = res.data || {}
+ if (body.code === 200 || body.code === 0) {
+ const rows = (body.data && body.data.list) || []
+ this.setData({ list: reset ? rows : this.data.list.concat(rows), page: page + 1 })
+ }
+ } finally {
+ this.setData({ loading: false })
+ }
+ },
+ onReachBottom() { this.load(false) },
+})
diff --git a/pages/gongdan/list/list.json b/pages/gongdan/list/list.json
new file mode 100644
index 0000000..2b340c2
--- /dev/null
+++ b/pages/gongdan/list/list.json
@@ -0,0 +1 @@
+{"navigationBarTitleText":"投诉记录","usingComponents":{}}
diff --git a/pages/gongdan/list/list.wxml b/pages/gongdan/list/list.wxml
new file mode 100644
index 0000000..62952fd
--- /dev/null
+++ b/pages/gongdan/list/list.wxml
@@ -0,0 +1,13 @@
+
+ + 我要投诉
+ 暂无投诉记录
+
+
+ {{item.leixing_label}}
+ {{item.zhuangtai_label}}
+
+ 工单号 {{item.gongdan_id}}
+ {{item.shuoming}}
+ {{item.CreateTime}}
+
+
diff --git a/pages/gongdan/list/list.wxss b/pages/gongdan/list/list.wxss
new file mode 100644
index 0000000..0ef3589
--- /dev/null
+++ b/pages/gongdan/list/list.wxss
@@ -0,0 +1,13 @@
+.page{padding:24rpx;background:#f5f6f8;min-height:100vh;box-sizing:border-box}
+.top-btn{background:#1a1a1a;color:#fff;text-align:center;padding:22rpx;border-radius:12rpx;margin-bottom:20rpx;font-size:28rpx}
+.empty{text-align:center;color:#999;padding:80rpx 0}
+.card{background:#fff;border-radius:16rpx;padding:24rpx;margin-bottom:16rpx}
+.row{display:flex;justify-content:space-between;align-items:center}
+.title{font-size:30rpx;font-weight:600;color:#222}
+.status{font-size:22rpx;padding:4rpx 12rpx;border-radius:8rpx;background:#eee}
+.s1{background:#fff3cd;color:#856404}
+.s2{background:#d4edda;color:#155724}
+.s3{background:#f8d7da;color:#721c24}
+.s4{background:#e2e3e5;color:#383d41}
+.id,.time{font-size:22rpx;color:#999;margin-top:8rpx}
+.desc{font-size:26rpx;color:#555;margin-top:12rpx;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
diff --git a/pages/manager-assign/manager-assign.json b/pages/manager-assign/manager-assign.json
index 4a234f5..bca78e2 100644
--- a/pages/manager-assign/manager-assign.json
+++ b/pages/manager-assign/manager-assign.json
@@ -1,5 +1,5 @@
{
- "navigationBarTitleText": "星之界",
+ "navigationBarTitleText": "龙先生电竞",
"usingComponents": {
"global-notification": "/components/global-notification/global-notification"
},
diff --git a/pages/merchant-order-detail/merchant-order-detail.js b/pages/merchant-order-detail/merchant-order-detail.js
index f9b2d64..2317d0f 100644
--- a/pages/merchant-order-detail/merchant-order-detail.js
+++ b/pages/merchant-order-detail/merchant-order-detail.js
@@ -42,6 +42,7 @@ Page({
showChexiaoModal: false, chexiaoLiyou: '', isChexiaoLoading: false,
showTuikuanModal: false, tuikuanLiyou: '', isTuikuanLoading: false,
showFakuanModal: false, fakuanLiyou: '', fakuanJine: '', yingxiangQiangdan: true, isFakuanLoading: false,
+ fakuanEvidenceLocal: [],
showGhDashouModal: false, isGhDashouLoading: false,
showJiesuanConfirm: false, isJiesuanLoading: false,
jiesuanPingfen: 0, jiesuanLiuyan: '',
@@ -462,9 +463,84 @@ Page({
if (dingdanId) {
this.jiazaiXiangxiShuju(dingdanId)
}
- this.setData({ showFakuanModal: true, fakuanLiyou: '', fakuanJine: '', yingxiangQiangdan: true })
+ this.setData({
+ showFakuanModal: true,
+ fakuanLiyou: '',
+ fakuanJine: '',
+ yingxiangQiangdan: true,
+ fakuanEvidenceLocal: [],
+ })
+ },
+ closeFakuanModal() {
+ this.setData({ showFakuanModal: false, fakuanEvidenceLocal: [] })
+ },
+ chooseFakuanEvidence() {
+ const remain = 9 - this.data.fakuanEvidenceLocal.length
+ if (remain <= 0) return
+ wx.chooseMedia({
+ count: remain,
+ mediaType: ['image'],
+ sourceType: ['album', 'camera'],
+ success: (res) => {
+ const paths = (res.tempFiles || []).map((f) => f.tempFilePath)
+ this.setData({
+ fakuanEvidenceLocal: this.data.fakuanEvidenceLocal.concat(paths).slice(0, 9),
+ })
+ },
+ })
+ },
+ deleteFakuanEvidence(e) {
+ const idx = e.currentTarget.dataset.index
+ const arr = this.data.fakuanEvidenceLocal.slice()
+ arr.splice(idx, 1)
+ this.setData({ fakuanEvidenceLocal: arr })
+ },
+ previewFakuanEvidence(e) {
+ const url = e.currentTarget.dataset.url
+ const urls = this.data.fakuanEvidenceLocal || []
+ wx.previewImage({ current: url, urls: urls.length ? urls : [url] })
+ },
+ async uploadFakuanEvidenceDraft(localPaths, dingdanId) {
+ if (!localPaths.length) return []
+ const credRes = await request({
+ url: '/dingdan/dsscpz',
+ method: 'POST',
+ data: { dingdan_id: dingdanId, yongtu: 'fakuan_evidence_draft' },
+ })
+ if (!credRes || !credRes.data || credRes.data.code !== 0) {
+ throw new Error((credRes && credRes.data && credRes.data.msg) || '上传凭证失败')
+ }
+ const tokenData = credRes.data.data
+ const credentials = tokenData.credentials || tokenData
+ const COS = require('../../utils/cos-wx-sdk-v5.min.js')
+ const cos = new COS({
+ SimpleUploadMethod: 'putObject',
+ getAuthorization: (_, callback) => {
+ callback({
+ TmpSecretId: credentials.tmpSecretId,
+ TmpSecretKey: credentials.tmpSecretKey,
+ SecurityToken: credentials.sessionToken || '',
+ StartTime: tokenData.startTime,
+ ExpiredTime: tokenData.expiredTime,
+ })
+ },
+ })
+ const bucket = tokenData.bucket || 'julebu-1361527063'
+ const region = tokenData.region || 'ap-shanghai'
+ const uid = wx.getStorageSync('uid') || '0000000'
+ const keys = []
+ for (let i = 0; i < localPaths.length; i++) {
+ const key = `fakuan/shangjiafakuan/zhengju/${uid}_${dingdanId}_draft_${Date.now() + i}.jpg`
+ await new Promise((resolve, reject) => {
+ cos.uploadFile(
+ { Bucket: bucket, Region: region, Key: key, FilePath: localPaths[i] },
+ (err) => (err ? reject(err) : resolve()),
+ )
+ })
+ keys.push(key)
+ }
+ return keys
},
- closeFakuanModal() { this.setData({ showFakuanModal: false }) },
inputFakuanLiyou(e) { this.setData({ fakuanLiyou: e.detail.value.slice(0, 50) }) },
inputFakuanJine(e) { this.setData({ fakuanJine: e.detail.value }) },
toggleQiangdan() { this.setData({ yingxiangQiangdan: !this.data.yingxiangQiangdan }) },
@@ -474,14 +550,22 @@ Page({
return (jine * this.data.fenhongLilv).toFixed(2)
},
async tijiaoFakuan() {
- const { fakuanLiyou, fakuanJine, jibenShuju, dashouInfo } = this.data
+ const { fakuanLiyou, fakuanJine, jibenShuju, dashouInfo, fakuanEvidenceLocal } = this.data
if (!fakuanLiyou.trim()) { wx.showToast({ title: '请输入罚款原因', icon: 'none' }); return }
const jineNum = parseFloat(fakuanJine)
if (isNaN(jineNum) || jineNum <= 0) { wx.showToast({ title: '请输入正确的罚款金额', icon: 'none' }); return }
+ if (!fakuanEvidenceLocal.length) {
+ wx.showToast({ title: '请至少上传1张证据图片', icon: 'none' })
+ return
+ }
if (this.data.isFakuanLoading) return
this.setData({ isFakuanLoading: true })
wx.showLoading({ title: '提交中...', mask: true })
try {
+ const evidenceUrls = await this.uploadFakuanEvidenceDraft(
+ fakuanEvidenceLocal,
+ jibenShuju.dingdan_id,
+ )
const res = await request({
url: isStaffMode() ? STAFF_API.penaltyApply : '/dingdan/sjfksq',
method: 'POST',
@@ -490,7 +574,8 @@ Page({
chufa_liyou: fakuanLiyou,
fakuanjine: jineNum.toFixed(2),
yingxiang_qiangdan: this.data.yingxiangQiangdan ? 1 : 0,
- dashou_id: dashouInfo.yonghuid
+ dashou_id: dashouInfo.yonghuid,
+ evidence_urls: evidenceUrls,
},
header: { 'content-type': 'application/json' }
})
@@ -498,7 +583,7 @@ Page({
this.setData({ isFakuanLoading: false })
if (res && res.data.code === 0) {
wx.showToast({ title: '罚款申请已提交', icon: 'success' })
- this.setData({ showFakuanModal: false })
+ this.setData({ showFakuanModal: false, fakuanEvidenceLocal: [] })
this.jiazaiXiangxiShuju(jibenShuju.dingdan_id)
} else {
wx.showToast({ title: res?.data?.msg || '提交失败', icon: 'none' })
@@ -506,7 +591,7 @@ Page({
} catch (err) {
wx.hideLoading()
this.setData({ isFakuanLoading: false })
- wx.showToast({ title: '网络错误', icon: 'none' })
+ wx.showToast({ title: (err && err.message) || '网络错误', icon: 'none' })
}
},
diff --git a/pages/merchant-order-detail/merchant-order-detail.wxml b/pages/merchant-order-detail/merchant-order-detail.wxml
index 0f6441b..c4cfad1 100644
--- a/pages/merchant-order-detail/merchant-order-detail.wxml
+++ b/pages/merchant-order-detail/merchant-order-detail.wxml
@@ -245,6 +245,16 @@
此次罚款应得分红:¥{{jisuanFenhong()}}(利率 {{fenhongLilv*100}}%)
+ 证据图片(至少1张,最多9张)
+
+
+
+
+ ×
+
+
+ +
+
取消
diff --git a/pages/merchant-order-detail/merchant-order-detail.wxss b/pages/merchant-order-detail/merchant-order-detail.wxss
index 7aed2dd..cbb2660 100644
--- a/pages/merchant-order-detail/merchant-order-detail.wxss
+++ b/pages/merchant-order-detail/merchant-order-detail.wxss
@@ -178,6 +178,45 @@ page { background: #fff8e1; }
border-top: 1rpx dashed rgba(245, 213, 99, 0.5);
}
+.img-grid-mini {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 16rpx;
+ margin: 16rpx 0 24rpx;
+}
+.img-box-mini, .img-add-mini {
+ width: 140rpx;
+ height: 140rpx;
+ border-radius: 12rpx;
+ position: relative;
+ overflow: hidden;
+}
+.img-mini {
+ width: 100%;
+ height: 100%;
+}
+.img-add-mini {
+ border: 2rpx dashed #ccc;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 48rpx;
+ color: #999;
+}
+.img-del-mini {
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 36rpx;
+ height: 36rpx;
+ background: rgba(0,0,0,0.55);
+ color: #fff;
+ text-align: center;
+ line-height: 36rpx;
+ font-size: 24rpx;
+ border-radius: 0 0 0 8rpx;
+}
+
/* ========== 新增:教程按钮样式 ========== */
.tutorial-btn {
position: fixed;
diff --git a/pages/merchant/merchant.js b/pages/merchant/merchant.js
index 54ff719..e84d44a 100644
--- a/pages/merchant/merchant.js
+++ b/pages/merchant/merchant.js
@@ -417,33 +417,9 @@ Page(createPage({
},
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');
- },
- });
+ // 龙先生:商家由后台开通,禁止前端邀请码自助注册
+ wx.showToast({ title: '请联系客服开通商家', icon: 'none' });
+ this.setData({ isAutoRegistering: false });
},
previewAvatar() {
diff --git a/pages/messages/messages.json b/pages/messages/messages.json
index ba43917..707fbb8 100644
--- a/pages/messages/messages.json
+++ b/pages/messages/messages.json
@@ -1,5 +1,5 @@
{
- "navigationBarTitleText": "星之界",
+ "navigationBarTitleText": "龙先生电竞",
"usingComponents": {
"global-notification": "/components/global-notification/global-notification",
"tab-bar": "/tab-bar/index"
diff --git a/pages/mine/mine.js b/pages/mine/mine.js
index 8365416..6af4faf 100644
--- a/pages/mine/mine.js
+++ b/pages/mine/mine.js
@@ -193,6 +193,11 @@ Page(createPage({
goToAuth(e) {
const type = e.currentTarget.dataset.type;
if (!type || !['dashou', 'shangjia'].includes(type)) return;
+ // 龙先生:商家只能后台开通,前端禁止自助认证
+ if (type === 'shangjia' && !isRoleStatusActive(wx.getStorageSync('shangjiastatus'))) {
+ wx.showToast({ title: '请联系客服开通商家', icon: 'none' });
+ return;
+ }
ensureLogin({ silent: false, page: this })
.then(() => restoreStaffContextAfterAuth())
.then(() => {
diff --git a/pages/mine/mine.json b/pages/mine/mine.json
index 1106d48..4394dac 100644
--- a/pages/mine/mine.json
+++ b/pages/mine/mine.json
@@ -2,7 +2,8 @@
"usingComponents": {
"global-notification": "/components/global-notification/global-notification",
"tab-bar": "/tab-bar/index",
- "pindao-modal": "/components/pindao-modal/pindao-modal"
+ "pindao-modal": "/components/pindao-modal/pindao-modal",
+ "tousu-float": "/components/tousu-float/tousu-float"
},
"navigationBarTitleText": "个人中心",
"navigationBarBackgroundColor": "#F7F3ED",
diff --git a/pages/mine/mine.wxml b/pages/mine/mine.wxml
index 5b0bb6a..41fd433 100644
--- a/pages/mine/mine.wxml
+++ b/pages/mine/mine.wxml
@@ -66,10 +66,6 @@
在线客服
-
-
- 关注快手
-
频道
@@ -77,7 +73,7 @@
-
+
身份认证
@@ -90,13 +86,6 @@
接单员
{{dashouCertified ? '已认证' : '去认证'}}
-
-
-
-
- 商家
- {{shangjiaCertified ? '已认证' : '去认证'}}
-
@@ -104,6 +93,13 @@
商家客服
{{staffTag}}
+
+
+
+
+ 进入商家
+ 已开通
+
@@ -121,7 +117,7 @@
@@ -130,6 +126,7 @@
+
wx.navigateBack({ fail: () => wx.switchTab({ url: '/pages/mine/mine' }) }), 500)
+ return
+ }
if (!API_MAP[type]) {
wx.showToast({ title: '认证类型错误', icon: 'none' })
setTimeout(() => wx.navigateBack(), 1500)
diff --git a/pages/withdraw/components/mode1/mode1.js b/pages/withdraw/components/mode1/mode1.js
index 4bc9d01..1ce8134 100644
--- a/pages/withdraw/components/mode1/mode1.js
+++ b/pages/withdraw/components/mode1/mode1.js
@@ -1,440 +1,440 @@
-// pages/withdraw/components/mode1/mode1.js — 收款码手动审核纯提现
-import request from '../../../../utils/request.js';
-import upload from '../../../../utils/upload.js';
-import PopupService from '../../../../services/popupService.js';
-
-const app = getApp();
-
-const ASSET_TYPES = {
- dashou_yue: { leixing: 1, label: '接单员佣金' },
- dashou_yajin: { leixing: 5, label: '接单员保证金' },
- shangjia_yue: { leixing: 6, label: '商家余额' },
- guanshi_fenyong: { leixing: 2, label: '管事分红' },
- zuzhang_fenyong: { leixing: 3, label: '组长分红' },
- kaoheguan_fenyong: { leixing: 4, label: '考核官分佣' },
-};
-
-const FROM_ASSET_MAP = {
- dashou: 'dashou_yue',
- guanshi: 'guanshi_fenyong',
- zuzhang: 'zuzhang_fenyong',
- kaoheguan: 'kaoheguan_fenyong',
- kaohe: 'kaoheguan_fenyong',
- shangjia: 'shangjia_yue',
- yajin: 'dashou_yajin',
-};
-
-Component({
- properties: { options: { type: Object, value: {} } },
- data: {
- imgUrls: { iconWechat: '', iconAlipay: '' },
- assetList: [],
- displayAssetList: [],
- totalAmount: '0.00',
- canWithdraw: false,
- isLoadingAssets: false,
- selectedAsset: null,
- tixianAmount: '',
- feeRateText: '--',
- currentRate: '0%',
- shouxufei: '0.00',
- shijidaozhang: '0.00',
- showTixianModal: false,
- submitting: false,
- txfangshi: null,
- txdianhua: '',
- txzh: '',
- txtupian: '',
- showSkfsModal: false,
- tempTxfangshi: null,
- tempTxPhone: '',
- tempTxAccount: '',
- tempTxImage: '',
- choosingImage: false,
- },
-
- attached() {
- this.initImageUrls();
- this.loadAllAssets();
- this.loadWithdrawMethod();
- },
-
- pageLifetimes: {
- show() {
- this.registerNotification();
- this.loadAllAssets();
- PopupService.checkAndShow(this, 'tixian');
- },
- hide() {
- const popup = this.selectComponent('#popupNotice');
- popup?.cleanup?.();
- },
- },
-
- methods: {
- formatRatePercent(rate) {
- const r = parseFloat(rate) || 0;
- if (r <= 1 && r > 0) return `${(r * 100).toFixed(0)}%`;
- return `${r}%`;
- },
-
- registerNotification() {
- const comp = this.selectComponent('#global-notification');
- if (comp?.showNotification) {
- app.globalData.globalNotification = {
- show: (data) => comp.showNotification(data),
- hide: () => comp.hideNotification(),
- };
- }
- },
-
- initImageUrls() {
- const ossBase = app.globalData.ossImageUrl || '';
- const imgDir = `${ossBase}beijing/tixian/`;
- this.setData({
- imgUrls: {
- iconWechat: `${imgDir}icon_wechat.png`,
- iconAlipay: `${imgDir}icon_alipay.png`,
- },
- });
- },
-
- /** 顶部展示:不含保证金的可提现合计 */
- calcDisplayTotal(assets) {
- let total = 0;
- (assets || []).forEach((item) => {
- if (item.type === 'dashou_yajin') return;
- total += parseFloat(item.amount) || 0;
- });
- return total;
- },
-
- hasAnyWithdrawable(assets) {
- return (assets || []).some((item) => parseFloat(item.amount) > 0);
- },
-
- applyRouteOptions(assets) {
- const opts = this.properties.options || {};
- const fromKey = FROM_ASSET_MAP[opts.from];
- let selected = null;
- if (fromKey) {
- selected = assets.find((a) => a.type === fromKey) || null;
- } else if (assets.length === 1) {
- selected = assets[0];
- }
- const patch = {};
- if (selected) {
- patch.selectedAsset = selected;
- patch.feeRateText = selected.rateText;
- }
- if (opts.amount && parseFloat(opts.amount) > 0) {
- const amt = parseFloat(opts.amount);
- const max = selected ? parseFloat(selected.amount) : amt;
- patch.tixianAmount = Math.min(amt, max).toFixed(2);
- }
- if (Object.keys(patch).length) {
- this.setData(patch, () => {
- this.recalcFee(this.data.tixianAmount, this.data.selectedAsset);
- });
- }
- },
-
- onSelectAsset(e) {
- const index = e.currentTarget.dataset.index;
- const asset = this.data.displayAssetList[index];
- if (!asset || parseFloat(asset.amount) <= 0) {
- wx.showToast({ title: '该账户无可提余额', icon: 'none' });
- return;
- }
- let amount = this.data.tixianAmount;
- const max = parseFloat(asset.amount);
- if (amount && parseFloat(amount) > max) {
- amount = asset.amount;
- }
- this.setData({ selectedAsset: asset, tixianAmount: amount });
- this.recalcFee(amount, asset);
- },
-
- async loadAllAssets() {
- this.setData({ isLoadingAssets: true, totalAmount: '0.00', canWithdraw: false, assetList: [] });
- try {
- const res = await request({ url: '/yonghu/tixianzichan', method: 'POST' });
- if (res?.data?.code === 200 || res?.data?.code === 0) {
- const data = res.data.data || {};
- const assets = [];
- const push = (type, amount, rate) => {
- const cfg = ASSET_TYPES[type];
- if (!cfg || !amount || parseFloat(amount) <= 0) return;
- assets.push({
- type,
- leixing: cfg.leixing,
- label: cfg.label,
- amount: parseFloat(amount).toFixed(2),
- rate: rate || 0,
- rateText: this.formatRatePercent(rate || 0),
- });
- };
- push('dashou_yue', data.dashou_yue, data.dashou_rate);
- push('dashou_yajin', data.dashou_yajin, data.dashou_yajin_rate);
- push('shangjia_yue', data.shangjia_yue, data.shangjia_rate);
- push('guanshi_fenyong', data.guanshi_fenyong, data.guanshi_rate);
- push('zuzhang_fenyong', data.zuzhang_fenyong, data.zuzhang_rate);
- push('kaoheguan_fenyong', data.kaoheguan_fenyong, data.kaoheguan_rate);
-
- const displayTotal = this.calcDisplayTotal(assets);
- const firstRate = assets.find((a) => a.type !== 'dashou_yajin')?.rate || 0;
- this.setData({
- assetList: assets,
- displayAssetList: assets,
- totalAmount: displayTotal.toFixed(2),
- canWithdraw: this.hasAnyWithdrawable(assets),
- isLoadingAssets: false,
- feeRateText: displayTotal > 0 ? this.formatRatePercent(firstRate) : '--',
- }, () => this.applyRouteOptions(assets));
- if (!this.data.selectedAsset) {
- this.recalcFee(this.data.tixianAmount, null);
- }
- } else {
- throw new Error(res?.data?.msg || '获取资产失败');
- }
- } catch (err) {
- console.error('loadAllAssets', err);
- this.setData({ isLoadingAssets: false, totalAmount: '0.00', canWithdraw: false, assetList: [] });
- }
- },
-
- async loadWithdrawMethod() {
- const txzh = wx.getStorageSync('txzh') || '';
- const txtupian = wx.getStorageSync('txtupian') || '';
- const txfangshi = wx.getStorageSync('txfangshi') || null;
- const txdianhua = wx.getStorageSync('txdianhua') || '';
- if (txzh || txtupian || txfangshi) {
- this.setData({ txzh, txtupian, txfangshi, txdianhua });
- return;
- }
- try {
- const res = await request({ url: '/yonghu/tixianhq', method: 'POST' });
- if (res?.data?.code === 0) {
- const data = res.data.data;
- this.setData({
- txzh: data.txzh || '',
- txtupian: data.txtupian || '',
- txfangshi: data.txfangshi || null,
- txdianhua: data.txdianhua || '',
- });
- wx.setStorageSync('txzh', data.txzh || '');
- wx.setStorageSync('txtupian', data.txtupian || '');
- wx.setStorageSync('txfangshi', data.txfangshi || null);
- wx.setStorageSync('txdianhua', data.txdianhua || '');
- }
- } catch (err) { /* ignore */ }
- },
-
- recalcFee(amountStr, asset) {
- const amount = parseFloat(amountStr);
- if (!amountStr || isNaN(amount) || amount <= 0 || !asset) {
- this.setData({
- shouxufei: '0.00',
- shijidaozhang: '0.00',
- feeRateText: asset ? asset.rateText : this.data.feeRateText,
- });
- return;
- }
- const rate = parseFloat(asset.rate) || 0;
- const fee = amount * rate;
- this.setData({
- shouxufei: fee.toFixed(2),
- shijidaozhang: (amount - fee).toFixed(2),
- feeRateText: asset.rateText,
- currentRate: asset.rateText,
- });
- },
-
- onAmountInput(e) {
- let val = e.detail.value;
- if (val && !/^\d*\.?\d{0,2}$/.test(val)) return;
- this.setData({ tixianAmount: val });
- this.recalcFee(val, this.data.selectedAsset);
- },
-
- onWithdrawAll() {
- const { selectedAsset } = this.data;
- if (!selectedAsset) {
- wx.showToast({ title: '请先选择提现账户', icon: 'none' });
- return;
- }
- const max = selectedAsset.amount;
- this.setData({ tixianAmount: max });
- this.recalcFee(max, selectedAsset);
- },
-
- onTapWithdraw() {
- if (this.data.submitting) return;
- if (!this.hasAnyWithdrawable(this.data.assetList)) {
- wx.showToast({ title: '暂无可提现余额', icon: 'none' });
- return;
- }
- const { selectedAsset, tixianAmount } = this.data;
- if (!selectedAsset) {
- wx.showToast({ title: '请先选择要提现的账户', icon: 'none' });
- return;
- }
- const amount = parseFloat(tixianAmount);
- if (isNaN(amount) || amount <= 0) {
- wx.showToast({ title: '请输入有效金额', icon: 'none' });
- return;
- }
- if (amount > parseFloat(selectedAsset.amount)) {
- wx.showToast({ title: `超过${selectedAsset.label}可提余额`, icon: 'none' });
- return;
- }
- const { txfangshi, txzh, txtupian } = this.data;
- if (!txfangshi || (!txzh && !txtupian)) {
- wx.showToast({ title: '请先设置收款方式', icon: 'none' });
- this.onSetSkfs();
- return;
- }
- this.applyIdentityAndConfirm(selectedAsset);
- },
-
- applyIdentityAndConfirm(asset) {
- this.recalcFee(this.data.tixianAmount, asset);
- this.setData({ selectedAsset: asset, showTixianModal: true });
- },
-
- async onConfirmWithdraw() {
- const { selectedAsset, tixianAmount, txfangshi, txzh, txtupian } = this.data;
- if (!selectedAsset) {
- wx.showToast({ title: '请选择提现身份', icon: 'none' });
- return;
- }
- const amount = parseFloat(tixianAmount);
- if (isNaN(amount) || amount <= 0) {
- wx.showToast({ title: '请输入有效金额', icon: 'none' });
- return;
- }
- if (amount > parseFloat(selectedAsset.amount)) {
- wx.showToast({ title: '超过可提余额', icon: 'none' });
- return;
- }
- const leixing = selectedAsset.leixing;
- let txskfs = 0;
- if (txzh && txtupian) txskfs = 3;
- else if (txzh) txskfs = 1;
- else if (txtupian) txskfs = 2;
-
- this.setData({ submitting: true });
- try {
- const res = await request({
- url: '/yonghu/tixian',
- method: 'POST',
- data: { leixing, jine: amount.toFixed(2), fangshi: txfangshi, txskfs },
- });
- if (res?.data?.code === 0) {
- this.setData({
- showTixianModal: false,
- selectedAsset: null,
- tixianAmount: '',
- submitting: false,
- });
- await this.loadAllAssets();
- wx.showModal({
- title: '申请成功',
- content: '提现申请已提交,请前往「提现记录」查看审核进度。',
- confirmText: '查看提现记录',
- cancelText: '知道了',
- success: (res) => {
- if (res.confirm) {
- wx.navigateTo({ url: '/pages/withdraw/withdraw-records' });
- }
- },
- });
- } else {
- wx.showToast({ title: res?.data?.msg || '提现失败', icon: 'none' });
- this.setData({ submitting: false });
- }
- } catch (err) {
- wx.showToast({ title: '网络错误', icon: 'none' });
- this.setData({ submitting: false });
- }
- },
-
- onCloseTixianModal() {
- if (this.data.submitting) return;
- this.setData({ showTixianModal: false, selectedAsset: null });
- },
-
- onSetSkfs() {
- this.setData({
- showSkfsModal: true,
- tempTxfangshi: this.data.txfangshi,
- tempTxPhone: this.data.txdianhua,
- tempTxAccount: this.data.txzh,
- tempTxImage: '',
- });
- },
-
- onSelectFangshi(e) { this.setData({ tempTxfangshi: e.currentTarget.dataset.fangshi }); },
- onPhoneInput(e) { this.setData({ tempTxPhone: e.detail.value }); },
- onAccountInput(e) { this.setData({ tempTxAccount: e.detail.value }); },
-
- onChooseImage() {
- if (this.data.choosingImage) return;
- this.setData({ choosingImage: true });
- wx.chooseMedia({
- count: 1,
- mediaType: ['image'],
- success: (res) => { this.setData({ tempTxImage: res.tempFiles[0].tempFilePath }); },
- complete: () => { this.setData({ choosingImage: false }); },
- });
- },
-
- onPreviewImage() {
- if (this.data.tempTxImage) wx.previewImage({ urls: [this.data.tempTxImage] });
- },
-
- onDeleteImage() { this.setData({ tempTxImage: '' }); },
-
- async onConfirmSkfs() {
- const { tempTxfangshi, tempTxPhone, tempTxAccount, tempTxImage } = this.data;
- if (!tempTxfangshi) { wx.showToast({ title: '请选择提现方式', icon: 'none' }); return; }
- if (!tempTxPhone) { wx.showToast({ title: '请输入收款人电话', icon: 'none' }); return; }
- if (tempTxfangshi == 1 && !tempTxImage && !this.data.txtupian) {
- wx.showToast({ title: '请上传微信收款码', icon: 'none' }); return;
- }
- if (tempTxfangshi == 2 && !tempTxAccount && !tempTxImage && !this.data.txzh) {
- wx.showToast({ title: '请填写支付宝账号或上传收款码', icon: 'none' }); return;
- }
- try {
- const res = await upload({
- url: '/yonghu/sksc',
- formData: { txdianhua: tempTxPhone, txzh: tempTxAccount || '' },
- filePath: tempTxImage || null,
- fileName: 'file',
- });
- if (res?.data?.code === 0) {
- const data = res.data.data;
- this.setData({
- txfangshi: tempTxfangshi,
- txdianhua: tempTxPhone,
- txzh: data.txzh || '',
- txtupian: data.txtupian || this.data.txtupian,
- showSkfsModal: false,
- });
- wx.setStorageSync('txfangshi', tempTxfangshi);
- wx.setStorageSync('txdianhua', tempTxPhone);
- wx.setStorageSync('txzh', data.txzh || '');
- wx.setStorageSync('txtupian', data.txtupian || this.data.txtupian);
- wx.showToast({ title: '设置成功', icon: 'success' });
- } else {
- wx.showToast({ title: res?.data?.msg || '保存失败', icon: 'none' });
- }
- } catch (err) {
- wx.showToast({ title: '网络错误', icon: 'none' });
- }
- },
-
- onCloseSkfsModal() { this.setData({ showSkfsModal: false }); },
- stopPropagation() {},
- },
-});
+// pages/withdraw/components/mode1/mode1.js — 收款码手动审核纯提现
+import request from '../../../../utils/request.js';
+import upload from '../../../../utils/upload.js';
+import PopupService from '../../../../services/popupService.js';
+
+const app = getApp();
+
+const ASSET_TYPES = {
+ dashou_yue: { leixing: 1, label: '接单员佣金' },
+ dashou_yajin: { leixing: 5, label: '接单员保证金' },
+ shangjia_yue: { leixing: 6, label: '商家余额' },
+ guanshi_fenyong: { leixing: 2, label: '管事分红' },
+ zuzhang_fenyong: { leixing: 3, label: '组长分红' },
+ kaoheguan_fenyong: { leixing: 4, label: '考核官分佣' },
+};
+
+const FROM_ASSET_MAP = {
+ dashou: 'dashou_yue',
+ guanshi: 'guanshi_fenyong',
+ zuzhang: 'zuzhang_fenyong',
+ kaoheguan: 'kaoheguan_fenyong',
+ kaohe: 'kaoheguan_fenyong',
+ shangjia: 'shangjia_yue',
+ yajin: 'dashou_yajin',
+};
+
+Component({
+ properties: { options: { type: Object, value: {} } },
+ data: {
+ imgUrls: { iconWechat: '', iconAlipay: '' },
+ assetList: [],
+ displayAssetList: [],
+ totalAmount: '0.00',
+ canWithdraw: false,
+ isLoadingAssets: false,
+ selectedAsset: null,
+ tixianAmount: '',
+ feeRateText: '--',
+ currentRate: '0%',
+ shouxufei: '0.00',
+ shijidaozhang: '0.00',
+ showTixianModal: false,
+ submitting: false,
+ txfangshi: null,
+ txdianhua: '',
+ txzh: '',
+ txtupian: '',
+ showSkfsModal: false,
+ tempTxfangshi: null,
+ tempTxPhone: '',
+ tempTxAccount: '',
+ tempTxImage: '',
+ choosingImage: false,
+ },
+
+ attached() {
+ this.initImageUrls();
+ this.loadAllAssets();
+ this.loadWithdrawMethod();
+ },
+
+ pageLifetimes: {
+ show() {
+ this.registerNotification();
+ this.loadAllAssets();
+ PopupService.checkAndShow(this, 'tixian');
+ },
+ hide() {
+ const popup = this.selectComponent('#popupNotice');
+ popup?.cleanup?.();
+ },
+ },
+
+ methods: {
+ formatRatePercent(rate) {
+ const r = parseFloat(rate) || 0;
+ if (r <= 1 && r > 0) return `${(r * 100).toFixed(0)}%`;
+ return `${r}%`;
+ },
+
+ registerNotification() {
+ const comp = this.selectComponent('#global-notification');
+ if (comp?.showNotification) {
+ app.globalData.globalNotification = {
+ show: (data) => comp.showNotification(data),
+ hide: () => comp.hideNotification(),
+ };
+ }
+ },
+
+ initImageUrls() {
+ const ossBase = app.globalData.ossImageUrl || '';
+ const imgDir = `${ossBase}beijing/tixian/`;
+ this.setData({
+ imgUrls: {
+ iconWechat: `${imgDir}icon_wechat.png`,
+ iconAlipay: `${imgDir}icon_alipay.png`,
+ },
+ });
+ },
+
+ /** 顶部展示:不含保证金的可提现合计 */
+ calcDisplayTotal(assets) {
+ let total = 0;
+ (assets || []).forEach((item) => {
+ if (item.type === 'dashou_yajin') return;
+ total += parseFloat(item.amount) || 0;
+ });
+ return total;
+ },
+
+ hasAnyWithdrawable(assets) {
+ return (assets || []).some((item) => parseFloat(item.amount) > 0);
+ },
+
+ applyRouteOptions(assets) {
+ const opts = this.properties.options || {};
+ const fromKey = FROM_ASSET_MAP[opts.from];
+ let selected = null;
+ if (fromKey) {
+ selected = assets.find((a) => a.type === fromKey) || null;
+ } else if (assets.length === 1) {
+ selected = assets[0];
+ }
+ const patch = {};
+ if (selected) {
+ patch.selectedAsset = selected;
+ patch.feeRateText = selected.rateText;
+ }
+ if (opts.amount && parseFloat(opts.amount) > 0) {
+ const amt = parseFloat(opts.amount);
+ const max = selected ? parseFloat(selected.amount) : amt;
+ patch.tixianAmount = Math.min(amt, max).toFixed(2);
+ }
+ if (Object.keys(patch).length) {
+ this.setData(patch, () => {
+ this.recalcFee(this.data.tixianAmount, this.data.selectedAsset);
+ });
+ }
+ },
+
+ onSelectAsset(e) {
+ const index = e.currentTarget.dataset.index;
+ const asset = this.data.displayAssetList[index];
+ if (!asset || parseFloat(asset.amount) <= 0) {
+ wx.showToast({ title: '该账户无可提余额', icon: 'none' });
+ return;
+ }
+ let amount = this.data.tixianAmount;
+ const max = parseFloat(asset.amount);
+ if (amount && parseFloat(amount) > max) {
+ amount = asset.amount;
+ }
+ this.setData({ selectedAsset: asset, tixianAmount: amount });
+ this.recalcFee(amount, asset);
+ },
+
+ async loadAllAssets() {
+ this.setData({ isLoadingAssets: true, totalAmount: '0.00', canWithdraw: false, assetList: [] });
+ try {
+ const res = await request({ url: '/yonghu/tixianzichan', method: 'POST' });
+ if (res?.data?.code === 200 || res?.data?.code === 0) {
+ const data = res.data.data || {};
+ const assets = [];
+ const push = (type, amount, rate) => {
+ const cfg = ASSET_TYPES[type];
+ if (!cfg || !amount || parseFloat(amount) <= 0) return;
+ assets.push({
+ type,
+ leixing: cfg.leixing,
+ label: cfg.label,
+ amount: parseFloat(amount).toFixed(2),
+ rate: rate || 0,
+ rateText: this.formatRatePercent(rate || 0),
+ });
+ };
+ push('dashou_yue', data.dashou_yue, data.dashou_rate);
+ push('dashou_yajin', data.dashou_yajin, data.dashou_yajin_rate);
+ push('shangjia_yue', data.shangjia_yue, data.shangjia_rate);
+ push('guanshi_fenyong', data.guanshi_fenyong, data.guanshi_rate);
+ push('zuzhang_fenyong', data.zuzhang_fenyong, data.zuzhang_rate);
+ push('kaoheguan_fenyong', data.kaoheguan_fenyong, data.kaoheguan_rate);
+
+ const displayTotal = this.calcDisplayTotal(assets);
+ const firstRate = assets.find((a) => a.type !== 'dashou_yajin')?.rate || 0;
+ this.setData({
+ assetList: assets,
+ displayAssetList: assets,
+ totalAmount: displayTotal.toFixed(2),
+ canWithdraw: this.hasAnyWithdrawable(assets),
+ isLoadingAssets: false,
+ feeRateText: displayTotal > 0 ? this.formatRatePercent(firstRate) : '--',
+ }, () => this.applyRouteOptions(assets));
+ if (!this.data.selectedAsset) {
+ this.recalcFee(this.data.tixianAmount, null);
+ }
+ } else {
+ throw new Error(res?.data?.msg || '获取资产失败');
+ }
+ } catch (err) {
+ console.error('loadAllAssets', err);
+ this.setData({ isLoadingAssets: false, totalAmount: '0.00', canWithdraw: false, assetList: [] });
+ }
+ },
+
+ async loadWithdrawMethod() {
+ const txzh = wx.getStorageSync('txzh') || '';
+ const txtupian = wx.getStorageSync('txtupian') || '';
+ const txfangshi = wx.getStorageSync('txfangshi') || null;
+ const txdianhua = wx.getStorageSync('txdianhua') || '';
+ if (txzh || txtupian || txfangshi) {
+ this.setData({ txzh, txtupian, txfangshi, txdianhua });
+ return;
+ }
+ try {
+ const res = await request({ url: '/yonghu/tixianhq', method: 'POST' });
+ if (res?.data?.code === 0) {
+ const data = res.data.data;
+ this.setData({
+ txzh: data.txzh || '',
+ txtupian: data.txtupian || '',
+ txfangshi: data.txfangshi || null,
+ txdianhua: data.txdianhua || '',
+ });
+ wx.setStorageSync('txzh', data.txzh || '');
+ wx.setStorageSync('txtupian', data.txtupian || '');
+ wx.setStorageSync('txfangshi', data.txfangshi || null);
+ wx.setStorageSync('txdianhua', data.txdianhua || '');
+ }
+ } catch (err) { /* ignore */ }
+ },
+
+ recalcFee(amountStr, asset) {
+ const amount = parseFloat(amountStr);
+ if (!amountStr || isNaN(amount) || amount <= 0 || !asset) {
+ this.setData({
+ shouxufei: '0.00',
+ shijidaozhang: '0.00',
+ feeRateText: asset ? asset.rateText : this.data.feeRateText,
+ });
+ return;
+ }
+ const rate = parseFloat(asset.rate) || 0;
+ const fee = amount * rate;
+ this.setData({
+ shouxufei: fee.toFixed(2),
+ shijidaozhang: (amount - fee).toFixed(2),
+ feeRateText: asset.rateText,
+ currentRate: asset.rateText,
+ });
+ },
+
+ onAmountInput(e) {
+ let val = e.detail.value;
+ if (val && !/^\d*\.?\d{0,2}$/.test(val)) return;
+ this.setData({ tixianAmount: val });
+ this.recalcFee(val, this.data.selectedAsset);
+ },
+
+ onWithdrawAll() {
+ const { selectedAsset } = this.data;
+ if (!selectedAsset) {
+ wx.showToast({ title: '请先选择提现账户', icon: 'none' });
+ return;
+ }
+ const max = selectedAsset.amount;
+ this.setData({ tixianAmount: max });
+ this.recalcFee(max, selectedAsset);
+ },
+
+ onTapWithdraw() {
+ if (this.data.submitting) return;
+ if (!this.hasAnyWithdrawable(this.data.assetList)) {
+ wx.showToast({ title: '暂无可提现余额', icon: 'none' });
+ return;
+ }
+ const { selectedAsset, tixianAmount } = this.data;
+ if (!selectedAsset) {
+ wx.showToast({ title: '请先选择要提现的账户', icon: 'none' });
+ return;
+ }
+ const amount = parseFloat(tixianAmount);
+ if (isNaN(amount) || amount <= 0) {
+ wx.showToast({ title: '请输入有效金额', icon: 'none' });
+ return;
+ }
+ if (amount > parseFloat(selectedAsset.amount)) {
+ wx.showToast({ title: `超过${selectedAsset.label}可提余额`, icon: 'none' });
+ return;
+ }
+ const { txfangshi, txzh, txtupian } = this.data;
+ if (!txfangshi || (!txzh && !txtupian)) {
+ wx.showToast({ title: '请先设置收款方式', icon: 'none' });
+ this.onSetSkfs();
+ return;
+ }
+ this.applyIdentityAndConfirm(selectedAsset);
+ },
+
+ applyIdentityAndConfirm(asset) {
+ this.recalcFee(this.data.tixianAmount, asset);
+ this.setData({ selectedAsset: asset, showTixianModal: true });
+ },
+
+ async onConfirmWithdraw() {
+ const { selectedAsset, tixianAmount, txfangshi, txzh, txtupian } = this.data;
+ if (!selectedAsset) {
+ wx.showToast({ title: '请选择提现身份', icon: 'none' });
+ return;
+ }
+ const amount = parseFloat(tixianAmount);
+ if (isNaN(amount) || amount <= 0) {
+ wx.showToast({ title: '请输入有效金额', icon: 'none' });
+ return;
+ }
+ if (amount > parseFloat(selectedAsset.amount)) {
+ wx.showToast({ title: '超过可提余额', icon: 'none' });
+ return;
+ }
+ const leixing = selectedAsset.leixing;
+ let txskfs = 0;
+ if (txzh && txtupian) txskfs = 3;
+ else if (txzh) txskfs = 1;
+ else if (txtupian) txskfs = 2;
+
+ this.setData({ submitting: true });
+ try {
+ const res = await request({
+ url: '/yonghu/tixian',
+ method: 'POST',
+ data: { leixing, jine: amount.toFixed(2), fangshi: txfangshi, txskfs },
+ });
+ if (res?.data?.code === 0) {
+ this.setData({
+ showTixianModal: false,
+ selectedAsset: null,
+ tixianAmount: '',
+ submitting: false,
+ });
+ await this.loadAllAssets();
+ wx.showModal({
+ title: '申请成功',
+ content: '提现申请已提交,请前往「提现记录」查看审核进度。',
+ confirmText: '查看提现记录',
+ cancelText: '知道了',
+ success: (res) => {
+ if (res.confirm) {
+ wx.navigateTo({ url: '/pages/withdraw/withdraw-records' });
+ }
+ },
+ });
+ } else {
+ wx.showToast({ title: res?.data?.msg || '提现失败', icon: 'none' });
+ this.setData({ submitting: false });
+ }
+ } catch (err) {
+ wx.showToast({ title: '网络错误', icon: 'none' });
+ this.setData({ submitting: false });
+ }
+ },
+
+ onCloseTixianModal() {
+ if (this.data.submitting) return;
+ this.setData({ showTixianModal: false, selectedAsset: null });
+ },
+
+ onSetSkfs() {
+ this.setData({
+ showSkfsModal: true,
+ tempTxfangshi: this.data.txfangshi,
+ tempTxPhone: this.data.txdianhua,
+ tempTxAccount: this.data.txzh,
+ tempTxImage: '',
+ });
+ },
+
+ onSelectFangshi(e) { this.setData({ tempTxfangshi: e.currentTarget.dataset.fangshi }); },
+ onPhoneInput(e) { this.setData({ tempTxPhone: e.detail.value }); },
+ onAccountInput(e) { this.setData({ tempTxAccount: e.detail.value }); },
+
+ onChooseImage() {
+ if (this.data.choosingImage) return;
+ this.setData({ choosingImage: true });
+ wx.chooseMedia({
+ count: 1,
+ mediaType: ['image'],
+ success: (res) => { this.setData({ tempTxImage: res.tempFiles[0].tempFilePath }); },
+ complete: () => { this.setData({ choosingImage: false }); },
+ });
+ },
+
+ onPreviewImage() {
+ if (this.data.tempTxImage) wx.previewImage({ urls: [this.data.tempTxImage] });
+ },
+
+ onDeleteImage() { this.setData({ tempTxImage: '' }); },
+
+ async onConfirmSkfs() {
+ const { tempTxfangshi, tempTxPhone, tempTxAccount, tempTxImage } = this.data;
+ if (!tempTxfangshi) { wx.showToast({ title: '请选择提现方式', icon: 'none' }); return; }
+ if (!tempTxPhone) { wx.showToast({ title: '请输入收款人电话', icon: 'none' }); return; }
+ if (tempTxfangshi == 1 && !tempTxImage && !this.data.txtupian) {
+ wx.showToast({ title: '请上传微信收款码', icon: 'none' }); return;
+ }
+ if (tempTxfangshi == 2 && !tempTxAccount && !tempTxImage && !this.data.txzh) {
+ wx.showToast({ title: '请填写支付宝账号或上传收款码', icon: 'none' }); return;
+ }
+ try {
+ const res = await upload({
+ url: '/yonghu/sksc',
+ formData: { txdianhua: tempTxPhone, txzh: tempTxAccount || '' },
+ filePath: tempTxImage || null,
+ fileName: 'file',
+ });
+ if (res?.data?.code === 0) {
+ const data = res.data.data;
+ this.setData({
+ txfangshi: tempTxfangshi,
+ txdianhua: tempTxPhone,
+ txzh: data.txzh || '',
+ txtupian: data.txtupian || this.data.txtupian,
+ showSkfsModal: false,
+ });
+ wx.setStorageSync('txfangshi', tempTxfangshi);
+ wx.setStorageSync('txdianhua', tempTxPhone);
+ wx.setStorageSync('txzh', data.txzh || '');
+ wx.setStorageSync('txtupian', data.txtupian || this.data.txtupian);
+ wx.showToast({ title: '设置成功', icon: 'success' });
+ } else {
+ wx.showToast({ title: res?.data?.msg || '保存失败', icon: 'none' });
+ }
+ } catch (err) {
+ wx.showToast({ title: '网络错误', icon: 'none' });
+ }
+ },
+
+ onCloseSkfsModal() { this.setData({ showSkfsModal: false }); },
+ stopPropagation() {},
+ },
+});
diff --git a/pages/withdraw/components/mode1/mode1.wxml b/pages/withdraw/components/mode1/mode1.wxml
index ce59995..6ce613d 100644
--- a/pages/withdraw/components/mode1/mode1.wxml
+++ b/pages/withdraw/components/mode1/mode1.wxml
@@ -1,115 +1,115 @@
-
-
-
-
-
-
-
- {{txfangshi == 1 ? '微信零钱' : (txfangshi == 2 ? '收款码' : '请先设置收款')}}
-
-
- 设置收款方式
-
-
-
-
-
- {{item.label}}
- ¥{{item.amount}}
-
-
- 请先选择上方提现账户
- 当前:{{selectedAsset.label}}
-
-
-
-
- 当前可提现:
- ¥
- {{selectedAsset ? selectedAsset.amount : totalAmount}}
-
-
- ¥
-
- 全部提现
-
-
-
- 提示:提现手续费
- {{feeRateText}}
- 。
-
-
-
-
-
- 处理中...
- 确认提现
-
-
-
-
- 📢 提现须知
- 🕒 提交后将进入人工审核,请耐心等待
- 📌 审核结果可在「提现记录」中查看
- 💰 每笔只能从单个账户提现,请先选择对应账户
- ✅ 请确保收款方式与收款码正确后再提交
- 🎧 如有疑问请联系客服核实处理
-
-
-
-
-
-
-
- 身份{{selectedAsset.label}}
- 可提¥{{selectedAsset.amount}}
- 费率{{currentRate}}
- 提现金额¥{{tixianAmount}}
- 手续费 ¥{{shouxufei}}到账 ¥{{shijidaozhang}}
- 收款{{txfangshi == 1 ? '微信' : (txfangshi == 2 ? '支付宝' : '未设置')}}
-
-
-
-
-
-
-
-
-
-
- 微信
- 支付宝
-
-
-
-
- + 上传收款码
- 预览删除
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ {{txfangshi == 1 ? '微信零钱' : (txfangshi == 2 ? '收款码' : '请先设置收款')}}
+
+
+ 设置收款方式
+
+
+
+
+
+ {{item.label}}
+ ¥{{item.amount}}
+
+
+ 请先选择上方提现账户
+ 当前:{{selectedAsset.label}}
+
+
+
+
+ 当前可提现:
+ ¥
+ {{selectedAsset ? selectedAsset.amount : totalAmount}}
+
+
+ ¥
+
+ 全部提现
+
+
+
+ 提示:提现手续费
+ {{feeRateText}}
+ 。
+
+
+
+
+
+ 处理中...
+ 确认提现
+
+
+
+
+ 📢 提现须知
+ 🕒 提交后将进入人工审核,请耐心等待
+ 📌 审核结果可在「提现记录」中查看
+ 💰 每笔只能从单个账户提现,请先选择对应账户
+ ✅ 请确保收款方式与收款码正确后再提交
+ 🎧 如有疑问请联系客服核实处理
+
+
+
+
+
+
+
+ 身份{{selectedAsset.label}}
+ 可提¥{{selectedAsset.amount}}
+ 费率{{currentRate}}
+ 提现金额¥{{tixianAmount}}
+ 手续费 ¥{{shouxufei}}到账 ¥{{shijidaozhang}}
+ 收款{{txfangshi == 1 ? '微信' : (txfangshi == 2 ? '支付宝' : '未设置')}}
+
+
+
+
+
+
+
+
+
+
+ 微信
+ 支付宝
+
+
+
+
+ + 上传收款码
+ 预览删除
+
+
+
+
+
+
+
+
diff --git a/pages/withdraw/components/mode1/mode1.wxss b/pages/withdraw/components/mode1/mode1.wxss
index 2d5e693..bd2ece7 100644
--- a/pages/withdraw/components/mode1/mode1.wxss
+++ b/pages/withdraw/components/mode1/mode1.wxss
@@ -1,85 +1,85 @@
-@import '../mode2/mode2.wxss';
-
-.method-card--row {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding-right: 24rpx;
-}
-
-.method-setting {
- font-size: 26rpx;
- color: #ff8c00;
- flex-shrink: 0;
- padding: 16rpx 8rpx;
-}
-
-.method-tab-icon--placeholder {
- background: #e0e0e0;
- border-radius: 8rpx;
-}
-
-.skfs-body .toggle-row {
- display: flex;
- gap: 16rpx;
- margin-bottom: 24rpx;
-}
-
-.toggle-item {
- flex: 1;
- text-align: center;
- padding: 20rpx;
- border-radius: 12rpx;
- background: #f5f5f5;
- font-size: 28rpx;
- color: #666;
-}
-
-.toggle-item.active {
- background: #fff8e1;
- color: #ff8c00;
- font-weight: 600;
- border: 2rpx solid #FFD54F;
-}
-
-.field-input {
- width: 100%;
- box-sizing: border-box;
- padding: 24rpx;
- margin-bottom: 16rpx;
- background: #f8f8f8;
- border-radius: 12rpx;
- font-size: 28rpx;
-}
-
-.upload-wrap {
- margin-top: 16rpx;
-}
-
-.upload-trigger {
- padding: 48rpx;
- text-align: center;
- border: 2rpx dashed #ddd;
- border-radius: 12rpx;
- color: #999;
- font-size: 28rpx;
-}
-
-.image-preview {
- position: relative;
-}
-
-.image-preview image {
- width: 100%;
- height: 320rpx;
- border-radius: 12rpx;
-}
-
-.image-actions {
- display: flex;
- justify-content: center;
- gap: 32rpx;
- margin-top: 16rpx;
- font-size: 28rpx;
- color: #ff8c00;
-}
+@import '../mode2/mode2.wxss';
+
+.method-card--row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding-right: 24rpx;
+}
+
+.method-setting {
+ font-size: 26rpx;
+ color: #ff8c00;
+ flex-shrink: 0;
+ padding: 16rpx 8rpx;
+}
+
+.method-tab-icon--placeholder {
+ background: #e0e0e0;
+ border-radius: 8rpx;
+}
+
+.skfs-body .toggle-row {
+ display: flex;
+ gap: 16rpx;
+ margin-bottom: 24rpx;
+}
+
+.toggle-item {
+ flex: 1;
+ text-align: center;
+ padding: 20rpx;
+ border-radius: 12rpx;
+ background: #f5f5f5;
+ font-size: 28rpx;
+ color: #666;
+}
+
+.toggle-item.active {
+ background: #fff8e1;
+ color: #ff8c00;
+ font-weight: 600;
+ border: 2rpx solid #FFD54F;
+}
+
+.field-input {
+ width: 100%;
+ box-sizing: border-box;
+ padding: 24rpx;
+ margin-bottom: 16rpx;
+ background: #f8f8f8;
+ border-radius: 12rpx;
+ font-size: 28rpx;
+}
+
+.upload-wrap {
+ margin-top: 16rpx;
+}
+
+.upload-trigger {
+ padding: 48rpx;
+ text-align: center;
+ border: 2rpx dashed #ddd;
+ border-radius: 12rpx;
+ color: #999;
+ font-size: 28rpx;
+}
+
+.image-preview {
+ position: relative;
+}
+
+.image-preview image {
+ width: 100%;
+ height: 320rpx;
+ border-radius: 12rpx;
+}
+
+.image-actions {
+ display: flex;
+ justify-content: center;
+ gap: 32rpx;
+ margin-top: 16rpx;
+ font-size: 28rpx;
+ color: #ff8c00;
+}
diff --git a/pages/withdraw/components/mode2/mode2.js b/pages/withdraw/components/mode2/mode2.js
index b393f71..fc4ad51 100644
--- a/pages/withdraw/components/mode2/mode2.js
+++ b/pages/withdraw/components/mode2/mode2.js
@@ -1,369 +1,369 @@
-// pages/withdraw/components/mode2/mode2.js — 自动打款纯提现
-import request from '../../../../utils/request.js';
-import PopupService from '../../../../services/popupService.js';
-
-const app = getApp();
-
-const ASSET_CONFIG = {
- dashou_yue: { leixing: 1, label: '接单员佣金' },
- guanshi_fenyong: { leixing: 2, label: '管事分红' },
- zuzhang_fenyong: { leixing: 3, label: '组长分红' },
- kaoheguan_fenyong: { leixing: 4, label: '考核官分佣' },
- dashou_yajin: { leixing: 5, label: '接单员保证金' },
- shangjia_yue: { leixing: 6, label: '商家余额' },
-};
-
-/** 页面入参 from 与资产 type 映射 */
-const FROM_ASSET_MAP = {
- dashou: 'dashou_yue',
- guanshi: 'guanshi_fenyong',
- zuzhang: 'zuzhang_fenyong',
- kaoheguan: 'kaoheguan_fenyong',
- kaohe: 'kaoheguan_fenyong',
- shangjia: 'shangjia_yue',
- yajin: 'dashou_yajin',
-};
-
-Component({
- properties: { options: { type: Object, value: {} } },
- data: {
- imgUrls: { iconWechat: '' },
- assetList: [],
- displayAssetList: [],
- totalAmount: '0.00',
- canWithdraw: false,
- selectedAsset: null,
- isLoadingAssets: false,
- tixianleixing: null,
- tixianjine: '',
- currentRate: '0.00',
- feeRateText: '--',
- showTixian: false,
- shouxufei: '0.00',
- shijidaozhang: '0.00',
- submitting: false,
- },
- lifetimes: {
- attached() {
- this.initImageUrls();
- this.loadAllAssets();
- },
- },
- pageLifetimes: {
- show() {
- this.registerNotificationComponent();
- this.loadAllAssets();
- PopupService.checkAndShow(this, 'tixian');
- },
- hide() {
- const popupComp = this.selectComponent('#popupNotice');
- if (popupComp && popupComp.cleanup) popupComp.cleanup();
- },
- },
- methods: {
- registerNotificationComponent() {
- const notificationComp = this.selectComponent('#global-notification');
- if (notificationComp && notificationComp.showNotification) {
- app.globalData.globalNotification = {
- show: (data) => notificationComp.showNotification(data),
- hide: () => notificationComp.hideNotification(),
- };
- }
- },
-
- gengxinYue(data, leixing) {
- if (!data) return;
- if (data.new_yongjin !== undefined && data.new_yongjin !== null) {
- app.globalData.yongjin = data.new_yongjin;
- }
- if (data.new_fenyong !== undefined && data.new_fenyong !== null) {
- app.globalData.guanshi.fenyongtixian = data.new_fenyong;
- }
- if (data.new_yajin !== undefined && data.new_yajin !== null) {
- app.globalData.yajin = data.new_yajin;
- }
- if (data.new_shangjia_yue !== undefined && data.new_shangjia_yue !== null) {
- if (app.globalData.shangjia) app.globalData.shangjia.sjyue = data.new_shangjia_yue;
- }
- if (data.current_rate !== undefined && leixing) {
- const rate = parseFloat(data.current_rate);
- const rateKeyMap = { 1: 'dashouRate', 5: 'dashou_yajin_rate', 6: 'shangjia_rate', 2: 'guanshi_rate', 3: 'zuzhang_rate', 4: 'kaoheguan_rate' };
- const key = rateKeyMap[leixing];
- if (key) wx.setStorageSync(key, rate);
- }
- },
-
- initImageUrls() {
- const ossBase = app.globalData.ossImageUrl || '';
- const imgDir = `${ossBase}beijing/tixian/`;
- this.setData({
- imgUrls: {
- iconWechat: `${imgDir}icon_wechat.png`,
- },
- });
- },
-
- /** 顶部展示:不含保证金的可提现合计 */
- calcDisplayTotal(assets) {
- let total = 0;
- (assets || []).forEach((item) => {
- if (item.type === 'dashou_yajin') return;
- total += parseFloat(item.amount) || 0;
- });
- return total;
- },
-
- hasAnyWithdrawable(assets) {
- return (assets || []).some((item) => parseFloat(item.amount) > 0);
- },
-
- applyRouteOptions(assets) {
- const opts = this.properties.options || {};
- const fromKey = FROM_ASSET_MAP[opts.from];
- let selected = null;
- if (fromKey) {
- selected = assets.find((a) => a.type === fromKey) || null;
- } else if (assets.length === 1) {
- selected = assets[0];
- }
- const patch = {};
- if (selected) {
- patch.selectedAsset = selected;
- patch.tixianleixing = selected.leixing;
- patch.feeRateText = selected.rateText;
- }
- if (opts.amount && parseFloat(opts.amount) > 0) {
- const amt = parseFloat(opts.amount);
- const max = selected ? parseFloat(selected.amount) : amt;
- patch.tixianjine = Math.min(amt, max).toFixed(2);
- }
- if (Object.keys(patch).length) {
- this.setData(patch, () => {
- this.recalcFee(this.data.tixianjine, this.data.selectedAsset);
- });
- }
- },
-
- onSelectAsset(e) {
- const index = e.currentTarget.dataset.index;
- const asset = this.data.displayAssetList[index];
- if (!asset || parseFloat(asset.amount) <= 0) {
- wx.showToast({ title: '该账户无可提余额', icon: 'none' });
- return;
- }
- let jine = this.data.tixianjine;
- const max = parseFloat(asset.amount);
- if (jine && parseFloat(jine) > max) {
- jine = asset.amount;
- }
- this.setData({
- selectedAsset: asset,
- tixianleixing: asset.leixing,
- tixianjine: jine,
- });
- this.recalcFee(jine, asset);
- },
-
- async loadAllAssets() {
- this.setData({ isLoadingAssets: true, totalAmount: '0.00', canWithdraw: false, assetList: [] });
- try {
- const res = await request({ url: '/yonghu/tixianzichan', method: 'POST' });
- if (res?.data?.code === 200 || res?.data?.code === 0) {
- const data = res.data.data || {};
- const assets = [];
- const pushAsset = (type, amount, rate) => {
- const cfg = ASSET_CONFIG[type];
- if (!cfg || !amount || parseFloat(amount) <= 0) return;
- assets.push({
- type,
- leixing: cfg.leixing,
- label: cfg.label,
- amount: parseFloat(amount).toFixed(2),
- rate: rate || 0,
- rateText: this.formatRatePercent(rate || 0),
- });
- };
- pushAsset('dashou_yue', data.dashou_yue, data.dashou_rate);
- pushAsset('dashou_yajin', data.dashou_yajin, data.dashou_yajin_rate);
- pushAsset('shangjia_yue', data.shangjia_yue, data.shangjia_rate);
- pushAsset('guanshi_fenyong', data.guanshi_fenyong, data.guanshi_rate);
- pushAsset('zuzhang_fenyong', data.zuzhang_fenyong, data.zuzhang_rate);
- pushAsset('kaoheguan_fenyong', data.kaoheguan_fenyong, data.kaoheguan_rate);
-
- const displayTotal = this.calcDisplayTotal(assets);
- const firstRate = assets.find((a) => a.type !== 'dashou_yajin')?.rate || 0;
- this.setData({
- assetList: assets,
- displayAssetList: assets,
- totalAmount: displayTotal.toFixed(2),
- canWithdraw: this.hasAnyWithdrawable(assets),
- isLoadingAssets: false,
- feeRateText: displayTotal > 0 ? this.formatRatePercent(firstRate) : '--',
- }, () => this.applyRouteOptions(assets));
- if (!this.data.selectedAsset) {
- this.recalcFee(this.data.tixianjine, null);
- }
- } else {
- throw new Error(res?.data?.msg || '获取资产失败');
- }
- } catch (err) {
- console.error('loadAllAssets', err);
- this.setData({ isLoadingAssets: false, totalAmount: '0.00', canWithdraw: false, assetList: [] });
- }
- },
-
- formatRatePercent(rate) {
- const r = parseFloat(rate) || 0;
- if (r <= 1 && r > 0) return `${(r * 100).toFixed(0)}%`;
- return `${r}%`;
- },
-
- recalcFee(amountStr, asset) {
- const amount = parseFloat(amountStr);
- if (!amountStr || isNaN(amount) || amount <= 0 || !asset) {
- this.setData({
- shouxufei: '0.00',
- shijidaozhang: '0.00',
- feeRateText: asset ? this.formatRatePercent(asset.rate) : this.data.feeRateText,
- });
- return;
- }
- const rate = parseFloat(asset.rate) || 0;
- const fee = amount * rate;
- const actual = amount - fee;
- this.setData({
- shouxufei: fee.toFixed(2),
- shijidaozhang: actual.toFixed(2),
- feeRateText: this.formatRatePercent(rate),
- currentRate: this.formatRatePercent(rate),
- });
- },
-
- onJineInput(e) {
- const val = e.detail.value;
- this.setData({ tixianjine: val });
- this.recalcFee(val, this.data.selectedAsset);
- },
-
- onWithdrawAll() {
- const { selectedAsset } = this.data;
- if (!selectedAsset) {
- wx.showToast({ title: '请先选择提现账户', icon: 'none' });
- return;
- }
- const max = selectedAsset.amount;
- this.setData({ tixianjine: max });
- this.recalcFee(max, selectedAsset);
- },
-
- onTapWithdraw() {
- if (this.data.submitting) return;
- if (!this.hasAnyWithdrawable(this.data.assetList)) {
- wx.showToast({ title: '暂无可提现余额', icon: 'none' });
- return;
- }
- const { selectedAsset, tixianjine } = this.data;
- if (!selectedAsset) {
- wx.showToast({ title: '请先选择要提现的账户', icon: 'none' });
- return;
- }
- const jineValue = parseFloat(tixianjine);
- if (!tixianjine || isNaN(jineValue) || jineValue <= 0) {
- wx.showToast({ title: '请输入有效金额', icon: 'none' });
- return;
- }
- if (jineValue <= 0.1) {
- wx.showToast({ title: '提现金额须大于0.1元', icon: 'none' });
- return;
- }
- if (jineValue > parseFloat(selectedAsset.amount)) {
- wx.showToast({ title: `超过${selectedAsset.label}可提余额`, icon: 'none' });
- return;
- }
- this.applyIdentityAndConfirm(selectedAsset);
- },
-
- applyIdentityAndConfirm(asset) {
- this.recalcFee(this.data.tixianjine, asset);
- this.setData({
- selectedAsset: asset,
- tixianleixing: asset.leixing,
- currentRate: this.formatRatePercent(asset.rate),
- showTixian: true,
- });
- },
-
- async onConfirmTixian() {
- if (this.data.submitting) return;
- const { tixianleixing, tixianjine, selectedAsset } = this.data;
- if (!tixianleixing || !selectedAsset) {
- wx.showToast({ title: '请选择提现身份', icon: 'none' });
- return;
- }
- const jineValue = parseFloat(tixianjine);
- if (!tixianjine || isNaN(jineValue) || jineValue <= 0) {
- wx.showToast({ title: '请输入有效金额', icon: 'none' });
- return;
- }
- if (jineValue > parseFloat(selectedAsset.amount)) {
- wx.showToast({ title: `超过${selectedAsset.label}可提余额`, icon: 'none' });
- return;
- }
-
- this.setData({ submitting: true });
- try {
- const res = await request({
- url: '/yonghu/zddksh',
- method: 'POST',
- data: { leixing: tixianleixing, jine: jineValue.toFixed(2) },
- });
- if (res.statusCode === 200 && res.data && res.data.code === 0) {
- const data = res.data.data || {};
- this.gengxinYue(data, tixianleixing);
- this.setData({
- showTixian: false,
- submitting: false,
- selectedAsset: null,
- tixianjine: '',
- shouxufei: '0.00',
- shijidaozhang: '0.00',
- });
- await this.loadAllAssets();
- wx.showModal({
- title: '申请成功',
- content: '提现申请已提交,请前往「提现记录」查看进度;审核通过后可在该页点击「收款」确认到账。',
- confirmText: '查看提现记录',
- cancelText: '知道了',
- success: (res) => {
- if (res.confirm) {
- wx.navigateTo({ url: '/pages/withdraw/withdraw-records' });
- }
- },
- });
- } else {
- wx.showModal({ title: '提现申请失败', content: res.data?.msg || '未知错误', showCancel: false });
- this.setData({ submitting: false });
- }
- } catch (err) {
- wx.showModal({ title: '网络错误', content: '网络连接失败,请稍后重试', showCancel: false });
- this.setData({ submitting: false });
- }
- },
-
- onCloseTixian() {
- if (this.data.submitting) {
- wx.showToast({ title: '正在处理中,请稍后', icon: 'none' });
- return;
- }
- this.setData({
- showTixian: false,
- selectedAsset: null,
- tixianleixing: null,
- shouxufei: '0.00',
- shijidaozhang: '0.00',
- });
- },
-
- stopPropagation() {},
- },
-});
+// pages/withdraw/components/mode2/mode2.js — 自动打款纯提现
+import request from '../../../../utils/request.js';
+import PopupService from '../../../../services/popupService.js';
+
+const app = getApp();
+
+const ASSET_CONFIG = {
+ dashou_yue: { leixing: 1, label: '接单员佣金' },
+ guanshi_fenyong: { leixing: 2, label: '管事分红' },
+ zuzhang_fenyong: { leixing: 3, label: '组长分红' },
+ kaoheguan_fenyong: { leixing: 4, label: '考核官分佣' },
+ dashou_yajin: { leixing: 5, label: '接单员保证金' },
+ shangjia_yue: { leixing: 6, label: '商家余额' },
+};
+
+/** 页面入参 from 与资产 type 映射 */
+const FROM_ASSET_MAP = {
+ dashou: 'dashou_yue',
+ guanshi: 'guanshi_fenyong',
+ zuzhang: 'zuzhang_fenyong',
+ kaoheguan: 'kaoheguan_fenyong',
+ kaohe: 'kaoheguan_fenyong',
+ shangjia: 'shangjia_yue',
+ yajin: 'dashou_yajin',
+};
+
+Component({
+ properties: { options: { type: Object, value: {} } },
+ data: {
+ imgUrls: { iconWechat: '' },
+ assetList: [],
+ displayAssetList: [],
+ totalAmount: '0.00',
+ canWithdraw: false,
+ selectedAsset: null,
+ isLoadingAssets: false,
+ tixianleixing: null,
+ tixianjine: '',
+ currentRate: '0.00',
+ feeRateText: '--',
+ showTixian: false,
+ shouxufei: '0.00',
+ shijidaozhang: '0.00',
+ submitting: false,
+ },
+ lifetimes: {
+ attached() {
+ this.initImageUrls();
+ this.loadAllAssets();
+ },
+ },
+ pageLifetimes: {
+ show() {
+ this.registerNotificationComponent();
+ this.loadAllAssets();
+ PopupService.checkAndShow(this, 'tixian');
+ },
+ hide() {
+ const popupComp = this.selectComponent('#popupNotice');
+ if (popupComp && popupComp.cleanup) popupComp.cleanup();
+ },
+ },
+ methods: {
+ registerNotificationComponent() {
+ const notificationComp = this.selectComponent('#global-notification');
+ if (notificationComp && notificationComp.showNotification) {
+ app.globalData.globalNotification = {
+ show: (data) => notificationComp.showNotification(data),
+ hide: () => notificationComp.hideNotification(),
+ };
+ }
+ },
+
+ gengxinYue(data, leixing) {
+ if (!data) return;
+ if (data.new_yongjin !== undefined && data.new_yongjin !== null) {
+ app.globalData.yongjin = data.new_yongjin;
+ }
+ if (data.new_fenyong !== undefined && data.new_fenyong !== null) {
+ app.globalData.guanshi.fenyongtixian = data.new_fenyong;
+ }
+ if (data.new_yajin !== undefined && data.new_yajin !== null) {
+ app.globalData.yajin = data.new_yajin;
+ }
+ if (data.new_shangjia_yue !== undefined && data.new_shangjia_yue !== null) {
+ if (app.globalData.shangjia) app.globalData.shangjia.sjyue = data.new_shangjia_yue;
+ }
+ if (data.current_rate !== undefined && leixing) {
+ const rate = parseFloat(data.current_rate);
+ const rateKeyMap = { 1: 'dashouRate', 5: 'dashou_yajin_rate', 6: 'shangjia_rate', 2: 'guanshi_rate', 3: 'zuzhang_rate', 4: 'kaoheguan_rate' };
+ const key = rateKeyMap[leixing];
+ if (key) wx.setStorageSync(key, rate);
+ }
+ },
+
+ initImageUrls() {
+ const ossBase = app.globalData.ossImageUrl || '';
+ const imgDir = `${ossBase}beijing/tixian/`;
+ this.setData({
+ imgUrls: {
+ iconWechat: `${imgDir}icon_wechat.png`,
+ },
+ });
+ },
+
+ /** 顶部展示:不含保证金的可提现合计 */
+ calcDisplayTotal(assets) {
+ let total = 0;
+ (assets || []).forEach((item) => {
+ if (item.type === 'dashou_yajin') return;
+ total += parseFloat(item.amount) || 0;
+ });
+ return total;
+ },
+
+ hasAnyWithdrawable(assets) {
+ return (assets || []).some((item) => parseFloat(item.amount) > 0);
+ },
+
+ applyRouteOptions(assets) {
+ const opts = this.properties.options || {};
+ const fromKey = FROM_ASSET_MAP[opts.from];
+ let selected = null;
+ if (fromKey) {
+ selected = assets.find((a) => a.type === fromKey) || null;
+ } else if (assets.length === 1) {
+ selected = assets[0];
+ }
+ const patch = {};
+ if (selected) {
+ patch.selectedAsset = selected;
+ patch.tixianleixing = selected.leixing;
+ patch.feeRateText = selected.rateText;
+ }
+ if (opts.amount && parseFloat(opts.amount) > 0) {
+ const amt = parseFloat(opts.amount);
+ const max = selected ? parseFloat(selected.amount) : amt;
+ patch.tixianjine = Math.min(amt, max).toFixed(2);
+ }
+ if (Object.keys(patch).length) {
+ this.setData(patch, () => {
+ this.recalcFee(this.data.tixianjine, this.data.selectedAsset);
+ });
+ }
+ },
+
+ onSelectAsset(e) {
+ const index = e.currentTarget.dataset.index;
+ const asset = this.data.displayAssetList[index];
+ if (!asset || parseFloat(asset.amount) <= 0) {
+ wx.showToast({ title: '该账户无可提余额', icon: 'none' });
+ return;
+ }
+ let jine = this.data.tixianjine;
+ const max = parseFloat(asset.amount);
+ if (jine && parseFloat(jine) > max) {
+ jine = asset.amount;
+ }
+ this.setData({
+ selectedAsset: asset,
+ tixianleixing: asset.leixing,
+ tixianjine: jine,
+ });
+ this.recalcFee(jine, asset);
+ },
+
+ async loadAllAssets() {
+ this.setData({ isLoadingAssets: true, totalAmount: '0.00', canWithdraw: false, assetList: [] });
+ try {
+ const res = await request({ url: '/yonghu/tixianzichan', method: 'POST' });
+ if (res?.data?.code === 200 || res?.data?.code === 0) {
+ const data = res.data.data || {};
+ const assets = [];
+ const pushAsset = (type, amount, rate) => {
+ const cfg = ASSET_CONFIG[type];
+ if (!cfg || !amount || parseFloat(amount) <= 0) return;
+ assets.push({
+ type,
+ leixing: cfg.leixing,
+ label: cfg.label,
+ amount: parseFloat(amount).toFixed(2),
+ rate: rate || 0,
+ rateText: this.formatRatePercent(rate || 0),
+ });
+ };
+ pushAsset('dashou_yue', data.dashou_yue, data.dashou_rate);
+ pushAsset('dashou_yajin', data.dashou_yajin, data.dashou_yajin_rate);
+ pushAsset('shangjia_yue', data.shangjia_yue, data.shangjia_rate);
+ pushAsset('guanshi_fenyong', data.guanshi_fenyong, data.guanshi_rate);
+ pushAsset('zuzhang_fenyong', data.zuzhang_fenyong, data.zuzhang_rate);
+ pushAsset('kaoheguan_fenyong', data.kaoheguan_fenyong, data.kaoheguan_rate);
+
+ const displayTotal = this.calcDisplayTotal(assets);
+ const firstRate = assets.find((a) => a.type !== 'dashou_yajin')?.rate || 0;
+ this.setData({
+ assetList: assets,
+ displayAssetList: assets,
+ totalAmount: displayTotal.toFixed(2),
+ canWithdraw: this.hasAnyWithdrawable(assets),
+ isLoadingAssets: false,
+ feeRateText: displayTotal > 0 ? this.formatRatePercent(firstRate) : '--',
+ }, () => this.applyRouteOptions(assets));
+ if (!this.data.selectedAsset) {
+ this.recalcFee(this.data.tixianjine, null);
+ }
+ } else {
+ throw new Error(res?.data?.msg || '获取资产失败');
+ }
+ } catch (err) {
+ console.error('loadAllAssets', err);
+ this.setData({ isLoadingAssets: false, totalAmount: '0.00', canWithdraw: false, assetList: [] });
+ }
+ },
+
+ formatRatePercent(rate) {
+ const r = parseFloat(rate) || 0;
+ if (r <= 1 && r > 0) return `${(r * 100).toFixed(0)}%`;
+ return `${r}%`;
+ },
+
+ recalcFee(amountStr, asset) {
+ const amount = parseFloat(amountStr);
+ if (!amountStr || isNaN(amount) || amount <= 0 || !asset) {
+ this.setData({
+ shouxufei: '0.00',
+ shijidaozhang: '0.00',
+ feeRateText: asset ? this.formatRatePercent(asset.rate) : this.data.feeRateText,
+ });
+ return;
+ }
+ const rate = parseFloat(asset.rate) || 0;
+ const fee = amount * rate;
+ const actual = amount - fee;
+ this.setData({
+ shouxufei: fee.toFixed(2),
+ shijidaozhang: actual.toFixed(2),
+ feeRateText: this.formatRatePercent(rate),
+ currentRate: this.formatRatePercent(rate),
+ });
+ },
+
+ onJineInput(e) {
+ const val = e.detail.value;
+ this.setData({ tixianjine: val });
+ this.recalcFee(val, this.data.selectedAsset);
+ },
+
+ onWithdrawAll() {
+ const { selectedAsset } = this.data;
+ if (!selectedAsset) {
+ wx.showToast({ title: '请先选择提现账户', icon: 'none' });
+ return;
+ }
+ const max = selectedAsset.amount;
+ this.setData({ tixianjine: max });
+ this.recalcFee(max, selectedAsset);
+ },
+
+ onTapWithdraw() {
+ if (this.data.submitting) return;
+ if (!this.hasAnyWithdrawable(this.data.assetList)) {
+ wx.showToast({ title: '暂无可提现余额', icon: 'none' });
+ return;
+ }
+ const { selectedAsset, tixianjine } = this.data;
+ if (!selectedAsset) {
+ wx.showToast({ title: '请先选择要提现的账户', icon: 'none' });
+ return;
+ }
+ const jineValue = parseFloat(tixianjine);
+ if (!tixianjine || isNaN(jineValue) || jineValue <= 0) {
+ wx.showToast({ title: '请输入有效金额', icon: 'none' });
+ return;
+ }
+ if (jineValue <= 0.1) {
+ wx.showToast({ title: '提现金额须大于0.1元', icon: 'none' });
+ return;
+ }
+ if (jineValue > parseFloat(selectedAsset.amount)) {
+ wx.showToast({ title: `超过${selectedAsset.label}可提余额`, icon: 'none' });
+ return;
+ }
+ this.applyIdentityAndConfirm(selectedAsset);
+ },
+
+ applyIdentityAndConfirm(asset) {
+ this.recalcFee(this.data.tixianjine, asset);
+ this.setData({
+ selectedAsset: asset,
+ tixianleixing: asset.leixing,
+ currentRate: this.formatRatePercent(asset.rate),
+ showTixian: true,
+ });
+ },
+
+ async onConfirmTixian() {
+ if (this.data.submitting) return;
+ const { tixianleixing, tixianjine, selectedAsset } = this.data;
+ if (!tixianleixing || !selectedAsset) {
+ wx.showToast({ title: '请选择提现身份', icon: 'none' });
+ return;
+ }
+ const jineValue = parseFloat(tixianjine);
+ if (!tixianjine || isNaN(jineValue) || jineValue <= 0) {
+ wx.showToast({ title: '请输入有效金额', icon: 'none' });
+ return;
+ }
+ if (jineValue > parseFloat(selectedAsset.amount)) {
+ wx.showToast({ title: `超过${selectedAsset.label}可提余额`, icon: 'none' });
+ return;
+ }
+
+ this.setData({ submitting: true });
+ try {
+ const res = await request({
+ url: '/yonghu/zddksh',
+ method: 'POST',
+ data: { leixing: tixianleixing, jine: jineValue.toFixed(2) },
+ });
+ if (res.statusCode === 200 && res.data && res.data.code === 0) {
+ const data = res.data.data || {};
+ this.gengxinYue(data, tixianleixing);
+ this.setData({
+ showTixian: false,
+ submitting: false,
+ selectedAsset: null,
+ tixianjine: '',
+ shouxufei: '0.00',
+ shijidaozhang: '0.00',
+ });
+ await this.loadAllAssets();
+ wx.showModal({
+ title: '申请成功',
+ content: '提现申请已提交,请前往「提现记录」查看进度;审核通过后可在该页点击「收款」确认到账。',
+ confirmText: '查看提现记录',
+ cancelText: '知道了',
+ success: (res) => {
+ if (res.confirm) {
+ wx.navigateTo({ url: '/pages/withdraw/withdraw-records' });
+ }
+ },
+ });
+ } else {
+ wx.showModal({ title: '提现申请失败', content: res.data?.msg || '未知错误', showCancel: false });
+ this.setData({ submitting: false });
+ }
+ } catch (err) {
+ wx.showModal({ title: '网络错误', content: '网络连接失败,请稍后重试', showCancel: false });
+ this.setData({ submitting: false });
+ }
+ },
+
+ onCloseTixian() {
+ if (this.data.submitting) {
+ wx.showToast({ title: '正在处理中,请稍后', icon: 'none' });
+ return;
+ }
+ this.setData({
+ showTixian: false,
+ selectedAsset: null,
+ tixianleixing: null,
+ shouxufei: '0.00',
+ shijidaozhang: '0.00',
+ });
+ },
+
+ stopPropagation() {},
+ },
+});
diff --git a/pages/withdraw/components/record-mode2/record-mode2.js b/pages/withdraw/components/record-mode2/record-mode2.js
index 6d441ae..c2d94f6 100644
--- a/pages/withdraw/components/record-mode2/record-mode2.js
+++ b/pages/withdraw/components/record-mode2/record-mode2.js
@@ -356,6 +356,15 @@ Component({
collectConfirmRecord: record,
});
this.tiaoqiWeixinQueRen(data.package_info);
+ } else if (res.data && res.data.code === 12) {
+ wx.showModal({
+ title: '收款处理中',
+ content: (res.data.msg || '请等待几秒后再次点击「收款」') + ',无需重新申请提现。',
+ showCancel: false,
+ complete: () => {
+ this.setData({ submitting: false, collectConfirmRecord: null });
+ },
+ });
} else {
wx.showModal({ title: '收款失败', content: res.data?.msg || '无法发起收款,请稍后重试', showCancel: false });
this.setData({ submitting: false, collectConfirmRecord: null });
diff --git a/pages/withdraw/withdraw.wxss b/pages/withdraw/withdraw.wxss
index 2606acf..b4801ac 100644
--- a/pages/withdraw/withdraw.wxss
+++ b/pages/withdraw/withdraw.wxss
@@ -1,40 +1,40 @@
-/* pages/withdraw/withdraw.wxss */
-.tixian-container {
- width: 100%;
- min-height: 100vh;
- background: #f5f5f5;
-}
-
-/* 加载状态 */
-.loading-center, .error-center {
- height: 100vh;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- color: #666;
- background: #f5f5f5;
-}
-
-.loading-spinner {
- border: 4rpx solid rgba(157, 78, 221, 0.3);
- border-top-color: #9d4edd;
- margin-bottom: 30rpx;
-}
-
-.loading-text {
- font-size: 28rpx;
- color: rgba(255, 255, 255, 0.7);
-}
-
-.error-text {
- font-size: 28rpx;
- margin-bottom: 30rpx;
-}
-
-.retry-btn {
- padding: 20rpx 60rpx;
- background: linear-gradient(90deg, #6a11cb, #2575fc);
- color: white;
- font-size: 28rpx;
-}
+/* pages/withdraw/withdraw.wxss */
+.tixian-container {
+ width: 100%;
+ min-height: 100vh;
+ background: #f5f5f5;
+}
+
+/* 加载状态 */
+.loading-center, .error-center {
+ height: 100vh;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ color: #666;
+ background: #f5f5f5;
+}
+
+.loading-spinner {
+ border: 4rpx solid rgba(157, 78, 221, 0.3);
+ border-top-color: #9d4edd;
+ margin-bottom: 30rpx;
+}
+
+.loading-text {
+ font-size: 28rpx;
+ color: rgba(255, 255, 255, 0.7);
+}
+
+.error-text {
+ font-size: 28rpx;
+ margin-bottom: 30rpx;
+}
+
+.retry-btn {
+ padding: 20rpx 60rpx;
+ background: linear-gradient(90deg, #6a11cb, #2575fc);
+ color: white;
+ font-size: 28rpx;
+}
diff --git a/project.config.json b/project.config.json
index cd3eb56..49f283a 100644
--- a/project.config.json
+++ b/project.config.json
@@ -62,6 +62,6 @@
],
"include": []
},
- "appid": "wxdefa454152e78a03",
+ "appid": "wx7ff90e9d024fcdb8",
"simulatorPluginLibVersion": {}
}
\ No newline at end of file
diff --git a/utils/club-context.js b/utils/club-context.js
index 4d51548..45bbce4 100644
--- a/utils/club-context.js
+++ b/utils/club-context.js
@@ -9,6 +9,7 @@ const DEFAULT_CLUB_ID = CONFIG_CLUB_ID || 'xq';
export const CLUB_API = {
wechatLogin: '/jituan/auth/wechat-login',
+ refreshWxBind: '/jituan/auth/refresh-wx-bind',
dashouRegister: '/jituan/auth/dashou-register',
clubList: '/jituan/club/list',
};
diff --git a/utils/login.js b/utils/login.js
index bfafed9..7da1531 100644
--- a/utils/login.js
+++ b/utils/login.js
@@ -10,6 +10,30 @@ import { CLUB_API, getClubId, setClubId, buildClubHeaders } from './club-context
const app = getApp();
+/** 有 token 时静默刷新当前小程序 openid 绑定(支付 AppID 对齐) */
+function silentRefreshWxBind(app) {
+ const token = getSessionToken(app);
+ if (!token) return;
+ wx.login({
+ success: (loginRes) => {
+ if (!loginRes.code || !app.globalData.apiBaseUrl) return;
+ wx.request({
+ url: app.globalData.apiBaseUrl + CLUB_API.refreshWxBind,
+ method: 'POST',
+ data: {
+ code: loginRes.code,
+ club_id: getClubId(app),
+ app_id: app.globalData.appId || '',
+ },
+ header: buildClubHeaders({
+ 'content-type': 'application/json',
+ Authorization: 'Bearer ' + token,
+ }),
+ });
+ },
+ });
+}
+
export function ensureLogin(options = {}) {
const silent = options.silent !== false;
const page = options.page || null;
@@ -17,6 +41,7 @@ export function ensureLogin(options = {}) {
if (token) {
backfillUserProfileCache(app);
restoreStaffContextAfterAuth();
+ silentRefreshWxBind(app);
return Promise.resolve(true);
}
diff --git a/utils/miniapp-icons.js b/utils/miniapp-icons.js
index 6192e08..aeddbde 100644
--- a/utils/miniapp-icons.js
+++ b/utils/miniapp-icons.js
@@ -36,6 +36,7 @@ export const ICON_KEYS = {
FIGHTER_RECHARGE_ADVANTAGE_2: 'fighter_recharge_advantage_2',
FIGHTER_RECHARGE_ADVANTAGE_3: 'fighter_recharge_advantage_3',
FIGHTER_RECHARGE_ADVANTAGE_4: 'fighter_recharge_advantage_4',
+ FIGHTER_COMPLAINT_RECORD: 'fighter_complaint_record',
FIGHTER_ORDER_PENDING: 'fighter_order_pending',
FIGHTER_ORDER_SETTLING: 'fighter_order_settling',
FIGHTER_ORDER_DONE: 'fighter_order_done',