Commit d82afe19 authored by leiqingsong's avatar leiqingsong

时间选择器限制范围

parent 2b9d5df6
......@@ -21,6 +21,7 @@
<van-datetime-picker
v-model="startTime"
type="datetime"
:min-date="minStartDate"
@cancel="startShow = false"
@confirm="handleStartTime"
@change="startTimeChange"
......@@ -43,6 +44,7 @@
<van-datetime-picker
v-model="endTime"
type="datetime"
:min-date="minEndDate"
@cancel="endShow = false"
@confirm="handleEndTime"
@change="endTimeChange"
......@@ -137,6 +139,8 @@ import * as API_Active from "@/api/active";
export default {
data() {
return {
minStartDate: null,
minEndDate: null,
checked_coupon: {},
logo_imgs: [],
bg_imgs: [],
......@@ -167,6 +171,10 @@ export default {
totalLimit_show: false
};
},
created() {
this.minStartDate = new Date();
this.minEndDate = new Date((new Date()/1000+86400)*1000);
},
methods: {
getTemplateDate(id) {
API_Active.getTemplateData(id).then(res => {
......
......@@ -26,6 +26,7 @@
<van-datetime-picker
v-model="basicInfo.startTime"
type="datetime"
:min-date="minStartDate"
@cancel="basicInfo.startShow = false"
@confirm="handleBasicSTime"
@change="startTimeChange"
......@@ -48,6 +49,7 @@
<van-datetime-picker
v-model="basicInfo.endTime"
type="datetime"
:min-date="minEndDate"
@cancel="basicInfo.endShow = false"
@confirm="handleBasicETime"
@change="endTimeChange"
......@@ -268,6 +270,8 @@ import { Toast } from "vant";
export default {
data() {
return {
minStaetDate: null,
minEndDate: null,
// 选择优惠券 当前下标
current_index: -1,
logo_imgs: [],
......@@ -346,6 +350,10 @@ export default {
confirmTime: new Date()
};
},
created() {
this.minStartDate = new Date();
this.minEndDate = new Date((new Date()/1000+86400)*1000);
},
methods: {
// 获取模板数据
getTemplateDate(id) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment