Skip to content

Commit

Permalink
fixed直辖市读取微信收货地址bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gooking committed Nov 10, 2020
1 parent 95ad16d commit 6325425
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
@@ -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为多店铺版本
Expand Down
17 changes: 15 additions & 2 deletions pages/address-add/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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: {
Expand Down

1 comment on commit 6325425

@solve-ok
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么在手机上微信小程序加载不出来?

Please sign in to comment.