From 2f0f13c472e3cb663c3f6cbb417cffe760a497f0 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 05 九月 2025 18:32:09 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/jinkuai

---
 small-program/pages/freight/freight.vue |   79 +++++++++++++++++++++++++++++----------
 1 files changed, 59 insertions(+), 20 deletions(-)

diff --git a/small-program/pages/freight/freight.vue b/small-program/pages/freight/freight.vue
index 216c33f..d40229d 100644
--- a/small-program/pages/freight/freight.vue
+++ b/small-program/pages/freight/freight.vue
@@ -27,7 +27,7 @@
 				<view class="list-item-row" @click="show2 = true">
 					<view class="list-item-row-label">鐢ㄨ溅鏃堕棿<b>*</b></view>
 					<view class="list-item-row-val">
-						<text :style="{ color: form.startDate ? '#111111' : '' }">{{form.startDate ? form.startDate + ' 鑷� ' + form.endDate + ' (' + form.priceNum1 + '澶�) ' : '璇烽�夋嫨'}}</text>
+						<text :style="{ color: form.startDate ? '#111111' : '' }">{{form.startDate ? form.startDate + ' 鑷� ' + form.endDate + ' (' + form.totalDays + '澶�) ' : '璇烽�夋嫨'}}</text>
 						<u-icon name="arrow-right" color="#111111" size="16"></u-icon>
 					</view>
 				</view>
@@ -91,20 +91,23 @@
 					<view class="list-item-row">
 						<view class="list-item-row-label">杩愯緭閲嶉噺/鏁伴噺<b>*</b></view>
 						<view class="list-item-row-val">
-							<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;">
+							<input type="text" style="flex: 3;" 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  style="flex: 1;" :class="form.transportUnit ==='涓�' ? 'val-cate-item val-active' : 'val-cate-item'"   @click="form.transportUnit = '涓�'">涓�</view>
+							<view  style="flex: 1;" :class="form.transportUnit ==='鏂�' ? 'val-cate-item val-active' : 'val-cate-item'"   @click="form.transportUnit = '鏂�'">鏂�</view>
 						</view>
+						 
 					</view>
-					<view class="list-item-row" v-if="viewStatus">
+					<view class="list-item-row" >
 						<view class="list-item-row-label">闇�姹傝ˉ鍏�</view>
 						<view class="list-item-row-val">
 							<textarea cols="30" v-model="form.supplement" rows="10" placeholder="璇疯緭鍏�" maxlength="200"></textarea>
 						</view>
 					</view>
-					<view class="list-item-row" v-if="viewStatus">
+					<view class="list-item-row" >
 						<view class="list-item-row-label">鍥剧墖</view>
 						<view class="list-item-row-upload">
 							<view class="upload-item" v-for="(item, index) in form.multifileList" :key="index">
@@ -117,10 +120,10 @@
 							</view>
 						</view>
 					</view>
-					<view class="list-item-zk" @click="viewStatus = !viewStatus">
+					<!-- <view class="list-item-zk" @click="viewStatus = !viewStatus">
 						<text>{{viewStatus ? '鏀惰捣' : '琛ュ厖闇�姹�'}}</text>
 						<u-icon :name="viewStatus ? 'arrow-up' : 'arrow-down'" color="#00BC12" size="16"></u-icon>
-					</view>
+					</view> -->
 				</view>
 				<view class="list-item">
 					<view class="list-item-label">
@@ -130,17 +133,24 @@
 					<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">{{item.name}}</view>
 					</view>
-					<view class="list-item-row">
-						<view class="list-item-row-label">澶╂暟</view>
+					<view class="list-item-row" v-if="form.carType==0">
+						<view class="list-item-row-label">鐢ㄨ溅澶╂暟</view>
 						<view class="list-item-row-val">
-							<input type="number" v-model="form.priceNum1" disabled placeholder="璇疯緭鍏�" />
+							<input type="number" v-model="form.totalDays" disabled placeholder="" />
 							<text>澶�</text>
+						</view>
+					</view>
+					<view class="list-item-row" v-if="form.carType==1">
+						<view class="list-item-row-label">鐢ㄨ溅娆℃暟<b>*</b></view>
+						<view class="list-item-row-val">
+							<input type="number" v-model="form.priceNum1"  @input="getPrice"  placeholder="璇疯緭鍏�" />
+							<text>娆�</text>
 						</view>
 					</view>
 					<view class="list-item-row">
 						<view class="list-item-row-label">璐圭敤鏍囧噯<b>*</b></view>
 						<view class="list-item-row-val">
-							<input type="digit" @blur="getPrice"  v-model="form.price" placeholder="璇疯緭鍏�" />
+							<input type="digit" @input="getPrice"  v-model="form.price" placeholder="璇疯緭鍏�" />
 							<text>{{form.priceUnit}}</text>
 						</view>
 					</view>
@@ -175,10 +185,10 @@
 					<text>鍏�</text>
 				</view>
 			</view>
-			<view class="footer-bottom">
-				<div class="footer-bottom-btn" @click="submit">
-					<text>绔嬪嵆涓嬪崟</text>
-					<text>锛堟湇鍔″畬鎴愬悗浠樻锛�</text>
+			<view class="footer-bottom"> 
+				<div class="footer-bottom-btn" @click="submit" >
+					<text>{{form.id?'纭淇敼':'绔嬪嵆涓嬪崟'}}</text>
+					<text v-if="!form.id">锛堟湇鍔″畬鎴愬悗浠樻锛�</text>
 				</div>
 			</view>
 			<view style="width: 100%; height: env(safe-area-inset-bottom);"></view>
@@ -262,6 +272,7 @@
 					categoryName: '',
 					wayInfoDTOList: [],
 					priceNum1: '',
+					totalDays:null,
 					priceNum2: 1,
 					transportNum: '',
 					transportTypeId: '',
@@ -296,6 +307,7 @@
 					} else if (news === 1) {
 						this.form.priceUnit = '鍏�/娆�'
 					}
+					this.getPrice()
 				}
 			}
 		},
@@ -307,6 +319,7 @@
 				}).then(res => {
 					if (res.code === 200) {
 						this.info = res.data
+						console.log(res.data.totalDays)
 						for (const key in this.form) {
 							this.form[key] = res.data[key]
 						}
@@ -328,7 +341,8 @@
 				this.form.endDate = res.endDate
 				this.form.lat = res.lat
 				this.form.lgt = res.lgt
-				this.form.priceNum1 = res.days
+				this.form.totalDays = res.days
+				this.form.priceNum1=res.days
 				this.form.categoryId = res.categoryId
 				this.form.categoryName = res.categoryName
 				this.form.location = res.location
@@ -377,6 +391,9 @@
 					uni.requestSubscribeMessage({
 						tmplIds: ['oVjOBLcHxIlGzOMJsdInmgI5CHGXh-UTvMzQqfFOnIg','AA97cHjvlPiNO4viMkVe4JifCf9TD5b5Eb7s6El3VS8'],
 						success(res) {
+							if(that.form.carType == 0){
+								that.form.priceNum1 = that.form.totalDays
+							}
 							that.$u.api.release({
 								...that.form,
 								price: Number(that.form.price) * 100,
@@ -425,7 +442,7 @@
 							}).then(res => {
 								if (res.code == 200) {
 									uni.showToast({
-										title: '缂栬緫鎴愬姛',
+										title: '淇敼鎴愬姛',
 										icon: 'success',
 										mask: true,
 										duration: 2000
@@ -472,8 +489,9 @@
 					this.$u.api.getTotal({
 						price: Number(this.form.price).toFixed(2) * 100,
 						priceUnit: this.form.priceUnit,
-						priceNum1: this.form.priceNum1,
+						priceNum1: this.form.carType!=1?this.form.totalDays:this.form.priceNum1,
 						priceNum2: this.form.priceNum2,
+						carType:this.form.carType ,
 						type: 1
 					}).then(res => {
 						if (res.code === 200) {
@@ -523,8 +541,9 @@
 				this.form.startDate = e[0]
 				this.form.endDate = e[e.length - 1]
 				let time = this.form.startDate == this.form.endDate ? 1 : 0
-				this.form.priceNum1 = e.length - time;
+				this.form.totalDays = e.length - time;
 				this.show2 = false
+				this.getPrice()
 			},
 			addAddr() {
 				this.form.wayInfoDTOList.push({
@@ -539,6 +558,7 @@
 						if ([2].includes(type)) {
 							this.form.latitude = res.latitude
 							this.form.longitude = res.longitude
+							this.form.location = res.name || res.address
 							this.form.address = res.name || res.address
 						} else if (type === 3) {
 							this.form.locationEnd = res.name || res.address
@@ -976,6 +996,25 @@
 							font-size: 30rpx;
 							color: #111111;
 						}
+						.val-active {
+							background: #00BC12 !important;
+							color: #ffffff !important;
+						}
+						.val-cate-item {
+							width: 208rpx;
+							height: 72rpx;
+							line-height: 72rpx;
+							text-align: center;
+							font-weight: 400;
+							font-size: 28rpx;
+							color: #333333;
+							background: #EEEEEE;
+							border-radius: 36rpx;
+							margin-right: 24rpx;
+							&:last-child {
+								margin: 0 !important;
+							}
+						}
 					}
 				}
 			}

--
Gitblit v1.9.3