From 611d7b93462deeb994dc89ab7c5b39bbcf5f2596 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期一, 11 五月 2026 18:22:27 +0800
Subject: [PATCH] 代码生成
---
small-program/pages/luggage-storage/luggage-storage.vue | 89 ++++++++++++++++++++++++++++++++------------
1 files changed, 65 insertions(+), 24 deletions(-)
diff --git a/small-program/pages/luggage-storage/luggage-storage.vue b/small-program/pages/luggage-storage/luggage-storage.vue
index 26fb854..55bc07d 100644
--- a/small-program/pages/luggage-storage/luggage-storage.vue
+++ b/small-program/pages/luggage-storage/luggage-storage.vue
@@ -64,11 +64,7 @@
</view>
</view>
<view v-if="receiveAddr" class="store-cell-copy-addr">
- <text class="store-cell-title">{{ receiveAddr.name }}</text>
- <view class="store-cell-subtitle-container">
- <image src="/static/icon/home_ic_location3@2x.png" mode="widthFix"></image>
- <text class="store-cell-subtitle">{{ receiveAddr.addr }}</text>
- </view>
+ <text class="store-cell-title">{{ receiveAddr.addr }}</text>
</view>
</view>
</view>
@@ -90,7 +86,7 @@
<input v-model="form.mobile" class="form-input" :class="{ 'filled-input': form.mobile }" type="number" placeholder="璇疯緭鍏ユ敹浠朵汉鐢佃瘽" placeholder-style="color: #B2B2B2;" />
</view>
<view class="form-row dashed-row">
- <text class="form-label">棰勮鍒板簵鏃堕棿</text>
+ <text class="form-label">鍒板簵瀵勫瓨鏃堕棿</text>
<view class="row-picker" @click="showArriveTimePicker = true">
<text :class="form.arriveTime ? 'picker-value-text' : 'placeholder-text'">{{ form.arriveTime || '璇烽�夋嫨' }}</text>
<u-icon name="arrow-right" size="18" color="#222222"></u-icon>
@@ -98,7 +94,7 @@
</view>
<view class="form-row no-border">
<text class="form-label">棰勮鍙栦欢鏃堕棿</text>
- <view class="row-picker" @click="showPickupTimePicker = true">
+ <view class="row-picker" @click="openPickupTimePicker">
<text :class="form.pickupTime ? 'picker-value-text' : 'placeholder-text'">{{ form.pickupTime || '璇烽�夋嫨' }}</text>
<u-icon name="arrow-right" size="18" color="#222222"></u-icon>
</view>
@@ -108,9 +104,10 @@
:show="showArriveTimePicker"
v-model="arriveTimeValue"
mode="datetime"
+ :minDate="Date.now()"
confirmText="纭畾"
cancelText="鍙栨秷"
- title="閫夋嫨棰勮鍒板簵鏃堕棿"
+ title="閫夋嫨鍒板簵瀵勫瓨鏃堕棿"
@confirm="confirmArriveTime"
@cancel="showArriveTimePicker = false"
@close="showArriveTimePicker = false"
@@ -119,6 +116,7 @@
:show="showPickupTimePicker"
v-model="pickupTimeValue"
mode="datetime"
+ :minDate="pickupMinDate"
confirmText="纭畾"
cancelText="鍙栨秷"
title="閫夋嫨棰勮鍙栦欢鏃堕棿"
@@ -167,7 +165,7 @@
<text class="section-title">鐗╁搧淇℃伅</text>
</view>
<view class="required-wrap">
- <text class="section-required goods-required-text" :style="{ color: form.goodTypeName ? '#111111' : '#B2B2B2' }">{{ form.goodTypeName || '蹇呴�夛紝璇烽�夋嫨' }}</text>
+ <text class="section-required goods-required-text" :style="{ color: form.goodTypeName ? '#111111' : 'red' }">{{ form.goodTypeName || '蹇呴�夛紝璇烽�夋嫨' }}</text>
<u-icon name="arrow-right" size="12" color="#A8AFBA"></u-icon>
</view>
</view>
@@ -175,9 +173,9 @@
<view class="upload-box" @click="chooseAndUploadImage(9)">
<image class="upload-icon" src="/static/image/btn_upload@2x.png" mode="widthFix"></image>
</view>
- <view v-for="(item, index) in uploadedImages" :key="index" class="uploaded-box" @click="deleteImage(index)">
+ <view v-for="(item, index) in uploadedImages" :key="index" class="uploaded-box">
<image class="uploaded-image" :src="item.url" mode="aspectFill"></image>
- <text class="uploaded-delete" @click="deleteImage(index)">鍒犻櫎</text>
+ <text class="uploaded-delete" @click.stop="deleteImage(index)">鍒犻櫎</text>
</view>
</view>
</view>
@@ -332,9 +330,15 @@
</view>
<text class="amount-row-value">{{ amountData.distance + 'km' }}</text>
</view>
+ <view v-if="activeMode !== 'city' && amountData.days" class="amount-row amount-row-extra">
+ <view class="amount-row-left">
+ <text class="amount-row-label">瀵勫瓨澶╂暟</text>
+ </view>
+ <text class="amount-row-value">{{ amountData.days + '澶�' }}</text>
+ </view>
<view v-if="amountData.insuranceFee" class="amount-row amount-row-extra">
<view class="amount-row-left">
- <text class="amount-row-label">琛屾潕淇濅环</text>
+ <text class="amount-row-label">鐗╁搧淇濊垂</text>
</view>
<text class="amount-row-value">{{ '锟�' + amountData.insuranceFee }}</text>
</view>
@@ -485,6 +489,12 @@
},
totalPriceText() {
return '锟�150.00'
+ },
+ pickupMinDate() {
+ if (this.form.arriveTime) {
+ return new Date(this.form.arriveTime).getTime()
+ }
+ return Date.now()
}
},
onLoad() {
@@ -492,25 +502,34 @@
this.getCategoryList()
this.getCitySizeList()
this.agreementChecked=false
+ this.getContactInfo()
+
+ if (uni.getStorageSync('selectedStore')) {
+ this.selectedStore = uni.getStorageSync('selectedStore')
+ uni.removeStorageSync('selectedStore')
+ }
+
uni.$on('updateAddress', (data) => {
- console.log(data)
+ this.form.receiver = data.name
+ this.form.mobile = data.phone
this.receiveAddr = data
+ this.receiveAddr.addr = data.provinceName + data.cityName + data.districtName + data.addr
})
},
methods: {
caozuo(e) {
var that = this;
+ this.receiveStore = null
+ this.receiveAddr = null
if (e.name === '閫夋嫨鏈嶅姟鐐�') {
that.storePopupType = 'receive'
- that.receiveStore = null
that.showStorePopup = true
} else if (e.name === '閫夋嫨鍦板潃绨�') {
- that.receiveAddr = null
uni.navigateTo({
url: '/pages/address/address?type=1'
})
}
- that.showReceiveAddress = false
+ this.showReceiveAddress = false
},
async uploadFiles(filePaths, maxCount = 9) {
if (!filePaths || filePaths.length === 0) {
@@ -683,8 +702,17 @@
const hour = String(date.getHours()).padStart(2, '0')
const minute = String(date.getMinutes()).padStart(2, '0')
this.form.arriveTime = `${year}-${month}-${day} ${hour}:${minute}`
+ this.form.pickupTime = ''
+ this.pickupTimeValue = e.value + 3600000
this.showArriveTimePicker = false
this.calculateLocalPrice()
+ },
+ openPickupTimePicker() {
+ if (!this.form.arriveTime) {
+ uni.showToast({ title: '璇峰厛閫夋嫨鍒板簵瀵勫瓨鏃堕棿', icon: 'none' })
+ return
+ }
+ this.showPickupTimePicker = true
},
confirmPickupTime(e) {
const date = new Date(e.value)
@@ -695,7 +723,7 @@
const minute = String(date.getMinutes()).padStart(2, '0')
const pickupTime = `${year}-${month}-${day} ${hour}:${minute}`
if (this.form.arriveTime && new Date(pickupTime) <= new Date(this.form.arriveTime)) {
- uni.showToast({ title: '棰勮鍙栦欢鏃堕棿蹇呴』澶т簬棰勮鍒板簵鏃堕棿', icon: 'none' })
+ uni.showToast({ title: '棰勮鍙栦欢鏃堕棿蹇呴』澶т簬鍒板簵瀵勫瓨鏃堕棿', icon: 'none' })
return
}
this.form.pickupTime = pickupTime
@@ -719,6 +747,17 @@
item.count = 0
})
this.luggageTypes = res.data || []
+ }
+ },
+ async getContactInfo() {
+ const res = await this.$u.api.getContactInfo({})
+ if (res.code === 200 && res.data) {
+ if (res.data.name) {
+ this.form.receiver = res.data.name
+ }
+ if (res.data.phone) {
+ this.form.mobile = res.data.phone
+ }
}
},
async getNearbyShopList() {
@@ -761,7 +800,8 @@
}
},
async calculateLocalPriceOnly() {
- if (!this.selectedStore || !this.form.arriveTime || !this.form.pickupTime) {
+ if (!this.form.arriveTime || !this.form.pickupTime) {
+ this.amountData = null
return
}
const luggageList = this.luggageTypes
@@ -771,11 +811,11 @@
quantity: item.count
}))
if (luggageList.length === 0) {
+ this.amountData = null
return
}
const res = await this.$u.api.calculateLocalPrice({
cityId: this.cityId,
- shopId: this.selectedStore.id,
depositStartTime: this.form.arriveTime + ':00',
depositEndTime: this.form.pickupTime + ':00',
items: luggageList,
@@ -791,10 +831,12 @@
}
},
async calculateRemotePrice() {
- if (!this.sendStore || !this.form.arriveTime || !this.form.pickupTime) {
+ if (!this.sendStore) {
+ this.amountData = null
return
}
if (!this.receiveStore && !this.receiveAddr) {
+ this.amountData = null
return
}
const luggageList = this.luggageTypes
@@ -804,6 +846,7 @@
quantity: item.count
}))
if (luggageList.length === 0) {
+ this.amountData = null
return
}
let fromLat = ''
@@ -828,8 +871,6 @@
toLat: toLat,
toLgt: toLgt,
urgent: this.isUrgent,
- depositStartTime: this.form.arriveTime + ':00',
- depositEndTime: this.form.pickupTime + ':00',
items: luggageList,
declaredAmount: this.form.insurance || 0
})
@@ -877,7 +918,7 @@
return
}
if (!this.form.arriveTime) {
- uni.showToast({ title: '璇烽�夋嫨棰勮鍒板簵鏃堕棿', icon: 'none' })
+ uni.showToast({ title: '璇烽�夋嫨鍒板簵瀵勫瓨鏃堕棿', icon: 'none' })
return
}
if (!this.form.pickupTime) {
@@ -885,7 +926,7 @@
return
}
if (new Date(this.form.pickupTime) <= new Date(this.form.arriveTime)) {
- uni.showToast({ title: '棰勮鍙栦欢鏃堕棿蹇呴』澶т簬棰勮鍒板簵鏃堕棿', icon: 'none' })
+ uni.showToast({ title: '棰勮鍙栦欢鏃堕棿蹇呴』澶т簬鍒板簵瀵勫瓨鏃堕棿', icon: 'none' })
return
}
const luggageList = this.luggageTypes
--
Gitblit v1.9.3