代客下单更新部分页面跳转请求。页面展示
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
<view class="search u-flex u-col-center ">
|
||||
<view class="u-flex-1">
|
||||
<uni-search-bar bgColor="#F9F9F9" cancelButton="none" placeholder="搜索店内商品" @confirm="search"
|
||||
:focus="true" v-model="searchValue">
|
||||
v-model="searchValue">
|
||||
</uni-search-bar>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
@@ -70,18 +70,18 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="bottom w-full">
|
||||
<my-car @updateNumber="carsNumberChange" :user="data.vipUser" :masterId="data.masterId"
|
||||
:table="data.table"
|
||||
:data="cars" @clear="onClearCart"></my-car>
|
||||
<my-car @updateNumber="carsNumberChange" :user="data.vipUser" :masterId="data.masterId" :table="data.table"
|
||||
:data="cars" @clear="onClearCart"></my-car>
|
||||
</view>
|
||||
|
||||
<!-- 选择规格 -->
|
||||
<guige-model @update-sku="updateSkuSel" @confirm="guigeConfirm" ref="chooseGuigeModel" :title="guigeModelData.title"
|
||||
:sku-map="guigeModelData.chooseGoods.skuMap" :skus="guigeModelData.chooseGoods.skus"></guige-model>
|
||||
<!-- 添加附加费 -->
|
||||
<my-surcharge @confirm="surchargeConfirm" ref="surcharge" title="添加附加费"></my-surcharge>
|
||||
|
||||
<!-- 选择规格 -->
|
||||
<guige-model @update-sku="updateSkuSel" @confirm="guigeConfirm" ref="chooseGuigeModel"
|
||||
:title="guigeModelData.title" :sku-map="guigeModelData.chooseGoods.skuMap"
|
||||
:skus="guigeModelData.chooseGoods.skus"></guige-model>
|
||||
<!-- 添加附加费 -->
|
||||
<my-surcharge @confirm="surchargeConfirm" ref="surcharge" title="添加附加费"></my-surcharge>
|
||||
</view>
|
||||
|
||||
|
||||
</template>
|
||||
<script setup>
|
||||
import _ from 'lodash';
|
||||
@@ -112,6 +112,7 @@
|
||||
import myCar from './components/car'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import infoBox from '@/commons/utils/infoBox.js';
|
||||
import {getNowCart} from '@/pagesCreateOrder/util.js'
|
||||
const cars = reactive([])
|
||||
const data = reactive({
|
||||
scrollTop: 0, //tab标题的滚动条位置
|
||||
@@ -302,9 +303,11 @@
|
||||
data.masterId = masterId
|
||||
const cartRes = await getCart()
|
||||
cars.length = 0
|
||||
for (let i in cartRes.records) {
|
||||
cars.push(cartRes.records[i])
|
||||
const cartArr =getNowCart(cartRes.records)
|
||||
for (let i in cartArr) {
|
||||
cars.push(cartArr[i])
|
||||
}
|
||||
|
||||
const categoryRes = await getCategory()
|
||||
const category = categoryRes.content.reduce((prve, cur) => {
|
||||
prve.push({
|
||||
@@ -329,7 +332,7 @@
|
||||
|
||||
// 监听选择用户事件
|
||||
|
||||
|
||||
|
||||
|
||||
const surcharge = ref(null)
|
||||
|
||||
@@ -663,15 +666,15 @@
|
||||
onReady(() => {
|
||||
getMenuItemTop()
|
||||
})
|
||||
|
||||
let isTabClickOver=true
|
||||
|
||||
let isTabClickOver = true
|
||||
// 点击左边的栏目切换
|
||||
async function swichMenu(index) {
|
||||
if (data.arr.length == 0) {
|
||||
await getMenuItemTop();
|
||||
}
|
||||
if (index == data.current) return;
|
||||
isTabClickOver=false;
|
||||
isTabClickOver = false;
|
||||
data.scrollRightTop = data.oldScrollTop;
|
||||
nextTick(function() {
|
||||
data.scrollRightTop = data.arr[index] + data.topZhanwei;
|
||||
@@ -717,12 +720,12 @@
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 设置左边菜单的滚动状态
|
||||
async function leftMenuStatus(index) {
|
||||
if(!isTabClickOver){
|
||||
if (!isTabClickOver) {
|
||||
return
|
||||
}
|
||||
data.current = index;
|
||||
@@ -755,9 +758,9 @@
|
||||
}).exec()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 右边菜单滚动
|
||||
async function rightScroll(e) {
|
||||
data.oldScrollTop = e.detail.scrollTop;
|
||||
@@ -777,16 +780,17 @@
|
||||
let height2 = data.arr[i + 1];
|
||||
// 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
|
||||
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
|
||||
if(isTabClickOver){
|
||||
if (isTabClickOver) {
|
||||
leftMenuStatus(i);
|
||||
}else{
|
||||
isTabClickOver=true
|
||||
} else {
|
||||
isTabClickOver = true
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}, 10)
|
||||
}
|
||||
|
||||
function watchChooseuser() {
|
||||
uni.$off('choose-user')
|
||||
uni.$on('choose-user', (user) => {
|
||||
@@ -797,14 +801,13 @@
|
||||
setUser()
|
||||
})
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
})
|
||||
onShow(()=>{
|
||||
onBeforeUnmount(() => {})
|
||||
onShow(() => {
|
||||
watchChooseuser()
|
||||
})
|
||||
onLoad((opt) => {
|
||||
console.log(opt)
|
||||
Object.assign(data.table,opt)
|
||||
Object.assign(data.table, opt)
|
||||
if (!opt.tableId) {
|
||||
infoBox.showErrorToast('暂不支持不选择台桌下载,请从桌台点餐')
|
||||
return setTimeout(() => {
|
||||
@@ -813,8 +816,6 @@
|
||||
}
|
||||
init()
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user