sen
2025-12-18 82b02a611da178a01f9da0207864693f35a23029
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);
@@ -893,10 +905,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);
        }
      });
    },