wangfukang 2 weeks ago
parent
commit
1171c8fffa
  1. 5
      pages/myCenter/businessInfo.vue
  2. 47
      pages/shop/orderDetail.vue
  3. 24
      pages/shop/shopOrderList.vue

5
pages/myCenter/businessInfo.vue

@ -57,6 +57,10 @@
<view class="name">单独购买佣金</view> <view class="name">单独购买佣金</view>
<view class="text">{{shop.commissionRateOne || 0}}%</view> <view class="text">{{shop.commissionRateOne || 0}}%</view>
</view> </view>
<view class="value">
<view class="name">虚拟成团佣金</view>
<view class="text">{{shop.virtualGroupCommissionRate || 0}}%</view>
</view>
<view class="value"> <view class="value">
<view class="name">经营品类</view> <view class="name">经营品类</view>
<view class="text">{{shop.type || '暂无'}}</view> <view class="text">{{shop.type || '暂无'}}</view>
@ -82,6 +86,7 @@
status: 0, status: 0,
commissionRateMore: '', commissionRateMore: '',
commissionRateOne: '', commissionRateOne: '',
virtualGroupCommissionRate: '',
type: '', type: '',
isDelivery: 0, isDelivery: 0,
cookingTime: '' cookingTime: ''

47
pages/shop/orderDetail.vue

@ -29,6 +29,7 @@
<view style="border: 1px solid #48D1CC;height: 50rpx;line-height: 50rpx;padding: 0 20rpx;border-radius: 20rpx;margin-top: auto;margin-bottom: auto;color: #48D1CC;font-weight: 700;"> <view style="border: 1px solid #48D1CC;height: 50rpx;line-height: 50rpx;padding: 0 20rpx;border-radius: 20rpx;margin-top: auto;margin-bottom: auto;color: #48D1CC;font-weight: 700;">
{{(data.deliveryType == 1 && data.orderType != 3)?'普通配送单':(data.deliveryType == 1 && data.orderType == 3)?'面对面配送单':(data.isPack == 1 && data.otherOrder == null)?'自取-打包':(data.isPack == 0 && data.otherOrder == null)?'自取-堂食':'到店消费'}} {{(data.deliveryType == 1 && data.orderType != 3)?'普通配送单':(data.deliveryType == 1 && data.orderType == 3)?'面对面配送单':(data.isPack == 1 && data.otherOrder == null)?'自取-打包':(data.isPack == 0 && data.otherOrder == null)?'自取-堂食':'到店消费'}}
</view> </view>
<view class="virtual-group-tag" v-if="isVirtualGroupOrder(data)">虚拟成团</view>
<view v-if="data.deliveryType == 1" style="display: flex;flex: 1;padding-left: 20rpx;"> <view v-if="data.deliveryType == 1" style="display: flex;flex: 1;padding-left: 20rpx;">
<text style="flex: 1;">{{data.shopDelivery == 1 ? '商家配送员' : '配送员'}}{{getWorkerName(data)}}</text> <text style="flex: 1;">{{data.shopDelivery == 1 ? '商家配送员' : '配送员'}}{{getWorkerName(data)}}</text>
<view class="" v-if="data.deliveryInfo && data.deliveryInfo.workerPhone"> <view class="" v-if="data.deliveryInfo && data.deliveryInfo.workerPhone">
@ -107,7 +108,7 @@
-{{formatAmount(data.freeAmount)}} -{{formatAmount(data.freeAmount)}}
</view> </view>
</view> </view>
<view style="display: flex;height: 60rpx;line-height: 60rpx;" v-if="data.userCoupon && data.userCoupon.length >0"> <view style="display: flex;height: 60rpx;line-height: 60rpx;" v-if="data.userCoupon && data.userCoupon.length > 0">
<view style="flex: 1;"> <view style="flex: 1;">
优惠券 优惠券
</view> </view>
@ -150,7 +151,7 @@
<view class="refund-value refund-amount">{{formatMoney(getMerchantRefundDisplayAmount(item))}}</view> <view class="refund-value refund-amount">{{formatMoney(getMerchantRefundDisplayAmount(item))}}</view>
</view> </view>
<view class="refund-goods-card" v-for="(goods,goodsIndex) in item.items" :key="goodsIndex" <view class="refund-goods-card" v-for="(goods,goodsIndex) in item.items" :key="goodsIndex"
v-if="item.items != null && item.items.length > 0"> v-if="item.items != null && item.items != undefined && item.items.length > 0">
<view class="refund-goods-img"> <view class="refund-goods-img">
<image :src="goods.productPicture" alt=""> <image :src="goods.productPicture" alt="">
</view> </view>
@ -208,7 +209,7 @@
</view> </view>
<view class="income-formula">商品金额 {{formatMoney(data.goodsAmount)}} + 餐盒/打包费 {{formatMoney(data.packageFee)}}</view> <view class="income-formula">商品金额 {{formatMoney(data.goodsAmount)}} + 餐盒/打包费 {{formatMoney(data.packageFee)}}</view>
<view class="income-row"> <view class="income-row">
<text>抽佣比例</text> <text>{{data.incomeSummary.commissionRateLabel || '抽佣比例'}}</text>
<text>{{formatMoney(data.incomeSummary.commissionRate)}}%</text> <text>{{formatMoney(data.incomeSummary.commissionRate)}}%</text>
</view> </view>
<view class="income-row"> <view class="income-row">
@ -416,7 +417,11 @@
data() { data() {
return { return {
Ptype:'', Ptype:'',
data:{}, data:{
goodsList: [],
userCoupon: [],
mallRefundRecord: []
},
mealServingLoading: false mealServingLoading: false
} }
}, },
@ -518,8 +523,17 @@
if (order && order.orderType == 1) { if (order && order.orderType == 1) {
return this.toAmount(shopTakeaway.commissionRateOne); return this.toAmount(shopTakeaway.commissionRateOne);
} }
if (this.isVirtualGroupOrder(order)) {
const virtualRate = shopTakeaway.virtualGroupCommissionRate;
if (virtualRate !== undefined && virtualRate !== null && virtualRate !== '') {
return this.toAmount(virtualRate);
}
}
return this.toAmount(shopTakeaway.commissionRateMore); return this.toAmount(shopTakeaway.commissionRateMore);
}, },
isVirtualGroupOrder(order) {
return !!order && order.isVirtualGroup == 1;
},
getSettlementNet(baseAmount, commissionBaseAmount, commissionRate) { getSettlementNet(baseAmount, commissionBaseAmount, commissionRate) {
let commission = this.roundAmount(this.toAmount(commissionBaseAmount) * this.toAmount(commissionRate) / 100); let commission = this.roundAmount(this.toAmount(commissionBaseAmount) * this.toAmount(commissionRate) / 100);
let settlement = this.roundAmount(this.toAmount(baseAmount) - commission); let settlement = this.roundAmount(this.toAmount(baseAmount) - commission);
@ -549,6 +563,7 @@
} }
let baseAmount = this.roundAmount(this.toAmount(order.goodsAmount) + this.toAmount(order.packageFee)); let baseAmount = this.roundAmount(this.toAmount(order.goodsAmount) + this.toAmount(order.packageFee));
let commissionRate = this.getCommissionRate(order); let commissionRate = this.getCommissionRate(order);
let commissionRateLabel = order.orderType == 1 ? '单独购买抽佣比例' : (this.isVirtualGroupOrder(order) ? '虚拟成团抽佣比例' : '拼团抽佣比例');
let refundRecords = Array.isArray(order.mallRefundRecord) ? order.mallRefundRecord : []; let refundRecords = Array.isArray(order.mallRefundRecord) ? order.mallRefundRecord : [];
let approvedRefundRecords = refundRecords.filter(item => this.isApprovedRefundRecord(item)); let approvedRefundRecords = refundRecords.filter(item => this.isApprovedRefundRecord(item));
let hasWorkerReasonRefund = approvedRefundRecords.some(item => item.status == 1 && item.refundTypeStatus == 2 && this.isWorkerRefundRecord(item)); let hasWorkerReasonRefund = approvedRefundRecords.some(item => item.status == 1 && item.refundTypeStatus == 2 && this.isWorkerRefundRecord(item));
@ -607,10 +622,14 @@
} else if (order.status == 8 && hasBothReasonRefund) { } else if (order.status == 8 && hasBothReasonRefund) {
remark = '商家/配送员都有原因全额退款,商家不产生收入'; remark = '商家/配送员都有原因全额退款,商家不产生收入';
} }
if (this.isVirtualGroupOrder(order)) {
remark = '虚拟成团订单,' + remark;
}
return { return {
show: true, show: true,
baseAmount, baseAmount,
commissionRate, commissionRate,
commissionRateLabel,
normalBaseAmount, normalBaseAmount,
normalCommissionAmount: normalNet.commission, normalCommissionAmount: normalNet.commission,
normalSettlementAmount: normalNet.settlement, normalSettlementAmount: normalNet.settlement,
@ -669,7 +688,7 @@
return Number(amount.toFixed(2)); return Number(amount.toFixed(2));
}, },
getPictureList(pictures) { getPictureList(pictures) {
if (pictures == null || pictures === '') return []; if (pictures == null || pictures === '' || pictures == undefined) return [];
if (Array.isArray(pictures)) { if (Array.isArray(pictures)) {
return pictures.filter(item => item != null && item !== ''); return pictures.filter(item => item != null && item !== '');
} }
@ -739,7 +758,13 @@
let that = this let that = this
this.NB.sendRequest("/mall/order/detail/"+ this.shopId, {}, false, 'get', 'application/x-www-form-urlencoded').then((res) => { this.NB.sendRequest("/mall/order/detail/"+ this.shopId, {}, false, 'get', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) { if (res.code == 200) {
that.data = res.result that.data = res.result || {}
if (!Array.isArray(that.data.userCoupon)) {
that.data.userCoupon = []
}
if (!Array.isArray(that.data.mallRefundRecord)) {
that.data.mallRefundRecord = []
}
// //
that.data.incomeSummary = that.buildMerchantIncomeSummary(that.data) that.data.incomeSummary = that.buildMerchantIncomeSummary(that.data)
@ -1042,6 +1067,16 @@
color: #ff6b35; color: #ff6b35;
font-weight: 700; font-weight: 700;
} }
.virtual-group-tag {
height: 50rpx;
line-height: 50rpx;
margin: auto 0 auto 14rpx;
padding: 0 18rpx;
border-radius: 20rpx;
background: linear-gradient(90deg, #FF4500, #FFA07A);
color: #fff;
font-weight: 800;
}
.remark-box { .remark-box {
display: flex; display: flex;
border: 1px solid rgba(255, 107, 53, 0.22); border: 1px solid rgba(255, 107, 53, 0.22);

24
pages/shop/shopOrderList.vue

@ -28,6 +28,7 @@
{{'#' + item.numberCode}} {{'#' + item.numberCode}}
</view> </view>
<view class="seckill-order-tag" v-if="isSeckillOrder(item)">秒杀</view> <view class="seckill-order-tag" v-if="isSeckillOrder(item)">秒杀</view>
<view class="virtual-group-order-tag" v-if="isVirtualGroupOrder(item)">虚拟成团</view>
<view style="flex: 1;display: flex;padding-left: 20rpx;"> <view style="flex: 1;display: flex;padding-left: 20rpx;">
{{item.createTime | formatISOTime}} {{item.createTime | formatISOTime}}
<!-- <text>已退款</text> --> <!-- <text>已退款</text> -->
@ -202,6 +203,12 @@
uni.hideLoading(); uni.hideLoading();
}).catch((res) => {}) }).catch((res) => {})
}, },
isSeckillOrder(item) {
return !!item && item.seckillOrder == 1
},
isVirtualGroupOrder(item) {
return !!item && item.isVirtualGroup == 1
},
mealServing(item){ mealServing(item){
let that = this let that = this
uni.showModal({ uni.showModal({
@ -296,6 +303,23 @@
font-weight: 700; font-weight: 700;
margin-top: 20rpx; margin-top: 20rpx;
} }
.seckill-order-tag,
.virtual-group-order-tag {
height: 40rpx;
line-height: 40rpx;
padding: 0 14rpx;
margin-left: 10rpx;
border-radius: 999rpx;
color: #fff;
font-size: 22rpx;
font-weight: 800;
}
.seckill-order-tag {
background: linear-gradient(90deg, #ff3d2e, #ff9d2f);
}
.virtual-group-order-tag {
background: linear-gradient(90deg, #FF4500, #FFA07A);
}
.title-name { .title-name {
padding-top: 110rpx; padding-top: 110rpx;

Loading…
Cancel
Save