小程序上传图本地片wx.chooseImage

 

 效果如上图所示

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

 

 

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 撸撸猫 设计师:设计师小姐姐 返回首页