sync project
This commit is contained in:
parent
cb17cf4f05
commit
af19450cbf
@ -169,6 +169,14 @@
|
|||||||
<binding protocol="http" bindingInformation="*:46950:localhost" />
|
<binding protocol="http" bindingInformation="*:46950:localhost" />
|
||||||
</bindings>
|
</bindings>
|
||||||
</site>
|
</site>
|
||||||
|
<site name="Mobile12306New" id="3">
|
||||||
|
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||||
|
<virtualDirectory path="/" physicalPath="E:\iFishWork\12306\Mobile12306New" />
|
||||||
|
</application>
|
||||||
|
<bindings>
|
||||||
|
<binding protocol="http" bindingInformation="*:43418:localhost" />
|
||||||
|
</bindings>
|
||||||
|
</site>
|
||||||
<siteDefaults>
|
<siteDefaults>
|
||||||
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
|
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
|
||||||
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
|
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
|
||||||
|
@ -34,6 +34,10 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.7.0.1-beta3\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.configuration" />
|
<Reference Include="System.configuration" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
@ -49,6 +53,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||||
|
4
DeployTools/packages.config
Normal file
4
DeployTools/packages.config
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Newtonsoft.Json" version="7.0.1-beta3" targetFramework="net4" userInstalled="true" />
|
||||||
|
</packages>
|
@ -9,6 +9,8 @@ using System.Windows.Forms;
|
|||||||
|
|
||||||
namespace StationDataFileGenerator
|
namespace StationDataFileGenerator
|
||||||
{
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
static class Program
|
static class Program
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -67,8 +69,10 @@ namespace StationDataFileGenerator
|
|||||||
return c.c;
|
return c.c;
|
||||||
}, s => s.First().t);
|
}, s => s.First().t);
|
||||||
|
|
||||||
|
//fix: remove invalid popcity
|
||||||
|
popData = popData.Where(s => cities.Any(x => x.c == s)).ToArray();
|
||||||
|
|
||||||
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});");
|
File.WriteAllText(targetDataFile, "define(function(require, exports, module){\r\n exports.data=" + JsonConvert.SerializeObject(commonData) + ";\r\n exports.popcity=" + JsonConvert.SerializeObject(popData) + ";\r\n exports.sellTime=" + JsonConvert.SerializeObject(timeData) + ";\r\n});");
|
||||||
|
|
||||||
Console.Write("OK.");
|
Console.Write("OK.");
|
||||||
Console.ReadKey();
|
Console.ReadKey();
|
||||||
|
@ -37,6 +37,10 @@
|
|||||||
<StartupObject />
|
<StartupObject />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.7.0.1-beta3\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
@ -60,6 +64,7 @@
|
|||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<None Include="packages.config" />
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
4
StationDataFileGenerator/packages.config
Normal file
4
StationDataFileGenerator/packages.config
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Newtonsoft.Json" version="7.0.1-beta3" targetFramework="net4" userInstalled="true" />
|
||||||
|
</packages>
|
@ -20,6 +20,10 @@
|
|||||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0"/>
|
||||||
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
</configuration>
|
</configuration>
|
@ -112,7 +112,7 @@ namespace TrainInfomationProviderService
|
|||||||
|
|
||||||
var opt = new TrainTransitSearchOptions();
|
var opt = new TrainTransitSearchOptions();
|
||||||
opt.InitLimit(999999);
|
opt.InitLimit(999999);
|
||||||
var altLines = searchProvider.FindOnceTransitTrains(DateTime.Parse("2015-01-29"), "NVH", "JJG", opt).ToArray();
|
var altLines = searchProvider.FindOnceTransitTrains(DateTime.Parse("2015-07-10"), "NVH", "JJG", opt).ToArray();
|
||||||
|
|
||||||
//var availableLines = lines.Select(s => s.Train.Code + "," + s.FromStation.Name + "," + s.ToStation.Name + "," + s.ElapsedTime).ToArray();
|
//var availableLines = lines.Select(s => s.Train.Code + "," + s.FromStation.Name + "," + s.ToStation.Name + "," + s.ElapsedTime).ToArray();
|
||||||
Array.ForEach(altLines.Select(s =>
|
Array.ForEach(altLines.Select(s =>
|
||||||
|
@ -133,6 +133,20 @@ namespace TrainInfomationProviderService.TrainInfo
|
|||||||
|
|
||||||
indexStorage.TrainInfoStorages.Add(date, curStorage);
|
indexStorage.TrainInfoStorages.Add(date, curStorage);
|
||||||
}
|
}
|
||||||
|
//fix duplicate key
|
||||||
|
var dd = curStorage.Trains.GroupBy(s => s.Key).Select(s => new {s.Key, list = s.ToArray()}).Where(s => s.list.Length > 1).ToArray();
|
||||||
|
if (dd.Length > 0)
|
||||||
|
{
|
||||||
|
foreach (var x1 in dd)
|
||||||
|
{
|
||||||
|
var dfrist = x1.list[0];
|
||||||
|
foreach (var dt in x1.list.Skip(1).ToArray())
|
||||||
|
{
|
||||||
|
dfrist.Code = dt.Code;
|
||||||
|
curStorage.Trains.Remove(dt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
var allkeys = curStorage.Trains.ToDictionary(s => s.Key, StringComparer.OrdinalIgnoreCase);
|
var allkeys = curStorage.Trains.ToDictionary(s => s.Key, StringComparer.OrdinalIgnoreCase);
|
||||||
//所有的车次
|
//所有的车次
|
||||||
var alltrains = dateSt.Values.SelectMany(s => s).Select(s =>
|
var alltrains = dateSt.Values.SelectMany(s => s).Select(s =>
|
||||||
@ -164,6 +178,7 @@ namespace TrainInfomationProviderService.TrainInfo
|
|||||||
|
|
||||||
train.Init();
|
train.Init();
|
||||||
curStorage.HashStore.Add(train.TrainHash);
|
curStorage.HashStore.Add(train.TrainHash);
|
||||||
|
allkeys.Add(train.Key, train);
|
||||||
TrainInfoManager.Instance.DataStore.TrainData.AddOrUpdate(train.TrainHash, train);
|
TrainInfoManager.Instance.DataStore.TrainData.AddOrUpdate(train.TrainHash, train);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{C385D043-316A-4F05-A6B9-E70BF0ED8DB6}</ProjectGuid>
|
<ProjectGuid>{C385D043-316A-4F05-A6B9-E70BF0ED8DB6}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>TrainInfomationProviderService</RootNamespace>
|
<RootNamespace>TrainInfomationProviderService</RootNamespace>
|
||||||
<AssemblyName>TrainInfomationProviderService</AssemblyName>
|
<AssemblyName>TrainInfomationProviderService</AssemblyName>
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
var port = require("../platform/extensionPort.js");
|
var port = require("../platform/extensionPort.js");
|
||||||
var param = require("../data.js");
|
var param = require("../data.js");
|
||||||
var dynamicjs = require("../otn/dynamicjs.js");
|
var dynamicjs = require("../otn/dynamicjs.js");
|
||||||
|
var sessmgr = require("../account/sessionMgr.js");
|
||||||
|
|
||||||
var submitToken;
|
var submitToken;
|
||||||
var formData;
|
var formData;
|
||||||
@ -174,12 +175,12 @@
|
|||||||
autoSubmitRequest();
|
autoSubmitRequest();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamicjs.loadDynamicPage("leftTicket/init", "leftTicket/init")
|
dynamicjs.loadDynamicPage("leftTicket/init", "leftTicket/init")
|
||||||
.done(function () {
|
.done(function () {
|
||||||
dynamicKey = arguments[0];
|
dynamicKey = arguments[0];
|
||||||
}).always(function () {
|
}).always(function () {
|
||||||
autoSubmitRequest();
|
sessmgr.reloadPassengers();
|
||||||
|
sessmgr.getPassengers().always(autoSubmitRequest);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
preparePageInfo();
|
preparePageInfo();
|
||||||
@ -233,7 +234,21 @@
|
|||||||
msg = "12306取消了您的登录,请重新登录...";
|
msg = "12306取消了您的登录,请重新登录...";
|
||||||
def.reject({ msg: msg || "12306返回了未知的状态信息,请刷新重试。" });
|
def.reject({ msg: msg || "12306返回了未知的状态信息,请刷新重试。" });
|
||||||
} else if (!json.data.submitStatus) {
|
} else if (!json.data.submitStatus) {
|
||||||
def.reject({ msg: json.data.errMsg || "提交订单错误,错误原因未知..." });
|
var errMsg = json.data.errMsg || "提交订单错误,错误原因未知...";
|
||||||
|
if (errMsg.indexOf("出票失败") !== -1) {
|
||||||
|
//重新加载联系人并提交
|
||||||
|
sessmgr.reloadPassengers();
|
||||||
|
sessmgr.getPassengers().always(function () {
|
||||||
|
exports.fastPrepareOrder(train, profile, passenger)
|
||||||
|
.done(function () {
|
||||||
|
def.reject({ msg: "出票失败,请重试一次。" });
|
||||||
|
})
|
||||||
|
.always(function (e) {
|
||||||
|
def.reject({ msg: e.msg });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else
|
||||||
|
def.reject({ msg: errMsg });
|
||||||
} else {
|
} else {
|
||||||
waitQueueToComplete();
|
waitQueueToComplete();
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
var parser = require("../platform/parser.js");
|
var parser = require("../platform/parser.js");
|
||||||
var ev = require("../platform/EventObject.js");
|
var ev = require("../platform/EventObject.js");
|
||||||
var dynamicjs = require("../otn/dynamicjs.js");
|
var dynamicjs = require("../otn/dynamicjs.js");
|
||||||
|
var sessmgr = require("../account/sessionMgr.js");
|
||||||
|
|
||||||
var extensionVersion = parseInt(document.body.dataset["targetExtensionVersion"].replace(/\./g, ""));
|
var extensionVersion = parseInt(document.body.dataset["targetExtensionVersion"].replace(/\./g, ""));
|
||||||
|
|
||||||
@ -266,11 +267,21 @@
|
|||||||
document.dispatchEvent(new CustomEvent("platformError"));
|
document.dispatchEvent(new CustomEvent("platformError"));
|
||||||
def.reject("未能初始化查询地址");
|
def.reject("未能初始化查询地址");
|
||||||
}
|
}
|
||||||
else sendQueryRequest();
|
else postFetchTicketUrl();
|
||||||
}).fail(function () {
|
}).fail(function () {
|
||||||
def.reject("网络错误");
|
def.reject("网络错误");
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
var postFetchTicketUrl = function() {
|
||||||
|
//加载查询页之后,必须要加载一次联系人,否则妥妥地出票失败。这傻逼逻辑啊。。
|
||||||
|
if (sessmgr.isLogined) {
|
||||||
|
sessmgr.reloadPassengers();
|
||||||
|
sessmgr.getPassengers().always(sendQueryRequest);
|
||||||
|
} else {
|
||||||
|
sendQueryRequest();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (queryTicketUrl) {
|
if (queryTicketUrl) {
|
||||||
sendQueryRequest();
|
sendQueryRequest();
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,7 @@
|
|||||||
});
|
});
|
||||||
if (!alltrains.length)
|
if (!alltrains.length)
|
||||||
return;
|
return;
|
||||||
//如果没有选择车次并且此时车次数量多于10趟,则不予检测。
|
//如果没有选择车次并且此时车次数量多于30趟,则不予检测。
|
||||||
if ((!cp.selectedTrain || !cp.selectedTrain.length) && alltrains.length > 30)
|
if ((!cp.selectedTrain || !cp.selectedTrain.length) && alltrains.length > 30)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -107,7 +107,7 @@
|
|||||||
key = key || uiInput.val();
|
key = key || uiInput.val();
|
||||||
if (key !== currentSearchKey) {
|
if (key !== currentSearchKey) {
|
||||||
currentSearchKey = key.toUpperCase();
|
currentSearchKey = key.toUpperCase();
|
||||||
currentList = currentSearchKey ? _.filter(allpasseengers, function (p) { return p.key.indexOf(currentSearchKey) != -1 || p.first_letter.indexOf(currentSearchKey) != -1; }) : allpasseengers;
|
currentList = currentSearchKey ? _.filter(allpasseengers, function (p) { return p.key.indexOf(currentSearchKey) !== -1 || p.first_letter.indexOf(currentSearchKey) !== -1; }) : allpasseengers;
|
||||||
currentPageIndex = 1;
|
currentPageIndex = 1;
|
||||||
totalpage = Math.ceil(currentList.length / pagesize);
|
totalpage = Math.ceil(currentList.length / pagesize);
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@
|
|||||||
submitProgress.find("span").html("订票失败...错误信息:" + data.msg);
|
submitProgress.find("span").html("订票失败...错误信息:" + data.msg);
|
||||||
submitBtn[0].disabled = false;
|
submitBtn[0].disabled = false;
|
||||||
|
|
||||||
if (data.msg.indexOf("验证码") === -1) {
|
if (data.msg.indexOf("验证码") === -1 && data.msg.indexOf("请重试") === -1) {
|
||||||
//切换至错误页面
|
//切换至错误页面
|
||||||
var dom = $("#ticket-submit-info").find("section.ticket-submit-info-vc").hide().end().find("section.ticket-submit-info-status-failed").show();
|
var dom = $("#ticket-submit-info").find("section.ticket-submit-info-vc").hide().end().find("section.ticket-submit-info-status-failed").show();
|
||||||
dom.find("div>p:eq(0) span").html(data.msg);
|
dom.find("div>p:eq(0) span").html(data.msg);
|
||||||
|
@ -126,10 +126,10 @@
|
|||||||
var lkey = key.toLowerCase();
|
var lkey = key.toLowerCase();
|
||||||
|
|
||||||
currentList = _.filter(_.values(cityMap), function (e) {
|
currentList = _.filter(_.values(cityMap), function (e) {
|
||||||
return e.p.indexOf(lkey) != -1 ||
|
return e.p.indexOf(lkey) !== -1 ||
|
||||||
e.n.indexOf(key) != -1 ||
|
e.n.indexOf(key) !== -1 ||
|
||||||
e.c.indexOf(key) != -1 ||
|
e.c.indexOf(key) !== -1 ||
|
||||||
e.h.indexOf(lkey) != -1;
|
e.h.indexOf(lkey) !== -1;
|
||||||
});
|
});
|
||||||
parser.sortCity(currentList);
|
parser.sortCity(currentList);
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user