picker多列选择器ios端显示异常 未找出原因
wxml代码
<picker mode="multiSelector" bindchange="pickAreaChange" bindcolumnchange="pickAreaColumn" value="{{areaIndex}}" range="{{pickArea}}">
<view class="section">
<view class="section-title">常驻地址</view>
<input class="section-form-item" name="area"
value="{{pickArea[0][areaIndex[0]]}}{{pickArea[1][areaIndex[1]]}}" placeholder="请选择省市" placeholder-class="placeholder" disabled />
</view>
</picker>
js代码
onLoad: function (options) {
wx.showLoading({
title: '加载中...',
})
let address1 = wx.getStorageSync('User').provinceName,
address2 = wx.getStorageSync('User').cityName;
if(address1&&address2){
//循环省数组 判断用户信息里的省份
for(let i=0;i<province.length;i++){
if(province[i] === address1){
//获取到对应省份后 取出对应省份的市区数据
let thiscity = ((util.city || []).filter(v => { return v.parent_code == util.province[i].code }) || []).map(v => {
return v.title
})
for(let index=0;index<thiscity.length;index++){
if(thiscity[index]===address2){
this.setData({
areaIndex:[i,index],
pickArea:[province,thiscity]
})
break;
}
}
console.log(thiscity,'<==thiscity=','=index==>',this.data.areaIndex)
break;
}
}
}else{
this.setData({
pickArea:[province,city]
})
}
//初始化p_c
this.setData({
user:wx.getStorageSync('User'),
wechatNickname:wx.getStorageSync('User').wechatNickname,
realName:wx.getStorageSync('User').realName,
phoneNo:wx.getStorageSync('User').phoneNo,
labelI:wx.getStorageSync('User').accountJob,
sexIndex:wx.getStorageSync('User').accountSex
})
wx.hideLoading()
},
在onload里判断是否有用户信息的缓存 然后决定选择器内的值
图一ios端的显示异常 图二android端显示正常 网上没找到原因 所以怀疑是微信对ios的兼容性问题
图一: 图二:
1 回复
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。