Kaynağa Gözat

Merge remote-tracking branch 'origin/feature-201830-wangcz' into feature-201830-wangcz

wangcz 7 yıl önce
ebeveyn
işleme
0bf045beef
1 değiştirilmiş dosya ile 36 ekleme ve 16 silme
  1. 36 16
      pages/mobile/order/logistics.vue

+ 36 - 16
pages/mobile/order/logistics.vue

@@ -91,23 +91,43 @@
           this.getInfo()
         },
         getInfo() {
-          this.$http.get(`/trade/order/invoiceid?id=${this.detailsInfo.id}&invoiceid=${this.idsList[this.nowIds]}`).then(data => {
-            this.logistics = data.data.data.logistics
-            this.$http.get(`/kdn/logistics/query?companyName=${this.logistics.companyName}&logisticsCode=${this.logistics.number}`).then(res => {
-              let str = res.data.traces
-              this.logisticsInfo = JSON.parse(res.data.traces).reverse()
-              if (str.indexOf('揽件') !== -1 || str.indexOf('收件') !== -1 || str.indexOf('转运') !== -1 || str.indexOf('运输') !== -1 || str.indexOf('发往') !== -1 ||
-                str.indexOf('发出') !== -1 || str.indexOf('收入') !== -1 || str.indexOf('扫描') !== -1 || str.indexOf('到达') !== -1) {
-                this.status = 'transit'
-              }
-              if (str.indexOf('派送') !== -1 || str.indexOf('派件') !== -1) {
-                this.status = 'send'
-              }
-              if (str.indexOf('签收') !== -1) {
-                this.status = 'signin'
-              }
+          if (this.$route.query.type === 'buyer') {
+            this.$http.get(`/trade/order/invoiceid?id=${this.detailsInfo.id}&invoiceid=${this.idsList[this.nowIds]}`).then(data => {
+              this.logistics = data.data.data.logistics
+              this.$http.get(`/kdn/logistics/query?companyName=${this.logistics.companyName}&logisticsCode=${this.logistics.number}`).then(res => {
+                let str = res.data.traces
+                this.logisticsInfo = JSON.parse(res.data.traces).reverse()
+                if (str.indexOf('揽件') !== -1 || str.indexOf('收件') !== -1 || str.indexOf('转运') !== -1 || str.indexOf('运输') !== -1 || str.indexOf('发往') !== -1 ||
+                  str.indexOf('发出') !== -1 || str.indexOf('收入') !== -1 || str.indexOf('扫描') !== -1 || str.indexOf('到达') !== -1) {
+                  this.status = 'transit'
+                }
+                if (str.indexOf('派送') !== -1 || str.indexOf('派件') !== -1) {
+                  this.status = 'send'
+                }
+                if (str.indexOf('签收') !== -1) {
+                  this.status = 'signin'
+                }
+              })
             })
-          })
+          } else {
+            this.$http.get(`/trade/logistics/${this.detailsInfo.lgtId}`).then(data => {
+              this.logistics = data.data
+              this.$http.get(`/kdn/logistics/query?companyName=${this.logistics.companyName}&logisticsCode=${this.logistics.number}`).then(res => {
+                let str = res.data.traces
+                this.logisticsInfo = JSON.parse(res.data.traces).reverse()
+                if (str.indexOf('揽件') !== -1 || str.indexOf('收件') !== -1 || str.indexOf('转运') !== -1 || str.indexOf('运输') !== -1 || str.indexOf('发往') !== -1 ||
+                  str.indexOf('发出') !== -1 || str.indexOf('收入') !== -1 || str.indexOf('扫描') !== -1 || str.indexOf('到达') !== -1) {
+                  this.status = 'transit'
+                }
+                if (str.indexOf('派送') !== -1 || str.indexOf('派件') !== -1) {
+                  this.status = 'send'
+                }
+                if (str.indexOf('签收') !== -1) {
+                  this.status = 'signin'
+                }
+              })
+            })
+          }
         }
       }
     }