<picker bindchange="bindPickerChange2" data-id="{{objectArray[objectIndex].id}}" value="{{objectIndex}}" range="{{objectArray}}" range-key="name">
<view class="picker">
<view class="pick2" style="display:flex;flex:1;">
<view style="flex:1;text-align:left;padding-left:20rpx;">{{objectArray[objectIndex].name}}</view>
<view style="flex:1;text-align:right;padding-right:20rpx;">
<image src="image/bottom.png" style="width:20rpx;height:20rpx;"></image>
</view>
</view>
</view>
</picker>
bindPickerChange2: function (e) {
console.log(e);
console.log(e.currentTarget.dataset.id);
// console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
objectIndex: e.detail.value
})
},
.pick2{
flex:1;
text-align: center;
height:90rpx;
font-size:25rpx;
line-height:90rpx;
background:rgb(242,242,242);
margin-left:20rpx;
margin-right:20rpx;
border-radius:10rpx;
}