lhl 561548437c 5-6-1 6 months ago
..
DateTimePicker 561548437c 5-6-1 6 months ago
Sansnn-uQRCode 561548437c 5-6-1 6 months ago
js_sdk 561548437c 5-6-1 6 months ago
jyf-parser 561548437c 5-6-1 6 months ago
lb-picker 561548437c 5-6-1 6 months ago
lime-painter 561548437c 5-6-1 6 months ago
more 561548437c 5-6-1 6 months ago
poiuy-uImgUpload 561548437c 5-6-1 6 months ago
shmily-drag-image 561548437c 5-6-1 6 months ago
ss-calendar 561548437c 5-6-1 6 months ago
tki-qrcode 561548437c 5-6-1 6 months ago
top-title 561548437c 5-6-1 6 months ago
uni-badge 561548437c 5-6-1 6 months ago
uni-countdown 561548437c 5-6-1 6 months ago
uni-icons 561548437c 5-6-1 6 months ago
uni-list 561548437c 5-6-1 6 months ago
uni-list-item 561548437c 5-6-1 6 months ago
uni-load-more 561548437c 5-6-1 6 months ago
uni-nav-bar 561548437c 5-6-1 6 months ago
uni-notice-bar 561548437c 5-6-1 6 months ago
uni-popup 561548437c 5-6-1 6 months ago
uni-search-bar 561548437c 5-6-1 6 months ago
uni-status-bar 561548437c 5-6-1 6 months ago
uni-swipe-action 561548437c 5-6-1 6 months ago
uni-swipe-action-item 561548437c 5-6-1 6 months ago
uni-tag 561548437c 5-6-1 6 months ago
uni-transition 561548437c 5-6-1 6 months ago
w-picker 561548437c 5-6-1 6 months ago
wangding-pickerAddress 561548437c 5-6-1 6 months ago
wangding-pickerAddressindex 561548437c 5-6-1 6 months ago
xw-empty 561548437c 5-6-1 6 months ago
zhilin-picker 561548437c 5-6-1 6 months ago
zhtx-uploadImg 561548437c 5-6-1 6 months ago
README.md 561548437c 5-6-1 6 months ago
empty.vue 561548437c 5-6-1 6 months ago
espempty.vue 561548437c 5-6-1 6 months ago
jyf-parser(1).zip 561548437c 5-6-1 6 months ago
newOne.vue 561548437c 5-6-1 6 months ago
permission.js 561548437c 5-6-1 6 months ago
share.vue 561548437c 5-6-1 6 months ago
uni-number-box.vue 561548437c 5-6-1 6 months ago
upload-image.vue 561548437c 5-6-1 6 months ago
upload-images.vue 561548437c 5-6-1 6 months 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
		}
	})

}