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 | 234 +++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 174 insertions(+), 60 deletions(-)
diff --git a/small-program/pages/luggage-storage/luggage-storage.vue b/small-program/pages/luggage-storage/luggage-storage.vue
index 92f2114..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="閫夋嫨棰勮鍙栦欢鏃堕棿"
@@ -133,7 +131,7 @@
<text class="section-title">瀵勫瓨琛屾潕绫诲瀷</text>
<text class="section-desc">锛堝閫夛紝蹇呭~锛�</text>
</view>
- <view class="price-note">
+ <view class="price-note" @click="goRichText(9)">
<image class="price-note-icon" src="/static/icon/ic_tips@2x.png" mode="widthFix"></image>
<text>浠锋牸璇存槑</text>
</view>
@@ -145,10 +143,12 @@
:class="{ active: item.count > 0 }"
>
<view class="luggage-info">
- <image class="luggage-image" :src="item.iconFull" mode="widthFix"></image>
+ <view class="luggage-image">
+ <image style="height: 100%;" :src="item.iconFull" mode="heightFix"></image>
+ </view>
<view class="luggage-copy">
<text class="luggage-name">{{ item.name }}</text>
- <text class="luggage-size">{{ item.otherField || '' }}</text>
+ <text class="luggage-size">{{ item.remark || '' }}</text>
</view>
</view>
<view class="luggage-stepper">
@@ -165,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>
@@ -173,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>
@@ -208,9 +208,13 @@
<text class="unit-text">鍏�</text>
</view>
</view>
- <view v-if="amountData" class="insurance-tip-row">
- <text class="insurance-tip-label">鐗╁搧淇濊垂:</text>
- <text class="insurance-tip-value">锟{ amountData.insuranceFee }}</text>
+ <view v-if="amountData || showInsuranceTip" class="insurance-tip-row">
+ <text v-if="showInsuranceTip" class="insurance-tip-warning">{{ showInsuranceTipText }}</text>
+ <text v-else></text>
+ <view style="display: flex; align-items: center;">
+ <text v-if="amountData" class="insurance-tip-label">鐗╁搧淇濊垂:</text>
+ <text v-if="amountData" class="insurance-tip-value">锟{ amountData.insuranceFee }}</text>
+ </view>
</view>
</view>
@@ -255,7 +259,7 @@
<image class="store-option-address-icon" src="/static/icon/home_ic_location3@2x.png" mode="widthFix"></image>
<text class="store-option-address">{{ item.address }}</text>
</view>
- <text class="store-option-time">{{ item.time }}</text>
+ <text class="store-option-time">{{ item.shopHours || '' }}</text>
</view>
</view>
<view v-if="tempSelectedStoreId === item.id" class="store-check">
@@ -280,23 +284,26 @@
<text class="goods-main-title">鐗╁搧鍚嶇О</text>
<text class="goods-main-required">锛堝繀閫夛級</text>
</view>
- <view class="goods-danger-tip">
+ <view class="goods-danger-tip" @click="goRichText(10)">
<image class="goods-danger-icon" src="/static/icon/ic_tips@2x.png" mode="widthFix"></image>
<text>绂佸瘎鐗╁搧</text>
</view>
</view>
<text class="goods-popup-desc">涓虹‘淇濈墿鍝佸瘎閫掑畨鍏紝璇锋鏌ユ槸鍚︿笉澶瑰甫鏄撶噧鏄撶垎鐗╁搧</text>
- <view class="goods-tag-grid">
- <view
- v-for="(item, index) in goodsOptions"
- :key="index"
- class="goods-tag"
- :class="{ active: item.active }"
- @click="goodsOptions.forEach((row,i) => row.active = i === index)"
- >
- <text>{{ item.name }}</text>
+ <view style="display: block;height: 500rpx;overflow-y: auto;margin-top:10px ;">
+ <view class="goods-tag-grid">
+ <view
+ v-for="(item, index) in goodsOptions"
+ :key="index"
+ class="goods-tag"
+ :class="{ active: item.active }"
+ @click="goodsOptions.forEach((row,i) => row.active = i === index)"
+ >
+ <text>{{ item.name }}</text>
+ </view>
</view>
- </view>
+ </view>
+
<view class="goods-save-btn" @tap="confirmGoods">淇濆瓨</view>
</view>
</u-popup>
@@ -317,19 +324,37 @@
</view>
<text class="amount-row-value">{{ '锟�' + item.unitPrice }}</text>
</view>
+ <view v-if="activeMode === 'city' && amountData.distance" class="amount-row amount-row-extra">
+ <view class="amount-row-left">
+ <text class="amount-row-label">閰嶉�侀噷绋�</text>
+ </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>
+ </view>
+ <text class="amount-row-value">{{ '锟�' + amountData.insuranceFee }}</text>
+ </view>
</view>
<view class="agreement-bar popup-agreement-bar" @click="toggleAgreement">
<image class="agreement-icon" :src="agreementChecked ? '/static/icon/ic_accept_sel@2x.png' : '/static/icon/ic_accept@2x.png'" mode="widthFix" />
<text class="agreement-text">鎴戝凡闃呰骞跺悓鎰�</text>
- <text class="agreement-link" @tap="goRichText('protocol')">銆婄敤鎴锋湇鍔″崗璁��</text>
+ <text class="agreement-link" @tap="goRichText(0)">銆婄敤鎴锋湇鍔″崗璁��</text>
<text class="agreement-text">鍙�</text>
- <text class="agreement-link" @tap="goRichText('privacy')">銆婇殣绉佹斂绛栥��</text>
+ <text class="agreement-link" @tap="goRichText(1)">銆婇殣绉佹斂绛栥��</text>
</view>
<view class="bottom-action-row popup-action-row">
<view class="total-wrap">
<text class="total-label">鎬昏垂鐢�</text>
<text class="total-price">{{ amountData ? '锟�' + amountData.totalPrice : '锟�--' }}</text>
- <view @click="showAmountPopup = false">
+ <view style="display: flex; align-items: center;" @click="showAmountPopup = false">
<text class="detail-text">鏄庣粏</text>
<u-icon name="arrow-up" size="13" color="#7B7F86"></u-icon>
</view>
@@ -343,9 +368,9 @@
<view class="agreement-bar" @click="toggleAgreement">
<image class="agreement-icon" :src="agreementChecked ? '/static/icon/ic_accept_sel@2x.png' : '/static/icon/ic_accept@2x.png'" mode="widthFix" />
<text class="agreement-text">鎴戝凡闃呰骞跺悓鎰�</text>
- <text class="agreement-link" @tap="goRichText('protocol')">銆婄敤鎴锋湇鍔″崗璁��</text>
+ <text class="agreement-link" @click="goRichText(0)">銆婄敤鎴锋湇鍔″崗璁��</text>
<text class="agreement-text">鍙�</text>
- <text class="agreement-link" @tap="goRichText('privacy')">銆婇殣绉佹斂绛栥��</text>
+ <text class="agreement-link" @click="goRichText(1)">銆婇殣绉佹斂绛栥��</text>
</view>
<view class="bottom-action-row">
<view class="total-wrap">
@@ -359,6 +384,7 @@
<view class="submit-btn active-submit-btn" @click="createOrder">绔嬪嵆涓嬪崟</view>
</view>
</view>
+
<!-- 閫夋嫨鏈嶅姟鐐�/鍦板潃 -->
<u-action-sheet
:show="showReceiveAddress"
@@ -387,7 +413,7 @@
{ label: '灏卞湴瀵勫瓨', value: 'local' },
{ label: '鍚屽煄瀵勯��', value: 'city' }
],
- agreementChecked: true,
+ agreementChecked: false,
tempSelectedStoreId: 2,
selectedStoreId: 2,
tempSelectedGoodsIds: [1],
@@ -406,6 +432,8 @@
goodsImages: [],
},
amountData: null,
+ showInsuranceTip: false,
+ showInsuranceTipText: '',
luggageTypes: [],
serviceTimes: [],
@@ -461,32 +489,47 @@
},
totalPriceText() {
return '锟�150.00'
+ },
+ pickupMinDate() {
+ if (this.form.arriveTime) {
+ return new Date(this.form.arriveTime).getTime()
+ }
+ return Date.now()
}
},
onLoad() {
this.getNearbyShopList()
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) {
@@ -647,6 +690,8 @@
}
this.form.goodTypeName = this.goodsOptions.find(item => item.active)?.name || ''
this.form.goodType = this.goodsOptions.find(item => item.active)?.id || ''
+ this.showInsuranceTip = this.goodsOptions.find(item => item.active)?.relationOtherField === '1'
+ this.showInsuranceTipText = this.goodsOptions.find(item => item.active)?.relationRemark
this.showGoodsPopup = false
},
confirmArriveTime(e) {
@@ -657,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)
@@ -669,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
@@ -693,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() {
@@ -735,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
@@ -745,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,
@@ -765,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
@@ -778,6 +846,7 @@
quantity: item.count
}))
if (luggageList.length === 0) {
+ this.amountData = null
return
}
let fromLat = ''
@@ -802,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
})
@@ -821,10 +888,6 @@
}
},
async createOrder() {
- if (!this.agreementChecked) {
- uni.showToast({ title: '璇峰厛闃呰骞跺悓鎰忕敤鎴锋湇鍔″崗璁強闅愮鏀跨瓥', icon: 'none' })
- return
- }
if (this.activeMode === 'local') {
if (!this.selectedStore) {
uni.showToast({ title: '璇烽�夋嫨闂ㄥ簵', icon: 'none' })
@@ -840,8 +903,22 @@
return
}
}
+ if (!this.form.receiver) {
+ uni.showToast({ title: '璇疯緭鍏ユ敹浠朵汉濮撳悕', icon: 'none' })
+ return
+ }
+ if (!this.form.mobile) {
+ uni.showToast({ title: '璇疯緭鍏ユ敹浠朵汉鐢佃瘽', icon: 'none' })
+ return
+ }
+ const mobileRegex = /^1\d{10}$/
+ const landlineRegex = /^\d{3,4}-?\d{7,8}$/
+ if (!mobileRegex.test(this.form.mobile) && !landlineRegex.test(this.form.mobile)) {
+ uni.showToast({ title: '璇疯緭鍏ユ纭殑鎵嬫満鍙锋垨鍥哄畾鐢佃瘽', icon: 'none' })
+ return
+ }
if (!this.form.arriveTime) {
- uni.showToast({ title: '璇烽�夋嫨棰勮鍒板簵鏃堕棿', icon: 'none' })
+ uni.showToast({ title: '璇烽�夋嫨鍒板簵瀵勫瓨鏃堕棿', icon: 'none' })
return
}
if (!this.form.pickupTime) {
@@ -849,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
@@ -860,6 +937,26 @@
}))
if (luggageList.length === 0) {
uni.showToast({ title: '璇烽�夋嫨琛屾潕绫诲瀷', icon: 'none' })
+ return
+ }
+ if (!this.form.goodType) {
+ uni.showToast({ title: '璇烽�夋嫨鐗╁搧淇℃伅', icon: 'none' })
+ return
+ }
+ if (!this.form.goodsImages ||!this.form.goodsImages.length) {
+ uni.showToast({ title: '璇蜂笂浼犵墿鍝佺収鐗�', icon: 'none' })
+ return
+ }
+ if (!this.form.goodsImages ||!this.form.goodsImages.length) {
+ uni.showToast({ title: '璇蜂笂浼犵墿鍝佺収鐗�', icon: 'none' })
+ return
+ }
+ if (this.form.insurance === '' || this.form.insurance <= 0) {
+ uni.showToast({ title: '璇疯緭鍏ヤ繚浠疯垂', icon: 'none' })
+ return
+ }
+ if (!this.agreementChecked) {
+ uni.showToast({ title: '璇峰厛闃呰骞跺悓鎰忕敤鎴锋湇鍔″崗璁強闅愮鏀跨瓥', icon: 'none' })
return
}
const items = luggageList.map(item => ({
@@ -925,9 +1022,11 @@
} else {
uni.showToast({ title: '鏀粯澶辫触', icon: 'none' })
}
- uni.redirectTo({
- url: '/pages/delivery-order-detail/delivery-order-detail?id=' + orderId
+ uni.setStorageSync("orderStatus",-2)
+ uni.switchTab({
+ url: '/pages/itinerary/itinerary'
});
+
}
})
}
@@ -967,8 +1066,8 @@
position: relative;
width: 50%;
text-align: center;
- font-size: 28rpx;
- font-weight: 500;
+ font-weight: 600;
+ font-size: 32rpx;
color: #9097a3;
}
@@ -1001,8 +1100,7 @@
.store-popup-wrap {
background: #ffffff;
border-radius: 24rpx 24rpx 0 0;
- padding: 0 30rpx;
- box-sizing: border-box;
+ padding: 0 30rpx 16rpx 30rpx;
box-sizing: border-box;
}
@@ -1126,16 +1224,20 @@
.store-option-address-row {
margin-top: 8rpx;
display: flex;
- align-items: center;
+ align-items: flex-start;
+ flex-wrap: wrap;
}
.store-option-address-icon {
+ flex-shrink: 0;
width: 24rpx;
height: 24rpx;
margin-right: 4rpx;
+ margin-top: 6rpx;
}
.store-option-address {
+ flex: 1;
font-size: 26rpx;
color: #9ea4af;
}
@@ -1444,7 +1546,7 @@
.luggage-item {
display: flex;
- align-items: baseline;
+ align-items: flex-end;
justify-content: space-between;
padding: 24rpx;
box-sizing: border-box;
@@ -1470,6 +1572,9 @@
height: 100rpx;
border-radius: 8rpx;
margin-right: 18rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
background: #f0f1f4;
overflow: hidden;
margin-right: 24rpx;
@@ -1715,6 +1820,9 @@
font-weight: 500;
color: #333333;
border: 2rpx solid transparent;
+ white-space: nowrap; /* 闃叉鏂囨湰鎹㈣ */
+ overflow: hidden; /* 闅愯棌婧㈠嚭鐨勫唴瀹� */
+ text-overflow: ellipsis; /* 鏄剧ず鐪佺暐鍙锋潵浠h〃琚慨鍓殑鏂囨湰 */
box-sizing: border-box;
}
@@ -1832,7 +1940,7 @@
padding-bottom: 14rpx;
display: flex;
align-items: center;
- justify-content: flex-end;
+ justify-content: space-between;
font-size: 22rpx;
}
@@ -1840,6 +1948,12 @@
color: #999999;
}
+ .insurance-tip-warning {
+ color: #ff4d4f;
+ font-size: 22rpx;
+ font-weight: 400;
+ }
+
.insurance-tip-value {
margin-left: 8rpx;
color: #ff4d4f;
--
Gitblit v1.9.3