lhl c42e9810fc end 9 mesi fa
..
DateTimePicker c42e9810fc end 9 mesi fa
Sansnn-uQRCode c42e9810fc end 9 mesi fa
js_sdk c42e9810fc end 9 mesi fa
jyf-parser c42e9810fc end 9 mesi fa
lb-picker c42e9810fc end 9 mesi fa
lime-painter c42e9810fc end 9 mesi fa
more c42e9810fc end 9 mesi fa
poiuy-uImgUpload c42e9810fc end 9 mesi fa
shmily-drag-image c42e9810fc end 9 mesi fa
ss-calendar c42e9810fc end 9 mesi fa
tki-qrcode c42e9810fc end 9 mesi fa
top-title c42e9810fc end 9 mesi fa
uni-badge c42e9810fc end 9 mesi fa
uni-countdown c42e9810fc end 9 mesi fa
uni-icons c42e9810fc end 9 mesi fa
uni-list c42e9810fc end 9 mesi fa
uni-list-item c42e9810fc end 9 mesi fa
uni-load-more c42e9810fc end 9 mesi fa
uni-nav-bar c42e9810fc end 9 mesi fa
uni-notice-bar c42e9810fc end 9 mesi fa
uni-popup c42e9810fc end 9 mesi fa
uni-search-bar c42e9810fc end 9 mesi fa
uni-status-bar c42e9810fc end 9 mesi fa
uni-swipe-action c42e9810fc end 9 mesi fa
uni-swipe-action-item c42e9810fc end 9 mesi fa
uni-tag c42e9810fc end 9 mesi fa
uni-transition c42e9810fc end 9 mesi fa
w-picker c42e9810fc end 9 mesi fa
wangding-pickerAddress c42e9810fc end 9 mesi fa
wangding-pickerAddressindex c42e9810fc end 9 mesi fa
xw-empty c42e9810fc end 9 mesi fa
zhilin-picker c42e9810fc end 9 mesi fa
zhtx-uploadImg c42e9810fc end 9 mesi fa
README.md c42e9810fc end 9 mesi fa
empty.vue c42e9810fc end 9 mesi fa
espempty.vue c42e9810fc end 9 mesi fa
jyf-parser(1).zip c42e9810fc end 9 mesi fa
newOne.vue c42e9810fc end 9 mesi fa
permission.js c42e9810fc end 9 mesi fa
share.vue c42e9810fc end 9 mesi fa
uni-number-box.vue c42e9810fc end 9 mesi fa
upload-image.vue c42e9810fc end 9 mesi fa
upload-images.vue c42e9810fc end 9 mesi fa

README.md

插件安装

图片上传组件 将组件放在自己的组件库里导入即可

**注意 1.组件加入后一定要去修改自己的上传路径!
2.自己的上传接口的返回值注意修改 我这边是0! **

导入:

小程序.json 文件里

"usingComponents": {
	"imgUpload":"/component/imgUpload/imgUpload"
  },


属性 attribute

属性名 类型 介绍 默认值
imgArr Array 图片展示列表 []
uploadImgCount Number 一次可选多少张图片 3
imgCount Number 一共可以上传多少张图片 3
imgSize Number 上传图片的大小 2 (M)
closeTip Boolean 关闭小提示 false

方法 method

开始上传图片 在父页面中调用该方法 注意 一定要给组件 id 如下(示范代码)


####示范代码 wxml:

<imgUpload id="imgUpload" imgArr="{{imgArr}}"></imgUpload>
<button bindtap="submit"></button>

*js*:

submit(){

	const imgUpload = this.selectComponent("#imgUpload");
	imgUpload.upload(res=>{
		if(res.code==0){
				// 正常的返回code=0 将回调的线上图片数组 赋值给需要提交的表单里
				// res.urlArray 线上路径图片数组
				//TODO
				
		}else{
			//没有上传图片的返回 code=400
		}
	})

}