Merge branch 'dev' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into ymf_3.0.0
This commit is contained in:
@@ -169,7 +169,15 @@
|
|||||||
<view class="u-p-30" style="width: 80vw;">
|
<view class="u-p-30" style="width: 80vw;">
|
||||||
<view class="font-bold u-text-center">优惠详情</view>
|
<view class="font-bold u-text-center">优惠详情</view>
|
||||||
<view class="u-m-t-32">
|
<view class="u-m-t-32">
|
||||||
<view class="u-flex u-row-between">
|
<!-- <view class="u-flex u-row-between u-m-b-18">
|
||||||
|
<view>会员优惠</view>
|
||||||
|
<view class="color-red">
|
||||||
|
<text>¥</text>
|
||||||
|
<text>{{vipDiscountPrice}}</text>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
<view class="u-flex u-row-between ">
|
||||||
<view>满减券抵扣</view>
|
<view>满减券抵扣</view>
|
||||||
<view class="color-red">
|
<view class="color-red">
|
||||||
<text>¥</text>
|
<text>¥</text>
|
||||||
@@ -323,6 +331,9 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
const productCoupPrice=computed(()=>{
|
const productCoupPrice=computed(()=>{
|
||||||
|
if(props.orderInfo.status=='closed'){
|
||||||
|
return props.orderInfo.productCouponDiscountAmount
|
||||||
|
}
|
||||||
const goodsPrice = props.data.reduce((a, b) => {
|
const goodsPrice = props.data.reduce((a, b) => {
|
||||||
const curTotal = b.info.filter(v => v.gift != true&& v.userCouponId).reduce((prve,
|
const curTotal = b.info.filter(v => v.gift != true&& v.userCouponId).reduce((prve,
|
||||||
cur) => {
|
cur) => {
|
||||||
@@ -338,7 +349,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
const youhuiAllPrice=computed(()=>{
|
const youhuiAllPrice=computed(()=>{
|
||||||
return (freePrice.value*1+vipDiscountPrice.value*1+props.orderInfo.fullCouponDiscountAmount+props.orderInfo.productCouponDiscountAmount+props.orderInfo.pointsDiscountAmount+productCoupPrice.value*1).toFixed(2)
|
return (freePrice.value*1+vipDiscountPrice.value*1+props.orderInfo.fullCouponDiscountAmount+props.orderInfo.pointsDiscountAmount+productCoupPrice.value*1).toFixed(2)
|
||||||
})
|
})
|
||||||
const packFee = computed(() => {
|
const packFee = computed(() => {
|
||||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||||
@@ -352,7 +363,8 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
const allPrice = computed(() => {
|
const allPrice = computed(() => {
|
||||||
return (goodsOriginAllPrice.value-youhuiAllPrice.value).toFixed(2)
|
const n=goodsOriginAllPrice.value-youhuiAllPrice.value
|
||||||
|
return (n<0?0:n).toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
const goodsNumber = computed(() => {
|
const goodsNumber = computed(() => {
|
||||||
|
|||||||
@@ -395,8 +395,8 @@
|
|||||||
uni.$off('choose-quan')
|
uni.$off('choose-quan')
|
||||||
uni.$on('choose-quan', (arr) => {
|
uni.$on('choose-quan', (arr) => {
|
||||||
console.log(arr);
|
console.log(arr);
|
||||||
const manjianCoup = arr.filter(v => v.type == 1)
|
const manjianCoup = arr.filter(v => v.type == 1&&v.num>=1)
|
||||||
let productCoup = arr.filter(v => v.type == 2)
|
let productCoup = arr.filter(v => v.type == 2&&v.num>=1)
|
||||||
console.log(productCoup);
|
console.log(productCoup);
|
||||||
//商品券分组
|
//商品券分组
|
||||||
let coupMap={}
|
let coupMap={}
|
||||||
@@ -413,10 +413,9 @@
|
|||||||
for(let i in arr){
|
for(let i in arr){
|
||||||
const coup=arr[i]
|
const coup=arr[i]
|
||||||
const proCoupStartIndex=returnProCoupStartIndex(arr,i)
|
const proCoupStartIndex=returnProCoupStartIndex(arr,i)
|
||||||
console.log(proCoupStartIndex);
|
const num=Math.min($goodsPayPriceMap[coup.proId].length,coup.num)
|
||||||
console.log($goodsPayPriceMap[coup.proId]);
|
coup.num=num
|
||||||
coup.discountAmount=returnProductCoupAllPrice($goodsPayPriceMap[coup.proId],proCoupStartIndex,coup.num)
|
coup.discountAmount=returnProductCoupAllPrice($goodsPayPriceMap[coup.proId],proCoupStartIndex,num).toFixed(2)
|
||||||
console.log(coup.discountAmount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(productCoup);
|
console.log(productCoup);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class=" u-m-t-20 u-flex">
|
<view class=" u-m-t-20 u-flex">
|
||||||
<view>有效期:</view>
|
<view>有效期:</view>
|
||||||
<view class="u-font-24 u-m-l-6"> {{item.endTime}}</view>
|
<view class="u-font-24 u-m-l-6"> {{dayjs(item.endTime).format('YYYY-MM-DD HH:mm:ss') }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-10 color-999 u-font-24">
|
<view class="u-m-t-10 color-999 u-font-24">
|
||||||
{{ formatStr(item.useRestrictions)}}
|
{{ formatStr(item.useRestrictions)}}
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class=" u-m-t-14 u-flex">
|
<view class=" u-m-t-14 u-flex">
|
||||||
<view>有效期:</view>
|
<view>有效期:</view>
|
||||||
<view class="u-font-24 u-m-l-6"> {{item.endTime}}</view>
|
<view class="u-font-24 u-m-l-6"> {{dayjs(item.endTime).format('YYYY-MM-DD HH:mm:ss') }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-10 color-999 u-font-24">
|
<view class="u-m-t-10 color-999 u-font-24">
|
||||||
{{ formatStr(item.useRestrictions)}}
|
{{ formatStr(item.useRestrictions)}}
|
||||||
@@ -138,6 +138,7 @@
|
|||||||
onMounted
|
onMounted
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import color from '@/commons/color.js'
|
import color from '@/commons/color.js'
|
||||||
|
import dayjs from 'dayjs';
|
||||||
import {
|
import {
|
||||||
getSafeBottomHeight
|
getSafeBottomHeight
|
||||||
} from '@/commons/utils/safe-bottom.js'
|
} from '@/commons/utils/safe-bottom.js'
|
||||||
|
|||||||
@@ -58,8 +58,9 @@ export function returnProductCoupon(coup, goodsArr, vipUser, selCoupArr = []) {
|
|||||||
const discountAmount = (price * coup.num).toFixed(2)
|
const discountAmount = (price * coup.num).toFixed(2)
|
||||||
console.log(discountAmount);
|
console.log(discountAmount);
|
||||||
|
|
||||||
const canUse = !coup.use ? false : (discountAmount > 0 && returnCoupCanUse(goodsArr, coup, selCoupArr))
|
// const canUse = !coup.use ? false : (discountAmount > 0 && returnCoupCanUse(goodsArr, coup, selCoupArr))
|
||||||
// const canUse=discountAmount>0
|
// const canUse=discountAmount>0
|
||||||
|
const canUse=coup.use
|
||||||
return {
|
return {
|
||||||
...coup,
|
...coup,
|
||||||
discountAmount: discountAmount,
|
discountAmount: discountAmount,
|
||||||
@@ -166,7 +167,9 @@ export function returnProductCouponAllPrice(coupArr, goodsArr, vipUser) {
|
|||||||
}
|
}
|
||||||
const proCoupStartIndex=returnProCoupStartIndex(arr,i)
|
const proCoupStartIndex=returnProCoupStartIndex(arr,i)
|
||||||
console.log(proCoupStartIndex);
|
console.log(proCoupStartIndex);
|
||||||
total+=returnProductCoupAllPrice(goodsPayPriceMap[coup.proId],proCoupStartIndex,coup.num)
|
const coupNum=Math.min(goodsPayPriceMap[coup.proId].length,coup.num)
|
||||||
|
console.log(coupNum);
|
||||||
|
total+=returnProductCoupAllPrice(goodsPayPriceMap[coup.proId],proCoupStartIndex,coupNum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user