代客下单更新部分页面跳转请求。页面展示
This commit is contained in:
@@ -5,8 +5,10 @@
|
||||
<text class="color-666">桌位号:</text>
|
||||
<text class="font-bold">{{options.name}}</text>
|
||||
</view>
|
||||
<goods-list :data="orderDetail.goodsList"></goods-list>
|
||||
<order-vue :data="orderDetail.info" :table="options"></order-vue>
|
||||
<goods-list :data="orderDetail.goodsList" :seatFee="orderDetail.seatFee.totalAmount"
|
||||
@tuicai="onTuiCai"></goods-list>
|
||||
<extra-vue :data="orderDetail.seatFee"></extra-vue>
|
||||
<order-vue :data="orderDetail.info" :table="options" :seatFee="orderDetail.seatFee"></order-vue>
|
||||
<step-vue></step-vue>
|
||||
<view style="height: 200rpx;"></view>
|
||||
<view class="u-fixed bottom bg-fff ">
|
||||
@@ -21,6 +23,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<tuicai-vue @confirm="tuicaiConfirm" v-model:show="tuicai.show" :data="tuicai.selGoods"></tuicai-vue>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -30,6 +34,8 @@
|
||||
import orderVue from './components/order.vue';
|
||||
import goodsList from './components/list.vue';
|
||||
import stepVue from './components/step.vue';
|
||||
import extraVue from './components/extra.vue';
|
||||
import tuicaiVue from './components/tuicai.vue';
|
||||
import go from '@/commons/utils/go.js'
|
||||
import {
|
||||
onLoad,
|
||||
@@ -40,6 +46,24 @@
|
||||
reactive
|
||||
} from 'vue';
|
||||
import OrderDetail from './page.js'
|
||||
const tuicai = reactive({
|
||||
show: false,
|
||||
selGoods: ''
|
||||
})
|
||||
|
||||
function onTuiCai(goods, index) {
|
||||
tuicai.show = true
|
||||
tuicai.selGoods = goods
|
||||
}
|
||||
|
||||
async function tuicaiConfirm() {
|
||||
const res=await Api.$returnCart({
|
||||
cartId: tuicai.selGoods.id,
|
||||
tableId:options.tableId,
|
||||
})
|
||||
tuicai.selGoods.status='return'
|
||||
tuicai.show = false
|
||||
}
|
||||
const uiPage = new OrderDetail()
|
||||
setTimeout(() => {
|
||||
uiPage.setVal('user', {
|
||||
@@ -50,22 +74,27 @@
|
||||
function diancan() {
|
||||
go.to('PAGES_CREATE_ORDER', {
|
||||
tableId: options.tableId,
|
||||
tableName: options.name
|
||||
tableName: options.name,
|
||||
type: 'add'
|
||||
})
|
||||
}
|
||||
|
||||
function toPay() {
|
||||
go.to('PAGES_CRESATE_ORDER_PAY', {
|
||||
...orderDetail.info,
|
||||
tableId: options.tableId,
|
||||
tableName: options.name,
|
||||
masterId: options.masterId,
|
||||
orderId: orderDetail.info.id,
|
||||
discount: 1
|
||||
})
|
||||
}
|
||||
|
||||
const orderDetail = reactive({
|
||||
goodsList: [],
|
||||
info: {}
|
||||
info: {},
|
||||
seatFee: {
|
||||
totalAmount: 0
|
||||
}
|
||||
})
|
||||
const options = reactive({})
|
||||
async function init() {
|
||||
@@ -73,14 +102,16 @@
|
||||
masterId
|
||||
} = await Api.$getMasterId(options)
|
||||
console.log(masterId);
|
||||
options.masterId=masterId
|
||||
options.masterId = masterId
|
||||
const {
|
||||
records
|
||||
records,
|
||||
seatFee
|
||||
} = await Api.getCart({
|
||||
...options,
|
||||
masterId
|
||||
})
|
||||
orderDetail.goodsList = records
|
||||
orderDetail.seatFee = seatFee
|
||||
const info = await Api.$createOrder({
|
||||
masterId,
|
||||
vipUserId: '',
|
||||
@@ -91,16 +122,16 @@
|
||||
})
|
||||
orderDetail.info = info
|
||||
}
|
||||
function watchEmit(){
|
||||
|
||||
function watchEmit() {
|
||||
uni.$off('orderDetail:update')
|
||||
uni.$once('orderDetail:update',(newval)=>{
|
||||
uni.$once('orderDetail:update', (newval) => {
|
||||
console.log(newval);
|
||||
init()
|
||||
})
|
||||
}
|
||||
onShow(()=>{
|
||||
onShow(() => {
|
||||
watchEmit()
|
||||
|
||||
})
|
||||
onLoad((opt) => {
|
||||
Object.assign(options, opt)
|
||||
|
||||
Reference in New Issue
Block a user