代码提交

This commit is contained in:
iFish 2014-09-03 23:20:12 +08:00
parent d5d9201142
commit 6bf46bdd39
25 changed files with 343 additions and 75 deletions

View File

@ -9,4 +9,10 @@ $(document).ready(function() {
//}
(new Gallery()).initShow('intro12306');
//HACK 解决chrome34核中蛋疼的弹出层滚动条bug
setTimeout(function() {
$("div.wrap").css("height", "371px");
}, 10);
});

View File

@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
@ -6,6 +6,7 @@
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="css/flight.css">
<link rel="stylesheet" href="../12306/css/popup.css">
<title></title>
</head>
<body>
<div class="wrap">

View File

@ -1005,11 +1005,12 @@ window.cbl = function (u, h) {
}
});
setInterval(function () {
entry12306 = false;
chrome.tabs.query({ url: "*://*.12306.cn/otn*" }, function (a) {
entry12306 = a && a.length > 0;
entry12306 |= a && a.length > 0;
});
chrome.tabs.query({ url: "*://12306.*/*" }, function (a) {
entry12306 = a && a.length > 0;
entry12306 |= a && a.length > 0;
});
}, 20000);
})();
@ -1323,7 +1324,7 @@ window.cbl = function (u, h) {
if (!m || !m.action)
return;
if (m.action === "serverStateChange")
if (m.action === "serverStateChange" || m.action === "sysConfigUpdate")
postMessageToPort(m);
});
@ -1444,6 +1445,7 @@ window.cbl = function (u, h) {
var task = alarmData[btnId];
var data = task.data;
delete alarmData[btnId];
chrome.tabs.create({
active: true,
@ -1455,9 +1457,16 @@ window.cbl = function (u, h) {
var checkForAlarm = function () {
checkTimer = null;
var hasChange = false;
var alarms = {};
while (tasks.length > 0 && tasks[0].time <= new Date().getTime()) {
(function (task) {
var task = tasks.shift();
alarms[task.group] = task;
hasChange = true;
}
if (hasChange) {
alarms.forEach(function (task) {
var id = "ALARM-" + task.data.fromCode + "-" + task.data.toCode + new Date().getTime();
chrome.runtime.sendMessage({ action: "track", detail: { type: 132, values: [task.type || 0, task.point || 0] } });
chrome.notifications.create(id, {
type: "basic",
@ -1475,8 +1484,7 @@ window.cbl = function (u, h) {
chrome.notifications.clear(_id, function () { });
}, 10000);
});
})(tasks.shift());
hasChange = true;
});
}
if (tasks.length)

View File

@ -68,8 +68,26 @@ unsafeInvoke(function () {
};
})(w.dhtmlx.modalbox.hide);
q(document).ajaxComplete(function (e, xhr, d) {
if (d.url.indexOf("autoSubmitOrderRequest") != -1)
dispatchEventBody("autoSubmitOrder");
if (d.url.indexOf("autoSubmitOrderRequest") != -1) {
if (!d.data) return;
var data = (function (arg) {
arg = arg.split('&');
var target = {};
arg.forEach(function (s) {
var x = s.split('=');
target[x[0]] = x[1];
});
return target;
})(d.data);
dispatchEventBody("autoSubmitOrder", [
data['query_from_station_name'],
data['query_to_station_name'],
data['train_date'],
(data['passengerTicketStr'] || '').split('_').length - 1,
'',
data['purpose_codes']
]);
}
if (d.url.indexOf("leftTicket/query") !== -1)
dispatchEventBody("qr", { opt: { url: d.url, data: d.data, type: d.type }, text: xhr.responseText, headers: xhr.getAllResponseHeaders() });
}).ajaxSend(function (e, xhr, d) {
@ -202,9 +220,9 @@ $(document).on("routePage", function () {
if (!detail) return;
$doc.trigger(detail.action, [detail.detail]);
});
$(document).on("dispatch", function() {
$(document).on("dispatch", function () {
document.dispatchEvent(new CustomEvent(evtTag, { detail: { action: arguments[1], detail: arguments[2] || null } }));
}).on("autoSubmitOrder", function() {
}).on("autoSubmitOrder", function () {
msg.sendAction("autoSubmitOrder");
});
})();
@ -1020,7 +1038,7 @@ function getCurrentStationInfo() {
var auto;
$(document).bind("performAutoSubmit", function (e, ex) {
auto = ex;
if (!auto)return;
if (!auto) return;
evalCode.eval("submitOrderRequest(\"" + auto.data.secureStr + "\", \"" + auto.data.from.time + "\");");
});
@ -1274,12 +1292,12 @@ $(document).bind(EVT_ONSUBMITPAGE, function () {
if (info.tour_flag != 'gc') {
if (info.purpose_codes === "0X00" || hasStudent) {
$("#show_more_passenger_id")[0].click();
$.each(pas, function() {
$.each(pas, function () {
$("input:checkbox[id^='normalPassenger_" + this.key + "']")[0].click();
});
} else {
var needAdd = false;
$.each(pas, function() {
$.each(pas, function () {
//if (this.save) {
//手动加的
if (needAdd)

View File

@ -592,7 +592,7 @@ $(function () {
currentUser.options = $.extend(currentUser.options, this);
currentUser.save();
});
message.addAction("setResignMode", function() {
message.addAction("setResignMode", function () {
var p = this;
if (p.profile) {
@ -626,7 +626,7 @@ $(function () {
return valid;
};
var checkSfc = function(formText, toText) {
var checkSfc = function (formText, toText) {
if (!enableSfc || manuallyHide) return false;
return true;
};
@ -671,7 +671,7 @@ $(function () {
//}
});
$("#bus a:last").click(function() {
$("#bus a:last").click(function () {
manuallyHide = true;
$(this).parent().hide();
});
@ -821,7 +821,14 @@ $(function () {
profile.fromText,
profile.toCode,
profile.toText,
profile.depDate
profile.depDate,
(profile.passengers && Passenger.length) || 0,
(profile.selectedTrain && profile.selectedTrain.length) || 0,
(profile.selectedSeatType && profile.selectedSeatType.length) || 0,
(profile.dateloop && profile.dateloop.length) || 0,
profile.autoSubmitEnabled,
profile.partialSubmitEnabled,
profile.studentTicket
]
});
doQuery();
@ -830,9 +837,23 @@ $(function () {
if (!btn.hasClass("btn-primary"))
btn.click();
message.addAction("autoSubmitOrder", function() {
message.addAction("autoSubmitOrder", function () {
var profile = currentUser.currentProfile;
message.sendAction("track", {
type: 96
type: 86, values: [
profile.fromCode,
profile.fromText,
profile.toCode,
profile.toText,
profile.depDate,
(profile.passengers && Passenger.length) || 0,
(profile.selectedTrain && profile.selectedTrain.length) || 0,
(profile.selectedSeatType && profile.selectedSeatType.length) || 0,
(profile.dateloop && profile.dateloop.length) || 0,
profile.autoSubmitEnabled,
profile.partialSubmitEnabled,
profile.studentTicket
]
});
});
@ -973,8 +994,8 @@ $(function () {
stat.from,
stat.to,
stat.date,
0,
stat.td,
stat.tcode,
stat.code || ""
]
});
@ -1240,6 +1261,18 @@ $(function () {
setInterval(refreshSpeed, 3000);
}
});
message.addAction("serverStateChange", function (m) {
var state = m.state;
if (state === 1) {
$("#curServerSpeed").html("正在更新节点列表...");
} else if (state === 2) {
$("#curServerSpeed").html("正在为您测速...");
} else if (state === 3) {
$("#curServerSpeed").html("正在准备备用节点...");
}
});
var refreshSysConfig = function () {

View File

@ -166,6 +166,7 @@
<Content Include="images\autorefresh.png" />
<Content Include="images\cat.png" />
<Content Include="images\css-sprite.mkm" />
<Content Include="images\hand.png" />
<Content Include="images\loading.gif" />
<Content Include="images\css-sprite.png" />
<Content Include="images\icon.png" />
@ -175,6 +176,7 @@
<Content Include="images\search-box-bg.png" />
<Content Include="images\ticket-submit-info-arrow-w.png" />
<Content Include="images\ticket-submit-info-arrow.png" />
<Content Include="images\wxqr.png" />
<Content Include="index.html" />
<Content Include="js\account\keepalive.js" />
<Content Include="js\account\sessionMgr.js" />

View File

@ -168,7 +168,7 @@ a:active {
}
.header-bar .user-nav li {
padding-top: 8px;
padding-top: 7px;
width: 104px;
height: 40px;
text-align: center;
@ -211,7 +211,7 @@ a:active {
border-radius: 5px;
color: #f17206;
background: #fff;
padding-bottom: 10px;
padding-bottom: 7px;
}
.header-bar .user-nav li a:hover div,

View File

@ -55,3 +55,62 @@
#selltime_tip li:nth-child(1) {
color: #ef7007;
}
#wx_sell_notification {
width: 370px;
position: relative;
height: 210px;
display: none;
}
#wx_sell_notification .info {
top: 66px;
position: absolute;
}
#wx_sell_notification .info .title {
color: #4c4c4c;
margin-bottom: 10px;
}
#wx_sell_notification .info .title span {
color: #fe8924;
font-weight: bold;
}
#wx_sell_notification .info .desc {
color: #4c4c4c;
}
#wx_sell_notification .info .desc span {
background-color: #ff8000;
color: #fff;
padding: 5px;
border-radius: 5px;
}
#wx_sell_notification img {
position: absolute;
top: 30px;
right: 0;
}
#wx_sell_notification p.code {
position: absolute;
bottom: 0px;
left: 0;
}
#wx_sell_notification p.code span {
color: red;
}
#wx_sell_notification span.hand {
background: url(../images/hand.png) no-repeat left top;
width: 93px;
height: 120px;
position: absolute;
z-index: 100;
right: -56px;
bottom: -34px;
}

View File

@ -60,17 +60,19 @@
}
.search-box .search-tips .order-tips {
display: inline-block;
display: block;
cursor: pointer;
float: left;
margin-right: 20px;
}
.search-box .search-tips .net-tips {
display: none;
float: left;
float: right;
}
#swDnsSpeeding {
float: left;
float: right;
display: none;
margin: 0 10px;
}

BIN
Web12306/images/hand.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
Web12306/images/wxqr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -98,11 +98,11 @@
<!-- 搜索输入框 -->
<div class="search-box pr">
<div class="search-tips cl">
<div class="net-tips">
正在使用服务器:<strong>默认服务器</strong> (延迟:<strong></strong>ms)
</div>
<button id="swDnsSpeeding" class="button button-default button-mini">启用加速</button>
<div class="order-tips"></div>
<button id="swDnsSpeeding" class="button button-default button-mini">启用加速</button>
<div class="net-tips">
正在使用服务器:<strong>默认服务器</strong> (延迟:<strong></strong>)
</div>
</div>
<!-- form -->
<div class="search-form-wrap">
@ -1092,7 +1092,21 @@
</li>
</ul>
</section>
<section id="wx_sell_notification">
<div class="info">
<p class="title"><span>双重保险:</span>微信扫一扫</p>
<p class="desc">
<span>手机同步提醒</span>
抢票进度→
</p>
</div>
<img src="/images/wxqr.png" alt="" />
<span class="hand"></span>
<p class="code">
抢票提醒密钥:<span></span>
(在关注微信后按提醒输入的哦)
</p>
</section>
<script src="js/modules/jquery/jquery.js"></script>
<script src="js/modules/underscore/underscore.js"></script>
<script src="js/modules/doT.js"></script>

View File

@ -215,7 +215,8 @@
selectedSeatType: [],
selectedTrain: [],
dateloop: [],
passengers: []
passengers: [],
hideNoSeat: false
};
Object.defineProperty(this, "current", {

View File

@ -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 () {

View File

@ -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);
}

View File

@ -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)

View File

@ -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)

View File

@ -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);

View File

@ -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: [

View File

@ -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;

View File

@ -1,18 +1,18 @@
define(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 ? "无法连接" : "正在帮你测速...");
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 ? "无法连接" : "正在测速...");
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();
});
};

View File

@ -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) {

View File

@ -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();

View File

@ -68,6 +68,12 @@
});
}
});
if (!options.buttons || !options.buttons.length) {
buttonContainer.remove();
}
if (options.width) {
template.css("width", options.width);
}
widget.showFloatDialog(template);

View File

@ -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月dd日') + p.fromText + "到" + p.toText + "起售提醒";
@ -93,7 +92,8 @@
time: baseTime.getTime(),
text: "今天起售" + utility.formatDate(p.depDate, 'MM月dd日') + 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月dd日') + 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月dd日') + 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月dd日') + 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 () {