执行顺序
This commit is contained in:
@@ -274,17 +274,16 @@
|
||||
this.countScrollTitle(e.scrollTop);
|
||||
},
|
||||
onLoad(e) {
|
||||
if (!uni.cache.get('token') && uni.cache.get('tableCode')) {
|
||||
if (e.q) {
|
||||
this.tableCode = this.getQueryString(decodeURIComponent(e.q), 'code')
|
||||
uni.cache.set('tableCode', this.tableCode)
|
||||
}
|
||||
if (!uni.cache.get('token')) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login?types=' + 0
|
||||
});
|
||||
return false
|
||||
}
|
||||
if (e.q) {
|
||||
let tableCode = this.getQueryString(decodeURIComponent(e.q), 'code')
|
||||
uni.cache.set('tableCode', tableCode)
|
||||
}
|
||||
this.productqueryShopIdByTableCode() //获取shop User id
|
||||
uni.$on('message', this.getMessage)
|
||||
this.$nextTick(() => {
|
||||
this.countTitleTopNum(); //导航栏
|
||||
@@ -302,14 +301,15 @@
|
||||
uni.$off('message')
|
||||
},
|
||||
onShow() {
|
||||
|
||||
|
||||
if (uni.cache.get('token')) {
|
||||
this.productqueryShopIdByTableCode() //获取shop User id
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 单独获取他的shopUserid
|
||||
async productqueryShopIdByTableCode() {
|
||||
let res = await this.api.productqueryShopIdByTableCode({
|
||||
code: uni.cache.get('tableCode')
|
||||
code: this.tableCode
|
||||
})
|
||||
if (res.code == 0) {
|
||||
let time = new Date
|
||||
@@ -339,7 +339,6 @@
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
wx.hideLoading()
|
||||
switch (msg.type) {
|
||||
case 'sku': // sku 数量
|
||||
this.$set(this, 'amountcartNumber', msg.amount)
|
||||
@@ -407,10 +406,6 @@
|
||||
}
|
||||
},
|
||||
handlemessage() {
|
||||
wx.showLoading({
|
||||
title: '',
|
||||
})
|
||||
|
||||
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
||||
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
||||
tableId: uni.cache.get('tableCode'),
|
||||
|
||||
Reference in New Issue
Block a user