From 9ee4ff1f30c22a3b24ab00605fe8b74fd251fe51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Tue, 23 Jul 2024 09:51:48 +0800 Subject: [PATCH 1/3] message --- pages/order_detail/indexs.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/order_detail/indexs.vue b/pages/order_detail/indexs.vue index f13addb..739cddd 100644 --- a/pages/order_detail/indexs.vue +++ b/pages/order_detail/indexs.vue @@ -257,7 +257,7 @@ }, onHide() { this.socketTicket.Close() - uni.$off('message') + uni.$off('getMessage') }, onShow() { uni.$on('message', this.getMessage) From fde34fa1519b4afc5eea2383431cd5f124b407fd Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Wed, 24 Jul 2024 16:58:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix::=E5=95=86=E5=93=81=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E5=88=86=E7=B1=BB=E9=80=89=E4=B8=AD=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/0-conf.js | 1 + pages/order_food/order_food.vue | 29 +++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/framework/0-conf.js b/framework/0-conf.js index 7efb0e0..a9b4c7d 100644 --- a/framework/0-conf.js +++ b/framework/0-conf.js @@ -18,6 +18,7 @@ const baseUrlwws = 'ws://cashier.sxczgkj.cn/cashierService' // #ifdef APP || MP-WEIXIN const baseUrl = debug ? proxyApi : 'https://cashier.sxczgkj.cn/cashierService' // 线上 const baseUrlwws = debug ? proxyApiwws : 'wss://cashier.sxczgkj.cn/netty' // 线上 + // const baseUrl = 'https://cashier.sxczgkj.cn/cashierService' // 线上 // const baseUrlwws = 'wss://cashier.sxczgkj.cn/netty' // 线上/ // #endif diff --git a/pages/order_food/order_food.vue b/pages/order_food/order_food.vue index 271b7bc..74e7620 100644 --- a/pages/order_food/order_food.vue +++ b/pages/order_food/order_food.vue @@ -48,7 +48,7 @@ + :class="{ active: titleTopNumIndex == index }" @click="titleClickHandle(item.id,index)"> {{ item.name }} @@ -267,6 +267,8 @@ showShopInfo: false, showShopsku: false, titleTopNumIndex: 0, + titleTopNumIndexFalg: true, + timer: null, titleTopNums: [], showCart: false, tableCode: '', //code, @@ -300,6 +302,7 @@ backgroundColor: '#000000' }); } + this.countScrollTitle(e.scrollTop); }, onLoad(e) { @@ -424,7 +427,7 @@ break; case 'addcart': this.cartLists = msg - console.log(msg, 1111) + // console.log(msg, 1111) this.productqueryProduct() //list 数据 try { if (msg.data.length != 0) { @@ -452,7 +455,7 @@ } break; } - console.log(this.cartLists.data, 1111111) + // console.log(this.cartLists.data, 1111111) this.cartListsdatashow = this.cartLists.data.length == 0 ? false : true } } catch (e) { @@ -663,7 +666,9 @@ }); }, // 点击菜单商品滚动到指定为止 - titleClickHandle(id) { + titleClickHandle(id,index) { + this.titleTopNumIndexFalg = false; + this.titleTopNumIndex = index; uni.createSelectorQuery() .select('#wrapper') .boundingClientRect((data) => { @@ -686,7 +691,8 @@ }, // 计算滚动到那个标题 countScrollTitle: _.throttle(function(top) { - if (this.titleTopNums.length > 1) { + + if (this.titleTopNums.length > 1 && this.titleTopNumIndexFalg) { for (let i = 0; i <= this.titleTopNums.length - 1; i++) { if (top >= this.titleTopNums[i] && top < this.titleTopNums[i + 1]) { this.titleTopNumIndex = i; @@ -696,6 +702,13 @@ this.titleTopNumIndex = this.titleTopNums.length - 1; } } + //这里必须要每次滚动前 清除一次 + clearTimeout(this.timer) + // 如果停留则表示滚动结束 一旦空了1s就判定为滚动结束 + this.timer = setTimeout(() => { + this.titleTopNumIndexFalg = true; + // console.log('结束滚动') + }, 1000) }, 100), // 统计每个标题到顶部的距离 countTitleTopNum() { @@ -704,9 +717,9 @@ uni.createSelectorQuery() .select(`#title${i.id}`) .boundingClientRect((res) => { - topNums.push(res.top + this.menuInfo.top + this.menuInfo.height + this - .paddingBtmSize - - this.tabHeadHeight - this.tabHeadHeight / 2); + topNums.push(res.top - this.menuInfo.top - this.menuInfo.height - this + .paddingBtmSize*8 - + this.tabHeadHeight + 40); }) .exec(); } From 62f0e6f25ba217756b8f6a97e13483b4ee3d5b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Fri, 26 Jul 2024 11:16:13 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/chooseasong/index.vue | 7 +- pages/index/indexs.vue | 19 +- pages/order_food/goodsList_scroll.vue | 300 ++++++++++++++++++++++---- pages/order_food/order_food.vue | 1 + 4 files changed, 272 insertions(+), 55 deletions(-) diff --git a/pages/chooseasong/index.vue b/pages/chooseasong/index.vue index 508a4ee..8531df7 100644 --- a/pages/chooseasong/index.vue +++ b/pages/chooseasong/index.vue @@ -1,8 +1,7 @@