From 16eecd1278962ef18a5439826a2bfdcc119b79f1 Mon Sep 17 00:00:00 2001 From: XingQue Date: Sun, 26 Jul 2026 18:39:32 +0800 Subject: [PATCH] =?UTF-8?q?checkpoint:=20=E5=86=BB=E7=BB=93=E8=B5=84?= =?UTF-8?q?=E9=87=91=E5=BC=80=E5=B7=A5=E5=89=8D=E9=BE=99=E5=85=88=E7=94=9F?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=9C=AC=E5=9C=B0=E5=A4=87=E4=BB=BD?= =?UTF-8?q?=EF=BC=88=E4=B8=8D=E6=8E=A8=E8=BF=9C=E7=A8=8B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- app.json | 11 +- components/tousu-float/tousu-float.js | 58 ++ components/tousu-float/tousu-float.json | 1 + components/tousu-float/tousu-float.wxml | 6 + components/tousu-float/tousu-float.wxss | 37 + config/club-config.js | 8 +- pages/accept-order/accept-order.js | 4 + pages/accept-order/accept-order.wxml | 6 + pages/accept-order/accept-order.wxss | 28 + pages/fighter-recharge/fighter-deposit.js | 77 ++ pages/fighter-recharge/fighter-deposit.wxml | 4 +- pages/fighter-recharge/fighter-recharge.js | 84 +- pages/fighter-recharge/fighter-recharge.wxml | 8 +- pages/fighter/fighter.js | 15 +- pages/fighter/fighter.json | 3 +- pages/fighter/fighter.wxml | 5 +- pages/fighter/fighter.wxss | 18 + pages/gongdan/chongzhi-list/chongzhi-list.js | 27 + .../gongdan/chongzhi-list/chongzhi-list.json | 1 + .../gongdan/chongzhi-list/chongzhi-list.wxml | 13 + .../gongdan/chongzhi-list/chongzhi-list.wxss | 9 + pages/gongdan/create/create.js | 154 +++ pages/gongdan/create/create.json | 1 + pages/gongdan/create/create.wxml | 57 ++ pages/gongdan/create/create.wxss | 20 + pages/gongdan/detail/detail.js | 63 ++ pages/gongdan/detail/detail.json | 1 + pages/gongdan/detail/detail.wxml | 34 + pages/gongdan/detail/detail.wxss | 14 + pages/gongdan/list/list.js | 26 + pages/gongdan/list/list.json | 1 + pages/gongdan/list/list.wxml | 13 + pages/gongdan/list/list.wxss | 13 + pages/manager-assign/manager-assign.json | 2 +- .../merchant-order-detail.js | 97 +- .../merchant-order-detail.wxml | 10 + .../merchant-order-detail.wxss | 39 + pages/merchant/merchant.js | 30 +- pages/messages/messages.json | 2 +- pages/mine/mine.js | 5 + pages/mine/mine.json | 3 +- pages/mine/mine.wxml | 23 +- pages/verify/verify.js | 6 + pages/withdraw/components/mode1/mode1.js | 880 +++++++++--------- pages/withdraw/components/mode1/mode1.wxml | 230 ++--- pages/withdraw/components/mode1/mode1.wxss | 170 ++-- pages/withdraw/components/mode2/mode2.js | 738 +++++++-------- .../components/record-mode2/record-mode2.js | 9 + pages/withdraw/withdraw.wxss | 80 +- project.config.json | 2 +- utils/club-context.js | 1 + utils/login.js | 25 + utils/miniapp-icons.js | 1 + 53 files changed, 2057 insertions(+), 1116 deletions(-) create mode 100644 components/tousu-float/tousu-float.js create mode 100644 components/tousu-float/tousu-float.json create mode 100644 components/tousu-float/tousu-float.wxml create mode 100644 components/tousu-float/tousu-float.wxss create mode 100644 pages/gongdan/chongzhi-list/chongzhi-list.js create mode 100644 pages/gongdan/chongzhi-list/chongzhi-list.json create mode 100644 pages/gongdan/chongzhi-list/chongzhi-list.wxml create mode 100644 pages/gongdan/chongzhi-list/chongzhi-list.wxss create mode 100644 pages/gongdan/create/create.js create mode 100644 pages/gongdan/create/create.json create mode 100644 pages/gongdan/create/create.wxml create mode 100644 pages/gongdan/create/create.wxss create mode 100644 pages/gongdan/detail/detail.js create mode 100644 pages/gongdan/detail/detail.json create mode 100644 pages/gongdan/detail/detail.wxml create mode 100644 pages/gongdan/detail/detail.wxss create mode 100644 pages/gongdan/list/list.js create mode 100644 pages/gongdan/list/list.json create mode 100644 pages/gongdan/list/list.wxml create mode 100644 pages/gongdan/list/list.wxss 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(选填) + + + + + 投诉说明 * +