Browse Source

no message

linwenxin 7 tháng trước cách đây
mục cha
commit
b79528df45
1 tập tin đã thay đổi với 26 bổ sung10 xóa
  1. 26 10
      src/packageWorkorder/pages/infoCollect/form.vue

+ 26 - 10
src/packageWorkorder/pages/infoCollect/form.vue

@@ -269,12 +269,17 @@ export default {
 
     // 上传采集图片
     async chooseCollectImg(index) {
+      uni.showLoading()
+
       if (!this.address) {
-        // uni.showLoading()
-        const lo = await this.$getAddress()
-        this.address = lo.address || ''
-        if (!this.address) {
-          this.address = `${this.orderDetail.province}${this.orderDetail.city}${this.orderDetail.area}${this.orderDetail.street}`
+        try {
+          const lo = await this.$getAddress()
+          this.address = lo.address || ''
+          if (!this.address) {
+            this.address = `${this.orderDetail.province}${this.orderDetail.city}${this.orderDetail.area}${this.orderDetail.street}`
+          }
+        } catch (error) {
+          uni.hideLoading()
         }
       }
 
@@ -296,6 +301,9 @@ export default {
               this.collectImgList.splice(index, 1, obj)
               uni.hideLoading()
             })
+            .catch(() => {
+              uni.hideLoading()
+            })
         },
         fail: err => {
           uni.hideLoading()
@@ -306,12 +314,17 @@ export default {
 
     // 选择故障图片
     async chooseFaultImg(index) {
+      uni.showLoading()
+
       if (!this.address) {
-        uni.showLoading()
-        const lo = await this.$getAddress()
-        this.address = lo.address || ''
-        if (!this.address) {
-          this.address = `${this.orderDetail.province}${this.orderDetail.city}${this.orderDetail.area}${this.orderDetail.street}`
+        try {
+          const lo = await this.$getAddress()
+          this.address = lo.address || ''
+          if (!this.address) {
+            this.address = `${this.orderDetail.province}${this.orderDetail.city}${this.orderDetail.area}${this.orderDetail.street}`
+          }
+        } catch (error) {
+          uni.hideLoading()
         }
       }
 
@@ -333,6 +346,9 @@ export default {
               this.faultImgList.splice(index, 1, obj)
               uni.hideLoading()
             })
+            .catch(() => {
+              uni.hideLoading()
+            })
         },
         fail: err => {
           uni.hideLoading()