并合桌
This commit is contained in:
@@ -173,6 +173,7 @@
|
||||
import timer from '@/commons/utils/timer.js'
|
||||
import formUtil from '@/commons/utils/formUtil.js'
|
||||
import EnvChangeTips from './components/EnvChangeTips.vue'
|
||||
import dayjs from 'dayjs' //时间格式库
|
||||
import {
|
||||
getExtStoreId
|
||||
} from "@/commons/utils/versionManage.js"
|
||||
@@ -376,10 +377,14 @@
|
||||
storageManage.shopId(loginBizData.shopId)
|
||||
storageManage.shopUserId(loginBizData.user.user.id)
|
||||
storageManage.userInfo(loginBizData)
|
||||
var time1 = new Date();
|
||||
var time2 = new Date(loginBizData.expireDate);
|
||||
let les = (time1.getTime() - time2.getTime()) / 86400000;
|
||||
uni.showToast({
|
||||
title: loginBizData.expireDate + '后到期',
|
||||
title: '店铺账号有限期至' + loginBizData.expireDate + ',店铺账号到期剩余' + Math.abs(les.toFixed(0)) + '天!',
|
||||
icon: 'none'
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
// 跳转到首页
|
||||
go.to("PAGES_INDEX", {
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
@@ -98,13 +99,13 @@
|
||||
})
|
||||
onLoad((opt) => {
|
||||
// console.log(JSON.parse(opt.item) ,'调试1')
|
||||
gettableList()
|
||||
datas.item = JSON.parse(opt.item)
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
console.log(11111)
|
||||
gettableList()
|
||||
})
|
||||
async function confirm() {
|
||||
console.log(datas.selecttableList, 'debug')
|
||||
console.log(datas.item, 'debug2')
|
||||
// 是否选择其他桌
|
||||
if (datas.selecttableList) {
|
||||
if (datas.current == 0) {
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
<text class="">桌号:</text>
|
||||
<text class="">{{orderInfo.tableName||""}}</text>
|
||||
</view>
|
||||
<view class=" font-bold u-p-b-32 border-bottom u-m-b-24">
|
||||
<view class="block" @tap="rotatingTables"
|
||||
style="display: flex;align-items: center;justify-content: space-between;">
|
||||
<view>转桌/并桌</view>
|
||||
<uni-icons type="right" color="#999" size="16"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class=" color-999 border-bottom u-p-b-24">
|
||||
<text>共</text>
|
||||
<text class="color-333 "> {{goodsNumber}}</text>
|
||||
@@ -180,7 +187,7 @@
|
||||
<text class="font-bold u-font-32">{{orderInfo.amount}}</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
</view>
|
||||
<!-- <view class="u-flex u-row-between u-m-t-20" v-if="orderInfo.status=='closed'">
|
||||
<view></view>
|
||||
@@ -347,57 +354,58 @@
|
||||
}
|
||||
|
||||
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 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)
|
||||
// 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 cantuiSeatFee=computed(()=>{
|
||||
let seatFee=props.orderInfo.seatInfo?(props.orderInfo.seatInfo.priceAmount):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
|
||||
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
|
||||
return props.orderInfo.status == 'unpaid' ? item.priceAmount : item.canReturnAmount
|
||||
if (props.orderInfo.status == 'unpaid') {
|
||||
return returnTotalMoney(item)
|
||||
} else {
|
||||
if(props.orderInfo.pointsDiscountAmount>0||props.orderInfo.fullCouponDiscountAmount>0){
|
||||
if (props.orderInfo.pointsDiscountAmount > 0 || props.orderInfo.fullCouponDiscountAmount > 0) {
|
||||
return item.canReturnAmount
|
||||
// const bili=Math.floor((item.priceAmount/canTuiKuanPrice.value )*100)/100
|
||||
// return Math.floor((allPrice.value)*bili*100)/100
|
||||
}else{
|
||||
} else {
|
||||
return item.priceAmount
|
||||
}
|
||||
}
|
||||
@@ -503,8 +511,8 @@
|
||||
})
|
||||
|
||||
const youhuiAllPrice = computed(() => {
|
||||
const n= props.orderInfo.originAmount-props.orderInfo.amount+vipDiscountPrice.value*1
|
||||
return (n<0?0:n).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)
|
||||
@@ -528,12 +536,13 @@
|
||||
|
||||
})
|
||||
const allPrice = computed(() => {
|
||||
|
||||
|
||||
|
||||
|
||||
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)
|
||||
return a + (props.orderInfo.status == 'unpaid' ? b.priceAmount : b
|
||||
.canReturnAmount * 1)
|
||||
}, 0)
|
||||
return prve + curTotal
|
||||
}, 0)
|
||||
@@ -542,12 +551,33 @@
|
||||
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 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)
|
||||
})
|
||||
|
||||
function rotatingTables() {
|
||||
let arr = []
|
||||
props.data.forEach(ele => {
|
||||
ele.info.forEach(res => {
|
||||
// 头像 coverImg
|
||||
res.coverImg = res.productImg
|
||||
// 名字 name
|
||||
res.name = res.productName
|
||||
// 金额 salePrice
|
||||
res.salePrice = res.price
|
||||
// 数量 number
|
||||
res.number = res.num
|
||||
arr.push(res)
|
||||
})
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/pagesCreateOrder/confirm-order/rotatingTables?item=' + JSON.stringify(arr),
|
||||
})
|
||||
}
|
||||
const goodsNumber = computed(() => {
|
||||
let result = 0
|
||||
result = props.data.reduce((a, b) => {
|
||||
|
||||
Reference in New Issue
Block a user