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

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

}