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

}