From 632542515afd8c2ac2c7d2c7f14ada8ba48d288b Mon Sep 17 00:00:00 2001 From: gooking Date: Tue, 10 Nov 2020 23:54:35 +0800 Subject: [PATCH] =?UTF-8?q?fixed=E7=9B=B4=E8=BE=96=E5=B8=82=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E5=BE=AE=E4=BF=A1=E6=94=B6=E8=B4=A7=E5=9C=B0=E5=9D=80?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.js | 4 ++-- pages/address-add/index.js | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/config.js b/config.js index f7e68985..915510e0 100644 --- a/config.js +++ b/config.js @@ -1,6 +1,6 @@ module.exports = { - version: '8.20.0', - note: '支持下单强制需要用户进行实名认证', // 这个为版本描述,无需修改 + version: '8.20.1', + note: 'fixed直辖市读取微信收货地址bug', // 这个为版本描述,无需修改 subDomain: 'tz', // 此处改成你自己的专属域名。什么是专属域名?请看教程 https://www.it120.cc/help/qr6l4m.html goodsDetailSkuShowType: 0, // 0 为点击立即购买按钮后出现规格尺寸、数量的选择; 1为直接在商品详情页面显示规格尺寸、数量的选择,而不弹框 shopMod: 0, // 0为单店铺版本 ; 1为多店铺版本 diff --git a/pages/address-add/index.js b/pages/address-add/index.js index de434044..303e4b03 100644 --- a/pages/address-add/index.js +++ b/pages/address-add/index.js @@ -226,7 +226,17 @@ Page({ let that = this; wx.chooseAddress({ success: function (res) { - console.log(res) + // res = { + // cityName: '上海市', + // countyName: '嘉定区', + // detailInfo: '惠民路123号', + // errMsg: 'chooseAddress.ok', + // nationalCode: '310114', + // postalCode: '201800', + // provinceName: '上海市', + // telNumber: '13500000000', + // userName: '测试', + // } const provinceName = res.provinceName; const cityName = res.cityName; const diatrictName = res.countyName; @@ -242,9 +252,12 @@ Page({ } that.provinceChange(e, 0, 0).then(() => { // 读取市 - const cIndex = that.data.cities.findIndex(ele => { + let cIndex = that.data.cities.findIndex(ele => { return ele.name == cityName }) + if (cIndex == -1) { + cIndex = 1 // 兼容直辖市 + } if (cIndex != -1) { const e = { detail: {