Kaynağa Gözat

feat:售后

chenqilong 1 yıl önce
ebeveyn
işleme
cc3975d490

+ 19 - 12
src/components/zj-upload/index.vue

@@ -8,14 +8,18 @@
           <view class="mack" @tap.stop="() => {}"></view>
           <image @tap.stop="() => {}" class="uploadImg" mode="aspectFit" src="/static/upload/loading.png"> </image>
         </template>
-        <image class="delImg" mode="aspectFit" src="/static/upload/del.png" @tap.stop="del(index)"> </image>
+        <template v-if="!disabled">
+          <image class="delImg" mode="aspectFit" src="/static/upload/del.png" @tap.stop="del(index)"> </image>
+        </template>
       </view>
     </view>
-    <view v-if="count === 0 ? true : count - files.length" class="file-upload-view" @click="upload">
-      <view class="file-upload-ckick">
-        <image class="uploadImg" mode="aspectFit" src="/static/upload/upload.png"> </image>
+    <template v-if="!disabled">
+      <view v-if="count === 0 ? true : count - files.length" class="file-upload-view" @click="upload">
+        <view class="file-upload-ckick">
+          <image class="uploadImg" mode="aspectFit" src="/static/upload/upload.png"> </image>
+        </view>
       </view>
-    </view>
+    </template>
   </view>
 </template>
 
@@ -27,6 +31,10 @@ import { b64_md5 } from '@/common/utils/md5.js'
 import loadingImg from './loading.png'
 export default {
   props: {
+    disabled: {
+      type: Boolean,
+      default: false
+    },
     count: {
       type: Number,
       default: 0
@@ -59,7 +67,7 @@ export default {
     }
   },
   methods: {
-     // 检查文件类型
+    // 检查文件类型
     checkFileType(url) {
       if (!url) return ''
       const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
@@ -81,7 +89,7 @@ export default {
         return 'pdf'
       }
     },
-    
+
     setFileVal(arr) {
       return arr.map(item => {
         if (typeof item == 'string') {
@@ -98,14 +106,14 @@ export default {
       uni.chooseImage({
         count: this.count === 0 ? 0 : this.count - this.files.length,
         success: async res => {
-          let pathType =  this.checkFileType(res.tempFiles[0].name)
-          if(pathType !== 'image'){
+          let pathType = this.checkFileType(res.tempFiles[0].name)
+          if (pathType !== 'image') {
             return this.$toast('当前格式仅支持jpg, jpeg, png,请检查')
           }
           //  #ifdef H5
-          uploadImgs(res.tempFiles[0]).then(res=>{
+          uploadImgs(res.tempFiles[0]).then(res => {
             this.files.push({
-              url:res.url
+              url: res.url
             })
           })
           //  #endif
@@ -113,7 +121,6 @@ export default {
           // #ifdef MP-WEIXIN
 
           // #endif
-          
         },
         fail: err => {
           console.log(err)

+ 2 - 2
src/pages/mine/myBuy/return.vue

@@ -40,10 +40,10 @@
         <view class="label">上传图片(最多9张)</view>
       </view>
       <br />
-      <zj-upload key="cp" @getFiles="getFiles" :fileList="fileList" :count="9" />
+      <zj-upload :disabled="showDisable" key="cp" @getFiles="getFiles" :fileList="fileList" :count="9" />
     </view>
 
-    <view v-if="['AFTER_WAIT', 'REFUND', 'NO_REFUND'].indexOf(form.status)" class="form-container">
+    <view v-if="['REFUND', 'NO_REFUND'].indexOf(form.status) != -1" class="form-container">
       <view class="title">处理结果</view>
       <view class="row">
         <view class="label">处理状态:</view>