下单页面调整,确认订单页面调整
This commit is contained in:
@@ -9,16 +9,21 @@ import {
|
||||
APIuser
|
||||
} from '@/common/api/api.js'
|
||||
import {
|
||||
APIproductqueryShop,
|
||||
APIproductqueryShop,APIusershopInfodetail,
|
||||
APIshopUserInfo
|
||||
} from '@/common/api/member.js'
|
||||
export const Storelogin = defineStore('login', {
|
||||
state: () => ({
|
||||
token: '',
|
||||
miniAppOpenId: '',
|
||||
userInfo: ''
|
||||
userInfo: '',
|
||||
shopInfo:{}
|
||||
}),
|
||||
actions: {
|
||||
async getShopInfo(shopId){
|
||||
const shopRes=await APIusershopInfodetail({shopId})
|
||||
console.log(shopRes);
|
||||
},
|
||||
actionslogin() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
// #ifdef MP-WEIXIN
|
||||
@@ -98,21 +103,26 @@ export const productStore = defineStore('product', {
|
||||
scanCodeactions(q) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
if (q) {
|
||||
console.log(q)
|
||||
let tableCode =""
|
||||
// #ifdef MP-WEIXIN
|
||||
let tableCode = this.getQueryString(decodeURIComponent(q), 'code')
|
||||
tableCode = this.getQueryString(decodeURIComponent(q), 'code')
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
let tableCode = q
|
||||
tableCode = q
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
tableCode= q.tableCode
|
||||
// #endif
|
||||
console.log(tableCode);
|
||||
// 储存卓玛
|
||||
uni.cache.set('tableCode', tableCode)
|
||||
if (tableCode) {
|
||||
let data = await this.actionsproductqueryShop()
|
||||
console.log(uni.cache.get('tableCode'));
|
||||
let data = await this.actionsproductqueryShop(tableCode)
|
||||
// -4请求登录
|
||||
const store = Storelogin()
|
||||
if (data.code == '500') {
|
||||
if (await store.actionslogin()) {
|
||||
if (await this.actionslogin()) {
|
||||
// 成功 接着在调用
|
||||
await this.actionsproductqueryShop()
|
||||
}
|
||||
@@ -166,51 +176,17 @@ export const productStore = defineStore('product', {
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
// #ifdef H5
|
||||
if (uni.cache.get('tableCode')) {
|
||||
let data = await this.actionsproductqueryShop()
|
||||
// -4请求登录
|
||||
const store = Storelogin()
|
||||
if (data.code == '-4') {
|
||||
if (await store.actionslogin()) {
|
||||
// 成功 接着在调用
|
||||
await this.actionsproductqueryShop()
|
||||
}
|
||||
}
|
||||
// idle-空闲 using-使用中 subscribe预定,closed--关台, opening 开台中,cleaning 台桌清理中
|
||||
if (uni.cache.get('shopTable').status == 'cleaning' || uni.cache.get(
|
||||
'shopTable').status == 'cleaning') {
|
||||
uni.showToast({
|
||||
title: '此台桌暂不可用...',
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/product/choosetable'
|
||||
});
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: '/pages/product/index'
|
||||
});
|
||||
// uni.pro.navigateTo('product/index', {
|
||||
// tableCode: uni.cache.get('tableCode'),
|
||||
// })
|
||||
}
|
||||
|
||||
}
|
||||
// #endif
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
// /通过桌码获取当前店铺信息
|
||||
actionsproductqueryShop() {
|
||||
actionsproductqueryShop(tableCode) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
// try {
|
||||
|
||||
let res = await APIproductqueryShop({
|
||||
tableCode: uni.cache.get('tableCode'),
|
||||
tableCode: tableCode?tableCode:uni.cache.get('tableCode'),
|
||||
})
|
||||
res.shopInfo.isVip = res.vip ? '1' : '0'
|
||||
res.shopTable.shopExtendMap = res.shopExtendMap
|
||||
|
||||
Reference in New Issue
Block a user