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 @@
+
-
@@ -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 @@