From 3fa2221feb0de6d43f5cad8e8bab7463b39c1dda Mon Sep 17 00:00:00 2001
From: zhangback <zhangback@163.com>
Date: 星期一, 29 十二月 2025 16:57:53 +0800
Subject: [PATCH] 提交
---
ui/car_wx_app/pages/transportation/index.vue | 67 +++++++++++++++++++++------------
1 files changed, 42 insertions(+), 25 deletions(-)
diff --git a/ui/car_wx_app/pages/transportation/index.vue b/ui/car_wx_app/pages/transportation/index.vue
index 62afbc5..106c2c6 100644
--- a/ui/car_wx_app/pages/transportation/index.vue
+++ b/ui/car_wx_app/pages/transportation/index.vue
@@ -221,6 +221,7 @@
import amap from '@/common/amap-wx.130.js'
import store from '@/store'
+import {uploadImage} from "@/common/upload";
export default {
data() {
return {
@@ -264,7 +265,7 @@
// odometer: [{ required: true, message: '璇疯緭鍏ヤ华琛ㄩ噷绋�', trigger: 'change' }],
voucher: [{ required: true, message: '璇蜂笂浼犲嚟璇�', trigger: 'blur' }]
},
-
+ isHk: false,
};
},
onLoad(options) {
@@ -272,6 +273,7 @@
this.amapPlugin = new amap.AMapWX({
key: this.mapApiKey
});
+ this.getLocation();
// 鑾峰彇 URL 鍙傛暟
if (options.id) {
this.getList();
@@ -371,27 +373,33 @@
},
// 鏂板鍥剧墖
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: '涓婁紶涓�'
- })
- })
- 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++
- }
+ console.log(event)
+ uploadImage(event.file[0].url,this.isHk).then(res=>{
+ console.log(res)
+ this.fileList.push(res);
+ })
+ // console.log(event)
+ // // 褰撹缃� multiple 涓� true 鏃�, file 涓烘暟缁勬牸寮忥紝鍚﹀垯涓哄璞℃牸寮�
+ // 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) {
@@ -452,7 +460,7 @@
if (this.newForm.statusStr == '寰呯敥鎸�') {
- var urls = this.fileList.map(item => item.urls).join(',');
+ var urls = this.fileList.map(item => item.url).join(',');
this.form.voucherUrl = urls
this.form.dispatchOrderId = this.newForm.dispatchId
this.form.driverId = this.newForm.driverId
@@ -473,7 +481,7 @@
} else if (this.newForm.statusStr == '寰呮帴鎸�') {
- var urls = this.fileList.map(item => item.urls).join(',');
+ var urls = this.fileList.map(item => item.url).join(',');
this.form.voucherUrl = urls
this.form.dispatchOrderId = this.newForm.dispatchId
this.form.driverId = this.newForm.driverId
@@ -541,7 +549,16 @@
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);
--
Gitblit v1.8.0