会员列表,详情,充值,订单列表
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
import {
|
||||
APIproductqueryShop,
|
||||
APIshopUserInfo
|
||||
} from '@/common/api/product/product.js'
|
||||
} from '@/common/api/member.js'
|
||||
export const Storelogin = defineStore('login', {
|
||||
state: () => ({
|
||||
token: '',
|
||||
@@ -40,11 +40,7 @@ export const Storelogin = defineStore('login', {
|
||||
.miniAppOpenId
|
||||
this.userInfo = res.userInfo
|
||||
uni.cache.set('token', res.token);
|
||||
uni.cache.set('openId', res
|
||||
.userInfo
|
||||
.wechatOpenId)
|
||||
uni.cache.set('userInfo', res
|
||||
.userInfo);
|
||||
uni.cache.set('userInfo', res.userInfo);
|
||||
}
|
||||
resolve(true);
|
||||
},
|
||||
@@ -120,17 +116,8 @@ export const productStore = defineStore('product', {
|
||||
await this.actionsproductqueryShop()
|
||||
}
|
||||
}
|
||||
if (uni.cache.get('productInfo')
|
||||
.shopTableInfo && !uni
|
||||
.cache.get('productInfo')
|
||||
.shopTableInfo
|
||||
.choseCount) {
|
||||
uni.pro.navigateTo(
|
||||
'/pagesOrder/orderAMeal/index', {
|
||||
tableCode: tableCode,
|
||||
shopId: uni.cache.get(
|
||||
'shopId'),
|
||||
})
|
||||
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
||||
uni.pro.navigateTo('product/choosetable')
|
||||
} else {
|
||||
uni.pro.navigateTo(
|
||||
'product/index', {
|
||||
@@ -141,7 +128,6 @@ export const productStore = defineStore('product', {
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(111)
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
@@ -157,12 +143,16 @@ export const productStore = defineStore('product', {
|
||||
await this.actionsproductqueryShop()
|
||||
}
|
||||
}
|
||||
if (uni.cache.get('productInfo').shopTableInfo && !uni
|
||||
.cache.get('productInfo').shopTableInfo.choseCount) {
|
||||
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
||||
tableCode: uni.cache.get('tableCode'),
|
||||
shopId: uni.cache.get('shopId'),
|
||||
if (uni.cache.get('shopTable').status != 'idle') {
|
||||
uni.showToast({
|
||||
title: '此台桌暂不可用...',
|
||||
icon: 'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
||||
uni.pro.navigateTo('product/choosetable')
|
||||
} else {
|
||||
uni.pro.navigateTo('product/index', {
|
||||
tableCode: uni.cache.get('tableCode'),
|
||||
@@ -181,13 +171,16 @@ export const productStore = defineStore('product', {
|
||||
let res = await APIproductqueryShop({
|
||||
tableCode: uni.cache.get('tableCode'),
|
||||
})
|
||||
res.shopInfo.isVip = res.vip ? '1' : '0'
|
||||
res.shopTable.shopExtendMap = res.shopExtendMap
|
||||
// 店铺信息
|
||||
uni.cache.set('shopTable', res.shopTable)
|
||||
// 台桌信息
|
||||
uni.cache.set('shopInfo', res.shopInfo)
|
||||
uni.cache.set('shopId', res.shopTable.shopId)
|
||||
// 当前用户距离店铺的米数
|
||||
uni.cache.set('distance', res.distance)
|
||||
uni.cache.set('distance', res.distance,5000)
|
||||
|
||||
resolve(res)
|
||||
} catch (e) {
|
||||
reject(false)
|
||||
@@ -200,11 +193,9 @@ export const productStore = defineStore('product', {
|
||||
actionsproductqueryProduct() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
let res = await APIshopUserInfo({
|
||||
"shopId": uni.cache.get('shopId'),
|
||||
"userId": uni.cache.get('userInfo').id
|
||||
})
|
||||
uni.cache.set('ShopUser', res)
|
||||
let res = await APIshopUserInfo()
|
||||
// uni.cache.set('ShopUser', res)
|
||||
uni.cache.set('userInfo', res);
|
||||
resolve(true)
|
||||
} catch (e) {
|
||||
reject(false)
|
||||
@@ -217,8 +208,12 @@ export const productStore = defineStore('product', {
|
||||
actionsAPIuser() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
let res = await APIuser()
|
||||
uni.cache.set('userInfo', res);
|
||||
if (uni.cache.get('shopId')) {
|
||||
this.actionsproductqueryProduct()
|
||||
} else {
|
||||
let res = await APIuser()
|
||||
uni.cache.set('userInfo', res);
|
||||
}
|
||||
resolve(true)
|
||||
} catch (e) {
|
||||
reject(false)
|
||||
|
||||
Reference in New Issue
Block a user