From 979d245dec56e0b6f2816dfb1d7856a0a7d46846 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Thu, 9 Oct 2025 09:06:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E5=B1=85=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- subPackages/foodNew/index.js | 11 +++++++++-- subPackages/foodNew/index.wxml | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index a3a5f26..f8afd78 100644 --- a/app.js +++ b/app.js @@ -38,7 +38,7 @@ App({ // 获取前端配置文件 commonApi._post("pbservice/Other/getClientConfig", {unique_key: "wechatxcx"}).then(res => { let data = JSON.parse(res.data); - data.isTest = data.isTest140? true : false; + data.isTest = data.isTest142? true : false; data.indexSeason = null this.globalData.configJson = data }).then(() => { diff --git a/subPackages/foodNew/index.js b/subPackages/foodNew/index.js index 75f2b02..aa44650 100644 --- a/subPackages/foodNew/index.js +++ b/subPackages/foodNew/index.js @@ -49,6 +49,8 @@ Page({ lon: null, lat: null, scrollLeft: 0, + scrollDom: "", + scrollDomLeft:0, windowWidth: 375, prod_phone: "", }, @@ -128,10 +130,15 @@ Page({ console.log(rect) if (rect) { let targetScrollLeft = rect.left + (rect.width / 2) - (windowWidth / 2)+_this.data.scrollLeft; - console.log(e, targetScrollLeft) + console.log((rect.width / 2) - (windowWidth / 2)) this.setData({ - scrollLeft: targetScrollLeft + scrollLeft: targetScrollLeft||0, + scrollDomLeft: (rect.width / 2) - (windowWidth / 2), + }); + this.setData({ + scrollDom: domId, + }) } }).exec() diff --git a/subPackages/foodNew/index.wxml b/subPackages/foodNew/index.wxml index 81a0aef..46f0ced 100644 --- a/subPackages/foodNew/index.wxml +++ b/subPackages/foodNew/index.wxml @@ -19,7 +19,9 @@ -