From a49f1e87ccd5fc250668b0e361bcac9d055b7fa4 Mon Sep 17 00:00:00 2001 From: tianyi <13521030702@163.com> Date: Mon, 10 Aug 2026 16:37:39 +0800 Subject: [PATCH] 1 --- pages/shop/goodsList.vue | 14 +- pages/shop/wallet.vue | 171 ++++++++++++----------- pages/worker/partTimeJobRegister.vue | 198 ++++++++++++++++++++------- pages/worker/wallet.vue | 142 +++++++++++++------ 4 files changed, 347 insertions(+), 178 deletions(-) diff --git a/pages/shop/goodsList.vue b/pages/shop/goodsList.vue index ce37d32..6f6f8ba 100644 --- a/pages/shop/goodsList.vue +++ b/pages/shop/goodsList.vue @@ -23,7 +23,7 @@ - + {{item.buyCountNew}} @@ -85,7 +85,7 @@ - + {{item.buyCountNew}} @@ -410,6 +410,16 @@ } }) }, + //查看大图 + largeImg(img) { + if (!img) return; + let shopImages = [] + shopImages.push(img) + uni.previewImage({ + current: shopImages[0], + urls: shopImages + }) + }, //点击左侧菜单切换 clickLeftBtn(index) { for (var i = 0; i < this.indexList.length; i++) { diff --git a/pages/shop/wallet.vue b/pages/shop/wallet.vue index 4413ec4..f46e2c0 100644 --- a/pages/shop/wallet.vue +++ b/pages/shop/wallet.vue @@ -25,7 +25,7 @@ - + WALLET @@ -39,8 +39,7 @@ {{ showBalance ? formatMoney(currentShopBalance) : '••••' }} - 🛡 - 当前第 {{activeShopIndex + 1}} / {{shopWallets.length}} 个店铺 + 当前第 {{activeShopIndex + 1}} / {{shopWallets.length}} 个店铺 @@ -64,6 +63,7 @@ 余额明细 + 点击不同身份查看余额明细 @@ -93,6 +93,7 @@ + @@ -102,14 +103,14 @@ - 支付宝认证手机号 - + 支付宝账号 + 提现金额 - + {{submittingWithdraw ? '提现中...' : '确认提现'}} @@ -151,6 +152,8 @@ balanceShop:[], submittingWithdraw: false, withdrawRequestId: '', + withdrawClickLocked: false, + withdrawClickTimer: null, showBalance: true, resolvingSettlementOrderId: false, skipWalletRefreshOnShow: false, @@ -217,6 +220,7 @@ } }, onShow() { + this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() if (this.skipWalletRefreshOnShow) { this.skipWalletRefreshOnShow = false return @@ -231,11 +235,14 @@ this.searchForm.pageNum+=1; this.rewardList(); }, + beforeDestroy() { + if (this.withdrawClickTimer) { + clearTimeout(this.withdrawClickTimer) + } + }, methods: { beginData(){ - this.NB.sendRequest("/worker/getAllDepo/", { - userId:uni.getStorageSync('id') - }, false, 'get', 'application/json').then((res) => { + this.NB.sendRequest("/worker/getAllDepo/", {userId:uni.getStorageSync('id')}, false, 'GET', 'application/x-www-form-urlencoded').then((res) => { if (res.code == 200) { if(res.result.user){ this.balanceUser = res.result.user @@ -249,14 +256,10 @@ this.syncActiveWallet() this.$forceUpdate(); } else { - uni.showToast({ - title: res.message, - icon: 'none' - }) - return + this.tui.toast(res.message) } uni.hideLoading() - }).catch((res) => {}); + }) }, //提现 withDraw(){ @@ -265,6 +268,7 @@ }) }, userCommion(type,commion,item){ + if (!this.lockWithdrawClick()) return const withdrawAmount = Number(commion) || 0 if(type=='user'){ this.commionUrl = '/app/returnCommission/handleReturnUser' @@ -284,6 +288,25 @@ createWithdrawRequestId(){ return `${Date.now()}${Math.floor(Math.random() * 1000000)}` }, + lockWithdrawClick(){ + if (this.withdrawClickLocked) return false + this.withdrawClickLocked = true + if (this.withdrawClickTimer) { + clearTimeout(this.withdrawClickTimer) + } + this.withdrawClickTimer = setTimeout(() => { + this.withdrawClickLocked = false + this.withdrawClickTimer = null + }, 800) + return true + }, + closeWithdrawPopup(){ + if (this.$refs.payPopup) { + this.$refs.payPopup.close() + } + this.submittingWithdraw = false + this.withdrawRequestId = '' + }, syncActiveWallet(){ if (this.targetWalletType) { const targetIndex = this.walletTabs.findIndex(tab => tab.key === this.targetWalletType) @@ -345,56 +368,45 @@ }, wxPayment(){ let that = this + if (!this.lockWithdrawClick()) return if (this.submittingWithdraw) { - uni.showToast({ - title: '提现处理中,请勿重复提交', - icon: 'none' - }); + that.tui.toast('提现处理中,请勿重复提交') return } const amount = Number(this.commionAmount) const maxAmount = Number(this.withdrawMaxAmount) || 0 if(!amount || amount < 1){ - uni.showToast({ - title: '提现金额不能小于1元', - icon: 'none' - }); + that.tui.toast('提现金额不能小于1元') return } if(amount > 5000){ - uni.showToast({ - title: '单笔提现金额不能超过5000元', - icon: 'none' - }); + that.tui.toast('单笔提现金额不能超过5000元') return } if(amount > maxAmount){ - uni.showToast({ - title: '提现金额不能超过可提现金额', - icon: 'none' - }); + that.tui.toast('提现金额不能超过可提现金额') + return + } + const aliName = (this.aliName || '').trim() + const aliAccount = (this.aliAccount || '').trim() + if(!aliName){ + that.tui.toast('支付宝实名名称不能为空') return } - if(!this.aliName){ - uni.showToast({ - title: '支付宝实名名称不能为空', - icon: 'none' - }); + if(!aliAccount){ + that.tui.toast('支付宝账号不能为空') return } - if(!this.aliAccount){ - uni.showToast({ - title: '支付宝手机号不能为空', - icon: 'none' - }); + if(!this.isValidAliAccount(aliAccount)){ + that.tui.toast('支付宝账号需为手机号或邮箱') return } this.submittingWithdraw = true let data = { id:this.withdrawRequestId || this.createWithdrawRequestId(), commission:amount, - aliName:this.aliName, - aliAccount:this.aliAccount + aliName:aliName, + aliAccount:aliAccount } if(this.commionType == 'user'){ data.userId = this.balanceUser.id @@ -403,28 +415,36 @@ }else{ data.shopId = this.shopId } - this.NB.sendRequest(this.commionUrl, data, false, 'POST', 'application/json').then((res) => { - if (res.code == 200) { - this.$refs.payPopup.close(); - this.withdrawRequestId = '' - this.beginData(); + this.NB.sendRequest(this.commionUrl, data, false, 'post', 'application/json').then((res) => { + that.loadStatus = 'nomore'; + const failMessage = that.getWithdrawErrorMessage(res) + if (res.code == 200 && !failMessage) { + that.closeWithdrawPopup() + that.beginData(); } else { - uni.showToast({ - title: res.message, - icon: 'none' - }); - that.submittingWithdraw = false + that.closeWithdrawPopup() + that.tui.toast(failMessage || '提现失败,请稍后再试', 2500) return } - that.submittingWithdraw = false uni.hideLoading() }).catch((res) => { - that.submittingWithdraw = false - uni.showToast({ - title: res.message, - icon: 'none' - }); - }); + that.closeWithdrawPopup() + that.tui.toast(that.getWithdrawErrorMessage(res) || '提现失败,请稍后再试', 2500) + }) + }, + isValidAliAccount(account){ + const value = (account || '').trim() + const phoneReg = /^1[3-9]\d{9}$/ + const emailReg = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ + return phoneReg.test(value) || emailReg.test(value) + }, + getWithdrawErrorMessage(res){ + if (!res) return '' + const message = res.message || res.msg || '' + const result = res.result || {} + const reason = result.failMessage || result.remark || message + if (res.code != 200 || res.success === false) return reason + return /失败|异常/.test(message) ? reason : '' }, chooseLinkId(type,item){ if(type == 'user'){ @@ -505,29 +525,23 @@ if (!this.canOpenShopOrder(item)) return if (this.resolvingSettlementOrderId) return this.resolvingSettlementOrderId = true - this.NB.sendRequest("/mall/order/orderIdBySettlementRecord/" + item.linkId, {}, false, 'GET', 'application/json').then((res) => { - if (res.code == 200) { + this.NB.sendRequest("/mall/order/orderIdBySettlementRecord/" + item.linkId, {}, false, 'GET', 'application/x-www-form-urlencoded').then((res) => { + if (res.code == 200 && res.result) { this.skipWalletRefreshOnShow = true uni.navigateTo({ - url: '/pages/shop/orderDetail?id=' + res.result, + url: '/package3/shop/orderDetail?id=' + res.result, fail: () => { this.skipWalletRefreshOnShow = false } }) } else { - uni.showToast({ - title: res.message || '未找到关联订单', - icon: 'none' - }); + this.tui.toast(res.message || '未找到关联订单') } this.resolvingSettlementOrderId = false }).catch((res) => { - uni.showToast({ - title: res && res.message ? res.message : '未找到关联订单', - icon: 'none' - }); + this.tui.toast(res && res.message ? res.message : '未找到关联订单') this.resolvingSettlementOrderId = false - }); + }) }, rewardList(){ this.loadStatus = 'loading' @@ -538,7 +552,7 @@ if (this.activeWalletType === 'user') { params.excludeDealingsWay = '免单奖励' } - this.NB.sendRequest("/mall/coupon/selectRewardByRegionId", params, false, 'POST', 'application/json').then((res) => { + this.NB.sendRequest("/mall/coupon/selectRewardByRegionId", params, false, 'post', 'application/json').then((res) => { that.loadStatus = 'nomore'; if (res.code == 200) { that.totalPages = res.result.pages @@ -549,14 +563,11 @@ } that.$forceUpdate() } else { - uni.showToast({ - title: res.message, - icon: 'none' - }); + that.tui.toast(res.message) return } uni.hideLoading() - }).catch((res) => {}); + }) }, back() { uni.navigateBack() @@ -1377,6 +1388,10 @@ transition: transform 0.16s ease; } + .popup-btn.disabled { + pointer-events: none; + } + /* ---------- 动画 ---------- */ .enter-card { animation: cardIn 0.46s ease both; diff --git a/pages/worker/partTimeJobRegister.vue b/pages/worker/partTimeJobRegister.vue index 97b77e4..e4b0384 100644 --- a/pages/worker/partTimeJobRegister.vue +++ b/pages/worker/partTimeJobRegister.vue @@ -24,15 +24,18 @@ - * 学生证上传 身份信息仅用于认证身份,平台会严格保密 - + + + × + @@ -87,9 +90,9 @@ - * 我的赚钱地盘 + * 我的赚钱地盘 - 选择你愿意配送的取货点和楼栋,再设置最低配送费。系统只会按这些范围给你派单。 + 外卖需选择愿意配送的取货点和楼栋;快递接单范围可稍后再设置。 @@ -150,7 +153,7 @@ 地盘 你还没有划定快递赚钱地盘 - 选择快递站和宿舍楼,系统才会把符合范围的快递单派给你。 + 可先提交注册,之后再选择快递站和宿舍楼来开启对应范围派单。 @@ -259,9 +262,16 @@ {{currentConfigType == 'waima' ? '生成外卖接单路线' : '生成快递接单路线'}} 选中的取货点和送达区域会两两组合生成路线,新路线默认使用本弹窗填写的最低配送费和备注。 + + {{waimaFullAreaOrder ? '已开启全域接单' : '全域接单'}} + + + 因校内区域较多,请手动选择接送单区域 + - 本次最低配送费 + 统一设置配送费 { + this.NB.sendRequest("/app/shopArea/getByParentId/" + JSON.parse(uni.getStorageSync('area')).regionId, {}, false, 'GET', 'application/x-www-form-urlencoded').then((res) => { if (res.code == 200) { if (res.result != null) { for (let m = 0; m < res.result.length; m++) { @@ -660,10 +681,9 @@ uni.showToast({ title: res.message, icon: 'none' - }); + }) return } - }) }, back() { @@ -674,6 +694,10 @@ this.bigImg = this.formData.studentCard; this.$refs.imgPopup.open() }, + clearStudentCard() { + this.formData.studentCard = '' + this.bigImg = '' + }, waimaOrpaotui(type) { if (type == 'waima') { this.formData.waima = !this.formData.waima @@ -701,6 +725,45 @@ }) this.$forceUpdate() }, + toggleWaimaFullAreaOrder() { + this.waimaFullAreaOrder = !this.waimaFullAreaOrder + this.buildRouteAreaOptions('waima') + }, + buildRouteAreaOptions(type) { + let that = this + this.qucan = []; + this.songcan = []; + let currentRuleList = type == 'waima' ? this.waimaRuleList : this.paotuiRuleList; + let isCanteenVal = type == 'waima' ? 1 : 2; + let isFullAreaOrder = type == 'waima' && this.waimaFullAreaOrder; + + this.shopArea.forEach(item => { + let isGetChecked = currentRuleList.some(r => r.getAreaId == item.id); + let isPutChecked = currentRuleList.some(r => r.putAreaId == item.id); + + if (isFullAreaOrder) { + that.qucan.push({ + ...item, + checked: isGetChecked + }); + that.songcan.push({ + ...item, + checked: isPutChecked + }); + } else if (item.isCanteen == isCanteenVal) { + that.qucan.push({ + ...item, + checked: isGetChecked + }); + } else { + that.songcan.push({ + ...item, + checked: isPutChecked + }); + } + }); + this.$forceUpdate() + }, closeGuize() { let selectedQucan = this.qucan.filter(item => item.checked); let selectedSongcan = this.songcan.filter(item => item.checked); @@ -725,6 +788,7 @@ let currentRuleList = this.currentConfigType == 'waima' ? this.waimaRuleList : this.paotuiRuleList; let newRules = []; let userId = uni.getStorageSync('id') || ''; + let regionId = this.getCurrentRegionId(); selectedQucan.forEach(q => { selectedSongcan.forEach(s => { let existing = currentRuleList.find(r => r.getAreaId == q.id && r.putAreaId == s @@ -734,6 +798,7 @@ } else { newRules.push({ workerId: "W" + userId, + regionId: regionId, getAreaId: q.id, getAreaName: q.title, putAreaId: s.id, @@ -832,11 +897,12 @@ }) } this.dispatchSaving = true - this.NB.sendRequest("/app/workerRelaPrice/batchUpdate", { + this.NB.sendRequest('/app/workerRelaPrice/batchUpdate', { userId: uni.getStorageSync('id'), + regionId: this.getCurrentRegionId(), workerRelaPriceList: selectRuleList, getPushOrder: this.zhipaiCheck ? 1 : 0 - }, false, 'post', 'application/x-www-form-urlencoded').then((res) => { + }, false, 'post', 'application/json').then((res) => { this.dispatchSaving = false if (res.code == 200) { let worker = uni.getStorageSync('worker') || {} @@ -858,35 +924,13 @@ icon: 'none' }) } - }).catch(() => { this.dispatchSaving = false }) }, checkAddress(type) { - let that = this this.currentConfigType = type; - this.qucan = []; - this.songcan = []; - let currentRuleList = type == 'waima' ? this.waimaRuleList : this.paotuiRuleList; - let isCanteenVal = type == 'waima' ? 1 : 2; - - this.shopArea.forEach(item => { - let isGetChecked = currentRuleList.some(r => r.getAreaId == item.id); - let isPutChecked = currentRuleList.some(r => r.putAreaId == item.id); - - if (item.isCanteen == isCanteenVal) { - that.qucan.push({ - ...item, - checked: isGetChecked - }); - } else { - that.songcan.push({ - ...item, - checked: isPutChecked - }); - } - }); + this.buildRouteAreaOptions(type) this.$refs.guizePopup.open() }, removeRule(type, index) { @@ -903,10 +947,6 @@ title: '请填写姓名', icon: 'none' }); - if (!this.formData.studentCard) return uni.showToast({ - title: '请上传学生证', - icon: 'none' - }); if (!this.formData.waima && !this.formData.paotui) return uni.showToast({ title: '请至少选择一种兼职类型', icon: 'none' @@ -918,13 +958,6 @@ icon: 'none' }); } - if (this.formData.paotui && this.paotuiRuleList.length == 0) { - return uni.showToast({ - title: '请先划定快递赚钱地盘', - icon: 'none' - }); - } - let workerRelaPriceList = []; if (this.formData.waima) { this.waimaRuleList.forEach(item => this.normalizeOrderBkge(item)); @@ -947,8 +980,11 @@ workerRelaPriceList = workerRelaPriceList.concat(this.paotuiRuleList); } + const regionId = this.getCurrentRegionId(); + workerRelaPriceList.forEach(item => item.regionId = regionId); let submitData = { userId: uni.getStorageSync('id'), + regionId: regionId, workerName: this.formData.name, cardPicture: this.formData.studentCard, highFloorFee: this.formatOneDecimalInput(this.formData.highFloorFee), @@ -965,7 +1001,7 @@ title: '提交中...', mask: true }); - this.NB.sendRequest("/app/workerRelaPrice/batchAdd", submitData, false, 'post', 'application/x-www-form-urlencoded').then((res) => { + this.NB.sendRequest("/app/workerRelaPrice/batchAdd", submitData, false, 'post', 'application/json').then((res) => { uni.hideLoading(); if (res.code == 200) { let user = res.result; @@ -978,7 +1014,7 @@ worker1.workerName = this.formData.name if (hasNewRule) worker1.getPushOrder = 1 uni.setStorageSync('worker', worker1) - this.getWorkerMessage(true, hasNewRule) + this.getWorkerMessage(workerRelaPriceList.length > 0, hasNewRule) } else { const message = this.getResponseMessage(res, '提交失败') if (this.isWorkerNameAuditMessage(message)) { @@ -990,7 +1026,6 @@ }); } } - }).catch(err => { uni.hideLoading(); const message = this.getResponseMessage(err, '提交失败,请稍后再试') @@ -1003,6 +1038,7 @@ }); } }); + }, pictureAdd() { let that = this @@ -1088,7 +1124,7 @@ } .back-btn { - padding-top:80rpx; + padding-top:110rpx; } .content { @@ -1128,6 +1164,33 @@ height: 500rpx; } + .student-card-preview { + display: inline-block; + position: relative; + width: 160rpx; + height: 160rpx; + vertical-align: top; + } + + .student-card-preview image { + display: block; + } + + .student-card-delete { + position: absolute; + top: -14rpx; + right: -14rpx; + width: 36rpx; + height: 36rpx; + line-height: 34rpx; + border-radius: 50%; + background: rgba(0, 0, 0, 0.65); + color: #fff; + font-size: 30rpx; + text-align: center; + z-index: 2; + } + .liangge-popup-content { background: #fff; border-radius: 10px; @@ -1606,6 +1669,35 @@ line-height: 36rpx; } + .full-area-btn { + margin-top: 16rpx; + height: 70rpx; + line-height: 70rpx; + border-radius: 70rpx; + background: rgba(247, 248, 248, 0.9); + border: 1px solid rgba(0, 35, 28, 0.12); + color: #00624f; + font-size: 26rpx; + font-weight: 900; + text-align: center; + } + + .full-area-btn--active { + background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1)); + border-color: rgba(166, 255, 234, 1); + color: #00231C; + } + + .full-area-tip { + margin-top: 12rpx; + padding: 16rpx 18rpx; + border-radius: 18rpx; + background: rgba(255, 244, 214, 0.8); + color: #9A5A00; + font-size: 24rpx; + line-height: 34rpx; + } + .area-popup-scroll { flex: 1; min-height: 0; diff --git a/pages/worker/wallet.vue b/pages/worker/wallet.vue index 832df4e..04fc633 100644 --- a/pages/worker/wallet.vue +++ b/pages/worker/wallet.vue @@ -25,7 +25,7 @@ - + WALLET @@ -39,8 +39,7 @@ {{ showBalance ? formatMoney(balanceWorker.depoBalRel) : '••••' }} - 🛡 - 今日佣金{{ showBalance ? formatMoney(balanceWorker.depoBal) : '••••' }}次日可提现 + 今日佣金{{ showBalance ? formatMoney(balanceWorker.depoBal) : '••••' }}次日可提现 @@ -104,14 +103,14 @@ - 支付宝认证手机号 - + 支付宝账号 + 提现金额 - + {{submittingWithdraw ? '提现中...' : '确认提现'}} @@ -153,6 +152,8 @@ balanceShop:[], submittingWithdraw: false, withdrawRequestId: '', + withdrawClickLocked: false, + withdrawClickTimer: null, showBalance: true, resolvingSettlementOrderId: false, skipWalletRefreshOnShow: false, @@ -219,7 +220,7 @@ } }, onShow() { - + this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() if (this.skipWalletRefreshOnShow) { this.skipWalletRefreshOnShow = false return @@ -234,11 +235,14 @@ this.searchForm.pageNum+=1; this.rewardList(); }, + beforeDestroy() { + if (this.withdrawClickTimer) { + clearTimeout(this.withdrawClickTimer) + } + }, methods: { beginData(){ - this.NB.sendRequest("/worker/getAllDepo/", { - userId:uni.getStorageSync('id') - }, false, 'get', 'application/json').then((res) => { + this.NB.sendRequest("/worker/getAllDepo/", {userId:uni.getStorageSync('id')}, false, 'GET', 'application/x-www-form-urlencoded').then((res) => { if (res.code == 200) { if(res.result.user){ this.balanceUser = res.result.user @@ -256,10 +260,9 @@ title: res.message, icon: 'none' }) - return } uni.hideLoading() - }).catch((res) => {}); + }) }, //提现 withDraw(){ @@ -268,6 +271,7 @@ }) }, userCommion(type,commion,item){ + if (!this.lockWithdrawClick()) return const withdrawAmount = Number(commion) || 0 if(type=='user'){ this.commionUrl = '/app/returnCommission/handleReturnUser' @@ -287,6 +291,25 @@ createWithdrawRequestId(){ return `${Date.now()}${Math.floor(Math.random() * 1000000)}` }, + lockWithdrawClick(){ + if (this.withdrawClickLocked) return false + this.withdrawClickLocked = true + if (this.withdrawClickTimer) { + clearTimeout(this.withdrawClickTimer) + } + this.withdrawClickTimer = setTimeout(() => { + this.withdrawClickLocked = false + this.withdrawClickTimer = null + }, 800) + return true + }, + closeWithdrawPopup(){ + if (this.$refs.payPopup) { + this.$refs.payPopup.close() + } + this.submittingWithdraw = false + this.withdrawRequestId = '' + }, syncActiveWallet(){ if (this.targetWalletType) { const targetIndex = this.walletTabs.findIndex(tab => tab.key === this.targetWalletType) @@ -348,11 +371,12 @@ }, wxPayment(){ let that = this + if (!this.lockWithdrawClick()) return if (this.submittingWithdraw) { uni.showToast({ title: '提现处理中,请勿重复提交', icon: 'none' - }); + }) return } const amount = Number(this.commionAmount) @@ -361,43 +385,52 @@ uni.showToast({ title: '提现金额不能小于1元', icon: 'none' - }); + }) return } if(amount > 5000){ uni.showToast({ title: '单笔提现金额不能超过5000元', icon: 'none' - }); + }) return } if(amount > maxAmount){ uni.showToast({ title: '提现金额不能超过可提现金额', icon: 'none' - }); + }) return } - if(!this.aliName){ + const aliName = (this.aliName || '').trim() + const aliAccount = (this.aliAccount || '').trim() + if(!aliName){ uni.showToast({ title: '支付宝实名名称不能为空', icon: 'none' - }); + }) return } - if(!this.aliAccount){ + if(!aliAccount){ uni.showToast({ - title: '支付宝手机号不能为空', + title: '支付宝账号不能为空', icon: 'none' - }); + }) + return + } + if(!this.isValidAliAccount(aliAccount)){ + uni.showToast({ + title: '支付宝账号需为手机号或邮箱', + icon: 'none' + }) return } this.submittingWithdraw = true let data = { id:this.withdrawRequestId || this.createWithdrawRequestId(), commission:amount, - aliName:this.aliName, - aliAccount:this.aliAccount + aliName:aliName, + aliAccount:aliAccount } if(this.commionType == 'user'){ data.userId = this.balanceUser.id @@ -406,28 +439,43 @@ }else{ data.shopId = this.shopId } - this.NB.sendRequest(this.commionUrl, data, false, 'POST', 'application/json').then((res) => { - if (res.code == 200) { - this.$refs.payPopup.close(); - this.withdrawRequestId = '' - this.beginData(); + this.NB.sendRequest(this.commionUrl, data, false, 'post', 'application/json').then((res) => { + that.loadStatus = 'nomore'; + const failMessage = that.getWithdrawErrorMessage(res) + if (res.code == 200 && !failMessage) { + that.closeWithdrawPopup() + that.beginData(); } else { + that.closeWithdrawPopup() uni.showToast({ - title: res.message, + title: failMessage || '提现失败,请稍后再试', icon: 'none' - }); - that.submittingWithdraw = false + }) return } - that.submittingWithdraw = false uni.hideLoading() }).catch((res) => { - that.submittingWithdraw = false + that.closeWithdrawPopup() uni.showToast({ - title: res.message, + title: that.getWithdrawErrorMessage(res) || '提现失败,请稍后再试', icon: 'none' - }); - }); + }) + }) + + }, + isValidAliAccount(account){ + const value = (account || '').trim() + const phoneReg = /^1[3-9]\d{9}$/ + const emailReg = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ + return phoneReg.test(value) || emailReg.test(value) + }, + getWithdrawErrorMessage(res){ + if (!res) return '' + const message = res.message || res.msg || '' + const result = res.result || {} + const reason = result.failMessage || result.remark || message + if (res.code != 200 || res.success === false) return reason + return /失败|异常/.test(message) ? reason : '' }, chooseLinkId(type,item){ if(type == 'user'){ @@ -508,11 +556,11 @@ if (!this.canOpenShopOrder(item)) return if (this.resolvingSettlementOrderId) return this.resolvingSettlementOrderId = true - this.NB.sendRequest("/mall/order/orderIdBySettlementRecord/" + item.linkId, {}, false, 'GET', 'application/json').then((res) => { - if (res.code == 200) { + this.NB.sendRequest("/mall/order/orderIdBySettlementRecord/" + item.linkId, {}, false, 'GET', 'application/x-www-form-urlencoded').then((res) => { + if (res.code == 200 && res.result) { this.skipWalletRefreshOnShow = true uni.navigateTo({ - url: '/pages/shop/orderDetail?id=' + res.result, + url: '/package3/shop/orderDetail?id=' + res.result, fail: () => { this.skipWalletRefreshOnShow = false } @@ -521,16 +569,16 @@ uni.showToast({ title: res.message || '未找到关联订单', icon: 'none' - }); + }) } this.resolvingSettlementOrderId = false }).catch((res) => { uni.showToast({ title: res && res.message ? res.message : '未找到关联订单', icon: 'none' - }); + }) this.resolvingSettlementOrderId = false - }); + }) }, rewardList(){ this.loadStatus = 'loading' @@ -541,7 +589,7 @@ if (this.activeWalletType === 'user') { params.excludeDealingsWay = '免单奖励' } - this.NB.sendRequest("/mall/coupon/selectRewardByRegionId", params, false, 'POST', 'application/json').then((res) => { + this.NB.sendRequest("/mall/coupon/selectRewardByRegionId", params, false, 'post', 'application/json').then((res) => { that.loadStatus = 'nomore'; if (res.code == 200) { that.totalPages = res.result.pages @@ -555,11 +603,11 @@ uni.showToast({ title: res.message, icon: 'none' - }); + }) return } uni.hideLoading() - }).catch((res) => {}); + }) }, back() { uni.navigateBack() @@ -1380,6 +1428,10 @@ transition: transform 0.16s ease; } + .popup-btn.disabled { + pointer-events: none; + } + /* ---------- 动画 ---------- */ .enter-card { animation: cardIn 0.46s ease both;