From a223d5e29e9384f720ae98c44cbe10f8fa4f73e7 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 21 八月 2025 13:42:16 +0800
Subject: [PATCH] 优化
---
small-program/pages/freight/freight.vue | 80 ++++++++++++++++++++++++++++-----------
1 files changed, 57 insertions(+), 23 deletions(-)
diff --git a/small-program/pages/freight/freight.vue b/small-program/pages/freight/freight.vue
index b6c615e..a56325a 100644
--- a/small-program/pages/freight/freight.vue
+++ b/small-program/pages/freight/freight.vue
@@ -126,7 +126,7 @@
<text>璐圭敤</text>
</view>
<view class="list-item-cate">
- <view :class="item.id === form.carType ? 'list-item-cate-item active' : 'list-item-cate-item'" v-for="(item, index) in ff" :key="index" @click="form.carType = item.id">鎸夊ぉ浠樿垂</view>
+ <view :class="item.id === form.carType ? 'list-item-cate-item active' : 'list-item-cate-item'" v-for="(item, index) in ff" :key="index" @click="form.carType = item.id">{{item.name}}</view>
</view>
<view class="list-item-row">
<view class="list-item-row-label">澶╂暟</view>
@@ -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