优化问题

This commit is contained in:
duan
2024-06-05 15:47:04 +08:00
parent bdd5a6a325
commit ba106d1f96
8 changed files with 48 additions and 25 deletions

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" width="180" height="180"></c-image>
<c-image :src="`${item1.coverImg}?x-oss-process=image/resize,m_lfit,w_180,h_180`" width="180" height="180"></c-image>
</view>
<view class="info " style="display: flex;flex-direction: column;justify-content: center;">
<view class="name">
@@ -272,7 +272,7 @@
}
this.countScrollTitle(e.scrollTop);
},
onLoad(e) {
onLoad(e) {
if (e.q) {
let tableCode = this.getQueryString(decodeURIComponent(e.q), 'code')
uni.cache.set('tableCode', tableCode)
@@ -280,7 +280,7 @@
}
if (!uni.cache.get('token') && uni.cache.get('tableCode')) {
uni.reLaunch({
url: '/pages/login/login?type=' + 0
url: '/pages/login/login?types=' + 0
});
}
uni.$on('message', this.getMessage)
@@ -292,10 +292,16 @@
this.socketSendMsg({ //定义socket数据传参
"type": "close", //“addcart:添加购物车create0rder:生成订单clearCart:庆康购物车”,
})
console.log(this.socketTicket, '关闭长连接')
this.socketTicket.Close()
uni.$off('message')
},
onShow() {
// console.log(this.socketTicket,'进入页面')
// if (this.socketTicket) {
// this.socketTicket.Close()
// uni.$off('message')
// }
// uni.onNetworkStatusChange((res) => { //监听网络状态变化
// if (!res.isConnected) {
// // 检查网络是否连接
@@ -305,6 +311,7 @@
// }
// });
setTimeout(() => {
console.log('调试1')
if (uni.cache.get('token') && uni.cache.get('tableCode')) {
this.productqueryShopIdByTableCode() //获取shop User id
}
@@ -392,7 +399,7 @@
msg.data.forEach((item, index, arr) => { //初始化skuidname的数据 选择第一个
if (item.skuId == this.skuidsearch) {
nums = item.number
}
}
// else {
// this.$set(this, 'amountcartNumber', 0)
// }
@@ -530,7 +537,7 @@
return res
})
this.specifications.tagSnap.forEach((val, index, arr) => { //初始化skuidname的数据 选择第一个
console.log(val.children[0],'skuidnam是否为空1')
console.log(val.children[0], 'skuidnam是否为空1')
this.skuidname.push(val.children[0])
})
try {
@@ -543,7 +550,7 @@
}
},
async morloe(e, index, index1, item) {
console.log(index,'skuidnam是否为空2')
console.log(index, 'skuidnam是否为空2')
this.specifications.tagSnap[index]['start'] = index1
this.skuidname.splice(index, 1, e) //替换skuidname的数据
this.hodgepodge(item, 2)
@@ -607,6 +614,7 @@
"shopId": uni.cache.get('shopUser'),
"userId": uni.cache.get('userInfo').id,
}
this.$store.dispatch("set_shopid"); //获取shapid
uni.$u.debounce(this.socketSendMsg(data), 500)
},
orderfoodindex() {