第1个回答 2017-12-13
<view>
<image src='{{upload}}' mode='widthFix' bindtap='uploadImg'></image>
</view>
js
page({
data:{
uploadImg:'',
}
uploadImg:function(){
var that = this
wx.chooseImage({
count: 1,//表示只能穿一张
that.setData({
uploadImg: res.tempFilePaths,
})
})
}
})
//可以拍照 也可上传图片