From 8e60f59b19f5eca3e5017aac354636715da8016f Mon Sep 17 00:00:00 2001 From: itgaojian163 Date: Fri, 20 Jun 2025 18:06:24 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D,=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=97=B6=E7=9C=81=E5=B8=82=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- net/mainUrl.js | 4 +- .../shop/publishCopyright/publishCopyright.js | 63 +++++++------------ 2 files changed, 26 insertions(+), 41 deletions(-) diff --git a/net/mainUrl.js b/net/mainUrl.js index 645d3bd..4a2477b 100644 --- a/net/mainUrl.js +++ b/net/mainUrl.js @@ -1,6 +1,6 @@ // 定义api服务地址 -const appUrl = 'https://www.aimzhu.com' -// const appUrl = 'http://121.36.71.250:58038' +// const appUrl = 'https://www.aimzhu.com' +const appUrl = 'http://121.36.71.250:58038' const prewBaseUrl = '' const operatorUrl = appUrl + '/operator' const operatorPlug = appUrl + '/operator-plugin' diff --git a/pages/shop/publishCopyright/publishCopyright.js b/pages/shop/publishCopyright/publishCopyright.js index 9c2bfb0..988ab07 100644 --- a/pages/shop/publishCopyright/publishCopyright.js +++ b/pages/shop/publishCopyright/publishCopyright.js @@ -343,7 +343,7 @@ Page({ selArea: tempSelArea, 'prevValue[0]': tempIndex }) - _self.doGetArea(_self.data.selArea.areaId) + _self.doGetArea(_self.data.selArea.areaId, false) } else { //默认加载第一个area _self.setData({ @@ -351,7 +351,7 @@ Page({ selArea: _self.data.areaList[0], rightType: _self.data.rightType }) - _self.doGetArea(_self.data.selArea.areaId) + _self.doGetArea(_self.data.selArea.areaId, false) } } }) @@ -367,31 +367,8 @@ Page({ }) }, - //获取省 - doGetProvince: function (id) { - wx.showLoading({ - title: '加载中...', - }) - var _self = this - Shop.doGetAreaDetail(id) - .then(function (res) { - wx.hideLoading() - _self.setData({ - selArea: res - }) - _self.doGetArea(_self.data.selArea.areaId) - }) - .catch(function (err) { - wx.hideLoading() - //重置selArea selCity - _self.setData({ - selArea: null, - selCity: null - }) - }) - }, //获取区域 - doGetArea: function (pId) { + doGetArea: function (pId, isChange) { wx.showLoading({ title: '加载中...', }) @@ -404,18 +381,26 @@ Page({ cityList: res }) if (_self.data.goodsId != '') { - var tempCity = null - var tempIndex = 0 - _self.data.cityList.forEach(function (item, index) { - if (_self.data.goods.goodsLeaderCity2 == item.areaId) { - tempCity = item - tempIndex = index - } - }) - _self.setData({ - selCity: tempCity, - 'prevValue[1]': tempIndex - }) + if (isChange) { + //手动滑动 + _self.setData({ + selCity: res[0], + 'prevValue[1]': 0 + }) + } else { + var tempCity = null + var tempIndex = 0 + _self.data.cityList.forEach(function (item, index) { + if (_self.data.goods.goodsLeaderCity2 == item.areaId) { + tempCity = item + tempIndex = index + } + }) + _self.setData({ + selCity: tempCity, + 'prevValue[1]': tempIndex + }) + } } else { _self.setData({ selCity: res[0] @@ -448,7 +433,7 @@ Page({ _self.setData({ selArea: area }) - _self.doGetArea(area.areaId) + _self.doGetArea(area.areaId, true) } else { var city = _self.data.cityList[currentValue[1]] _self.setData({