<text class='fs28 c9 ml15'>预约专家</text>
<picker name="u_consultation" bindchange="zhuanjiachange" value="{{index}}" range="{{zjarrs}}">
<view wx:if="{{index == ''}}" class='fs24 c9 ml100'>
请选择要预约的专家
</view>
<view wx:else class="fs26 c6 ml100">
<!-- <view wx:for="{{expert}}" wx:for-item="items"> -->
<!-- {{zjarrs[index]}} -->
<input name="u_consultation" value='{{zjarrs[index]}}' disabled='true'/>
<!-- </view> -->
</view>
</picker>
js文件
onload(){
that.bindPickerChange();
}
bindPickerChange: function (e) {
var that =this;
app.util.request({
'url': "entry/wxapp/YuZhuanjia",
success:function(e){
var arrs = e.data.data;
var zjarrs = [];
for (var i = 0; i < arrs.length;i++){
zjarrs.push(arrs[i].z_name);
}
that.setData({
expert: e.data.data,
zjarrs: zjarrs
})
}
})
},
zhuanjiachange:function(e){
console.log('picker发送选择改变,携带值为', e.detail.value)
console.log(this.data.expert);
this.setData({
index:e.detail.value
})
},