fix 自动提交不等待整点
This commit is contained in:
parent
f3af1b9acb
commit
582b05526c
@ -24,7 +24,7 @@
|
|||||||
var ignoreIllegalData = currentProfile.ignoreIllegalData;
|
var ignoreIllegalData = currentProfile.ignoreIllegalData;
|
||||||
|
|
||||||
if (ignoreIllegalData) {
|
if (ignoreIllegalData) {
|
||||||
trainList = _.filter(trainList, _.matcher({ maybeIllegal: false }));
|
trainList = _.filter(trainList, _.matcher({maybeIllegal: false}));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (seatFirst) {
|
if (seatFirst) {
|
||||||
@ -32,7 +32,7 @@
|
|||||||
seat = _.find(seatOrder, function (s) {
|
seat = _.find(seatOrder, function (s) {
|
||||||
var treg = _.find(trainFilter, function (t) {
|
var treg = _.find(trainFilter, function (t) {
|
||||||
train = _.find(trainList, function (item) {
|
train = _.find(trainList, function (item) {
|
||||||
return t.test(item.code) && (_.findWhere(item.tickets, { code: s }) || {}).count >= count;
|
return item.available == 1 && t.test(item.code) && (_.findWhere(item.tickets, {code: s}) || {}).count >= count;
|
||||||
});
|
});
|
||||||
return typeof (train) != 'undefined';
|
return typeof (train) != 'undefined';
|
||||||
});
|
});
|
||||||
@ -43,7 +43,7 @@
|
|||||||
_.find(trainFilter, function (t) {
|
_.find(trainFilter, function (t) {
|
||||||
seat = _.find(seatOrder, function (s) {
|
seat = _.find(seatOrder, function (s) {
|
||||||
train = _.find(trainList, function (item) {
|
train = _.find(trainList, function (item) {
|
||||||
return t.test(item.code) && (_.findWhere(item.tickets, { code: s }) || {}).count >= count;
|
return item.available == 1 && t.test(item.code) && (_.findWhere(item.tickets, {code: s}) || {}).count >= count;
|
||||||
});
|
});
|
||||||
return typeof (train) != 'undefined';
|
return typeof (train) != 'undefined';
|
||||||
});
|
});
|
||||||
@ -52,7 +52,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (seat)
|
if (seat)
|
||||||
return { seat: seat, train: train };
|
return {seat: seat, train: train};
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,9 @@
|
|||||||
//TODO 没有查到任何车次
|
//TODO 没有查到任何车次
|
||||||
}
|
}
|
||||||
|
|
||||||
var trainRegCache = _.map(expdata.translateTrain(currentProfile.selectedTrain || []), function (s) { return new RegExp("^" + s + "$", "i"); });
|
var trainRegCache = _.map(expdata.translateTrain(currentProfile.selectedTrain || []), function (s) {
|
||||||
|
return new RegExp("^" + s + "$", "i");
|
||||||
|
});
|
||||||
if (!trainRegCache || !trainRegCache.length) {
|
if (!trainRegCache || !trainRegCache.length) {
|
||||||
trainRegCache = [/.*/];
|
trainRegCache = [/.*/];
|
||||||
}
|
}
|
||||||
@ -90,7 +92,7 @@
|
|||||||
//查找结果
|
//查找结果
|
||||||
if (seat) {
|
if (seat) {
|
||||||
//乘客
|
//乘客
|
||||||
var ticketCount = _.findWhere(entry.tickets, { code: seat }).count;
|
var ticketCount = _.findWhere(entry.tickets, {code: seat}).count;
|
||||||
var pcount = Math.min(ticketCount, currentProfile.passengers ? currentProfile.passengers.length : 0);
|
var pcount = Math.min(ticketCount, currentProfile.passengers ? currentProfile.passengers.length : 0);
|
||||||
|
|
||||||
data.auto = {
|
data.auto = {
|
||||||
@ -99,9 +101,13 @@
|
|||||||
passengers: _.first(currentProfile.passengers || [], pcount),
|
passengers: _.first(currentProfile.passengers || [], pcount),
|
||||||
data: entry
|
data: entry
|
||||||
};
|
};
|
||||||
data.auto.passengers.forEach(function (p) { p.seat = data.auto.seat; });
|
data.auto.passengers.forEach(function (p) {
|
||||||
|
p.seat = data.auto.seat;
|
||||||
|
});
|
||||||
if (currentProfile.submitStuAsCommon && !currentProfile.studentTicket) {
|
if (currentProfile.submitStuAsCommon && !currentProfile.studentTicket) {
|
||||||
data.auto.passengers.forEach(function (p) { if (p.passenger_type === "3") p.passenger_type = "1"; });
|
data.auto.passengers.forEach(function (p) {
|
||||||
|
if (p.passenger_type === "3") p.passenger_type = "1";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
data.auto = null;
|
data.auto = null;
|
||||||
@ -315,11 +321,11 @@
|
|||||||
$("#date_loop_editor>span.selected").removeClass("selected");
|
$("#date_loop_editor>span.selected").removeClass("selected");
|
||||||
if (currentDateLoopIndex > sessMgr.currentProfile.dateloop.length - 1) {
|
if (currentDateLoopIndex > sessMgr.currentProfile.dateloop.length - 1) {
|
||||||
sessMgr.currentProfile.depDate = sessMgr.currentProfile.trueDate;
|
sessMgr.currentProfile.depDate = sessMgr.currentProfile.trueDate;
|
||||||
sessMgr.currentProfile.inLoop=false;
|
sessMgr.currentProfile.inLoop = false;
|
||||||
currentDateLoopIndex = -1;
|
currentDateLoopIndex = -1;
|
||||||
} else {
|
} else {
|
||||||
sessMgr.currentProfile.trueDate=sessMgr.currentProfile.depDate;
|
sessMgr.currentProfile.trueDate = sessMgr.currentProfile.depDate;
|
||||||
sessMgr.currentProfile.inLoop=true;
|
sessMgr.currentProfile.inLoop = true;
|
||||||
sessMgr.currentProfile.depDate = sessMgr.currentProfile.dateloop[currentDateLoopIndex];
|
sessMgr.currentProfile.depDate = sessMgr.currentProfile.dateloop[currentDateLoopIndex];
|
||||||
$("#date_loop_editor>span:eq(" + currentDateLoopIndex + ")").addClass("selected");
|
$("#date_loop_editor>span:eq(" + currentDateLoopIndex + ")").addClass("selected");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user