wangfukang 2 months ago
parent
commit
7c9688f001
  1. 85
      package2/group/groupBuySingle.vue
  2. 46
      package2/myCenter/partTimeJobRegister.vue
  3. 210
      package2/myCenter/wallet.vue
  4. 16
      package2/partTimeJob/partTimeJobCenter.vue
  5. 2
      package2/shop/afterService.vue
  6. 4
      package2/shop/merchantCenter.vue
  7. 266
      package2/shop/orderDetail.vue
  8. 28
      package2/shop/shopOrderList.vue

85
package2/group/groupBuySingle.vue

@ -582,6 +582,48 @@
若1小时内拼团失败将会为您自动退款
</view>
</view>
<view class="box1 pay-more-buy-card" v-if="showPayPopupMoreBuy">
<view class="spec11 pay-more-buy-title" style="display: flex;">
<view style="flex: 1;">
搭配小食
</view>
<view style="padding-top: 10rpx;">
<view class="goods-num">
<view class="num-plus" style="background: #999;color: #fff;"
@tap="changeValue('minus')">
-
</view>
<view class="num">
{{vModelValue}}
</view>
<view class="num-plus" @tap="changeValue('plus')">
+
</view>
</view>
</view>
</view>
<scroll-view scroll-x class="pay-more-buy-scroll">
<view class="pay-more-buy-list">
<view :class="spec.isChecked ? 'team-check1 pay-more-buy-item' : 'team2 pay-more-buy-item'"
v-for="(spec, sIndex) in moreBuyList" :key="sIndex"
@tap="selectMoreBuy(spec,sIndex)">
<view>
<img :src="spec.productPicture" alt=""
style="width: 70px;height: 70px;background-size: 100%;border-radius: 10px;">
</view>
<view class="team11" style="margin-top:10rpx;">
{{spec.attributeListPrice | sliceMsg}}
</view>
<view class="team11" style="margin-top:10rpx;">
{{spec.productName}}
</view>
<view class="jiaobiao" v-if="spec.quantity>0">
{{spec.quantity ? spec.quantity : ''}}
</view>
</view>
</view>
</scroll-view>
</view>
<view class="box1" style="display: flex;padding: 40rpx;"
v-if="groupdeliveryType == 2 && !isStoreGroupOrder">
<view style="flex: 1;">
@ -874,6 +916,10 @@
isMinimumPayAmount() {
return this.formatMoney(this.getPayTotalAmount()) === '0.01';
},
showPayPopupMoreBuy() {
return this.groupId && this.isFaceToFaceGroup && this.parsedSpecs.length === 0 &&
this.moreBuyList.length > 0 && !this.currentOrderId;
},
stickyInnerHeight() {
// sticky
// iPhone
@ -1200,6 +1246,14 @@
}
this.selectedGroupRule.groupPriceAndMore = amount > 0 ? amount : 0.01;
},
syncCurrentItemMoreBuyData() {
this.currentItem.moreBuyData = [];
for (let i = 0; i < this.moreBuyData.length; i++) {
if (this.moreBuyData[i].quantity != undefined && this.moreBuyData[i].quantity > 0) {
this.currentItem.moreBuyData.push(this.moreBuyData[i]);
}
}
},
goPayOrderDetail() {
if (!this.currentOrderId) return;
this.navigatingFromPayPopup = true;
@ -1712,12 +1766,7 @@
}
let packageFee = parseFloat(this.currentItem.lunchBox || 0);
this.currentItem.moreBuyData = []
for (let i = 0; i < this.moreBuyData.length; i++) {
if (this.moreBuyData[i].quantity != undefined && this.moreBuyData[i].quantity > 0) {
this.currentItem.moreBuyData.push(this.moreBuyData[i])
}
}
this.syncCurrentItemMoreBuyData();
if (this.groupId && this.isFaceToFaceGroup) {
this.submitFTFJoinPay(specChoices);
return
@ -1805,6 +1854,7 @@
createFTFJoinOrder(specChoices, autoPay) {
if (this.isCreatingOrder) return;
this.isCreatingOrder = true;
this.syncCurrentItemMoreBuyData();
let payload = this.buildFTFJoinPayload(specChoices);
if (!payload) {
this.isCreatingOrder = false;
@ -4073,6 +4123,29 @@
padding: 28rpx 30rpx 24rpx;
}
.pay-more-buy-card {
padding: 20rpx 30rpx 28rpx;
}
.pay-more-buy-title {
height: 78rpx;
line-height: 78rpx;
}
.pay-more-buy-scroll {
width: 100%;
white-space: nowrap;
}
.pay-more-buy-list {
display: inline-flex;
}
.pay-more-buy-item {
float: none;
flex-shrink: 0;
}
.pay-countdown {
display: flex;
align-items: center;

46
package2/myCenter/partTimeJobRegister.vue

@ -15,7 +15,8 @@
<text style="color:red;">*</text> 姓名
</view>
<view class="reg-value">
<input type="text" v-model="formData.name" placeholder="请填写姓名"
<input type="text" v-model="formData.name" maxlength="10" placeholder="请填写姓名"
@input="onWorkerNameInput"
style="background: rgba(247, 248, 248, 0.6);height: 80rpx;line-height: 80rpx;padding: 18rpx 20rpx;border-radius: 20rpx;">
</view>
</view>
@ -128,7 +129,8 @@
</view>
<view class="route-remark">
<text>备注(选填)</text>
<input type="text" v-model="item.remark" placeholder="如:大件/限时可加钱">
<input type="text" v-model="item.remark" maxlength="20" placeholder="如:大件/限时可加钱"
@input="onRuleRemarkInput($event, item)">
</view>
</view>
</view>
@ -172,7 +174,8 @@
</view>
<view class="route-remark">
<text>备注(选填)</text>
<input type="text" v-model="item.remark" placeholder="如:大件/限时可加钱">
<input type="text" v-model="item.remark" maxlength="20" placeholder="如:大件/限时可加钱"
@input="onRuleRemarkInput($event, item)">
</view>
</view>
</view>
@ -265,7 +268,8 @@
</view>
<view class="route-default-row route-default-row--remark">
<view class="route-default-label">统一备注</view>
<input class="route-default-remark" type="text" v-model="defaultRouteRemark"
<input class="route-default-remark" type="text" v-model="defaultRouteRemark" maxlength="20"
@input="onDefaultRouteRemarkInput"
placeholder="选填,如:大件不接/限时加钱">
</view>
</view>
@ -439,6 +443,24 @@
this.defaultRoutePrice = value
return value
},
limitText(value, maxLength) {
return String(value || '').slice(0, maxLength)
},
onWorkerNameInput(e) {
const value = this.limitText(e.detail.value, 10)
this.formData.name = value
return value
},
onDefaultRouteRemarkInput(e) {
const value = this.limitText(e.detail.value, 20)
this.defaultRouteRemark = value
return value
},
onRuleRemarkInput(e, item) {
const value = this.limitText(e.detail.value, 20)
item.remark = value
return value
},
normalizeOrderBkge(item) {
const value = this.formatMoneyInput(item.orderBkge);
const amount = parseFloat(value);
@ -467,7 +489,7 @@
if (res.code == 200) {
if (res.result != null) {
let data = res.result;
if (data.workerName) that.formData.name = data.workerName;
if (data.workerName) that.formData.name = that.limitText(data.workerName, 10);
if (data.cardPicture) that.formData.studentCard = data.cardPicture;
if (data.mobile) that.formData.mobile = data.mobile;
if (data.highFloorFee !== undefined && data.highFloorFee !== null) that.formData
@ -475,7 +497,11 @@
if (data.deliveryLocation !== undefined && data.deliveryLocation !== null) that.formData
.deliveryLocation = data.deliveryLocation;
let list = data.workerRelaPriceList || [];
let list = (data.workerRelaPriceList || []).map(item => {
return Object.assign({}, item, {
remark: that.limitText(item.remark, 20)
});
});
let waimaList = list.filter(item => item.orderType == 0);
let paotuiList = list.filter(item => item.orderType == 1);
@ -585,7 +611,7 @@
putAreaName: s.title,
orderBkge: this.formatMoneyInput(this.defaultRoutePrice),
orderType: this.currentConfigType == 'waima' ? 0 : 1,
remark: this.defaultRouteRemark || ''
remark: this.limitText(this.defaultRouteRemark, 20)
});
}
});
@ -645,6 +671,7 @@
}
},
submit() {
this.formData.name = this.limitText(this.formData.name, 10)
if (!this.formData.name) return uni.showToast({
title: '请填写姓名',
icon: 'none'
@ -674,6 +701,7 @@
let workerRelaPriceList = [];
if (this.formData.waima) {
this.waimaRuleList.forEach(item => this.normalizeOrderBkge(item));
this.waimaRuleList.forEach(item => item.remark = this.limitText(item.remark, 20));
let invalid = this.waimaRuleList.find(item => !this.isValidOrderBkge(item.orderBkge));
if (invalid) return uni.showToast({
title: '外卖最低配送费需大于0且不超过200',
@ -683,6 +711,7 @@
}
if (this.formData.paotui) {
this.paotuiRuleList.forEach(item => this.normalizeOrderBkge(item));
this.paotuiRuleList.forEach(item => item.remark = this.limitText(item.remark, 20));
let invalid = this.paotuiRuleList.find(item => !this.isValidOrderBkge(item.orderBkge));
if (invalid) return uni.showToast({
title: '快递最低配送费需大于0且不超过200',
@ -718,6 +747,9 @@
title: '提交成功'
});
}
let worker1 = uni.getStorageSync('worker')
worker1.workerName = this.formData.name
uni.setStorageSync('worker', worker1)
uni.reLaunch({
url: '/pages/index/index?tabIndex=1&deliveryRuleEdited=1'
})

210
package2/myCenter/wallet.vue

@ -7,7 +7,7 @@
<view class="wallet-aura aura-pink"></view>
</view>
<view class="wallet-nav" :style="{'padding-top': menuButtonInfo.top +'px'}">
<view class="wallet-nav" :style="{'padding-top': navSafeTop + 'px'}">
<view class="back-btn" @tap="back">
<text></text>
</view>
@ -29,7 +29,7 @@
<view class="hero-watermark">WALLET</view>
<view class="hero-copy">
<view class="hero-label" @tap.stop="toggleBalance">
<text>用户余额</text>
<text>用户余额</text>
<view class="eye-badge" :class="{closed: !showBalance}">
<view class="eye-line" v-if="showBalance"></view>
<text class="eye-emoji" v-else>🙈</text>
@ -45,7 +45,7 @@
</view>
<view class="withdraw-btn" @tap.stop="userCommion('user', balanceUser.depoBal, balanceUser)">
<text>提现</text>
<view class="btn-arrow"></view>
<!-- <view class="btn-arrow"></view> -->
</view>
</view>
@ -53,23 +53,34 @@
<view class="identity-grid">
<!-- 配送兼职佣金卡片 -->
<view v-if="hasWorkerWallet" class="identity-card worker-card enter-card" :class="{active: activeWalletType === 'worker'}" @tap="switchWallet('worker')">
<view class="card-title">配送兼职佣金<text class="info-icon">?</text></view>
<view class="card-title">配送可提现佣金</view>
<view class="card-value">{{ showBalance ? formatMoney(balanceWorker.depoBalRel) : '••••' }}</view>
<view class="card-today">今日佣金 {{ showBalance ? formatMoney(balanceWorker.depoBal) : '••••' }}</view>
<view class="card-link-btn">去查看 </view>
<view class="worker-today-line">
今日佣金{{ showBalance ? formatMoney(workerTodayCommission) : '••••' }}<text>次日可提现</text>
</view>
<view class="card-link-btn" @tap.stop="userCommion('worker', balanceWorker.depoBalRel, balanceWorker)">提现</view>
<view class="card-illus">🛵</view>
</view>
<!-- 店铺余额卡片 -->
<view v-if="hasShopWallet" class="identity-card shop-card enter-card" :class="{active: activeWalletType === 'shop'}" @tap="switchWallet('shop')">
<view class="card-title">店铺余额<text class="info-icon">?</text></view>
<view class="card-value">{{ showBalance ? formatMoney(shopTotalBalance) : '••••' }}</view>
<view class="card-link-btn">去查看 </view>
<view class="card-title">{{currentShopName}}余额</view>
<view class="card-value">{{ showBalance ? formatMoney(currentShopBalance) : '••••' }}</view>
<view class="card-today" v-if="shopWallets.length > 1">当前第 {{activeShopIndex + 1}} / {{shopWallets.length}} 个店铺</view>
<view class="card-link-btn" @tap.stop="userCommion('shop', currentShopBalance, currentShop)">提现</view>
<view class="card-illus shop-image-illus">
<image class="shop-illus-img" src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/f19689fe650a4a439f7d9096d354b47e.png" mode="aspectFit"></image>
</view>
</view>
</view>
<scroll-view v-if="hasShopWallet && shopWallets.length > 1" scroll-x class="shop-switch-scroll" :show-scrollbar="false">
<view class="shop-switch-list">
<view class="shop-switch-item" :class="{active: activeWalletType === 'shop' && activeShopIndex === index}"
v-for="(shop,index) in shopWallets" :key="index" @tap="switchShop(index)">
{{getShopName(shop, index)}}
</view>
</view>
</scroll-view>
<!-- 余额明细面板 -->
<view class="flow-panel enter-card">
@ -77,7 +88,7 @@
<view class="flow-tabs">
<view class="flow-tab active">余额明细</view>
</view>
<view class="flow-filter">全部 <text class="filter-caret"></text></view>
<view class="flow-filter">点击不同身份查看余额明细</view>
</view>
<view class="timeline-list">
@ -114,7 +125,7 @@
<text class="tip-icon">📢</text>
<text class="tip-text"><text class="tip-bold">小提示</text>努力兼职钱包会鼓鼓的哦 💪</text>
</view>
<view class="tip-arrow"></view>
<!-- <view class="tip-arrow"></view> -->
</view>
<!-- 出层 -->
@ -166,6 +177,7 @@
totalPages: 1,
commionUrl:'',
commionAmount:0,
withdrawMaxAmount: 0,
linkId:'',
activeWalletType: 'user',
activeShopIndex: 0,
@ -178,6 +190,10 @@
}
},
computed: {
navSafeTop() {
const top = Number(this.menuButtonInfo && this.menuButtonInfo.top)
return top && top > 20 ? top : 44
},
shopWallets() {
if (Array.isArray(this.balanceShop)) return this.balanceShop
return this.balanceShop && typeof this.balanceShop === 'object' ? [this.balanceShop] : []
@ -197,6 +213,13 @@
currentShop() {
return this.shopWallets[this.activeShopIndex] || this.shopWallets[0] || {}
},
currentShopName() {
return this.getShopName(this.currentShop, this.activeShopIndex)
},
currentShopBalance() {
const shop = this.currentShop || {}
return shop.balance != null ? shop.balance : (shop.depoBal != null ? shop.depoBal : 0)
},
workerTodayCommission() {
if (!this.balanceWorker) return 0
if (this.balanceWorker.todayCommission != null) return this.balanceWorker.todayCommission
@ -210,10 +233,10 @@
},
displayRewardLists() {
return (this.rewardLists || []).map((item, index) => {
const amountClass = this.amountClass(item.amount)
const amountClass = this.amountClass(item)
return Object.assign({}, item, {
amountClass,
amountText: this.formatSignedAmount(item.amount),
amountText: this.formatSignedAmount(item),
flowIconKey: this.flowIconKey(item.dealingsWay),
flowEmoji: this.flowEmoji(item.dealingsWay),
delay: (index * 0.04) + 's'
@ -249,7 +272,7 @@
this.balanceWorker = res.result.worker
}
if(res.result.shop){
this.balanceShop = res.result.shop
this.balanceShop = Array.isArray(res.result.shop) ? res.result.shop : [res.result.shop]
}
this.syncActiveWallet()
this.$forceUpdate();
@ -266,15 +289,17 @@
})
},
userCommion(type,commion,item){
const withdrawAmount = Number(commion) || 0
if(type=='user'){
this.commionUrl = '/app/returnCommission/handleReturnUser'
}else if(type=='worker'){
this.commionUrl = '/app/returnCommission/handleReturnWorker'
}else{
this.commionUrl = '/app/returnCommission/handleReturn'
this.shopId = item.id
this.shopId = item && item.id
}
this.commionAmount = commion
this.commionAmount = this.formatMoney(withdrawAmount)
this.withdrawMaxAmount = withdrawAmount
this.commionType = type
this.submittingWithdraw = false
this.withdrawRequestId = this.createWithdrawRequestId()
@ -298,6 +323,9 @@
if (this.activeWalletType === 'shop' && this.activeShopIndex >= this.shopWallets.length) {
this.activeShopIndex = 0
}
if (this.activeWalletType !== 'shop') {
this.activeShopIndex = 0
}
this.setCurrentLinkId()
},
setCurrentLinkId(){
@ -319,13 +347,21 @@
switchWallet(type){
if (this.activeWalletType === type) return
this.activeWalletType = type
if (type === 'shop' && this.activeShopIndex >= this.shopWallets.length) {
this.activeShopIndex = 0
}
this.setCurrentLinkId()
},
switchShop(index){
if (this.activeShopIndex === index) return
this.activeShopIndex = index
this.activeWalletType = 'shop'
this.setCurrentLinkId()
},
getShopName(shop, index) {
if (!shop) return `店铺${index + 1}`
return shop.shopName || shop.name || shop.storeName || shop.merchantName || `店铺${index + 1}`
},
loadMoreFlow(){
if (this.searchForm.pageNum >= this.totalPages) return
this.searchForm.pageNum += 1
@ -338,8 +374,17 @@
return
}
const amount = Number(this.commionAmount)
if(!amount || amount < 1 || amount > 5000){
that.tui.toast('单笔提现金额应在1-5000之间')
const maxAmount = Number(this.withdrawMaxAmount) || 0
if(!amount || amount < 1){
that.tui.toast('提现金额不能小于1元')
return
}
if(amount > 5000){
that.tui.toast('单笔提现金额不能超过5000元')
return
}
if(amount > maxAmount){
that.tui.toast('提现金额不能超过可提现金额')
return
}
if(!this.aliName){
@ -399,13 +444,16 @@
if (!isFinite(num)) return '0.00'
return num.toFixed(2)
},
amountClass(amount){
return Number(amount) < 0 ? 'outcome' : 'income'
isIncomeFlow(item){
return item && Number(item.dealingsType) === 0
},
formatSignedAmount(amount){
const num = Number(amount)
amountClass(item){
return this.isIncomeFlow(item) ? 'income' : 'outcome'
},
formatSignedAmount(item){
const num = Number(item && item.amount)
if (!isFinite(num)) return '+0.00'
const prefix = num < 0 ? '-' : '+'
const prefix = this.isIncomeFlow(item) ? '+' : '-'
return prefix + Math.abs(num).toFixed(2)
},
flowIconKey(title) {
@ -452,8 +500,13 @@
rewardList(){
this.loadStatus = 'loading'
let that = this
this.searchForm.linkUserId = this.linkId;
that.tui.request("/mall/coupon/selectRewardByRegionId", "POST", this.searchForm, false, false).then((res) => {
const params = Object.assign({}, this.searchForm, {
linkUserId: this.linkId
})
if (this.activeWalletType === 'user') {
params.excludeDealingsWay = '免单奖励'
}
that.tui.request("/mall/coupon/selectRewardByRegionId", "POST", params, false, false).then((res) => {
that.loadStatus = 'nomore';
if (res.code == 200) {
that.totalPages = res.result.pages
@ -480,17 +533,20 @@
<style lang="scss">
page {
width: 100%;
min-height: 100%;
height: 100%;
font-size: 24rpx;
background: #F3FFF8;
color: #153A2E;
overflow: hidden;
}
.wallet-page {
width: 100%;
min-height: 100vh;
height: 100vh;
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
background:
radial-gradient(circle at 18% 8%, rgba(205, 255, 206, 0.78), rgba(205, 255, 206, 0) 220rpx),
radial-gradient(circle at 88% 10%, rgba(142, 239, 255, 0.5), rgba(142, 239, 255, 0) 300rpx),
@ -547,11 +603,13 @@
.wallet-nav {
position: relative;
z-index: 2;
height: 124rpx;
flex: none;
min-height: 132rpx;
display: flex;
align-items: center;
padding-left: 32rpx;
padding-right: 32rpx;
padding-bottom: 10rpx;
box-sizing: content-box;
}
@ -586,7 +644,9 @@
.wallet-scroll {
position: relative;
z-index: 1;
height: calc(100vh - 124rpx);
flex: 1;
height: 0;
min-height: 0;
}
.wallet-content {
@ -827,9 +887,9 @@
.identity-card {
position: relative;
min-height: 264rpx;
min-height: 238rpx;
border-radius: 34rpx;
padding: 30rpx 26rpx 26rpx;
padding: 26rpx 22rpx 68rpx;
box-sizing: border-box;
overflow: hidden;
display: flex;
@ -864,7 +924,7 @@
display: flex;
align-items: center;
gap: 8rpx;
font-size: 24rpx;
font-size: 22rpx;
font-weight: 700;
color: rgba(21, 58, 46, 0.62);
}
@ -882,9 +942,9 @@
}
.card-value {
margin-top: 16rpx;
font-size: 52rpx;
line-height: 58rpx;
margin-top: 12rpx;
font-size: 46rpx;
line-height: 50rpx;
font-weight: 900;
letter-spacing: -1rpx;
color: #153A2E;
@ -897,36 +957,58 @@
color: #12B76A;
}
.worker-today-line {
margin-top: 8rpx;
max-width: 230rpx;
font-size: 20rpx;
line-height: 26rpx;
font-weight: 900;
color: #12B76A;
white-space: nowrap;
position: relative;
z-index: 1;
}
.worker-today-line text {
margin-left: 6rpx;
font-size: 18rpx;
font-weight: 700;
color: rgba(18, 183, 106, 0.66);
}
.card-link-btn {
margin-top: auto;
width: fit-content;
padding: 12rpx 26rpx;
padding: 9rpx 22rpx;
border-radius: 999rpx;
background: #FFFFFF;
box-shadow: 0 8rpx 20rpx rgba(28, 122, 91, 0.08);
font-size: 23rpx;
font-weight: 800;
color: #137A5A;
position: relative;
z-index: 1;
position: absolute;
left: 22rpx;
bottom: 18rpx;
z-index: 2;
}
.card-illus {
position: absolute;
right: 12rpx;
bottom: 12rpx;
font-size: 96rpx;
right: 8rpx;
bottom: 8rpx;
font-size: 72rpx;
line-height: 1;
filter: drop-shadow(0 10rpx 18rpx rgba(28, 122, 91, 0.14));
animation: illusFloat 5s ease-in-out infinite alternate;
pointer-events: none;
opacity: 0.9;
}
.shop-image-illus {
right: -16rpx;
bottom: -30rpx;
width: 160rpx;
height: 160rpx;
bottom: -20rpx;
width: 120rpx;
height: 120rpx;
display: flex;
align-items: center;
justify-content: center;
@ -934,11 +1016,45 @@
}
.shop-illus-img {
width: 160rpx;
height: 160rpx;
width: 120rpx;
height: 120rpx;
display: block;
}
.shop-switch-scroll {
width: 100%;
margin-top: 18rpx;
white-space: nowrap;
}
.shop-switch-list {
display: inline-flex;
gap: 16rpx;
padding: 0 2rpx 4rpx;
}
.shop-switch-item {
max-width: 240rpx;
height: 60rpx;
line-height: 60rpx;
padding: 0 24rpx;
border-radius: 999rpx;
background: rgba(255, 255, 255, 0.72);
color: rgba(21, 58, 46, 0.58);
font-size: 24rpx;
font-weight: 800;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
box-shadow: inset 0 0 0 1rpx rgba(21, 58, 46, 0.06);
}
.shop-switch-item.active {
background: linear-gradient(90deg, #19C889, #65E08D);
color: #fff;
box-shadow: 0 10rpx 22rpx rgba(18, 183, 106, 0.18);
}
/* ---------- 余额明细面板 ---------- */
.flow-panel {
margin-top: 28rpx;
@ -990,7 +1106,7 @@
border-radius: 999rpx;
background: #F2FFF8;
border: 1rpx solid rgba(28, 122, 91, 0.06);
font-size: 24rpx;
font-size: 20rpx;
font-weight: 700;
color: rgba(21, 58, 46, 0.58);
display: flex;

16
package2/partTimeJob/partTimeJobCenter.vue

@ -102,6 +102,22 @@
配送佣金
</view>
</view>
<view class="data22">
<view class="data222">
{{orderData.afterSaleCount == undefined ? 0 : orderData.afterSaleCount}}
</view>
<view class="data333">
退/售后笔数
</view>
</view>
<view class="data22">
<view class="data222">
{{orderData.afterSaleAmount == undefined ? 0 : orderData.afterSaleAmount}}
</view>
<view class="data333">
退/售后金额
</view>
</view>
</view>
</view>
<view class="shop-order">

2
package2/shop/afterService.vue

@ -374,7 +374,7 @@
return;
}
uni.navigateTo({
url: '/package1/order/orderDetail?id=' + orderId
url: '/package1/order/orderDetail?id=' + orderId + '&refundAmountMode=settlement'
});
},
makeCall(phone){

4
package2/shop/merchantCenter.vue

@ -143,7 +143,7 @@
{{shopData.orderRevenueAndCount.afterSaleCount == undefined?0:shopData.orderRevenueAndCount.afterSaleCount}}
</view>
<view class="data333">
售后笔数
退/售后笔数
</view>
</view>
<view class="data22">
@ -151,7 +151,7 @@
{{shopData.orderRevenueAndCount.afterSaleAmount == undefined?0:shopData.orderRevenueAndCount.afterSaleAmount}}
</view>
<view class="data333">
售后金额
退/售后金额
</view>
</view>
</view>

266
package2/shop/orderDetail.vue

@ -147,7 +147,7 @@
</view>
<view class="refund-row">
<view class="refund-label">金额</view>
<view class="refund-value refund-amount">{{formatAmount(item.refundAmount)}}</view>
<view class="refund-value refund-amount">{{formatMoney(getMerchantRefundDisplayAmount(item))}}</view>
</view>
<view class="refund-goods-card" v-for="(goods,goodsIndex) in item.items" :key="goodsIndex"
v-if="item.items != null && item.items.length > 0">
@ -200,6 +200,47 @@
</view>
</view>
</view>
<view class="box1 income-card" v-if="data.incomeSummary && data.incomeSummary.show">
<view class="income-title">
<text>商家预计收入</text>
<text class="income-total">{{formatMoney(data.incomeSummary.expectedIncome)}}</text>
</view>
<view class="income-subtitle">{{data.incomeSummary.remark}}</view>
<view class="income-row">
<text>结算基数</text>
<text>{{formatMoney(data.incomeSummary.baseAmount)}}</text>
</view>
<view class="income-formula">商品金额 {{formatMoney(data.goodsAmount)}} + 餐盒/打包费 {{formatMoney(data.packageFee)}}</view>
<view class="income-row">
<text>抽佣比例</text>
<text>{{formatMoney(data.incomeSummary.commissionRate)}}%</text>
</view>
<view class="income-row">
<text>正常结算</text>
<text>{{formatMoney(data.incomeSummary.normalSettlementAmount)}}</text>
</view>
<view class="income-formula">
{{formatMoney(data.incomeSummary.normalBaseAmount)}} - 平台服务费 {{formatMoney(data.incomeSummary.normalCommissionAmount)}}
</view>
<view class="income-row" v-if="data.incomeSummary.deductionBaseAmount > 0">
<text>退款/售后责任扣款</text>
<text class="income-negative">-{{formatMoney(data.incomeSummary.deductionSettlementAmount)}}</text>
</view>
<view class="income-formula" v-if="data.incomeSummary.deductionBaseAmount > 0">
责任金额 {{formatMoney(data.incomeSummary.deductionBaseAmount)}} - 返还服务费 {{formatMoney(data.incomeSummary.deductionCommissionAmount)}}
</view>
<view class="income-row income-result">
<text>预计收入</text>
<text>{{formatMoney(data.incomeSummary.expectedIncome)}}</text>
</view>
<view class="income-formula">正常结算 - 退款/售后责任扣款</view>
<view class="income-line-list" v-if="data.incomeSummary.lines && data.incomeSummary.lines.length > 0">
<view class="income-line" v-for="(line,lineIndex) in data.incomeSummary.lines" :key="lineIndex">
<text>{{line.name}}</text>
<text :class="{'income-negative': line.amount < 0}">{{line.amount < 0 ? '-' : ''}}{{formatMoney(absAmount(line.amount))}}</text>
</view>
</view>
</view>
<view class="box1">
<view class="">
<view style="display: flex;height: 60rpx;line-height: 60rpx;">
@ -323,7 +364,7 @@
预计收入
</view>
<view style="color: red;font-weight: 700;">
{{data.yujishouru?data.yujishouru:0}}
{{data.incomeSummary ? formatMoney(data.incomeSummary.expectedIncome) : (data.yujishouru?data.yujishouru:0)}}
</view>
</view>
<view style="margin-top: 20rpx;">
@ -428,10 +469,141 @@
if (value === undefined || value === null || value === '') return '0';
return value;
},
formatMoney(value) {
let num = this.toAmount(value);
return num.toFixed(2);
},
toAmount(value) {
let num = Number(value);
return isNaN(num) ? 0 : num;
},
roundAmount(value) {
return Number(this.toAmount(value).toFixed(2));
},
absAmount(value) {
return Math.abs(this.toAmount(value));
},
isRunnerOrder(order) {
return order && order.otherOrder == 1;
},
isMerchantDeliveryOrder(order) {
return order && order.deliveryType == 1;
},
isWorkerRefundRecord(record) {
return !!(record && record.linkId && String(record.linkId).toUpperCase().indexOf('W') == 0);
},
isApprovedRefundRecord(record) {
return record && (record.status == 1 || record.status == 4);
},
isMerchantResponsibilityRecord(record) {
if (!record || this.isWorkerRefundRecord(record)) return false;
return record.refundTypeStatus == 1 || record.refundTypeStatus == 3;
},
isMerchantAfterSaleDeductionRecord(record) {
if (!record || record.status != 4) return false;
if (!this.isMerchantResponsibilityRecord(record)) return false;
return record.refundType != 2;
},
getMerchantRefundDisplayAmount(item) {
if (!item) return 0;
return item.settlementAmount != null ? item.settlementAmount : item.refundAmount;
},
getCommissionRate(order) {
let shopTakeaway = uni.getStorageSync('shopTakeaway') || {};
if (order && order.orderType == 1) {
return this.toAmount(shopTakeaway.commissionRateOne);
}
return this.toAmount(shopTakeaway.commissionRateMore);
},
getSettlementNet(baseAmount, commissionBaseAmount, commissionRate) {
let commission = this.roundAmount(this.toAmount(commissionBaseAmount) * this.toAmount(commissionRate) / 100);
let settlement = this.roundAmount(this.toAmount(baseAmount) - commission);
return {
commission,
settlement
};
},
buildMerchantIncomeSummary(order) {
if (!order || this.isRunnerOrder(order)) {
return {
show: false,
expectedIncome: 0
};
}
let baseAmount = this.roundAmount(this.toAmount(order.goodsAmount) + this.toAmount(order.packageFee));
let deliveryFee = this.toAmount(order.deliveryFee);
let commissionRate = this.getCommissionRate(order);
let refundRecords = Array.isArray(order.mallRefundRecord) ? order.mallRefundRecord : [];
let approvedRefundRecords = refundRecords.filter(item => this.isApprovedRefundRecord(item));
let hasWorkerReasonRefund = approvedRefundRecords.some(item => item.status == 1 && item.refundTypeStatus == 2 && this.isWorkerRefundRecord(item));
let hasMerchantReasonRefund = approvedRefundRecords.some(item => item.status == 1 && item.refundTypeStatus == 1 && this.isMerchantResponsibilityRecord(item));
let hasBothReasonRefund = approvedRefundRecords.some(item => item.status == 1 && item.refundTypeStatus == 3);
let normalBaseAmount = (order.status == 6 || order.status == 8) ? 0 : baseAmount;
if (order.status == 8 && hasWorkerReasonRefund) {
normalBaseAmount = baseAmount;
}
if (order.status == 8 && (hasMerchantReasonRefund || hasBothReasonRefund)) {
normalBaseAmount = 0;
}
let normalNet = this.getSettlementNet(normalBaseAmount, normalBaseAmount, commissionRate);
let deductionBaseAmount = 0;
let deductionCommissionAmount = 0;
let deductionSettlementAmount = 0;
let lines = [];
if (normalBaseAmount > 0) {
lines.push({
name: '正常订单结算',
amount: normalNet.settlement
});
}
if (order.status == 8 && hasMerchantReasonRefund && this.isMerchantDeliveryOrder(order)) {
let deliveryDeduction = this.roundAmount(deliveryFee);
deductionBaseAmount = this.roundAmount(deductionBaseAmount + deliveryFee);
deductionSettlementAmount = this.roundAmount(deductionSettlementAmount + deliveryDeduction);
lines.push({
name: '商家原因退款承担配送费',
amount: -deliveryDeduction
});
}
approvedRefundRecords.forEach(item => {
if (!this.isMerchantAfterSaleDeductionRecord(item)) return;
let responsibilityAmount = this.toAmount(this.getMerchantRefundDisplayAmount(item));
if (responsibilityAmount <= 0) return;
let includesDeliveryFee = item.refundType == 3 && item.refundTypeStatus == 1 && this.isMerchantDeliveryOrder(order);
let commissionBase = includesDeliveryFee ? Math.max(0, responsibilityAmount - deliveryFee) : responsibilityAmount;
let deductionNet = this.getSettlementNet(responsibilityAmount, commissionBase, commissionRate);
deductionBaseAmount = this.roundAmount(deductionBaseAmount + responsibilityAmount);
deductionCommissionAmount = this.roundAmount(deductionCommissionAmount + deductionNet.commission);
deductionSettlementAmount = this.roundAmount(deductionSettlementAmount + deductionNet.settlement);
lines.push({
name: '商家原因售后扣款',
amount: -deductionNet.settlement
});
});
let expectedIncome = this.roundAmount(normalNet.settlement - deductionSettlementAmount);
let remark = '按后台结算口径估算,最终以平台结算账单为准';
if (order.status == 8 && hasWorkerReasonRefund) {
remark = '配送员原因全额退款,商家餐费仍按正常订单结算';
} else if (order.status == 8 && hasMerchantReasonRefund) {
remark = this.isMerchantDeliveryOrder(order) ? '商家原因全额退款,商家不结餐费并承担配送费' : '商家原因全额退款,商家不产生收入';
} else if (order.status == 8 && hasBothReasonRefund) {
remark = '商家/配送员都有原因全额退款,商家不产生收入';
}
return {
show: true,
baseAmount,
commissionRate,
normalBaseAmount,
normalCommissionAmount: normalNet.commission,
normalSettlementAmount: normalNet.settlement,
deductionBaseAmount,
deductionCommissionAmount,
deductionSettlementAmount,
expectedIncome,
lines,
remark
};
},
getSettlementAmount(item) {
if (!item) return 0;
let price = this.toAmount(item.goodsAmount) + this.toAmount(item.packageFee);
@ -552,15 +724,9 @@
that.data = res.result
//
let price = that.getSettlementAmount(that.data)
let shopTakeaway = uni.getStorageSync('shopTakeaway') || {}
if(that.data.orderType == 1){
that.data.chouyong = (price/100 * Number(shopTakeaway.commissionRateOne || 0)).toFixed(2)
that.data.yujishouru = (price - that.data.chouyong).toFixed(2)
}else{
that.data.chouyong = (price/100 * Number(shopTakeaway.commissionRateMore || 0)).toFixed(2)
that.data.yujishouru = (price - that.data.chouyong).toFixed(2)
}
that.data.incomeSummary = that.buildMerchantIncomeSummary(that.data)
that.data.chouyong = that.data.incomeSummary ? that.formatMoney(that.data.incomeSummary.normalCommissionAmount) : 0
that.data.yujishouru = that.data.incomeSummary ? that.formatMoney(that.data.incomeSummary.expectedIncome) : 0
if(that.data.groupInfo != null && that.data.groupInfo != undefined && that.data.groupInfo.groupOrderIds){
that.data.groupInfo.groupIdList = that.data.groupInfo.groupOrderIds.split(',');
}
@ -968,6 +1134,84 @@
border-radius: 16rpx;
background: #f0f5f3;
}
.income-card {
border: 1rpx solid rgba(0, 35, 28, 0.08);
background: linear-gradient(180deg, #ffffff 0%, #f8fffc 100%);
}
.income-title {
display: flex;
align-items: center;
padding-bottom: 14rpx;
border-bottom: 1px solid #eef2ef;
color: #00231C;
font-size: 32rpx;
font-weight: 900;
}
.income-title text:first-child {
flex: 1;
}
.income-total {
color: red;
font-size: 34rpx;
}
.income-subtitle {
margin-top: 14rpx;
padding: 14rpx 18rpx;
border-radius: 16rpx;
background: rgba(166, 255, 234, 0.28);
color: #37645b;
font-size: 24rpx;
font-weight: 700;
line-height: 34rpx;
}
.income-row {
display: flex;
align-items: center;
min-height: 58rpx;
color: #00231C;
font-size: 27rpx;
font-weight: 800;
}
.income-row text:first-child {
flex: 1;
color: #66736f;
}
.income-formula {
margin-bottom: 8rpx;
color: #8a9692;
font-size: 23rpx;
line-height: 32rpx;
}
.income-result {
margin-top: 8rpx;
padding-top: 10rpx;
border-top: 1px dashed #dce7e2;
font-size: 30rpx;
}
.income-result text:last-child {
color: red;
font-size: 34rpx;
}
.income-negative {
color: #f04438;
}
.income-line-list {
margin-top: 14rpx;
padding: 14rpx 18rpx;
border-radius: 16rpx;
background: rgba(247, 248, 248, 0.9);
}
.income-line {
display: flex;
min-height: 42rpx;
line-height: 42rpx;
color: #66736f;
font-size: 24rpx;
font-weight: 700;
}
.income-line text:first-child {
flex: 1;
}
.auto-refund-tip {
margin: 8rpx 0 12rpx;
padding: 16rpx 18rpx;

28
package2/shop/shopOrderList.vue

@ -30,7 +30,7 @@
<view class="order-time">{{item.createTime | formatISOTime}}</view>
</view>
<view class="order-status">
{{item.status == 0?'待支付':item.status == 2?'待配送员接单-不要出餐':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime == null) || (item.status == 3 && item.deliveryType == 2 && item.userRequireMake == 1)?'待出餐':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null)?'待取货':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null) || (item.status == 3 && item.deliveryType == 2 && item.userRequireMake != 1)?'待消费':item.status == 4?'待送达':item.status == 5?'已完成':item.status == 7?'待同意退款':item.status == 8?'已退款':item.status == 6?'已取消':item.status == 11?'售后中':item.status == 12?'已售后':""}}
{{item.status == 0?'待支付':item.status == 2?'待接单-不要出餐':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime == null) || (item.status == 3 && item.deliveryType == 2 && item.userRequireMake == 1)?'待出餐':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null)?'待取货':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null) || (item.status == 3 && item.deliveryType == 2 && item.userRequireMake != 1)?'待消费':item.status == 4?'待送达':item.status == 5?'已完成':item.status == 7?'待同意退款':item.status == 8?'已退款':item.status == 6?'已取消':item.status == 11?'售后中':item.status == 12?'已售后':""}}
</view>
</view>
<view class="delivery-info-row" v-if="item.deliveryType == 1 && (isAppointmentDelivery(item) || getDeliveryMustFinishTime(item))">
@ -77,7 +77,7 @@
拼团详情
</view>
<view class="footer-space"></view>
<view @tap.stop="mealServing(item)" v-if="currentIndex == 13" class="btn meal-btn">
<view @tap.stop="mealServing(item)" v-if="canShowMealServingButton(item)" class="btn meal-btn">
出餐
</view>
</view>
@ -96,7 +96,7 @@
</view>
<view class="group-popup-close" @tap="$refs.pintuanPopup.close()">×</view>
</view>
<scroll-view scroll-y class="group-popup-scroll" :class="{ 'group-popup-scroll-with-footer': isFaceDeliveryOrder(groupOrderCheck) }">
<scroll-view scroll-y class="group-popup-scroll" :class="{ 'group-popup-scroll-with-footer': canShowBatchMealServingButton(groupOrderCheck) }">
<view class="group-order-card" v-for="(item,index) in tuanzhangOrder" :key="index">
<view class="group-order-head">
<view class="group-order-code">订单-{{item.numberCode || item.id}}</view>
@ -124,7 +124,7 @@
</view>
<view class="group-popup-empty" v-if="tuanzhangOrder.length == 0">暂无拼团订单</view>
</scroll-view>
<view class="group-popup-footer" v-if="isFaceDeliveryOrder(groupOrderCheck)">
<view class="group-popup-footer" v-if="canShowBatchMealServingButton(groupOrderCheck)">
<view class="group-all-meal-btn" @tap="batchMealServing">已全部出餐</view>
</view>
</view>
@ -325,6 +325,16 @@
isFaceDeliveryOrder(item) {
return !!item && item.deliveryType == 1 && item.orderType == 3
},
isEmptyShopMakeTime(value) {
return value === null || value === undefined || value === ''
},
canShowMealServingButton(item) {
if (!item || item.status != 3 || !this.isEmptyShopMakeTime(item.shopMakeTime)) return false
return item.deliveryType == 1 || (item.deliveryType == 2 && item.userRequireMake == 1)
},
canShowBatchMealServingButton(item) {
return this.isFaceDeliveryOrder(item) && this.canShowMealServingButton(item)
},
getDeliveryInfo(item) {
return item && item.deliveryInfo ? item.deliveryInfo : {}
},
@ -339,7 +349,7 @@
},
getStatusText(item) {
if (!item) return ''
return item.status == 0?'待支付':item.status == 2?'待配送员接单':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime == null) || (item.status == 3 && item.deliveryType == 2 && item.userRequireMake == 1)?'待出餐':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null)?'待取货':(item.status == 3 && item.deliveryType == 2)?'待消费':item.status == 4?'待送达':item.status == 5?'已完成':item.status == 7?'待同意退款':item.status == 8?'已退款':item.status == 6?'已取消':item.status == 11?'售后中':item.status == 12?'已售后':''
return item.status == 0?'待支付':item.status == 2?'待接单':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime == null) || (item.status == 3 && item.deliveryType == 2 && item.userRequireMake == 1)?'待出餐':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null)?'待取货':(item.status == 3 && item.deliveryType == 2)?'待消费':item.status == 4?'待送达':item.status == 5?'已完成':item.status == 7?'待同意退款':item.status == 8?'已退款':item.status == 6?'已取消':item.status == 11?'售后中':item.status == 12?'已售后':''
},
toNumber(value) {
let amount = parseFloat(value)
@ -360,6 +370,10 @@
return this.formatMoney(goodsAmount + this.toNumber(order.packageFee))
},
mealServing(item){
if (!this.canShowMealServingButton(item)) {
this.tui.toast('当前订单不可出餐')
return
}
let that = this
uni.showModal({
title: '提示',
@ -389,6 +403,10 @@
});
},
batchMealServing() {
if (!this.canShowBatchMealServingButton(this.groupOrderCheck)) {
this.tui.toast('当前订单不可出餐')
return
}
const orderIdList = (Array.isArray(this.tuanzhangOrder) ? this.tuanzhangOrder : [])
.map(item => this.getOrderId(item))
.filter(id => !!id)

Loading…
Cancel
Save