代客下单修改部分页面跳转逻辑

This commit is contained in:
YeMingfei666 2024-10-11 15:45:52 +08:00
parent ec509d1186
commit c9e195c859
4 changed files with 39 additions and 22 deletions

View File

@ -146,7 +146,8 @@
} = await $table.get(query) } = await $table.get(query)
tables.hasAjax = true tables.hasAjax = true
content = content.filter(v =>{ content = content.filter(v =>{
return v.status == 'idle'||(v.status=='using') // return v.status == 'idle'||(v.status=='using')
return v.status == 'idle'
}) })
console.log(content ); console.log(content );
tables.list = content tables.list = content

View File

@ -528,14 +528,16 @@
if ($shop.value.registerType == 'munchies') { if ($shop.value.registerType == 'munchies') {
// //
return go.to('PAGES_ORDER_PAY', { return go.to('PAGES_ORDER_PAY', {
orderId: res.id orderId: res.id,
}) isNowPay:true
},'redirect'
)
} else { } else {
// //
if (option.isCreateOrderToDetail) { if (option.isCreateOrderToDetail) {
go.to('PAGES_ORDER_DETAIL', { go.to('PAGES_ORDER_DETAIL', {
id: res.id id: res.id
}) },'redirect')
} else { } else {
uni.navigateBack({ uni.navigateBack({
delta: 2 delta: 2

View File

@ -391,8 +391,7 @@
// data.table=res.content[0] // data.table=res.content[0]
} }
} }
let $originGoods = []
let $originGoods = ref([])
async function init() { async function init() {
const shopInfo = await tbShopInfo() const shopInfo = await tbShopInfo()
$shop.value = shopInfo $shop.value = shopInfo
@ -417,10 +416,10 @@
} }
return isShow; return isShow;
}); });
$originGoods.value = goods $originGoods=goods
if (!data.table.tableId) { if (!data.table.tableId) {
// //
setTabBar(category, $originGoods.value, []) setTabBar(category, goods, [])
return return
} }
const { const {
@ -464,9 +463,9 @@
const newval = searchValue.value const newval = searchValue.value
let arr = [] let arr = []
if (newval == "") { if (newval == "") {
arr = $originGoods.value; arr = $originGoods;
} else { } else {
arr = $originGoods.value.filter((v) => arr = $originGoods.filter((v) =>
v.name.includes(newval.trim()) v.name.includes(newval.trim())
); );
} }
@ -659,7 +658,9 @@
function chooseGuige(foodsindex, index) { function chooseGuige(foodsindex, index) {
if (!canAddGoods()) { if (!canAddGoods()) {
return infoBox.showToast('清先选择桌台') return infoBox.showToast('清先选择桌台',0.5).then(res=>{
chooseTable()
})
} }
const $goods = data.tabbar[index].foods[foodsindex] const $goods = data.tabbar[index].foods[foodsindex]
guigeModelData.title = $goods.name guigeModelData.title = $goods.name
@ -763,7 +764,9 @@
} }
async function goodsUpdate(foodsindex, index, isAdd) { async function goodsUpdate(foodsindex, index, isAdd) {
if (!canAddGoods()) { if (!canAddGoods()) {
return infoBox.showToast('清先选择桌台') return infoBox.showToast('请先选择桌台',0.5).then(res=>{
chooseTable()
})
} }
const $goods = data.tabbar[index].foods[foodsindex] const $goods = data.tabbar[index].foods[foodsindex]
if ($goods.isDan) { if ($goods.isDan) {
@ -981,6 +984,7 @@
// watchChooseuser() // watchChooseuser()
watchChooseTable() watchChooseTable()
watchUpdate() watchUpdate()
init()
}) })
let isCreateOrderToDetail = ref(false) let isCreateOrderToDetail = ref(false)
onLoad((opt) => { onLoad((opt) => {
@ -998,7 +1002,7 @@
// go.back() // go.back()
// }, 1500) // }, 1500)
// } // }
init() // init()
}) })
</script> </script>

View File

@ -80,12 +80,15 @@
ref ref
} from 'vue'; } from 'vue';
import { import {
onLoad onLoad,
onBackPress
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import * as Api from '@/http/yskApi/Instead.js' import * as Api from '@/http/yskApi/Instead.js'
import infoBox from '@/commons/utils/infoBox.js' import infoBox from '@/commons/utils/infoBox.js'
import editDiscount from '/pagesCreateOrder/components/edit-discount.vue' import editDiscount from '/pagesCreateOrder/components/edit-discount.vue'
import {queryAllShopUser} from '@/http/yskApi/shop-user.js' import {
queryAllShopUser
} from '@/http/yskApi/shop-user.js'
const pays = reactive({ const pays = reactive({
list: ['扫码收款', '二维码收款'], list: ['扫码收款', '二维码收款'],
selIndex: 0, selIndex: 0,
@ -94,7 +97,11 @@
selIndex: 0 selIndex: 0
} }
}) })
let option = opt
onBackPress(()=>{
console.log('-------------------');
console.log('onBackPress');
})
const models = new Map(); const models = new Map();
function setModel(el) { function setModel(el) {
@ -107,8 +114,8 @@
const model = models.get(key) const model = models.get(key)
model && model.open() model && model.open()
} }
let user=ref({}) let user = ref({})
async function getPayType() { async function getPayType() {
const payTypeList = await Api.$getPayType() const payTypeList = await Api.$getPayType()
pays.payTypes.list = payTypeList pays.payTypes.list = payTypeList
@ -125,7 +132,7 @@
uni.$emit('update:createOrderIndex') uni.$emit('update:createOrderIndex')
console.log('update:createOrderIndex'); console.log('update:createOrderIndex');
uni.navigateBack({ uni.navigateBack({
delta: 2 delta: 1
}) })
}, 500) }, 500)
} }
@ -184,11 +191,14 @@
} }
}) })
onLoad((opt) => { onLoad((opt) => {
option = opt
console.log(opt); console.log(opt);
Object.assign(order, opt) Object.assign(order, opt)
if(order.userId){ if (order.userId) {
queryAllShopUser({id:opt.userId}).then(res=>{ queryAllShopUser({
user.value=res.content[0]||opt id: opt.userId
}).then(res => {
user.value = res.content[0] || opt
}) })
} }
}) })