代客下单增加临时菜
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
<view class="page-view u-p-l-24">
|
||||
<view class="list-tight-top">
|
||||
<template v-if="lingshi.show">
|
||||
<view id="lingshi" class="lingshi" @tap="toLinshi">
|
||||
<view id="lingshi" class="lingshi u-m-b-32" @tap="toLinshi">
|
||||
<uni-icons type="plus-filled" size="24" :color="color.ColorMain"></uni-icons>
|
||||
<view class="u-m-t-24 color-main">临时菜</view>
|
||||
</view>
|
||||
@@ -671,7 +671,12 @@
|
||||
}
|
||||
|
||||
function toLinshi() {
|
||||
go.to('PAGES_ADD_TEMP_CUISINE')
|
||||
go.to('PAGES_ADD_TEMP_CUISINE',{
|
||||
masterId:data.masterId,
|
||||
tableId:data.table.tableId,
|
||||
vipUserId:option.vipUserId?option.vipUserId:'',
|
||||
useType:uni.getStorageSync('useType')
|
||||
})
|
||||
}
|
||||
|
||||
const chooseGuigeModel = ref(null)
|
||||
@@ -897,10 +902,13 @@
|
||||
categoryId,
|
||||
skuId
|
||||
} = goods
|
||||
|
||||
const cartId = goods.id
|
||||
const tabbarIndex = data.tabbar.findIndex(v => v.id == categoryId)
|
||||
const $goods = data.tabbar[tabbarIndex].foods.find(v => v.id == productId)
|
||||
const $sku = $goods.specList.find(v => v.id == skuId)
|
||||
//临时菜没有对应商品数据
|
||||
const $goods =!productId?undefined:data.tabbar[tabbarIndex].foods.find(v => v.id == productId)
|
||||
//临时菜没有skuList
|
||||
const $sku =!productId?{suit:1}:$goods.specList.find(v => v.id == skuId)
|
||||
|
||||
if (num === 0 || num < $sku.suit) {
|
||||
//移除
|
||||
@@ -1180,10 +1188,11 @@
|
||||
setTabBar($category, $originGoods, cars)
|
||||
}
|
||||
onBeforeUnmount(() => {})
|
||||
|
||||
|
||||
function watchUpdate() {
|
||||
uni.$off('update:createOrderIndex')
|
||||
uni.$off('get:table')
|
||||
uni.$off('add:cashCai')
|
||||
uni.$on('update:createOrderIndex', () => {
|
||||
// data.table = {
|
||||
// tableId: ""
|
||||
@@ -1192,6 +1201,15 @@
|
||||
console.log('update:createOrderIndex');
|
||||
init()
|
||||
})
|
||||
uni.$on('add:cashCai', async() => {
|
||||
console.log('add:cashCai');
|
||||
const cartRes = await getCart()
|
||||
cars.length = 0
|
||||
const cartArr = getNowCart(cartRes.records)
|
||||
for (let i in cartArr) {
|
||||
cars.push(cartArr[i])
|
||||
}
|
||||
})
|
||||
uni.$on('get:table', () => {
|
||||
console.log('get:table');
|
||||
if (data.table.tableId) {
|
||||
|
||||
Reference in New Issue
Block a user