效果如上图所示
<view class="idcard-upload" bindtap='idcardFan'>
<image src="{
{idfan}}" class="img"></image>
</view>
data: {
idfan:'../image/加号.png',
},
idcardFan:function(e){
var that=this;
wx.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success (res) {
const tempFilePaths = res.tempFilePaths
that.setData({
idfan: tempFilePaths[0]
})
}
})
},