更新代码
This commit is contained in:
parent
0740c3f349
commit
7519ffced3
|
|
@ -24,6 +24,17 @@ export function $bind(data) {
|
|||
}
|
||||
});
|
||||
}
|
||||
// 转/并桌
|
||||
export function tableswitch(data) {
|
||||
return request({
|
||||
url: '/api/place/switch',
|
||||
method: "put",
|
||||
data: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
//获取台桌详情状态
|
||||
export function $returnTableDetail(data) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"name" : "银收客",
|
||||
"appid" : "__UNI__02A31D8",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.2",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : 100,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
|
|
|
|||
|
|
@ -51,6 +51,9 @@
|
|||
} from 'vue';
|
||||
import color from '@/commons/color.js';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
onLoad,
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
tbShopPurveyorput
|
||||
} from '@/http/yskApi/requestAll.js';
|
||||
|
|
@ -62,17 +65,15 @@
|
|||
type: String
|
||||
}
|
||||
})
|
||||
onMounted(() => {
|
||||
datas.form = JSON.parse(props.item)
|
||||
onLoad((d)=>{
|
||||
datas.form = JSON.parse(d.item)
|
||||
})
|
||||
|
||||
function sumbit() {
|
||||
tbShopPurveyorput({
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
|
||||
...datas.form
|
||||
}).then(res => {
|
||||
// go.to('PAGES_SUPPLIER')
|
||||
go.back()
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<!-- 不需要label, 需要修改: label-width="0" -->
|
||||
<uni-forms ref="loginFormRef" label-width="0" :model="vdata.formData" :rules="rules">
|
||||
|
||||
<view >
|
||||
<view>
|
||||
<uni-forms-item name="username">
|
||||
<uni-easyinput class='jeepay-easyinput' placeholder="请输入登录名/手机号"
|
||||
v-model="vdata.formData.username" :clearable="false">
|
||||
|
|
@ -29,7 +29,8 @@
|
|||
</template>
|
||||
<template #suffixIcon>
|
||||
<view class='show-tips' @tap="vdata.isShowPwd = !vdata.isShowPwd ">
|
||||
{{ vdata.isShowPwd ? '隐藏' : '显示' }}</view>
|
||||
{{ vdata.isShowPwd ? '隐藏' : '显示' }}
|
||||
</view>
|
||||
</template>
|
||||
</uni-easyinput>
|
||||
</uni-forms-item>
|
||||
|
|
@ -55,7 +56,6 @@
|
|||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
|
||||
import {
|
||||
login
|
||||
} from '@/http/businessApiManger.js';
|
||||
|
|
@ -112,7 +112,6 @@
|
|||
formUtil.validate(loginFormRef.value).then(() => {
|
||||
|
||||
login(vdata.formData).then((res) => {
|
||||
console.log(res);
|
||||
useStorage.set('token', res.data.token);
|
||||
useStorage.set('userInfo', res.data.user);
|
||||
uni.showToast({
|
||||
|
|
|
|||
|
|
@ -630,6 +630,13 @@
|
|||
"navigationBarTitleText": "确认订单"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_ROTATING_TABLES",
|
||||
"path": "confirm-order/rotatingTables",
|
||||
"style": {
|
||||
"navigationBarTitleText": "转桌/并桌"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_CHOOSE_TABLE",
|
||||
"path": "choose-table/choose-table",
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
@ -249,7 +250,7 @@
|
|||
})
|
||||
// #ifdef H5
|
||||
vdata.formData.username = '17792050546'
|
||||
vdata.formData.pwd = 'sy666888'
|
||||
vdata.formData.pwd = 'qwer1234'
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
// vdata.formData.username = '15699991111'
|
||||
|
|
@ -258,11 +259,11 @@
|
|||
|
||||
function accountTypeChange(e) {
|
||||
// #ifdef H5
|
||||
if(e==1){
|
||||
if (e == 1) {
|
||||
vdata.formData.merchantName = '18049104914'
|
||||
vdata.formData.username = '13666666666'
|
||||
vdata.formData.pwd = '123456'
|
||||
}else{
|
||||
} else {
|
||||
vdata.formData.pwd = 'qwer1234'
|
||||
}
|
||||
// #endif
|
||||
|
|
@ -301,6 +302,7 @@
|
|||
}
|
||||
|
||||
function loginFunc() {
|
||||
|
||||
// 表单验证
|
||||
formUtil.validate(loginFormRef.value).then(() => {
|
||||
if (!vdata.isSelectedAgreement) {
|
||||
|
|
@ -375,11 +377,21 @@
|
|||
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 + ',店铺账号到期剩余' + Math.abs(les.toFixed(0)) + '天!',
|
||||
icon: 'none'
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
// 跳转到首页
|
||||
go.to("PAGES_INDEX", {
|
||||
isGetCid: true
|
||||
}, go.GO_TYPE_RELAUNCH)
|
||||
}, 1000)
|
||||
|
||||
// 跳转到首页
|
||||
go.to("PAGES_INDEX", {
|
||||
isGetCid: true
|
||||
}, go.GO_TYPE_RELAUNCH)
|
||||
}
|
||||
|
||||
// 点击发送验证码的函数
|
||||
|
|
|
|||
|
|
@ -112,6 +112,14 @@
|
|||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- <template v-if="goods.list[0].tableId&&goods.list[0].orderId">
|
||||
<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>
|
||||
</template> -->
|
||||
|
||||
</template>
|
||||
|
||||
<view class="block">
|
||||
|
|
@ -367,6 +375,11 @@
|
|||
return Number(n).toFixed(2)
|
||||
}
|
||||
|
||||
function rotatingTables() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesCreateOrder/confirm-order/rotatingTables?item='+JSON.stringify(goods.list),
|
||||
})
|
||||
}
|
||||
// 单品打折
|
||||
async function discountconfirm(form) {
|
||||
if (form.discountMoney != '.') {
|
||||
|
|
@ -618,10 +631,10 @@
|
|||
}, 0)
|
||||
return goodsTotalPrice - allPrice.value
|
||||
} else {
|
||||
console.log(discountSaleAmount.value,'优惠金额')
|
||||
console.log(discountSaleAmount.value, '优惠金额')
|
||||
return (discountSaleAmount.value)
|
||||
}
|
||||
console.log(discountSaleAmount.value,'优惠金额1')
|
||||
console.log(discountSaleAmount.value, '优惠金额1')
|
||||
return (goodsTotalPrice + discountSaleAmount.value * 1).toFixed(2)
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,207 @@
|
|||
<template>
|
||||
<view style="padding: 20rpx;">
|
||||
<view class="uni-padding-wrap uni-common-mt">
|
||||
<uni-segmented-control :current="datas.current" :values=" ['转桌', '并桌']" style-type="button"
|
||||
active-color="#007aff" @clickItem="onClickItem" />
|
||||
</view>
|
||||
<view class="u-m-t-48">
|
||||
请选择其他桌:
|
||||
</view>
|
||||
<view class="uni-list">
|
||||
<radio-group @change="radioChange" v-if="datas.tableList.length">
|
||||
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in datas.tableList" :key="index">
|
||||
<view class="u-m-t-48 u-m-b-48">
|
||||
<radio :value="item.tableId" /> {{item.name}}
|
||||
</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
<view v-else>
|
||||
暂无数据
|
||||
</view>
|
||||
</view>
|
||||
<view class="uni-list" v-if="datas.current==0">
|
||||
<view class="u-m-t-48">
|
||||
请选择需要转桌的菜品:
|
||||
</view>
|
||||
<checkbox-group @change="checkboxChange">
|
||||
<label class="uni-list-cell uni-list-cell-pd" v-for="(item,index) in datas.item" :key="index">
|
||||
<template v-if="item.status=='unpaid'">
|
||||
<view class="u-flex u-m-t-48 u-m-b-48"
|
||||
style="justify-content: space-between;align-items: center;">
|
||||
<view class="u-flex">
|
||||
<checkbox :value="item.cartId" />
|
||||
<image class="img" v-if="item.coverImg" :src="item.coverImg" mode=""></image>
|
||||
|
||||
{{item.name}}
|
||||
</view>
|
||||
<view class="">
|
||||
<view class=" u-relative">
|
||||
<template v-if="item.isGift">
|
||||
<text
|
||||
class="line-th color-999">¥{{formatPrice(item.salePrice*item.number) }}</text>
|
||||
<view class="u-absolute" style="right: 0;bottom: 100%;">
|
||||
<text class="font-bold">¥0</text>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="isVip&&item.memberPrice&&item.memberPrice*1!=item.salePrice*1">
|
||||
<text
|
||||
class="line-th color-999">¥{{formatPrice(item.salePrice*item.number) }}</text>
|
||||
<view class="u-absolute" style="right: 0;bottom: 100%;">
|
||||
<text
|
||||
class="font-bold">¥{{formatPrice(item.memberPrice*item.number) }}</text>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="font-bold">
|
||||
<text>¥</text>
|
||||
<text class="">{{formatPrice(item.salePrice*item.number) }}</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
</view>
|
||||
<view class="color-999 u-text-right u-font-24 u-m-t-12">×{{item.number}}</view>
|
||||
</view>
|
||||
<!-- <text class=" color-999">¥{{formatPrice(item.salePrice*item.number) }}</text> -->
|
||||
</view>
|
||||
</template>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
|
||||
<my-button shape="circle" @tap="confirm">确定</my-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
defineProps
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
$table,
|
||||
tableswitch
|
||||
} from '@/http/yskApi/table.js'
|
||||
let datas = reactive({
|
||||
current: 0,
|
||||
item: "",
|
||||
// 桌台列表
|
||||
tableList: [],
|
||||
// 并桌选中
|
||||
selecttableList: '',
|
||||
// 转桌数据
|
||||
changeTable: []
|
||||
})
|
||||
const props = defineProps({
|
||||
item: {
|
||||
type: Array
|
||||
},
|
||||
tableId: {
|
||||
type: String
|
||||
}
|
||||
})
|
||||
onLoad((opt) => {
|
||||
datas.item = JSON.parse(opt.item)
|
||||
})
|
||||
onShow(() => {
|
||||
gettableList()
|
||||
})
|
||||
async function confirm() {
|
||||
// 是否选择其他桌
|
||||
if (datas.selecttableList) {
|
||||
if (datas.current == 0) {
|
||||
// 转桌是否选择菜品
|
||||
if (datas.changeTable.length) {
|
||||
let res = await tableswitch({
|
||||
masterId: datas.item[0].masterId,
|
||||
useType: datas.item[0].useType,
|
||||
cartIds: datas.changeTable,
|
||||
currentTableId: datas.item[0].tableId,
|
||||
targetTableId: datas.selecttableList
|
||||
})
|
||||
if (res) {
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '请选择菜品或桌号!',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
let res = await tableswitch({
|
||||
masterId: datas.item[0].masterId,
|
||||
useType: datas.item[0].useType,
|
||||
isFull: true,
|
||||
currentTableId: datas.item[0].tableId,
|
||||
targetTableId: datas.selecttableList
|
||||
})
|
||||
if (res) {
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '请选择菜品或桌号!',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function radioChange(d) {
|
||||
datas.selecttableList = d.detail.value
|
||||
}
|
||||
// 切换转/并桌
|
||||
function onClickItem(e) {
|
||||
if (datas.current !== e.currentIndex) {
|
||||
datas.current = e.currentIndex
|
||||
}
|
||||
}
|
||||
// 获取桌台
|
||||
async function gettableList() {
|
||||
const res = await $table.get({
|
||||
page: 1,
|
||||
size: 999
|
||||
})
|
||||
let arr = []
|
||||
res.content.forEach((ele) => {
|
||||
if (ele.status == 'using' && props.tableId != ele.tableId) {
|
||||
arr.push(ele)
|
||||
}
|
||||
});
|
||||
datas.tableList = arr
|
||||
}
|
||||
|
||||
function formatPrice(n) {
|
||||
return Number(n).toFixed(2)
|
||||
}
|
||||
|
||||
function checkboxChange(e) {
|
||||
datas.changeTable = e.detail.value
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.goods {
|
||||
// padding-bottom: 30rpx;
|
||||
border-bottom: 1px dashed #E5E5E5;
|
||||
|
||||
.item {}
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 84rpx;
|
||||
height: 84rpx;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -116,6 +116,7 @@
|
|||
}
|
||||
|
||||
function close() {
|
||||
datas.selectNumber = 0
|
||||
model.value.close()
|
||||
}
|
||||
const instance = getCurrentInstance();
|
||||
|
|
|
|||
|
|
@ -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" v-if="orderInfo.tableName&&orderInfo.status=='unpaid'">
|
||||
<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>
|
||||
|
|
@ -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.priceAmount
|
||||
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
|
||||
}
|
||||
}
|
||||
|
|
@ -419,7 +427,7 @@
|
|||
if (res) {
|
||||
emits('tuikuan', {
|
||||
...item,
|
||||
priceAmount: item.canReturnAmount
|
||||
priceAmount: item.priceAmount
|
||||
}, index)
|
||||
}
|
||||
})
|
||||
|
|
@ -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)
|
||||
|
|
@ -533,21 +541,48 @@
|
|||
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 + (b.status == 'unpaid' ? b.priceAmount : b.status == 'return' ? 0 : b
|
||||
.priceAmount * 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 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
|
||||
res.masterId = props.orderInfo.masterId
|
||||
res.useType = props.orderInfo.useType
|
||||
res.tableId = props.orderInfo.tableId
|
||||
arr.push(res)
|
||||
})
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/pagesCreateOrder/confirm-order/rotatingTables?item=' + JSON.stringify(arr) + '&tableId=' + props
|
||||
.orderInfo.tableId
|
||||
})
|
||||
}
|
||||
const goodsNumber = computed(() => {
|
||||
let result = 0
|
||||
result = props.data.reduce((a, b) => {
|
||||
|
|
|
|||
|
|
@ -6,22 +6,23 @@
|
|||
{{data.productName}}
|
||||
</view>
|
||||
<view class="u-flex u-m-t-32" :class="{'gray':data.productId=='-999'}">
|
||||
<up-number-box :min="1" :max="data.num" :buttonSize="44" v-model="number" integer :disabled="data.productId=='-999'">
|
||||
<up-number-box :min="0" :max="data.num" :buttonSize="44" v-model="number" integer
|
||||
:disabled="data.productId=='-999'">
|
||||
<template #minus>
|
||||
<view class="minus number-box-btn">
|
||||
</view>
|
||||
</template>
|
||||
<template #input>
|
||||
<view class="u-flex-1 u-row-center u-text-center input">
|
||||
<up-input
|
||||
:disabled="data.productId=='-999'"
|
||||
@change="parseIntNumber($event,false)" @blur="parseIntNumber($event,true)"
|
||||
v-model="number" border="none" type="number"></up-input>
|
||||
<up-input :disabled="data.productId=='-999'" @change="parseIntNumber($event,false)"
|
||||
@blur="parseIntNumber($event,true)" v-model="number" border="none"
|
||||
type="number"></up-input>
|
||||
</view>
|
||||
</template>
|
||||
<template #plus>
|
||||
<view class="plus number-box-btn">
|
||||
<up-icon v-if="data.productId=='-999'" name="plus" color="#ccc" size="16" bold></up-icon>
|
||||
<up-icon v-if="data.productId=='-999'" name="plus" color="#ccc" size="16"
|
||||
bold></up-icon>
|
||||
<up-icon v-else name="plus" color="#999" size="16" bold></up-icon>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -50,8 +51,7 @@
|
|||
<view class="u-p-t-18 u-p-l-30 u-p-r-30 u-p-b-10">
|
||||
<my-button box-shadow shape="circle" @tap="confirm">确认退菜</my-button>
|
||||
<view class="u-m-t-10">
|
||||
<my-button @tap="onModelClose" shape="circle" bgColor="#fff" type="cancel"
|
||||
box-shadow>取消</my-button>
|
||||
<my-button @tap="onModelClose" shape="circle" bgColor="#fff" type="cancel" box-shadow>取消</my-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
productId:'-999'
|
||||
productId: '-999'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -86,7 +86,7 @@
|
|||
const emits = defineEmits(['update:show', 'confirm'])
|
||||
let model = ref(null)
|
||||
let modelShow = ref(props.show)
|
||||
let number = ref(1)
|
||||
let number = ref(0)
|
||||
const tags = ref([{
|
||||
label: "点错",
|
||||
checked: false
|
||||
|
|
@ -103,16 +103,18 @@
|
|||
let timer = null
|
||||
|
||||
function parseIntNumber(val, isNow) {
|
||||
console.log(val);
|
||||
let newval = parseInt(val)
|
||||
let newval = val * 1
|
||||
if (newval > props.data.num) {
|
||||
newval = props.data.num
|
||||
}
|
||||
if (newval < 1) {
|
||||
newval = 1
|
||||
// 判断是否是称重商品。如果是可以输入小数
|
||||
if (props.data.isWeight != 1) {
|
||||
if (newval < 1) {
|
||||
newval = 1
|
||||
}
|
||||
}
|
||||
if (isNow) {
|
||||
number.value = parseInt(newval)
|
||||
number.value = newval * 1
|
||||
return
|
||||
}
|
||||
timer = setTimeout(() => {
|
||||
|
|
@ -141,7 +143,7 @@
|
|||
|
||||
|
||||
function onModelClose() {
|
||||
number.value=1
|
||||
number.value = 1
|
||||
modelShow.value = false
|
||||
}
|
||||
|
||||
|
|
@ -151,17 +153,17 @@
|
|||
|
||||
function open() {
|
||||
model.value.open()
|
||||
if(props.data.productId=='-999'){
|
||||
number.value=props.data.num
|
||||
if (props.data.productId == '-999') {
|
||||
number.value = props.data.num
|
||||
}
|
||||
}
|
||||
|
||||
function close() {
|
||||
model.value.close()
|
||||
tags.value.map(v=>{
|
||||
v.checked=false
|
||||
tags.value.map(v => {
|
||||
v.checked = false
|
||||
})
|
||||
form.note=''
|
||||
form.note = ''
|
||||
}
|
||||
|
||||
function confirm() {
|
||||
|
|
@ -206,12 +208,14 @@
|
|||
::v-deep .uni-input-input {
|
||||
text-align: center;
|
||||
}
|
||||
.gray{
|
||||
.minus::after{
|
||||
|
||||
.gray {
|
||||
.minus::after {
|
||||
border-color: #ccc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.minus {
|
||||
&::after {
|
||||
content: '';
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@
|
|||
}
|
||||
|
||||
async function onSeatFeeTuiKuan(seatFee) {
|
||||
console.log(seatFee);
|
||||
console.log(seatFee,'调试1');
|
||||
const canTuikuan=await hasTuiKuan()
|
||||
if(!canTuikuan){
|
||||
return
|
||||
|
|
@ -124,19 +124,22 @@
|
|||
}
|
||||
|
||||
function onTuiCai(goods, index) {
|
||||
console.log(goods);
|
||||
tuicai.show = true
|
||||
tuicai.selGoods = goods
|
||||
}
|
||||
async function tuicaiConfirm(e) {
|
||||
console.log(tuicai.selGoods);
|
||||
const res = await Api.$returnCart({
|
||||
...e,
|
||||
cartId: tuicai.selGoods.hasOwnProperty('cartId') ? tuicai.selGoods.cartId : tuicai.selGoods.id,
|
||||
tableId: orderDetail.info.tableId,
|
||||
})
|
||||
tuicai.show = false
|
||||
if(res){
|
||||
go.back()
|
||||
}else{
|
||||
|
||||
init()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -171,7 +174,7 @@
|
|||
if(!canTuikuan){
|
||||
return
|
||||
}
|
||||
console.log(goods);
|
||||
console.log(goods,'debug');
|
||||
const {
|
||||
id,
|
||||
productId,
|
||||
|
|
@ -307,6 +310,7 @@
|
|||
}))
|
||||
console.log(orderDetail.goodsList);
|
||||
}
|
||||
console.log(res,'debug121')
|
||||
orderDetail.info = res
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue