This commit is contained in:
qiuyuan 2025-08-13 10:53:10 +08:00
parent 0cc0a04508
commit 5d3f1b9c81
4 changed files with 51 additions and 55 deletions

View File

@ -434,54 +434,42 @@
}, },
handleStartTimeConfirm(e) { handleStartTimeConfirm(e) {
// uViewdatetime-pickere.value
const date = new Date(e.value); const date = new Date(e.value);
//
const padZero = num => num.toString().padStart(2, '0');
const year = date.getFullYear(); const year = date.getFullYear();
const month = padZero(date.getMonth() + 1); // const month = String(date.getMonth() + 1).padStart(2, '0');
const day = padZero(date.getDate()); // const day = String(date.getDate()).padStart(2, '0');
const hours = padZero(date.getHours()); // const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const dateString = this.mode === 'year-month' ? this.startTime = `${year}-${month}-${day} ${hours}:${minutes}`;
`${year}-${month}` // 2023-01
:
`${year}-${month}-${day} ${hours}:00`; // 2023-01-02 09:00
// this.startTime = dateString;
// this.startTimePickerValue = dateString;
// this.showStartTimePicker = false;
this.startTime = `2025-08-${e.day} ${e.hour}:00`;
this.startTimePickerValue = this.startTime; this.startTimePickerValue = this.startTime;
this.showStartTimePicker = false; this.showStartTimePicker = false;
//
if (new Date(this.endTime) < new Date(this.startTime)) {
const endDate = new Date(date.getTime() + 60 * 60 * 1000); // 1
this.endTime = `${endDate.getFullYear()}-${String(endDate.getMonth() + 1).padStart(2, '0')}-${String(endDate.getDate()).padStart(2, '0')} ${String(endDate.getHours()).padStart(2, '0')}:${String(endDate.getMinutes()).padStart(2, '0')}`;
this.endTimePickerValue = this.endTime;
}
}, },
handleEndTimeConfirm(e) { handleEndTimeConfirm(e) {
const date = new Date(e.value); const date = new Date(e.value);
//
const padZero = num => num.toString().padStart(2, '0');
const year = date.getFullYear(); const year = date.getFullYear();
const month = padZero(date.getMonth() + 1); // const month = String(date.getMonth() + 1).padStart(2, '0');
const day = padZero(date.getDate()); // const day = String(date.getDate()).padStart(2, '0');
const hours = padZero(date.getHours()); // const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const dateString = this.mode === 'year-month' ? this.endTime = `${year}-${month}-${day} ${hours}:${minutes}`;
`${year}-${month}` // 2023-01
:
`${year}-${month}-${day} ${hours}:00`; // 2023-01-02 09:00
// this.endTime = dateString;
// this.endTimePickerValue = dateString;
// this.showEndTimePicker = false;
this.endTime = `2025-08-${e.day} ${e.hour}:00`;
this.endTimePickerValue = this.endTime; this.endTimePickerValue = this.endTime;
this.showEndTimePicker = false; this.showEndTimePicker = false;
console.log('格式化后的结束时间:', this.endTime); //
// this.validateTime(); // this.validateTime();
}, },
adjustEndTime() { adjustEndTime() {

View File

@ -668,7 +668,7 @@
padding: 20rpx; padding: 20rpx;
min-height: 100vh; min-height: 100vh;
box-sizing: border-box; box-sizing: border-box;
padding-bottom: 190rpx; padding-bottom: calc(190rpx + 100rpx + 80rpx);
} }
.user-info-card { .user-info-card {
background: #fff; background: #fff;

View File

@ -17,7 +17,9 @@
</view> </view>
<view class="right" @click="goPage('helpInfo','')"> <view class="right" @click="goPage('helpInfo','')">
<view class="right-icon">+</view> <view class="">
<u-icon name="plus-circle" color="#2979ff" size="50"></u-icon>
</view>
<view class="right-font">发帖</view> <view class="right-font">发帖</view>
</view> </view>
</view> </view>

View File

@ -156,8 +156,14 @@ export default {
methods: { methods: {
// //
validatePhone() { validatePhone() {
if (!this.customerPhone) return true;
const phoneReg = /^1[3-9]\d{9}$/; const phoneReg = /^1[3-9]\d{9}$/;
if (!this.customerPhone) {
uni.showToast({
title: '请填写联系电话',
icon: 'none'
});
return false;
}
if (!phoneReg.test(this.customerPhone)) { if (!phoneReg.test(this.customerPhone)) {
uni.showToast({ uni.showToast({
title: '请输入正确的手机号码', title: '请输入正确的手机号码',