mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-06-11 06:07:24 +08:00
修复 业主小程序端:报修时候选择预约日期及时间,当下之前的日期及时间应该灰掉,不能选择过往日期及时间 bug
This commit is contained in:
parent
6d2c08a96f
commit
cca6a2d45d
@ -39,6 +39,18 @@ export function formatTime(date) {
|
|||||||
const second = date.getSeconds();
|
const second = date.getSeconds();
|
||||||
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':');
|
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':');
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 将时间转换为 字符串
|
||||||
|
* @desc: 格式化时间
|
||||||
|
* @return: eg: '2018/04/09 21:31:00'
|
||||||
|
* @param {Date对象} date
|
||||||
|
*/
|
||||||
|
export function formatHourAndMin(date) {
|
||||||
|
const hour = date.getHours();
|
||||||
|
const minute = date.getMinutes();
|
||||||
|
return [hour, minute].map(formatNumber).join(':');
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 将日期转换为 字符串
|
* 将日期转换为 字符串
|
||||||
* @desc: 格式化日期
|
* @desc: 格式化日期
|
||||||
|
|||||||
@ -56,7 +56,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group arrow">
|
<view class="cu-form-group arrow">
|
||||||
<view class="title">预约日期</view>
|
<view class="title">预约日期</view>
|
||||||
<picker mode="date" :value="bindDate" start="2020-09-01" end="2050-09-01" @change="dateChange">
|
<picker mode="date" :value="bindDate" :start="todayDate" end="2050-09-01" @change="dateChange">
|
||||||
<view class="picker">
|
<view class="picker">
|
||||||
{{bindDate}}
|
{{bindDate}}
|
||||||
</view>
|
</view>
|
||||||
@ -64,7 +64,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group arrow">
|
<view class="cu-form-group arrow">
|
||||||
<view class="title">预约时间</view>
|
<view class="title">预约时间</view>
|
||||||
<picker mode="time" :value="bindTime" start="08:30" end="22:00" @change="timeChange">
|
<picker mode="time" :value="bindTime" :start="todayDateTime" end="22:00" @change="timeChange">
|
||||||
<view class="picker">
|
<view class="picker">
|
||||||
{{bindTime}}
|
{{bindTime}}
|
||||||
</view>
|
</view>
|
||||||
@ -113,6 +113,7 @@
|
|||||||
import context from '../../lib/java110/Java110Context.js'
|
import context from '../../lib/java110/Java110Context.js'
|
||||||
const constant = context.constant;
|
const constant = context.constant;
|
||||||
const factory = context.factory;
|
const factory = context.factory;
|
||||||
|
import {formatDate,formatHourAndMin} from '@/lib/java110/utils/DateUtil.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@ -169,6 +170,8 @@
|
|||||||
unitNum: '',
|
unitNum: '',
|
||||||
unitId: '',
|
unitId: '',
|
||||||
priceScope: '',
|
priceScope: '',
|
||||||
|
todayDate:'',
|
||||||
|
todayDateTime:''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -199,6 +202,8 @@
|
|||||||
|
|
||||||
//加载报修类型
|
//加载报修类型
|
||||||
this._loadRepairTypes();
|
this._loadRepairTypes();
|
||||||
|
this.todayDate = formatDate(new Date());
|
||||||
|
this.todayDateTime = formatHourAndMin(new Date())
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user