提交代码

This commit is contained in:
duan
2024-06-07 15:55:12 +08:00
parent 4ab5b59d7f
commit c8633827cc
4 changed files with 22 additions and 17 deletions

View File

@@ -133,7 +133,7 @@
onLoad(e) {
console.log(e)
console.log(e,'调试1')
try {
this.types = e.types
} catch (e) {
@@ -348,7 +348,6 @@
url: '/pages/order_food/order_food'
});
} else {
// uni.cache.set('shopUser', res.data.shopUser);
uni.pro.switchTab('index/index')
}
}

View File

@@ -230,17 +230,22 @@
},
onUnload() {
uni.switchTab({
url: '/pages/order/order'
})
uni.$off('getMessage')
this.ispws = false
},
onLoad(e) {
this.listinfo = JSON.parse(e.tablelist)
// 获取余额
// this.getAount()
// 获取用户信息,判断是否设置支付密码
this.getuserinfo()
},
onShow() {
// this.$store.dispatch("set_shopid"); //获取shapid
this.getAount()
@@ -300,20 +305,20 @@
}
},
handlemessage() {
console.log(this.socketTicket,'detail页面')
console.log(this.socketTicket, 'detail页面')
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
// this.socketTicket = new webSocketUtils(
// `${uni.conf.baseUrlwws}/websocket/table/${uni.cache.get('tableCode')}/${uni.cache.get('shopUser')}/${uni.cache.get('userInfo').id}`,
// 5000)
this.socketTicket = new webSocketUtils(
`${uni.conf.baseUrlwws}`,
5000, {
tableId: uni.cache.get('tableCode'),
shopId: uni.cache.get('shopUser'),
userId: uni.cache.get('userInfo').id,
"type": "connect",
})
this.socketTicket = new webSocketUtils(
`${uni.conf.baseUrlwws}`,
5000, {
tableId: uni.cache.get('tableCode'),
shopId: uni.cache.get('shopUser'),
userId: uni.cache.get('userInfo').id,
"type": "connect",
})
},
// 数据处理

View File

@@ -60,7 +60,7 @@
</view>
<view class="shop-item" v-for="(item1,index1) in item.products" :key="item1.id">
<view class="cover" style="width:180rpx; height: 180rpx;">
<c-image :src="`${item1.coverImg}?x-oss-process=image/resize,m_lfit,w_180,h_180`"
<c-image :src="`${item1.coverImg}?x-oss-process=image/resize,m_lfit,w_90,h_90`"
width="180" height="180"></c-image>
</view>
<view class="info " style="display: flex;flex-direction: column;justify-content: center;">
@@ -312,6 +312,7 @@
// }
// });
// setTimeout()
this.handlemessage()
setTimeout(() => {
console.log('调试1')
if (uni.cache.get('token') && uni.cache.get('tableCode')) {
@@ -330,6 +331,7 @@
console.log(time, '时间戳')
uni.cache.set('shopUser', res.data)
this.handlemessage()
this.productqueryProduct() //list 数据
} else {
setTimeout(() => {
uni.pro.switchTab('index/index')
@@ -429,7 +431,7 @@
}
},
handlemessage() {
// this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
// this.socketTicket = new webSocketUtils(
// `${uni.conf.baseUrlwws}/websocket/table?tableId=${uni.cache.get('tableCode')}&shopId=${uni.cache.get('shopUser')}&userId=${uni.cache.get('userInfo').id}`,
// 5000)