代码更新
This commit is contained in:
@@ -4,13 +4,13 @@
|
||||
<text class="">桌号:</text>
|
||||
<text class="">{{orderInfo.tableName||""}}</text>
|
||||
</view>
|
||||
<view class=" font-bold u-p-b-32 border-bottom u-m-b-24" v-if="orderInfo.tableName&&orderInfo.status=='unpaid'">
|
||||
<!-- <view class=" font-bold u-p-b-32 border-bottom u-m-b-24" v-if="orderInfo.tableName&&orderInfo.status=='unpaid'">
|
||||
<view class="block" @tap="rotatingTables"
|
||||
style="display: flex;align-items: center;justify-content: space-between;">
|
||||
<view>转桌/并桌</view>
|
||||
<uni-icons type="right" color="#999" size="16"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class=" color-999 border-bottom u-p-b-24">
|
||||
<text>共</text>
|
||||
<text class="color-333 "> {{goodsNumber}}</text>
|
||||
@@ -55,7 +55,7 @@
|
||||
</view>
|
||||
<view class="u-m-r-20 u-font-24 u-flex" v-if="item.returnAmount">
|
||||
<view class="color-666">退款金额:</view>
|
||||
<view class="color-999 u-m-l-6">{{item.returnAmount}}</view>
|
||||
<view class="color-999 u-m-l-6">{{item.returnAmount*item.returnNum}}</view>
|
||||
</view>
|
||||
<view class="u-m-r-20 u-font-24 u-flex" v-if="item.returnNum">
|
||||
<view class="color-666">退菜数量:</view>
|
||||
@@ -70,7 +70,6 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-text-right u-m-t-28">
|
||||
{{isTui(item)}}
|
||||
<template v-if="isTui(item)">
|
||||
<view>¥0.00</view>
|
||||
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}</view>
|
||||
@@ -79,6 +78,10 @@
|
||||
<view>¥0.00</view>
|
||||
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}</view>
|
||||
</template>
|
||||
<template v-else-if="user.isVip == 1">
|
||||
<view>¥{{item.num*item.memberPrice}}</view>
|
||||
<view class="line-th color-666 ">¥{{item.num*item.price}}</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="returnCanTuiMoney(item)*1!=returnTotalMoney(item)*1">
|
||||
<view>¥{{returnTotalMoney(item)}}</view>
|
||||
@@ -96,7 +99,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="canTuicai(orderInfo,item)">
|
||||
<view class="u-flex u-row-right gap-20 u-m-t-24">
|
||||
<view class="u-flex u-row-right gap-20 u-m-t-24" v-if="item.returnNum*item.returnAmount<item.payAmount">
|
||||
<!-- <my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> -->
|
||||
<my-button :width="128" :height="48" plain shape="circle" @tap="tuicai(item,index)"><text
|
||||
class="no-wrap">退菜</text></my-button>
|
||||
@@ -134,10 +137,10 @@
|
||||
已优惠¥{{youhuiAllPrice}}
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<!-- <view>
|
||||
<text>小计¥</text>
|
||||
<text class="font-bold u-font-32">{{allPrice}}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
@@ -162,18 +165,25 @@
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="canTuiKuan(orderInfo)">
|
||||
<view class="u-flex u-row-right gap-20 u-m-t-20">
|
||||
<my-button :width="168" :height="48" plain shape="circle" @tap="tuikuan(data,index)"><text
|
||||
class="no-wrap">全部退款</text> </my-button>
|
||||
</view>
|
||||
</template>
|
||||
<view class="u-flex u-row-between u-m-t-20">
|
||||
|
||||
<view></view>
|
||||
<template v-if="orderInfo.status=='unpaid'">
|
||||
<view>
|
||||
<text>总计¥</text>
|
||||
<text class="font-bold u-font-32">{{orderInfo.orderAmount }}</text>
|
||||
<text class="font-bold u-font-32">{{orderInfo.orderAmount.toFixed(2)}}</text>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view>
|
||||
<text>总计¥</text>
|
||||
<text class="font-bold u-font-32">{{orderInfo.payAmount}}</text>
|
||||
<text class="font-bold u-font-32">{{orderInfo.payAmount.toFixed(2)}}</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -358,7 +368,20 @@
|
||||
function returnTotalMoney(item) {
|
||||
return (item.payAmount).toFixed(2)
|
||||
}
|
||||
|
||||
function returnCanTuiMoney(item) {
|
||||
// if (props.orderInfo.status == 'unpaid') {
|
||||
// return returnTotalMoney(item)
|
||||
// } else {
|
||||
if (props.orderInfo.pointsDiscountAmount > 0 || props.orderInfo.fullCouponDiscountAmount > 0) {
|
||||
return item.canReturnAmount
|
||||
} else if (item.price != item.unitPrice) {
|
||||
return item.price*item.num
|
||||
} else {
|
||||
return item.payAmount
|
||||
}
|
||||
|
||||
// }
|
||||
}
|
||||
const canTuiKuanPrice = computed(() => {
|
||||
const goodsTotal = props.data.reduce((prve, cur) => {
|
||||
const curTotal = cur.info.filter(v => !isTui(v) && !v.userCouponId)
|
||||
@@ -396,19 +419,7 @@
|
||||
return seatFee
|
||||
})
|
||||
|
||||
function returnCanTuiMoney(item) {
|
||||
if (props.orderInfo.status == 'unpaid') {
|
||||
return returnTotalMoney(item)
|
||||
} else {
|
||||
if (props.orderInfo.pointsDiscountAmount > 0 || props.orderInfo.fullCouponDiscountAmount > 0) {
|
||||
return item.canReturnAmount
|
||||
} else if (item.price != item.unitPrice) {
|
||||
return item.price*item.num
|
||||
} else {
|
||||
return item.payAmount
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function to2(n) {
|
||||
if (!n) {
|
||||
@@ -424,10 +435,27 @@
|
||||
function tuikuan(item, index) {
|
||||
hasPermission('允许退款').then(res => {
|
||||
if (res) {
|
||||
emits('tuikuan', {
|
||||
...item,
|
||||
payAmount: item.payAmount
|
||||
}, index)
|
||||
if (Array.isArray(item)) {
|
||||
let arr = [];
|
||||
console.log(item)
|
||||
item.map(v=>{
|
||||
v.info.map(obj=>{
|
||||
obj.number = 0
|
||||
obj.skuName = obj.skuName || ''
|
||||
obj.priceAmount = obj.priceAmount ? obj.priceAmount : (obj.num*obj.unitPrice).toFixed(2)
|
||||
obj.unitPrice = obj.unitPrice
|
||||
})
|
||||
|
||||
arr = [...arr,...v.info]
|
||||
})
|
||||
emits('tuikuan', arr)
|
||||
} else {
|
||||
emits('tuikuan', {
|
||||
...item,
|
||||
payAmount: item.payAmount
|
||||
}, index)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -448,7 +476,6 @@
|
||||
if (props.orderInfo.discountAmount) {
|
||||
return props.orderInfo.discountAmount
|
||||
}
|
||||
console.log(props.orderInfo.originAmount * (1 - props.orderInfo.discountRatio));
|
||||
return (props.orderInfo.originAmount * (1 - props.orderInfo.discountRatio))
|
||||
})
|
||||
const goodsOriginAllPrice = computed(() => {
|
||||
@@ -513,7 +540,7 @@
|
||||
* 已优惠金额
|
||||
*/
|
||||
const youhuiAllPrice = computed(() => {
|
||||
const n = props.orderInfo.orderAmount - props.orderInfo.payAmount + vipDiscountPrice.value * 1
|
||||
const n = props.orderInfo.originAmount - props.orderInfo.orderAmount + vipDiscountPrice.value * 1
|
||||
return (n < 0 ? 0 : n).toFixed(2)
|
||||
})
|
||||
|
||||
@@ -531,7 +558,6 @@
|
||||
})
|
||||
const allPrice = computed(() => {
|
||||
|
||||
|
||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||
const curTotal = cur.info.reduce((a,
|
||||
b) => {
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
</template>
|
||||
<view class="u-flex u-m-t-24 u-row-between u-font-28">
|
||||
<view class="">
|
||||
<view class="font-bold ">{{user.amount}}</view>
|
||||
<view class="font-bold ">{{user.amount||0}}</view>
|
||||
<view class="color-666 u-m-t-8 u-font-24">余额</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="font-bold">{{user.accountPoints}}</view>
|
||||
<view class="font-bold">{{user.accountPoints||0}}</view>
|
||||
<view class="color-666 u-m-t-8 u-font-24">积分</view>
|
||||
</view>
|
||||
<view class="">
|
||||
|
||||
Reference in New Issue
Block a user