From 36ef5bd6136dfa70d32eadf024428c792aec4bf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com>
Date: Tue, 28 May 2024 14:06:16 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=98=B2=E6=8A=96=20=20?=
=?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=B4=AD=E7=89=A9=E8=BD=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/index/components/diamond.vue | 6 ++----
pages/login/login.vue | 22 +++++++++-------------
pages/order_detail/order_detail.vue | 6 +-----
pages/order_food/order_food.vue | 28 ++++++++++++++--------------
4 files changed, 26 insertions(+), 36 deletions(-)
diff --git a/pages/index/components/diamond.vue b/pages/index/components/diamond.vue
index 3efb8a6..dbcb39a 100644
--- a/pages/index/components/diamond.vue
+++ b/pages/index/components/diamond.vue
@@ -52,11 +52,9 @@
uni.scanCode({
success: (res) => {
let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
- uni.cache.set('tableCode', this.tableCode)
+ uni.cache.set('tableCode', tableCode)
if (tableCode) {
- uni.pro.navigateTo('order_food/order_food', {
- tableCode: tableCode,
- })
+ uni.pro.navigateTo('order_food/order_food')
}
}
});
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 2835a7f..9858c35 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -34,10 +34,10 @@
-
+
@@ -150,7 +150,6 @@
this.agreeShow = false;
},
blurinput(e) {
- console.log(e);
uni.conf.baseUrl = e;
this.baseUrl = e;
this.showpopup = false;
@@ -235,7 +234,6 @@
}
},
rightClick() {
- console.log(11);
uni.switchTab({
url: '/pages/device_shop/index'
});
@@ -269,13 +267,13 @@
});
return false;
}
- if (this.radioChangeItem == false) {
- uni.showToast({
- icon: 'none',
- title: '请先阅读《用户协议》和《隐私政策》'
- });
- return;
- }
+ // if (this.radioChangeItem == false) {
+ // uni.showToast({
+ // icon: 'none',
+ // title: '请先阅读《用户协议》和《隐私政策》'
+ // });
+ // return;
+ // }
let res = await this.api.loginapplogin({
username: this.form.loginName,
password: this.form.password,
@@ -352,11 +350,9 @@
}
},
fail: (err) => {
- console.log(err)
}
});
} catch (e) {
- console.log(e)
}
}
});
diff --git a/pages/order_detail/order_detail.vue b/pages/order_detail/order_detail.vue
index 98750d2..c9d01b0 100644
--- a/pages/order_detail/order_detail.vue
+++ b/pages/order_detail/order_detail.vue
@@ -171,7 +171,7 @@
以优惠¥{{emitorderfoodform.couponsPrice}}
-
+
立即付款
@@ -336,10 +336,6 @@
orderId: this.listinfoid
})
},
- // 防抖去结算
- shopEvent(){
- uni.$u.throttle(this.showpopupclick, 500)
- },
// 去结算
showpopupclick() {
if (this.numValue == 0) {
diff --git a/pages/order_food/order_food.vue b/pages/order_food/order_food.vue
index 94db7b7..b64ea8d 100644
--- a/pages/order_food/order_food.vue
+++ b/pages/order_food/order_food.vue
@@ -274,21 +274,21 @@
},
async onLoad(e) {
if (e.q) {
- this.tableCode = this.getQueryString(decodeURIComponent(e.q), 'code')
- uni.cache.set('tableCode', this.tableCode)
+ let tableCode = this.getQueryString(decodeURIComponent(e.q), 'code')
+ uni.cache.set('tableCode', tableCode)
// this.scanCodehandle()
- uni.pro.navigateTo('login/login', {
- type: 0
- })
- } else {
- this.tableCode = uni.cache.get('tableCode')
- this.productqueryShopIdByTableCode() //获取shop User id
}
-
+ if (!uni.cache.get('token') && uni.cache.get('tableCode')) {
+ uni.reLaunch({
+ url: '/pages/login/login?type=' + 0
+ });
+ // uni.pro.navigateTo('login/login', {
+ // type: 0
+ // })
+ }
uni.$on('message', this.getMessage)
-
this.$nextTick(() => {
- this.countTitleTopNum();
+ this.countTitleTopNum(); //导航栏
});
},
onUnload() {
@@ -296,7 +296,7 @@
uni.$off('message')
},
onShow() {
- if (uni.cache.get('token')) {
+ if (uni.cache.get('token') && uni.cache.get('tableCode')) {
this.productqueryShopIdByTableCode() //获取shop User id
}
},
@@ -429,7 +429,7 @@
uni.cache.set('miniAppOpenId', res.data.userInfo
.miniAppOpenId)
uni.cache.set('userInfo', res.data.userInfo);
- this.productqueryShopIdByTableCode()//获取shop User id
+ this.productqueryShopIdByTableCode() //获取shop User id
}
},
fail: (err) => {
@@ -479,7 +479,7 @@
},
async productqueryProduct() { //list 数据
let res = await this.api.productqueryProduct({
- code:uni.cache.get('tableCode'),
+ code: uni.cache.get('tableCode'),
productGroupId: ''
})
if (res.code == 0) {