|
|
@@ -175,14 +175,15 @@
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="true">
|
|
|
- <view class="tui-title ">配送日期</view>
|
|
|
- <view class="uni-input" v-if="form.reachDate==''" style="width:400upx;font-size:34upx;" @click="bindDateChange">今天</view>
|
|
|
+ <view class="tui-title">{{ reachDateTitle }}</view>
|
|
|
+ <view class="uni-input placeholder-text" v-if="form.reachDate==''" style="width:400upx;font-size:34upx;" @click="bindDateChange">请选择</view>
|
|
|
<view class="uni-input" @click="bindDateChange" v-else style="width:400upx;font-size:34upx;">{{form.reachDate}}</view>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="openTimePopup">
|
|
|
- <view class="tui-title">配送时间</view>
|
|
|
- <view class="uni-input" style="width:450upx;font-size:34upx;">{{form.reachPeriod}}</view>
|
|
|
+ <view class="tui-title">{{ reachPeriodTitle }}</view>
|
|
|
+ <view class="uni-input placeholder-text" v-if="form.reachPeriod==''" style="width:450upx;font-size:34upx;">请选择</view>
|
|
|
+ <view class="uni-input" v-else style="width:450upx;font-size:34upx;">{{form.reachPeriod}}</view>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
@@ -213,7 +214,7 @@
|
|
|
<uni-popup ref="timePopup" type="bottom" background-color="#fff">
|
|
|
<view class="time-picker-popup">
|
|
|
<view class="popup-header">
|
|
|
- <text class="popup-title">选择配送时间</text>
|
|
|
+ <text class="popup-title">{{ timePopupTitle }}</text>
|
|
|
<text class="popup-close" @click="closeTimePopup">×</text>
|
|
|
</view>
|
|
|
|
|
|
@@ -314,7 +315,7 @@ export default {
|
|
|
defaultPickerDate: '',
|
|
|
form: {
|
|
|
reachDate: "",
|
|
|
- reachPeriod: "20:00",
|
|
|
+ reachPeriod: "",
|
|
|
province: "",
|
|
|
city: "",
|
|
|
floor: "",
|
|
|
@@ -336,7 +337,7 @@ export default {
|
|
|
['00', '01', '02','03','04','05','06','07','08','09','10','11','12','13', '14','15','16','17','18','19','20','21','22','23'],
|
|
|
['00', '05', '10','15','20','25','30','35','40','45','50','55']
|
|
|
],
|
|
|
- selectedHour: '20', // 选中的小时
|
|
|
+ selectedHour: '00', // 选中的小时
|
|
|
selectedMinute: '00', // 选中的分钟
|
|
|
account:0,
|
|
|
showDistance:0,
|
|
|
@@ -478,14 +479,33 @@ export default {
|
|
|
}
|
|
|
return hasPolicy
|
|
|
},
|
|
|
+ reachDateTitle() {
|
|
|
+ return this.form.sendType == 1 ? '取货日期' : '配送日期'
|
|
|
+ },
|
|
|
+ reachPeriodTitle() {
|
|
|
+ return this.form.sendType == 1 ? '取货时间' : '配送时间'
|
|
|
+ },
|
|
|
+ timePopupTitle() {
|
|
|
+ return this.form.sendType == 1 ? '选择取货时间' : '选择配送时间'
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
// 打开时间选择弹框
|
|
|
openTimePopup() {
|
|
|
- // 初始化为当前选中的时间
|
|
|
- const [hour, minute] = this.form.reachPeriod.split(':')
|
|
|
- this.selectedHour = hour
|
|
|
- this.selectedMinute = minute
|
|
|
+ if (this.form.reachPeriod) {
|
|
|
+ const parts = this.form.reachPeriod.split(':')
|
|
|
+ this.selectedHour = parts[0] || '00'
|
|
|
+ this.selectedMinute = parts[1] || '00'
|
|
|
+ } else {
|
|
|
+ const now = new Date()
|
|
|
+ this.selectedHour = String(now.getHours()).padStart(2, '0')
|
|
|
+ const minute = now.getMinutes()
|
|
|
+ const minuteOptions = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55]
|
|
|
+ const nearest = minuteOptions.reduce((prev, curr) => {
|
|
|
+ return Math.abs(curr - minute) < Math.abs(prev - minute) ? curr : prev
|
|
|
+ })
|
|
|
+ this.selectedMinute = String(nearest).padStart(2, '0')
|
|
|
+ }
|
|
|
this.$refs.timePopup.open()
|
|
|
},
|
|
|
// 关闭时间选择弹框
|
|
|
@@ -779,6 +799,14 @@ export default {
|
|
|
this.$msg('请填写收花人名称')
|
|
|
return false
|
|
|
}
|
|
|
+ if(this.$util.isEmpty(this.form.reachDate)){
|
|
|
+ this.$msg('请填写配送日期')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(this.$util.isEmpty(this.form.reachPeriod)){
|
|
|
+ this.$msg('请填写配送时间')
|
|
|
+ return false
|
|
|
+ }
|
|
|
}
|
|
|
this.$util.confirmModal({content:'确认提交?'},() => {
|
|
|
this.submitMyForm()
|
|
|
@@ -1058,6 +1086,9 @@ export default {
|
|
|
margin-right: 20upx;
|
|
|
}
|
|
|
.app-content {
|
|
|
+ .placeholder-text {
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
.affirm-view {
|
|
|
flex: 1;
|
|
|
padding: 20upx;
|