wangfukang 2 days ago
parent
commit
3905beaa9a
  1. 81
      package2/myCenter/partTimeJobRegister.vue
  2. 68
      package2/myCenter/wallet.vue
  3. 4
      package2/shop/shopBill.vue
  4. 8
      package2/shop/shopSettlementDetail.vue

81
package2/myCenter/partTimeJobRegister.vue

@ -18,6 +18,7 @@
<input type="text" v-model="formData.name" maxlength="10" placeholder="请填写姓名" <input type="text" v-model="formData.name" maxlength="10" placeholder="请填写姓名"
@input="onWorkerNameInput" @input="onWorkerNameInput"
style="background: rgba(247, 248, 248, 0.6);height: 80rpx;line-height: 80rpx;padding: 18rpx 20rpx;border-radius: 20rpx;"> style="background: rgba(247, 248, 248, 0.6);height: 80rpx;line-height: 80rpx;padding: 18rpx 20rpx;border-radius: 20rpx;">
<view class="audit-tip" v-if="workerNameAuditTip">{{workerNameAuditTip}}</view>
</view> </view>
</view> </view>
@ -198,8 +199,10 @@
<view class="official-desc">关注后可提现佣金有新订单会及时通知下线后不再接收通知</view> <view class="official-desc">关注后可提现佣金有新订单会及时通知下线后不再接收通知</view>
</view> </view>
</view> </view>
<view class="btn" @click="submit"> <view class="bottom-action">
{{worker ? '保存规则' : '提交注册'}} <view class="btn" @click="submit">
{{worker ? '保存规则' : '提交注册'}}
</view>
</view> </view>
</view> </view>
<!-- 查看大图弹出层 --> <!-- 查看大图弹出层 -->
@ -419,7 +422,8 @@
dispatchPopupVisible: false, dispatchPopupVisible: false,
dispatchSaving: false, dispatchSaving: false,
zhipaiCheck: false, zhipaiCheck: false,
pendingNewDispatchRuleKeys: [] pendingNewDispatchRuleKeys: [],
workerNameAuditTip: ''
} }
}, },
components: { components: {
@ -534,8 +538,29 @@
onWorkerNameInput(e) { onWorkerNameInput(e) {
const value = this.limitText(e.detail.value, 10) const value = this.limitText(e.detail.value, 10)
this.formData.name = value this.formData.name = value
this.workerNameAuditTip = ''
return value return value
}, },
getResponseMessage(res, fallback) {
if (!res) return fallback
if (res.message) return res.message
if (res.msg) return res.msg
if (res.errMsg) return res.errMsg
if (res.data && res.data.message) return res.data.message
if (res.data && res.data.msg) return res.data.msg
return fallback
},
isWorkerNameAuditMessage(message) {
return !!message && (message.indexOf('审核') !== -1 || message.indexOf('不合适') !== -1)
},
showWorkerNameAuditTip(message) {
const tip = message || '姓名内容未通过审核,请修改后再提交'
this.workerNameAuditTip = tip
uni.showToast({
title: tip,
icon: 'none'
})
},
onDefaultRouteRemarkInput(e) { onDefaultRouteRemarkInput(e) {
const value = this.limitText(e.detail.value, 20) const value = this.limitText(e.detail.value, 20)
this.defaultRouteRemark = value this.defaultRouteRemark = value
@ -868,6 +893,7 @@
}, },
submit() { submit() {
this.formData.name = this.limitText(this.formData.name, 10) this.formData.name = this.limitText(this.formData.name, 10)
this.workerNameAuditTip = ''
if (!this.formData.name) return uni.showToast({ if (!this.formData.name) return uni.showToast({
title: '请填写姓名', title: '请填写姓名',
icon: 'none' icon: 'none'
@ -948,14 +974,28 @@
if (hasNewRule) worker1.getPushOrder = 1 if (hasNewRule) worker1.getPushOrder = 1
uni.setStorageSync('worker', worker1) uni.setStorageSync('worker', worker1)
this.getWorkerMessage(true, hasNewRule) this.getWorkerMessage(true, hasNewRule)
} else {
const message = this.getResponseMessage(res, '提交失败')
if (this.isWorkerNameAuditMessage(message)) {
this.showWorkerNameAuditTip(message)
} else {
uni.showToast({
title: message,
icon: 'none'
});
}
}
}).catch(err => {
uni.hideLoading();
const message = this.getResponseMessage(err, '提交失败,请稍后再试')
if (this.isWorkerNameAuditMessage(message)) {
this.showWorkerNameAuditTip(message)
} else { } else {
uni.showToast({ uni.showToast({
title: res.message, title: message,
icon: 'none' icon: 'none'
}); });
} }
}).catch(err => {
uni.hideLoading();
}); });
}, },
pictureAdd() { pictureAdd() {
@ -1054,6 +1094,10 @@
border-radius: 40rpx; border-radius: 40rpx;
background: #fff; background: #fff;
padding: 16rpx 20rpx; padding: 16rpx 20rpx;
padding-bottom: 220rpx;
padding-bottom: calc(220rpx + constant(safe-area-inset-bottom));
padding-bottom: calc(220rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
} }
.reg-name { .reg-name {
@ -1068,6 +1112,13 @@
margin-top: 10rpx; margin-top: 10rpx;
} }
.audit-tip {
margin-top: 12rpx;
color: #ff3b30;
font-size: 24rpx;
line-height: 34rpx;
}
.img-popup-content { .img-popup-content {
width: 500rpx; width: 500rpx;
height: 500rpx; height: 500rpx;
@ -1433,8 +1484,22 @@
font-weight: 700; font-weight: 700;
} }
.bottom-action {
position: fixed;
left: 0;
right: 0;
bottom: 0;
padding: 22rpx 20rpx 32rpx;
padding-bottom: calc(32rpx + constant(safe-area-inset-bottom));
padding-bottom: calc(32rpx + env(safe-area-inset-bottom));
background: #fff;
box-shadow: 0 -10rpx 28rpx rgba(0, 35, 28, 0.08);
box-sizing: border-box;
z-index: 20;
}
.btn { .btn {
width: 95%; width: 100%;
height: 100rpx; height: 100rpx;
font-size: 32rpx; font-size: 32rpx;
font-weight: 700; font-weight: 700;
@ -1442,7 +1507,7 @@
border-radius: 100rpx; border-radius: 100rpx;
line-height: 100rpx; line-height: 100rpx;
text-align: center; text-align: center;
margin: 40rpx auto; box-shadow: 0 16rpx 36rpx rgba(0, 35, 28, 0.18);
} }
.guize-popup-content { .guize-popup-content {

68
package2/myCenter/wallet.vue

@ -137,14 +137,14 @@
<input type="text" v-model="aliName" placeholder="请输入姓名" /> <input type="text" v-model="aliName" placeholder="请输入姓名" />
</view> </view>
<view class="popup-field"> <view class="popup-field">
<text>支付宝认证手机</text> <text>支付宝</text>
<input type="digit" v-model="aliAccount" placeholder="请输入手机号" /> <input type="text" v-model.trim="aliAccount" maxlength="64" placeholder="请输入手机号或邮箱" />
</view> </view>
<view class="popup-field"> <view class="popup-field">
<text>提现金额</text> <text>提现金额</text>
<input type="digit" v-model="commionAmount" placeholder="请输入金额" /> <input type="digit" v-model="commionAmount" placeholder="请输入金额" />
</view> </view>
<view class="popup-btn" :style="{opacity: submittingWithdraw ? 0.6 : 1}" @tap="wxPayment"> <view class="popup-btn" :class="{disabled: submittingWithdraw}" :style="{opacity: submittingWithdraw ? 0.6 : 1}" @tap="wxPayment">
{{submittingWithdraw ? '提现中...' : '确认提现'}} {{submittingWithdraw ? '提现中...' : '确认提现'}}
</view> </view>
</view> </view>
@ -186,6 +186,8 @@
balanceShop:[], balanceShop:[],
submittingWithdraw: false, submittingWithdraw: false,
withdrawRequestId: '', withdrawRequestId: '',
withdrawClickLocked: false,
withdrawClickTimer: null,
showBalance: true, showBalance: true,
resolvingSettlementOrderId: false, resolvingSettlementOrderId: false,
skipWalletRefreshOnShow: false, skipWalletRefreshOnShow: false,
@ -267,6 +269,11 @@
this.searchForm.pageNum+=1; this.searchForm.pageNum+=1;
this.rewardList(); this.rewardList();
}, },
beforeDestroy() {
if (this.withdrawClickTimer) {
clearTimeout(this.withdrawClickTimer)
}
},
methods: { methods: {
beginData(){ beginData(){
this.tui.request("/worker/getAllDepo/", "GET", {userId:uni.getStorageSync('id')}, false, true).then((res) => { this.tui.request("/worker/getAllDepo/", "GET", {userId:uni.getStorageSync('id')}, false, true).then((res) => {
@ -295,6 +302,7 @@
}) })
}, },
userCommion(type,commion,item){ userCommion(type,commion,item){
if (!this.lockWithdrawClick()) return
const withdrawAmount = Number(commion) || 0 const withdrawAmount = Number(commion) || 0
if(type=='user'){ if(type=='user'){
this.commionUrl = '/app/returnCommission/handleReturnUser' this.commionUrl = '/app/returnCommission/handleReturnUser'
@ -314,6 +322,18 @@
createWithdrawRequestId(){ createWithdrawRequestId(){
return `${Date.now()}${Math.floor(Math.random() * 1000000)}` 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
},
syncActiveWallet(){ syncActiveWallet(){
if (this.targetWalletType) { if (this.targetWalletType) {
const targetIndex = this.walletTabs.findIndex(tab => tab.key === this.targetWalletType) const targetIndex = this.walletTabs.findIndex(tab => tab.key === this.targetWalletType)
@ -375,6 +395,7 @@
}, },
wxPayment(){ wxPayment(){
let that = this let that = this
if (!this.lockWithdrawClick()) return
if (this.submittingWithdraw) { if (this.submittingWithdraw) {
that.tui.toast('提现处理中,请勿重复提交') that.tui.toast('提现处理中,请勿重复提交')
return return
@ -393,20 +414,26 @@
that.tui.toast('提现金额不能超过可提现金额') that.tui.toast('提现金额不能超过可提现金额')
return return
} }
if(!this.aliName){ const aliName = (this.aliName || '').trim()
const aliAccount = (this.aliAccount || '').trim()
if(!aliName){
that.tui.toast('支付宝实名名称不能为空') that.tui.toast('支付宝实名名称不能为空')
return return
} }
if(!this.aliAccount){ if(!aliAccount){
that.tui.toast('支付宝手机号不能为空') that.tui.toast('支付宝账号不能为空')
return
}
if(!this.isValidAliAccount(aliAccount)){
that.tui.toast('支付宝账号需为手机号或邮箱')
return return
} }
this.submittingWithdraw = true this.submittingWithdraw = true
let data = { let data = {
id:this.withdrawRequestId || this.createWithdrawRequestId(), id:this.withdrawRequestId || this.createWithdrawRequestId(),
commission:amount, commission:amount,
aliName:this.aliName, aliName:aliName,
aliAccount:this.aliAccount aliAccount:aliAccount
} }
if(this.commionType == 'user'){ if(this.commionType == 'user'){
data.userId = this.balanceUser.id data.userId = this.balanceUser.id
@ -417,12 +444,13 @@
} }
that.tui.request(this.commionUrl, "POST", data, false, false).then((res) => { that.tui.request(this.commionUrl, "POST", data, false, false).then((res) => {
that.loadStatus = 'nomore'; that.loadStatus = 'nomore';
if (res.code == 200) { const failMessage = that.getWithdrawErrorMessage(res)
if (res.code == 200 && !failMessage) {
this.$refs.payPopup.close(); this.$refs.payPopup.close();
this.withdrawRequestId = '' this.withdrawRequestId = ''
this.beginData(); this.beginData();
} else { } else {
that.tui.toast(res.message) that.tui.toast(failMessage || '提现失败,请稍后再试')
that.submittingWithdraw = false that.submittingWithdraw = false
return return
} }
@ -430,9 +458,23 @@
uni.hideLoading() uni.hideLoading()
}).catch((res) => { }).catch((res) => {
that.submittingWithdraw = false that.submittingWithdraw = false
that.tui.toast(res.message) that.tui.toast(that.getWithdrawErrorMessage(res) || '提现失败,请稍后再试')
}) })
}, },
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){ chooseLinkId(type,item){
if(type == 'user'){ if(type == 'user'){
this.linkId = this.balanceUser.id this.linkId = this.balanceUser.id
@ -1375,6 +1417,10 @@
transition: transform 0.16s ease; transition: transform 0.16s ease;
} }
.popup-btn.disabled {
pointer-events: none;
}
/* ---------- 动画 ---------- */ /* ---------- 动画 ---------- */
.enter-card { .enter-card {
animation: cardIn 0.46s ease both; animation: cardIn 0.46s ease both;

4
package2/shop/shopBill.vue

@ -30,11 +30,11 @@
</view> </view>
</view> </view>
<view class="summary-card"> <!-- <view class="summary-card">
<view class="summary-title">{{searchForm.status === 0 ? '待结算金额' : '已结算金额'}}</view> <view class="summary-title">{{searchForm.status === 0 ? '待结算金额' : '已结算金额'}}</view>
<view class="summary-amount">{{formatMoney(pageTotalAmount)}}</view> <view class="summary-amount">{{formatMoney(pageTotalAmount)}}</view>
<view class="summary-desc">当前列表共 {{total}} 个账单日</view> <view class="summary-desc">当前列表共 {{total}} 个账单日</view>
</view> </view> -->
<view class="bill-list"> <view class="bill-list">
<view class="bill-card" v-for="item in dataList" :key="item.billTime" @tap="goDetail(item)"> <view class="bill-card" v-for="item in dataList" :key="item.billTime" @tap="goDetail(item)">

8
package2/shop/shopSettlementDetail.vue

@ -15,7 +15,7 @@
<view class="content"> <view class="content">
<view class="summary-card"> <view class="summary-card">
<view class="summary-date">{{query.billTime || '-'}}</view> <view class="summary-date">{{query.billTime || '-'}}</view>
<view class="summary-row"> <!-- <view class="summary-row">
<view> <view>
<text>结算金额</text> <text>结算金额</text>
<view>{{formatMoney(query.totalSettlementAmount)}}</view> <view>{{formatMoney(query.totalSettlementAmount)}}</view>
@ -28,7 +28,7 @@
<view class="summary-mini"> <view class="summary-mini">
<view>结算基数{{formatMoney(query.totalBaseAmount)}}</view> <view>结算基数{{formatMoney(query.totalBaseAmount)}}</view>
<view>平台服务费{{formatMoney(query.totalCommissionAmount)}}</view> <view>平台服务费{{formatMoney(query.totalCommissionAmount)}}</view>
</view> </view> -->
</view> </view>
<view class="record-list"> <view class="record-list">
@ -43,11 +43,11 @@
</view> </view>
</view> </view>
<view class="record-grid"> <view class="record-grid">
<view> <view v-if="item.type != 2">
<text>结算基数</text> <text>结算基数</text>
<view>{{formatMoney(item.baseAmount)}}</view> <view>{{formatMoney(item.baseAmount)}}</view>
</view> </view>
<view> <view v-if="item.type != 2">
<text>平台抽佣</text> <text>平台抽佣</text>
<view>{{formatMoney(item.commissionAmount)}}</view> <view>{{formatMoney(item.commissionAmount)}}</view>
</view> </view>

Loading…
Cancel
Save