Compare commits
36 Commits
gaohao2.0.
...
ymf_1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| df82d70855 | |||
| 1f826fb87b | |||
| b562ccc707 | |||
| 4e1290fbf7 | |||
| 0a8f5c3a1e | |||
| e59a18ca52 | |||
| cff33a9875 | |||
| c9caed9579 | |||
| a2a4a1bf96 | |||
| 35160c63b4 | |||
| 586f30c4c4 | |||
| 5ae1e4b420 | |||
| 00b81e9f1b | |||
| 0906ab8523 | |||
| 0f2e791557 | |||
| d36afe0969 | |||
| 3706573eab | |||
| 75161519f2 | |||
| 70933ce1e4 | |||
|
|
8dfd42f20a | ||
|
|
433479fee7 | ||
|
|
eb640a1fde | ||
| b69159d965 | |||
| 84855194e8 | |||
| 47da4d3041 | |||
| 2e77c6a842 | |||
| 975921014f | |||
| 10ced0d770 | |||
| 4f566f37c7 | |||
| fb811fa07e | |||
| 698184d561 | |||
| 4204ec8021 | |||
| b0986065f4 | |||
| d588fd16ce | |||
| 0ff2e8f770 | |||
| fe441fc471 |
@@ -17,9 +17,11 @@ export function canTuicai(orderInfo, item) {
|
|||||||
return orderInfo.status == 'unpaid' && orderInfo.useType != 'dine-in-before' && item.status != 'return'
|
return orderInfo.status == 'unpaid' && orderInfo.useType != 'dine-in-before' && item.status != 'return'
|
||||||
}
|
}
|
||||||
export function canTuiKuan(orderInfo, item) {
|
export function canTuiKuan(orderInfo, item) {
|
||||||
// 已完成的订单,也不是商品券抵扣才可以退款
|
|
||||||
return orderInfo.status == 'closed' && item.status != 'return' && item.status != 'refund' && item.status !=
|
return orderInfo.status == 'closed' && item.status != 'return' && item.status != 'refund' && item.status !=
|
||||||
'refunding' && !item.userCouponId
|
'refunding'
|
||||||
|
}
|
||||||
|
export function isTuiCai(item) {
|
||||||
|
return item.status == 'return'
|
||||||
}
|
}
|
||||||
export function isTui(item) {
|
export function isTui(item) {
|
||||||
return item.status == 'return' || item.status == 'refund' || item.status == 'refunding'
|
return item.status == 'return' || item.status == 'refund' || item.status == 'refunding'
|
||||||
|
|||||||
@@ -69,10 +69,14 @@
|
|||||||
price: {
|
price: {
|
||||||
type: [Number,String],
|
type: [Number,String],
|
||||||
default: 0
|
default: 0
|
||||||
|
},
|
||||||
|
nowPrice:{
|
||||||
|
type: [Number,String],
|
||||||
|
default: 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
function currentPriceInput(newval){
|
function currentPriceInput(newval){
|
||||||
form.discount=(newval*100/form.price).toFixed()
|
form.discount=(newval*100/form.price)
|
||||||
}
|
}
|
||||||
function discountInput(newval){
|
function discountInput(newval){
|
||||||
form.currentPrice=(form.price*newval/100).toFixed(2)
|
form.currentPrice=(form.price*newval/100).toFixed(2)
|
||||||
@@ -126,8 +130,8 @@
|
|||||||
function open() {
|
function open() {
|
||||||
model.value.open()
|
model.value.open()
|
||||||
form.price=props.price
|
form.price=props.price
|
||||||
form.currentPrice=props.price
|
|
||||||
form.discount=props.discount
|
form.discount=props.discount
|
||||||
|
form.currentPrice=(props.discount*props.price/100).toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ import { reject } from 'lodash';
|
|||||||
// let baseUrl = 'https://admintestpapi.sxczgkj.cn'
|
// let baseUrl = 'https://admintestpapi.sxczgkj.cn'
|
||||||
|
|
||||||
//预发布
|
//预发布
|
||||||
let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn'
|
// let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn'
|
||||||
|
|
||||||
//正式
|
//正式
|
||||||
// let baseUrl = 'https://cashieradmin.sxczgkj.cn'
|
let baseUrl = 'https://cashieradmin.sxczgkj.cn'
|
||||||
|
|
||||||
// 王伟本地测
|
// 王伟本地测
|
||||||
// let baseUrl = '/ww'
|
// let baseUrl = '/ww'
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="boxconstant">
|
<view class="boxconstant">
|
||||||
<view class="boxconstantbox"
|
<view class="boxconstantbox"
|
||||||
style="border-radius: 18px 18px 0 0;padding:32rpx 24rpx 0 24rpx;border-bottom: 2rpx solid #E5E5E5;">
|
style="border-radius: 18px 18px 0 0;padding:32rpx 24rpx;border-bottom: 2rpx solid #E5E5E5;">
|
||||||
<view class="boxconstantbox_one">
|
<view class="boxconstantbox_one">
|
||||||
充值设置
|
充值设置
|
||||||
</view>
|
</view>
|
||||||
<view class="boxconstantbox_tow">
|
<view class="boxconstantbox_tow">
|
||||||
<text>用户消费结账时,成功充值</text>
|
<text>用户消费结账时,成功充值</text>
|
||||||
<input class="text" v-model="form.rechargeTimes"></input>
|
<input class="text" type="number" v-model="form.rechargeTimes" />
|
||||||
<text>倍的金额本单即可享受免单</text>
|
<text>倍的金额本单即可享受免单</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="boxconstantbox" style="padding:32rpx 24rpx 0 24rpx; border-radius: 0 0 18px 18px;">
|
<view class="boxconstantbox" style="border-radius: 0 0 18px 18px;">
|
||||||
<view class="boxconstantbox_one">
|
<view class="boxconstantbox_one">
|
||||||
充值门槛
|
充值门槛
|
||||||
</view>
|
</view>
|
||||||
<view class="boxconstantbox_tow">
|
<view class="boxconstantbox_tow">
|
||||||
<text>订单支付金额需满</text>
|
<text>订单支付金额需满</text>
|
||||||
<input class="text" v-model="form.rechargeThreshold"></input>
|
<input class="text" type="number" v-model="form.rechargeThreshold"></input>
|
||||||
<text> 元,才能使用</text>
|
<text> 元,才能使用</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -28,11 +28,11 @@
|
|||||||
<up-switch v-model="form.enable" size="18"></up-switch>
|
<up-switch v-model="form.enable" size="18"></up-switch>
|
||||||
</view>
|
</view>
|
||||||
<view class="boxconstantbox"
|
<view class="boxconstantbox"
|
||||||
style="margin-top:24rpx; padding:32rpx 24rpx 0 24rpx; border-radius: 0 0 18px 18px;">
|
style="margin-top:24rpx; padding:32rpx 24rpx; border-radius: 0 0 18px 18px;">
|
||||||
<view class="boxconstantbox_one">
|
<view class="boxconstantbox_one">
|
||||||
充值说明
|
充值说明
|
||||||
</view>
|
</view>
|
||||||
<view class="boxconstantbox_tow">
|
<view>
|
||||||
<up-textarea v-model="form.rechargeDesc" placeholder="请输入内容"></up-textarea>
|
<up-textarea v-model="form.rechargeDesc" placeholder="请输入内容"></up-textarea>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
useTypeList: [],
|
useTypeList: [],
|
||||||
childShopIdList: '',
|
childShopIdList: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const getlist = async () => {
|
const getlist = async () => {
|
||||||
let res = await get()
|
let res = await get()
|
||||||
console.log(res)
|
console.log(res)
|
||||||
@@ -83,9 +83,9 @@
|
|||||||
title: '保存成功'
|
title: '保存成功'
|
||||||
})
|
})
|
||||||
Object.assign(form, res)
|
Object.assign(form, res)
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
},1500)
|
}, 1500)
|
||||||
}
|
}
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
getlist()
|
getlist()
|
||||||
@@ -113,21 +113,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.boxconstantbox_tow {
|
.boxconstantbox_tow {
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: center;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
padding-bottom: 24rpx;
|
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
box-sizing: border-box;
|
// display: flex;
|
||||||
|
// justify-content: flex-start;
|
||||||
|
// align-items: center;
|
||||||
|
// flex-wrap: wrap;
|
||||||
|
// align-content: flex-start;
|
||||||
.text {
|
.text {
|
||||||
|
display:inline-flex;
|
||||||
|
text-align: center;
|
||||||
margin: 0 12rpx;
|
margin: 0 12rpx;
|
||||||
width: 118rpx;
|
width: 118rpx;
|
||||||
height: 48rpx;
|
height: 48rpx;
|
||||||
|
line-height: 48rpx;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||||
border: 2rpx solid #E5E5E5;
|
border: 2rpx solid #E5E5E5;
|
||||||
|
|||||||
@@ -120,7 +120,6 @@
|
|||||||
<view class="constantboxitem" v-for="(item,index) in tableData.data" :key="index"
|
<view class="constantboxitem" v-for="(item,index) in tableData.data" :key="index"
|
||||||
@click="toDetail(item)">
|
@click="toDetail(item)">
|
||||||
<view class="head">{{item.dutyId|| '无'}}</view>
|
<view class="head">{{item.dutyId|| '无'}}</view>
|
||||||
<view class="head">班次</view>
|
|
||||||
<view class="head">{{item.staffName || '无'}}</view>
|
<view class="head">{{item.staffName || '无'}}</view>
|
||||||
<view class="head">{{item.startTime|| '无'}}</view>
|
<view class="head">{{item.startTime|| '无'}}</view>
|
||||||
<view class="head">{{item.endTime|| '无'}}</view>
|
<view class="head">{{item.endTime|| '无'}}</view>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="default-box-padding bg-fff border-r-12 u-m-t-20" v-if="packeFee>0||data.priceAmount>0">
|
<view class="default-box-padding bg-fff border-r-12 u-m-t-20"
|
||||||
|
v-if="packeFee>0||data.priceAmount>0||data.returnAmount>0">
|
||||||
<view class="u-flex u-row-between">
|
<view class="u-flex u-row-between">
|
||||||
<view class="font-bold">附加费</view>
|
<view class="font-bold">附加费</view>
|
||||||
<template v-if="extraCanTuicai(orderInfo,data)">
|
<template v-if="extraCanTuicai(orderInfo,data)">
|
||||||
@@ -14,7 +15,7 @@
|
|||||||
<view class="u-flex u-row-between u-m-t-24" v-if="data.priceAmount*1>0">
|
<view class="u-flex u-row-between u-m-t-24" v-if="data.priceAmount*1>0">
|
||||||
<view>{{data.productName||'餐位费'}}</view>
|
<view>{{data.productName||'餐位费'}}</view>
|
||||||
<view>x{{data.num||0}}</view>
|
<view>x{{data.num||0}}</view>
|
||||||
<view class="price-min-width">¥{{data.priceAmount}}</view>
|
<view class="price-min-width">¥{{seatFeePrice}}</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
@@ -24,7 +25,8 @@
|
|||||||
<view class="tag yitui u-m-l-10">{{data.status=='refunding'?'退款中': '已退'}}</view>
|
<view class="tag yitui u-m-l-10">{{data.status=='refunding'?'退款中': '已退'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line-th">x{{data.num||0}}</view>
|
<view class="line-th">x{{data.num||0}}</view>
|
||||||
<view class="line-th">¥{{data.priceAmount}}</view>
|
<view class="line-th">¥{{seatFeePrice}}</view>
|
||||||
|
<!-- <view class="line-th">¥{{data.priceAmount||data.returnAmount}}</view> -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- <view class="u-flex u-row-right u-m-t-24">
|
<!-- <view class="u-flex u-row-right u-m-t-24">
|
||||||
@@ -50,24 +52,30 @@
|
|||||||
computed
|
computed
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import {
|
import {
|
||||||
returnCanComputedGoodsArr,canComputedPackFee,
|
returnCanComputedGoodsArr,
|
||||||
returnPackFee
|
canComputedPackFee,
|
||||||
|
returnPackFee,isTui,
|
||||||
|
isTuiCai,
|
||||||
|
isGift,
|
||||||
|
canTuiKuan,
|
||||||
|
canTuicai,
|
||||||
|
numSum
|
||||||
} from '@/commons/utils/goodsUtil.js'
|
} from '@/commons/utils/goodsUtil.js'
|
||||||
function extraCanTuicai(orderInfo,data){
|
|
||||||
return orderInfo.status=='unpaid'&&data.status!='return'&&data.priceAmount*1>0
|
|
||||||
}
|
|
||||||
function extraCanTuiKuan(orderInfo,data){
|
|
||||||
return orderInfo.status=='closed'&&data.status!='return'&&data.priceAmount*1>0
|
|
||||||
}
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {
|
||||||
|
return {
|
||||||
|
priceAmount: 0,
|
||||||
|
returnAmount: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
orderInfo: {
|
orderInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {
|
||||||
return {
|
return {
|
||||||
|
amount: 0,
|
||||||
detailList: []
|
detailList: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,6 +85,35 @@
|
|||||||
default: () => {}
|
default: () => {}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const canTuiKuanPrice = computed(() => {
|
||||||
|
return props.orderInfo.detailList.filter(v =>!isTui(v)&& !v.userCouponId)
|
||||||
|
.reduce((a, b) => {
|
||||||
|
return a + b.priceAmount * 1
|
||||||
|
}, 0)
|
||||||
|
})
|
||||||
|
const seatFeePrice = computed(() => {
|
||||||
|
const item = props.data
|
||||||
|
if (props.data.returnAmount) {
|
||||||
|
return props.data.returnAmount
|
||||||
|
}
|
||||||
|
console.log(item);
|
||||||
|
if (props.orderInfo.pointsDiscountAmount > 0 || props.orderInfo.fullCouponDiscountAmount > 0) {
|
||||||
|
return item.canReturnAmount
|
||||||
|
// const shengyuKeTui=canTuiKuanPrice.value
|
||||||
|
// const bili = Math.floor((item.priceAmount / shengyuKeTui) * 100) / 100
|
||||||
|
// return Math.floor((props.orderInfo.amount-props.orderInfo.refundAmount) * bili * 100) / 100
|
||||||
|
} else {
|
||||||
|
return item.priceAmount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function extraCanTuicai(orderInfo, data) {
|
||||||
|
return orderInfo.status == 'unpaid' && data.status != 'return' && data.priceAmount * 1 > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function extraCanTuiKuan(orderInfo, data) {
|
||||||
|
return orderInfo.status == 'closed' && data.status != 'refund' && data.priceAmount * 1 > 0
|
||||||
|
}
|
||||||
const packeNumbber = computed(() => {
|
const packeNumbber = computed(() => {
|
||||||
if (!props.orderInfo.detailList) {
|
if (!props.orderInfo.detailList) {
|
||||||
return 0
|
return 0
|
||||||
@@ -104,7 +141,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function tuikuan() {
|
function tuikuan() {
|
||||||
emits('tuikuan', props.data)
|
emits('tuikuan', {...props.data,priceAmount:props.data.canReturnAmount})
|
||||||
}
|
}
|
||||||
|
|
||||||
function tuicai() {
|
function tuicai() {
|
||||||
|
|||||||
548
pagesOrder/detail/components/list - 副本.vue
Normal file
548
pagesOrder/detail/components/list - 副本.vue
Normal file
@@ -0,0 +1,548 @@
|
|||||||
|
<template>
|
||||||
|
<view class="default-box-padding bg-fff border-r-24 u-m-t-32" v-if="data.length">
|
||||||
|
<view class=" font-bold u-p-b-32 border-bottom u-m-b-24" v-if="orderInfo.tableName">
|
||||||
|
<text class="">桌号:</text>
|
||||||
|
<text class="">{{orderInfo.tableName||""}}</text>
|
||||||
|
</view>
|
||||||
|
<view class=" color-999 border-bottom u-p-b-24">
|
||||||
|
<text>共</text>
|
||||||
|
<text class="color-333 "> {{goodsNumber}}</text>
|
||||||
|
<text>份菜品</text>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-b-20 " v-for="(order,orderIndex) in data" :key="orderIndex">
|
||||||
|
<view class="u-p-t-24"> 第{{ order.placeNum }}次下单
|
||||||
|
</view>
|
||||||
|
<view class="u-m-t-24 list">
|
||||||
|
<view class="item u-m-b-32" v-for="(item,index) in order.info" :key="index">
|
||||||
|
<view class="u-flex u-col-top">
|
||||||
|
<view class="u-flex">
|
||||||
|
<image class="img" :src="item.coverImg||item.productImg" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="u-p-l-32 u-flex-1">
|
||||||
|
<view class="u-flex u-row-between u-col-top">
|
||||||
|
|
||||||
|
<view class="">
|
||||||
|
<view class="u-flex">
|
||||||
|
<view class="tui" v-if="isTui(item)">
|
||||||
|
{{item.status=='refunding'?'退款中':'已退'}}
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
:class="{'line-th':item.status=='return'||item.status=='refund'||item.status=='refunding'}">
|
||||||
|
{{item.name||item.productName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-m-t-8">
|
||||||
|
<view class="u-m-r-20 u-flex " v-if="item.gift">
|
||||||
|
<uni-tag text="赠送"
|
||||||
|
custom-style="background-color: #FFF0DF; border-color: #FFF0DF; color: #FF9F2E;">
|
||||||
|
</uni-tag>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-r-20 u-flex " v-if="item.userCouponId">
|
||||||
|
<uni-tag :text=" productCouponDikou(item)"
|
||||||
|
custom-style="background-color: #FFF0DF; border-color: #FFF0DF; color: #FF9F2E;">
|
||||||
|
</uni-tag>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-r-20 u-flex" v-if="item.pack">
|
||||||
|
<uni-tag
|
||||||
|
custom-style="background-color: #E6F0FF; border-color: #E6F0FF; color: #318AFE;"
|
||||||
|
size="small" text="打包" inverted type="success" />
|
||||||
|
</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>
|
||||||
|
</view>
|
||||||
|
<view class="color-999 u-font-24 u-m-t-8">{{item.productSkuName||''}}</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="u-m-t-12 color-666 u-font-24" v-if="item.note">
|
||||||
|
备注:{{item.note}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-text-right u-m-t-28">
|
||||||
|
<template v-if="isTui(item)">
|
||||||
|
<view>¥0.00</view>
|
||||||
|
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="isGift(item)||item.userCouponId">
|
||||||
|
<view>¥0.00</view>
|
||||||
|
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<template v-if="returnCanTuiMoney(item)*1!=returnTotalMoney(item)*1">
|
||||||
|
<view>¥{{returnCanTuiMoney(item)}}</view>
|
||||||
|
<view class=" color-666 line-th">
|
||||||
|
¥{{returnTotalMoney(item)}}</view>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<view>¥{{returnTotalMoney(item)}}</view>
|
||||||
|
</template>
|
||||||
|
<!-- <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>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<view>¥{{returnTotalMoney(item)}}</view>
|
||||||
|
</template> -->
|
||||||
|
</template>
|
||||||
|
<view class="u-m-t-22 color-999 u-font-24">X{{item.number||item.num}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<template v-if="canTuicai(orderInfo,item)">
|
||||||
|
<view class="u-flex u-row-right gap-20 u-m-t-24">
|
||||||
|
<!-- <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>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-if="canTuiKuan(orderInfo,item)">
|
||||||
|
<view class="u-flex u-row-right gap-20 u-m-t-20">
|
||||||
|
<my-button :width="128" :height="48" plain shape="circle" @tap="tuikuan(item,index)"><text
|
||||||
|
class="no-wrap">{{item.userCouponId?'退券':'退款' }}</text> </my-button>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="bg-gray u-p-20 u-m-t-20" v-if="orderInfo.remark">
|
||||||
|
<view>备注</view>
|
||||||
|
<view class="u-m-t-10">{{orderInfo.remark}}</view>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="u-m-t-32">
|
||||||
|
<view class="u-flex u-row-between border-top u-p-t-32">
|
||||||
|
<view>
|
||||||
|
<template v-if="orderInfo.status=='unpaid'">
|
||||||
|
<view class="tag no-pay">
|
||||||
|
未支付
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-if="orderInfo.status=='refund'">
|
||||||
|
<view class="tag refund">
|
||||||
|
退款成功
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="u-flex">
|
||||||
|
<view class="u-flex u-m-r-24" v-if="youhuiAllPrice>0">
|
||||||
|
<view class="color-red u-m-r-6 ">
|
||||||
|
已优惠¥{{youhuiAllPrice}}
|
||||||
|
</view>
|
||||||
|
<up-icon name="info-circle" color="#999" :size="14" @click="youhuiDetailShow"></up-icon>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view>
|
||||||
|
<text>小计¥</text>
|
||||||
|
<text class="font-bold u-font-32">{{allPrice}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<template v-if="orderInfo.refundAmount">
|
||||||
|
<view class="u-flex u-row-between u-m-t-32">
|
||||||
|
<view>退款金额</view>
|
||||||
|
<view class="color-999">
|
||||||
|
<text class="">{{(orderInfo.refundAmount).toFixed(2)}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-between u-m-t-32">
|
||||||
|
<view>退款原因</view>
|
||||||
|
<view class="color-999">
|
||||||
|
<text class="">{{orderInfo.refundRemark||''}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-between u-m-t-32 u-p-b-24 border-bottom">
|
||||||
|
<view></view>
|
||||||
|
<view class="">
|
||||||
|
<text class="">退款成功</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<view class="u-flex u-row-between u-m-t-20">
|
||||||
|
<view></view>
|
||||||
|
<view>
|
||||||
|
<text>总计¥</text>
|
||||||
|
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1+packFee*1) }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-between u-m-t-20" v-if="orderInfo.status=='closed'">
|
||||||
|
<view></view>
|
||||||
|
<view>
|
||||||
|
<text>实付¥</text>
|
||||||
|
<text class="font-bold u-font-32">{{to2(orderInfo.amount) }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="u-flex u-row-between u-m-t-20">
|
||||||
|
<view></view>
|
||||||
|
<view>
|
||||||
|
<text>原价¥</text>
|
||||||
|
<text class="font-bold u-font-32">{{to2(orderInfo.originAmount||0) }}</text>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
<view class="u-m-t-24">
|
||||||
|
<my-button @tap="printOrder" type="cancel" :color="color.ColorMain">重新打印</my-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<up-popup :round="10" :show="pop.youhui" mode="center" closeOnClickOverlay @close="youhuiDetailHide">
|
||||||
|
<view class="u-p-30" style="width: 80vw;">
|
||||||
|
<view class="font-bold u-text-center">优惠详情</view>
|
||||||
|
<view class="u-m-t-32">
|
||||||
|
<view class="u-flex u-row-between u-m-b-18" v-if="vipDiscountPrice*1>0">
|
||||||
|
<view>会员优惠</view>
|
||||||
|
<view class="color-red">
|
||||||
|
<text>¥</text>
|
||||||
|
<text>{{vipDiscountPrice}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-between u-m-b-18" v-if="discountAmount">
|
||||||
|
<view>打折</view>
|
||||||
|
<view class="color-red">
|
||||||
|
<text>¥</text>
|
||||||
|
<text>{{to2(discountAmount) }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-between " v-if="orderInfo.fullCouponDiscountAmount*1>0">
|
||||||
|
<view>满减券抵扣</view>
|
||||||
|
<view class="color-red">
|
||||||
|
<text>¥</text>
|
||||||
|
<text>{{to2(orderInfo.fullCouponDiscountAmount) }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-between u-m-t-18" v-if="productCouponDiscountAmount*1>0">
|
||||||
|
<view>商品券抵扣</view>
|
||||||
|
<view class="color-red">
|
||||||
|
<text>¥</text>
|
||||||
|
<text> {{productCouponDiscountAmount }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="u-flex u-row-between u-m-t-18"
|
||||||
|
v-if="orderInfo.productCouponDiscountAmount||productCoupPrice*1>0">
|
||||||
|
<view>商品券抵扣</view>
|
||||||
|
<view class="color-red">
|
||||||
|
<text>¥</text>
|
||||||
|
<text> {{to2(orderInfo.productCouponDiscountAmount||productCoupPrice) }}</text>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
<view class="u-flex u-row-between u-m-t-18" v-if="orderInfo.pointsDiscountAmount">
|
||||||
|
<view>积分抵扣</view>
|
||||||
|
<view class="color-red">
|
||||||
|
<text>¥</text>
|
||||||
|
<text>{{to2(orderInfo.pointsDiscountAmount) }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</up-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
computed,
|
||||||
|
reactive
|
||||||
|
} from 'vue';
|
||||||
|
import color from '@/commons/color.js'
|
||||||
|
import {
|
||||||
|
hasPermission
|
||||||
|
} from '@/commons/utils/hasPermission.js'
|
||||||
|
import {
|
||||||
|
isTui,
|
||||||
|
isTuiCai,
|
||||||
|
isGift,
|
||||||
|
canTuiKuan,
|
||||||
|
canTuicai,
|
||||||
|
numSum
|
||||||
|
} from '@/commons/utils/goodsUtil.js'
|
||||||
|
const pop = reactive({
|
||||||
|
youhui: false
|
||||||
|
})
|
||||||
|
|
||||||
|
function youhuiDetailShow() {
|
||||||
|
pop.youhui = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function productCouponDikou(item) {
|
||||||
|
return '商品券抵扣¥' + returnProductCoupPrice(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
function youhuiDetailHide() {
|
||||||
|
pop.youhui = false
|
||||||
|
}
|
||||||
|
const props = defineProps({
|
||||||
|
orderInfo: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
seatFee: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
},
|
||||||
|
user: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {
|
||||||
|
id: '',
|
||||||
|
isVip: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function returnProductCoupPrice(item) {
|
||||||
|
if (!item.isMember) {
|
||||||
|
return item.price * item.num
|
||||||
|
}
|
||||||
|
const price = item.memberPrice ? item.memberPrice : item.price
|
||||||
|
return price * item.num
|
||||||
|
}
|
||||||
|
const productCouponDiscountAmount = computed(() => {
|
||||||
|
// if(props.orderInfo.productCouponDiscountAmount){
|
||||||
|
// return orderInfo.productCouponDiscountAmount.toFixed(2)
|
||||||
|
// }
|
||||||
|
if (!props.data.length) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
const n = props.data.reduce((prve, cur) => {
|
||||||
|
const curTotal = cur.info.filter(v => v.userCouponId).reduce((a, b) => {
|
||||||
|
return a + returnProductCoupPrice(b)
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
console.log(n);
|
||||||
|
return n.toFixed(2)
|
||||||
|
})
|
||||||
|
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
|
||||||
|
|
||||||
|
function returnVipMoney(item) {
|
||||||
|
if (!item.memberPrice || !props.user.isVip) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return (item.memberPrice * item.num).toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
function returnTotalMoney(item) {
|
||||||
|
return (item.price * item.num).toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
const canTuiKuanPrice = computed(() => {
|
||||||
|
return props.data.reduce((prve,cur)=>{
|
||||||
|
// const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{
|
||||||
|
// return a+b.priceAmount*1
|
||||||
|
// },0)
|
||||||
|
const curTotal=cur.info.filter(v=>canTuiKuan(props.orderInfo,v)&&!v.userCouponId).reduce((a,b)=>{
|
||||||
|
return a+b.priceAmount*1
|
||||||
|
},0)
|
||||||
|
return prve+curTotal
|
||||||
|
},0)
|
||||||
|
})
|
||||||
|
function returnCanTuiMoney(item) {
|
||||||
|
console.log(canTuiKuanPrice.value);
|
||||||
|
if(props.orderInfo.status=='unpaid'){
|
||||||
|
return returnTotalMoney(item)
|
||||||
|
}else{
|
||||||
|
return (item.priceAmount/(canTuiKuanPrice.value+seatFeePrice.value*1)*props.orderInfo.amount).toFixed(2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function to2(n) {
|
||||||
|
if (!n) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return n.toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
function tuicai(item, index) {
|
||||||
|
emits('tuicai', item, index)
|
||||||
|
}
|
||||||
|
|
||||||
|
function tuikuan(item, index) {
|
||||||
|
hasPermission('允许退款').then(res => {
|
||||||
|
if (res) {
|
||||||
|
emits('tuikuan', {...item,priceAmount:returnCanTuiMoney(item)}, index)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function printOrder() {
|
||||||
|
emits('printOrder')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const seatFeePrice = computed(() => {
|
||||||
|
if (!props.seatFee.priceAmount) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
const n = props.seatFee.priceAmount * (isTui(props.seatFee) ? 0 : 1)
|
||||||
|
return n.toFixed(2)
|
||||||
|
})
|
||||||
|
const discountAmount = computed(() => {
|
||||||
|
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(() => {
|
||||||
|
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||||
|
const curTotal = cur.info.reduce((a,
|
||||||
|
b) => {
|
||||||
|
return a + (b.num * b.price)
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
return goodsPrice.toFixed(2)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const freePrice = computed(() => {
|
||||||
|
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||||
|
const curTotal = cur.info.filter(v => v.gift == true || isGift(v)).reduce((a,
|
||||||
|
b) => {
|
||||||
|
const price = (b.isMember && b.memberPrice) ? b.memberPrice : b.price
|
||||||
|
return a + (b.num * price)
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
return goodsPrice.toFixed(2)
|
||||||
|
})
|
||||||
|
const vipDiscountPrice = computed(() => {
|
||||||
|
if (!props.user.isVip) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||||
|
const curTotal = cur.info.filter(v => v.gift != true && v.status !== "return" && (v.isMember &&
|
||||||
|
v.memberPrice) && (v.memberPrice != v.price)).reduce((
|
||||||
|
a,
|
||||||
|
b) => {
|
||||||
|
return a + (b.num * (b.price - b.memberPrice))
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
return goodsPrice.toFixed(2)
|
||||||
|
})
|
||||||
|
|
||||||
|
const productCoupPrice = computed(() => {
|
||||||
|
if (props.orderInfo.status == 'closed') {
|
||||||
|
return props.orderInfo.productCouponDiscountAmount
|
||||||
|
}
|
||||||
|
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.pointsDiscountAmount + (props.orderInfo.status == 'unpaid' ? productCoupPrice.value :
|
||||||
|
productCouponDiscountAmount.value) * 1 + (props.orderInfo.discountAmount ||
|
||||||
|
0)).toFixed(2)
|
||||||
|
|
||||||
|
})
|
||||||
|
const packFee = computed(() => {
|
||||||
|
//不是退菜只要有打包费的都计算,包括赠送
|
||||||
|
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||||
|
const curTotal = cur.info.filter(v => v.status !== "return").reduce((a,
|
||||||
|
b) => {
|
||||||
|
return a + b.packAmount
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
return goodsPrice.toFixed(2)
|
||||||
|
|
||||||
|
})
|
||||||
|
const allPrice = computed(() => {
|
||||||
|
const n = goodsOriginAllPrice.value - youhuiAllPrice.value
|
||||||
|
return (n < 0 ? 0 : n).toFixed(2)
|
||||||
|
|
||||||
|
// if (props.orderInfo.status == 'unpaid') {
|
||||||
|
// const n = goodsOriginAllPrice.value - youhuiAllPrice.value
|
||||||
|
// return (n < 0 ? 0 : n).toFixed(2)
|
||||||
|
// }
|
||||||
|
// return props.orderInfo.amount
|
||||||
|
})
|
||||||
|
|
||||||
|
const goodsNumber = computed(() => {
|
||||||
|
let result = 0
|
||||||
|
result = props.data.reduce((a, b) => {
|
||||||
|
const bTotal = b.info.reduce((prve, cur) => {
|
||||||
|
return prve + (cur.number || cur.num) * 1;
|
||||||
|
}, 0);
|
||||||
|
return a + bTotal
|
||||||
|
}, 0)
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.img {
|
||||||
|
width: 152rpx;
|
||||||
|
height: 152rpx;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border-top {
|
||||||
|
border-color: #F6F6F6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border-r-24 {
|
||||||
|
border-radius: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border-bottom {
|
||||||
|
// border-color: rgb(240, 240, 240);
|
||||||
|
border-color: #F6F6F6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line-th {
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
padding: 4rpx 8rpx 2rpx 10rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
|
||||||
|
&.no-pay {
|
||||||
|
background-color: rgb(170, 170, 170);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.refund {
|
||||||
|
background-color: #FCE7E7;
|
||||||
|
padding: 8rpx 20rpx 6rpx 22rpx;
|
||||||
|
color: #EB4F4F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tui {
|
||||||
|
background-color: rgb(239, 239, 239);
|
||||||
|
border-radius: 4rpx;
|
||||||
|
margin-right: 6rpx;
|
||||||
|
color: #666;
|
||||||
|
padding: 0 4rpx;
|
||||||
|
font-size: 20rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
</uni-tag>
|
</uni-tag>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-r-20 u-flex " v-if="item.userCouponId">
|
<view class="u-m-r-20 u-flex " v-if="item.userCouponId">
|
||||||
<uni-tag text="商品券抵扣"
|
<uni-tag :text=" productCouponDikou(item)"
|
||||||
custom-style="background-color: #FFF0DF; border-color: #FFF0DF; color: #FF9F2E;">
|
custom-style="background-color: #FFF0DF; border-color: #FFF0DF; color: #FF9F2E;">
|
||||||
</uni-tag>
|
</uni-tag>
|
||||||
</view>
|
</view>
|
||||||
@@ -47,6 +47,10 @@
|
|||||||
custom-style="background-color: #E6F0FF; border-color: #E6F0FF; color: #318AFE;"
|
custom-style="background-color: #E6F0FF; border-color: #E6F0FF; color: #318AFE;"
|
||||||
size="small" text="打包" inverted type="success" />
|
size="small" text="打包" inverted type="success" />
|
||||||
</view>
|
</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>
|
||||||
</view>
|
</view>
|
||||||
<view class="color-999 u-font-24 u-m-t-8">{{item.productSkuName||''}}</view>
|
<view class="color-999 u-font-24 u-m-t-8">{{item.productSkuName||''}}</view>
|
||||||
|
|
||||||
@@ -67,14 +71,23 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<template v-if="user.isVip&&item.isMember&&returnVipMoney(item)>0&&returnVipMoney(item)!=returnTotalMoney(item)">
|
<template v-if="returnCanTuiMoney(item)*1!=returnTotalMoney(item)*1">
|
||||||
<view>¥{{returnVipMoney(item)}}</view>
|
<view>¥{{returnCanTuiMoney(item)}}</view>
|
||||||
<view class=" color-666 line-th">
|
<view class=" color-666 line-th">
|
||||||
¥{{returnTotalMoney(item)}}</view>
|
¥{{returnTotalMoney(item)}}</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view>¥{{returnTotalMoney(item)}}</view>
|
<view>¥{{returnTotalMoney(item)}}</view>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- <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>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<view>¥{{returnTotalMoney(item)}}</view>
|
||||||
|
</template> -->
|
||||||
</template>
|
</template>
|
||||||
<view class="u-m-t-22 color-999 u-font-24">X{{item.number||item.num}}</view>
|
<view class="u-m-t-22 color-999 u-font-24">X{{item.number||item.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -91,7 +104,7 @@
|
|||||||
<template v-if="canTuiKuan(orderInfo,item)">
|
<template v-if="canTuiKuan(orderInfo,item)">
|
||||||
<view class="u-flex u-row-right gap-20 u-m-t-20">
|
<view class="u-flex u-row-right gap-20 u-m-t-20">
|
||||||
<my-button :width="128" :height="48" plain shape="circle" @tap="tuikuan(item,index)"><text
|
<my-button :width="128" :height="48" plain shape="circle" @tap="tuikuan(item,index)"><text
|
||||||
class="no-wrap">退款</text> </my-button>
|
class="no-wrap">{{item.userCouponId?'退券':'退款' }}</text> </my-button>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -120,21 +133,20 @@
|
|||||||
|
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<view class="u-flex u-m-r-24" v-if="youhuiAllPrice>0">
|
<view class="u-flex u-m-r-24" v-if="youhuiAllPrice>0">
|
||||||
<view class="color-red u-m-r-6 " >
|
<view class="color-red u-m-r-6 ">
|
||||||
已优惠¥{{youhuiAllPrice}}
|
已优惠¥{{youhuiAllPrice}}
|
||||||
</view>
|
</view>
|
||||||
<up-icon name="info-circle" color="#999" :size="14" @click="youhuiDetailShow"></up-icon>
|
<!-- <up-icon name="info-circle" color="#999" :size="14" @click="youhuiDetailShow"></up-icon> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<text>小计¥</text>
|
<text>小计¥</text>
|
||||||
<text class="font-bold u-font-32">{{allPrice}}</text>
|
<text class="font-bold u-font-32">{{allPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<template v-if="orderInfo.status=='refund'">
|
<template v-if="orderInfo.refundAmount">
|
||||||
<view class="u-flex u-row-between u-m-t-32">
|
<view class="u-flex u-row-between u-m-t-32">
|
||||||
<view>退款金额</view>
|
<view>退款金额</view>
|
||||||
<view class="color-999">
|
<view class="color-999">
|
||||||
@@ -156,55 +168,86 @@
|
|||||||
</template>
|
</template>
|
||||||
<view class="u-flex u-row-between u-m-t-20">
|
<view class="u-flex u-row-between u-m-t-20">
|
||||||
<view></view>
|
<view></view>
|
||||||
<view>
|
<template v-if="orderInfo.status=='unpaid'">
|
||||||
<text>总计¥</text>
|
<view>
|
||||||
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1+packFee*1) }}</text>
|
<text>总计¥</text>
|
||||||
</view>
|
<text class="font-bold u-font-32">{{orderInfo.amount }}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<view>
|
||||||
|
<text>总计¥</text>
|
||||||
|
<text class="font-bold u-font-32">{{orderInfo.amount}}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <view class="u-flex u-row-between u-m-t-20" v-if="orderInfo.status=='closed'">
|
||||||
|
<view></view>
|
||||||
|
<view>
|
||||||
|
<text>实付¥</text>
|
||||||
|
<text class="font-bold u-font-32">{{to2(orderInfo.amount) }}</text>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
<!-- <view class="u-flex u-row-between u-m-t-20">
|
||||||
|
<view></view>
|
||||||
|
<view>
|
||||||
|
<text>原价¥</text>
|
||||||
|
<text class="font-bold u-font-32">{{to2(orderInfo.originAmount||0) }}</text>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
<view class="u-m-t-24">
|
<view class="u-m-t-24">
|
||||||
<my-button @tap="printOrder" type="cancel" :color="color.ColorMain">重新打印</my-button>
|
<my-button @tap="printOrder" type="cancel" :color="color.ColorMain">重新打印</my-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<up-popup :round="10" :show="pop.youhui" mode="center" closeOnClickOverlay @close="youhuiDetailHide" >
|
<up-popup :round="10" :show="pop.youhui" mode="center" closeOnClickOverlay @close="youhuiDetailHide">
|
||||||
<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 u-m-b-18">
|
<view class="u-flex u-row-between u-m-b-18" v-if="vipDiscountPrice*1>0">
|
||||||
<view>会员优惠</view>
|
<view>会员优惠</view>
|
||||||
<view class="color-red">
|
<view class="color-red">
|
||||||
<text>¥</text>
|
<text>¥</text>
|
||||||
<text>{{vipDiscountPrice}}</text>
|
<text>{{vipDiscountPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view>
|
||||||
<view class="u-flex u-row-between u-m-b-18" v-if="orderInfo.discountAmount*1>0">
|
<view class="u-flex u-row-between u-m-b-18" v-if="discountAmount">
|
||||||
<view>打折</view>
|
<view>打折</view>
|
||||||
<view class="color-red">
|
<view class="color-red">
|
||||||
<text>¥</text>
|
<text>¥</text>
|
||||||
<text>{{orderInfo.discountAmount}}</text>
|
<text>{{to2(discountAmount) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-row-between " v-if="orderInfo.fullCouponDiscountAmount*1>0">
|
<view class="u-flex u-row-between " v-if="orderInfo.fullCouponDiscountAmount*1>0">
|
||||||
<view>满减券抵扣</view>
|
<view>满减券抵扣</view>
|
||||||
<view class="color-red">
|
<view class="color-red">
|
||||||
<text>¥</text>
|
<text>¥</text>
|
||||||
<text>{{orderInfo.fullCouponDiscountAmount}}</text>
|
<text>{{to2(orderInfo.fullCouponDiscountAmount) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-row-between u-m-t-18" v-if="orderInfo.productCouponDiscountAmount||productCoupPrice">
|
<view class="u-flex u-row-between u-m-t-18" v-if="productCouponDiscountAmount*1>0">
|
||||||
<view>商品券抵扣</view>
|
<view>商品券抵扣</view>
|
||||||
<view class="color-red">
|
<view class="color-red">
|
||||||
<text>¥</text>
|
<text>¥</text>
|
||||||
<text>{{orderInfo.productCouponDiscountAmount||productCoupPrice}}</text>
|
<text> {{productCouponDiscountAmount }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <view class="u-flex u-row-between u-m-t-18"
|
||||||
|
v-if="orderInfo.productCouponDiscountAmount||productCoupPrice*1>0">
|
||||||
|
<view>商品券抵扣</view>
|
||||||
|
<view class="color-red">
|
||||||
|
<text>¥</text>
|
||||||
|
<text> {{to2(orderInfo.productCouponDiscountAmount||productCoupPrice) }}</text>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
<view class="u-flex u-row-between u-m-t-18" v-if="orderInfo.pointsDiscountAmount">
|
<view class="u-flex u-row-between u-m-t-18" v-if="orderInfo.pointsDiscountAmount">
|
||||||
<view>积分抵扣</view>
|
<view>积分抵扣</view>
|
||||||
<view class="color-red">
|
<view class="color-red">
|
||||||
<text>¥</text>
|
<text>¥</text>
|
||||||
<text>{{orderInfo.pointsDiscountAmount}}</text>
|
<text>{{to2(orderInfo.pointsDiscountAmount) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</up-popup>
|
</up-popup>
|
||||||
@@ -213,26 +256,35 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
computed, reactive
|
computed,
|
||||||
|
reactive
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import color from '@/commons/color.js'
|
import color from '@/commons/color.js'
|
||||||
import {
|
import {
|
||||||
hasPermission
|
hasPermission
|
||||||
} from '@/commons/utils/hasPermission.js'
|
} from '@/commons/utils/hasPermission.js'
|
||||||
import {
|
import {
|
||||||
isTui,isGift,
|
isTui,
|
||||||
|
isTuiCai,
|
||||||
|
isGift,
|
||||||
canTuiKuan,
|
canTuiKuan,
|
||||||
canTuicai,
|
canTuicai,
|
||||||
numSum
|
numSum
|
||||||
} from '@/commons/utils/goodsUtil.js'
|
} from '@/commons/utils/goodsUtil.js'
|
||||||
const pop=reactive({
|
const pop = reactive({
|
||||||
youhui:false
|
youhui: false
|
||||||
})
|
})
|
||||||
function youhuiDetailShow(){
|
|
||||||
pop.youhui=true
|
function youhuiDetailShow() {
|
||||||
|
pop.youhui = true
|
||||||
}
|
}
|
||||||
function youhuiDetailHide(){
|
|
||||||
pop.youhui=false
|
function productCouponDikou(item) {
|
||||||
|
return '商品券抵扣¥' + returnProductCoupPrice(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
function youhuiDetailHide() {
|
||||||
|
pop.youhui = false
|
||||||
}
|
}
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
orderInfo: {
|
orderInfo: {
|
||||||
@@ -257,6 +309,30 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function returnProductCoupPrice(item) {
|
||||||
|
if (!item.isMember) {
|
||||||
|
return item.price * item.num
|
||||||
|
}
|
||||||
|
const price = item.memberPrice ? item.memberPrice : item.price
|
||||||
|
return price * item.num
|
||||||
|
}
|
||||||
|
const productCouponDiscountAmount = computed(() => {
|
||||||
|
// if(props.orderInfo.productCouponDiscountAmount){
|
||||||
|
// return orderInfo.productCouponDiscountAmount.toFixed(2)
|
||||||
|
// }
|
||||||
|
if (!props.data.length) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
const n = props.data.reduce((prve, cur) => {
|
||||||
|
const curTotal = cur.info.filter(v => v.userCouponId).reduce((a, b) => {
|
||||||
|
return a + returnProductCoupPrice(b)
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
console.log(n);
|
||||||
|
return n.toFixed(2)
|
||||||
|
})
|
||||||
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
|
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
|
||||||
|
|
||||||
function returnVipMoney(item) {
|
function returnVipMoney(item) {
|
||||||
@@ -270,6 +346,52 @@
|
|||||||
return (item.price * item.num).toFixed(2)
|
return (item.price * item.num).toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const canTuiKuanPrice = computed(() => {
|
||||||
|
const goodsTotal= props.data.reduce((prve, cur) => {
|
||||||
|
// const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{
|
||||||
|
// return a+b.priceAmount*1
|
||||||
|
// },0)
|
||||||
|
const curTotal = cur.info.filter(v => !isTui(v)&& !v.userCouponId)
|
||||||
|
.reduce((a, b) => {
|
||||||
|
return a + b.priceAmount * 1
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
console.log(goodsTotal);
|
||||||
|
console.log(seatFeePrice.value);
|
||||||
|
return (goodsTotal+seatFeePrice.value*1).toFixed(2)
|
||||||
|
})
|
||||||
|
const TuiKuanPrice = computed(() => {
|
||||||
|
return props.data.reduce((prve, cur) => {
|
||||||
|
// const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{
|
||||||
|
// return a+b.priceAmount*1
|
||||||
|
// },0)
|
||||||
|
const curTotal = cur.info.filter(v => isTui(v)&&!v.userCouponId)
|
||||||
|
.reduce((a, b) => {
|
||||||
|
return a + b.priceAmount * 1
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
})
|
||||||
|
const noTuiKuanPrice=computed(()=>{
|
||||||
|
return props.data.reduce((prve, cur) => {
|
||||||
|
const curTotal = cur.info.filter(v => !isTui(v)&&!v.userCouponId)
|
||||||
|
.reduce((a, b) => {
|
||||||
|
return a + b.priceAmount * 1
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
})
|
||||||
|
const cantuiSeatFee=computed(()=>{
|
||||||
|
let seatFee=props.orderInfo.seatInfo?(props.orderInfo.seatInfo.priceAmount):0
|
||||||
|
const bili = Math.floor((seatFee / canTuiKuanPrice.value) * 100) / 100
|
||||||
|
seatFee= Math.floor((props.orderInfo.amount-props.orderInfo.refundAmount) * bili * 100) / 100
|
||||||
|
return seatFee
|
||||||
|
})
|
||||||
|
function returnCanTuiMoney(item) {
|
||||||
|
return props.orderInfo.status == 'unpaid'? item.priceAmount: item.canReturnAmount
|
||||||
|
}
|
||||||
|
|
||||||
function to2(n) {
|
function to2(n) {
|
||||||
if (!n) {
|
if (!n) {
|
||||||
return 0
|
return 0
|
||||||
@@ -284,7 +406,10 @@
|
|||||||
function tuikuan(item, index) {
|
function tuikuan(item, index) {
|
||||||
hasPermission('允许退款').then(res => {
|
hasPermission('允许退款').then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
emits('tuikuan', item, index)
|
emits('tuikuan', {
|
||||||
|
...item,
|
||||||
|
priceAmount: item.canReturnAmount
|
||||||
|
}, index)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -298,9 +423,16 @@
|
|||||||
if (!props.seatFee.priceAmount) {
|
if (!props.seatFee.priceAmount) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
const n = props.seatFee.priceAmount * (props.seatFee.status == 'return' ? 0 : 1)
|
const n = props.seatFee.priceAmount * (isTui(props.seatFee) ? 0 : 1)
|
||||||
return n.toFixed(2)
|
return n.toFixed(2)
|
||||||
})
|
})
|
||||||
|
const discountAmount = computed(() => {
|
||||||
|
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(() => {
|
const goodsOriginAllPrice = computed(() => {
|
||||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||||
const curTotal = cur.info.reduce((a,
|
const curTotal = cur.info.reduce((a,
|
||||||
@@ -311,12 +443,15 @@
|
|||||||
}, 0)
|
}, 0)
|
||||||
return goodsPrice.toFixed(2)
|
return goodsPrice.toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const freePrice = computed(() => {
|
const freePrice = computed(() => {
|
||||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||||
const curTotal = cur.info.filter(v => v.gift == true || isTui(v)).reduce((a,
|
const curTotal = cur.info.filter(v => v.gift == true || isGift(v)).reduce((a,
|
||||||
b) => {
|
b) => {
|
||||||
return a + (b.num * b.price)
|
const price = (b.isMember && b.memberPrice) ? b.memberPrice : b.price
|
||||||
|
return a + (b.num * price)
|
||||||
}, 0)
|
}, 0)
|
||||||
return prve + curTotal
|
return prve + curTotal
|
||||||
}, 0)
|
}, 0)
|
||||||
@@ -327,39 +462,52 @@
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||||
const curTotal = cur.info.filter(v => v.gift != true && v.status !== "return" &&!v.userCouponId&&(v.isMember&&v.memberPrice)&&(v.memberPrice!=v.price)).reduce((a,
|
const curTotal = cur.info.filter(v => v.gift != true && v.status !== "return" && (v.isMember &&
|
||||||
|
v.memberPrice) && (v.memberPrice != v.price)).reduce((
|
||||||
|
a,
|
||||||
b) => {
|
b) => {
|
||||||
return a + (b.num * (b.price-b.memberPrice))
|
return a + (b.num * (b.price - b.memberPrice))
|
||||||
}, 0)
|
}, 0)
|
||||||
return prve + curTotal
|
return prve + curTotal
|
||||||
}, 0)
|
}, 0)
|
||||||
return goodsPrice.toFixed(2)
|
return goodsPrice.toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
const productCoupPrice=computed(()=>{
|
const productCoupPrice = computed(() => {
|
||||||
if(props.orderInfo.status=='closed'){
|
if (props.orderInfo.status == 'closed') {
|
||||||
return props.orderInfo.productCouponDiscountAmount
|
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) => {
|
||||||
const isVip=props.user.isVip&&cur.isMember
|
const isVip = props.user.isVip && cur.isMember
|
||||||
const memberPrice=cur.memberPrice?cur.memberPrice:cur.price
|
const memberPrice = cur.memberPrice ? cur.memberPrice : cur.price
|
||||||
const price=isVip?memberPrice:cur.price
|
const price = isVip ? memberPrice : cur.price
|
||||||
const curTotal=price*cur.num
|
const curTotal = price * cur.num
|
||||||
return prve+curTotal
|
return prve + curTotal
|
||||||
}, 0)
|
}, 0)
|
||||||
return a + curTotal
|
return a + curTotal
|
||||||
}, 0)
|
}, 0)
|
||||||
return goodsPrice.toFixed(2)
|
return goodsPrice.toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
const youhuiAllPrice=computed(()=>{
|
const youhuiAllPrice = computed(() => {
|
||||||
return (freePrice.value*1+vipDiscountPrice.value*1+props.orderInfo.fullCouponDiscountAmount+props.orderInfo.pointsDiscountAmount+productCoupPrice.value*1+(props.orderInfo.discountAmount||0)).toFixed(2)
|
const n= props.orderInfo.originAmount-props.orderInfo.amount+vipDiscountPrice.value*1
|
||||||
|
return (n<0?0:n).toFixed(2)
|
||||||
|
// if(props.orderInfo.status!='unpaid'){
|
||||||
|
// const seatfee=(props.orderInfo.amount==0&&allPrice.value==0)?seatFeePrice.value:0
|
||||||
|
// return (goodsOriginAllPrice.value-allPrice.value+seatfee*1).toFixed(2)
|
||||||
|
// }
|
||||||
|
// return (freePrice.value * 1 + vipDiscountPrice.value * 1 + props.orderInfo.fullCouponDiscountAmount + props
|
||||||
|
// .orderInfo.pointsDiscountAmount + (props.orderInfo.status == 'unpaid' ? productCoupPrice.value :
|
||||||
|
// productCouponDiscountAmount.value) * 1 + (props.orderInfo.discountAmount ||
|
||||||
|
// 0)).toFixed(2)
|
||||||
|
|
||||||
})
|
})
|
||||||
const packFee = computed(() => {
|
const packFee = computed(() => {
|
||||||
|
//不是退菜只要有打包费的都计算,包括赠送
|
||||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||||
const curTotal = cur.info.filter(v => v.gift != true && v.status !== "return").reduce((a,
|
const curTotal = cur.info.filter(v => v.status !== "return").reduce((a,
|
||||||
b) => {
|
b) => {
|
||||||
return a + b.packAmount
|
return a + b.packAmount
|
||||||
}, 0)
|
}, 0)
|
||||||
@@ -369,8 +517,24 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
const allPrice = computed(() => {
|
const allPrice = computed(() => {
|
||||||
const n=goodsOriginAllPrice.value-youhuiAllPrice.value
|
|
||||||
return (n<0?0:n).toFixed(2)
|
|
||||||
|
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||||
|
const curTotal = cur.info.reduce((a,
|
||||||
|
b) => {
|
||||||
|
return a +(props.orderInfo.status == 'unpaid'?b.priceAmount:b.canReturnAmount*1)
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
return goodsPrice.toFixed(2)
|
||||||
|
if (props.orderInfo.status == 'unpaid') {
|
||||||
|
const n = goodsOriginAllPrice.value - youhuiAllPrice.value
|
||||||
|
return (n < 0 ? 0 : n).toFixed(2)
|
||||||
|
}
|
||||||
|
const returnAmount=props.orderInfo.seatInfo&&props.orderInfo.seatInfo.returnAmount?props.orderInfo.seatInfo.returnAmount:0
|
||||||
|
const canReturnAmount=props.orderInfo.seatInfo&&props.orderInfo.seatInfo.canReturnAmount?props.orderInfo.seatInfo.canReturnAmount:0
|
||||||
|
const total=props.orderInfo.amount-(returnAmount?returnAmount:canReturnAmount)
|
||||||
|
return (total<=0?0:total).toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
const goodsNumber = computed(() => {
|
const goodsNumber = computed(() => {
|
||||||
|
|||||||
@@ -9,6 +9,11 @@
|
|||||||
:user="user"
|
:user="user"
|
||||||
:data="orderDetail.goodsList" :seatFee="orderDetail.seatFee" @tuicai="onTuiCai"></goods-list>
|
:data="orderDetail.goodsList" :seatFee="orderDetail.seatFee" @tuicai="onTuiCai"></goods-list>
|
||||||
<!-- <template v-if="orderDetail.seatFee.totalNumber&&orderDetail.seatFee.totalAmount"> -->
|
<!-- <template v-if="orderDetail.seatFee.totalNumber&&orderDetail.seatFee.totalAmount"> -->
|
||||||
|
|
||||||
|
<!-- <view class="default-box-padding bg-fff border-r-12 u-m-t-20 u-flex u-row-between" v-if="orderDetail.info.discountAmount>0">
|
||||||
|
<view>服务员改价</view>
|
||||||
|
<view class="color-red">-¥{{orderDetail.info.discountAmount}}</view>
|
||||||
|
</view> -->
|
||||||
<template v-if="true">
|
<template v-if="true">
|
||||||
<extra-vue @tuicai="onSeatFeeTuicai" @tuikuan="onSeatFeeTuiKuan" :orderInfo="orderDetail.info"
|
<extra-vue @tuicai="onSeatFeeTuicai" @tuikuan="onSeatFeeTuiKuan" :orderInfo="orderDetail.info"
|
||||||
:data="orderDetail.seatFee"></extra-vue>
|
:data="orderDetail.seatFee"></extra-vue>
|
||||||
@@ -177,7 +182,7 @@
|
|||||||
orderId,
|
orderId,
|
||||||
num,
|
num,
|
||||||
priceAmount,
|
priceAmount,
|
||||||
price
|
price,userCouponId
|
||||||
} = goods
|
} = goods
|
||||||
go.to('PAGES_ORDER_TUIKUAN', {
|
go.to('PAGES_ORDER_TUIKUAN', {
|
||||||
id,
|
id,
|
||||||
@@ -190,7 +195,8 @@
|
|||||||
number: 0,
|
number: 0,
|
||||||
productSkuName: productSkuName || '',
|
productSkuName: productSkuName || '',
|
||||||
priceAmount:priceAmount?priceAmount:(num*price).toFixed(2),
|
priceAmount:priceAmount?priceAmount:(num*price).toFixed(2),
|
||||||
price
|
price,
|
||||||
|
userCouponId:userCouponId?userCouponId:''
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="bg-gray min-page u-p-30 u-font-28">
|
<view class="bg-gray min-page u-p-30 u-font-28">
|
||||||
<view class="u-p-t-60 u-p-b-60 u-text-center">
|
<view class="u-p-t-60 u-p-b-60 u-text-center">
|
||||||
<template v-if="order.amount!=payPrice">
|
<template v-if="originPrice!=payPrice">
|
||||||
<view class="u-font-32 ">
|
<view class="u-font-32 ">
|
||||||
<text class="price-fuhao">¥</text>
|
<text class="price-fuhao">¥</text>
|
||||||
<!-- <text class="font-bold price">{{discount.currentPrice?discount.currentPrice:order.amount}}</text> -->
|
<!-- <text class="font-bold price">{{discount.currentPrice?discount.currentPrice:order.amount}}</text> -->
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-10 color-999 old-price">
|
<view class="u-m-t-10 color-999 old-price">
|
||||||
<text class="">¥</text>
|
<text class="">¥</text>
|
||||||
<text class=" ">{{order.amount}}</text>
|
<text class=" ">{{originPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-10 u-flex u-row-center color-main">
|
<view class="u-m-t-10 u-flex u-row-center color-main">
|
||||||
<view @click="discountShow">修改</view>
|
<view @click="discountShow">修改</view>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<template v-else>
|
<template v-else>
|
||||||
<view class="u-font-32 ">
|
<view class="u-font-32 ">
|
||||||
<text class="price-fuhao">¥</text>
|
<text class="price-fuhao">¥</text>
|
||||||
<text class="font-bold price">{{order.amount}}</text>
|
<text class="font-bold price">{{originPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-10 u-flex u-row-center color-main">
|
<view class="u-m-t-10 u-flex u-row-center color-main">
|
||||||
<view @click="discountShow">修改</view>
|
<view @click="discountShow">修改</view>
|
||||||
@@ -27,8 +27,17 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="content bg-fff border-r-12">
|
<view class="content bg-fff border-r-12">
|
||||||
<view class=" u-p-t-30 u-p-l-26 u-p-r-26 card top u-m-t-30">
|
<view class="u-p-l-26 u-p-r-26 card top u-m-t-30">
|
||||||
<view class="border-bottom-dashed u-p-b-30">
|
<view class="border-bottom-dashed u-p-b-30 u-p-t-30" v-if="vipDiscount*1>0">
|
||||||
|
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between ">
|
||||||
|
<view>会员优惠</view>
|
||||||
|
<view class="color-red">
|
||||||
|
-¥{{vipDiscount}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="border-bottom-dashed u-p-b-30 u-p-t-30">
|
||||||
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between " @click="toQuan">
|
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between " @click="toQuan">
|
||||||
<view>优惠券</view>
|
<view>优惠券</view>
|
||||||
<view class="color-999 u-flex u-col-center">
|
<view class="color-999 u-flex u-col-center">
|
||||||
@@ -61,12 +70,11 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="border-bottom u-p-b-30" v-if="(discount.price&&discount.currentPrice!=order.amount)||accountPoints.sel">
|
<view class="border-bottom u-p-b-30" v-if="discount.value||accountPoints.sel">
|
||||||
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between u-p-t-30 "
|
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between u-p-t-30 " v-if="discount.value">
|
||||||
v-if="discount.price&&discount.currentPrice!=order.amount">
|
|
||||||
<view>服务员改价</view>
|
<view>服务员改价</view>
|
||||||
<view class=" u-flex u-col-center">
|
<view class=" u-flex u-col-center">
|
||||||
<text style="color: rgb(255, 95, 46);">-¥{{to2(order.amount- discount.currentPrice)}}</text>
|
<text style="color: rgb(255, 95, 46);">-¥{{to2(discount.value)}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between u-p-t-30 "
|
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between u-p-t-30 "
|
||||||
@@ -92,7 +100,8 @@
|
|||||||
<text class="u-m-l-10 no-wrap">{{item.payName}}</text>
|
<text class="u-m-l-10 no-wrap">{{item.payName}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex color-999 u-font-24">
|
<view class="u-flex color-999 u-font-24">
|
||||||
<view class="u-m-r-20" v-if="item.payType=='vipPay'&&user.id">
|
<view class="u-m-r-20" v-if="item.payType=='vipPay'&&user.id"
|
||||||
|
@click.stop="chooseUser">
|
||||||
<view>
|
<view>
|
||||||
<text>会员:</text>
|
<text>会员:</text>
|
||||||
<text class="u-m-r-4">{{user.telephone||user.nickName}}</text>
|
<text class="u-m-r-4">{{user.telephone||user.nickName}}</text>
|
||||||
@@ -202,8 +211,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<edit-discount @confirm="editDiscountConfirm" title="优惠金额" :ref="setModel" name="editMoney"
|
<edit-discount :nowPrice="order.amount-productCouponDiscountAmount-fullCouponDiscountAmount"
|
||||||
:price="order.amount"></edit-discount>
|
@confirm="editDiscountConfirm" title="优惠金额" :ref="setModel" name="editMoney"
|
||||||
|
:price="order.amount-productCouponDiscountAmount" :discount="discount.discount"></edit-discount>
|
||||||
|
|
||||||
<up-modal :title="modal.title" :content="modal.content" :show="modal.show" :confirmText="modal.confirmText"
|
<up-modal :title="modal.title" :content="modal.content" :show="modal.show" :confirmText="modal.confirmText"
|
||||||
:cancelText="modal.cancelText" showCancelButton closeOnClickOverlay @confirm="confirmModelConfirm"
|
:cancelText="modal.cancelText" showCancelButton closeOnClickOverlay @confirm="confirmModelConfirm"
|
||||||
@@ -211,6 +221,7 @@
|
|||||||
|
|
||||||
<edit-accountPoints @confirm="pointsConfirm" :price="accountPoints.num" :accountPoints="accountPoints"
|
<edit-accountPoints @confirm="pointsConfirm" :price="accountPoints.num" :accountPoints="accountPoints"
|
||||||
ref="refPoints"></edit-accountPoints>
|
ref="refPoints"></edit-accountPoints>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -258,20 +269,36 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
function confirmModelCancel() {
|
function confirmModelCancel() {
|
||||||
modal.show=false
|
if (modal.key == 'fullCoupon') {
|
||||||
modal.key=''
|
// 取消改价
|
||||||
modal.data=''
|
discount.discount = 100
|
||||||
|
discount.value = 0
|
||||||
|
}
|
||||||
|
confirmModelClose()
|
||||||
|
}
|
||||||
|
|
||||||
|
function confirmModelClose() {
|
||||||
|
modal.show = false
|
||||||
|
modal.key = ''
|
||||||
|
modal.data = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
function cashConfirmShow() {
|
function cashConfirmShow() {
|
||||||
modal.content = '是否确认已现金收款' + payPrice.value
|
modal.content = '是否确认已现金收款' + payPrice.value
|
||||||
modal.key='cash'
|
modal.key = 'cash'
|
||||||
modal.show=true
|
modal.show = true
|
||||||
}
|
}
|
||||||
async function confirmModelConfirm() {
|
async function confirmModelConfirm() {
|
||||||
if (modal.key == 'cash') {
|
if (modal.key == 'cash') {
|
||||||
await pay()
|
await pay()
|
||||||
confirmModelCancel()
|
confirmModelCancel()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (modal.key == 'fullCoupon') {
|
||||||
|
//删除满减券
|
||||||
|
const index = pays.quan.findIndex(v => v.type == 1)
|
||||||
|
pays.quan.splice(index, 1)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,13 +332,14 @@
|
|||||||
function pointsConfirm(e) {
|
function pointsConfirm(e) {
|
||||||
accountPoints.num = e
|
accountPoints.num = e
|
||||||
}
|
}
|
||||||
async function calcUsablePoints() {
|
async function calcUsablePoints(orderAmount) {
|
||||||
if (!order.memberId) {
|
if (!order.memberId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
console.log(orderAmount);
|
||||||
const res = await Api.$calcUsablePoints({
|
const res = await Api.$calcUsablePoints({
|
||||||
memberId: order.memberId,
|
memberId: order.memberId,
|
||||||
orderAmount: pointCanDicountPrice.value
|
orderAmount: orderAmount ? orderAmount : payPrice.value
|
||||||
})
|
})
|
||||||
accountPoints.calcRes = res
|
accountPoints.calcRes = res
|
||||||
accountPoints.num = res.maxUsablePoints
|
accountPoints.num = res.maxUsablePoints
|
||||||
@@ -319,16 +347,22 @@
|
|||||||
}
|
}
|
||||||
watch(() => accountPoints.sel, (newval) => {
|
watch(() => accountPoints.sel, (newval) => {
|
||||||
if (newval) {
|
if (newval) {
|
||||||
calcUsablePoints()
|
calcDeDuctionPoints()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
async function calcDeDuctionPoints() {
|
async function calcDeDuctionPoints() {
|
||||||
|
if (accountPoints.num <= 0) {
|
||||||
|
accountPoints.price = 0
|
||||||
|
return ''
|
||||||
|
}
|
||||||
const res = await Api.$calcDeDuctionPoints({
|
const res = await Api.$calcDeDuctionPoints({
|
||||||
memberId: order.memberId,
|
memberId: order.memberId,
|
||||||
orderAmount: order.amount,
|
orderAmount: originPrice.value,
|
||||||
points: accountPoints.num
|
points: accountPoints.num
|
||||||
})
|
})
|
||||||
accountPoints.price = res
|
if (res) {
|
||||||
|
accountPoints.price = res
|
||||||
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
watch(() => accountPoints.num, (newval) => {
|
watch(() => accountPoints.num, (newval) => {
|
||||||
@@ -359,7 +393,7 @@
|
|||||||
go.to('PAGES_ORDER_QUAN', {
|
go.to('PAGES_ORDER_QUAN', {
|
||||||
orderId: order.id,
|
orderId: order.id,
|
||||||
memberId: order.memberId,
|
memberId: order.memberId,
|
||||||
orderPrice: payPrice.value * 1 + coupAllPrice.value * 1
|
orderPrice: (payPrice.value * 1 + coupAllPrice.value * 1).toFixed(2)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
async function discountShow() {
|
async function discountShow() {
|
||||||
@@ -398,7 +432,7 @@
|
|||||||
if (!n) {
|
if (!n) {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
return n.toFixed(2)
|
return Number(n).toFixed(2)
|
||||||
}
|
}
|
||||||
const pays = reactive({
|
const pays = reactive({
|
||||||
list: ['扫码收款', '二维码收款'],
|
list: ['扫码收款', '二维码收款'],
|
||||||
@@ -431,6 +465,7 @@
|
|||||||
uni.$off('choose-user')
|
uni.$off('choose-user')
|
||||||
uni.$on('choose-user', (data) => {
|
uni.$on('choose-user', (data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
pays.quan = []
|
||||||
setUser({
|
setUser({
|
||||||
vipUserId: data.id ? data.id : '',
|
vipUserId: data.id ? data.id : '',
|
||||||
type: data.id ? 0 : 1 //0 设置 1 取消
|
type: data.id ? 0 : 1 //0 设置 1 取消
|
||||||
@@ -442,41 +477,57 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setQuan(arr) {
|
||||||
|
console.log(arr);
|
||||||
|
discount.discount = 100
|
||||||
|
discount.value = 0
|
||||||
|
discount.currentPrice = order.amount
|
||||||
|
//强制将满减券数量定为1
|
||||||
|
const manjianCoup = arr.filter(v => v.type == 1 && v.num >= 1).map(v=>{
|
||||||
|
return {
|
||||||
|
...v,num:1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let productCoup = arr.filter(v => v.type == 2)
|
||||||
|
console.log(productCoup);
|
||||||
|
//商品券分组
|
||||||
|
let coupMap = {}
|
||||||
|
for (let i in productCoup) {
|
||||||
|
const coup = productCoup[i]
|
||||||
|
if (coupMap.hasOwnProperty(coup.proId)) {
|
||||||
|
coupMap[coup.proId].push(coup)
|
||||||
|
} else {
|
||||||
|
coupMap[coup.proId] = [coup]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(coupMap);
|
||||||
|
for (let key in coupMap) {
|
||||||
|
const arr = coupMap[key]
|
||||||
|
for (let i in arr) {
|
||||||
|
const coup = arr[i]
|
||||||
|
const proCoupStartIndex = returnProCoupStartIndex(arr, i)
|
||||||
|
console.log(proCoupStartIndex);
|
||||||
|
const coupUseNum = returnProductCanUseNum($goodsPayPriceMap[coup.proId], proCoupStartIndex,
|
||||||
|
coup.num)
|
||||||
|
const num = Math.min($goodsPayPriceMap[coup.proId].length, coupUseNum)
|
||||||
|
coup.num = num
|
||||||
|
console.log($goodsPayPriceMap[coup.proId]);
|
||||||
|
const findGoods = order.detailList.find(v => v.productId == coup.proId)
|
||||||
|
const isMember = findGoods.isMember
|
||||||
|
coup.discountAmount = returnProductCoupAllPrice($goodsPayPriceMap[coup.proId],
|
||||||
|
proCoupStartIndex, num, isMember).toFixed(2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
productCoup = productCoup.filter(v => v.num >= 1)
|
||||||
|
console.log(productCoup);
|
||||||
|
pays.quan = [...manjianCoup, ...productCoup]
|
||||||
|
console.log(pays.quan);
|
||||||
|
}
|
||||||
|
|
||||||
function watchChooseQuan() {
|
function watchChooseQuan() {
|
||||||
uni.$off('choose-quan')
|
uni.$off('choose-quan')
|
||||||
uni.$on('choose-quan', (arr) => {
|
uni.$on('choose-quan', (arr) => {
|
||||||
console.log(arr);
|
setQuan(arr)
|
||||||
const manjianCoup = arr.filter(v => v.type == 1 && v.num >= 1)
|
|
||||||
let productCoup = arr.filter(v => v.type == 2)
|
|
||||||
console.log(productCoup);
|
|
||||||
//商品券分组
|
|
||||||
let coupMap = {}
|
|
||||||
for (let i in productCoup) {
|
|
||||||
const coup = productCoup[i]
|
|
||||||
if (coupMap.hasOwnProperty(coup.proId)) {
|
|
||||||
coupMap[coup.proId].push(coup)
|
|
||||||
} else {
|
|
||||||
coupMap[coup.proId] = [coup]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log(coupMap);
|
|
||||||
for (let key in coupMap) {
|
|
||||||
const arr = coupMap[key]
|
|
||||||
for (let i in arr) {
|
|
||||||
const coup = arr[i]
|
|
||||||
const proCoupStartIndex = returnProCoupStartIndex(arr, i)
|
|
||||||
console.log(proCoupStartIndex);
|
|
||||||
const coupUseNum = returnProductCanUseNum($goodsPayPriceMap[coup.proId], proCoupStartIndex,
|
|
||||||
coup.num)
|
|
||||||
const num = Math.min($goodsPayPriceMap[coup.proId].length, coupUseNum)
|
|
||||||
coup.num = num
|
|
||||||
coup.discountAmount = returnProductCoupAllPrice($goodsPayPriceMap[coup.proId],
|
|
||||||
proCoupStartIndex, num).toFixed(2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
productCoup = productCoup.filter(v => v.num >= 1)
|
|
||||||
console.log(productCoup);
|
|
||||||
pays.quan = [...manjianCoup, ...productCoup]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -516,12 +567,26 @@
|
|||||||
|
|
||||||
//打折相关数据
|
//打折相关数据
|
||||||
const discount = reactive({
|
const discount = reactive({
|
||||||
discount: 100
|
discount: 100,
|
||||||
|
currentPrice: 0,
|
||||||
|
value: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
function editDiscountConfirm(form) {
|
function editDiscountConfirm(form) {
|
||||||
console.log(form);
|
console.log(form);
|
||||||
Object.assign(discount, form)
|
accountPoints.sel = false
|
||||||
|
Object.assign(discount, {
|
||||||
|
...form,
|
||||||
|
value: form.price - form.currentPrice
|
||||||
|
})
|
||||||
|
const fullCoupon = pays.quan.find(v => v.type == 1)
|
||||||
|
if (fullCoupon && form.currentPrice < fullCoupon.fullAmount) {
|
||||||
|
modal.content = '改价后价格不满足满减券最低满减需求' + fullCoupon.fullAmount + '元'
|
||||||
|
modal.key = 'fullCoupon'
|
||||||
|
modal.show = true
|
||||||
|
modal.cancelText = '取消改价'
|
||||||
|
modal.confirmText = '删除满减券'
|
||||||
|
}
|
||||||
getPayUrl()
|
getPayUrl()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -540,7 +605,7 @@
|
|||||||
return infoBox.showToast(item.payName + '不可用')
|
return infoBox.showToast(item.payName + '不可用')
|
||||||
}
|
}
|
||||||
pays.payTypes.selIndex = i
|
pays.payTypes.selIndex = i
|
||||||
if (item.payType == 'vipPay') {
|
if (item.payType == 'vipPay' && !user.value.id) {
|
||||||
chooseUser()
|
chooseUser()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -581,7 +646,7 @@
|
|||||||
infoBox.showToast('余额不足')
|
infoBox.showToast('余额不足')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payStatus) {
|
if (payStatus) {
|
||||||
return infoBox.showToast(tipsMap[payStatus])
|
return infoBox.showToast(tipsMap[payStatus])
|
||||||
}
|
}
|
||||||
@@ -628,7 +693,9 @@
|
|||||||
success: function(res) {
|
success: function(res) {
|
||||||
console.log('条码类型:' + res.scanType);
|
console.log('条码类型:' + res.scanType);
|
||||||
console.log('条码内容:' + res.result);
|
console.log('条码内容:' + res.result);
|
||||||
pay({code: res.result})
|
pay({
|
||||||
|
code: res.result
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -651,9 +718,19 @@
|
|||||||
const orderRes = await orderApi.tbOrderInfoDetail(order.orderId)
|
const orderRes = await orderApi.tbOrderInfoDetail(order.orderId)
|
||||||
Object.assign(order, orderRes)
|
Object.assign(order, orderRes)
|
||||||
$goodsPayPriceMap = returnGoodsPayPriceMap(order.detailList)
|
$goodsPayPriceMap = returnGoodsPayPriceMap(order.detailList)
|
||||||
console.log($goodsPayPriceMap);
|
const hasSelQuan = orderRes.couponInfoList ? JSON.parse(orderRes.couponInfoList) : {
|
||||||
|
fullReductionCoupon: [],
|
||||||
|
productCoupon: []
|
||||||
|
};
|
||||||
|
const fullReductionCoupon = hasSelQuan.fullReductionCoupon.filter(v => v.type == 1)
|
||||||
|
const productCoupon = hasSelQuan.productCoupon.filter(v => v.type == 2)
|
||||||
|
setQuan([...fullReductionCoupon, ...productCoupon])
|
||||||
|
|
||||||
if (orderRes.memberId) {
|
if (orderRes.memberId) {
|
||||||
calcUsablePoints()
|
calcUsablePoints()
|
||||||
|
if (orderRes.pointsNum) {
|
||||||
|
accountPoints.sel = true
|
||||||
|
}
|
||||||
queryAllShopUser({
|
queryAllShopUser({
|
||||||
id: orderRes.memberId
|
id: orderRes.memberId
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
@@ -673,14 +750,48 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const coupAllPrice = computed(() => {
|
const coupAllPrice = computed(() => {
|
||||||
return pays.quan.reduce((prve, cur) => {
|
const n = pays.quan.reduce((prve, cur) => {
|
||||||
|
return prve + cur.discountAmount * 1
|
||||||
|
}, 0)
|
||||||
|
return n
|
||||||
|
})
|
||||||
|
const payPrice = computed(() => {
|
||||||
|
// const discountPrice = discount.currentPrice ? discount.currentPrice : order.amount
|
||||||
|
// const calcPrice = discountPrice - coupAllPrice.value - accountPoints.price * (accountPoints.sel ? 1 : 0)
|
||||||
|
// return (calcPrice <= 0 ? 0 : calcPrice).toFixed(2)
|
||||||
|
const total = (originPrice.value) - vipDiscount.value - productCouponDiscountAmount.value - discount
|
||||||
|
.value -
|
||||||
|
fullCouponDiscountAmount.value - accountPoints.price * (accountPoints.sel ? 1 : 0)
|
||||||
|
return (total < 0 ? 0 : total).toFixed(2)
|
||||||
|
})
|
||||||
|
const vipDiscount = computed(() => {
|
||||||
|
if (!user.value.isVip) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
const goodsPrice = order.detailList.filter(v => v.gift != true && v.status !== "return" && (v.isMember &&
|
||||||
|
v.memberPrice) && (v.memberPrice != v.price)).reduce((
|
||||||
|
a,
|
||||||
|
b) => {
|
||||||
|
return a + (b.num * (b.price - b.memberPrice))
|
||||||
|
}, 0)
|
||||||
|
return goodsPrice.toFixed(2)
|
||||||
|
})
|
||||||
|
const originPrice = computed(() => {
|
||||||
|
const n = (order.amount || 0) * 1 + vipDiscount.value * 1 + (order.fullCouponDiscountAmount || 0) + (order
|
||||||
|
.productCouponDiscountAmount || 0) +
|
||||||
|
(order.pointsDiscountAmount || 0)
|
||||||
|
|
||||||
|
return n.toFixed(2)
|
||||||
|
})
|
||||||
|
const fullCouponDiscountAmount = computed(() => {
|
||||||
|
return pays.quan.filter(v => v.type == 1).reduce((prve, cur) => {
|
||||||
return prve + cur.discountAmount * 1
|
return prve + cur.discountAmount * 1
|
||||||
}, 0)
|
}, 0)
|
||||||
})
|
})
|
||||||
const payPrice = computed(() => {
|
const productCouponDiscountAmount = computed(() => {
|
||||||
const discountPrice = discount.currentPrice ? discount.currentPrice : order.amount
|
return pays.quan.filter(v => v.type == 2).reduce((prve, cur) => {
|
||||||
const calcPrice = discountPrice - coupAllPrice.value - accountPoints.price * (accountPoints.sel ? 1 : 0)
|
return prve + cur.discountAmount * 1
|
||||||
return (calcPrice <= 0 ? 0 : calcPrice).toFixed(2)
|
}, 0)
|
||||||
})
|
})
|
||||||
watch(() => payPrice.value, (newval) => {
|
watch(() => payPrice.value, (newval) => {
|
||||||
getPayUrl()
|
getPayUrl()
|
||||||
@@ -702,9 +813,9 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
const pointCanDicountPrice = computed(() => {
|
const pointCanDicountPrice = computed(() => {
|
||||||
const discountPrice = discount.currentPrice ? discount.currentPrice : order.amount
|
const total = (order.amount || 0) - productCouponDiscountAmount.value - discount.value -
|
||||||
const calcPrice = discountPrice - coupAllPrice.value
|
fullCouponDiscountAmount.value
|
||||||
return (calcPrice <= 0 ? 0 : calcPrice).toFixed(2)
|
return (total < 0 ? 0 : total).toFixed(2)
|
||||||
})
|
})
|
||||||
watch(() => pointCanDicountPrice.value, (newval) => {
|
watch(() => pointCanDicountPrice.value, (newval) => {
|
||||||
calcUsablePoints()
|
calcUsablePoints()
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<view class="sel u-abso" v-if="item.id==myQuan.fullReductionCouponSel.id ">
|
<view class="sel u-abso" v-if="item.id==myQuan.fullReductionCouponSel.id ">
|
||||||
<up-icon name="checkbox-mark" color="#fff"></up-icon>
|
<up-icon name="checkbox-mark" color="#fff"></up-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-p-t-32 u-p-b-32 u-p-l-24 u-p-r-24">
|
<view class="u-p-t-32 u-p-b-32 u-p-l-24 u-p-r-24 left">
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<view class="hui">减</view>
|
<view class="hui">减</view>
|
||||||
<view class="u-m-l-18">{{item.name}}</view>
|
<view class="u-m-l-18">{{item.name}}</view>
|
||||||
@@ -315,12 +315,15 @@
|
|||||||
memberId: option.memberId
|
memberId: option.memberId
|
||||||
})
|
})
|
||||||
canDikouGoodsArr = returnNewGoodsList(order.value.detailList || [])
|
canDikouGoodsArr = returnNewGoodsList(order.value.detailList || [])
|
||||||
res.fullReductionCoupon = res.fullReductionCoupon.filter((v) => {
|
res.fullReductionCoupon = res.fullReductionCoupon.map((v) => {
|
||||||
if(option.orderPrice<=0){
|
if(option.orderPrice<=0){
|
||||||
return false
|
return {...v,use:false}
|
||||||
}else{
|
}else{
|
||||||
return v.use && option.orderPrice * 1 >= v
|
return{
|
||||||
.fullAmount * 1
|
...v,
|
||||||
|
use:v.use && option.orderPrice * 1 >= v
|
||||||
|
.fullAmount * 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -527,7 +530,9 @@
|
|||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
box-shadow: 0 0 5px #eee;
|
box-shadow: 0 0 5px #eee;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
.left{
|
||||||
|
max-width: 80%;
|
||||||
|
}
|
||||||
.sel {
|
.sel {
|
||||||
padding: 2rpx 4rpx;
|
padding: 2rpx 4rpx;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@@ -91,11 +91,12 @@ export function returnProductPayPrice(goods,vipUser){
|
|||||||
return price
|
return price
|
||||||
}
|
}
|
||||||
//返回商品券抵扣的商品价格
|
//返回商品券抵扣的商品价格
|
||||||
export function returnProductCoupAllPrice(productPriceArr,startIndex,num){
|
export function returnProductCoupAllPrice(productPriceArr,startIndex,num,isMember=true){
|
||||||
|
console.log(productPriceArr);
|
||||||
return productPriceArr.slice(startIndex,startIndex+num).reduce((prve,cur)=>{
|
return productPriceArr.slice(startIndex,startIndex+num).reduce((prve,cur)=>{
|
||||||
let curPrice=0
|
let curPrice=0
|
||||||
if(typeof cur==='object'){
|
if(typeof cur==='object'){
|
||||||
curPrice=cur.memberPrice*1
|
curPrice=isMember?cur.memberPrice*1:cur.price
|
||||||
}else{
|
}else{
|
||||||
curPrice=cur*1
|
curPrice=cur*1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<template v-if="option.productId=='-999'">
|
<template v-if="option.productId=='-999'">
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<view class="color-red">¥{{item.priceAmount}}</view>
|
<view class="color-red" >¥{{item.priceAmount}}</view>
|
||||||
<view class="u-flex u-m-l-32 u-col-center">
|
<view class="u-flex u-m-l-32 u-col-center">
|
||||||
<view class="u-m-l-28 u-m-r-28">x{{item.number}}</view>
|
<view class="u-m-l-28 u-m-r-28">x{{item.number}}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<view class="color-red">¥{{item.priceAmount}}</view>
|
<view class="color-red" v-if="!option.userCouponId">¥{{item.priceAmount}}</view>
|
||||||
<view class="u-flex u-m-l-32 u-col-center">
|
<view class="u-flex u-m-l-32 u-col-center">
|
||||||
<up-icon @click="changeItem(item,-1)" :size="20" name="minus-circle"></up-icon>
|
<up-icon @click="changeItem(item,-1)" :size="20" name="minus-circle"></up-icon>
|
||||||
<view class="u-m-l-28 u-m-r-28">{{item.number}}</view>
|
<view class="u-m-l-28 u-m-r-28">{{item.number}}</view>
|
||||||
@@ -39,21 +39,24 @@
|
|||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bg-fff u-m-t-32 u-p-24 border-r-12 u-flex u-row-between">
|
<template v-if="!option.userCouponId">
|
||||||
<view>支付金额</view>
|
<view class="bg-fff u-m-t-32 u-p-24 border-r-12 u-flex u-row-between" >
|
||||||
<view>
|
<view>支付金额</view>
|
||||||
{{to2(totalPrice)}}元
|
<view>
|
||||||
|
{{to2(totalPrice)}}元
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="bg-fff u-m-t-32 u-p-24 border-r-12 u-flex u-row-between" >
|
||||||
<view class="bg-fff u-m-t-32 u-p-24 border-r-12 u-flex u-row-between">
|
<view>退款金额</view>
|
||||||
<view>退款金额</view>
|
<view class="color-red">
|
||||||
<view class="color-red">
|
{{to2(tuikuanPrice)}}元
|
||||||
{{to2(tuikuanPrice)}}元
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</template>
|
||||||
|
|
||||||
<view class="bg-fff u-p-24 border-r-12 u-m-t-32">
|
<view class="bg-fff u-p-24 border-r-12 u-m-t-32">
|
||||||
<view>退回优惠券</view>
|
<view>退回优惠券</view>
|
||||||
<view class="u-font-24 color-999 u-m-t-16">
|
<view class="u-font-24 color-999 u-m-t-16" v-if="!option.userCouponId">
|
||||||
该订单未使用优惠券
|
该订单未使用优惠券
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -143,7 +146,8 @@
|
|||||||
})
|
})
|
||||||
const tuikuanPrice = computed(() => {
|
const tuikuanPrice = computed(() => {
|
||||||
return orderDetail.goodsList.reduce((prve, cur) => {
|
return orderDetail.goodsList.reduce((prve, cur) => {
|
||||||
return prve + cur.number * cur.price
|
const n=(cur.number/cur.num*100) * cur.priceAmount
|
||||||
|
return prve + (n/100).toFixed(2)
|
||||||
}, 0)
|
}, 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user