增加部分公共样式

修改部分公共组件代码
修改台桌,代课下单逻辑代码
增加支付页面
修改用户列表页面
This commit is contained in:
2024-09-09 17:45:19 +08:00
parent da5f7ca916
commit 34853b8783
31 changed files with 1182 additions and 99 deletions

View File

@@ -3,10 +3,10 @@
<user-vue></user-vue>
<view class="default-box-padding bg-fff border-r-12 u-m-t-20">
<text class="color-666">桌位号</text>
<text class="font-bold">A6</text>
<text class="font-bold">{{options.name}}</text>
</view>
<goods-list :data="orderDetail.goodsList"></goods-list>
<order-vue></order-vue>
<order-vue :data="orderDetail.info" :table="options"></order-vue>
<step-vue></step-vue>
<view style="height: 200rpx;"></view>
<view class="u-fixed bottom bg-fff ">
@@ -16,7 +16,8 @@
shape="circle" plain type="primary">加菜</my-button>
</view>
<view class="u-flex-1">
<my-button borderRadius="0 100rpx 100rpx 0" shape="circle" type="primary" >结账</my-button>
<my-button @tap="toPay" borderRadius="0 100rpx 100rpx 0" shape="circle"
type="primary">结账</my-button>
</view>
</view>
</view>
@@ -31,36 +32,76 @@
import stepVue from './components/step.vue';
import go from '@/commons/utils/go.js'
import {
onLoad,onHide
onLoad,
onShow,
onHide
} from '@dcloudio/uni-app';
import {
reactive
} from 'vue';
import OrderDetail from './page.js'
const uiPage=new OrderDetail()
setTimeout(()=>{
uiPage.setVal('user',{name:1})
},1500)
const uiPage = new OrderDetail()
setTimeout(() => {
uiPage.setVal('user', {
name: 1
})
}, 1500)
function diancan() {
go.to('PAGES_CREATE_ORDER', {
tableId: options.tableId,
tableName: options.name
})
}
const orderDetail=reactive({
goodsList:[]
function toPay() {
go.to('PAGES_CRESATE_ORDER_PAY', {
...orderDetail.info,
tableId: options.tableId,
tableName: options.name,
masterId: options.masterId,
})
}
const orderDetail = reactive({
goodsList: [],
info: {}
})
const options = reactive({})
async function init(){
const {masterId}=await Api.$getMasterId(options)
async function init() {
const {
masterId
} = await Api.$getMasterId(options)
console.log(masterId);
const {records} = await Api.getCart({
...options,masterId
options.masterId=masterId
const {
records
} = await Api.getCart({
...options,
masterId
})
orderDetail.goodsList=records
orderDetail.goodsList = records
const info = await Api.$createOrder({
masterId,
vipUserId: '',
tableId: options.tableId,
note: '',
postPay: true,
orderld: ''
})
orderDetail.info = info
}
function watchEmit(){
uni.$off('orderDetail:update')
uni.$once('orderDetail:update',(newval)=>{
console.log(newval);
init()
})
}
onShow(()=>{
watchEmit()
})
onLoad((opt) => {
Object.assign(options, opt)
console.log(options);