小程序点击添加图片


 

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]})
}
})
},

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM