Commit f4947fdf30877617272c7dc1dc30098b86787bc1

Authored by vking
1 parent aa6fcd9d

使用默认时间

@@ -146,8 +146,14 @@ Page({ @@ -146,8 +146,14 @@ Page({
146 146
147 let timeObj = await comm.getTimeSpaceIndexData(d); 147 let timeObj = await comm.getTimeSpaceIndexData(d);
148 //form.time=await comm.getTimeSpaceIndex(d); 148 //form.time=await comm.getTimeSpaceIndex(d);
149 - form.time = timeObj.timeIndex; 149 + //如果小于默认时间,使用默认时间
  150 + let mmii = util.unixtoTime(d,'HH:II')
  151 + if (mmii < this.data.defDtime[timeObj.timeIndex]) {
  152 + let str=util.unixtoTime(d, 'YYYY-MM-DD '+this.data.defDtime[timeObj.timeIndex]+':00')
  153 + timeObj = await comm.getTimeSpaceIndexData(util.timetouUnix(str));
  154 + }
150 155
  156 + form.time = timeObj.timeIndex;
151 let ind = dateStr._indexOf(nowStr); 157 let ind = dateStr._indexOf(nowStr);
152 if (ind > -1) { 158 if (ind > -1) {
153 form.date = ind 159 form.date = ind
@@ -163,6 +169,7 @@ Page({ @@ -163,6 +169,7 @@ Page({
163 timePickerIndex: timePickerIndex, 169 timePickerIndex: timePickerIndex,
164 timeOpt: timeObj.timeOpt, 170 timeOpt: timeObj.timeOpt,
165 }; 171 };
  172 +
166 this.setData(obj) 173 this.setData(obj)
167 return obj; 174 return obj;
168 175