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

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

}