wxml:
<view class="uPic">
<view class="tit">头像:</view>
<view class=""><image src="{{imageList}}" class="uPicimg" mode="scaleToFill" bindtap="chooseImg"></image></view>
</view>
wxss:此处省略样式代码!!!!
js:
chooseImg:function () {
var that = this
wx.chooseImage({
sourceType: sourceType[this.data.sourceTypeIndex],
sizeType: sizeType[this.data.sizeTypeIndex],
success: function(res) {
var tempFilePaths = res.tempFilePaths[0]
console.log(res.tempFilePaths)
that.setData({imageList: res.tempFilePaths[0]})
}
})
},