Procházet zdrojové kódy

Merge branch 'master' of ssh://gogs.zfire.top:2222/zfire-front/recycle-mobile

# Conflicts:
#	src/pages/mine/myBuy/return.vue
linwenxin před 1 rokem
rodič
revize
e1b44e8a40
1 změnil soubory, kde provedl 87 přidání a 50 odebrání
  1. 87 50
      src/pages/mine/myBuy/return.vue

+ 87 - 50
src/pages/mine/myBuy/return.vue

@@ -85,6 +85,7 @@
       }
     },
 
+
     onLoad(pam) {
       this.pam = pam
     },
@@ -116,71 +117,107 @@
       orderId
     }) {
       this.orderId = orderId
-    },
-    onShow() {
       this.getDetail()
     },
+    onShow() {},
     methods: {
       back() {
         uni.navigateBack()
       },
       getFiles(value) {
-        this.fileurl = value
+        this.fileurl = []
+        value.forEach(v => {
+          this.fileurl.push(v)
+        })
       },
-      //
-      apply() {
-        if (!this.formdata.applyNote) {
-          this.$toast('缺少必要参数,请检查')
-          return
-        }
-        this.disabled = true
-        let params = {
-          ...this.formdata,
-          orderId: this.orderId,
-          refundFile: this.fileurl.toString()
+      data() {
+        return {
+          disabled: false,
+          type: 1,
+          content: '',
+          refresherTriggered: false,
+          form: {
+            goods: {}
+          },
+          formdata: {
+            applyType: 'REFUND',
+            applyNote: ''
+          },
+          showDisable: false,
+          fileList: [],
+          fileurl: [],
+          orderId: ''
         }
-        this.$toast('正在申请售后中...')
-        setTimeout(() => {
+      },
+      onLoad({
+        orderId
+      }) {
+        this.orderId = orderId
+      },
+      onShow() {
+        this.getDetail()
+      },
+      methods: {
+        back() {
+          uni.navigateBack()
+        },
+        getFiles(value) {
+          this.fileurl = value
+        },
+        //
+        apply() {
+          if (!this.formdata.applyNote) {
+            this.$toast('缺少必要参数,请检查')
+            return
+          }
+          this.disabled = true
+          let params = {
+            ...this.formdata,
+            orderId: this.orderId,
+            refundFile: this.fileurl.toString()
+          }
+          this.$toast('正在申请售后中...')
+          setTimeout(() => {
+            this.$api
+              .postJson('/refundOrder/apply', params)
+              .then(res => {
+                this.disabled = false
+                this.$navToPage({
+                    url: '/pages/mine/myBuy/list'
+                  },
+                  'redirectTo'
+                )
+              })
+              .catch(err => {
+                this.disabled = false
+              })
+          }, 1000)
+        },
+        //
+        getDetail() {
           this.$api
-            .postJson('/refundOrder/apply', params)
+            .postJson('/refundOrder/detail', {
+              orderId: this.orderId
+            })
             .then(res => {
-              this.disabled = false
-              this.$navToPage({
-                  url: '/pages/mine/myBuy/list'
-                },
-                'redirectTo'
-              )
+              this.form = res.data
+              this.fileList = res.data.orderRefundFileList.map(v => v.imgUrl)
+              if (['AFTER_WAIT', 'REFUND', 'NO_REFUND'].indexOf(res.data.status) !== -1) {
+                this.showDisable = true
+              }
             })
-            .catch(err => {
-              this.disabled = false
+            .catch(err => {})
+            .finally(() => {
+              this.refresherTriggered = false
             })
-        }, 1000)
-      },
-      //
-      getDetail() {
-        this.$api
-          .postJson('/refundOrder/detail', {
-            orderId: this.orderId
-          })
-          .then(res => {
-            this.form = res.data
-            this.fileList = res.data.orderRefundFileList.map(v => v.imgUrl)
-            if (['AFTER_WAIT', 'REFUND', 'NO_REFUND'].indexOf(res.data.status) !== -1) {
-              this.showDisable = true
-            }
-          })
-          .catch(err => {})
-          .finally(() => {
-            this.refresherTriggered = false
-          })
-      },
-      refresherrefresh() {
-        this.refresherTriggered = true
-        this.getDetail()
+        },
+        refresherrefresh() {
+          this.refresherTriggered = true
+          this.getDetail()
+        }
       }
+      // #endif
     }
-    // #endif
-  }
 </script>
 
 <style lang="scss" scoped>