代码同步提交
This commit is contained in:
parent
7a98f76274
commit
32597dd2bd
@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
@ -23,22 +24,52 @@ namespace StationDataFileGenerator
|
||||
var targetDataFile = Path.Combine(_root, @"..\Web12306\js\station\station_data.js");
|
||||
var inputDataFile = Path.Combine(_root, @"station_name.js");
|
||||
var inputPopFile = Path.Combine(_root, @"favorite_name.js");
|
||||
var inputTimeFile = Path.Combine(_root, "time.js");
|
||||
|
||||
//下载数据
|
||||
ServicePointManager.Expect100Continue = false;
|
||||
ServicePointManager.ServerCertificateValidationCallback = (x, y, z, d) =>
|
||||
{
|
||||
return true;
|
||||
};
|
||||
Console.WriteLine("正在下载站点列表..");
|
||||
var client = new WebClient();
|
||||
client.DownloadFile("https://kyfw.12306.cn/otn/resources/js/framework/station_name.js", inputDataFile);
|
||||
client.DownloadFile("https://kyfw.12306.cn/otn/resources/js/framework/favorite_name.js", inputPopFile);
|
||||
client.DownloadFile("https://kyfw.12306.cn/otn/resources/js/query/qss.js", inputTimeFile);
|
||||
|
||||
Console.WriteLine("正在处理....");
|
||||
//常规数据
|
||||
var commonDataText = File.ReadAllText(inputDataFile);
|
||||
var popDataText = File.ReadAllText(inputPopFile);
|
||||
var timeDataText = File.ReadAllText(inputTimeFile);
|
||||
|
||||
//@bjb|北京北|VAP|beijingbei|bjb|0
|
||||
//@bji|北京|BJP|0
|
||||
var commonData = new Regex(@"@([a-z]+)\|([^\|]+)\|([^\|]+)\|([^\|@]+)\|([^\|@]+)\|([^\|@'""]+)", RegexOptions.IgnoreCase).Matches(commonDataText)
|
||||
.Cast<Match>().Select(s => new { p = s.Groups[4].Value.ToLower(), n = s.Groups[2].Value.ToLower(), c = s.Groups[3].Value, s = int.Parse(s.Groups[6].Value), h = s.Groups[5].Value.ToLower() })
|
||||
.GroupBy(s => GetCodeKey(s.h)).ToDictionary(s => s.Key, s => s.OrderBy(x => x.s).ToDictionary(x => x.c))
|
||||
var cities = new Regex(@"@([a-z]+)\|([^\|]+)\|([^\|]+)\|([^\|@]+)\|([^\|@]+)\|([^\|@'""]+)", RegexOptions.IgnoreCase).Matches(commonDataText)
|
||||
.Cast<Match>().Select(s => new { p = s.Groups[4].Value.ToLower(), n = s.Groups[2].Value.ToLower(), c = s.Groups[3].Value, s = int.Parse(s.Groups[6].Value), h = s.Groups[5].Value.ToLower() });
|
||||
var commonData = cities.GroupBy(s => GetCodeKey(s.h)).ToDictionary(s => s.Key, s => s.OrderBy(x => x.s).ToDictionary(x => x.c))
|
||||
;
|
||||
var popData = new Regex(@"@([a-z]+)\|([^\|]+)\|([^\|]+)\|([^\|@]+)", RegexOptions.IgnoreCase).Matches(popDataText)
|
||||
.Cast<Match>().Select(s => s.Groups[3].Value).ToArray();
|
||||
;
|
||||
var timeData = new Regex(@"""([^""]+)""\s*:\s*""([^""]+)""").Matches(timeDataText)
|
||||
.Cast<Match>()
|
||||
.Select(s => new { n = s.Groups[1].Value, t = s.Groups[2].Value })
|
||||
.GroupBy(s => s.n)
|
||||
.ToDictionary(s =>
|
||||
{
|
||||
var c = cities.FirstOrDefault(x => x.n == s.Key);
|
||||
if (c == null)
|
||||
{
|
||||
Console.WriteLine("警告:站点【" + s.Key + "】不存在!");
|
||||
return s.Key;
|
||||
}
|
||||
return c.c;
|
||||
}, s => s.First().t);
|
||||
|
||||
File.WriteAllText(targetDataFile, "define(function(require, exports, module){\r\n exports.data=" + Newtonsoft.Json.JsonConvert.SerializeObject(commonData) + ";\r\n exports.popcity=" + JsonConvert.SerializeObject(popData) + ";\r\n});");
|
||||
|
||||
File.WriteAllText(targetDataFile, "define(function(require, exports, module){\r\n exports.data=" + Newtonsoft.Json.JsonConvert.SerializeObject(commonData) + ";\r\n exports.popcity=" + JsonConvert.SerializeObject(popData) + ";\r\n exports.sellTime=" + JsonConvert.SerializeObject(timeData) + ";\r\n});");
|
||||
|
||||
Console.Write("OK.");
|
||||
Console.ReadKey();
|
||||
|
3933
Web12306/Scripts/typings/jquery/jquery.d.ts
vendored
Normal file
3933
Web12306/Scripts/typings/jquery/jquery.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3167
Web12306/Scripts/typings/underscore.d.ts
vendored
Normal file
3167
Web12306/Scripts/typings/underscore.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3167
Web12306/Scripts/typings/underscore/underscore.d.ts
vendored
Normal file
3167
Web12306/Scripts/typings/underscore/underscore.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,49 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
有关如何配置 ASP.NET 应用程序的详细信息,请访问
|
||||
http://go.microsoft.com/fwlink/?LinkId=301880
|
||||
-->
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key="webpages:Version" value="3.0.0.0" />
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
<add key="ClientValidationEnabled" value="true" />
|
||||
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.5" />
|
||||
<httpRuntime targetFramework="4.5" />
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
|
||||
<remove name="OPTIONSVerbHandler" />
|
||||
<remove name="TRACEVerbHandler" />
|
||||
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
有关如何配置 ASP.NET 应用程序的详细信息,请访问
|
||||
http://go.microsoft.com/fwlink/?LinkId=301880
|
||||
-->
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key="webpages:Version" value="3.0.0.0" />
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
<add key="ClientValidationEnabled" value="true" />
|
||||
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.5" />
|
||||
<httpRuntime targetFramework="4.5" />
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
|
||||
<remove name="OPTIONSVerbHandler" />
|
||||
<remove name="TRACEVerbHandler" />
|
||||
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@ -22,6 +23,7 @@
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
<TypeScriptToolsVersion>1.0</TypeScriptToolsVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@ -157,6 +159,7 @@
|
||||
<Content Include="css\ui\ui-autorefresh.css" />
|
||||
<Content Include="css\ui\widget-login.css" />
|
||||
<Content Include="css\ui\widget-message-popup.css" />
|
||||
<Content Include="css\ui\widget-selltime-notification.css" />
|
||||
<Content Include="css\ui\widget-ticketsubmit.css" />
|
||||
<Content Include="css\ui\widget.css" />
|
||||
<Content Include="Global.asax" />
|
||||
@ -218,6 +221,7 @@
|
||||
<Content Include="js\ui\widget_datebar.js" />
|
||||
<Content Include="js\ui\widget_datedropdown.js" />
|
||||
<Content Include="js\ui\widget_message_popup.js" />
|
||||
<Content Include="js\ui\widget_sell_notification.js" />
|
||||
<Content Include="js\ui\widget_verifycode.js" />
|
||||
<None Include="Scripts\_references.js" />
|
||||
<Content Include="Web.config" />
|
||||
@ -236,11 +240,16 @@
|
||||
<ItemGroup>
|
||||
<Content Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<TypeScriptCompile Include="Scripts\typings\jquery\jquery.d.ts" />
|
||||
<TypeScriptCompile Include="Scripts\typings\underscore.d.ts" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
||||
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
|
||||
|
@ -68,7 +68,7 @@ a.button-primary {
|
||||
}
|
||||
|
||||
.button-mini {
|
||||
padding: 0 15px;
|
||||
padding: 5px 15px;
|
||||
}
|
||||
|
||||
.text {
|
||||
|
@ -16,6 +16,7 @@
|
||||
@import url('ui/float-passenger-selector.css');
|
||||
@import url('ui/ui-autorefresh.css');
|
||||
@import url('ui/chat.css');
|
||||
@import url('ui/widget-selltime-notification.css');
|
||||
|
||||
.icon {
|
||||
background: url(../images/icon.png) no-repeat;
|
||||
|
@ -322,3 +322,15 @@ button#btnResetOptions {
|
||||
color: #7c5024;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.search-form-wrap .search-time-tips {
|
||||
float: left;
|
||||
line-height: 40px;
|
||||
color: #CFB19A;
|
||||
display: none;
|
||||
}
|
||||
.search-form-wrap .search-time-tips span {
|
||||
font-weight: bold;
|
||||
margin-left: 4px;
|
||||
margin-right: 4px;
|
||||
}
|
@ -39,8 +39,8 @@
|
||||
}
|
||||
|
||||
.result .train-num {
|
||||
padding: 18px 20px 18px 20px;
|
||||
width: 100px;
|
||||
padding: 8px 10px 8px 15px;
|
||||
width: 80px;
|
||||
font-family: tahoma;
|
||||
color: #4D5873;
|
||||
font-size: 24px;
|
||||
|
43
Web12306/css/ui/widget-selltime-notification.css
Normal file
43
Web12306/css/ui/widget-selltime-notification.css
Normal file
@ -0,0 +1,43 @@
|
||||
#book_sell_tip {
|
||||
border: 1px solid #ddd;
|
||||
margin-bottom: 10px;
|
||||
padding: 5px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#book_sell_tip > header {
|
||||
font-weight: bold;
|
||||
text-indent: 20px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
#book_sell_tip > header > span {
|
||||
font-weight: normal;
|
||||
float: right;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
#book_sell_tip > div {
|
||||
padding: 10px;
|
||||
line-height: 200%;
|
||||
}
|
||||
|
||||
#book_sell_tip > div span {
|
||||
color: #D1455B;
|
||||
}
|
||||
|
||||
#book_sell_tip > div time {
|
||||
font-weight: bold;
|
||||
color: #D1455B;
|
||||
}
|
||||
|
||||
#book_sell_tip > div address {
|
||||
display: inline;
|
||||
font-style: normal;
|
||||
font-weight: bold;
|
||||
color: #D1455B;
|
||||
}
|
||||
|
||||
#book_sell_tip > footer {
|
||||
padding-left: 20px;
|
||||
}
|
@ -72,18 +72,18 @@
|
||||
<ul class="search-form">
|
||||
<li>
|
||||
<label class="label-desc">出发城市</label>
|
||||
<div class="input-wrap"><input class="search-form-city ui-cityselector" id="from_city" autocomplete="off" type="text" name="from_city" placeholder="请填写出发城市" /></div>
|
||||
<div class="input-wrap"><input required="" class="search-form-city ui-cityselector" id="from_city" autocomplete="off" type="text" name="from_city" placeholder="请填写出发城市" /></div>
|
||||
</li>
|
||||
<li class="transfer-city">
|
||||
<div class="transfer-city-btn"></div>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-desc">到达城市</label>
|
||||
<div class="input-wrap"><input class="search-form-city ui-cityselector" id="to_city" autocomplete="off" type="text" name="to_city" placeholder="请填写到达城市" /></div>
|
||||
<div class="input-wrap"><input readonly="" class="search-form-city ui-cityselector" id="to_city" autocomplete="off" type="text" name="to_city" placeholder="请填写到达城市" /></div>
|
||||
</li>
|
||||
<li class="select-date">
|
||||
<label class="label-desc">乘车日期</label>
|
||||
<div class="input-wrap"><input class="search-form-date ui-date" data-profile-key="depDate" type="text" name="dep_date" id="dep_date" placeholder="请选择乘车日期" /></div>
|
||||
<div class="input-wrap"><input required="" class="search-form-date ui-date" data-profile-key="depDate" type="text" name="dep_date" id="dep_date" placeholder="请选择乘车日期" /></div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="identity fl">
|
||||
@ -146,11 +146,39 @@
|
||||
</li>
|
||||
<li>[<a href="javascript:;">全选</a>]</li>
|
||||
</ul>
|
||||
<div class="search-time-tips">
|
||||
<span></span>起售时间为 <span></span>,
|
||||
<span>动车</span>起售时间为<span>上午 11:00</span>,
|
||||
<span>高铁</span>起售时间为<span>下午 2:00</span>
|
||||
</div>
|
||||
<a class="search-more-option" href="javascript:;">
|
||||
隐藏更多选项
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<section id="book_sell_tip">
|
||||
<header>
|
||||
预售提醒
|
||||
<span>
|
||||
<i class="fa fa-times"></i>
|
||||
关闭
|
||||
</span>
|
||||
</header>
|
||||
<div>
|
||||
您选择的日期 <time>2014-08-30</time> 不在预售期内,无法购买。
|
||||
<br />
|
||||
<time>2004-08-30</time> 的 <address>北京站</address> 车票起售时间为 <time>2014年8月10日 上午10:00</time>(全国动车票为<time>上午11:00</time>、高铁车票为<time>下午2:00</time>)。
|
||||
<br />
|
||||
高峰期预售期可能有变动或增开临客,详情请密切留意12306公告。
|
||||
<span>需要在起售前提醒您吗?</span>
|
||||
</div>
|
||||
<footer>
|
||||
<button class="button-primary button-mini">
|
||||
<i class="fa fa-check"></i>
|
||||
开启提醒
|
||||
</button>
|
||||
</footer>
|
||||
</section>
|
||||
<!-- 其他设置条件 -->
|
||||
<div class="options-param">
|
||||
<dl class="cl offset-parent">
|
||||
@ -264,7 +292,7 @@
|
||||
</div>
|
||||
<script type="text/x-dot-template">
|
||||
{{~it:p:i}}
|
||||
<span class="optional-block" data-id="{{!p.key}}">{{!p.passenger_name}}{{=p.passenger_type=="2"?"(儿童)":p.passenger_type=="3"?"(学生)":p.passenger_type=="4"?"(残军)":""}}<span class="close">×</span></span>
|
||||
<span class="optional-block" data-id="{{!p.key}}">{{!p.passenger_name}}{{=p.passenger_type=="2"?"(儿童)":p.passenger_type=="3"?"(学生)":p.passenger_type=="4"?"(残军)":""}}<span class="close">x</span></span>
|
||||
{{~}}
|
||||
</script>
|
||||
</dd>
|
||||
|
@ -121,6 +121,7 @@
|
||||
|
||||
var key = "12306_user_" + that.current.username;
|
||||
storage.put(key, that.current);
|
||||
that.fireEvent("save");
|
||||
};
|
||||
that.getPassengers = function (callback) {
|
||||
if (!callback)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -24,7 +24,7 @@
|
||||
if (currentProfile.trainTypes && currentProfile.trainTypes.length) {
|
||||
var ft = _.filter(data.available, function (t) {
|
||||
var vc = t.code[0];
|
||||
if ('GDCKZT'.indexOf(vc) != -1)
|
||||
if ('GDCKZT'.indexOf(vc)!==-1)
|
||||
return _.indexOf(currentProfile.trainTypes, t.code[0]) == -1;
|
||||
else if (/^[L\d]/i.test(vc)) {
|
||||
return _.indexOf(currentProfile.trainTypes, '1') == -1;
|
||||
|
@ -29,7 +29,7 @@
|
||||
var space = getHours(t1, t2);
|
||||
return space != null && space <= limit;
|
||||
};
|
||||
var sortFunc = function(x, y) {
|
||||
var sortFunc = function (x, y) {
|
||||
if (x.ep ^ y.ep)
|
||||
return x.ep ? -1 : 1;
|
||||
return y.st - x.st;
|
||||
@ -49,8 +49,15 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var tcode = alltrains.pop();
|
||||
var t = _.findWhere(queryResult.original, { code: tcode });
|
||||
var tcode, t;
|
||||
do {
|
||||
tcode = alltrains.pop();
|
||||
t = _.findWhere(queryResult.original, { code: tcode });
|
||||
} while (!t && alltrains.length)
|
||||
if (!t) {
|
||||
checkSuggestion();
|
||||
return;
|
||||
}
|
||||
query.queryTrainStop(t.id, t.from.code, t.to.code, t.date)
|
||||
.done(function (stopinfo) {
|
||||
trainStops[t.code] = {
|
||||
@ -199,5 +206,4 @@
|
||||
});
|
||||
|
||||
return ctx;
|
||||
});
|
||||
|
||||
});
|
@ -70,7 +70,7 @@
|
||||
});
|
||||
};
|
||||
exports.getSeats = function (trainSeats) {
|
||||
var seats = _.clone(trainSeats);
|
||||
var seats = _.filter(_.clone(trainSeats), function(t) {return t.count>0;});
|
||||
//排序
|
||||
seats.sort(function (x, y) {
|
||||
return x.price - y.price;
|
||||
@ -110,4 +110,13 @@
|
||||
return exports.formatDate(date, "MM月dd日 hh:mm");
|
||||
}
|
||||
};
|
||||
exports.sortCity = function (cities) {
|
||||
/// <summary>对城市进行排序</summary>
|
||||
|
||||
cities.sort(function(x,y) {
|
||||
if (x.s != y.s)
|
||||
return x.s - y.s;
|
||||
return x.c > y.c ? 1 : -1;
|
||||
});
|
||||
};
|
||||
});
|
||||
|
File diff suppressed because one or more lines are too long
@ -7,6 +7,7 @@
|
||||
var parser = require("../platform/parser.js");
|
||||
var media = require("../platform/media.js");
|
||||
var mp = require("./widget_message_popup.js");
|
||||
var stationData = require("../station/station_data.js");
|
||||
|
||||
//会话管理器事件
|
||||
sessMgr.on("notValidPassengerFound", function () {
|
||||
@ -80,6 +81,7 @@
|
||||
|
||||
var p = user.currentProfile;
|
||||
$("#from_city").val(p.fromText).attr("data-code", p.fromCode);
|
||||
showSellTime.call(document.getElementById("from_city"));
|
||||
$("#to_city").val(p.toText).attr("data-code", p.toCode);
|
||||
document.querySelector("input[name='ticket_type'][value='" + (p.studentTicket ? "1" : "0") + "']").checked = true;
|
||||
|
||||
@ -148,6 +150,20 @@
|
||||
p.toCode = this.dataset.code;
|
||||
sessMgr.save();
|
||||
});
|
||||
var showSellTime = function () {
|
||||
var v = this.dataset.code;
|
||||
|
||||
if (!v) {
|
||||
$("div.search-time-tips").hide();
|
||||
return;
|
||||
}
|
||||
|
||||
var sellTimes = stationData.sellTime[v] || "----";
|
||||
$("div.search-time-tips").show().find("span:eq(1)").html(sellTimes).end().find("span:eq(0)").html(this.value + "站");
|
||||
};
|
||||
$("#from_city").change(showSellTime);
|
||||
showSellTime.apply(document.getElementById("from_city"));
|
||||
|
||||
$("input[name='ticket_type']").click(function () {
|
||||
sessMgr.currentProfile.studentTicket = this.value === "1";
|
||||
sessMgr.save();
|
||||
@ -178,7 +194,7 @@
|
||||
|
||||
//检查学生票是否对应
|
||||
if (sessMgr.currentProfile.studentTicket && sessMgr.currentProfile.passengers && sessMgr.currentProfile.passengers.length) {
|
||||
if (_.some(sessMgr.currentProfile.passengers, function(p) { return p.passenger_type != '3'; })) {
|
||||
if (_.some(sessMgr.currentProfile.passengers, function (p) { return p.passenger_type != '3'; })) {
|
||||
mp.confirm("确认", "您选择的是学生票,但是添加的联系人并不全是学生,将无法提交订单,确定继续查票吗?", ui_result.load);
|
||||
} else {
|
||||
ui_result.load();
|
||||
@ -206,4 +222,7 @@
|
||||
//调试
|
||||
if (self.location.hash == "#debug")
|
||||
$("#chat").show();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
@ -229,7 +229,10 @@
|
||||
}
|
||||
};
|
||||
this.showCountDownInfo = function () {
|
||||
refreshInfoSpan.eq(3).html((Math.round(countdownTime * 10) / 10) + "");
|
||||
var str = (Math.round(countdownTime * 10) / 10) + "";
|
||||
if (str.indexOf(".") === -1)
|
||||
str += ".0";
|
||||
refreshInfoSpan.eq(3).html(str);
|
||||
};
|
||||
|
||||
Object.defineProperties(this, {
|
||||
|
@ -2,12 +2,15 @@
|
||||
var $html = '<div id="city_selector"><ul class="city-tab-nav"><li class="selected">常用</li><li data-code="A-E">A-E</li><li data-code="F-J">F-J</li><li data-code="K-O">K-O</li><li data-code="P-T">P-T</li><li data-code="U-Z">U-Z</li></ul><div class="recent-city-list"><p>最近查询</p><dl><dd>TEST</dd></dl></div><div class="city-pop"><p>常用城市</p><ul class="city-list-container"></ul></div><div class="city-search"><p>站点列表</p><ul class="city-list-container"></ul><div class="city-list-pager"><button class="city-prev" disabled="disabled">上一页</button><button class="city-next">下一页</button></div></div></div>';
|
||||
var selector;
|
||||
var data = require("../data.js");
|
||||
var parser = require("../platform/parser.js");
|
||||
|
||||
var cityMap = data.cities;
|
||||
var citydata = data.citydata.data;
|
||||
var popcity = data.citydata.popcity;
|
||||
var maxRecentCity = 8;
|
||||
var sessMgr = require("../account/sessionMgr.js");
|
||||
|
||||
|
||||
|
||||
var CitySelector = function (options) {
|
||||
var that = this;
|
||||
@ -124,6 +127,7 @@
|
||||
e.c.indexOf(key) != -1 ||
|
||||
e.h.indexOf(lkey) != -1;
|
||||
});
|
||||
parser.sortCity(currentList);
|
||||
currentPage = 0;
|
||||
totalPage = Math.ceil(currentList.length / pageSize);
|
||||
that.renderPage(1);
|
||||
|
@ -53,7 +53,7 @@
|
||||
selected.push(curDate);
|
||||
|
||||
var dayStart = new Date(now.getFullYear(), now.getMonth(), 1);
|
||||
var maxShowDay = new Date(now.getTime() + 86400 * 1000 * options.maxSellDays);
|
||||
var maxShowDay = new Date(now.getTime() + 86400 * 1000 * options.maxSellDays * 2);
|
||||
|
||||
if (dateDom.prop("data-month") !== getDateString(dayStart)) {
|
||||
renderCalendar(dateDom.find(">.month-first"), dayStart, now, maxShowDay);
|
||||
|
4
Web12306/js/ui/widget_sell_notification.js
Normal file
4
Web12306/js/ui/widget_sell_notification.js
Normal file
@ -0,0 +1,4 @@
|
||||
define(function (require, exports, module) {
|
||||
var sessMgr = require("../account/sessionMgr.js");
|
||||
var data = require("../data.js");
|
||||
});
|
@ -1,26 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Antlr" version="3.4.1.9004" targetFramework="net45" />
|
||||
<package id="bootstrap" version="3.0.0" targetFramework="net45" />
|
||||
<package id="jQuery" version="1.10.2" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc.zh-Hans" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor.zh-Hans" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Web.Optimization.zh-Hans" version="1.1.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client.zh-Hans" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core.zh-Hans" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost.zh-Hans" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages.zh-Hans" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
|
||||
<package id="Modernizr" version="2.6.2" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="5.0.6" targetFramework="net45" />
|
||||
<package id="Respond" version="1.2.0" targetFramework="net45" />
|
||||
<package id="WebGrease" version="1.5.2" targetFramework="net45" />
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Antlr" version="3.4.1.9004" targetFramework="net45" />
|
||||
<package id="bootstrap" version="3.0.0" targetFramework="net45" />
|
||||
<package id="jQuery" version="1.10.2" targetFramework="net45" />
|
||||
<package id="jquery.TypeScript.DefinitelyTyped" version="1.3.7" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc.zh-Hans" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor.zh-Hans" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Web.Optimization.zh-Hans" version="1.1.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client.zh-Hans" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core.zh-Hans" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost.zh-Hans" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages.zh-Hans" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
|
||||
<package id="Modernizr" version="2.6.2" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="5.0.6" targetFramework="net45" />
|
||||
<package id="Respond" version="1.2.0" targetFramework="net45" />
|
||||
<package id="underscore.TypeScript.DefinitelyTyped" version="0.4.4" targetFramework="net45" />
|
||||
<package id="WebGrease" version="1.5.2" targetFramework="net45" />
|
||||
</packages>
|
Loading…
Reference in New Issue
Block a user