瀏覽代碼

上传组件

彭宇 1 年之前
父節點
當前提交
1d7fe28e5c
共有 2 個文件被更改,包括 3 次插入4 次删除
  1. 1 3
      components/upload/index.vue
  2. 2 1
      plugins/modal.js

+ 1 - 3
components/upload/index.vue

@@ -6,7 +6,7 @@
              style="width: 200rpx; height: 150rpx; margin: 0 12rpx; " @click="choose()"></image>
       <view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
         <view
-            v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.picUrl.substring(item.picUrl.length-4)=='jpeg' ">
+            v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'|| item.substring(item.length-4)=='jpeg' ">
           <image :src="loadImgSrcLocalhost(item)" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
                  @click="showPhoto(index)">
           </image>
@@ -105,7 +105,6 @@ export default {
               formData: {},
               header: _this.headers,
               success: res => {
-				  debugger
                 // 判断是否json字符串,将其转为json格式
                 let data = JSON.parse(res.data);
                 if (![200].includes(data.code)) {
@@ -130,7 +129,6 @@ export default {
               }
             });
             task.onProgressUpdate(res => {
-				debugger
               _this.progress = res.progress;
               uni.showLoading({
                 title: '上传中'

+ 2 - 1
plugins/modal.js

@@ -3,7 +3,8 @@ export default {
   msg(content) {
     uni.showToast({
       title: content,
-      icon: 'none'
+      icon: 'none',
+      duration: 2000
     })
   },
   // 错误消息