代客下单,订单管理修改会员价的判断依据,增加isMember字段
This commit is contained in:
parent
16cfbfec63
commit
40514ef243
|
|
@ -512,13 +512,12 @@
|
|||
totalAmount: 0,
|
||||
})
|
||||
const isVip=computed(()=>{
|
||||
return user.value&&user.value.id&&user.value.isVip
|
||||
return $shop.isVip&& user.value&&user.value.id&&user.value.isVip
|
||||
})
|
||||
const goodsPrice = computed(() => {
|
||||
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
||||
const memberPrice=cur.memberPrice?cur.memberPrice:cur.salePrice
|
||||
const tPrice = (isVip.value? memberPrice:cur.salePrice) * cur.number
|
||||
console.log(cur.isPack);
|
||||
const tpackFee = cur.isPack ? cur.packFee * 1 : 0
|
||||
return prve + (cur.isGift ? 0 : tPrice) + tpackFee
|
||||
}, 0)
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="user.isVip&&returnVipMoney(item)>0&&returnVipMoney(item)!=returnTotalMoney(item)">
|
||||
<template v-if="user.isVip&&item.isMember&&returnVipMoney(item)>0&&returnVipMoney(item)!=returnTotalMoney(item)">
|
||||
<view>¥{{returnVipMoney(item)}}</view>
|
||||
<view class=" color-666 line-th">
|
||||
¥{{returnTotalMoney(item)}}</view>
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
<view>商品券抵扣</view>
|
||||
<view class="color-red">
|
||||
<text>¥</text>
|
||||
<text>{{orderInfo.productCouponDiscountAmount}}</text>
|
||||
<text>{{orderInfo.productCouponDiscountAmount||productCoupPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-18">
|
||||
|
|
@ -313,7 +313,7 @@
|
|||
return 0
|
||||
}
|
||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||
const curTotal = cur.info.filter(v => v.gift != true && v.status !== "return"&&v.memberPrice&&(v.memberPrice!=v.price)).reduce((a,
|
||||
const curTotal = cur.info.filter(v => v.gift != true && v.status !== "return" &&!v.userCouponId&&(v.isMember&&v.memberPrice)&&(v.memberPrice!=v.price)).reduce((a,
|
||||
b) => {
|
||||
return a + (b.num * (b.price-b.memberPrice))
|
||||
}, 0)
|
||||
|
|
@ -321,8 +321,24 @@
|
|||
}, 0)
|
||||
return goodsPrice.toFixed(2)
|
||||
})
|
||||
|
||||
const productCoupPrice=computed(()=>{
|
||||
const goodsPrice = props.data.reduce((a, b) => {
|
||||
const curTotal = b.info.filter(v => v.gift != true&& v.userCouponId).reduce((prve,
|
||||
cur) => {
|
||||
const isVip=props.user.isVip&&cur.isMember
|
||||
const memberPrice=cur.memberPrice?cur.memberPrice:cur.price
|
||||
const price=isVip?memberPrice:cur.price
|
||||
const curTotal=price*cur.num
|
||||
return prve+curTotal
|
||||
}, 0)
|
||||
return a + curTotal
|
||||
}, 0)
|
||||
return goodsPrice.toFixed(2)
|
||||
})
|
||||
|
||||
const youhuiAllPrice=computed(()=>{
|
||||
return (freePrice.value*1+vipDiscountPrice.value*1+props.orderInfo.fullCouponDiscountAmount+props.orderInfo.productCouponDiscountAmount+props.orderInfo.pointsDiscountAmount).toFixed(2)
|
||||
return (freePrice.value*1+vipDiscountPrice.value*1+props.orderInfo.fullCouponDiscountAmount+props.orderInfo.productCouponDiscountAmount+props.orderInfo.pointsDiscountAmount+productCoupPrice.value*1).toFixed(2)
|
||||
})
|
||||
const packFee = computed(() => {
|
||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else-if="data.memberId&&item.memberPrice&&item.memberPrice!=item.price">
|
||||
<template v-else-if="data.isMember&&data.memberId&&item.memberPrice&&item.memberPrice!=item.price">
|
||||
<view class="u-text-right u-relative" :style="computedPriceStyle()">
|
||||
<text class="line-th">¥{{goodsPriceAmount(item)}}</text>
|
||||
<view class="u-absolute" style="bottom: 100%;right: 0;">
|
||||
|
|
@ -164,7 +164,7 @@
|
|||
}
|
||||
|
||||
function goodsVipPriceAmount(item) {
|
||||
const price = props.data.memberId ? item.memberPrice : item.price
|
||||
const price = (props.data.memberId&&item.isMember) ? item.memberPrice : item.price
|
||||
return (price * item.num).toFixed(2)
|
||||
}
|
||||
// const packeFee=computed(()=>{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
export function isTui(item) {
|
||||
return item.status == 'return' || item.status == 'refund' || item.status == 'refunding'
|
||||
}
|
||||
//是否使用会员价
|
||||
export function isUseVipPrice(vipUser,goods){
|
||||
return vipUser.id&&vipUser.isVip&&goods.isMember
|
||||
}
|
||||
|
||||
//计算商品券优惠价格
|
||||
export function returnProductCouponPrice(coup, goodsArr, vipUser) {
|
||||
|
|
@ -9,7 +13,7 @@ export function returnProductCouponPrice(coup, goodsArr, vipUser) {
|
|||
return 0
|
||||
}
|
||||
const memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
||||
const price = item ? (vipUser.isVip ? memberPrice : item.price) : 0;
|
||||
const price = item ? (isUseVipPrice(vipUser,item) ? memberPrice : item.price) : 0;
|
||||
return price * coup.num
|
||||
|
||||
}
|
||||
|
|
@ -50,7 +54,7 @@ export function returnProductCoupon(coup, goodsArr, vipUser, selCoupArr = []) {
|
|||
}
|
||||
}
|
||||
const memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
||||
const price = item ? (vipUser.isVip ? memberPrice : item.price) : 0;
|
||||
const price = item ? (vipUser(vipUser,item) ? memberPrice : item.price) : 0;
|
||||
const discountAmount = (price * coup.num).toFixed(2)
|
||||
console.log(discountAmount);
|
||||
|
||||
|
|
@ -81,7 +85,7 @@ export function returnProductAllCoup(coupArr, goodsArr, vipUser) {
|
|||
//返回商品实际支付价格
|
||||
export function returnProductPayPrice(goods,vipUser){
|
||||
const memberPrice = goods.memberPrice ? goods.memberPrice : goods.price;
|
||||
const price = vipUser.isVip ? memberPrice : item.price;
|
||||
const price = (vipUser,item) ? memberPrice : item.price;
|
||||
return price
|
||||
}
|
||||
//返回商品券抵扣的商品价格
|
||||
|
|
|
|||
Loading…
Reference in New Issue