From 13796df077a2ccba587667e233f7cb48ea6c73b6 Mon Sep 17 00:00:00 2001
From: zhangback <zhangback@163.com>
Date: 星期一, 29 十二月 2025 16:59:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/yagwly_fa_master' into yagwly_fa_master

---
 ui/car_wx_app/pages/examine/index.vue |   72 +++++++++++++++++++++++------------
 1 files changed, 47 insertions(+), 25 deletions(-)

diff --git a/ui/car_wx_app/pages/examine/index.vue b/ui/car_wx_app/pages/examine/index.vue
index 26af185..21cf080 100644
--- a/ui/car_wx_app/pages/examine/index.vue
+++ b/ui/car_wx_app/pages/examine/index.vue
@@ -352,6 +352,8 @@
 </template>
 
 <script>
+import {uploadImage} from "@/common/upload";
+
 function groupBy(array, key){
   return array.reduce((acc, item) => {
     const groupKey = String(item[key]);
@@ -430,7 +432,7 @@
       },
       mapList: {},
       activeActive: {},
-
+      isHk:false,
 
     };
   },
@@ -445,6 +447,7 @@
     this.amapPlugin = new amap.AMapWX({
       key: this.mapApiKey
     });
+
     // 鑾峰彇 URL 鍙傛暟
     if (options.id) {
       //this.getList();
@@ -453,6 +456,8 @@
       this.form.tripTime = this.getCurrentDateTime();
 
     }
+
+    this.getLocation();
   },
   created() {
     // this.getList();
@@ -669,7 +674,14 @@
       this.amapPlugin.getRegeo({
         location:`${longitude},${latitude}`,
         success: (data) => {
-          this.form.address  = data[0].name;
+          let datum = data[0];
+          if (datum.regeocodeData){
+            if (datum.regeocodeData.addressComponent){
+              let province = datum.regeocodeData.addressComponent.province;
+              this.isHk = province.indexOf("棣欐腐") != -1;
+            }
+          }
+          this.form.address  = datum.name;
         },
         fail: (err) => {
           console.error("SDK璋冪敤澶辫触:", err);
@@ -788,26 +800,31 @@
     // 鏂板鍥剧墖
     async afterRead(event) {
       // 褰撹缃� multiple 涓� true 鏃�, file 涓烘暟缁勬牸寮忥紝鍚﹀垯涓哄璞℃牸寮�
-      let lists = [].concat(event.file)
-      let fileListLen = this.fileList.length
-      lists.map((item) => {
-        this.fileList.push({
-          ...item,
-          status: 'success',
-          message: '涓婁紶涓�'
-        })
+      uploadImage(event.file[0].url,this.isHk).then(res=>{
+        console.log(res)
+        this.fileList.push(res);
       })
-      for (let i = 0; i < lists.length; i++) {
 
-        const result = await this.uploadFilePromise(lists[i].url)
-        let item = this.fileList[fileListLen]
-        this.fileList.splice(fileListLen, 1, Object.assign(item, {
-          status: result.status,
-          message: result.status == 'success' ? '涓婁紶鎴愬姛' : '涓婁紶澶辫触',
-          urls: result.url
-        }))
-        fileListLen++
-      }
+      // let lists = [].concat(event.file)
+      // let fileListLen = this.fileList.length
+      // lists.map((item) => {
+      //   this.fileList.push({
+      //     ...item,
+      //     status: 'success',
+      //     message: '涓婁紶涓�'
+      //   })
+      // })
+      // for (let i = 0; i < lists.length; i++) {
+      //
+      //   const result = await this.uploadFilePromise(lists[i].url)
+      //   let item = this.fileList[fileListLen]
+      //   this.fileList.splice(fileListLen, 1, Object.assign(item, {
+      //     status: result.status,
+      //     message: result.status == 'success' ? '涓婁紶鎴愬姛' : '涓婁紶澶辫触',
+      //     urls: result.url
+      //   }))
+      //   fileListLen++
+      // }
     },
 
     uploadFilePromise(url) {
@@ -893,10 +910,15 @@
         sizeType: ['original', 'compressed'],
         sourceType: ['album', 'camera'],
         success: (res) => {
+          const tempFilePaths = res.tempFilePaths;
+          const imgUrl = tempFilePaths[0];
+          uploadImage(imgUrl,this.isHk).then(res2=>{
+            this.uploadAreas[index].imageUrl = res2.url;
+            // const tempFilePath = res.tempFilePaths[0];
+            // // 涓婁紶鍥剧墖鍒版湇鍔″櫒
+            // this.uploadAreaPic(tempFilePath, index);
+          })
 
-          const tempFilePath = res.tempFilePaths[0];
-          // 涓婁紶鍥剧墖鍒版湇鍔″櫒
-          this.uploadAreaPic(tempFilePath, index);
         }
       });
     },
@@ -957,7 +979,7 @@
           // 楠岃瘉鏄惁鑷冲皯涓婁紶浜嗕竴寮犲浘鐗�
           // 鏀堕泦鎵�鏈変笂浼犵殑鍥剧墖鍦板潃锛堢敤閫楀彿鍒嗛殧锛�
 
-          const voucherUrls = this.uploadAreas.map(item => item.imageUrl && item.imageUrl !== '').join(',');
+          const voucherUrls = this.uploadAreas.filter(item => item.imageUrl!=='').map(item => item.imageUrl).join(',');
           this.form.voucherUrl = voucherUrls;
 
           this.$refs.uForm.validate().then(res => {
@@ -1020,7 +1042,7 @@
 
         this.$refs.uForm.validate().then(res => {
           if (res) {
-            var urls = this.fileList.map(item => item.urls).join(',');
+            var urls = this.fileList.map(item => item.url).join(',');
             this.form.feeVoucherUrl = urls
             this.form.dispatchOrderId = this.newForm.dispatchId
             this.form.driverId = this.newForm.driverId

--
Gitblit v1.8.0