Commit 68c8b1738577ec9be7301636c9580403f7775eda

Authored by vking
1 parent d2eb47d5

使用默认时间

... ... @@ -85,7 +85,7 @@
"navigationBarTextStyle": "white"
},
"networkTimeout": {
"request": 5000,
"request": 10000,
"downloadFile": 10000
},
"tabBar": {
... ...
... ... @@ -95,21 +95,21 @@ Page({
let rev_time=parseInt(nt)
if(options.hasQuick==1){
let rdate=options.ddate.split('-')
if(rev_time<rdate[0] || rev_time>rdate[1]){
if(!(rev_time>=rdate[0] && rev_time<=rdate[1])){
rev_time=rdate[0]
}
await this.setDateStr(rev_time);
}
await this.setDateStr(rev_time);
this.sellerid = util.cache('enter_params')['seller_id'];
let timePickerArray = await comm.getDayTimeSpace();
//判断hasUseDefDtime
let hasUseDefDtime = true;
let mmii = util.unixtoTime(rev_time, 'HH:II');
console.log('initLoad',mmii,this.data.defDtime[this.data.form.time],this.data.defDtime)
console.log('initLoad',mmii > this.data.defDtime[this.data.form.time])
if (mmii > this.data.defDtime[this.data.form.time]) {
hasUseDefDtime = false;
}
//console.log('initLoad::setDateStr',util.unixtoTime(rev_time,'YYYY-MM-DD HH:II'),this.data.defDtime[this.data.form.time])
await this.setDateStr(rev_time,hasUseDefDtime);
this.sellerid = util.cache('enter_params')['seller_id'];
let timePickerArray = await comm.getDayTimeSpace();
this.setData({
timePickerArray: timePickerArray,
speciallist: speciallist,
... ... @@ -128,7 +128,12 @@ Page({
* @param d
*
*/
async setDateStr(d = new Date() / 1000){
async setDateStr(d = new Date() / 1000,hasUseDefDtime=false){
if(hasUseDefDtime){//
let timestr=util.unixtoTime(d,'YYYY-MM-DD '+this.data.defDtime[this.data.form.time])
d=util.timetouUnix(timestr)
}
console.log('setDateStr',util.unixtoTime(d,'YYYY-MM-DD HH:II'),hasUseDefDtime)
this.year=util.unixtoTime(d,'YYYY');
let ns = new Date() / 1000;
let dateStr = [
... ... @@ -302,17 +307,6 @@ Page({
sobj.timePickerMask = true;
}
}
if ('date,time,pnum,pnum_str,tabid'.indexOf(key) > -1) {
if (!displayTimes) {
//sobj.form.tid = []; //切换日期时间清空桌位
//sobj.buttonhide = true;
this.getTables();
}
if (key == 'date') {
let xtime = util.unixtoTime(new Date() / 1000, 'YYYY-' + (this.data.dateStr[val].substr(0, 5)) + ' HH:II:SS');
this.setDateStr(util.timetouUnix(xtime));
}
}
//判断hasUseDefDtime
if ((key == 'time' || key == 'date') && !sobj.timePickerMask) {
sobj.hasUseDefDtime = true
... ... @@ -323,6 +317,18 @@ Page({
sobj.hasUseDefDtime = false;
}
}
if ('date,time,pnum,pnum_str,tabid'.indexOf(key) > -1) {
if (!displayTimes) {
//sobj.form.tid = []; //切换日期时间清空桌位
//sobj.buttonhide = true;
this.getTables();
}
if (key == 'date') {
let xtime = util.unixtoTime(new Date() / 1000, 'YYYY-' + (this.data.dateStr[val].substr(0, 5)) + ' HH:II:SS');
this.setDateStr(util.timetouUnix(xtime),sobj.hasUseDefDtime);
}
}
this.setData(sobj)
},
async getTables(){
... ... @@ -695,6 +701,7 @@ Page({
this.year=util.unixtoTime(options.ddate.substr(0,10),'YYYY');
let form=this.data.form
form.tid=[options.tid]
this.setData({
form: form,
})
... ...