From 58d63637b67a7c565618379268da604e6231fc4c Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期三, 27 八月 2025 18:16:48 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
small-program/pages/freight/freight.vue | 176 ++++++++++++++++++++++++++++++++--------------------------
1 files changed, 98 insertions(+), 78 deletions(-)
diff --git a/small-program/pages/freight/freight.vue b/small-program/pages/freight/freight.vue
index d915dee..93c0835 100644
--- a/small-program/pages/freight/freight.vue
+++ b/small-program/pages/freight/freight.vue
@@ -91,9 +91,11 @@
<view class="list-item-row">
<view class="list-item-row-label">杩愯緭閲嶉噺/鏁伴噺<b>*</b></view>
<view class="list-item-row-val">
- <input type="text" v-model="form.transportNum" placeholder="璇疯緭鍏�" />
- <text @click="show4 = true">{{form.transportUnit}}</text>
- <u-icon name="arrow-down" color="#111111" size="16"></u-icon>
+ <input type="text" style="flex: 1;" v-model="form.transportNum" placeholder="璇疯緭鍏�" />
+ <view @click="show4 = true" style="width: 100rpx; flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end;">
+ <text>{{form.transportUnit}}</text>
+ <u-icon name="arrow-down" color="#111111" size="16"></u-icon>
+ </view>
</view>
</view>
<view class="list-item-row" v-if="viewStatus">
@@ -126,7 +128,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>
@@ -220,6 +222,7 @@
<u-calendar
:show="show2"
color="#00BC12"
+ :allowSameDay="true"
mode="range"
@close="show2 = false"
@confirm="confirmDate" />
@@ -318,7 +321,9 @@
})
} else {
const res = uni.getStorageSync('carData');
+ console.log(res)
this.form.linkPhone = this.userInfo.telephone
+ this.form.linkName = this.userInfo.name
this.form.startDate = res.startDate
this.form.endDate = res.endDate
this.form.lat = res.lat
@@ -342,6 +347,10 @@
},
// 鎻愪氦璁㈠崟
submit() {
+ var that = this;
+ if (!this.form.carUnit) {
+ return uni.showToast({ title: '璇烽�夋嫨璐ц溅鍨嬪彿', icon: 'none' })
+ }
if (!this.form.transportTypeName) {
return uni.showToast({ title: '璇烽�夋嫨杩愯緭鍝佺', icon: 'none' })
}
@@ -357,60 +366,69 @@
if (!this.form.linkPhone) {
return uni.showToast({ title: '璇疯緭鍏ヨ仈绯荤數璇�', icon: 'none' })
}
- 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}`
+ if (!that.form.id) {
+ uni.requestSubscribeMessage({
+ tmplIds: ['oVjOBLcHxIlGzOMJsdInmgI5CHGXh-UTvMzQqfFOnIg'],
+ success(res) {
+ that.$u.api.release({
+ ...that.form,
+ price: Number(that.form.price) * 100,
+ wayInfoDTOList: [
+ {
+ lat: that.form.lat,
+ lgt: that.form.lgt,
+ location: that.form.location
+ },
+ ...that.form.wayInfoDTOList,
+ {
+ lat: that.form.latEnd,
+ lgt: that.form.lgtEnd,
+ location: that.form.locationEnd
+ }
+ ]
+ }).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
+ uni.requestSubscribeMessage({
+ tmplIds: ['3YSC7gouRlSjHXz4CrWOGFzPmGwEBtFj4snwdfMvKHk'],
+ success(res) {
+ that.$u.api.updateOrder({
+ ...that.form,
+ price: Number(that.form.price) * 100,
+ wayInfoDTOList: [
+ {
+ lat: that.form.lat,
+ lgt: that.form.lgt,
+ location: that.form.location
+ },
+ ...that.form.wayInfoDTOList,
+ {
+ lat: that.form.latEnd,
+ lgt: that.form.lgtEnd,
+ location: that.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)
+ }
})
- setTimeout(() => {
- uni.navigateBack({ delta: 1 });
- // uni.$emit('refresh')
- }, 1500)
-
}
})
}
@@ -419,24 +437,25 @@
var that = this;
uni.chooseImage({
success: (chooseImageRes) => {
- const tempFilePaths = chooseImageRes.tempFilePaths;
- uni.uploadFile({
- url: this.$baseUrl + '/web/public/upload',
- filePath: tempFilePaths[0],
- name: 'file',
- formData: {
- 'folder': 'orders'
- },
- success: (uploadFileRes) => {
- const res = JSON.parse(uploadFileRes.data)
- that.form.multifileList.push({
- fileurl: res.data.imgaddr,
- name: res.data.originname,
- url: res.data.url,
- type: 0
- })
- }
- });
+ for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) {
+ uni.uploadFile({
+ url: this.$baseUrl + '/web/public/upload',
+ filePath: chooseImageRes.tempFilePaths[i],
+ name: 'file',
+ formData: {
+ 'folder': 'orders'
+ },
+ success: (uploadFileRes) => {
+ const res = JSON.parse(uploadFileRes.data)
+ that.form.multifileList.push({
+ fileurl: res.data.imgaddr,
+ name: res.data.originname,
+ url: res.data.url,
+ type: 0
+ })
+ }
+ });
+ }
}
});
},
@@ -496,7 +515,8 @@
confirmDate(e) {
this.form.startDate = e[0]
this.form.endDate = e[e.length - 1]
- this.form.priceNum1 = e.length;
+ let time = this.form.startDate == this.form.endDate ? 1 : 0
+ this.form.priceNum1 = e.length - time;
this.show2 = false
},
addAddr() {
@@ -512,15 +532,15 @@
if ([2].includes(type)) {
this.form.latitude = res.latitude
this.form.longitude = res.longitude
- this.form.address = res.address
+ this.form.address = res.name || res.address
} else if (type === 3) {
- this.form.locationEnd = res.address
+ this.form.locationEnd = res.name || res.address
this.form.latEnd = res.latitude
this.form.lgtEnd = res.longitude
- } else if (type === 4) {
- this.form.wayInfoDTOList[0].lat = res.latitude
- this.form.wayInfoDTOList[0].lgt = res.longitude
- this.form.wayInfoDTOList[0].location = res.address
+ } else if (type === 4) {
+ this.form.wayInfoDTOList[index].lat = res.latitude
+ this.form.wayInfoDTOList[index].lgt = res.longitude
+ this.form.wayInfoDTOList[index].location = res.name || res.address
}
}
});
--
Gitblit v1.9.3