计算购物车钱之前
This commit is contained in:
@@ -14,15 +14,12 @@
|
||||
defineProps
|
||||
} from 'vue';
|
||||
import {
|
||||
APIproductqueryShop
|
||||
} from "@/common/api/product/product.js";
|
||||
import {
|
||||
Storelogin
|
||||
} from '@/stores/share.js';
|
||||
productStore
|
||||
} from '@/stores/user.js';
|
||||
const props = defineProps({
|
||||
district: Array
|
||||
});
|
||||
const clickdistrict = (item) => {
|
||||
const clickdistrict = async (item) => {
|
||||
switch (item.jumpType) {
|
||||
case 'absolute':
|
||||
uni.pro.navigateTo('webview/webview', {
|
||||
@@ -36,47 +33,13 @@
|
||||
uni.pro.navigateTo(item.absUrl);
|
||||
break;
|
||||
case 'scan':
|
||||
// #ifndef H5
|
||||
if (!uni.utils.pluschooseImage()) {
|
||||
return false
|
||||
}
|
||||
// #ifdef APP || MP-WEIXIN || MP-ALIPAY
|
||||
uni.scanCode({
|
||||
success: async (res) => {
|
||||
let tableCode = getQueryString(decodeURIComponent(res.result), 'code')
|
||||
uni.cache.set('tableCode', tableCode)
|
||||
if (tableCode) {
|
||||
let data = await APIproductqueryShop({
|
||||
code: uni.cache.get('tableCode'),
|
||||
})
|
||||
// -4请求登录
|
||||
const store = Storelogin();
|
||||
if (data.code == '-4') {
|
||||
if (await store.actionslogin()) {
|
||||
// 成功
|
||||
} else {
|
||||
// 失败接着请求
|
||||
await store.actionslogin()
|
||||
}
|
||||
}
|
||||
if (data.data.shopTableInfo && !data.data.shopTableInfo.choseCount) {
|
||||
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
||||
tableCode: tableCode,
|
||||
shopId: data.data.storeInfo.id,
|
||||
})
|
||||
} else {
|
||||
uni.pro.navigateTo('order_food/order_food', {
|
||||
tableCode: tableCode,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
const store = productStore();
|
||||
await store.scanCodeactions()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user