From 1d3acbd2992cac0123911f0ffc13a71910ae484b Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期六, 19 七月 2025 16:14:12 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 small-program/pages/freight/freight.vue |   78 ++++++++++++++++++++++++++++-----------
 1 files changed, 56 insertions(+), 22 deletions(-)

diff --git a/small-program/pages/freight/freight.vue b/small-program/pages/freight/freight.vue
index b6c615e..d915dee 100644
--- a/small-program/pages/freight/freight.vue
+++ b/small-program/pages/freight/freight.vue
@@ -357,29 +357,63 @@
 				if (!this.form.linkPhone) {
 					return uni.showToast({ title: '璇疯緭鍏ヨ仈绯荤數璇�', icon: 'none' })
 				}
-				this.$u.api.release({ 
-					...this.form,
-					price: Number(this.form.price) * 100,
-					wayInfoDTOList: [
-						{
-							lat: this.form.lat,
-							lgt: this.form.lgt,
-							location: this.form.location
-						},
-						...this.form.wayInfoDTOList,
-						{
-							lat: this.form.latEnd,
-							lgt: this.form.lgtEnd,
-							location: this.form.locationEnd
+				if (!this.form.id) {
+					this.$u.api.release({
+						...this.form,
+						price: Number(this.form.price) * 100,
+						wayInfoDTOList: [
+							{
+								lat: this.form.lat,
+								lgt: this.form.lgt,
+								location: this.form.location
+							},
+							...this.form.wayInfoDTOList,
+							{
+								lat: this.form.latEnd,
+								lgt: this.form.lgtEnd,
+								location: this.form.locationEnd
+							}
+						]
+					}).then(res => {
+						if (res.code == 200) {
+							uni.navigateTo({
+								url: `/pages/success/success?orderId=${res.data.id}`
+							})
 						}
-					]
-				}).then(res => {
-					if (res.code == 200) {
-						uni.navigateTo({
-							url: `/pages/success/success?orderId=${res.data.id}`
-						})
-					}
-				})
+					})
+				} else {
+					this.$u.api.updateOrder({
+						...this.form,
+						price: Number(this.form.price) * 100,
+						wayInfoDTOList: [
+							{
+								lat: this.form.lat,
+								lgt: this.form.lgt,
+								location: this.form.location
+							},
+							...this.form.wayInfoDTOList,
+							{
+								lat: this.form.latEnd,
+								lgt: this.form.lgtEnd,
+								location: this.form.locationEnd
+							}
+						]
+					}).then(res => {
+						if (res.code == 200) {
+							uni.showToast({
+								title: '缂栬緫鎴愬姛',
+								icon: 'success',
+								mask: true,
+								duration: 2000
+							})
+							setTimeout(() => {
+								uni.navigateBack({ delta: 1 });
+								// uni.$emit('refresh')
+							}, 1500)
+							
+						}
+					})
+				}
 			},
 			uploadImg() {
 				var that = this;

--
Gitblit v1.9.3