lhl 2e67abb7d5 11-5 4 年之前
..
DateTimePicker e034bc7b8c 10-6-myfu 4 年之前
Sansnn-uQRCode 52736e5588 create 4 年之前
js_sdk 52736e5588 create 4 年之前
jyf-parser 52736e5588 create 4 年之前
lb-picker e034bc7b8c 10-6-myfu 4 年之前
lime-painter 52736e5588 create 4 年之前
more 52736e5588 create 4 年之前
poiuy-uImgUpload 52736e5588 create 4 年之前
shmily-drag-image 52736e5588 create 4 年之前
ss-calendar 52736e5588 create 4 年之前
tki-qrcode 52736e5588 create 4 年之前
top-title 2e67abb7d5 11-5 4 年之前
uni-badge 52736e5588 create 4 年之前
uni-countdown 52736e5588 create 4 年之前
uni-icons 52736e5588 create 4 年之前
uni-list 52736e5588 create 4 年之前
uni-list-item 52736e5588 create 4 年之前
uni-load-more 52736e5588 create 4 年之前
uni-nav-bar 52736e5588 create 4 年之前
uni-notice-bar 52736e5588 create 4 年之前
uni-popup 52736e5588 create 4 年之前
uni-search-bar 52736e5588 create 4 年之前
uni-status-bar 52736e5588 create 4 年之前
uni-swipe-action 52736e5588 create 4 年之前
uni-swipe-action-item 52736e5588 create 4 年之前
uni-tag 52736e5588 create 4 年之前
uni-transition 52736e5588 create 4 年之前
w-picker 52736e5588 create 4 年之前
wangding-pickerAddress 52736e5588 create 4 年之前
wangding-pickerAddressindex 52736e5588 create 4 年之前
xw-empty 52736e5588 create 4 年之前
zhilin-picker 52736e5588 create 4 年之前
zhtx-uploadImg 52736e5588 create 4 年之前
.DS_Store 52736e5588 create 4 年之前
README.md 52736e5588 create 4 年之前
empty.vue 52736e5588 create 4 年之前
espempty.vue 2e67abb7d5 11-5 4 年之前
jyf-parser(1).zip 52736e5588 create 4 年之前
newOne.vue 52736e5588 create 4 年之前
permission.js 52736e5588 create 4 年之前
share.vue 52736e5588 create 4 年之前
uni-number-box.vue 52736e5588 create 4 年之前
upload-image.vue 52736e5588 create 4 年之前
upload-images.vue 52736e5588 create 4 年之前

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

}