更换正式环境,测试修改
This commit is contained in:
@@ -80,17 +80,20 @@
|
||||
</view>
|
||||
<view class="u-text-right u-m-t-28">
|
||||
<template v-if="item.refundNum>0||item.returnNum>0">
|
||||
<!-- <view>¥{{mathFloorPrice( - mathFloorPrice(parseFloat(item.returnNum*item.unitPrice),item) - mathFloorPrice(parseFloat(item.refundNum*item.unitPrice),item))}}</view> -->
|
||||
<view>¥{{mathFloorPrice( parseFloat(mathFloorPrice(item.num*item.unitPrice),item) - (parseFloat(mathFloorPrice(item.returnNum*item.unitPrice,item)) + parseFloat(mathFloorPrice(item.refundNum*item.unitPrice,item))))}}</view>
|
||||
<view>¥{{mathFloorPrice( parseFloat(mathFloorPrice(item.num*item.unitPrice,item)) - (parseFloat(mathFloorPrice(item.returnNum*item.unitPrice,item)) + parseFloat(mathFloorPrice(item.refundNum*item.unitPrice,item))))}}</view>
|
||||
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}</view>
|
||||
</template>
|
||||
<template v-else-if="item.userCouponId">
|
||||
<view>¥0.00</view>
|
||||
<template v-else-if="item.couponNum > 0">
|
||||
<view>¥{{mathFloorPrice((item.num-item.couponNum)*item.unitPrice,item)}}</view>
|
||||
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}</view>
|
||||
</template>
|
||||
<template v-else-if="item.discountSaleAmount > 0">
|
||||
<view>¥{{mathFloorPrice(item.num*item.discountSaleAmount,item)}}</view>
|
||||
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}</view>
|
||||
</template>
|
||||
<template v-else-if="isVip == 1">
|
||||
<view>¥{{item.num*item.memberPrice}}</view>
|
||||
<view class="line-th color-666 ">¥{{item.num*item.price}}</view>
|
||||
<view>¥{{mathFloorPrice(item.num*item.memberPrice,item)}}</view>
|
||||
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="returnCanTuiMoney(item)*1!=returnTotalMoney(item)*1">
|
||||
@@ -206,7 +209,7 @@
|
||||
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-24">
|
||||
<view class="u-m-t-24" v-if="orderInfo.status == 'unpaid'||orderInfo.status == 'done'">
|
||||
<my-button @tap="printOrder" type="cancel" :color="color.ColorMain">重新打印</my-button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -374,12 +377,13 @@
|
||||
* 总优惠金额
|
||||
*/
|
||||
const discountsPrice = computed(() => {
|
||||
|
||||
// 满减券优惠
|
||||
let fullCouponDiscountAmount = props.orderInfo.fullCouponDiscountAmount
|
||||
let fullCouponDiscountAmount = props.orderInfo.status == 'done' ? props.orderInfo.fullCouponDiscountAmount : 0
|
||||
// 商品券优惠
|
||||
let productCouponDiscountAmount = props.orderInfo.productCouponDiscountAmount
|
||||
let productCouponDiscountAmount = props.orderInfo.status == 'done' ? props.orderInfo.productCouponDiscountAmount : 0
|
||||
// 积分抵扣优惠
|
||||
let pointsDiscountAmount = props.orderInfo.pointsDiscountAmount
|
||||
let pointsDiscountAmount = props.orderInfo.status == 'done' ? props.orderInfo.pointsDiscountAmount : 0
|
||||
return (parseFloat(vipDiscountPrice.value) + parseFloat(discountSaleAmount.value) + discountAmount.value + fullCouponDiscountAmount + productCouponDiscountAmount + pointsDiscountAmount).toFixed(2)
|
||||
})
|
||||
|
||||
@@ -394,14 +398,13 @@
|
||||
let memberPrice = cur.memberPrice ? cur.memberPrice : cur.price
|
||||
let tPrice = (isVip.value ? memberPrice : cur.price)
|
||||
tPrice = cur.memberPrice != cur.unitPrice&& cur.price != cur.unitPrice ? cur.unitPrice : tPrice
|
||||
console.log(tPrice)
|
||||
let Total = Math.floor(tPrice * cur.num * 100) / 100
|
||||
|
||||
return prve + Total - (cur.returnNum*tPrice) - (cur.refundNum*cur.unitPrice)
|
||||
}, 0)
|
||||
return a + curTotal
|
||||
}, 0)
|
||||
console.log("菜品金额==",goodsPrice)
|
||||
// console.log("菜品金额==",goodsPrice)
|
||||
return goodsPrice.toFixed(2)
|
||||
})
|
||||
|
||||
@@ -495,7 +498,7 @@
|
||||
|
||||
|
||||
function returnTotalMoney(item) {
|
||||
return (Math.floor(item.num*item.unitPrice*100)/100).toFixed(2)
|
||||
return (Math.floor(item.num*item.price*100)/100).toFixed(2)
|
||||
}
|
||||
function returnCanTuiMoney(item) {
|
||||
// if (props.orderInfo.status == 'unpaid') {
|
||||
@@ -566,7 +569,7 @@
|
||||
obj.number = '0.00'
|
||||
obj.skuName = obj.skuName || ''
|
||||
obj.unitPrice = obj.unitPrice
|
||||
obj.num = obj.num - obj.returnNum - obj.refundNum
|
||||
obj.num = obj.num - obj.returnNum - obj.refundNum - obj.couponNum
|
||||
obj.priceAmount = mathFloorPrice(obj.num*obj.unitPrice ,obj)
|
||||
})
|
||||
arr = [...arr,...infoLit]
|
||||
|
||||
@@ -173,11 +173,11 @@
|
||||
}
|
||||
let par = {
|
||||
orderId: props.data.orderId,
|
||||
refundAmount: number.value*props.data.unitPrice,
|
||||
refundAmount: number.value * props.data.unitPrice,
|
||||
refundReason: note,
|
||||
refundDetails: [{
|
||||
id: props.data.id,
|
||||
returnAmount: number.value*props.data.unitPrice,
|
||||
returnAmount: number.value * props.data.unitPrice,
|
||||
num: number.value,
|
||||
}],
|
||||
}
|
||||
|
||||
@@ -85,7 +85,6 @@
|
||||
})
|
||||
onLoad((opt) => {
|
||||
Object.assign(options, opt)
|
||||
console.log("opt===",options);
|
||||
getShopInfoData()
|
||||
})
|
||||
onShow(() => {
|
||||
@@ -109,24 +108,27 @@
|
||||
*/
|
||||
async function getOrderDetail () {
|
||||
let res = await getHistoryOrder({orderId: options.id})
|
||||
console.log("订单详情===",res)
|
||||
// console.log("订单详情===",res)
|
||||
if(res.userId){
|
||||
shopUserDetail({userId:res.userId}).then(res=>{
|
||||
if(res){
|
||||
user.value = res
|
||||
}
|
||||
})
|
||||
let resUser = await shopUserDetail({userId:res.userId})
|
||||
user.value = resUser
|
||||
}
|
||||
orderDetail.seatFee = {
|
||||
seatNum: res.seatNum,
|
||||
seatAmount: res.seatAmount,
|
||||
}
|
||||
|
||||
orderDetail.goodsList = Object.entries(res.detailMap).map(([key, value]) => ({
|
||||
info: value,
|
||||
placeNum: key
|
||||
}))
|
||||
|
||||
orderDetail.goodsList.map(item=>{
|
||||
item.info.map(item=>{
|
||||
item.unitPrice = uni.$utils.isGoodsPrice(item,user.value)
|
||||
})
|
||||
})
|
||||
orderDetail.info = res
|
||||
console.log("orderDetail===",orderDetail);
|
||||
}
|
||||
|
||||
function onSeatFeeTuicai(seatFee) {
|
||||
@@ -195,7 +197,9 @@
|
||||
if (res.confirm) {
|
||||
try {
|
||||
const res = await printOrder({
|
||||
id: orderDetail.info.id
|
||||
id: orderDetail.info.id,
|
||||
type: orderDetail.info.status == 'unpaid' ? 1 : 0
|
||||
|
||||
})
|
||||
infoBox.showToast('已发送打印请求')
|
||||
} catch (e) {
|
||||
@@ -213,6 +217,7 @@
|
||||
return
|
||||
}
|
||||
if (Array.isArray(goods)) {
|
||||
|
||||
go.to('PAGES_ORDER_TUIKUAN', {
|
||||
orderInfo: JSON.stringify(orderDetail.info),
|
||||
goodsList:JSON.stringify(goods)
|
||||
@@ -221,8 +226,9 @@
|
||||
} else {
|
||||
goods.number = 0
|
||||
goods.skuName = goods.skuName || ''
|
||||
goods.priceAmount = goods.priceAmount ? goods.priceAmount : (goods.num*goods.unitPrice).toFixed(2)
|
||||
goods.unitPrice = goods.unitPrice
|
||||
goods.priceAmount = goods.priceAmount ? goods.priceAmount : (goods.num*uni.$utils.isGoodsPrice(goods,user.value)).toFixed(2)
|
||||
console.log(goods)
|
||||
goods.unitPrice = uni.$utils.isGoodsPrice(goods,user.value)
|
||||
goods.userCouponId = goods.userCouponId ? goods.userCouponId:''
|
||||
go.to('PAGES_ORDER_TUIKUAN', {
|
||||
orderInfo: JSON.stringify(orderDetail.info),
|
||||
|
||||
Reference in New Issue
Block a user