@@ -1092,7 +1092,21 @@
-
+
+
+
鍙岄噸淇濋櫓锛寰俊鎵竴鎵
+
+ 鎵嬫満鍚屾鎻愰啋
+ 鎶㈢エ杩涘害鈫
+
+
+
+
+
+ 鎶㈢エ鎻愰啋瀵嗛挜锛
+ 锛堝湪鍏虫敞寰俊鍚庢寜鎻愰啋杈撳叆鐨勫摝锛
+
+
diff --git a/Web12306/js/account/sessionMgr.js b/Web12306/js/account/sessionMgr.js
index 8da5d94..eb63fe9 100644
--- a/Web12306/js/account/sessionMgr.js
+++ b/Web12306/js/account/sessionMgr.js
@@ -215,7 +215,8 @@
selectedSeatType: [],
selectedTrain: [],
dateloop: [],
- passengers: []
+ passengers: [],
+ hideNoSeat: false
};
Object.defineProperty(this, "current", {
diff --git a/Web12306/js/otn/orderprocess.js b/Web12306/js/otn/orderprocess.js
index 18ee21d..e450419 100644
--- a/Web12306/js/otn/orderprocess.js
+++ b/Web12306/js/otn/orderprocess.js
@@ -193,7 +193,10 @@
train.from.name,
train.to.name,
train.date,
- passenger[0].seat
+ passenger[0].seat,
+ passenger.length,
+ train.byAuto ? 1 : 0,
+ train.suggest ? 1 : 0
]);
}
}, function () {
@@ -358,7 +361,10 @@
train.from.name,
train.to.name,
train.date,
- passenger[0].seat
+ passenger[0].seat,
+ passenger.length,
+ train.byAuto ? 1 : 0,
+ train.suggest ? 1 : 0
]);
}
}, function () {
diff --git a/Web12306/js/otn/queryticket.js b/Web12306/js/otn/queryticket.js
index 7899668..e0c6a8a 100644
--- a/Web12306/js/otn/queryticket.js
+++ b/Web12306/js/otn/queryticket.js
@@ -20,17 +20,17 @@
var sc = m[1];
var sp = m[2][0] == '*' ? null : parseInt(m[2], 10);
var st = parseInt(m[3], 10);
- var seat = { code: sc, name: param.toSeatTypeName(sc), price: sp };
+ var seat = { code: sc, name: param.toSeatTypeName(sc), price: sp, selected: false };
if (st < 3000) {
seat.count = st;
//TODO 浜岀瓑杞骇鎻愪氦鏄惁鍜屼簩绛夊骇涓鏍烽兘鐢ㄧ殑MO锛
//涓绛夎蒋搴 7锛 浜岀瓑杞骇 8
if (sc === "7") {
- data.push({ code: 'M', name: param.toSeatTypeName('M'), price: sp, count: st });
+ data.push({ code: 'M', name: param.toSeatTypeName('M'), price: sp, count: st, selected: false });
}
else if (sc === "8") {
- data.push({ code: 'O', name: param.toSeatTypeName('O'), price: sp, count: st });
+ data.push({ code: 'O', name: param.toSeatTypeName('O'), price: sp, count: st, selected: false });
} else {
data.push(seat);
}
diff --git a/Web12306/js/otn/trainfilter.js b/Web12306/js/otn/trainfilter.js
index 2898b38..4ccf348 100644
--- a/Web12306/js/otn/trainfilter.js
+++ b/Web12306/js/otn/trainfilter.js
@@ -22,7 +22,7 @@
expdata.log("寮濮嬭繃婊よ溅娆");
_.each(data.available, function (t) {
t.selected = false;
-
+ t.hasSeat = false;
});
//杞︽绫诲瀷杩囨护
if (currentProfile.trainTypes && currentProfile.trainTypes.length) {
@@ -99,6 +99,25 @@
});
}
}
+ if (currentProfile.selectedSeatType && currentProfile.selectedSeatType.length) {
+ var filtered4 = _.filter(data.available, function (e) {
+ return !(e.hasSeat = currentProfile.selectedSeatType.some(function (x) {
+ var o = e.ticketMap[x];
+ if (o && o.count)
+ o.selected = true;
+ return o || false;
+ }));
+ });
+ if (currentProfile.hideNoSeat) {
+ data.available = _.difference(data.available, filtered4);
+ $.each(filtered4, function () {
+ this.reason = 6;
+ data.filtered.push(this);
+ if (LOG_PROCESS)
+ expdata.log("杞︽銆" + this.code + "銆戜笉娌℃湁鎸囧畾鐨勮溅娆¤岃杩囨护銆");
+ });
+ }
+ }
data.include = data.available;
if (currentProfile.hideNoTicket) {
@@ -120,8 +139,20 @@
//鏄惁閫夋嫨锛->鏈夌エ->鏈捣鍞->鏃犵エ
if (data.available) {
data.available.sort(function (x, y) {
- if (x.selected ^ y.selected)
- return x.selected ? -1 : 1;
+ if (currentProfile.selectSeatFirst) {
+ if (x.hasSeat ^ y.hasSeat)
+ return x.hasSeat ? -1 : 1;
+
+ if (x.selected ^ y.selected)
+ return x.selected ? -1 : 1;
+ } else {
+ if (x.selected ^ y.selected)
+ return x.selected ? -1 : 1;
+
+ if (x.hasSeat ^ y.hasSeat)
+ return x.hasSeat ? -1 : 1;
+ }
+
if (x.available === 1 ^ y.available === 1)
return x.available === 1 ? -1 : 1;
if (x.available === -1 ^ y.available === -1)
diff --git a/Web12306/js/otn/trainstationsuggest.js b/Web12306/js/otn/trainstationsuggest.js
index cf98b31..e268acc 100644
--- a/Web12306/js/otn/trainstationsuggest.js
+++ b/Web12306/js/otn/trainstationsuggest.js
@@ -177,7 +177,7 @@
lastQuerySuggest = null;
};
this.checkTrainSuggestion = function () {
- var suggestKey = cp.fromCode + cp.toCode + ((cp.selectedTrain || []).join("|"));
+ var suggestKey = cp.fromCode + cp.toCode + ((cp.selectedTrain || []).join("|")) + ((cp.selectedSeatType || []).join("|"));
if (suggestKey === cachedSuggest.key) {
if (!lastQuerySuggest || (new Date() - lastQuerySuggest) > data.suggestRefreshInterval) {
@@ -199,6 +199,12 @@
if ((t.from.endpoint && t.to.endpoint) || t.available < 0)
return false;
+ //濡傛灉璁剧疆浜嗗腑鍒紝骞朵笖璁剧疆鐨勫腑鍒兘娌℃湁锛屽垯涓嶈冭檻
+ if (cp.selectedSeatType && cp.selectedSeatType.length) {
+ if (!cp.selectedSeatType.some(function(x) { return t.tickets[x] || false; }))
+ return false;
+ }
+
return true;
});
if (!alltrains.length)
diff --git a/Web12306/js/ui/chat/roomsession.js b/Web12306/js/ui/chat/roomsession.js
index aa4095c..235072d 100644
--- a/Web12306/js/ui/chat/roomsession.js
+++ b/Web12306/js/ui/chat/roomsession.js
@@ -65,7 +65,7 @@
port.postMessage("enterChatRoom", room);
}
- port.track(param.trackTypes.JOIN_CHAT);
+ ep.track(param.trackTypes.JOIN_CHAT);
};
this.refreshOnlineCount = function () {
page.find(">header>span:eq(1)").html("褰撳墠鍦ㄧ嚎 " + room.onlinecount + " 浜");
@@ -76,7 +76,7 @@
port.postMessage("disconnectChatRoom");
that.fireEvent("exitRoom");
- port.track(param.trackTypes.EXIT_CHAT);
+ ep.track(param.trackTypes.EXIT_CHAT);
};
this.appendMessageItem = function (html) {
chatListContainer.append(html);
diff --git a/Web12306/js/ui/index.js b/Web12306/js/ui/index.js
index 4826fae..d33408d 100644
--- a/Web12306/js/ui/index.js
+++ b/Web12306/js/ui/index.js
@@ -36,6 +36,12 @@
//鑷姩鍒锋柊鍛
var autorefresh = require("./ui-autorefresh.js");
autorefresh.on("requestQueryTicket", function () {
+ var cp = sessMgr.currentProfile;
+ if (!cp.fromCode || !cp.toCode || !cp.depDate) {
+ mp.showMessagePopup("error", "浜诧紝杩樻病鏈夎缃煡璇㈢殑鏉′欢鍝︺");
+ autorefresh.stop();
+ return;
+ }
ui_result.load();
});
@@ -208,7 +214,24 @@
}
//track
- port.track(param.trackTypes.QUERY_TICKET, [cp.fromCode, cp.fromText, cp.toCode, cp.toText, cp.depDate, cp.studentTicket + '']);
+ port.track(param.trackTypes.QUERY_TICKET, [
+ cp.fromCode,
+ cp.fromText,
+ cp.toCode,
+ cp.toText,
+ cp.depDate,
+ cp.studentTicket + '',
+ (cp.selectedSeatType && cp.selectedSeatType.length) || 0,
+ (cp.selectedTrain && cp.selectedTrain.length) || 0
+ (cp.passengers && cp.passengers.length) || 0,
+ (cp.dateloop && cp.dateloop.length) || 0,
+ cp.hideNoTicket ? 1 : 0,
+ cp.hideNotInListTrain ? 1 : 0,
+ cp.autoWaitToSell ? 1 : 0,
+ cp.tryBottomSeat ? 1 : 0,
+ cp.selectSeatFirst ? 1 : 0,
+ cp.autoSubmitEnabled ? 1 : 0
+ ]);
});
@@ -257,6 +280,13 @@
//鏈嶅姟鍣ㄥ姞閫
require("./ui-dnsspeeding.js");
+ setTimeout(function () {
+ $("#wx_sell_notification").showModalDialog({
+ title: "鎴愬姛璁㈤槄鎻愰啋",
+ width: 'auto'
+ });
+ }, 1000);
+
//$("#passenger_editor").showModalDialog({
// title: "鏂板鑱旂郴浜",
// buttons: [
diff --git a/Web12306/js/ui/ui-autorefresh.js b/Web12306/js/ui/ui-autorefresh.js
index 8e25d6c..29f4bd5 100644
--- a/Web12306/js/ui/ui-autorefresh.js
+++ b/Web12306/js/ui/ui-autorefresh.js
@@ -161,7 +161,24 @@
//track
var cp = sessMgr.currentProfile;
- port.track(expdata.trackTypes.START_AUTOREFRESH, [cp.fromCode, cp.fromText, cp.toCode, cp.toText, cp.depDate, cp.studentTicket + '']);
+ port.track(expdata.trackTypes.START_AUTOREFRESH, [
+ cp.fromCode,
+ cp.fromText,
+ cp.toCode,
+ cp.toText,
+ cp.depDate,
+ cp.studentTicket + '',
+ (cp.selectedSeatType && cp.selectedSeatType.length) || 0,
+ (cp.selectedTrain && cp.selectedTrain.length) || 0
+ (cp.passengers && cp.passengers.length) || 0,
+ (cp.dateloop && cp.dateloop.length) || 0,
+ cp.hideNoTicket ? 1 : 0,
+ cp.hideNotInListTrain ? 1 : 0,
+ cp.autoWaitToSell ? 1 : 0,
+ cp.tryBottomSeat ? 1 : 0,
+ cp.selectSeatFirst ? 1 : 0,
+ cp.autoSubmitEnabled ? 1 : 0
+ ]);
}
inAutoRefresh = true;
diff --git a/Web12306/js/ui/ui-dnsspeeding.js b/Web12306/js/ui/ui-dnsspeeding.js
index 858c9c6..5cf272c 100644
--- a/Web12306/js/ui/ui-dnsspeeding.js
+++ b/Web12306/js/ui/ui-dnsspeeding.js
@@ -1,18 +1,18 @@
锘縟efine(function (require, exports, module) {
var port = require("../platform/extensionPort.js");
var isValid = 0;
- var serverSpan = $("span.net-tips");
+ var serverSpan = $("div.net-tips");
var sysConfig = null;
var checkSpeedTimer = null;
var refreshSpeed = function () {
- chrome.runtime.sendMessage({ action: "getCurrentServer" }, function (m) {
+ port.sendMessage({ action: "getCurrentServer" }, function (m) {
var data = m["kyfw.12306.cn"];
var speed = data.speed;
//var cls = speed === 0 ? "label-default" : speed < 0 ? "label-danger" : speed < 100 ? "label-success" : speed < 400 ? "label-warning" : "label-danger";
- serverSpan.find("strong:eq(1)").html(speed > 0 ? speed + " 姣" + (data.rate ? " (鍔犻" + data.rate + "%)" : "") : speed < 0 ? "鏃犳硶杩炴帴" : "姝e湪甯綘娴嬮...");
- serverSpan.find("strong:eq(1)").html(data.ip ? "榛樿鏈嶅姟鍣" : data.ip);
+ serverSpan.find("strong:eq(1)").html(speed > 0 ? speed + " 姣" + (data.rate ? " (鍔犻" + data.rate + "%)" : "") : speed < 0 ? "鏃犳硶杩炴帴" : "姝e湪娴嬮...");
+ serverSpan.find("strong:eq(0)").html(!data.ip ? "榛樿鏈嶅姟鍣" : data.ip);
});
};
var checkStatus = function () {
@@ -20,17 +20,19 @@
if (isValid <= 0) {
$("#swDnsSpeeding").hide();
} else {
+ $("#swDnsSpeeding").show();
if (sysConfig.enableServerAutoChange) {
serverSpan.show();
- $("#swDnsSpeeding").val("鍏抽棴鍔犻");
+ $("#swDnsSpeeding").html("鍏抽棴鍔犻");
refreshSpeed();
} else {
- $("#swDnsSpeeding").val("鍚敤鍔犻");
+ $("#swDnsSpeeding").html("鍚敤鍔犻");
}
}
if (isValid > 0) {
if (!checkSpeedTimer)
checkSpeedTimer = setInterval(refreshSpeed, 3000);
+ port.sendMessage({ action: "triggerUpdate" });
} else {
if (checkSpeedTimer) {
clearInterval(checkSpeedTimer);
@@ -44,20 +46,20 @@
});
var checkServerValid = function () {
- port.sendMessage({ action: "servervalid" }, function (valid) {
- isValid = valid;
+ port.sendMessage({ action: "servervalid" }, function (r) {
+ isValid = r.valid;
checkStatus();
});
};
- port.port.on("sysConfigUpdate", function (data) {
+ port.port.on("sysConfigUpdate", function (e, data) {
sysConfig = data;
checkStatus();
});
var reloadSysConfig = function () {
port.sendMessage({ action: "getSysConfig" }, function (data) {
- sysConfig = data;
+ sysConfig = data.detail;
checkServerValid();
});
};
diff --git a/Web12306/js/ui/ui-submit-order.js b/Web12306/js/ui/ui-submit-order.js
index 1207df0..752f1c1 100644
--- a/Web12306/js/ui/ui-submit-order.js
+++ b/Web12306/js/ui/ui-submit-order.js
@@ -94,7 +94,10 @@
pTrain.from.name,
pTrain.to.name,
pTrain.date,
- pPassengers[0].seat
+ pPassengers[0].seat,
+ pPassengers.length,
+ pTrain.byAuto ? 1 : 0,
+ pTrain.suggest ? 1 : 0
]);
submitBtn[0].disabled = true;
@@ -116,7 +119,10 @@
pTrain.from.name,
pTrain.to.name,
pTrain.date,
- pPassengers[0].seat
+ pPassengers[0].seat,
+ pPassengers.length,
+ pTrain.byAuto ? 1 : 0,
+ pTrain.suggest ? 1 : 0
]);
});
submitDef.fail(function (data) {
@@ -140,7 +146,10 @@
pTrain.from.name,
pTrain.to.name,
pTrain.date,
- pPassengers[0].seat
+ pPassengers[0].seat,
+ pPassengers.length,
+ pTrain.byAuto ? 1 : 0,
+ pTrain.suggest ? 1 : 0
]);
});
submitDef.progress(function (data) {
diff --git a/Web12306/js/ui/ui-trainlist.js b/Web12306/js/ui/ui-trainlist.js
index 5051d95..9217b14 100644
--- a/Web12306/js/ui/ui-trainlist.js
+++ b/Web12306/js/ui/ui-trainlist.js
@@ -57,6 +57,12 @@
date = date || sessMgr.currentProfile.depDate;
stu = stu || sessMgr.currentProfile.studentTicket;
+ if (!from || !to || !date) {
+ mp.showMessagePopup("error", "浜诧紝杩樻病鏈夎缃煡璇㈢殑鏉′欢鍝︺");
+ return;
+ }
+
+
var extArg = Array.prototype.slice.call(arguments);
__.fireEvent("onload", extArg);
datebar.go(date, date);
@@ -157,6 +163,7 @@
if (this.dataset.suggest) {
train = trainSuggest.findTrain(this.dataset.sec);
+ train.suggest = true;
bySuggest = true;
} else {
train = _.findWhere(queryResult.original, { id: id });
@@ -174,23 +181,23 @@
if (cp.submitStuAsCommon && !cp.studentTicket) {
pas.forEach(function (p) { if (p.passenger_type == "3") p.passenger_type = "1"; });
}
-
+ train.byAuto = true;
__.dispatchEvent("requireSubmitOrder", {
train: train,
seat: seatcode,
passengers: pas
});
- if (bySuggest) {
- port.track(param.trackTypes.SUBMIT_ORDER_BY_SUGGESTIONI, [
- train.code,
- train.from.name,
- train.to.name,
- train.date,
- seatcode
- ]);
+ //if (bySuggest) {
+ // port.track(param.trackTypes.SUBMIT_ORDER_BY_SUGGESTIONI, [
+ // train.code,
+ // train.from.name,
+ // train.to.name,
+ // train.date,
+ // seatcode
+ // ]);
- }
+ //}
});
};
init();
diff --git a/Web12306/js/ui/widget_modalDialog.js b/Web12306/js/ui/widget_modalDialog.js
index 6948cc1..af9a67d 100644
--- a/Web12306/js/ui/widget_modalDialog.js
+++ b/Web12306/js/ui/widget_modalDialog.js
@@ -68,6 +68,12 @@
});
}
});
+ if (!options.buttons || !options.buttons.length) {
+ buttonContainer.remove();
+ }
+ if (options.width) {
+ template.css("width", options.width);
+ }
widget.showFloatDialog(template);
diff --git a/Web12306/js/ui/widget_sell_notification.js b/Web12306/js/ui/widget_sell_notification.js
index 6c3d7b9..1c76d54 100644
--- a/Web12306/js/ui/widget_sell_notification.js
+++ b/Web12306/js/ui/widget_sell_notification.js
@@ -9,6 +9,7 @@
var mp = require("./widget_message_popup.js");
var query = require("../otn/queryticket.js");
var port = require("../platform/extensionPort.js");
+ var wxData = null;
require("./widget_modalDialog.js");
@@ -81,8 +82,6 @@
var baseTime = new Date(parseInt(container[0].dataset.sellday));
var sellTime = parseSellTime(container[0].dataset.timeset);
- baseTime = utility.addDays(utility.trimToDay(new Date()), 1);
-
var tasks = [];
var p = sessMgr.currentProfile;
var taskGroup = utility.formatDate(p.depDate, 'MM鏈坉d鏃') + p.fromText + "鍒" + p.toText + "璧峰敭鎻愰啋";
@@ -93,7 +92,8 @@
time: baseTime.getTime(),
text: "浠婂ぉ璧峰敭" + utility.formatDate(p.depDate, 'MM鏈坉d鏃') + p.fromText + "鍒" + p.toText + "杞︾エ 锛岃鐣欐剰鍝︼紒",
group: taskGroup,
- data: taskdata
+ data: taskdata,
+ point: 0
}
);
var assignTimeGroup = function (timepoint, grouptype) {
@@ -103,7 +103,9 @@
time: timepoint - 30 * 60 * 1000,
text: "涓夊崄鍒嗛挓鍚庤捣鍞" + utility.formatDate(p.depDate, 'MM鏈坉d鏃') + p.fromText + "鍒" + p.toText + "鐨" + grouptype + "杞︾エ 锛岃鐣欐剰鍝︼紒",
group: taskGroup,
- data: taskdata
+ data: taskdata,
+ point: 30,
+ type: grouptype
}
);
@@ -113,7 +115,9 @@
time: timepoint - 15 * 60 * 1000,
text: "鍗佷簲鍒嗛挓鍚庤捣鍞" + utility.formatDate(p.depDate, 'MM鏈坉d鏃') + p.fromText + "鍒" + p.toText + "鐨" + grouptype + "杞︾エ 锛岃鐣欐剰鍝︼紒",
group: taskGroup,
- data: taskdata
+ data: taskdata,
+ point: 15,
+ type: grouptype
}
);
@@ -123,7 +127,9 @@
time: timepoint - 5 * 60 * 1000,
text: "浜斿垎閽熷悗璧峰敭" + utility.formatDate(p.depDate, 'MM鏈坉d鏃') + p.fromText + "鍒" + p.toText + "鐨" + grouptype + "杞︾エ 锛岃鐣欐剰鍝︼紒",
group: taskGroup,
- data: taskdata
+ data: taskdata,
+ point: 5,
+ type: grouptype
}
);
}
@@ -192,8 +198,9 @@
text: "璁㈤槄鎻愰啋",
callback: function (e) {
if (confirmAlarm()) {
- mp.showMessagePopup("ok", "鎻愰啋璁剧疆鎴愬姛!");
e.hide();
+
+ showWx();
}
},
type: "primary"
@@ -201,6 +208,9 @@
]
});
port.track(data.trackTypes.SHOW_NOTIFICATION_SELECT);
+ };
+ var showWx = function() {
+
};
var init = function () {
sessMgr.on("save", function () {