談談我對前端組件化中「組件」的理解,順帶寫個Vue與React的demo

前言

前端已通過了單兵做戰的時代了,如今一個稍微複雜一點的項目都須要幾我的協同開發,一個戰略級別的APP的話分工會更細,好比攜程:javascript

攜程app = 機票頻道 + 酒店頻道 + 旅遊頻道 + ......css

每一個頻道有獨立的團隊去維護這些代碼,具體到某一個頻道的話有會由數十個不等的頁面組成,在各個頁面開發過程當中,會產生不少重複的功能,好比彈出層提示框,像這種純粹非業務的UI,便成了咱們所謂的UI組件,最初的前端組件也就僅僅指的是UI組件。html

而因爲移動端的興起,前端頁面的邏輯已經變得很重了,一個頁面的代碼超過5000行的場景漸漸增多,這個時候頁面的維護便會頗有問題,牽一髮而動全身的事情會常常發生,爲了解決這個問題,便出現了前端組件化,這個組件化就不是UI組件了,而是包含具體業務的業務組件。前端

這種開發的思想其實也就是分而治之(最重要的架構思想),APP分紅多個頻道由各個團隊維護,頻道分爲多個頁面由幾個開發維護,頁面邏輯過於複雜,便將頁面分爲不少個業務組件模塊分而治之,這樣的話維護人員每次只須要改動對應的模塊便可,以達到最大程度的下降開發難度與維護成本的效果,因此如今比較好的框架都會對組件化做必定程度的實現。java

組件通常是與展現相關,視覺變動與交互優化是一個產品最容易產生的迭代,因此多數組件相關的框架核心都是View層的實現,好比Vue與React的就認爲本身僅僅是「View」,雖然展現與交互不斷的在改變,可是底層展現的數據卻不常變化,而View是表象,數據是根本,因此如何能更好的將數據展現到View也是各個組件須要考慮的,從而衍生出了單向數據綁定與雙向數據綁定等概念,組件與組件之間的通訊每每也是數據爲橋樑。git

因此若是沒有複雜的業務邏輯的話,根本不能體現出組件化編程解決的痛點,這個也是爲何todoMVC中的demo沒有太大參考意義。github

今天,咱們就一塊兒來研究一下前端組件化中View部分的實現,後面再看看作一個相同業務(有點複雜的業務),也簡單對比下React與Vue實現相同業務的差別。web

PS:文章只是我的觀點,有問題請指正面試

導讀

github

代碼地址:https://github.com/yexiaochai/module/ajax

演示地址:http://yexiaochai.github.io/module/me/index.html

若是對文中的一些代碼比較疑惑,能夠對比着看看這些文章:

【一次面試】再談javascript中的繼承

【移動前端開發實踐】從無到有(統計、請求、MVC、模塊化)H5開發須知

【組件化開發】前端進階篇之如何編寫可維護可升級的代碼

預覽

組件化的實現

以前咱們已經說過,所謂組件化,很大程度上是在View上面作文章,要把一個View打散,作到分散,可是又總會有一個整體的控制器在控制全部的View,把他們合到一塊兒,通常來講這個總的控制器是根組件,不少時候就是頁面自己(View實例自己)。

根據以前的經驗,組件化不必定是越細越好,組件嵌套也不推薦,通常是將一個頁面分爲多個組件,而子組件再也不作過深嵌套(我的經驗)

因此咱們這裏的第一步是實現一個通用的View,這裏借鑑以前的代碼(【組件化開發】前端進階篇之如何編寫可維護可升級的代碼):

  1 define([], function () {
  2     'use strict';
  3 
  4     return _.inherit({
  5 
  6         showPageView: function (name, _viewdata, id) {
  7             this.APP.curViewIns = this;
  8             this.APP.showPageView(name, _viewdata, id)
  9         },
 10 
 11         propertys: function () {
 12             //這裏設置UI的根節點所處包裹層
 13             this.wrapper = $('#main');
 14             this.id = _.uniqueId('page-view-');
 15             this.classname = '';
 16 
 17             this.viewId = null;
 18             this.refer = null;
 19 
 20             //模板字符串,各個組件不一樣,如今加入預編譯機制
 21             this.template = '';
 22             //事件機制
 23             this.events = {};
 24 
 25             //自定義事件
 26             //此處須要注意mask 綁定事件先後問題,考慮scroll.radio插件類型的mask應用,考慮組件通訊
 27             this.eventArr = {};
 28 
 29             //初始狀態爲實例化
 30             this.status = 'init';
 31         },
 32 
 33         //子類事件綁定若想保留父級的,應該使用該方法
 34         addEvents: function (events) {
 35             if (_.isObject(events)) _.extend(this.events, events);
 36         },
 37 
 38         on: function (type, fn, insert) {
 39             if (!this.eventArr[type]) this.eventArr[type] = [];
 40 
 41             //頭部插入
 42             if (insert) {
 43                 this.eventArr[type].splice(0, 0, fn);
 44             } else {
 45                 this.eventArr[type].push(fn);
 46             }
 47         },
 48 
 49         off: function (type, fn) {
 50             if (!this.eventArr[type]) return;
 51             if (fn) {
 52                 this.eventArr[type] = _.without(this.eventArr[type], fn);
 53             } else {
 54                 this.eventArr[type] = [];
 55             }
 56         },
 57 
 58         trigger: function (type) {
 59             var _slice = Array.prototype.slice;
 60             var args = _slice.call(arguments, 1);
 61             var events = this.eventArr;
 62             var results = [], i, l;
 63 
 64             if (events[type]) {
 65                 for (i = 0, l = events[type].length; i < l; i++) {
 66                     results[results.length] = events[type][i].apply(this, args);
 67                 }
 68             }
 69             return results;
 70         },
 71 
 72         createRoot: function (html) {
 73 
 74             //若是存在style節點,而且style節點不存在的時候須要處理
 75             if (this.style && !$('#page_' + this.viewId)[0]) {
 76                 $('head').append($('<style id="page_' + this.viewId + '" class="page-style">' + this.style + '</style>'))
 77             }
 78 
 79             //若是具備fake節點,須要移除
 80             $('#fake-page').remove();
 81 
 82             //UI的根節點
 83             this.$el = $('<div class="cm-view page-' + this.viewId + ' ' + this.classname + '" style="display: none; " id="' + this.id + '">' + html + '</div>');
 84             if (this.wrapper.find('.cm-view')[0]) {
 85                 this.wrapper.append(this.$el);
 86             } else {
 87                 this.wrapper.html('').append(this.$el);
 88             }
 89 
 90         },
 91 
 92         _isAddEvent: function (key) {
 93             if (key == 'onCreate' || key == 'onPreShow' || key == 'onShow' || key == 'onRefresh' || key == 'onHide')
 94                 return true;
 95             return false;
 96         },
 97 
 98         setOption: function (options) {
 99             //這裏能夠寫成switch,開始沒有想到有這麼多分支
100             for (var k in options) {
101                 if (k == 'events') {
102                     _.extend(this[k], options[k]);
103                     continue;
104                 } else if (this._isAddEvent(k)) {
105                     this.on(k, options[k])
106                     continue;
107                 }
108                 this[k] = options[k];
109             }
110             //      _.extend(this, options);
111         },
112 
113         initialize: function (opts) {
114             //這種默認屬性
115             this.propertys();
116             //根據參數重置屬性
117             this.setOption(opts);
118             //檢測不合理屬性,修正爲正確數據
119             this.resetPropery();
120 
121             this.addEvent();
122             this.create();
123 
124             this.initElement();
125 
126             window.sss = this;
127 
128         },
129 
130         $: function (selector) {
131             return this.$el.find(selector);
132         },
133 
134         //提供屬性重置功能,對屬性作檢查
135         resetPropery: function () { },
136 
137         //各事件註冊點,用於被繼承override
138         addEvent: function () {
139         },
140 
141         create: function () {
142             this.trigger('onPreCreate');
143             //若是沒有傳入模板,說明html結構已經存在
144             this.createRoot(this.render());
145 
146             this.status = 'create';
147             this.trigger('onCreate');
148         },
149 
150         //實例化須要用到到dom元素
151         initElement: function () { },
152 
153         render: function (callback) {
154             var html = this.template;
155             if (!this.template) return '';
156             //引入預編譯機制
157             if (_.isFunction(this.template)) {
158                 html = this.template(data);
159             } else {
160                 html = _.template(this.template)({});
161             }
162             typeof callback == 'function' && callback.call(this);
163             return html;
164         },
165 
166         refresh: function (needRecreate) {
167             this.resetPropery();
168             if (needRecreate) {
169                 this.create();
170             } else {
171                 this.$el.html(this.render());
172             }
173             this.initElement();
174             if (this.status != 'hide') this.show();
175             this.trigger('onRefresh');
176         },
177 
178         /**
179         * @description 組件顯示方法,首次顯示會將ui對象實際由內存插入包裹層
180         * @method initialize
181         * @param {Object} opts
182         */
183         show: function () {
184             this.trigger('onPreShow');
185 
186             this.$el.show();
187             this.status = 'show';
188 
189             this.bindEvents();
190 
191             this.initHeader();
192             this.trigger('onShow');
193         },
194 
195         initHeader: function () { },
196 
197         hide: function () {
198             if (!this.$el || this.status !== 'show') return;
199 
200             this.trigger('onPreHide');
201             this.$el.hide();
202 
203             this.status = 'hide';
204             this.unBindEvents();
205             this.trigger('onHide');
206         },
207 
208         destroy: function () {
209             this.status = 'destroy';
210             this.unBindEvents();
211             this.$root.remove();
212             this.trigger('onDestroy');
213             delete this;
214         },
215 
216         bindEvents: function () {
217             var events = this.events;
218 
219             if (!(events || (events = _.result(this, 'events')))) return this;
220             this.unBindEvents();
221 
222             // 解析event參數的正則
223             var delegateEventSplitter = /^(\S+)\s*(.*)$/;
224             var key, method, match, eventName, selector;
225 
226             // 作簡單的字符串數據解析
227             for (key in events) {
228                 method = events[key];
229                 if (!_.isFunction(method)) method = this[events[key]];
230                 if (!method) continue;
231 
232                 match = key.match(delegateEventSplitter);
233                 eventName = match[1], selector = match[2];
234                 method = _.bind(method, this);
235                 eventName += '.delegateViewEvents' + this.id;
236 
237                 if (selector === '') {
238                     this.$el.on(eventName, method);
239                 } else {
240                     this.$el.on(eventName, selector, method);
241                 }
242             }
243 
244             return this;
245         },
246 
247         unBindEvents: function () {
248             this.$el.off('.delegateViewEvents' + this.id);
249             return this;
250         },
251 
252         getParam: function (key) {
253             return _.getUrlParam(window.location.href, key)
254         },
255 
256         renderTpl: function (tpl, data) {
257             if (!_.isFunction(tpl)) tpl = _.template(tpl);
258             return tpl(data);
259         }
260 
261 
262     });
263 
264 });
View Code

有了View的代碼後便須要組件級別的代碼,正如以前所說,這裏的組件只有根元素與子組件兩層的層級:

  1 define([], function () {
  2     'use strict';
  3 
  4     return _.inherit({
  5 
  6         propertys: function () {
  7             //這裏設置UI的根節點所處包裹層,必須設置
  8             this.$el = null;
  9 
 10             //用於定位dom的選擇器
 11             this.selector = '';
 12 
 13             //每一個moduleView必須有一個父view,頁面級容器
 14             this.view = null;
 15 
 16             //模板字符串,各個組件不一樣,如今加入預編譯機制
 17             this.template = '';
 18 
 19             //事件機制
 20             this.events = {};
 21 
 22             //實體model,跨模塊通訊的橋樑
 23             this.entity = null;
 24         },
 25 
 26         setOption: function (options) {
 27             //這裏能夠寫成switch,開始沒有想到有這麼多分支
 28             for (var k in options) {
 29                 if (k == 'events') {
 30                     _.extend(this[k], options[k]);
 31                     continue;
 32                 }
 33                 this[k] = options[k];
 34             }
 35             //      _.extend(this, options);
 36         },
 37 
 38         //@override
 39         initData: function () {
 40         },
 41 
 42         //若是傳入了dom便
 43         initWrapper: function (el) {
 44             if (el && el[0]) {
 45                 this.$el = el;
 46                 return;
 47             }
 48             this.$el = this.view.$(this.selector);
 49         },
 50 
 51         initialize: function (opts) {
 52 
 53             //這種默認屬性
 54             this.propertys();
 55             //根據參數重置屬性
 56             this.setOption(opts);
 57             this.initData();
 58 
 59             this.initWithoutRender();
 60 
 61         },
 62 
 63         //當父容器關閉後,其對應子容器也應該隱藏
 64         bindViewEvent: function () {
 65             if (!this.view) return;
 66             var scope = this;
 67             this.view.on('onHide', function () {
 68                 scope.onHide();
 69             });
 70         },
 71 
 72         //處理dom已經存在,不須要渲染的狀況
 73         initWithoutRender: function () {
 74             if (this.template) return;
 75             var scope = this;
 76             this.view.on('onShow', function () {
 77                 scope.initWrapper();
 78                 if (!scope.$el[0]) return;
 79                 //若是沒有父view則不能繼續
 80                 if (!scope.view) return;
 81                 scope.initElement();
 82                 scope.bindEvents();
 83             });
 84         },
 85 
 86         $: function (selector) {
 87             return this.$el.find(selector);
 88         },
 89 
 90         //實例化須要用到到dom元素
 91         initElement: function () { },
 92 
 93         //@override
 94         //收集來自各方的實體組成view渲染須要的數據,須要重寫
 95         getViewModel: function () {
 96             throw '必須重寫';
 97         },
 98 
 99         _render: function (callback) {
100             var data = this.getViewModel() || {};
101             var html = this.template;
102             if (!this.template) return '';
103             //引入預編譯機制
104             if (_.isFunction(this.template)) {
105                 html = this.template(data);
106             } else {
107                 html = _.template(this.template)(data);
108             }
109             typeof callback == 'function' && callback.call(this);
110             return html;
111         },
112 
113         //渲染時必須傳入dom映射
114         render: function () {
115             this.initWrapper();
116             if (!this.$el[0]) return;
117 
118             //若是沒有父view則不能繼續
119             if (!this.view) return;
120 
121             var html = this._render();
122             this.$el.html(html);
123             this.initElement();
124             this.bindEvents();
125 
126         },
127 
128         bindEvents: function () {
129             var events = this.events;
130 
131             if (!(events || (events = _.result(this, 'events')))) return this;
132             this.unBindEvents();
133 
134             // 解析event參數的正則
135             var delegateEventSplitter = /^(\S+)\s*(.*)$/;
136             var key, method, match, eventName, selector;
137 
138             // 作簡單的字符串數據解析
139             for (key in events) {
140                 method = events[key];
141                 if (!_.isFunction(method)) method = this[events[key]];
142                 if (!method) continue;
143 
144                 match = key.match(delegateEventSplitter);
145                 eventName = match[1], selector = match[2];
146                 method = _.bind(method, this);
147                 eventName += '.delegateUIEvents' + this.id;
148 
149                 if (selector === '') {
150                     this.$el.on(eventName, method);
151                 } else {
152                     this.$el.on(eventName, selector, method);
153                 }
154             }
155 
156             return this;
157         },
158 
159         unBindEvents: function () {
160             this.$el.off('.delegateUIEvents' + this.id);
161             return this;
162         }
163     });
164 
165 });
View Code

有了根View與View組件的實現,剩下的即是數據實體的實現,View與組件Module之間通訊的橋樑就是數據Entity,事實上咱們的View或者組件模塊未必會須要數據實體Entity,只有在業務邏輯的複雜度達到必定階段才須要分模塊,若是dom操做過多的話就須要Entity了:

  1 define([], function () {
  2     /*
  3     一些原則:
  4     init方法時,不可引發其它字段update
  5     */
  6     var Entity = _.inherit({
  7         initialize: function (opts) {
  8             this.propertys();
  9             this.setOption(opts);
 10         },
 11 
 12         propertys: function () {
 13             //只取頁面展現須要數據
 14             this.data = {};
 15 
 16             //局部數據改變對應的響應程序,暫定爲一個方法
 17             //能夠是一個類的實例,若是是實例必須有render方法
 18             this.controllers = {};
 19 
 20             this.scope = null;
 21 
 22         },
 23 
 24         subscribed: function (namespace, callback, scope) {
 25             this.subscribed();
 26         },
 27 
 28         unsubscribed: function (namespace) {
 29             this.unsubscribe(namespace);
 30         },
 31 
 32         subscribe: function (namespace, callback, scope) {
 33             if (typeof namespace === 'function') {
 34                 scope = callback;
 35                 callback = namespace;
 36                 namespace = 'update';
 37             }
 38             if (!namespace || !callback) return;
 39             if (scope) callback = $.proxy(callback, scope);
 40             if (!this.controllers[namespace]) this.controllers[namespace] = [];
 41             this.controllers[namespace].push(callback);
 42         },
 43 
 44         unsubscribe: function (namespace) {
 45             if (!namespace) this.controllers = {};
 46             if (this.controllers[namespace]) this.controllers[namespace] = [];
 47         },
 48 
 49         publish: function (namespace, data) {
 50             if (!namespace) return;
 51             if (!this.controllers[namespace]) return;
 52             var arr = this.controllers[namespace];
 53             var i, len = arr.length;
 54             for (i = 0; i < len; i++) {
 55                 arr[i](data);
 56             }
 57         },
 58 
 59         setOption: function (opts) {
 60             for (var k in opts) {
 61                 this[k] = opts[k];
 62             }
 63         },
 64 
 65         //首次初始化時,須要矯正數據,好比作服務器適配
 66         //@override
 67         handleData: function () { },
 68 
 69         //通常用於首次根據服務器數據源填充數據
 70         initData: function (data) {
 71             var k;
 72             if (!data) return;
 73 
 74             //若是默認數據沒有被覆蓋可能有誤
 75             for (k in this.data) {
 76                 if (data[k]) this.data[k] = data[k];
 77             }
 78 
 79             this.handleData();
 80             this.publish('init', this.get());
 81         },
 82 
 83         //驗證data的有效性,若是無效的話,不該該進行如下邏輯,而且應該報警
 84         //@override
 85         validateData: function () {
 86             return true;
 87         },
 88 
 89         //獲取數據前,能夠進行格式化
 90         //@override
 91         formatData: function (data) {
 92             return data;
 93         },
 94 
 95         //獲取數據
 96         get: function () {
 97             if (!this.validateData()) {
 98                 //須要log
 99                 return {};
100             }
101             return this.formatData(this.data);
102         },
103 
104         //數據跟新後須要作的動做,執行對應的controller改變dom
105         //@override
106         update: function (key) {
107             key = key || 'update';
108             var data = this.get();
109             this.publish(key, data);
110         }
111 
112     });
113 
114     return Entity;
115 });
View Code

咱們這裏抽取一段火車票列表的篩選功能作實現,這個頁面有必定複雜度又不是太難,大概頁面是這個樣子的:

由於,咱們這裏的關注點在View,這裏就直接將網上上海到北京的數據給拿下來:

   1 this.listData = [
   2                 {
   3                 "train_no": "87000K180502",
   4                 "train_number": "K1805",
   5                 "from_station": "上海南",
   6                 "to_station": "杭州",
   7                 "from_time": "04:22",
   8                 "to_time": "06:29",
   9                 "from_station_type": "途經",
  10                 "to_station_type": "終點",
  11                 "day_diff": "0",
  12                 "use_time": "127",
  13                 "sale_time": "15:30",
  14                 "control_day": 59,
  15                 "from_telecode": "SNH",
  16                 "to_telecode": "HZH",
  17                 "can_web_buy": "Y",
  18                 "note": "",
  19                 "seats": [{
  20                     "seat_price": "28.5",
  21                     "seat_name": "硬座",
  22                     "seat_bookable": 1,
  23                     "seat_yupiao": 555
  24                 }, {
  25                     "seat_price": "74.5",
  26                     "seat_name": "硬臥上",
  27                     "seat_bookable": 1,
  28                     "seat_yupiao": 551
  29                 }, {
  30                     "seat_price": "77.5",
  31                     "seat_name": "硬臥中",
  32                     "seat_bookable": 1,
  33                     "seat_yupiao": 551
  34                 }, {
  35                     "seat_price": "84.5",
  36                     "seat_name": "硬臥下",
  37                     "seat_bookable": 1,
  38                     "seat_yupiao": 551
  39                 }, {
  40                     "seat_price": "112.5",
  41                     "seat_name": "軟臥上",
  42                     "seat_bookable": 1,
  43                     "seat_yupiao": 28
  44                 }, {
  45                     "seat_price": "127.0",
  46                     "seat_name": "軟臥下",
  47                     "seat_bookable": 1,
  48                     "seat_yupiao": 28
  49                 }, {"seat_price": "28.5", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 334}]
  50             }, {
  51                 "train_no": "47000K151100",
  52                 "train_number": "K1511",
  53                 "from_station": "上海南",
  54                 "to_station": "杭州東",
  55                 "from_time": "04:56",
  56                 "to_time": "06:45",
  57                 "from_station_type": "途經",
  58                 "to_station_type": "途經",
  59                 "day_diff": "0",
  60                 "use_time": "109",
  61                 "sale_time": "15:30",
  62                 "control_day": 59,
  63                 "from_telecode": "SNH",
  64                 "to_telecode": "HGH",
  65                 "can_web_buy": "Y",
  66                 "note": "",
  67                 "seats": [{
  68                     "seat_price": "24.5",
  69                     "seat_name": "硬座",
  70                     "seat_bookable": 1,
  71                     "seat_yupiao": 8
  72                 }, {
  73                     "seat_price": "70.5",
  74                     "seat_name": "硬臥上",
  75                     "seat_bookable": 1,
  76                     "seat_yupiao": 8
  77                 }, {
  78                     "seat_price": "73.5",
  79                     "seat_name": "硬臥中",
  80                     "seat_bookable": 1,
  81                     "seat_yupiao": 8
  82                 }, {
  83                     "seat_price": "80.0",
  84                     "seat_name": "硬臥下",
  85                     "seat_bookable": 1,
  86                     "seat_yupiao": 8
  87                 }, {
  88                     "seat_price": "108.5",
  89                     "seat_name": "軟臥上",
  90                     "seat_bookable": 1,
  91                     "seat_yupiao": 1
  92                 }, {
  93                     "seat_price": "122.5",
  94                     "seat_name": "軟臥下",
  95                     "seat_bookable": 1,
  96                     "seat_yupiao": 1
  97                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
  98             }, {
  99                 "train_no": "1100000K7509",
 100                 "train_number": "K75",
 101                 "from_station": "上海南",
 102                 "to_station": "杭州東",
 103                 "from_time": "05:02",
 104                 "to_time": "06:58",
 105                 "from_station_type": "途經",
 106                 "to_station_type": "途經",
 107                 "day_diff": "0",
 108                 "use_time": "116",
 109                 "sale_time": "15:30",
 110                 "control_day": 59,
 111                 "from_telecode": "SNH",
 112                 "to_telecode": "HGH",
 113                 "can_web_buy": "Y",
 114                 "note": "",
 115                 "seats": [{
 116                     "seat_price": "24.5",
 117                     "seat_name": "硬座",
 118                     "seat_bookable": 0,
 119                     "seat_yupiao": 0
 120                 }, {
 121                     "seat_price": "70.5",
 122                     "seat_name": "硬臥上",
 123                     "seat_bookable": 1,
 124                     "seat_yupiao": 9
 125                 }, {
 126                     "seat_price": "73.5",
 127                     "seat_name": "硬臥中",
 128                     "seat_bookable": 1,
 129                     "seat_yupiao": 9
 130                 }, {
 131                     "seat_price": "80.0",
 132                     "seat_name": "硬臥下",
 133                     "seat_bookable": 1,
 134                     "seat_yupiao": 9
 135                 }, {
 136                     "seat_price": "108.5",
 137                     "seat_name": "軟臥上",
 138                     "seat_bookable": 0,
 139                     "seat_yupiao": 0
 140                 }, {
 141                     "seat_price": "122.5",
 142                     "seat_name": "軟臥下",
 143                     "seat_bookable": 0,
 144                     "seat_yupiao": 0
 145                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 240}]
 146             }, {
 147                 "train_no": "48000K837105",
 148                 "train_number": "K8371",
 149                 "from_station": "上海南",
 150                 "to_station": "杭州",
 151                 "from_time": "05:43",
 152                 "to_time": "08:14",
 153                 "from_station_type": "途經",
 154                 "to_station_type": "途經",
 155                 "day_diff": "0",
 156                 "use_time": "151",
 157                 "sale_time": "15:30",
 158                 "control_day": 59,
 159                 "from_telecode": "SNH",
 160                 "to_telecode": "HZH",
 161                 "can_web_buy": "Y",
 162                 "note": "",
 163                 "seats": [{
 164                     "seat_price": "28.5",
 165                     "seat_name": "硬座",
 166                     "seat_bookable": 1,
 167                     "seat_yupiao": 6
 168                 }, {
 169                     "seat_price": "74.5",
 170                     "seat_name": "硬臥上",
 171                     "seat_bookable": 1,
 172                     "seat_yupiao": 21
 173                 }, {
 174                     "seat_price": "77.5",
 175                     "seat_name": "硬臥中",
 176                     "seat_bookable": 1,
 177                     "seat_yupiao": 21
 178                 }, {
 179                     "seat_price": "84.5",
 180                     "seat_name": "硬臥下",
 181                     "seat_bookable": 1,
 182                     "seat_yupiao": 21
 183                 }, {
 184                     "seat_price": "112.5",
 185                     "seat_name": "軟臥上",
 186                     "seat_bookable": 0,
 187                     "seat_yupiao": 0
 188                 }, {
 189                     "seat_price": "127.0",
 190                     "seat_name": "軟臥下",
 191                     "seat_bookable": 0,
 192                     "seat_yupiao": 0
 193                 }, {"seat_price": "28.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 194             }, {
 195                 "train_no": "5l000G754130",
 196                 "train_number": "G7541",
 197                 "from_station": "上海虹橋",
 198                 "to_station": "杭州東",
 199                 "from_time": "06:14",
 200                 "to_time": "07:06",
 201                 "from_station_type": "起點",
 202                 "to_station_type": "途經",
 203                 "day_diff": "0",
 204                 "use_time": "52",
 205                 "sale_time": "13:30",
 206                 "control_day": 59,
 207                 "from_telecode": "AOH",
 208                 "to_telecode": "HGH",
 209                 "can_web_buy": "Y",
 210                 "note": "",
 211                 "seats": [{
 212                     "seat_price": "73.0",
 213                     "seat_name": "二等座",
 214                     "seat_bookable": 1,
 215                     "seat_yupiao": 375
 216                 }, {
 217                     "seat_price": "117.0",
 218                     "seat_name": "一等座",
 219                     "seat_bookable": 1,
 220                     "seat_yupiao": 24
 221                 }, {
 222                     "seat_price": "219.5",
 223                     "seat_name": "商務座",
 224                     "seat_bookable": 1,
 225                     "seat_yupiao": 10
 226                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 227             }, {
 228                 "train_no": "5l000G7331B0",
 229                 "train_number": "G7331",
 230                 "from_station": "上海虹橋",
 231                 "to_station": "杭州東",
 232                 "from_time": "06:20",
 233                 "to_time": "07:12",
 234                 "from_station_type": "起點",
 235                 "to_station_type": "途經",
 236                 "day_diff": "0",
 237                 "use_time": "52",
 238                 "sale_time": "13:30",
 239                 "control_day": 59,
 240                 "from_telecode": "AOH",
 241                 "to_telecode": "HGH",
 242                 "can_web_buy": "Y",
 243                 "note": "",
 244                 "seats": [{
 245                     "seat_price": "73.0",
 246                     "seat_name": "二等座",
 247                     "seat_bookable": 1,
 248                     "seat_yupiao": 339
 249                 }, {
 250                     "seat_price": "117.0",
 251                     "seat_name": "一等座",
 252                     "seat_bookable": 1,
 253                     "seat_yupiao": 26
 254                 }, {
 255                     "seat_price": "219.5",
 256                     "seat_name": "商務座",
 257                     "seat_bookable": 1,
 258                     "seat_yupiao": 10
 259                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 260             }, {
 261                 "train_no": "470000T13501",
 262                 "train_number": "T135",
 263                 "from_station": "上海南",
 264                 "to_station": "杭州東",
 265                 "from_time": "06:21",
 266                 "to_time": "08:18",
 267                 "from_station_type": "途經",
 268                 "to_station_type": "途經",
 269                 "day_diff": "0",
 270                 "use_time": "117",
 271                 "sale_time": "15:30",
 272                 "control_day": 59,
 273                 "from_telecode": "SNH",
 274                 "to_telecode": "HGH",
 275                 "can_web_buy": "Y",
 276                 "note": "",
 277                 "seats": [{
 278                     "seat_price": "24.5",
 279                     "seat_name": "硬座",
 280                     "seat_bookable": 1,
 281                     "seat_yupiao": 4
 282                 }, {
 283                     "seat_price": "70.5",
 284                     "seat_name": "硬臥上",
 285                     "seat_bookable": 1,
 286                     "seat_yupiao": 38
 287                 }, {
 288                     "seat_price": "73.5",
 289                     "seat_name": "硬臥中",
 290                     "seat_bookable": 1,
 291                     "seat_yupiao": 38
 292                 }, {
 293                     "seat_price": "80.0",
 294                     "seat_name": "硬臥下",
 295                     "seat_bookable": 1,
 296                     "seat_yupiao": 38
 297                 }, {
 298                     "seat_price": "108.5",
 299                     "seat_name": "軟臥上",
 300                     "seat_bookable": 0,
 301                     "seat_yupiao": 0
 302                 }, {
 303                     "seat_price": "122.5",
 304                     "seat_name": "軟臥下",
 305                     "seat_bookable": 0,
 306                     "seat_yupiao": 0
 307                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 308             }, {
 309                 "train_no": "5l000G132120",
 310                 "train_number": "G1321",
 311                 "from_station": "上海虹橋",
 312                 "to_station": "杭州東",
 313                 "from_time": "06:25",
 314                 "to_time": "07:17",
 315                 "from_station_type": "起點",
 316                 "to_station_type": "途經",
 317                 "day_diff": "0",
 318                 "use_time": "52",
 319                 "sale_time": "13:30",
 320                 "control_day": 57,
 321                 "from_telecode": "AOH",
 322                 "to_telecode": "HGH",
 323                 "can_web_buy": "Y",
 324                 "note": "",
 325                 "seats": [{
 326                     "seat_price": "73.0",
 327                     "seat_name": "二等座",
 328                     "seat_bookable": 1,
 329                     "seat_yupiao": 304
 330                 }, {
 331                     "seat_price": "117.0",
 332                     "seat_name": "一等座",
 333                     "seat_bookable": 1,
 334                     "seat_yupiao": 15
 335                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 9}]
 336             }, {
 337                 "train_no": "5l000G733380",
 338                 "train_number": "G7333",
 339                 "from_station": "上海虹橋",
 340                 "to_station": "杭州東",
 341                 "from_time": "06:30",
 342                 "to_time": "07:22",
 343                 "from_station_type": "起點",
 344                 "to_station_type": "途經",
 345                 "day_diff": "0",
 346                 "use_time": "52",
 347                 "sale_time": "13:30",
 348                 "control_day": 59,
 349                 "from_telecode": "AOH",
 350                 "to_telecode": "HGH",
 351                 "can_web_buy": "Y",
 352                 "note": "",
 353                 "seats": [{
 354                     "seat_price": "73.0",
 355                     "seat_name": "二等座",
 356                     "seat_bookable": 1,
 357                     "seat_yupiao": 702
 358                 }, {
 359                     "seat_price": "117.0",
 360                     "seat_name": "一等座",
 361                     "seat_bookable": 1,
 362                     "seat_yupiao": 51
 363                 }, {
 364                     "seat_price": "219.5",
 365                     "seat_name": "商務座",
 366                     "seat_bookable": 1,
 367                     "seat_yupiao": 20
 368                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 369             }, {
 370                 "train_no": "0400000K5004",
 371                 "train_number": "K47",
 372                 "from_station": "上海南",
 373                 "to_station": "杭州",
 374                 "from_time": "06:34",
 375                 "to_time": "09:15",
 376                 "from_station_type": "途經",
 377                 "to_station_type": "終點",
 378                 "day_diff": "0",
 379                 "use_time": "161",
 380                 "sale_time": "15:30",
 381                 "control_day": 59,
 382                 "from_telecode": "SNH",
 383                 "to_telecode": "HZH",
 384                 "can_web_buy": "Y",
 385                 "note": "",
 386                 "seats": [{
 387                     "seat_price": "28.5",
 388                     "seat_name": "硬座",
 389                     "seat_bookable": 1,
 390                     "seat_yupiao": 6
 391                 }, {
 392                     "seat_price": "74.5",
 393                     "seat_name": "硬臥上",
 394                     "seat_bookable": 1,
 395                     "seat_yupiao": 122
 396                 }, {
 397                     "seat_price": "77.5",
 398                     "seat_name": "硬臥中",
 399                     "seat_bookable": 1,
 400                     "seat_yupiao": 122
 401                 }, {
 402                     "seat_price": "84.5",
 403                     "seat_name": "硬臥下",
 404                     "seat_bookable": 1,
 405                     "seat_yupiao": 122
 406                 }, {
 407                     "seat_price": "112.5",
 408                     "seat_name": "軟臥上",
 409                     "seat_bookable": 1,
 410                     "seat_yupiao": 1
 411                 }, {
 412                     "seat_price": "127.0",
 413                     "seat_name": "軟臥下",
 414                     "seat_bookable": 1,
 415                     "seat_yupiao": 1
 416                 }, {"seat_price": "28.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 417             }, {
 418                 "train_no": "5l000G7301B1",
 419                 "train_number": "G7301",
 420                 "from_station": "上海虹橋",
 421                 "to_station": "杭州",
 422                 "from_time": "06:35",
 423                 "to_time": "07:40",
 424                 "from_station_type": "起點",
 425                 "to_station_type": "終點",
 426                 "day_diff": "0",
 427                 "use_time": "65",
 428                 "sale_time": "13:30",
 429                 "control_day": 59,
 430                 "from_telecode": "AOH",
 431                 "to_telecode": "HZH",
 432                 "can_web_buy": "Y",
 433                 "note": "",
 434                 "seats": [{
 435                     "seat_price": "77.5",
 436                     "seat_name": "二等座",
 437                     "seat_bookable": 1,
 438                     "seat_yupiao": 490
 439                 }, {
 440                     "seat_price": "123.5",
 441                     "seat_name": "一等座",
 442                     "seat_bookable": 1,
 443                     "seat_yupiao": 26
 444                 }, {
 445                     "seat_price": "233.5",
 446                     "seat_name": "商務座",
 447                     "seat_bookable": 1,
 448                     "seat_yupiao": 10
 449                 }, {"seat_price": "77.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 450             }, {
 451                 "train_no": "5l000D314510",
 452                 "train_number": "D3145",
 453                 "from_station": "上海虹橋",
 454                 "to_station": "杭州東",
 455                 "from_time": "06:40",
 456                 "to_time": "07:41",
 457                 "from_station_type": "起點",
 458                 "to_station_type": "途經",
 459                 "day_diff": "0",
 460                 "use_time": "61",
 461                 "sale_time": "13:30",
 462                 "control_day": 59,
 463                 "from_telecode": "AOH",
 464                 "to_telecode": "HGH",
 465                 "can_web_buy": "Y",
 466                 "note": "",
 467                 "seats": [{
 468                     "seat_price": "49.0",
 469                     "seat_name": "二等座",
 470                     "seat_bookable": 1,
 471                     "seat_yupiao": 21
 472                 }, {
 473                     "seat_price": "59.0",
 474                     "seat_name": "一等座",
 475                     "seat_bookable": 1,
 476                     "seat_yupiao": 1
 477                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 478             }, {
 479                 "train_no": "5l000G138330",
 480                 "train_number": "G1383",
 481                 "from_station": "上海虹橋",
 482                 "to_station": "杭州東",
 483                 "from_time": "06:45",
 484                 "to_time": "07:46",
 485                 "from_station_type": "起點",
 486                 "to_station_type": "途經",
 487                 "day_diff": "0",
 488                 "use_time": "61",
 489                 "sale_time": "13:30",
 490                 "control_day": 59,
 491                 "from_telecode": "AOH",
 492                 "to_telecode": "HGH",
 493                 "can_web_buy": "Y",
 494                 "note": "",
 495                 "seats": [{
 496                     "seat_price": "73.0",
 497                     "seat_name": "二等座",
 498                     "seat_bookable": 1,
 499                     "seat_yupiao": 384
 500                 }, {
 501                     "seat_price": "117.0",
 502                     "seat_name": "一等座",
 503                     "seat_bookable": 1,
 504                     "seat_yupiao": 16
 505                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 0, "seat_yupiao": 0}]
 506             }, {
 507                 "train_no": "5l000G750164",
 508                 "train_number": "G7501",
 509                 "from_station": "上海虹橋",
 510                 "to_station": "杭州東",
 511                 "from_time": "06:50",
 512                 "to_time": "07:56",
 513                 "from_station_type": "起點",
 514                 "to_station_type": "途經",
 515                 "day_diff": "0",
 516                 "use_time": "66",
 517                 "sale_time": "13:30",
 518                 "control_day": 59,
 519                 "from_telecode": "AOH",
 520                 "to_telecode": "HGH",
 521                 "can_web_buy": "Y",
 522                 "note": "",
 523                 "seats": [{
 524                     "seat_price": "73.0",
 525                     "seat_name": "二等座",
 526                     "seat_bookable": 1,
 527                     "seat_yupiao": 165
 528                 }, {
 529                     "seat_price": "117.0",
 530                     "seat_name": "一等座",
 531                     "seat_bookable": 0,
 532                     "seat_yupiao": 0
 533                 }, {
 534                     "seat_price": "219.5",
 535                     "seat_name": "商務座",
 536                     "seat_bookable": 1,
 537                     "seat_yupiao": 3
 538                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 539             }, {
 540                 "train_no": "49000K11840B",
 541                 "train_number": "K1181",
 542                 "from_station": "上海南",
 543                 "to_station": "杭州",
 544                 "from_time": "06:51",
 545                 "to_time": "09:50",
 546                 "from_station_type": "途經",
 547                 "to_station_type": "途經",
 548                 "day_diff": "0",
 549                 "use_time": "179",
 550                 "sale_time": "15:30",
 551                 "control_day": 59,
 552                 "from_telecode": "SNH",
 553                 "to_telecode": "HZH",
 554                 "can_web_buy": "Y",
 555                 "note": "",
 556                 "seats": [{
 557                     "seat_price": "28.5",
 558                     "seat_name": "硬座",
 559                     "seat_bookable": 1,
 560                     "seat_yupiao": 7
 561                 }, {
 562                     "seat_price": "74.5",
 563                     "seat_name": "硬臥上",
 564                     "seat_bookable": 1,
 565                     "seat_yupiao": 15
 566                 }, {
 567                     "seat_price": "77.5",
 568                     "seat_name": "硬臥中",
 569                     "seat_bookable": 1,
 570                     "seat_yupiao": 15
 571                 }, {
 572                     "seat_price": "84.5",
 573                     "seat_name": "硬臥下",
 574                     "seat_bookable": 1,
 575                     "seat_yupiao": 15
 576                 }, {
 577                     "seat_price": "112.5",
 578                     "seat_name": "軟臥上",
 579                     "seat_bookable": 0,
 580                     "seat_yupiao": 0
 581                 }, {
 582                     "seat_price": "127.0",
 583                     "seat_name": "軟臥下",
 584                     "seat_bookable": 0,
 585                     "seat_yupiao": 0
 586                 }, {"seat_price": "28.5", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 75}]
 587             }, {
 588                 "train_no": "5l000G165120",
 589                 "train_number": "G1651",
 590                 "from_station": "上海虹橋",
 591                 "to_station": "杭州東",
 592                 "from_time": "06:56",
 593                 "to_time": "08:00",
 594                 "from_station_type": "起點",
 595                 "to_station_type": "途經",
 596                 "day_diff": "0",
 597                 "use_time": "64",
 598                 "sale_time": "13:30",
 599                 "control_day": 59,
 600                 "from_telecode": "AOH",
 601                 "to_telecode": "HGH",
 602                 "can_web_buy": "Y",
 603                 "note": "",
 604                 "seats": [{
 605                     "seat_price": "73.0",
 606                     "seat_name": "二等座",
 607                     "seat_bookable": 1,
 608                     "seat_yupiao": 190
 609                 }, {
 610                     "seat_price": "117.0",
 611                     "seat_name": "一等座",
 612                     "seat_bookable": 1,
 613                     "seat_yupiao": 5
 614                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 1}]
 615             }, {
 616                 "train_no": "5l0000D37960",
 617                 "train_number": "D379",
 618                 "from_station": "上海虹橋",
 619                 "to_station": "杭州東",
 620                 "from_time": "07:02",
 621                 "to_time": "08:08",
 622                 "from_station_type": "起點",
 623                 "to_station_type": "途經",
 624                 "day_diff": "0",
 625                 "use_time": "66",
 626                 "sale_time": "13:30",
 627                 "control_day": 59,
 628                 "from_telecode": "AOH",
 629                 "to_telecode": "HGH",
 630                 "can_web_buy": "Y",
 631                 "note": "",
 632                 "seats": [{
 633                     "seat_price": "49.0",
 634                     "seat_name": "二等座",
 635                     "seat_bookable": 1,
 636                     "seat_yupiao": 683
 637                 }, {
 638                     "seat_price": "59.0",
 639                     "seat_name": "一等座",
 640                     "seat_bookable": 1,
 641                     "seat_yupiao": 45
 642                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 643             }, {
 644                 "train_no": "5l000G754304",
 645                 "train_number": "G7543",
 646                 "from_station": "上海虹橋",
 647                 "to_station": "杭州東",
 648                 "from_time": "07:07",
 649                 "to_time": "08:04",
 650                 "from_station_type": "起點",
 651                 "to_station_type": "途經",
 652                 "day_diff": "0",
 653                 "use_time": "57",
 654                 "sale_time": "13:30",
 655                 "control_day": 59,
 656                 "from_telecode": "AOH",
 657                 "to_telecode": "HGH",
 658                 "can_web_buy": "Y",
 659                 "note": "",
 660                 "seats": [{
 661                     "seat_price": "73.0",
 662                     "seat_name": "二等座",
 663                     "seat_bookable": 1,
 664                     "seat_yupiao": 128
 665                 }, {
 666                     "seat_price": "117.0",
 667                     "seat_name": "一等座",
 668                     "seat_bookable": 1,
 669                     "seat_yupiao": 54
 670                 }, {
 671                     "seat_price": "219.5",
 672                     "seat_name": "商務座",
 673                     "seat_bookable": 1,
 674                     "seat_yupiao": 20
 675                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 676             }, {
 677                 "train_no": "5l000G236510",
 678                 "train_number": "G2365",
 679                 "from_station": "上海虹橋",
 680                 "to_station": "杭州東",
 681                 "from_time": "07:12",
 682                 "to_time": "08:18",
 683                 "from_station_type": "起點",
 684                 "to_station_type": "途經",
 685                 "day_diff": "0",
 686                 "use_time": "66",
 687                 "sale_time": "13:30",
 688                 "control_day": 59,
 689                 "from_telecode": "AOH",
 690                 "to_telecode": "HGH",
 691                 "can_web_buy": "Y",
 692                 "note": "",
 693                 "seats": [{
 694                     "seat_price": "73.0",
 695                     "seat_name": "二等座",
 696                     "seat_bookable": 1,
 697                     "seat_yupiao": 816
 698                 }, {
 699                     "seat_price": "117.0",
 700                     "seat_name": "一等座",
 701                     "seat_bookable": 1,
 702                     "seat_yupiao": 28
 703                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 15}]
 704             }, {
 705                 "train_no": "5l000G137120",
 706                 "train_number": "G1371",
 707                 "from_station": "上海虹橋",
 708                 "to_station": "杭州東",
 709                 "from_time": "07:22",
 710                 "to_time": "08:23",
 711                 "from_station_type": "起點",
 712                 "to_station_type": "途經",
 713                 "day_diff": "0",
 714                 "use_time": "61",
 715                 "sale_time": "13:30",
 716                 "control_day": 59,
 717                 "from_telecode": "AOH",
 718                 "to_telecode": "HGH",
 719                 "can_web_buy": "Y",
 720                 "note": "",
 721                 "seats": [{
 722                     "seat_price": "73.0",
 723                     "seat_name": "二等座",
 724                     "seat_bookable": 1,
 725                     "seat_yupiao": 210
 726                 }, {
 727                     "seat_price": "117.0",
 728                     "seat_name": "一等座",
 729                     "seat_bookable": 1,
 730                     "seat_yupiao": 16
 731                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 0, "seat_yupiao": 0}]
 732             }, {
 733                 "train_no": "5l000G739541",
 734                 "train_number": "G7395",
 735                 "from_station": "上海虹橋",
 736                 "to_station": "杭州",
 737                 "from_time": "07:27",
 738                 "to_time": "08:32",
 739                 "from_station_type": "起點",
 740                 "to_station_type": "途經",
 741                 "day_diff": "0",
 742                 "use_time": "65",
 743                 "sale_time": "13:30",
 744                 "control_day": 59,
 745                 "from_telecode": "AOH",
 746                 "to_telecode": "HZH",
 747                 "can_web_buy": "Y",
 748                 "note": "",
 749                 "seats": [{
 750                     "seat_price": "77.5",
 751                     "seat_name": "二等座",
 752                     "seat_bookable": 1,
 753                     "seat_yupiao": 435
 754                 }, {
 755                     "seat_price": "123.5",
 756                     "seat_name": "一等座",
 757                     "seat_bookable": 1,
 758                     "seat_yupiao": 22
 759                 }, {
 760                     "seat_price": "233.5",
 761                     "seat_name": "商務座",
 762                     "seat_bookable": 1,
 763                     "seat_yupiao": 10
 764                 }, {"seat_price": "77.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 765             }, {
 766                 "train_no": "550000K83392",
 767                 "train_number": "K833",
 768                 "from_station": "上海南",
 769                 "to_station": "杭州東",
 770                 "from_time": "07:31",
 771                 "to_time": "09:34",
 772                 "from_station_type": "起點",
 773                 "to_station_type": "途經",
 774                 "day_diff": "0",
 775                 "use_time": "123",
 776                 "sale_time": "15:30",
 777                 "control_day": 59,
 778                 "from_telecode": "SNH",
 779                 "to_telecode": "HGH",
 780                 "can_web_buy": "Y",
 781                 "note": "",
 782                 "seats": [{
 783                     "seat_price": "24.5",
 784                     "seat_name": "硬座",
 785                     "seat_bookable": 1,
 786                     "seat_yupiao": 234
 787                 }, {
 788                     "seat_price": "70.5",
 789                     "seat_name": "硬臥上",
 790                     "seat_bookable": 1,
 791                     "seat_yupiao": 17
 792                 }, {
 793                     "seat_price": "73.5",
 794                     "seat_name": "硬臥中",
 795                     "seat_bookable": 1,
 796                     "seat_yupiao": 17
 797                 }, {
 798                     "seat_price": "80.0",
 799                     "seat_name": "硬臥下",
 800                     "seat_bookable": 1,
 801                     "seat_yupiao": 17
 802                 }, {
 803                     "seat_price": "108.5",
 804                     "seat_name": "軟臥上",
 805                     "seat_bookable": 0,
 806                     "seat_yupiao": 0
 807                 }, {
 808                     "seat_price": "122.5",
 809                     "seat_name": "軟臥下",
 810                     "seat_bookable": 0,
 811                     "seat_yupiao": 0
 812                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 813             }, {
 814                 "train_no": "5l000G134140",
 815                 "train_number": "G1341",
 816                 "from_station": "上海虹橋",
 817                 "to_station": "杭州東",
 818                 "from_time": "07:32",
 819                 "to_time": "08:31",
 820                 "from_station_type": "起點",
 821                 "to_station_type": "途經",
 822                 "day_diff": "0",
 823                 "use_time": "59",
 824                 "sale_time": "13:30",
 825                 "control_day": 59,
 826                 "from_telecode": "AOH",
 827                 "to_telecode": "HGH",
 828                 "can_web_buy": "Y",
 829                 "note": "",
 830                 "seats": [{
 831                     "seat_price": "73.0",
 832                     "seat_name": "二等座",
 833                     "seat_bookable": 1,
 834                     "seat_yupiao": 704
 835                 }, {
 836                     "seat_price": "117.0",
 837                     "seat_name": "一等座",
 838                     "seat_bookable": 1,
 839                     "seat_yupiao": 20
 840                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 18}]
 841             }, {
 842                 "train_no": "5l000D313140",
 843                 "train_number": "D3131",
 844                 "from_station": "上海虹橋",
 845                 "to_station": "杭州東",
 846                 "from_time": "07:37",
 847                 "to_time": "08:38",
 848                 "from_station_type": "起點",
 849                 "to_station_type": "途經",
 850                 "day_diff": "0",
 851                 "use_time": "61",
 852                 "sale_time": "13:30",
 853                 "control_day": 59,
 854                 "from_telecode": "AOH",
 855                 "to_telecode": "HGH",
 856                 "can_web_buy": "Y",
 857                 "note": "",
 858                 "seats": [{
 859                     "seat_price": "49.0",
 860                     "seat_name": "二等座",
 861                     "seat_bookable": 1,
 862                     "seat_yupiao": 543
 863                 }, {
 864                     "seat_price": "59.0",
 865                     "seat_name": "一等座",
 866                     "seat_bookable": 1,
 867                     "seat_yupiao": 60
 868                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 84}]
 869             }, {
 870                 "train_no": "5l000D228730",
 871                 "train_number": "D2287",
 872                 "from_station": "上海虹橋",
 873                 "to_station": "杭州東",
 874                 "from_time": "07:47",
 875                 "to_time": "09:07",
 876                 "from_station_type": "起點",
 877                 "to_station_type": "途經",
 878                 "day_diff": "0",
 879                 "use_time": "80",
 880                 "sale_time": "13:30",
 881                 "control_day": 59,
 882                 "from_telecode": "AOH",
 883                 "to_telecode": "HGH",
 884                 "can_web_buy": "Y",
 885                 "note": "",
 886                 "seats": [{
 887                     "seat_price": "49.0",
 888                     "seat_name": "二等座",
 889                     "seat_bookable": 1,
 890                     "seat_yupiao": 114
 891                 }, {
 892                     "seat_price": "59.0",
 893                     "seat_name": "一等座",
 894                     "seat_bookable": 1,
 895                     "seat_yupiao": 12
 896                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 84}]
 897             }, {
 898                 "train_no": "5l000G163120",
 899                 "train_number": "G1631",
 900                 "from_station": "上海虹橋",
 901                 "to_station": "杭州東",
 902                 "from_time": "07:54",
 903                 "to_time": "08:49",
 904                 "from_station_type": "起點",
 905                 "to_station_type": "途經",
 906                 "day_diff": "0",
 907                 "use_time": "55",
 908                 "sale_time": "13:30",
 909                 "control_day": 59,
 910                 "from_telecode": "AOH",
 911                 "to_telecode": "HGH",
 912                 "can_web_buy": "Y",
 913                 "note": "",
 914                 "seats": [{
 915                     "seat_price": "73.0",
 916                     "seat_name": "二等座",
 917                     "seat_bookable": 1,
 918                     "seat_yupiao": 238
 919                 }, {
 920                     "seat_price": "117.0",
 921                     "seat_name": "一等座",
 922                     "seat_bookable": 1,
 923                     "seat_yupiao": 4
 924                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 6}]
 925             }, {
 926                 "train_no": "5l00000G8520",
 927                 "train_number": "G85",
 928                 "from_station": "上海虹橋",
 929                 "to_station": "杭州東",
 930                 "from_time": "08:00",
 931                 "to_time": "08:45",
 932                 "from_station_type": "起點",
 933                 "to_station_type": "途經",
 934                 "day_diff": "0",
 935                 "use_time": "45",
 936                 "sale_time": "13:30",
 937                 "control_day": 59,
 938                 "from_telecode": "AOH",
 939                 "to_telecode": "HGH",
 940                 "can_web_buy": "N",
 941                 "note": "",
 942                 "seats": [{
 943                     "seat_price": "73.0",
 944                     "seat_name": "二等座",
 945                     "seat_bookable": 1,
 946                     "seat_yupiao": 97
 947                 }, {
 948                     "seat_price": "117.0",
 949                     "seat_name": "一等座",
 950                     "seat_bookable": 1,
 951                     "seat_yupiao": 25
 952                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 0, "seat_yupiao": 0}]
 953             }, {
 954                 "train_no": "5l000G750350",
 955                 "train_number": "G7503",
 956                 "from_station": "上海虹橋",
 957                 "to_station": "杭州東",
 958                 "from_time": "08:05",
 959                 "to_time": "08:57",
 960                 "from_station_type": "起點",
 961                 "to_station_type": "途經",
 962                 "day_diff": "0",
 963                 "use_time": "52",
 964                 "sale_time": "13:30",
 965                 "control_day": 59,
 966                 "from_telecode": "AOH",
 967                 "to_telecode": "HGH",
 968                 "can_web_buy": "Y",
 969                 "note": "",
 970                 "seats": [{
 971                     "seat_price": "73.0",
 972                     "seat_name": "二等座",
 973                     "seat_bookable": 1,
 974                     "seat_yupiao": 130
 975                 }, {
 976                     "seat_price": "117.0",
 977                     "seat_name": "一等座",
 978                     "seat_bookable": 1,
 979                     "seat_yupiao": 46
 980                 }, {
 981                     "seat_price": "219.5",
 982                     "seat_name": "商務座",
 983                     "seat_bookable": 1,
 984                     "seat_yupiao": 20
 985                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
 986             }, {
 987                 "train_no": "55000G735700",
 988                 "train_number": "G7357",
 989                 "from_station": "上海",
 990                 "to_station": "杭州",
 991                 "from_time": "08:05",
 992                 "to_time": "09:44",
 993                 "from_station_type": "起點",
 994                 "to_station_type": "終點",
 995                 "day_diff": "0",
 996                 "use_time": "99",
 997                 "sale_time": "14:30",
 998                 "control_day": 59,
 999                 "from_telecode": "SHH",
1000                 "to_telecode": "HZH",
1001                 "can_web_buy": "Y",
1002                 "note": "",
1003                 "seats": [{
1004                     "seat_price": "92.5",
1005                     "seat_name": "二等座",
1006                     "seat_bookable": 1,
1007                     "seat_yupiao": 995
1008                 }, {
1009                     "seat_price": "147.5",
1010                     "seat_name": "一等座",
1011                     "seat_bookable": 1,
1012                     "seat_yupiao": 48
1013                 }, {
1014                     "seat_price": "278.5",
1015                     "seat_name": "商務座",
1016                     "seat_bookable": 1,
1017                     "seat_yupiao": 20
1018                 }, {"seat_price": "92.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1019             }, {
1020                 "train_no": "5l000G754920",
1021                 "train_number": "G7549",
1022                 "from_station": "上海虹橋",
1023                 "to_station": "杭州東",
1024                 "from_time": "08:10",
1025                 "to_time": "09:12",
1026                 "from_station_type": "起點",
1027                 "to_station_type": "途經",
1028                 "day_diff": "0",
1029                 "use_time": "62",
1030                 "sale_time": "13:30",
1031                 "control_day": 59,
1032                 "from_telecode": "AOH",
1033                 "to_telecode": "HGH",
1034                 "can_web_buy": "Y",
1035                 "note": "",
1036                 "seats": [{
1037                     "seat_price": "73.0",
1038                     "seat_name": "二等座",
1039                     "seat_bookable": 1,
1040                     "seat_yupiao": 128
1041                 }, {
1042                     "seat_price": "117.0",
1043                     "seat_name": "一等座",
1044                     "seat_bookable": 1,
1045                     "seat_yupiao": 50
1046                 }, {
1047                     "seat_price": "219.5",
1048                     "seat_name": "商務座",
1049                     "seat_bookable": 1,
1050                     "seat_yupiao": 20
1051                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1052             }, {
1053                 "train_no": "5l000G165330",
1054                 "train_number": "G1653",
1055                 "from_station": "上海虹橋",
1056                 "to_station": "杭州東",
1057                 "from_time": "08:15",
1058                 "to_time": "09:01",
1059                 "from_station_type": "起點",
1060                 "to_station_type": "途經",
1061                 "day_diff": "0",
1062                 "use_time": "46",
1063                 "sale_time": "13:30",
1064                 "control_day": 59,
1065                 "from_telecode": "AOH",
1066                 "to_telecode": "HGH",
1067                 "can_web_buy": "Y",
1068                 "note": "",
1069                 "seats": [{
1070                     "seat_price": "73.0",
1071                     "seat_name": "二等座",
1072                     "seat_bookable": 1,
1073                     "seat_yupiao": 752
1074                 }, {
1075                     "seat_price": "117.0",
1076                     "seat_name": "一等座",
1077                     "seat_bookable": 1,
1078                     "seat_yupiao": 29
1079                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 15}]
1080             }, {
1081                 "train_no": "5l000D320190",
1082                 "train_number": "D3201",
1083                 "from_station": "上海虹橋",
1084                 "to_station": "杭州東",
1085                 "from_time": "08:20",
1086                 "to_time": "09:28",
1087                 "from_station_type": "起點",
1088                 "to_station_type": "途經",
1089                 "day_diff": "0",
1090                 "use_time": "68",
1091                 "sale_time": "13:30",
1092                 "control_day": 59,
1093                 "from_telecode": "AOH",
1094                 "to_telecode": "HGH",
1095                 "can_web_buy": "Y",
1096                 "note": "",
1097                 "seats": [{
1098                     "seat_price": "49.0",
1099                     "seat_name": "二等座",
1100                     "seat_bookable": 1,
1101                     "seat_yupiao": 73
1102                 }, {
1103                     "seat_price": "59.0",
1104                     "seat_name": "一等座",
1105                     "seat_bookable": 1,
1106                     "seat_yupiao": 19
1107                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 168}]
1108             }, {
1109                 "train_no": "5l000G132320",
1110                 "train_number": "G1323",
1111                 "from_station": "上海虹橋",
1112                 "to_station": "杭州東",
1113                 "from_time": "08:25",
1114                 "to_time": "09:24",
1115                 "from_station_type": "起點",
1116                 "to_station_type": "途經",
1117                 "day_diff": "0",
1118                 "use_time": "59",
1119                 "sale_time": "13:30",
1120                 "control_day": 59,
1121                 "from_telecode": "AOH",
1122                 "to_telecode": "HGH",
1123                 "can_web_buy": "Y",
1124                 "note": "",
1125                 "seats": [{
1126                     "seat_price": "73.0",
1127                     "seat_name": "二等座",
1128                     "seat_bookable": 1,
1129                     "seat_yupiao": 272
1130                 }, {
1131                     "seat_price": "117.0",
1132                     "seat_name": "一等座",
1133                     "seat_bookable": 1,
1134                     "seat_yupiao": 12
1135                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 9}]
1136             }, {
1137                 "train_no": "5l000G150930",
1138                 "train_number": "G1509",
1139                 "from_station": "上海虹橋",
1140                 "to_station": "杭州東",
1141                 "from_time": "08:31",
1142                 "to_time": "09:46",
1143                 "from_station_type": "起點",
1144                 "to_station_type": "途經",
1145                 "day_diff": "0",
1146                 "use_time": "75",
1147                 "sale_time": "13:30",
1148                 "control_day": 59,
1149                 "from_telecode": "AOH",
1150                 "to_telecode": "HGH",
1151                 "can_web_buy": "Y",
1152                 "note": "",
1153                 "seats": [{
1154                     "seat_price": "73.0",
1155                     "seat_name": "二等座",
1156                     "seat_bookable": 1,
1157                     "seat_yupiao": 80
1158                 }, {
1159                     "seat_price": "117.0",
1160                     "seat_name": "一等座",
1161                     "seat_bookable": 1,
1162                     "seat_yupiao": 56
1163                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 24}]
1164             }, {
1165                 "train_no": "550000K14906",
1166                 "train_number": "K149",
1167                 "from_station": "上海南",
1168                 "to_station": "杭州東",
1169                 "from_time": "08:42",
1170                 "to_time": "10:38",
1171                 "from_station_type": "起點",
1172                 "to_station_type": "途經",
1173                 "day_diff": "0",
1174                 "use_time": "116",
1175                 "sale_time": "15:30",
1176                 "control_day": 59,
1177                 "from_telecode": "SNH",
1178                 "to_telecode": "HGH",
1179                 "can_web_buy": "Y",
1180                 "note": "",
1181                 "seats": [{
1182                     "seat_price": "24.5",
1183                     "seat_name": "硬座",
1184                     "seat_bookable": 1,
1185                     "seat_yupiao": 66
1186                 }, {
1187                     "seat_price": "70.5",
1188                     "seat_name": "硬臥上",
1189                     "seat_bookable": 1,
1190                     "seat_yupiao": 38
1191                 }, {
1192                     "seat_price": "73.5",
1193                     "seat_name": "硬臥中",
1194                     "seat_bookable": 1,
1195                     "seat_yupiao": 38
1196                 }, {
1197                     "seat_price": "80.0",
1198                     "seat_name": "硬臥下",
1199                     "seat_bookable": 1,
1200                     "seat_yupiao": 38
1201                 }, {
1202                     "seat_price": "108.5",
1203                     "seat_name": "軟臥上",
1204                     "seat_bookable": 0,
1205                     "seat_yupiao": 0
1206                 }, {
1207                     "seat_price": "122.5",
1208                     "seat_name": "軟臥下",
1209                     "seat_bookable": 0,
1210                     "seat_yupiao": 0
1211                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1212             }, {
1213                 "train_no": "55000K118532",
1214                 "train_number": "K1185",
1215                 "from_station": "上海南",
1216                 "to_station": "杭州東",
1217                 "from_time": "08:48",
1218                 "to_time": "11:01",
1219                 "from_station_type": "起點",
1220                 "to_station_type": "途經",
1221                 "day_diff": "0",
1222                 "use_time": "133",
1223                 "sale_time": "15:30",
1224                 "control_day": 59,
1225                 "from_telecode": "SNH",
1226                 "to_telecode": "HGH",
1227                 "can_web_buy": "Y",
1228                 "note": "",
1229                 "seats": [{
1230                     "seat_price": "24.5",
1231                     "seat_name": "硬座",
1232                     "seat_bookable": 1,
1233                     "seat_yupiao": 234
1234                 }, {
1235                     "seat_price": "70.5",
1236                     "seat_name": "硬臥上",
1237                     "seat_bookable": 0,
1238                     "seat_yupiao": 0
1239                 }, {
1240                     "seat_price": "73.5",
1241                     "seat_name": "硬臥中",
1242                     "seat_bookable": 0,
1243                     "seat_yupiao": 0
1244                 }, {
1245                     "seat_price": "80.0",
1246                     "seat_name": "硬臥下",
1247                     "seat_bookable": 0,
1248                     "seat_yupiao": 0
1249                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1250             }, {
1251                 "train_no": "54000D312510",
1252                 "train_number": "D3125",
1253                 "from_station": "上海虹橋",
1254                 "to_station": "杭州東",
1255                 "from_time": "08:49",
1256                 "to_time": "10:09",
1257                 "from_station_type": "途經",
1258                 "to_station_type": "途經",
1259                 "day_diff": "0",
1260                 "use_time": "80",
1261                 "sale_time": "13:30",
1262                 "control_day": 59,
1263                 "from_telecode": "AOH",
1264                 "to_telecode": "HGH",
1265                 "can_web_buy": "Y",
1266                 "note": "",
1267                 "seats": [{
1268                     "seat_price": "49.0",
1269                     "seat_name": "二等座",
1270                     "seat_bookable": 1,
1271                     "seat_yupiao": 355
1272                 }, {
1273                     "seat_price": "59.0",
1274                     "seat_name": "一等座",
1275                     "seat_bookable": 1,
1276                     "seat_yupiao": 55
1277                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1278             }, {
1279                 "train_no": "5l000G134340",
1280                 "train_number": "G1343",
1281                 "from_station": "上海虹橋",
1282                 "to_station": "杭州東",
1283                 "from_time": "08:55",
1284                 "to_time": "09:42",
1285                 "from_station_type": "起點",
1286                 "to_station_type": "途經",
1287                 "day_diff": "0",
1288                 "use_time": "47",
1289                 "sale_time": "13:30",
1290                 "control_day": 59,
1291                 "from_telecode": "AOH",
1292                 "to_telecode": "HGH",
1293                 "can_web_buy": "N",
1294                 "note": "",
1295                 "seats": [{
1296                     "seat_price": "73.0",
1297                     "seat_name": "二等座",
1298                     "seat_bookable": 1,
1299                     "seat_yupiao": 139
1300                 }, {
1301                     "seat_price": "117.0",
1302                     "seat_name": "一等座",
1303                     "seat_bookable": 1,
1304                     "seat_yupiao": 13
1305                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 2}]
1306             }, {
1307                 "train_no": "5l000G750550",
1308                 "train_number": "G7505",
1309                 "from_station": "上海虹橋",
1310                 "to_station": "杭州東",
1311                 "from_time": "09:00",
1312                 "to_time": "09:54",
1313                 "from_station_type": "途經",
1314                 "to_station_type": "途經",
1315                 "day_diff": "0",
1316                 "use_time": "54",
1317                 "sale_time": "13:30",
1318                 "control_day": 59,
1319                 "from_telecode": "AOH",
1320                 "to_telecode": "HGH",
1321                 "can_web_buy": "Y",
1322                 "note": "",
1323                 "seats": [{
1324                     "seat_price": "73.0",
1325                     "seat_name": "二等座",
1326                     "seat_bookable": 1,
1327                     "seat_yupiao": 190
1328                 }, {
1329                     "seat_price": "117.0",
1330                     "seat_name": "一等座",
1331                     "seat_bookable": 1,
1332                     "seat_yupiao": 113
1333                 }, {
1334                     "seat_price": "219.5",
1335                     "seat_name": "商務座",
1336                     "seat_bookable": 1,
1337                     "seat_yupiao": 13
1338                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1339             }, {
1340                 "train_no": "5l000D228520",
1341                 "train_number": "D2285",
1342                 "from_station": "上海虹橋",
1343                 "to_station": "杭州東",
1344                 "from_time": "09:05",
1345                 "to_time": "10:18",
1346                 "from_station_type": "起點",
1347                 "to_station_type": "途經",
1348                 "day_diff": "0",
1349                 "use_time": "73",
1350                 "sale_time": "13:30",
1351                 "control_day": 59,
1352                 "from_telecode": "AOH",
1353                 "to_telecode": "HGH",
1354                 "can_web_buy": "N",
1355                 "note": "",
1356                 "seats": [{
1357                     "seat_price": "49.0",
1358                     "seat_name": "二等座",
1359                     "seat_bookable": 1,
1360                     "seat_yupiao": 3
1361                 }, {
1362                     "seat_price": "59.0",
1363                     "seat_name": "一等座",
1364                     "seat_bookable": 1,
1365                     "seat_yupiao": 10
1366                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1367             }, {
1368                 "train_no": "5l000G734952",
1369                 "train_number": "G7349",
1370                 "from_station": "上海虹橋",
1371                 "to_station": "杭州東",
1372                 "from_time": "09:10",
1373                 "to_time": "10:04",
1374                 "from_station_type": "途經",
1375                 "to_station_type": "途經",
1376                 "day_diff": "0",
1377                 "use_time": "54",
1378                 "sale_time": "13:30",
1379                 "control_day": 59,
1380                 "from_telecode": "AOH",
1381                 "to_telecode": "HGH",
1382                 "can_web_buy": "Y",
1383                 "note": "",
1384                 "seats": [{
1385                     "seat_price": "73.0",
1386                     "seat_name": "二等座",
1387                     "seat_bookable": 1,
1388                     "seat_yupiao": 281
1389                 }, {
1390                     "seat_price": "117.0",
1391                     "seat_name": "一等座",
1392                     "seat_bookable": 1,
1393                     "seat_yupiao": 21
1394                 }, {
1395                     "seat_price": "219.5",
1396                     "seat_name": "商務座",
1397                     "seat_bookable": 1,
1398                     "seat_yupiao": 7
1399                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1400             }, {
1401                 "train_no": "54000D5589A2",
1402                 "train_number": "D5589",
1403                 "from_station": "上海虹橋",
1404                 "to_station": "杭州東",
1405                 "from_time": "09:16",
1406                 "to_time": "10:32",
1407                 "from_station_type": "途經",
1408                 "to_station_type": "途經",
1409                 "day_diff": "0",
1410                 "use_time": "76",
1411                 "sale_time": "13:30",
1412                 "control_day": 59,
1413                 "from_telecode": "AOH",
1414                 "to_telecode": "HGH",
1415                 "can_web_buy": "Y",
1416                 "note": "",
1417                 "seats": [{
1418                     "seat_price": "49.0",
1419                     "seat_name": "二等座",
1420                     "seat_bookable": 1,
1421                     "seat_yupiao": 503
1422                 }, {
1423                     "seat_price": "59.0",
1424                     "seat_name": "一等座",
1425                     "seat_bookable": 1,
1426                     "seat_yupiao": 43
1427                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 112}]
1428             }, {
1429                 "train_no": "5l000G165510",
1430                 "train_number": "G1655",
1431                 "from_station": "上海虹橋",
1432                 "to_station": "杭州東",
1433                 "from_time": "09:23",
1434                 "to_time": "10:23",
1435                 "from_station_type": "起點",
1436                 "to_station_type": "途經",
1437                 "day_diff": "0",
1438                 "use_time": "60",
1439                 "sale_time": "13:30",
1440                 "control_day": 59,
1441                 "from_telecode": "AOH",
1442                 "to_telecode": "HGH",
1443                 "can_web_buy": "Y",
1444                 "note": "",
1445                 "seats": [{
1446                     "seat_price": "73.0",
1447                     "seat_name": "二等座",
1448                     "seat_bookable": 1,
1449                     "seat_yupiao": 208
1450                 }, {
1451                     "seat_price": "117.0",
1452                     "seat_name": "一等座",
1453                     "seat_bookable": 1,
1454                     "seat_yupiao": 78
1455                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 20}]
1456             }, {
1457                 "train_no": "5l000G132530",
1458                 "train_number": "G1325",
1459                 "from_station": "上海虹橋",
1460                 "to_station": "杭州東",
1461                 "from_time": "09:28",
1462                 "to_time": "10:27",
1463                 "from_station_type": "途經",
1464                 "to_station_type": "途經",
1465                 "day_diff": "0",
1466                 "use_time": "59",
1467                 "sale_time": "13:30",
1468                 "control_day": 59,
1469                 "from_telecode": "AOH",
1470                 "to_telecode": "HGH",
1471                 "can_web_buy": "N",
1472                 "note": "",
1473                 "seats": [{
1474                     "seat_price": "73.0",
1475                     "seat_name": "二等座",
1476                     "seat_bookable": 1,
1477                     "seat_yupiao": 2
1478                 }, {
1479                     "seat_price": "117.0",
1480                     "seat_name": "一等座",
1481                     "seat_bookable": 0,
1482                     "seat_yupiao": 0
1483                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 2}]
1484             }, {
1485                 "train_no": "5l000D3205A0",
1486                 "train_number": "D3205",
1487                 "from_station": "上海虹橋",
1488                 "to_station": "杭州東",
1489                 "from_time": "09:35",
1490                 "to_time": "10:36",
1491                 "from_station_type": "起點",
1492                 "to_station_type": "途經",
1493                 "day_diff": "0",
1494                 "use_time": "61",
1495                 "sale_time": "13:30",
1496                 "control_day": 59,
1497                 "from_telecode": "AOH",
1498                 "to_telecode": "HGH",
1499                 "can_web_buy": "Y",
1500                 "note": "",
1501                 "seats": [{
1502                     "seat_price": "49.0",
1503                     "seat_name": "二等座",
1504                     "seat_bookable": 1,
1505                     "seat_yupiao": 154
1506                 }, {
1507                     "seat_price": "59.0",
1508                     "seat_name": "一等座",
1509                     "seat_bookable": 1,
1510                     "seat_yupiao": 1
1511                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1512             }, {
1513                 "train_no": "55000G735102",
1514                 "train_number": "G7351",
1515                 "from_station": "上海",
1516                 "to_station": "杭州",
1517                 "from_time": "09:38",
1518                 "to_time": "11:07",
1519                 "from_station_type": "起點",
1520                 "to_station_type": "終點",
1521                 "day_diff": "0",
1522                 "use_time": "89",
1523                 "sale_time": "14:30",
1524                 "control_day": 59,
1525                 "from_telecode": "SHH",
1526                 "to_telecode": "HZH",
1527                 "can_web_buy": "Y",
1528                 "note": "",
1529                 "seats": [{
1530                     "seat_price": "92.5",
1531                     "seat_name": "二等座",
1532                     "seat_bookable": 1,
1533                     "seat_yupiao": 988
1534                 }, {
1535                     "seat_price": "147.5",
1536                     "seat_name": "一等座",
1537                     "seat_bookable": 1,
1538                     "seat_yupiao": 53
1539                 }, {
1540                     "seat_price": "278.5",
1541                     "seat_name": "商務座",
1542                     "seat_bookable": 1,
1543                     "seat_yupiao": 20
1544                 }, {"seat_price": "92.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1545             }, {
1546                 "train_no": "5l000D3107A0",
1547                 "train_number": "D3107",
1548                 "from_station": "上海虹橋",
1549                 "to_station": "杭州東",
1550                 "from_time": "09:40",
1551                 "to_time": "11:22",
1552                 "from_station_type": "起點",
1553                 "to_station_type": "途經",
1554                 "day_diff": "0",
1555                 "use_time": "102",
1556                 "sale_time": "13:30",
1557                 "control_day": 59,
1558                 "from_telecode": "AOH",
1559                 "to_telecode": "HGH",
1560                 "can_web_buy": "Y",
1561                 "note": "",
1562                 "seats": [{
1563                     "seat_price": "49.0",
1564                     "seat_name": "二等座",
1565                     "seat_bookable": 1,
1566                     "seat_yupiao": 65
1567                 }, {
1568                     "seat_price": "59.0",
1569                     "seat_name": "一等座",
1570                     "seat_bookable": 1,
1571                     "seat_yupiao": 12
1572                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1573             }, {
1574                 "train_no": "54000G735520",
1575                 "train_number": "G7355",
1576                 "from_station": "上海虹橋",
1577                 "to_station": "杭州東",
1578                 "from_time": "09:46",
1579                 "to_time": "10:40",
1580                 "from_station_type": "途經",
1581                 "to_station_type": "途經",
1582                 "day_diff": "0",
1583                 "use_time": "54",
1584                 "sale_time": "13:30",
1585                 "control_day": 59,
1586                 "from_telecode": "AOH",
1587                 "to_telecode": "HGH",
1588                 "can_web_buy": "Y",
1589                 "note": "",
1590                 "seats": [{
1591                     "seat_price": "73.0",
1592                     "seat_name": "二等座",
1593                     "seat_bookable": 1,
1594                     "seat_yupiao": 222
1595                 }, {
1596                     "seat_price": "117.0",
1597                     "seat_name": "一等座",
1598                     "seat_bookable": 0,
1599                     "seat_yupiao": 0
1600                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1601             }, {
1602                 "train_no": "5l000G134740",
1603                 "train_number": "G1347",
1604                 "from_station": "上海虹橋",
1605                 "to_station": "杭州東",
1606                 "from_time": "09:51",
1607                 "to_time": "10:50",
1608                 "from_station_type": "起點",
1609                 "to_station_type": "途經",
1610                 "day_diff": "0",
1611                 "use_time": "59",
1612                 "sale_time": "13:30",
1613                 "control_day": 59,
1614                 "from_telecode": "AOH",
1615                 "to_telecode": "HGH",
1616                 "can_web_buy": "Y",
1617                 "note": "",
1618                 "seats": [{
1619                     "seat_price": "73.0",
1620                     "seat_name": "二等座",
1621                     "seat_bookable": 1,
1622                     "seat_yupiao": 547
1623                 }, {
1624                     "seat_price": "117.0",
1625                     "seat_name": "一等座",
1626                     "seat_bookable": 1,
1627                     "seat_yupiao": 20
1628                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 0, "seat_yupiao": 0}]
1629             }, {
1630                 "train_no": "5l000G758730",
1631                 "train_number": "G7587",
1632                 "from_station": "上海虹橋",
1633                 "to_station": "杭州東",
1634                 "from_time": "09:58",
1635                 "to_time": "10:54",
1636                 "from_station_type": "途經",
1637                 "to_station_type": "途經",
1638                 "day_diff": "0",
1639                 "use_time": "56",
1640                 "sale_time": "13:30",
1641                 "control_day": 59,
1642                 "from_telecode": "AOH",
1643                 "to_telecode": "HGH",
1644                 "can_web_buy": "Y",
1645                 "note": "",
1646                 "seats": [{
1647                     "seat_price": "73.0",
1648                     "seat_name": "二等座",
1649                     "seat_bookable": 0,
1650                     "seat_yupiao": 0
1651                 }, {
1652                     "seat_price": "117.0",
1653                     "seat_name": "一等座",
1654                     "seat_bookable": 1,
1655                     "seat_yupiao": 3
1656                 }, {
1657                     "seat_price": "219.5",
1658                     "seat_name": "商務座",
1659                     "seat_bookable": 1,
1660                     "seat_yupiao": 5
1661                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1662             }, {
1663                 "train_no": "5l000G150120",
1664                 "train_number": "G1501",
1665                 "from_station": "上海虹橋",
1666                 "to_station": "杭州東",
1667                 "from_time": "10:03",
1668                 "to_time": "10:58",
1669                 "from_station_type": "起點",
1670                 "to_station_type": "途經",
1671                 "day_diff": "0",
1672                 "use_time": "55",
1673                 "sale_time": "13:30",
1674                 "control_day": 59,
1675                 "from_telecode": "AOH",
1676                 "to_telecode": "HGH",
1677                 "can_web_buy": "Y",
1678                 "note": "",
1679                 "seats": [{
1680                     "seat_price": "73.0",
1681                     "seat_name": "二等座",
1682                     "seat_bookable": 1,
1683                     "seat_yupiao": 394
1684                 }, {
1685                     "seat_price": "117.0",
1686                     "seat_name": "一等座",
1687                     "seat_bookable": 1,
1688                     "seat_yupiao": 20
1689                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 14}]
1690             }, {
1691                 "train_no": "5l000G750731",
1692                 "train_number": "G7507",
1693                 "from_station": "上海虹橋",
1694                 "to_station": "杭州東",
1695                 "from_time": "10:13",
1696                 "to_time": "11:06",
1697                 "from_station_type": "起點",
1698                 "to_station_type": "途經",
1699                 "day_diff": "0",
1700                 "use_time": "53",
1701                 "sale_time": "13:30",
1702                 "control_day": 59,
1703                 "from_telecode": "AOH",
1704                 "to_telecode": "HGH",
1705                 "can_web_buy": "Y",
1706                 "note": "",
1707                 "seats": [{
1708                     "seat_price": "73.0",
1709                     "seat_name": "二等座",
1710                     "seat_bookable": 1,
1711                     "seat_yupiao": 111
1712                 }, {
1713                     "seat_price": "117.0",
1714                     "seat_name": "一等座",
1715                     "seat_bookable": 1,
1716                     "seat_yupiao": 51
1717                 }, {
1718                     "seat_price": "219.5",
1719                     "seat_name": "商務座",
1720                     "seat_bookable": 1,
1721                     "seat_yupiao": 20
1722                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1723             }, {
1724                 "train_no": "5l000G165720",
1725                 "train_number": "G1657",
1726                 "from_station": "上海虹橋",
1727                 "to_station": "杭州東",
1728                 "from_time": "10:18",
1729                 "to_time": "11:18",
1730                 "from_station_type": "起點",
1731                 "to_station_type": "途經",
1732                 "day_diff": "0",
1733                 "use_time": "60",
1734                 "sale_time": "13:30",
1735                 "control_day": 59,
1736                 "from_telecode": "AOH",
1737                 "to_telecode": "HGH",
1738                 "can_web_buy": "Y",
1739                 "note": "",
1740                 "seats": [{
1741                     "seat_price": "73.0",
1742                     "seat_name": "二等座",
1743                     "seat_bookable": 1,
1744                     "seat_yupiao": 63
1745                 }, {
1746                     "seat_price": "117.0",
1747                     "seat_name": "一等座",
1748                     "seat_bookable": 0,
1749                     "seat_yupiao": 0
1750                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 1}]
1751             }, {
1752                 "train_no": "330000Z28404",
1753                 "train_number": "Z281",
1754                 "from_station": "上海南",
1755                 "to_station": "杭州",
1756                 "from_time": "10:20",
1757                 "to_time": "12:23",
1758                 "from_station_type": "途經",
1759                 "to_station_type": "終點",
1760                 "day_diff": "0",
1761                 "use_time": "123",
1762                 "sale_time": "15:30",
1763                 "control_day": 59,
1764                 "from_telecode": "SNH",
1765                 "to_telecode": "HZH",
1766                 "can_web_buy": "Y",
1767                 "note": "",
1768                 "seats": [{
1769                     "seat_price": "28.5",
1770                     "seat_name": "硬座",
1771                     "seat_bookable": 1,
1772                     "seat_yupiao": 86
1773                 }, {
1774                     "seat_price": "74.5",
1775                     "seat_name": "硬臥上",
1776                     "seat_bookable": 1,
1777                     "seat_yupiao": 259
1778                 }, {
1779                     "seat_price": "77.5",
1780                     "seat_name": "硬臥中",
1781                     "seat_bookable": 1,
1782                     "seat_yupiao": 259
1783                 }, {
1784                     "seat_price": "84.5",
1785                     "seat_name": "硬臥下",
1786                     "seat_bookable": 1,
1787                     "seat_yupiao": 259
1788                 }, {
1789                     "seat_price": "112.5",
1790                     "seat_name": "軟臥上",
1791                     "seat_bookable": 1,
1792                     "seat_yupiao": 7
1793                 }, {
1794                     "seat_price": "127.0",
1795                     "seat_name": "軟臥下",
1796                     "seat_bookable": 1,
1797                     "seat_yupiao": 7
1798                 }, {"seat_price": "28.5", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 94}]
1799             }, {
1800                 "train_no": "5l000G130140",
1801                 "train_number": "G1301",
1802                 "from_station": "上海虹橋",
1803                 "to_station": "杭州東",
1804                 "from_time": "10:23",
1805                 "to_time": "11:26",
1806                 "from_station_type": "起點",
1807                 "to_station_type": "途經",
1808                 "day_diff": "0",
1809                 "use_time": "63",
1810                 "sale_time": "13:30",
1811                 "control_day": 59,
1812                 "from_telecode": "AOH",
1813                 "to_telecode": "HGH",
1814                 "can_web_buy": "Y",
1815                 "note": "",
1816                 "seats": [{
1817                     "seat_price": "73.0",
1818                     "seat_name": "二等座",
1819                     "seat_bookable": 1,
1820                     "seat_yupiao": 64
1821                 }, {
1822                     "seat_price": "117.0",
1823                     "seat_name": "一等座",
1824                     "seat_bookable": 0,
1825                     "seat_yupiao": 0
1826                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 0, "seat_yupiao": 0}]
1827             }, {
1828                 "train_no": "54000D228130",
1829                 "train_number": "D2281",
1830                 "from_station": "上海虹橋",
1831                 "to_station": "杭州東",
1832                 "from_time": "10:28",
1833                 "to_time": "11:31",
1834                 "from_station_type": "途經",
1835                 "to_station_type": "途經",
1836                 "day_diff": "0",
1837                 "use_time": "63",
1838                 "sale_time": "13:30",
1839                 "control_day": 59,
1840                 "from_telecode": "AOH",
1841                 "to_telecode": "HGH",
1842                 "can_web_buy": "Y",
1843                 "note": "",
1844                 "seats": [{
1845                     "seat_price": "49.0",
1846                     "seat_name": "二等座",
1847                     "seat_bookable": 1,
1848                     "seat_yupiao": 533
1849                 }, {
1850                     "seat_price": "59.0",
1851                     "seat_name": "一等座",
1852                     "seat_bookable": 1,
1853                     "seat_yupiao": 76
1854                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1855             }, {
1856                 "train_no": "5l000G758942",
1857                 "train_number": "G7589",
1858                 "from_station": "上海虹橋",
1859                 "to_station": "杭州東",
1860                 "from_time": "10:34",
1861                 "to_time": "11:41",
1862                 "from_station_type": "途經",
1863                 "to_station_type": "途經",
1864                 "day_diff": "0",
1865                 "use_time": "67",
1866                 "sale_time": "13:30",
1867                 "control_day": 59,
1868                 "from_telecode": "AOH",
1869                 "to_telecode": "HGH",
1870                 "can_web_buy": "Y",
1871                 "note": "",
1872                 "seats": [{
1873                     "seat_price": "73.0",
1874                     "seat_name": "二等座",
1875                     "seat_bookable": 1,
1876                     "seat_yupiao": 62
1877                 }, {
1878                     "seat_price": "117.0",
1879                     "seat_name": "一等座",
1880                     "seat_bookable": 1,
1881                     "seat_yupiao": 50
1882                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1883             }, {
1884                 "train_no": "54000D313550",
1885                 "train_number": "D3135",
1886                 "from_station": "上海虹橋",
1887                 "to_station": "杭州東",
1888                 "from_time": "10:42",
1889                 "to_time": "12:04",
1890                 "from_station_type": "途經",
1891                 "to_station_type": "途經",
1892                 "day_diff": "0",
1893                 "use_time": "82",
1894                 "sale_time": "13:30",
1895                 "control_day": 59,
1896                 "from_telecode": "AOH",
1897                 "to_telecode": "HGH",
1898                 "can_web_buy": "Y",
1899                 "note": "",
1900                 "seats": [{
1901                     "seat_price": "49.0",
1902                     "seat_name": "二等座",
1903                     "seat_bookable": 1,
1904                     "seat_yupiao": 2
1905                 }, {
1906                     "seat_price": "59.0",
1907                     "seat_name": "一等座",
1908                     "seat_bookable": 1,
1909                     "seat_yupiao": 28
1910                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1911             }, {
1912                 "train_no": "550000K751A3",
1913                 "train_number": "K751",
1914                 "from_station": "上海南",
1915                 "to_station": "杭州東",
1916                 "from_time": "10:42",
1917                 "to_time": "13:26",
1918                 "from_station_type": "起點",
1919                 "to_station_type": "途經",
1920                 "day_diff": "0",
1921                 "use_time": "164",
1922                 "sale_time": "15:30",
1923                 "control_day": 59,
1924                 "from_telecode": "SNH",
1925                 "to_telecode": "HGH",
1926                 "can_web_buy": "Y",
1927                 "note": "",
1928                 "seats": [{
1929                     "seat_price": "24.5",
1930                     "seat_name": "硬座",
1931                     "seat_bookable": 1,
1932                     "seat_yupiao": 17
1933                 }, {
1934                     "seat_price": "70.5",
1935                     "seat_name": "硬臥上",
1936                     "seat_bookable": 0,
1937                     "seat_yupiao": 0
1938                 }, {
1939                     "seat_price": "73.5",
1940                     "seat_name": "硬臥中",
1941                     "seat_bookable": 0,
1942                     "seat_yupiao": 0
1943                 }, {
1944                     "seat_price": "80.0",
1945                     "seat_name": "硬臥下",
1946                     "seat_bookable": 0,
1947                     "seat_yupiao": 0
1948                 }, {
1949                     "seat_price": "108.5",
1950                     "seat_name": "軟臥上",
1951                     "seat_bookable": 0,
1952                     "seat_yupiao": 0
1953                 }, {
1954                     "seat_price": "122.5",
1955                     "seat_name": "軟臥下",
1956                     "seat_bookable": 0,
1957                     "seat_yupiao": 0
1958                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
1959             }, {
1960                 "train_no": "5l000G134920",
1961                 "train_number": "G1349",
1962                 "from_station": "上海虹橋",
1963                 "to_station": "杭州東",
1964                 "from_time": "10:48",
1965                 "to_time": "11:48",
1966                 "from_station_type": "起點",
1967                 "to_station_type": "途經",
1968                 "day_diff": "0",
1969                 "use_time": "60",
1970                 "sale_time": "13:30",
1971                 "control_day": 59,
1972                 "from_telecode": "AOH",
1973                 "to_telecode": "HGH",
1974                 "can_web_buy": "Y",
1975                 "note": "",
1976                 "seats": [{
1977                     "seat_price": "73.0",
1978                     "seat_name": "二等座",
1979                     "seat_bookable": 1,
1980                     "seat_yupiao": 668
1981                 }, {
1982                     "seat_price": "117.0",
1983                     "seat_name": "一等座",
1984                     "seat_bookable": 1,
1985                     "seat_yupiao": 24
1986                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 17}]
1987             }, {
1988                 "train_no": "550000T16920",
1989                 "train_number": "T169",
1990                 "from_station": "上海南",
1991                 "to_station": "杭州東",
1992                 "from_time": "10:50",
1993                 "to_time": "12:40",
1994                 "from_station_type": "起點",
1995                 "to_station_type": "途經",
1996                 "day_diff": "0",
1997                 "use_time": "110",
1998                 "sale_time": "15:30",
1999                 "control_day": 59,
2000                 "from_telecode": "SNH",
2001                 "to_telecode": "HGH",
2002                 "can_web_buy": "Y",
2003                 "note": "",
2004                 "seats": [{
2005                     "seat_price": "24.5",
2006                     "seat_name": "硬座",
2007                     "seat_bookable": 1,
2008                     "seat_yupiao": 355
2009                 }, {
2010                     "seat_price": "70.5",
2011                     "seat_name": "硬臥上",
2012                     "seat_bookable": 1,
2013                     "seat_yupiao": 337
2014                 }, {
2015                     "seat_price": "73.5",
2016                     "seat_name": "硬臥中",
2017                     "seat_bookable": 1,
2018                     "seat_yupiao": 337
2019                 }, {
2020                     "seat_price": "80.0",
2021                     "seat_name": "硬臥下",
2022                     "seat_bookable": 1,
2023                     "seat_yupiao": 337
2024                 }, {
2025                     "seat_price": "108.5",
2026                     "seat_name": "軟臥上",
2027                     "seat_bookable": 1,
2028                     "seat_yupiao": 24
2029                 }, {
2030                     "seat_price": "122.5",
2031                     "seat_name": "軟臥下",
2032                     "seat_bookable": 1,
2033                     "seat_yupiao": 24
2034                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 124}]
2035             }, {
2036                 "train_no": "55000K120961",
2037                 "train_number": "K1209",
2038                 "from_station": "上海南",
2039                 "to_station": "杭州",
2040                 "from_time": "10:59",
2041                 "to_time": "12:55",
2042                 "from_station_type": "起點",
2043                 "to_station_type": "途經",
2044                 "day_diff": "0",
2045                 "use_time": "116",
2046                 "sale_time": "15:30",
2047                 "control_day": 59,
2048                 "from_telecode": "SNH",
2049                 "to_telecode": "HZH",
2050                 "can_web_buy": "Y",
2051                 "note": "",
2052                 "seats": [{
2053                     "seat_price": "28.5",
2054                     "seat_name": "硬座",
2055                     "seat_bookable": 1,
2056                     "seat_yupiao": 122
2057                 }, {
2058                     "seat_price": "74.5",
2059                     "seat_name": "硬臥上",
2060                     "seat_bookable": 0,
2061                     "seat_yupiao": 0
2062                 }, {
2063                     "seat_price": "77.5",
2064                     "seat_name": "硬臥中",
2065                     "seat_bookable": 0,
2066                     "seat_yupiao": 0
2067                 }, {
2068                     "seat_price": "84.5",
2069                     "seat_name": "硬臥下",
2070                     "seat_bookable": 0,
2071                     "seat_yupiao": 0
2072                 }, {
2073                     "seat_price": "112.5",
2074                     "seat_name": "軟臥上",
2075                     "seat_bookable": 0,
2076                     "seat_yupiao": 0
2077                 }, {
2078                     "seat_price": "127.0",
2079                     "seat_name": "軟臥下",
2080                     "seat_bookable": 0,
2081                     "seat_yupiao": 0
2082                 }, {"seat_price": "28.5", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 62}]
2083             }, {
2084                 "train_no": "5l000G750931",
2085                 "train_number": "G7509",
2086                 "from_station": "上海虹橋",
2087                 "to_station": "杭州東",
2088                 "from_time": "10:59",
2089                 "to_time": "11:58",
2090                 "from_station_type": "起點",
2091                 "to_station_type": "途經",
2092                 "day_diff": "0",
2093                 "use_time": "59",
2094                 "sale_time": "13:30",
2095                 "control_day": 59,
2096                 "from_telecode": "AOH",
2097                 "to_telecode": "HGH",
2098                 "can_web_buy": "Y",
2099                 "note": "",
2100                 "seats": [{
2101                     "seat_price": "73.0",
2102                     "seat_name": "二等座",
2103                     "seat_bookable": 1,
2104                     "seat_yupiao": 123
2105                 }, {
2106                     "seat_price": "117.0",
2107                     "seat_name": "一等座",
2108                     "seat_bookable": 1,
2109                     "seat_yupiao": 113
2110                 }, {
2111                     "seat_price": "219.5",
2112                     "seat_name": "商務座",
2113                     "seat_bookable": 1,
2114                     "seat_yupiao": 26
2115                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2116             }, {
2117                 "train_no": "55000K125102",
2118                 "train_number": "K1251",
2119                 "from_station": "上海南",
2120                 "to_station": "杭州",
2121                 "from_time": "11:13",
2122                 "to_time": "13:30",
2123                 "from_station_type": "起點",
2124                 "to_station_type": "途經",
2125                 "day_diff": "0",
2126                 "use_time": "137",
2127                 "sale_time": "15:30",
2128                 "control_day": 59,
2129                 "from_telecode": "SNH",
2130                 "to_telecode": "HZH",
2131                 "can_web_buy": "Y",
2132                 "note": "",
2133                 "seats": [{
2134                     "seat_price": "28.5",
2135                     "seat_name": "硬座",
2136                     "seat_bookable": 0,
2137                     "seat_yupiao": 0
2138                 }, {
2139                     "seat_price": "74.5",
2140                     "seat_name": "硬臥上",
2141                     "seat_bookable": 1,
2142                     "seat_yupiao": 6
2143                 }, {
2144                     "seat_price": "77.5",
2145                     "seat_name": "硬臥中",
2146                     "seat_bookable": 1,
2147                     "seat_yupiao": 6
2148                 }, {
2149                     "seat_price": "84.5",
2150                     "seat_name": "硬臥下",
2151                     "seat_bookable": 1,
2152                     "seat_yupiao": 6
2153                 }, {
2154                     "seat_price": "112.5",
2155                     "seat_name": "軟臥上",
2156                     "seat_bookable": 0,
2157                     "seat_yupiao": 0
2158                 }, {
2159                     "seat_price": "127.0",
2160                     "seat_name": "軟臥下",
2161                     "seat_bookable": 0,
2162                     "seat_yupiao": 0
2163                 }, {"seat_price": "28.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2164             }, {
2165                 "train_no": "5l000D543141",
2166                 "train_number": "D5431",
2167                 "from_station": "上海虹橋",
2168                 "to_station": "杭州東",
2169                 "from_time": "11:19",
2170                 "to_time": "12:34",
2171                 "from_station_type": "途經",
2172                 "to_station_type": "途經",
2173                 "day_diff": "0",
2174                 "use_time": "75",
2175                 "sale_time": "13:30",
2176                 "control_day": 59,
2177                 "from_telecode": "AOH",
2178                 "to_telecode": "HGH",
2179                 "can_web_buy": "Y",
2180                 "note": "",
2181                 "seats": [{
2182                     "seat_price": "49.0",
2183                     "seat_name": "二等座",
2184                     "seat_bookable": 1,
2185                     "seat_yupiao": 35
2186                 }, {
2187                     "seat_price": "59.0",
2188                     "seat_name": "一等座",
2189                     "seat_bookable": 1,
2190                     "seat_yupiao": 46
2191                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 16}]
2192             }, {
2193                 "train_no": "5l000D228350",
2194                 "train_number": "D2283",
2195                 "from_station": "上海虹橋",
2196                 "to_station": "杭州東",
2197                 "from_time": "11:24",
2198                 "to_time": "12:26",
2199                 "from_station_type": "起點",
2200                 "to_station_type": "途經",
2201                 "day_diff": "0",
2202                 "use_time": "62",
2203                 "sale_time": "13:30",
2204                 "control_day": 59,
2205                 "from_telecode": "AOH",
2206                 "to_telecode": "HGH",
2207                 "can_web_buy": "N",
2208                 "note": "",
2209                 "seats": [{
2210                     "seat_price": "49.0",
2211                     "seat_name": "二等座",
2212                     "seat_bookable": 1,
2213                     "seat_yupiao": 31
2214                 }, {
2215                     "seat_price": "59.0",
2216                     "seat_name": "一等座",
2217                     "seat_bookable": 0,
2218                     "seat_yupiao": 0
2219                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2220             }, {
2221                 "train_no": "5500000T7780",
2222                 "train_number": "T77",
2223                 "from_station": "上海南",
2224                 "to_station": "杭州東",
2225                 "from_time": "11:27",
2226                 "to_time": "13:13",
2227                 "from_station_type": "起點",
2228                 "to_station_type": "途經",
2229                 "day_diff": "0",
2230                 "use_time": "106",
2231                 "sale_time": "15:30",
2232                 "control_day": 59,
2233                 "from_telecode": "SNH",
2234                 "to_telecode": "HGH",
2235                 "can_web_buy": "Y",
2236                 "note": "",
2237                 "seats": [{
2238                     "seat_price": "70.5",
2239                     "seat_name": "硬臥上",
2240                     "seat_bookable": 1,
2241                     "seat_yupiao": 18
2242                 }, {
2243                     "seat_price": "73.5",
2244                     "seat_name": "硬臥中",
2245                     "seat_bookable": 1,
2246                     "seat_yupiao": 18
2247                 }, {
2248                     "seat_price": "80.0",
2249                     "seat_name": "硬臥下",
2250                     "seat_bookable": 1,
2251                     "seat_yupiao": 18
2252                 }, {
2253                     "seat_price": "108.5",
2254                     "seat_name": "軟臥上",
2255                     "seat_bookable": 0,
2256                     "seat_yupiao": 0
2257                 }, {"seat_price": "122.5", "seat_name": "軟臥下", "seat_bookable": 0, "seat_yupiao": 0}]
2258             }, {
2259                 "train_no": "5l000G753724",
2260                 "train_number": "G7537",
2261                 "from_station": "上海虹橋",
2262                 "to_station": "杭州東",
2263                 "from_time": "11:29",
2264                 "to_time": "12:30",
2265                 "from_station_type": "起點",
2266                 "to_station_type": "途經",
2267                 "day_diff": "0",
2268                 "use_time": "61",
2269                 "sale_time": "13:30",
2270                 "control_day": 59,
2271                 "from_telecode": "AOH",
2272                 "to_telecode": "HGH",
2273                 "can_web_buy": "Y",
2274                 "note": "",
2275                 "seats": [{
2276                     "seat_price": "73.0",
2277                     "seat_name": "二等座",
2278                     "seat_bookable": 1,
2279                     "seat_yupiao": 25
2280                 }, {
2281                     "seat_price": "117.0",
2282                     "seat_name": "一等座",
2283                     "seat_bookable": 1,
2284                     "seat_yupiao": 67
2285                 }, {
2286                     "seat_price": "219.5",
2287                     "seat_name": "商務座",
2288                     "seat_bookable": 0,
2289                     "seat_yupiao": 0
2290                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2291             }, {
2292                 "train_no": "5l000G7303A1",
2293                 "train_number": "G7303",
2294                 "from_station": "上海虹橋",
2295                 "to_station": "杭州",
2296                 "from_time": "11:34",
2297                 "to_time": "12:49",
2298                 "from_station_type": "起點",
2299                 "to_station_type": "終點",
2300                 "day_diff": "0",
2301                 "use_time": "75",
2302                 "sale_time": "13:30",
2303                 "control_day": 59,
2304                 "from_telecode": "AOH",
2305                 "to_telecode": "HZH",
2306                 "can_web_buy": "Y",
2307                 "note": "",
2308                 "seats": [{
2309                     "seat_price": "77.5",
2310                     "seat_name": "二等座",
2311                     "seat_bookable": 1,
2312                     "seat_yupiao": 458
2313                 }, {
2314                     "seat_price": "123.5",
2315                     "seat_name": "一等座",
2316                     "seat_bookable": 1,
2317                     "seat_yupiao": 26
2318                 }, {
2319                     "seat_price": "233.5",
2320                     "seat_name": "商務座",
2321                     "seat_bookable": 1,
2322                     "seat_yupiao": 10
2323                 }, {"seat_price": "77.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2324             }, {
2325                 "train_no": "5l000G132720",
2326                 "train_number": "G1327",
2327                 "from_station": "上海虹橋",
2328                 "to_station": "杭州東",
2329                 "from_time": "11:39",
2330                 "to_time": "12:39",
2331                 "from_station_type": "起點",
2332                 "to_station_type": "途經",
2333                 "day_diff": "0",
2334                 "use_time": "60",
2335                 "sale_time": "13:30",
2336                 "control_day": 59,
2337                 "from_telecode": "AOH",
2338                 "to_telecode": "HGH",
2339                 "can_web_buy": "Y",
2340                 "note": "",
2341                 "seats": [{
2342                     "seat_price": "73.0",
2343                     "seat_name": "二等座",
2344                     "seat_bookable": 1,
2345                     "seat_yupiao": 63
2346                 }, {
2347                     "seat_price": "117.0",
2348                     "seat_name": "一等座",
2349                     "seat_bookable": 0,
2350                     "seat_yupiao": 0
2351                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 0, "seat_yupiao": 0}]
2352             }, {
2353                 "train_no": "550000T21140",
2354                 "train_number": "T211",
2355                 "from_station": "上海南",
2356                 "to_station": "杭州東",
2357                 "from_time": "11:41",
2358                 "to_time": "13:39",
2359                 "from_station_type": "起點",
2360                 "to_station_type": "途經",
2361                 "day_diff": "0",
2362                 "use_time": "118",
2363                 "sale_time": "15:30",
2364                 "control_day": 59,
2365                 "from_telecode": "SNH",
2366                 "to_telecode": "HGH",
2367                 "can_web_buy": "Y",
2368                 "note": "",
2369                 "seats": [{
2370                     "seat_price": "24.5",
2371                     "seat_name": "硬座",
2372                     "seat_bookable": 1,
2373                     "seat_yupiao": 309
2374                 }, {
2375                     "seat_price": "70.5",
2376                     "seat_name": "硬臥上",
2377                     "seat_bookable": 1,
2378                     "seat_yupiao": 407
2379                 }, {
2380                     "seat_price": "73.5",
2381                     "seat_name": "硬臥中",
2382                     "seat_bookable": 1,
2383                     "seat_yupiao": 407
2384                 }, {
2385                     "seat_price": "80.0",
2386                     "seat_name": "硬臥下",
2387                     "seat_bookable": 1,
2388                     "seat_yupiao": 407
2389                 }, {
2390                     "seat_price": "108.5",
2391                     "seat_name": "軟臥上",
2392                     "seat_bookable": 1,
2393                     "seat_yupiao": 16
2394                 }, {
2395                     "seat_price": "122.5",
2396                     "seat_name": "軟臥下",
2397                     "seat_bookable": 1,
2398                     "seat_yupiao": 16
2399                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 168}]
2400             }, {
2401                 "train_no": "5l000D3207A3",
2402                 "train_number": "D3207",
2403                 "from_station": "上海虹橋",
2404                 "to_station": "杭州東",
2405                 "from_time": "11:48",
2406                 "to_time": "12:59",
2407                 "from_station_type": "起點",
2408                 "to_station_type": "途經",
2409                 "day_diff": "0",
2410                 "use_time": "71",
2411                 "sale_time": "13:30",
2412                 "control_day": 59,
2413                 "from_telecode": "AOH",
2414                 "to_telecode": "HGH",
2415                 "can_web_buy": "Y",
2416                 "note": "",
2417                 "seats": [{
2418                     "seat_price": "49.0",
2419                     "seat_name": "二等座",
2420                     "seat_bookable": 1,
2421                     "seat_yupiao": 476
2422                 }, {
2423                     "seat_price": "59.0",
2424                     "seat_name": "一等座",
2425                     "seat_bookable": 1,
2426                     "seat_yupiao": 20
2427                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2428             }, {
2429                 "train_no": "5l000G751107",
2430                 "train_number": "G7511",
2431                 "from_station": "上海虹橋",
2432                 "to_station": "杭州東",
2433                 "from_time": "11:53",
2434                 "to_time": "12:54",
2435                 "from_station_type": "起點",
2436                 "to_station_type": "途經",
2437                 "day_diff": "0",
2438                 "use_time": "61",
2439                 "sale_time": "13:30",
2440                 "control_day": 59,
2441                 "from_telecode": "AOH",
2442                 "to_telecode": "HGH",
2443                 "can_web_buy": "Y",
2444                 "note": "",
2445                 "seats": [{
2446                     "seat_price": "73.0",
2447                     "seat_name": "二等座",
2448                     "seat_bookable": 1,
2449                     "seat_yupiao": 815
2450                 }, {
2451                     "seat_price": "117.0",
2452                     "seat_name": "一等座",
2453                     "seat_bookable": 1,
2454                     "seat_yupiao": 49
2455                 }, {
2456                     "seat_price": "219.5",
2457                     "seat_name": "商務座",
2458                     "seat_bookable": 1,
2459                     "seat_yupiao": 20
2460                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2461             }, {
2462                 "train_no": "550000K75960",
2463                 "train_number": "K759",
2464                 "from_station": "上海南",
2465                 "to_station": "杭州",
2466                 "from_time": "12:01",
2467                 "to_time": "14:26",
2468                 "from_station_type": "起點",
2469                 "to_station_type": "途經",
2470                 "day_diff": "0",
2471                 "use_time": "145",
2472                 "sale_time": "15:30",
2473                 "control_day": 59,
2474                 "from_telecode": "SNH",
2475                 "to_telecode": "HZH",
2476                 "can_web_buy": "N",
2477                 "note": "",
2478                 "seats": [{
2479                     "seat_price": "28.5",
2480                     "seat_name": "硬座",
2481                     "seat_bookable": 0,
2482                     "seat_yupiao": 0
2483                 }, {
2484                     "seat_price": "74.5",
2485                     "seat_name": "硬臥上",
2486                     "seat_bookable": 0,
2487                     "seat_yupiao": 0
2488                 }, {
2489                     "seat_price": "77.5",
2490                     "seat_name": "硬臥中",
2491                     "seat_bookable": 0,
2492                     "seat_yupiao": 0
2493                 }, {
2494                     "seat_price": "84.5",
2495                     "seat_name": "硬臥下",
2496                     "seat_bookable": 0,
2497                     "seat_yupiao": 0
2498                 }, {
2499                     "seat_price": "112.5",
2500                     "seat_name": "軟臥上",
2501                     "seat_bookable": 0,
2502                     "seat_yupiao": 0
2503                 }, {
2504                     "seat_price": "127.0",
2505                     "seat_name": "軟臥下",
2506                     "seat_bookable": 0,
2507                     "seat_yupiao": 0
2508                 }, {"seat_price": "28.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2509             }, {
2510                 "train_no": "59000G759400",
2511                 "train_number": "G7591",
2512                 "from_station": "上海虹橋",
2513                 "to_station": "杭州東",
2514                 "from_time": "12:02",
2515                 "to_time": "13:03",
2516                 "from_station_type": "途經",
2517                 "to_station_type": "途經",
2518                 "day_diff": "0",
2519                 "use_time": "61",
2520                 "sale_time": "13:30",
2521                 "control_day": 59,
2522                 "from_telecode": "AOH",
2523                 "to_telecode": "HGH",
2524                 "can_web_buy": "Y",
2525                 "note": "",
2526                 "seats": [{
2527                     "seat_price": "73.0",
2528                     "seat_name": "二等座",
2529                     "seat_bookable": 1,
2530                     "seat_yupiao": 120
2531                 }, {
2532                     "seat_price": "117.0",
2533                     "seat_name": "一等座",
2534                     "seat_bookable": 1,
2535                     "seat_yupiao": 52
2536                 }, {
2537                     "seat_price": "219.5",
2538                     "seat_name": "商務座",
2539                     "seat_bookable": 1,
2540                     "seat_yupiao": 20
2541                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2542             }, {
2543                 "train_no": "5l000D329100",
2544                 "train_number": "D3291",
2545                 "from_station": "上海虹橋",
2546                 "to_station": "杭州東",
2547                 "from_time": "12:15",
2548                 "to_time": "13:16",
2549                 "from_station_type": "起點",
2550                 "to_station_type": "途經",
2551                 "day_diff": "0",
2552                 "use_time": "61",
2553                 "sale_time": "15:00",
2554                 "control_day": 59,
2555                 "from_telecode": "AOH",
2556                 "to_telecode": "HGH",
2557                 "can_web_buy": "Y",
2558                 "note": "",
2559                 "seats": [{
2560                     "seat_price": "49.0",
2561                     "seat_name": "二等座",
2562                     "seat_bookable": 1,
2563                     "seat_yupiao": 63
2564                 }, {
2565                     "seat_price": "59.0",
2566                     "seat_name": "一等座",
2567                     "seat_bookable": 1,
2568                     "seat_yupiao": 9
2569                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2570             }, {
2571                 "train_no": "5l000G138711",
2572                 "train_number": "G1387",
2573                 "from_station": "上海虹橋",
2574                 "to_station": "杭州東",
2575                 "from_time": "12:20",
2576                 "to_time": "13:21",
2577                 "from_station_type": "起點",
2578                 "to_station_type": "途經",
2579                 "day_diff": "0",
2580                 "use_time": "61",
2581                 "sale_time": "13:30",
2582                 "control_day": 59,
2583                 "from_telecode": "AOH",
2584                 "to_telecode": "HGH",
2585                 "can_web_buy": "Y",
2586                 "note": "",
2587                 "seats": [{
2588                     "seat_price": "73.0",
2589                     "seat_name": "二等座",
2590                     "seat_bookable": 1,
2591                     "seat_yupiao": 103
2592                 }, {
2593                     "seat_price": "117.0",
2594                     "seat_name": "一等座",
2595                     "seat_bookable": 1,
2596                     "seat_yupiao": 14
2597                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 1}]
2598             }, {
2599                 "train_no": "5l000G163320",
2600                 "train_number": "G1633",
2601                 "from_station": "上海虹橋",
2602                 "to_station": "杭州東",
2603                 "from_time": "12:25",
2604                 "to_time": "13:25",
2605                 "from_station_type": "起點",
2606                 "to_station_type": "途經",
2607                 "day_diff": "0",
2608                 "use_time": "60",
2609                 "sale_time": "13:30",
2610                 "control_day": 59,
2611                 "from_telecode": "AOH",
2612                 "to_telecode": "HGH",
2613                 "can_web_buy": "Y",
2614                 "note": "",
2615                 "seats": [{
2616                     "seat_price": "73.0",
2617                     "seat_name": "二等座",
2618                     "seat_bookable": 1,
2619                     "seat_yupiao": 113
2620                 }, {
2621                     "seat_price": "117.0",
2622                     "seat_name": "一等座",
2623                     "seat_bookable": 0,
2624                     "seat_yupiao": 0
2625                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 0, "seat_yupiao": 0}]
2626             }, {
2627                 "train_no": "5l000G733570",
2628                 "train_number": "G7335",
2629                 "from_station": "上海虹橋",
2630                 "to_station": "杭州東",
2631                 "from_time": "12:30",
2632                 "to_time": "13:29",
2633                 "from_station_type": "起點",
2634                 "to_station_type": "途經",
2635                 "day_diff": "0",
2636                 "use_time": "59",
2637                 "sale_time": "13:30",
2638                 "control_day": 59,
2639                 "from_telecode": "AOH",
2640                 "to_telecode": "HGH",
2641                 "can_web_buy": "Y",
2642                 "note": "",
2643                 "seats": [{
2644                     "seat_price": "73.0",
2645                     "seat_name": "二等座",
2646                     "seat_bookable": 1,
2647                     "seat_yupiao": 545
2648                 }, {
2649                     "seat_price": "117.0",
2650                     "seat_name": "一等座",
2651                     "seat_bookable": 1,
2652                     "seat_yupiao": 37
2653                 }, {
2654                     "seat_price": "219.5",
2655                     "seat_name": "商務座",
2656                     "seat_bookable": 1,
2657                     "seat_yupiao": 17
2658                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2659             }, {
2660                 "train_no": "5l000G137331",
2661                 "train_number": "G1373",
2662                 "from_station": "上海虹橋",
2663                 "to_station": "杭州東",
2664                 "from_time": "12:40",
2665                 "to_time": "13:40",
2666                 "from_station_type": "起點",
2667                 "to_station_type": "途經",
2668                 "day_diff": "0",
2669                 "use_time": "60",
2670                 "sale_time": "13:30",
2671                 "control_day": 59,
2672                 "from_telecode": "AOH",
2673                 "to_telecode": "HGH",
2674                 "can_web_buy": "N",
2675                 "note": "",
2676                 "seats": [{
2677                     "seat_price": "73.0",
2678                     "seat_name": "二等座",
2679                     "seat_bookable": 1,
2680                     "seat_yupiao": 72
2681                 }, {
2682                     "seat_price": "117.0",
2683                     "seat_name": "一等座",
2684                     "seat_bookable": 1,
2685                     "seat_yupiao": 21
2686                 }, {"seat_price": "132.0", "seat_name": "特等座", "seat_bookable": 0, "seat_yupiao": 0}]
2687             }, {
2688                 "train_no": "5i000G737813",
2689                 "train_number": "G7375",
2690                 "from_station": "上海虹橋",
2691                 "to_station": "杭州東",
2692                 "from_time": "12:53",
2693                 "to_time": "13:53",
2694                 "from_station_type": "途經",
2695                 "to_station_type": "途經",
2696                 "day_diff": "0",
2697                 "use_time": "60",
2698                 "sale_time": "13:30",
2699                 "control_day": 59,
2700                 "from_telecode": "AOH",
2701                 "to_telecode": "HGH",
2702                 "can_web_buy": "Y",
2703                 "note": "",
2704                 "seats": [{
2705                     "seat_price": "73.0",
2706                     "seat_name": "二等座",
2707                     "seat_bookable": 1,
2708                     "seat_yupiao": 287
2709                 }, {
2710                     "seat_price": "117.0",
2711                     "seat_name": "一等座",
2712                     "seat_bookable": 1,
2713                     "seat_yupiao": 49
2714                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2715             }, {
2716                 "train_no": "5l000G165920",
2717                 "train_number": "G1659",
2718                 "from_station": "上海虹橋",
2719                 "to_station": "杭州東",
2720                 "from_time": "12:58",
2721                 "to_time": "13:58",
2722                 "from_station_type": "起點",
2723                 "to_station_type": "途經",
2724                 "day_diff": "0",
2725                 "use_time": "60",
2726                 "sale_time": "13:30",
2727                 "control_day": 59,
2728                 "from_telecode": "AOH",
2729                 "to_telecode": "HGH",
2730                 "can_web_buy": "Y",
2731                 "note": "",
2732                 "seats": [{
2733                     "seat_price": "73.0",
2734                     "seat_name": "二等座",
2735                     "seat_bookable": 1,
2736                     "seat_yupiao": 80
2737                 }, {
2738                     "seat_price": "117.0",
2739                     "seat_name": "一等座",
2740                     "seat_bookable": 1,
2741                     "seat_yupiao": 9
2742                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 7}]
2743             }, {
2744                 "train_no": "5i000G759807",
2745                 "train_number": "G7595",
2746                 "from_station": "上海虹橋",
2747                 "to_station": "杭州東",
2748                 "from_time": "13:05",
2749                 "to_time": "14:08",
2750                 "from_station_type": "途經",
2751                 "to_station_type": "途經",
2752                 "day_diff": "0",
2753                 "use_time": "63",
2754                 "sale_time": "13:30",
2755                 "control_day": 59,
2756                 "from_telecode": "AOH",
2757                 "to_telecode": "HGH",
2758                 "can_web_buy": "Y",
2759                 "note": "",
2760                 "seats": [{
2761                     "seat_price": "73.0",
2762                     "seat_name": "二等座",
2763                     "seat_bookable": 1,
2764                     "seat_yupiao": 3
2765                 }, {
2766                     "seat_price": "117.0",
2767                     "seat_name": "一等座",
2768                     "seat_bookable": 1,
2769                     "seat_yupiao": 2
2770                 }, {
2771                     "seat_price": "219.5",
2772                     "seat_name": "商務座",
2773                     "seat_bookable": 0,
2774                     "seat_yupiao": 0
2775                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2776             }, {
2777                 "train_no": "5l000G138920",
2778                 "train_number": "G1389",
2779                 "from_station": "上海虹橋",
2780                 "to_station": "杭州東",
2781                 "from_time": "13:11",
2782                 "to_time": "14:03",
2783                 "from_station_type": "起點",
2784                 "to_station_type": "途經",
2785                 "day_diff": "0",
2786                 "use_time": "52",
2787                 "sale_time": "13:30",
2788                 "control_day": 59,
2789                 "from_telecode": "AOH",
2790                 "to_telecode": "HGH",
2791                 "can_web_buy": "Y",
2792                 "note": "",
2793                 "seats": [{
2794                     "seat_price": "73.0",
2795                     "seat_name": "二等座",
2796                     "seat_bookable": 1,
2797                     "seat_yupiao": 16
2798                 }, {
2799                     "seat_price": "117.0",
2800                     "seat_name": "一等座",
2801                     "seat_bookable": 0,
2802                     "seat_yupiao": 0
2803                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 1}]
2804             }, {
2805                 "train_no": "5l000D314110",
2806                 "train_number": "D3141",
2807                 "from_station": "上海虹橋",
2808                 "to_station": "杭州東",
2809                 "from_time": "13:19",
2810                 "to_time": "14:21",
2811                 "from_station_type": "起點",
2812                 "to_station_type": "途經",
2813                 "day_diff": "0",
2814                 "use_time": "62",
2815                 "sale_time": "13:30",
2816                 "control_day": 59,
2817                 "from_telecode": "AOH",
2818                 "to_telecode": "HGH",
2819                 "can_web_buy": "N",
2820                 "note": "",
2821                 "seats": [{
2822                     "seat_price": "49.0",
2823                     "seat_name": "二等座",
2824                     "seat_bookable": 1,
2825                     "seat_yupiao": 93
2826                 }, {
2827                     "seat_price": "59.0",
2828                     "seat_name": "一等座",
2829                     "seat_bookable": 1,
2830                     "seat_yupiao": 18
2831                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2832             }, {
2833                 "train_no": "550000T10140",
2834                 "train_number": "T101",
2835                 "from_station": "上海南",
2836                 "to_station": "杭州東",
2837                 "from_time": "13:20",
2838                 "to_time": "15:11",
2839                 "from_station_type": "起點",
2840                 "to_station_type": "途經",
2841                 "day_diff": "0",
2842                 "use_time": "111",
2843                 "sale_time": "15:30",
2844                 "control_day": 59,
2845                 "from_telecode": "SNH",
2846                 "to_telecode": "HGH",
2847                 "can_web_buy": "Y",
2848                 "note": "",
2849                 "seats": [{
2850                     "seat_price": "24.5",
2851                     "seat_name": "硬座",
2852                     "seat_bookable": 1,
2853                     "seat_yupiao": 116
2854                 }, {
2855                     "seat_price": "70.5",
2856                     "seat_name": "硬臥上",
2857                     "seat_bookable": 1,
2858                     "seat_yupiao": 204
2859                 }, {
2860                     "seat_price": "73.5",
2861                     "seat_name": "硬臥中",
2862                     "seat_bookable": 1,
2863                     "seat_yupiao": 204
2864                 }, {
2865                     "seat_price": "80.0",
2866                     "seat_name": "硬臥下",
2867                     "seat_bookable": 1,
2868                     "seat_yupiao": 204
2869                 }, {
2870                     "seat_price": "108.5",
2871                     "seat_name": "軟臥上",
2872                     "seat_bookable": 0,
2873                     "seat_yupiao": 0
2874                 }, {
2875                     "seat_price": "122.5",
2876                     "seat_name": "軟臥下",
2877                     "seat_bookable": 0,
2878                     "seat_yupiao": 0
2879                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2880             }, {
2881                 "train_no": "5l000G135320",
2882                 "train_number": "G1353",
2883                 "from_station": "上海虹橋",
2884                 "to_station": "杭州東",
2885                 "from_time": "13:25",
2886                 "to_time": "14:26",
2887                 "from_station_type": "起點",
2888                 "to_station_type": "途經",
2889                 "day_diff": "0",
2890                 "use_time": "61",
2891                 "sale_time": "13:30",
2892                 "control_day": 59,
2893                 "from_telecode": "AOH",
2894                 "to_telecode": "HGH",
2895                 "can_web_buy": "Y",
2896                 "note": "",
2897                 "seats": [{
2898                     "seat_price": "73.0",
2899                     "seat_name": "二等座",
2900                     "seat_bookable": 1,
2901                     "seat_yupiao": 211
2902                 }, {
2903                     "seat_price": "117.0",
2904                     "seat_name": "一等座",
2905                     "seat_bookable": 0,
2906                     "seat_yupiao": 0
2907                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 0, "seat_yupiao": 0}]
2908             }, {
2909                 "train_no": "5l000G730583",
2910                 "train_number": "G7305",
2911                 "from_station": "上海虹橋",
2912                 "to_station": "杭州",
2913                 "from_time": "13:30",
2914                 "to_time": "14:36",
2915                 "from_station_type": "起點",
2916                 "to_station_type": "終點",
2917                 "day_diff": "0",
2918                 "use_time": "66",
2919                 "sale_time": "13:30",
2920                 "control_day": 59,
2921                 "from_telecode": "AOH",
2922                 "to_telecode": "HZH",
2923                 "can_web_buy": "Y",
2924                 "note": "",
2925                 "seats": [{
2926                     "seat_price": "77.5",
2927                     "seat_name": "二等座",
2928                     "seat_bookable": 1,
2929                     "seat_yupiao": 11
2930                 }, {
2931                     "seat_price": "123.5",
2932                     "seat_name": "一等座",
2933                     "seat_bookable": 1,
2934                     "seat_yupiao": 52
2935                 }, {
2936                     "seat_price": "233.5",
2937                     "seat_name": "商務座",
2938                     "seat_bookable": 1,
2939                     "seat_yupiao": 17
2940                 }, {"seat_price": "77.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
2941             }, {
2942                 "train_no": "550000K123C0",
2943                 "train_number": "K123",
2944                 "from_station": "上海南",
2945                 "to_station": "杭州東",
2946                 "from_time": "13:40",
2947                 "to_time": "15:54",
2948                 "from_station_type": "起點",
2949                 "to_station_type": "途經",
2950                 "day_diff": "0",
2951                 "use_time": "134",
2952                 "sale_time": "15:30",
2953                 "control_day": 59,
2954                 "from_telecode": "SNH",
2955                 "to_telecode": "HGH",
2956                 "can_web_buy": "Y",
2957                 "note": "",
2958                 "seats": [{
2959                     "seat_price": "24.5",
2960                     "seat_name": "硬座",
2961                     "seat_bookable": 1,
2962                     "seat_yupiao": 917
2963                 }, {
2964                     "seat_price": "70.5",
2965                     "seat_name": "硬臥上",
2966                     "seat_bookable": 1,
2967                     "seat_yupiao": 5
2968                 }, {
2969                     "seat_price": "73.5",
2970                     "seat_name": "硬臥中",
2971                     "seat_bookable": 1,
2972                     "seat_yupiao": 5
2973                 }, {
2974                     "seat_price": "80.0",
2975                     "seat_name": "硬臥下",
2976                     "seat_bookable": 1,
2977                     "seat_yupiao": 5
2978                 }, {
2979                     "seat_price": "108.5",
2980                     "seat_name": "軟臥上",
2981                     "seat_bookable": 1,
2982                     "seat_yupiao": 4
2983                 }, {
2984                     "seat_price": "122.5",
2985                     "seat_name": "軟臥下",
2986                     "seat_bookable": 1,
2987                     "seat_yupiao": 4
2988                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 488}]
2989             }, {
2990                 "train_no": "5l000G132930",
2991                 "train_number": "G1329",
2992                 "from_station": "上海虹橋",
2993                 "to_station": "杭州東",
2994                 "from_time": "13:43",
2995                 "to_time": "14:42",
2996                 "from_station_type": "起點",
2997                 "to_station_type": "途經",
2998                 "day_diff": "0",
2999                 "use_time": "59",
3000                 "sale_time": "13:30",
3001                 "control_day": 59,
3002                 "from_telecode": "AOH",
3003                 "to_telecode": "HGH",
3004                 "can_web_buy": "Y",
3005                 "note": "",
3006                 "seats": [{
3007                     "seat_price": "73.0",
3008                     "seat_name": "二等座",
3009                     "seat_bookable": 1,
3010                     "seat_yupiao": 417
3011                 }, {
3012                     "seat_price": "117.0",
3013                     "seat_name": "一等座",
3014                     "seat_bookable": 1,
3015                     "seat_yupiao": 20
3016                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 9}]
3017             }, {
3018                 "train_no": "5l000G135511",
3019                 "train_number": "G1355",
3020                 "from_station": "上海虹橋",
3021                 "to_station": "杭州東",
3022                 "from_time": "13:48",
3023                 "to_time": "14:47",
3024                 "from_station_type": "起點",
3025                 "to_station_type": "途經",
3026                 "day_diff": "0",
3027                 "use_time": "59",
3028                 "sale_time": "13:30",
3029                 "control_day": 59,
3030                 "from_telecode": "AOH",
3031                 "to_telecode": "HGH",
3032                 "can_web_buy": "N",
3033                 "note": "",
3034                 "seats": [{
3035                     "seat_price": "73.0",
3036                     "seat_name": "二等座",
3037                     "seat_bookable": 1,
3038                     "seat_yupiao": 198
3039                 }, {
3040                     "seat_price": "117.0",
3041                     "seat_name": "一等座",
3042                     "seat_bookable": 1,
3043                     "seat_yupiao": 27
3044                 }, {"seat_price": "132.0", "seat_name": "特等座", "seat_bookable": 0, "seat_yupiao": 0}]
3045             }, {
3046                 "train_no": "5l000G751550",
3047                 "train_number": "G7515",
3048                 "from_station": "上海虹橋",
3049                 "to_station": "杭州東",
3050                 "from_time": "14:00",
3051                 "to_time": "14:59",
3052                 "from_station_type": "起點",
3053                 "to_station_type": "途經",
3054                 "day_diff": "0",
3055                 "use_time": "59",
3056                 "sale_time": "13:30",
3057                 "control_day": 59,
3058                 "from_telecode": "AOH",
3059                 "to_telecode": "HGH",
3060                 "can_web_buy": "Y",
3061                 "note": "",
3062                 "seats": [{
3063                     "seat_price": "73.0",
3064                     "seat_name": "二等座",
3065                     "seat_bookable": 1,
3066                     "seat_yupiao": 837
3067                 }, {
3068                     "seat_price": "117.0",
3069                     "seat_name": "一等座",
3070                     "seat_bookable": 1,
3071                     "seat_yupiao": 112
3072                 }, {
3073                     "seat_price": "219.5",
3074                     "seat_name": "商務座",
3075                     "seat_bookable": 1,
3076                     "seat_yupiao": 26
3077                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3078             }, {
3079                 "train_no": "54000G735300",
3080                 "train_number": "G7353",
3081                 "from_station": "上海虹橋",
3082                 "to_station": "杭州",
3083                 "from_time": "14:05",
3084                 "to_time": "15:14",
3085                 "from_station_type": "途經",
3086                 "to_station_type": "終點",
3087                 "day_diff": "0",
3088                 "use_time": "69",
3089                 "sale_time": "13:30",
3090                 "control_day": 59,
3091                 "from_telecode": "AOH",
3092                 "to_telecode": "HZH",
3093                 "can_web_buy": "Y",
3094                 "note": "",
3095                 "seats": [{
3096                     "seat_price": "77.5",
3097                     "seat_name": "二等座",
3098                     "seat_bookable": 1,
3099                     "seat_yupiao": 82
3100                 }, {
3101                     "seat_price": "123.5",
3102                     "seat_name": "一等座",
3103                     "seat_bookable": 1,
3104                     "seat_yupiao": 26
3105                 }, {
3106                     "seat_price": "233.5",
3107                     "seat_name": "商務座",
3108                     "seat_bookable": 1,
3109                     "seat_yupiao": 5
3110                 }, {"seat_price": "77.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3111             }, {
3112                 "train_no": "5l000G130340",
3113                 "train_number": "G1303",
3114                 "from_station": "上海虹橋",
3115                 "to_station": "杭州東",
3116                 "from_time": "14:10",
3117                 "to_time": "15:04",
3118                 "from_station_type": "起點",
3119                 "to_station_type": "途經",
3120                 "day_diff": "0",
3121                 "use_time": "54",
3122                 "sale_time": "13:30",
3123                 "control_day": 59,
3124                 "from_telecode": "AOH",
3125                 "to_telecode": "HGH",
3126                 "can_web_buy": "Y",
3127                 "note": "",
3128                 "seats": [{
3129                     "seat_price": "73.0",
3130                     "seat_name": "二等座",
3131                     "seat_bookable": 1,
3132                     "seat_yupiao": 333
3133                 }, {
3134                     "seat_price": "117.0",
3135                     "seat_name": "一等座",
3136                     "seat_bookable": 1,
3137                     "seat_yupiao": 18
3138                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 9}]
3139             }, {
3140                 "train_no": "5l000G753960",
3141                 "train_number": "G7539",
3142                 "from_station": "上海虹橋",
3143                 "to_station": "杭州東",
3144                 "from_time": "14:15",
3145                 "to_time": "15:14",
3146                 "from_station_type": "起點",
3147                 "to_station_type": "途經",
3148                 "day_diff": "0",
3149                 "use_time": "59",
3150                 "sale_time": "13:30",
3151                 "control_day": 59,
3152                 "from_telecode": "AOH",
3153                 "to_telecode": "HGH",
3154                 "can_web_buy": "Y",
3155                 "note": "",
3156                 "seats": [{
3157                     "seat_price": "73.0",
3158                     "seat_name": "二等座",
3159                     "seat_bookable": 1,
3160                     "seat_yupiao": 186
3161                 }, {
3162                     "seat_price": "117.0",
3163                     "seat_name": "一等座",
3164                     "seat_bookable": 1,
3165                     "seat_yupiao": 3
3166                 }, {
3167                     "seat_price": "219.5",
3168                     "seat_name": "商務座",
3169                     "seat_bookable": 1,
3170                     "seat_yupiao": 13
3171                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3172             }, {
3173                 "train_no": "550000K57570",
3174                 "train_number": "K575",
3175                 "from_station": "上海南",
3176                 "to_station": "杭州東",
3177                 "from_time": "14:18",
3178                 "to_time": "16:26",
3179                 "from_station_type": "起點",
3180                 "to_station_type": "途經",
3181                 "day_diff": "0",
3182                 "use_time": "128",
3183                 "sale_time": "15:30",
3184                 "control_day": 59,
3185                 "from_telecode": "SNH",
3186                 "to_telecode": "HGH",
3187                 "can_web_buy": "Y",
3188                 "note": "",
3189                 "seats": [{
3190                     "seat_price": "24.5",
3191                     "seat_name": "硬座",
3192                     "seat_bookable": 0,
3193                     "seat_yupiao": 0
3194                 }, {
3195                     "seat_price": "70.5",
3196                     "seat_name": "硬臥上",
3197                     "seat_bookable": 0,
3198                     "seat_yupiao": 0
3199                 }, {
3200                     "seat_price": "73.5",
3201                     "seat_name": "硬臥中",
3202                     "seat_bookable": 0,
3203                     "seat_yupiao": 0
3204                 }, {
3205                     "seat_price": "80.0",
3206                     "seat_name": "硬臥下",
3207                     "seat_bookable": 0,
3208                     "seat_yupiao": 0
3209                 }, {
3210                     "seat_price": "108.5",
3211                     "seat_name": "軟臥上",
3212                     "seat_bookable": 0,
3213                     "seat_yupiao": 0
3214                 }, {
3215                     "seat_price": "122.5",
3216                     "seat_name": "軟臥下",
3217                     "seat_bookable": 0,
3218                     "seat_yupiao": 0
3219                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3220             }, {
3221                 "train_no": "53000G757820",
3222                 "train_number": "G7575",
3223                 "from_station": "上海虹橋",
3224                 "to_station": "杭州東",
3225                 "from_time": "14:19",
3226                 "to_time": "15:19",
3227                 "from_station_type": "途經",
3228                 "to_station_type": "途經",
3229                 "day_diff": "0",
3230                 "use_time": "60",
3231                 "sale_time": "13:30",
3232                 "control_day": 59,
3233                 "from_telecode": "AOH",
3234                 "to_telecode": "HGH",
3235                 "can_web_buy": "Y",
3236                 "note": "",
3237                 "seats": [{
3238                     "seat_price": "73.0",
3239                     "seat_name": "二等座",
3240                     "seat_bookable": 1,
3241                     "seat_yupiao": 3
3242                 }, {
3243                     "seat_price": "117.0",
3244                     "seat_name": "一等座",
3245                     "seat_bookable": 1,
3246                     "seat_yupiao": 1
3247                 }, {
3248                     "seat_price": "219.5",
3249                     "seat_name": "商務座",
3250                     "seat_bookable": 0,
3251                     "seat_yupiao": 0
3252                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3253             }, {
3254                 "train_no": "5l000G730771",
3255                 "train_number": "G7307",
3256                 "from_station": "上海虹橋",
3257                 "to_station": "杭州",
3258                 "from_time": "14:30",
3259                 "to_time": "15:37",
3260                 "from_station_type": "起點",
3261                 "to_station_type": "終點",
3262                 "day_diff": "0",
3263                 "use_time": "67",
3264                 "sale_time": "13:30",
3265                 "control_day": 59,
3266                 "from_telecode": "AOH",
3267                 "to_telecode": "HZH",
3268                 "can_web_buy": "Y",
3269                 "note": "",
3270                 "seats": [{
3271                     "seat_price": "77.5",
3272                     "seat_name": "二等座",
3273                     "seat_bookable": 1,
3274                     "seat_yupiao": 471
3275                 }, {
3276                     "seat_price": "123.5",
3277                     "seat_name": "一等座",
3278                     "seat_bookable": 1,
3279                     "seat_yupiao": 24
3280                 }, {
3281                     "seat_price": "233.5",
3282                     "seat_name": "商務座",
3283                     "seat_bookable": 1,
3284                     "seat_yupiao": 10
3285                 }, {"seat_price": "77.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3286             }, {
3287                 "train_no": "5500000K7120",
3288                 "train_number": "K71",
3289                 "from_station": "上海南",
3290                 "to_station": "杭州東",
3291                 "from_time": "14:34",
3292                 "to_time": "16:40",
3293                 "from_station_type": "起點",
3294                 "to_station_type": "途經",
3295                 "day_diff": "0",
3296                 "use_time": "126",
3297                 "sale_time": "15:00",
3298                 "control_day": 57,
3299                 "from_telecode": "SNH",
3300                 "to_telecode": "HGH",
3301                 "can_web_buy": "Y",
3302                 "note": "",
3303                 "seats": [{
3304                     "seat_price": "24.5",
3305                     "seat_name": "硬座",
3306                     "seat_bookable": 1,
3307                     "seat_yupiao": 234
3308                 }, {
3309                     "seat_price": "70.5",
3310                     "seat_name": "硬臥上",
3311                     "seat_bookable": 1,
3312                     "seat_yupiao": 12
3313                 }, {
3314                     "seat_price": "73.5",
3315                     "seat_name": "硬臥中",
3316                     "seat_bookable": 1,
3317                     "seat_yupiao": 12
3318                 }, {
3319                     "seat_price": "80.0",
3320                     "seat_name": "硬臥下",
3321                     "seat_bookable": 1,
3322                     "seat_yupiao": 12
3323                 }, {
3324                     "seat_price": "108.5",
3325                     "seat_name": "軟臥上",
3326                     "seat_bookable": 1,
3327                     "seat_yupiao": 4
3328                 }, {
3329                     "seat_price": "122.5",
3330                     "seat_name": "軟臥下",
3331                     "seat_bookable": 1,
3332                     "seat_yupiao": 4
3333                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 310}]
3334             }, {
3335                 "train_no": "5l000G163510",
3336                 "train_number": "G1635",
3337                 "from_station": "上海虹橋",
3338                 "to_station": "杭州東",
3339                 "from_time": "14:35",
3340                 "to_time": "15:36",
3341                 "from_station_type": "起點",
3342                 "to_station_type": "途經",
3343                 "day_diff": "0",
3344                 "use_time": "61",
3345                 "sale_time": "13:30",
3346                 "control_day": 59,
3347                 "from_telecode": "AOH",
3348                 "to_telecode": "HGH",
3349                 "can_web_buy": "Y",
3350                 "note": "",
3351                 "seats": [{
3352                     "seat_price": "73.0",
3353                     "seat_name": "二等座",
3354                     "seat_bookable": 1,
3355                     "seat_yupiao": 68
3356                 }, {
3357                     "seat_price": "117.0",
3358                     "seat_name": "一等座",
3359                     "seat_bookable": 0,
3360                     "seat_yupiao": 0
3361                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 0, "seat_yupiao": 0}]
3362             }, {
3363                 "train_no": "54000G758350",
3364                 "train_number": "G7583",
3365                 "from_station": "上海虹橋",
3366                 "to_station": "杭州東",
3367                 "from_time": "14:40",
3368                 "to_time": "15:40",
3369                 "from_station_type": "途經",
3370                 "to_station_type": "途經",
3371                 "day_diff": "0",
3372                 "use_time": "60",
3373                 "sale_time": "13:30",
3374                 "control_day": 59,
3375                 "from_telecode": "AOH",
3376                 "to_telecode": "HGH",
3377                 "can_web_buy": "Y",
3378                 "note": "",
3379                 "seats": [{
3380                     "seat_price": "73.0",
3381                     "seat_name": "二等座",
3382                     "seat_bookable": 1,
3383                     "seat_yupiao": 62
3384                 }, {
3385                     "seat_price": "117.0",
3386                     "seat_name": "一等座",
3387                     "seat_bookable": 1,
3388                     "seat_yupiao": 39
3389                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3390             }, {
3391                 "train_no": "5l0000D38170",
3392                 "train_number": "D381",
3393                 "from_station": "上海虹橋",
3394                 "to_station": "杭州東",
3395                 "from_time": "14:45",
3396                 "to_time": "16:16",
3397                 "from_station_type": "起點",
3398                 "to_station_type": "途經",
3399                 "day_diff": "0",
3400                 "use_time": "91",
3401                 "sale_time": "13:30",
3402                 "control_day": 59,
3403                 "from_telecode": "AOH",
3404                 "to_telecode": "HGH",
3405                 "can_web_buy": "Y",
3406                 "note": "",
3407                 "seats": [{
3408                     "seat_price": "49.0",
3409                     "seat_name": "二等座",
3410                     "seat_bookable": 0,
3411                     "seat_yupiao": 0
3412                 }, {
3413                     "seat_price": "59.0",
3414                     "seat_name": "一等座",
3415                     "seat_bookable": 1,
3416                     "seat_yupiao": 1
3417                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 83}]
3418             }, {
3419                 "train_no": "2400000G410B",
3420                 "train_number": "G41",
3421                 "from_station": "上海虹橋",
3422                 "to_station": "杭州東",
3423                 "from_time": "14:51",
3424                 "to_time": "15:44",
3425                 "from_station_type": "途經",
3426                 "to_station_type": "終點",
3427                 "day_diff": "0",
3428                 "use_time": "53",
3429                 "sale_time": "13:30",
3430                 "control_day": 59,
3431                 "from_telecode": "AOH",
3432                 "to_telecode": "HGH",
3433                 "can_web_buy": "Y",
3434                 "note": "",
3435                 "seats": [{
3436                     "seat_price": "73.0",
3437                     "seat_name": "二等座",
3438                     "seat_bookable": 1,
3439                     "seat_yupiao": 224
3440                 }, {
3441                     "seat_price": "117.0",
3442                     "seat_name": "一等座",
3443                     "seat_bookable": 1,
3444                     "seat_yupiao": 67
3445                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 1}]
3446             }, {
3447                 "train_no": "5l000G751721",
3448                 "train_number": "G7517",
3449                 "from_station": "上海虹橋",
3450                 "to_station": "杭州東",
3451                 "from_time": "14:56",
3452                 "to_time": "15:49",
3453                 "from_station_type": "起點",
3454                 "to_station_type": "途經",
3455                 "day_diff": "0",
3456                 "use_time": "53",
3457                 "sale_time": "13:30",
3458                 "control_day": 59,
3459                 "from_telecode": "AOH",
3460                 "to_telecode": "HGH",
3461                 "can_web_buy": "Y",
3462                 "note": "",
3463                 "seats": [{
3464                     "seat_price": "73.0",
3465                     "seat_name": "二等座",
3466                     "seat_bookable": 1,
3467                     "seat_yupiao": 18
3468                 }, {
3469                     "seat_price": "117.0",
3470                     "seat_name": "一等座",
3471                     "seat_bookable": 1,
3472                     "seat_yupiao": 52
3473                 }, {
3474                     "seat_price": "219.5",
3475                     "seat_name": "商務座",
3476                     "seat_bookable": 1,
3477                     "seat_yupiao": 20
3478                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3479             }, {
3480                 "train_no": "55000K112700",
3481                 "train_number": "K1127",
3482                 "from_station": "上海南",
3483                 "to_station": "杭州東",
3484                 "from_time": "14:59",
3485                 "to_time": "17:11",
3486                 "from_station_type": "起點",
3487                 "to_station_type": "途經",
3488                 "day_diff": "0",
3489                 "use_time": "132",
3490                 "sale_time": "15:30",
3491                 "control_day": 59,
3492                 "from_telecode": "SNH",
3493                 "to_telecode": "HGH",
3494                 "can_web_buy": "Y",
3495                 "note": "",
3496                 "seats": [{
3497                     "seat_price": "24.5",
3498                     "seat_name": "硬座",
3499                     "seat_bookable": 1,
3500                     "seat_yupiao": 414
3501                 }, {
3502                     "seat_price": "70.5",
3503                     "seat_name": "硬臥上",
3504                     "seat_bookable": 1,
3505                     "seat_yupiao": 9
3506                 }, {
3507                     "seat_price": "73.5",
3508                     "seat_name": "硬臥中",
3509                     "seat_bookable": 1,
3510                     "seat_yupiao": 9
3511                 }, {
3512                     "seat_price": "80.0",
3513                     "seat_name": "硬臥下",
3514                     "seat_bookable": 1,
3515                     "seat_yupiao": 9
3516                 }, {
3517                     "seat_price": "108.5",
3518                     "seat_name": "軟臥上",
3519                     "seat_bookable": 0,
3520                     "seat_yupiao": 0
3521                 }, {
3522                     "seat_price": "122.5",
3523                     "seat_name": "軟臥下",
3524                     "seat_bookable": 0,
3525                     "seat_yupiao": 0
3526                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3527             }, {
3528                 "train_no": "5l000G135711",
3529                 "train_number": "G1357",
3530                 "from_station": "上海虹橋",
3531                 "to_station": "杭州東",
3532                 "from_time": "15:01",
3533                 "to_time": "15:54",
3534                 "from_station_type": "起點",
3535                 "to_station_type": "途經",
3536                 "day_diff": "0",
3537                 "use_time": "53",
3538                 "sale_time": "13:30",
3539                 "control_day": 59,
3540                 "from_telecode": "AOH",
3541                 "to_telecode": "HGH",
3542                 "can_web_buy": "Y",
3543                 "note": "",
3544                 "seats": [{
3545                     "seat_price": "73.0",
3546                     "seat_name": "二等座",
3547                     "seat_bookable": 0,
3548                     "seat_yupiao": 0
3549                 }, {
3550                     "seat_price": "117.0",
3551                     "seat_name": "一等座",
3552                     "seat_bookable": 1,
3553                     "seat_yupiao": 11
3554                 }, {"seat_price": "132.0", "seat_name": "特等座", "seat_bookable": 1, "seat_yupiao": 7}]
3555             }, {
3556                 "train_no": "550000K111D0",
3557                 "train_number": "K111",
3558                 "from_station": "上海南",
3559                 "to_station": "杭州東",
3560                 "from_time": "15:05",
3561                 "to_time": "17:24",
3562                 "from_station_type": "起點",
3563                 "to_station_type": "途經",
3564                 "day_diff": "0",
3565                 "use_time": "139",
3566                 "sale_time": "15:30",
3567                 "control_day": 59,
3568                 "from_telecode": "SNH",
3569                 "to_telecode": "HGH",
3570                 "can_web_buy": "Y",
3571                 "note": "",
3572                 "seats": [{
3573                     "seat_price": "24.5",
3574                     "seat_name": "硬座",
3575                     "seat_bookable": 1,
3576                     "seat_yupiao": 34
3577                 }, {
3578                     "seat_price": "70.5",
3579                     "seat_name": "硬臥上",
3580                     "seat_bookable": 1,
3581                     "seat_yupiao": 11
3582                 }, {
3583                     "seat_price": "73.5",
3584                     "seat_name": "硬臥中",
3585                     "seat_bookable": 1,
3586                     "seat_yupiao": 11
3587                 }, {
3588                     "seat_price": "80.0",
3589                     "seat_name": "硬臥下",
3590                     "seat_bookable": 1,
3591                     "seat_yupiao": 11
3592                 }, {
3593                     "seat_price": "108.5",
3594                     "seat_name": "軟臥上",
3595                     "seat_bookable": 0,
3596                     "seat_yupiao": 0
3597                 }, {
3598                     "seat_price": "122.5",
3599                     "seat_name": "軟臥下",
3600                     "seat_bookable": 0,
3601                     "seat_yupiao": 0
3602                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3603             }, {
3604                 "train_no": "5l000D310160",
3605                 "train_number": "D3101",
3606                 "from_station": "上海虹橋",
3607                 "to_station": "杭州東",
3608                 "from_time": "15:09",
3609                 "to_time": "16:28",
3610                 "from_station_type": "起點",
3611                 "to_station_type": "途經",
3612                 "day_diff": "0",
3613                 "use_time": "79",
3614                 "sale_time": "13:30",
3615                 "control_day": 59,
3616                 "from_telecode": "AOH",
3617                 "to_telecode": "HGH",
3618                 "can_web_buy": "Y",
3619                 "note": "",
3620                 "seats": [{
3621                     "seat_price": "49.0",
3622                     "seat_name": "二等座",
3623                     "seat_bookable": 1,
3624                     "seat_yupiao": 579
3625                 }, {
3626                     "seat_price": "59.0",
3627                     "seat_name": "一等座",
3628                     "seat_bookable": 1,
3629                     "seat_yupiao": 35
3630                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3631             }, {
3632                 "train_no": "5l000G163720",
3633                 "train_number": "G1637",
3634                 "from_station": "上海虹橋",
3635                 "to_station": "杭州東",
3636                 "from_time": "15:17",
3637                 "to_time": "16:21",
3638                 "from_station_type": "起點",
3639                 "to_station_type": "途經",
3640                 "day_diff": "0",
3641                 "use_time": "64",
3642                 "sale_time": "13:30",
3643                 "control_day": 59,
3644                 "from_telecode": "AOH",
3645                 "to_telecode": "HGH",
3646                 "can_web_buy": "Y",
3647                 "note": "",
3648                 "seats": [{
3649                     "seat_price": "73.0",
3650                     "seat_name": "二等座",
3651                     "seat_bookable": 1,
3652                     "seat_yupiao": 684
3653                 }, {
3654                     "seat_price": "117.0",
3655                     "seat_name": "一等座",
3656                     "seat_bookable": 1,
3657                     "seat_yupiao": 13
3658                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 17}]
3659             }, {
3660                 "train_no": "5l000G130503",
3661                 "train_number": "G1305",
3662                 "from_station": "上海虹橋",
3663                 "to_station": "杭州東",
3664                 "from_time": "15:25",
3665                 "to_time": "16:12",
3666                 "from_station_type": "起點",
3667                 "to_station_type": "途經",
3668                 "day_diff": "0",
3669                 "use_time": "47",
3670                 "sale_time": "13:30",
3671                 "control_day": 59,
3672                 "from_telecode": "AOH",
3673                 "to_telecode": "HGH",
3674                 "can_web_buy": "Y",
3675                 "note": "",
3676                 "seats": [{
3677                     "seat_price": "73.0",
3678                     "seat_name": "二等座",
3679                     "seat_bookable": 1,
3680                     "seat_yupiao": 109
3681                 }, {
3682                     "seat_price": "117.0",
3683                     "seat_name": "一等座",
3684                     "seat_bookable": 1,
3685                     "seat_yupiao": 113
3686                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 17}]
3687             }, {
3688                 "train_no": "5l000G733780",
3689                 "train_number": "G7337",
3690                 "from_station": "上海虹橋",
3691                 "to_station": "杭州東",
3692                 "from_time": "15:32",
3693                 "to_time": "16:32",
3694                 "from_station_type": "起點",
3695                 "to_station_type": "途經",
3696                 "day_diff": "0",
3697                 "use_time": "60",
3698                 "sale_time": "13:30",
3699                 "control_day": 59,
3700                 "from_telecode": "AOH",
3701                 "to_telecode": "HGH",
3702                 "can_web_buy": "Y",
3703                 "note": "",
3704                 "seats": [{
3705                     "seat_price": "73.0",
3706                     "seat_name": "二等座",
3707                     "seat_bookable": 1,
3708                     "seat_yupiao": 638
3709                 }, {
3710                     "seat_price": "117.0",
3711                     "seat_name": "一等座",
3712                     "seat_bookable": 1,
3713                     "seat_yupiao": 43
3714                 }, {
3715                     "seat_price": "219.5",
3716                     "seat_name": "商務座",
3717                     "seat_bookable": 1,
3718                     "seat_yupiao": 18
3719                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3720             }, {
3721                 "train_no": "5l000G135921",
3722                 "train_number": "G1359",
3723                 "from_station": "上海虹橋",
3724                 "to_station": "杭州東",
3725                 "from_time": "15:37",
3726                 "to_time": "16:36",
3727                 "from_station_type": "起點",
3728                 "to_station_type": "途經",
3729                 "day_diff": "0",
3730                 "use_time": "59",
3731                 "sale_time": "13:30",
3732                 "control_day": 59,
3733                 "from_telecode": "AOH",
3734                 "to_telecode": "HGH",
3735                 "can_web_buy": "N",
3736                 "note": "",
3737                 "seats": [{
3738                     "seat_price": "73.0",
3739                     "seat_name": "二等座",
3740                     "seat_bookable": 1,
3741                     "seat_yupiao": 148
3742                 }, {
3743                     "seat_price": "117.0",
3744                     "seat_name": "一等座",
3745                     "seat_bookable": 1,
3746                     "seat_yupiao": 24
3747                 }, {"seat_price": "132.0", "seat_name": "特等座", "seat_bookable": 0, "seat_yupiao": 0}]
3748             }, {
3749                 "train_no": "550000K253A0",
3750                 "train_number": "K253",
3751                 "from_station": "上海南",
3752                 "to_station": "杭州東",
3753                 "from_time": "15:37",
3754                 "to_time": "17:45",
3755                 "from_station_type": "起點",
3756                 "to_station_type": "途經",
3757                 "day_diff": "0",
3758                 "use_time": "128",
3759                 "sale_time": "15:30",
3760                 "control_day": 59,
3761                 "from_telecode": "SNH",
3762                 "to_telecode": "HGH",
3763                 "can_web_buy": "Y",
3764                 "note": "",
3765                 "seats": [{
3766                     "seat_price": "24.5",
3767                     "seat_name": "硬座",
3768                     "seat_bookable": 1,
3769                     "seat_yupiao": 170
3770                 }, {
3771                     "seat_price": "70.5",
3772                     "seat_name": "硬臥上",
3773                     "seat_bookable": 1,
3774                     "seat_yupiao": 16
3775                 }, {
3776                     "seat_price": "73.5",
3777                     "seat_name": "硬臥中",
3778                     "seat_bookable": 1,
3779                     "seat_yupiao": 16
3780                 }, {
3781                     "seat_price": "80.0",
3782                     "seat_name": "硬臥下",
3783                     "seat_bookable": 1,
3784                     "seat_yupiao": 16
3785                 }, {
3786                     "seat_price": "108.5",
3787                     "seat_name": "軟臥上",
3788                     "seat_bookable": 0,
3789                     "seat_yupiao": 0
3790                 }, {
3791                     "seat_price": "122.5",
3792                     "seat_name": "軟臥下",
3793                     "seat_bookable": 0,
3794                     "seat_yupiao": 0
3795                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3796             }, {
3797                 "train_no": "5l000G751951",
3798                 "train_number": "G7519",
3799                 "from_station": "上海虹橋",
3800                 "to_station": "杭州東",
3801                 "from_time": "15:47",
3802                 "to_time": "16:47",
3803                 "from_station_type": "起點",
3804                 "to_station_type": "途經",
3805                 "day_diff": "0",
3806                 "use_time": "60",
3807                 "sale_time": "13:30",
3808                 "control_day": 59,
3809                 "from_telecode": "AOH",
3810                 "to_telecode": "HGH",
3811                 "can_web_buy": "Y",
3812                 "note": "",
3813                 "seats": [{
3814                     "seat_price": "73.0",
3815                     "seat_name": "二等座",
3816                     "seat_bookable": 1,
3817                     "seat_yupiao": 844
3818                 }, {
3819                     "seat_price": "117.0",
3820                     "seat_name": "一等座",
3821                     "seat_bookable": 1,
3822                     "seat_yupiao": 116
3823                 }, {
3824                     "seat_price": "219.5",
3825                     "seat_name": "商務座",
3826                     "seat_bookable": 1,
3827                     "seat_yupiao": 26
3828                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3829             }, {
3830                 "train_no": "5l000G754532",
3831                 "train_number": "G7545",
3832                 "from_station": "上海虹橋",
3833                 "to_station": "杭州東",
3834                 "from_time": "15:52",
3835                 "to_time": "16:51",
3836                 "from_station_type": "起點",
3837                 "to_station_type": "途經",
3838                 "day_diff": "0",
3839                 "use_time": "59",
3840                 "sale_time": "13:30",
3841                 "control_day": 59,
3842                 "from_telecode": "AOH",
3843                 "to_telecode": "HGH",
3844                 "can_web_buy": "Y",
3845                 "note": "",
3846                 "seats": [{
3847                     "seat_price": "73.0",
3848                     "seat_name": "二等座",
3849                     "seat_bookable": 1,
3850                     "seat_yupiao": 15
3851                 }, {
3852                     "seat_price": "117.0",
3853                     "seat_name": "一等座",
3854                     "seat_bookable": 1,
3855                     "seat_yupiao": 54
3856                 }, {
3857                     "seat_price": "219.5",
3858                     "seat_name": "商務座",
3859                     "seat_bookable": 1,
3860                     "seat_yupiao": 20
3861                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3862             }, {
3863                 "train_no": "5l000D310350",
3864                 "train_number": "D3103",
3865                 "from_station": "上海虹橋",
3866                 "to_station": "杭州東",
3867                 "from_time": "15:57",
3868                 "to_time": "16:58",
3869                 "from_station_type": "起點",
3870                 "to_station_type": "途經",
3871                 "day_diff": "0",
3872                 "use_time": "61",
3873                 "sale_time": "13:30",
3874                 "control_day": 59,
3875                 "from_telecode": "AOH",
3876                 "to_telecode": "HGH",
3877                 "can_web_buy": "Y",
3878                 "note": "",
3879                 "seats": [{
3880                     "seat_price": "49.0",
3881                     "seat_name": "二等座",
3882                     "seat_bookable": 1,
3883                     "seat_yupiao": 154
3884                 }, {
3885                     "seat_price": "59.0",
3886                     "seat_name": "一等座",
3887                     "seat_bookable": 1,
3888                     "seat_yupiao": 2
3889                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3890             }, {
3891                 "train_no": "550000K351B2",
3892                 "train_number": "K351",
3893                 "from_station": "上海南",
3894                 "to_station": "杭州東",
3895                 "from_time": "15:58",
3896                 "to_time": "18:11",
3897                 "from_station_type": "起點",
3898                 "to_station_type": "途經",
3899                 "day_diff": "0",
3900                 "use_time": "133",
3901                 "sale_time": "15:30",
3902                 "control_day": 59,
3903                 "from_telecode": "SNH",
3904                 "to_telecode": "HGH",
3905                 "can_web_buy": "Y",
3906                 "note": "",
3907                 "seats": [{
3908                     "seat_price": "24.5",
3909                     "seat_name": "硬座",
3910                     "seat_bookable": 1,
3911                     "seat_yupiao": 326
3912                 }, {
3913                     "seat_price": "70.5",
3914                     "seat_name": "硬臥上",
3915                     "seat_bookable": 1,
3916                     "seat_yupiao": 6
3917                 }, {
3918                     "seat_price": "73.5",
3919                     "seat_name": "硬臥中",
3920                     "seat_bookable": 1,
3921                     "seat_yupiao": 6
3922                 }, {
3923                     "seat_price": "80.0",
3924                     "seat_name": "硬臥下",
3925                     "seat_bookable": 1,
3926                     "seat_yupiao": 6
3927                 }, {
3928                     "seat_price": "108.5",
3929                     "seat_name": "軟臥上",
3930                     "seat_bookable": 0,
3931                     "seat_yupiao": 0
3932                 }, {
3933                     "seat_price": "122.5",
3934                     "seat_name": "軟臥下",
3935                     "seat_bookable": 0,
3936                     "seat_yupiao": 0
3937                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3938             }, {
3939                 "train_no": "5500000T8150",
3940                 "train_number": "T81",
3941                 "from_station": "上海南",
3942                 "to_station": "杭州東",
3943                 "from_time": "16:06",
3944                 "to_time": "17:58",
3945                 "from_station_type": "起點",
3946                 "to_station_type": "途經",
3947                 "day_diff": "0",
3948                 "use_time": "112",
3949                 "sale_time": "15:00",
3950                 "control_day": 57,
3951                 "from_telecode": "SNH",
3952                 "to_telecode": "HGH",
3953                 "can_web_buy": "Y",
3954                 "note": "",
3955                 "seats": [{
3956                     "seat_price": "24.5",
3957                     "seat_name": "硬座",
3958                     "seat_bookable": 1,
3959                     "seat_yupiao": 113
3960                 }, {
3961                     "seat_price": "70.5",
3962                     "seat_name": "硬臥上",
3963                     "seat_bookable": 1,
3964                     "seat_yupiao": 7
3965                 }, {
3966                     "seat_price": "73.5",
3967                     "seat_name": "硬臥中",
3968                     "seat_bookable": 1,
3969                     "seat_yupiao": 7
3970                 }, {
3971                     "seat_price": "80.0",
3972                     "seat_name": "硬臥下",
3973                     "seat_bookable": 1,
3974                     "seat_yupiao": 7
3975                 }, {
3976                     "seat_price": "108.5",
3977                     "seat_name": "軟臥上",
3978                     "seat_bookable": 0,
3979                     "seat_yupiao": 0
3980                 }, {
3981                     "seat_price": "122.5",
3982                     "seat_name": "軟臥下",
3983                     "seat_bookable": 0,
3984                     "seat_yupiao": 0
3985                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
3986             }, {
3987                 "train_no": "5l000G736510",
3988                 "train_number": "G7365",
3989                 "from_station": "上海虹橋",
3990                 "to_station": "杭州東",
3991                 "from_time": "16:07",
3992                 "to_time": "17:03",
3993                 "from_station_type": "起點",
3994                 "to_station_type": "途經",
3995                 "day_diff": "0",
3996                 "use_time": "56",
3997                 "sale_time": "13:30",
3998                 "control_day": 59,
3999                 "from_telecode": "AOH",
4000                 "to_telecode": "HGH",
4001                 "can_web_buy": "Y",
4002                 "note": "",
4003                 "seats": [{
4004                     "seat_price": "73.0",
4005                     "seat_name": "二等座",
4006                     "seat_bookable": 1,
4007                     "seat_yupiao": 128
4008                 }, {
4009                     "seat_price": "117.0",
4010                     "seat_name": "一等座",
4011                     "seat_bookable": 1,
4012                     "seat_yupiao": 54
4013                 }, {
4014                     "seat_price": "219.5",
4015                     "seat_name": "商務座",
4016                     "seat_bookable": 1,
4017                     "seat_yupiao": 20
4018                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4019             }, {
4020                 "train_no": "53000G757120",
4021                 "train_number": "G7571",
4022                 "from_station": "上海虹橋",
4023                 "to_station": "杭州東",
4024                 "from_time": "16:12",
4025                 "to_time": "17:12",
4026                 "from_station_type": "途經",
4027                 "to_station_type": "途經",
4028                 "day_diff": "0",
4029                 "use_time": "60",
4030                 "sale_time": "13:30",
4031                 "control_day": 59,
4032                 "from_telecode": "AOH",
4033                 "to_telecode": "HGH",
4034                 "can_web_buy": "Y",
4035                 "note": "",
4036                 "seats": [{
4037                     "seat_price": "73.0",
4038                     "seat_name": "二等座",
4039                     "seat_bookable": 1,
4040                     "seat_yupiao": 396
4041                 }, {
4042                     "seat_price": "117.0",
4043                     "seat_name": "一等座",
4044                     "seat_bookable": 1,
4045                     "seat_yupiao": 45
4046                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4047             }, {
4048                 "train_no": "5l000G139121",
4049                 "train_number": "G1391",
4050                 "from_station": "上海虹橋",
4051                 "to_station": "杭州東",
4052                 "from_time": "16:27",
4053                 "to_time": "17:28",
4054                 "from_station_type": "起點",
4055                 "to_station_type": "途經",
4056                 "day_diff": "0",
4057                 "use_time": "61",
4058                 "sale_time": "13:30",
4059                 "control_day": 59,
4060                 "from_telecode": "AOH",
4061                 "to_telecode": "HGH",
4062                 "can_web_buy": "Y",
4063                 "note": "",
4064                 "seats": [{
4065                     "seat_price": "73.0",
4066                     "seat_name": "二等座",
4067                     "seat_bookable": 1,
4068                     "seat_yupiao": 261
4069                 }, {
4070                     "seat_price": "117.0",
4071                     "seat_name": "一等座",
4072                     "seat_bookable": 1,
4073                     "seat_yupiao": 14
4074                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 9}]
4075             }, {
4076                 "train_no": "5l000G7309B0",
4077                 "train_number": "G7309",
4078                 "from_station": "上海虹橋",
4079                 "to_station": "杭州",
4080                 "from_time": "16:32",
4081                 "to_time": "17:44",
4082                 "from_station_type": "起點",
4083                 "to_station_type": "終點",
4084                 "day_diff": "0",
4085                 "use_time": "72",
4086                 "sale_time": "13:30",
4087                 "control_day": 59,
4088                 "from_telecode": "AOH",
4089                 "to_telecode": "HZH",
4090                 "can_web_buy": "Y",
4091                 "note": "",
4092                 "seats": [{
4093                     "seat_price": "77.5",
4094                     "seat_name": "二等座",
4095                     "seat_bookable": 1,
4096                     "seat_yupiao": 450
4097                 }, {
4098                     "seat_price": "123.5",
4099                     "seat_name": "一等座",
4100                     "seat_bookable": 1,
4101                     "seat_yupiao": 20
4102                 }, {
4103                     "seat_price": "233.5",
4104                     "seat_name": "商務座",
4105                     "seat_bookable": 1,
4106                     "seat_yupiao": 10
4107                 }, {"seat_price": "77.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4108             }, {
4109                 "train_no": "5l000G136120",
4110                 "train_number": "G1361",
4111                 "from_station": "上海虹橋",
4112                 "to_station": "杭州東",
4113                 "from_time": "16:42",
4114                 "to_time": "17:41",
4115                 "from_station_type": "起點",
4116                 "to_station_type": "途經",
4117                 "day_diff": "0",
4118                 "use_time": "59",
4119                 "sale_time": "13:30",
4120                 "control_day": 59,
4121                 "from_telecode": "AOH",
4122                 "to_telecode": "HGH",
4123                 "can_web_buy": "Y",
4124                 "note": "",
4125                 "seats": [{
4126                     "seat_price": "73.0",
4127                     "seat_name": "二等座",
4128                     "seat_bookable": 1,
4129                     "seat_yupiao": 255
4130                 }, {
4131                     "seat_price": "117.0",
4132                     "seat_name": "一等座",
4133                     "seat_bookable": 1,
4134                     "seat_yupiao": 16
4135                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 2}]
4136             }, {
4137                 "train_no": "5l000G752174",
4138                 "train_number": "G7521",
4139                 "from_station": "上海虹橋",
4140                 "to_station": "杭州東",
4141                 "from_time": "16:47",
4142                 "to_time": "17:53",
4143                 "from_station_type": "起點",
4144                 "to_station_type": "途經",
4145                 "day_diff": "0",
4146                 "use_time": "66",
4147                 "sale_time": "13:30",
4148                 "control_day": 59,
4149                 "from_telecode": "AOH",
4150                 "to_telecode": "HGH",
4151                 "can_web_buy": "Y",
4152                 "note": "",
4153                 "seats": [{
4154                     "seat_price": "73.0",
4155                     "seat_name": "二等座",
4156                     "seat_bookable": 1,
4157                     "seat_yupiao": 125
4158                 }, {
4159                     "seat_price": "117.0",
4160                     "seat_name": "一等座",
4161                     "seat_bookable": 1,
4162                     "seat_yupiao": 5
4163                 }, {
4164                     "seat_price": "219.5",
4165                     "seat_name": "商務座",
4166                     "seat_bookable": 1,
4167                     "seat_yupiao": 25
4168                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4169             }, {
4170                 "train_no": "55000K137303",
4171                 "train_number": "K1373",
4172                 "from_station": "上海南",
4173                 "to_station": "杭州東",
4174                 "from_time": "16:49",
4175                 "to_time": "19:10",
4176                 "from_station_type": "起點",
4177                 "to_station_type": "途經",
4178                 "day_diff": "0",
4179                 "use_time": "141",
4180                 "sale_time": "15:30",
4181                 "control_day": 59,
4182                 "from_telecode": "SNH",
4183                 "to_telecode": "HGH",
4184                 "can_web_buy": "Y",
4185                 "note": "",
4186                 "seats": [{
4187                     "seat_price": "24.5",
4188                     "seat_name": "硬座",
4189                     "seat_bookable": 1,
4190                     "seat_yupiao": 317
4191                 }, {
4192                     "seat_price": "70.5",
4193                     "seat_name": "硬臥上",
4194                     "seat_bookable": 1,
4195                     "seat_yupiao": 5
4196                 }, {
4197                     "seat_price": "73.5",
4198                     "seat_name": "硬臥中",
4199                     "seat_bookable": 1,
4200                     "seat_yupiao": 5
4201                 }, {
4202                     "seat_price": "80.0",
4203                     "seat_name": "硬臥下",
4204                     "seat_bookable": 1,
4205                     "seat_yupiao": 5
4206                 }, {
4207                     "seat_price": "108.5",
4208                     "seat_name": "軟臥上",
4209                     "seat_bookable": 0,
4210                     "seat_yupiao": 0
4211                 }, {
4212                     "seat_price": "122.5",
4213                     "seat_name": "軟臥下",
4214                     "seat_bookable": 0,
4215                     "seat_yupiao": 0
4216                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4217             }, {
4218                 "train_no": "550000T38120",
4219                 "train_number": "T381",
4220                 "from_station": "上海南",
4221                 "to_station": "杭州東",
4222                 "from_time": "16:55",
4223                 "to_time": "18:44",
4224                 "from_station_type": "起點",
4225                 "to_station_type": "途經",
4226                 "day_diff": "0",
4227                 "use_time": "109",
4228                 "sale_time": "15:30",
4229                 "control_day": 59,
4230                 "from_telecode": "SNH",
4231                 "to_telecode": "HGH",
4232                 "can_web_buy": "Y",
4233                 "note": "",
4234                 "seats": [{
4235                     "seat_price": "24.5",
4236                     "seat_name": "硬座",
4237                     "seat_bookable": 1,
4238                     "seat_yupiao": 68
4239                 }, {
4240                     "seat_price": "70.5",
4241                     "seat_name": "硬臥上",
4242                     "seat_bookable": 0,
4243                     "seat_yupiao": 0
4244                 }, {
4245                     "seat_price": "73.5",
4246                     "seat_name": "硬臥中",
4247                     "seat_bookable": 0,
4248                     "seat_yupiao": 0
4249                 }, {
4250                     "seat_price": "80.0",
4251                     "seat_name": "硬臥下",
4252                     "seat_bookable": 0,
4253                     "seat_yupiao": 0
4254                 }, {
4255                     "seat_price": "108.5",
4256                     "seat_name": "軟臥上",
4257                     "seat_bookable": 0,
4258                     "seat_yupiao": 0
4259                 }, {
4260                     "seat_price": "122.5",
4261                     "seat_name": "軟臥下",
4262                     "seat_bookable": 0,
4263                     "seat_yupiao": 0
4264                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4265             }, {
4266                 "train_no": "550000K27172",
4267                 "train_number": "K271",
4268                 "from_station": "上海南",
4269                 "to_station": "杭州東",
4270                 "from_time": "17:01",
4271                 "to_time": "19:23",
4272                 "from_station_type": "起點",
4273                 "to_station_type": "途經",
4274                 "day_diff": "0",
4275                 "use_time": "142",
4276                 "sale_time": "15:00",
4277                 "control_day": 57,
4278                 "from_telecode": "SNH",
4279                 "to_telecode": "HGH",
4280                 "can_web_buy": "Y",
4281                 "note": "",
4282                 "seats": [{
4283                     "seat_price": "24.5",
4284                     "seat_name": "硬座",
4285                     "seat_bookable": 1,
4286                     "seat_yupiao": 293
4287                 }, {
4288                     "seat_price": "70.5",
4289                     "seat_name": "硬臥上",
4290                     "seat_bookable": 0,
4291                     "seat_yupiao": 0
4292                 }, {
4293                     "seat_price": "73.5",
4294                     "seat_name": "硬臥中",
4295                     "seat_bookable": 0,
4296                     "seat_yupiao": 0
4297                 }, {
4298                     "seat_price": "80.0",
4299                     "seat_name": "硬臥下",
4300                     "seat_bookable": 0,
4301                     "seat_yupiao": 0
4302                 }, {
4303                     "seat_price": "108.5",
4304                     "seat_name": "軟臥上",
4305                     "seat_bookable": 0,
4306                     "seat_yupiao": 0
4307                 }, {
4308                     "seat_price": "122.5",
4309                     "seat_name": "軟臥下",
4310                     "seat_bookable": 0,
4311                     "seat_yupiao": 0
4312                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4313             }, {
4314                 "train_no": "5i000G756611",
4315                 "train_number": "G7563",
4316                 "from_station": "上海虹橋",
4317                 "to_station": "杭州東",
4318                 "from_time": "17:05",
4319                 "to_time": "18:06",
4320                 "from_station_type": "途經",
4321                 "to_station_type": "終點",
4322                 "day_diff": "0",
4323                 "use_time": "61",
4324                 "sale_time": "13:30",
4325                 "control_day": 59,
4326                 "from_telecode": "AOH",
4327                 "to_telecode": "HGH",
4328                 "can_web_buy": "Y",
4329                 "note": "",
4330                 "seats": [{
4331                     "seat_price": "73.0",
4332                     "seat_name": "二等座",
4333                     "seat_bookable": 1,
4334                     "seat_yupiao": 1
4335                 }, {
4336                     "seat_price": "117.0",
4337                     "seat_name": "一等座",
4338                     "seat_bookable": 1,
4339                     "seat_yupiao": 2
4340                 }, {
4341                     "seat_price": "219.5",
4342                     "seat_name": "商務座",
4343                     "seat_bookable": 0,
4344                     "seat_yupiao": 0
4345                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4346             }, {
4347                 "train_no": "550000Z25701",
4348                 "train_number": "Z257",
4349                 "from_station": "上海南",
4350                 "to_station": "杭州東",
4351                 "from_time": "17:14",
4352                 "to_time": "18:57",
4353                 "from_station_type": "起點",
4354                 "to_station_type": "途經",
4355                 "day_diff": "0",
4356                 "use_time": "103",
4357                 "sale_time": "15:30",
4358                 "control_day": 59,
4359                 "from_telecode": "SNH",
4360                 "to_telecode": "HGH",
4361                 "can_web_buy": "N",
4362                 "note": "",
4363                 "seats": [{
4364                     "seat_price": "70.5",
4365                     "seat_name": "硬臥上",
4366                     "seat_bookable": 1,
4367                     "seat_yupiao": 17
4368                 }, {
4369                     "seat_price": "73.5",
4370                     "seat_name": "硬臥中",
4371                     "seat_bookable": 1,
4372                     "seat_yupiao": 17
4373                 }, {
4374                     "seat_price": "80.0",
4375                     "seat_name": "硬臥下",
4376                     "seat_bookable": 1,
4377                     "seat_yupiao": 17
4378                 }, {
4379                     "seat_price": "108.5",
4380                     "seat_name": "軟臥上",
4381                     "seat_bookable": 1,
4382                     "seat_yupiao": 6
4383                 }, {"seat_price": "122.5", "seat_name": "軟臥下", "seat_bookable": 1, "seat_yupiao": 6}]
4384             }, {
4385                 "train_no": "54000G758560",
4386                 "train_number": "G7585",
4387                 "from_station": "上海虹橋",
4388                 "to_station": "杭州東",
4389                 "from_time": "17:14",
4390                 "to_time": "18:14",
4391                 "from_station_type": "途經",
4392                 "to_station_type": "途經",
4393                 "day_diff": "0",
4394                 "use_time": "60",
4395                 "sale_time": "13:30",
4396                 "control_day": 59,
4397                 "from_telecode": "AOH",
4398                 "to_telecode": "HGH",
4399                 "can_web_buy": "Y",
4400                 "note": "",
4401                 "seats": [{
4402                     "seat_price": "73.0",
4403                     "seat_name": "二等座",
4404                     "seat_bookable": 1,
4405                     "seat_yupiao": 504
4406                 }, {
4407                     "seat_price": "117.0",
4408                     "seat_name": "一等座",
4409                     "seat_bookable": 1,
4410                     "seat_yupiao": 29
4411                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4412             }, {
4413                 "train_no": "5l000G136331",
4414                 "train_number": "G1363",
4415                 "from_station": "上海虹橋",
4416                 "to_station": "杭州東",
4417                 "from_time": "17:19",
4418                 "to_time": "18:19",
4419                 "from_station_type": "起點",
4420                 "to_station_type": "途經",
4421                 "day_diff": "0",
4422                 "use_time": "60",
4423                 "sale_time": "13:30",
4424                 "control_day": 57,
4425                 "from_telecode": "AOH",
4426                 "to_telecode": "HGH",
4427                 "can_web_buy": "N",
4428                 "note": "",
4429                 "seats": [{
4430                     "seat_price": "73.0",
4431                     "seat_name": "二等座",
4432                     "seat_bookable": 1,
4433                     "seat_yupiao": 191
4434                 }, {
4435                     "seat_price": "117.0",
4436                     "seat_name": "一等座",
4437                     "seat_bookable": 1,
4438                     "seat_yupiao": 24
4439                 }, {"seat_price": "132.0", "seat_name": "特等座", "seat_bookable": 0, "seat_yupiao": 0}]
4440             }, {
4441                 "train_no": "550000K46951",
4442                 "train_number": "K469",
4443                 "from_station": "上海南",
4444                 "to_station": "杭州東",
4445                 "from_time": "17:20",
4446                 "to_time": "19:42",
4447                 "from_station_type": "途經",
4448                 "to_station_type": "途經",
4449                 "day_diff": "0",
4450                 "use_time": "142",
4451                 "sale_time": "15:30",
4452                 "control_day": 59,
4453                 "from_telecode": "SNH",
4454                 "to_telecode": "HGH",
4455                 "can_web_buy": "Y",
4456                 "note": "",
4457                 "seats": [{
4458                     "seat_price": "24.5",
4459                     "seat_name": "硬座",
4460                     "seat_bookable": 1,
4461                     "seat_yupiao": 1
4462                 }, {
4463                     "seat_price": "70.5",
4464                     "seat_name": "硬臥上",
4465                     "seat_bookable": 0,
4466                     "seat_yupiao": 0
4467                 }, {
4468                     "seat_price": "73.5",
4469                     "seat_name": "硬臥中",
4470                     "seat_bookable": 0,
4471                     "seat_yupiao": 0
4472                 }, {
4473                     "seat_price": "80.0",
4474                     "seat_name": "硬臥下",
4475                     "seat_bookable": 0,
4476                     "seat_yupiao": 0
4477                 }, {
4478                     "seat_price": "108.5",
4479                     "seat_name": "軟臥上",
4480                     "seat_bookable": 0,
4481                     "seat_yupiao": 0
4482                 }, {
4483                     "seat_price": "122.5",
4484                     "seat_name": "軟臥下",
4485                     "seat_bookable": 0,
4486                     "seat_yupiao": 0
4487                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4488             }, {
4489                 "train_no": "5l000G163911",
4490                 "train_number": "G1639",
4491                 "from_station": "上海虹橋",
4492                 "to_station": "杭州東",
4493                 "from_time": "17:24",
4494                 "to_time": "18:23",
4495                 "from_station_type": "起點",
4496                 "to_station_type": "途經",
4497                 "day_diff": "0",
4498                 "use_time": "59",
4499                 "sale_time": "13:30",
4500                 "control_day": 59,
4501                 "from_telecode": "AOH",
4502                 "to_telecode": "HGH",
4503                 "can_web_buy": "Y",
4504                 "note": "",
4505                 "seats": [{
4506                     "seat_price": "73.0",
4507                     "seat_name": "二等座",
4508                     "seat_bookable": 1,
4509                     "seat_yupiao": 58
4510                 }, {
4511                     "seat_price": "117.0",
4512                     "seat_name": "一等座",
4513                     "seat_bookable": 0,
4514                     "seat_yupiao": 0
4515                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 2}]
4516             }, {
4517                 "train_no": "5l000G7311B1",
4518                 "train_number": "G7311",
4519                 "from_station": "上海虹橋",
4520                 "to_station": "杭州",
4521                 "from_time": "17:29",
4522                 "to_time": "18:41",
4523                 "from_station_type": "起點",
4524                 "to_station_type": "終點",
4525                 "day_diff": "0",
4526                 "use_time": "72",
4527                 "sale_time": "13:30",
4528                 "control_day": 59,
4529                 "from_telecode": "AOH",
4530                 "to_telecode": "HZH",
4531                 "can_web_buy": "Y",
4532                 "note": "",
4533                 "seats": [{
4534                     "seat_price": "77.5",
4535                     "seat_name": "二等座",
4536                     "seat_bookable": 1,
4537                     "seat_yupiao": 463
4538                 }, {
4539                     "seat_price": "123.5",
4540                     "seat_name": "一等座",
4541                     "seat_bookable": 1,
4542                     "seat_yupiao": 26
4543                 }, {
4544                     "seat_price": "233.5",
4545                     "seat_name": "商務座",
4546                     "seat_bookable": 1,
4547                     "seat_yupiao": 10
4548                 }, {"seat_price": "77.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4549             }, {
4550                 "train_no": "5i000G738810",
4551                 "train_number": "G7385",
4552                 "from_station": "上海虹橋",
4553                 "to_station": "杭州東",
4554                 "from_time": "17:34",
4555                 "to_time": "18:54",
4556                 "from_station_type": "途經",
4557                 "to_station_type": "途經",
4558                 "day_diff": "0",
4559                 "use_time": "80",
4560                 "sale_time": "13:30",
4561                 "control_day": 59,
4562                 "from_telecode": "AOH",
4563                 "to_telecode": "HGH",
4564                 "can_web_buy": "Y",
4565                 "note": "",
4566                 "seats": [{
4567                     "seat_price": "73.0",
4568                     "seat_name": "二等座",
4569                     "seat_bookable": 1,
4570                     "seat_yupiao": 207
4571                 }, {
4572                     "seat_price": "117.0",
4573                     "seat_name": "一等座",
4574                     "seat_bookable": 1,
4575                     "seat_yupiao": 133
4576                 }, {
4577                     "seat_price": "219.5",
4578                     "seat_name": "商務座",
4579                     "seat_bookable": 1,
4580                     "seat_yupiao": 26
4581                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4582             }, {
4583                 "train_no": "5l000G136521",
4584                 "train_number": "G1365",
4585                 "from_station": "上海虹橋",
4586                 "to_station": "杭州東",
4587                 "from_time": "17:40",
4588                 "to_time": "18:40",
4589                 "from_station_type": "起點",
4590                 "to_station_type": "途經",
4591                 "day_diff": "0",
4592                 "use_time": "60",
4593                 "sale_time": "13:30",
4594                 "control_day": 59,
4595                 "from_telecode": "AOH",
4596                 "to_telecode": "HGH",
4597                 "can_web_buy": "Y",
4598                 "note": "",
4599                 "seats": [{
4600                     "seat_price": "73.0",
4601                     "seat_name": "二等座",
4602                     "seat_bookable": 1,
4603                     "seat_yupiao": 135
4604                 }, {
4605                     "seat_price": "117.0",
4606                     "seat_name": "一等座",
4607                     "seat_bookable": 1,
4608                     "seat_yupiao": 24
4609                 }, {"seat_price": "132.0", "seat_name": "特等座", "seat_bookable": 0, "seat_yupiao": 0}]
4610             }, {
4611                 "train_no": "5l000G139330",
4612                 "train_number": "G1393",
4613                 "from_station": "上海虹橋",
4614                 "to_station": "杭州東",
4615                 "from_time": "17:47",
4616                 "to_time": "18:49",
4617                 "from_station_type": "起點",
4618                 "to_station_type": "途經",
4619                 "day_diff": "0",
4620                 "use_time": "62",
4621                 "sale_time": "13:30",
4622                 "control_day": 59,
4623                 "from_telecode": "AOH",
4624                 "to_telecode": "HGH",
4625                 "can_web_buy": "Y",
4626                 "note": "",
4627                 "seats": [{
4628                     "seat_price": "73.0",
4629                     "seat_name": "二等座",
4630                     "seat_bookable": 1,
4631                     "seat_yupiao": 222
4632                 }, {
4633                     "seat_price": "117.0",
4634                     "seat_name": "一等座",
4635                     "seat_bookable": 1,
4636                     "seat_yupiao": 16
4637                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 5}]
4638             }, {
4639                 "train_no": "5500000T2520",
4640                 "train_number": "T25",
4641                 "from_station": "上海南",
4642                 "to_station": "杭州東",
4643                 "from_time": "17:49",
4644                 "to_time": "19:55",
4645                 "from_station_type": "起點",
4646                 "to_station_type": "途經",
4647                 "day_diff": "0",
4648                 "use_time": "126",
4649                 "sale_time": "15:30",
4650                 "control_day": 59,
4651                 "from_telecode": "SNH",
4652                 "to_telecode": "HGH",
4653                 "can_web_buy": "Y",
4654                 "note": "",
4655                 "seats": [{
4656                     "seat_price": "24.5",
4657                     "seat_name": "硬座",
4658                     "seat_bookable": 0,
4659                     "seat_yupiao": 0
4660                 }, {
4661                     "seat_price": "70.5",
4662                     "seat_name": "硬臥上",
4663                     "seat_bookable": 1,
4664                     "seat_yupiao": 23
4665                 }, {
4666                     "seat_price": "73.5",
4667                     "seat_name": "硬臥中",
4668                     "seat_bookable": 1,
4669                     "seat_yupiao": 23
4670                 }, {
4671                     "seat_price": "80.0",
4672                     "seat_name": "硬臥下",
4673                     "seat_bookable": 1,
4674                     "seat_yupiao": 23
4675                 }, {
4676                     "seat_price": "108.5",
4677                     "seat_name": "軟臥上",
4678                     "seat_bookable": 0,
4679                     "seat_yupiao": 0
4680                 }, {
4681                     "seat_price": "122.5",
4682                     "seat_name": "軟臥下",
4683                     "seat_bookable": 0,
4684                     "seat_yupiao": 0
4685                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4686             }, {
4687                 "train_no": "55000G735900",
4688                 "train_number": "G7359",
4689                 "from_station": "上海",
4690                 "to_station": "杭州",
4691                 "from_time": "17:54",
4692                 "to_time": "19:32",
4693                 "from_station_type": "起點",
4694                 "to_station_type": "終點",
4695                 "day_diff": "0",
4696                 "use_time": "98",
4697                 "sale_time": "14:30",
4698                 "control_day": 59,
4699                 "from_telecode": "SHH",
4700                 "to_telecode": "HZH",
4701                 "can_web_buy": "Y",
4702                 "note": "",
4703                 "seats": [{
4704                     "seat_price": "92.5",
4705                     "seat_name": "二等座",
4706                     "seat_bookable": 1,
4707                     "seat_yupiao": 987
4708                 }, {
4709                     "seat_price": "147.5",
4710                     "seat_name": "一等座",
4711                     "seat_bookable": 1,
4712                     "seat_yupiao": 54
4713                 }, {
4714                     "seat_price": "278.5",
4715                     "seat_name": "商務座",
4716                     "seat_bookable": 1,
4717                     "seat_yupiao": 20
4718                 }, {"seat_price": "92.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4719             }, {
4720                 "train_no": "5l000G75250B",
4721                 "train_number": "G7525",
4722                 "from_station": "上海虹橋",
4723                 "to_station": "杭州東",
4724                 "from_time": "17:59",
4725                 "to_time": "19:00",
4726                 "from_station_type": "起點",
4727                 "to_station_type": "途經",
4728                 "day_diff": "0",
4729                 "use_time": "61",
4730                 "sale_time": "13:30",
4731                 "control_day": 59,
4732                 "from_telecode": "AOH",
4733                 "to_telecode": "HGH",
4734                 "can_web_buy": "Y",
4735                 "note": "",
4736                 "seats": [{
4737                     "seat_price": "73.0",
4738                     "seat_name": "二等座",
4739                     "seat_bookable": 1,
4740                     "seat_yupiao": 632
4741                 }, {
4742                     "seat_price": "117.0",
4743                     "seat_name": "一等座",
4744                     "seat_bookable": 1,
4745                     "seat_yupiao": 50
4746                 }, {
4747                     "seat_price": "219.5",
4748                     "seat_name": "商務座",
4749                     "seat_bookable": 1,
4750                     "seat_yupiao": 20
4751                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4752             }, {
4753                 "train_no": "5l000G7391A1",
4754                 "train_number": "G7391",
4755                 "from_station": "上海虹橋",
4756                 "to_station": "杭州",
4757                 "from_time": "18:04",
4758                 "to_time": "19:17",
4759                 "from_station_type": "起點",
4760                 "to_station_type": "途經",
4761                 "day_diff": "0",
4762                 "use_time": "73",
4763                 "sale_time": "13:30",
4764                 "control_day": 59,
4765                 "from_telecode": "AOH",
4766                 "to_telecode": "HZH",
4767                 "can_web_buy": "Y",
4768                 "note": "",
4769                 "seats": [{
4770                     "seat_price": "77.5",
4771                     "seat_name": "二等座",
4772                     "seat_bookable": 1,
4773                     "seat_yupiao": 860
4774                 }, {
4775                     "seat_price": "123.5",
4776                     "seat_name": "一等座",
4777                     "seat_bookable": 1,
4778                     "seat_yupiao": 114
4779                 }, {
4780                     "seat_price": "233.5",
4781                     "seat_name": "商務座",
4782                     "seat_bookable": 1,
4783                     "seat_yupiao": 26
4784                 }, {"seat_price": "77.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4785             }, {
4786                 "train_no": "5i000G737421",
4787                 "train_number": "G7371",
4788                 "from_station": "上海虹橋",
4789                 "to_station": "杭州東",
4790                 "from_time": "18:14",
4791                 "to_time": "19:15",
4792                 "from_station_type": "途經",
4793                 "to_station_type": "途經",
4794                 "day_diff": "0",
4795                 "use_time": "61",
4796                 "sale_time": "13:30",
4797                 "control_day": 59,
4798                 "from_telecode": "AOH",
4799                 "to_telecode": "HGH",
4800                 "can_web_buy": "Y",
4801                 "note": "",
4802                 "seats": [{
4803                     "seat_price": "73.0",
4804                     "seat_name": "二等座",
4805                     "seat_bookable": 1,
4806                     "seat_yupiao": 81
4807                 }, {
4808                     "seat_price": "117.0",
4809                     "seat_name": "一等座",
4810                     "seat_bookable": 1,
4811                     "seat_yupiao": 137
4812                 }, {
4813                     "seat_price": "219.5",
4814                     "seat_name": "商務座",
4815                     "seat_bookable": 1,
4816                     "seat_yupiao": 26
4817                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4818             }, {
4819                 "train_no": "540000K52520",
4820                 "train_number": "K525",
4821                 "from_station": "上海南",
4822                 "to_station": "杭州東",
4823                 "from_time": "18:20",
4824                 "to_time": "20:19",
4825                 "from_station_type": "途經",
4826                 "to_station_type": "途經",
4827                 "day_diff": "0",
4828                 "use_time": "119",
4829                 "sale_time": "15:30",
4830                 "control_day": 59,
4831                 "from_telecode": "SNH",
4832                 "to_telecode": "HGH",
4833                 "can_web_buy": "Y",
4834                 "note": "",
4835                 "seats": [{
4836                     "seat_price": "24.5",
4837                     "seat_name": "硬座",
4838                     "seat_bookable": 1,
4839                     "seat_yupiao": 6
4840                 }, {
4841                     "seat_price": "70.5",
4842                     "seat_name": "硬臥上",
4843                     "seat_bookable": 0,
4844                     "seat_yupiao": 0
4845                 }, {
4846                     "seat_price": "73.5",
4847                     "seat_name": "硬臥中",
4848                     "seat_bookable": 0,
4849                     "seat_yupiao": 0
4850                 }, {
4851                     "seat_price": "80.0",
4852                     "seat_name": "硬臥下",
4853                     "seat_bookable": 0,
4854                     "seat_yupiao": 0
4855                 }, {
4856                     "seat_price": "108.5",
4857                     "seat_name": "軟臥上",
4858                     "seat_bookable": 0,
4859                     "seat_yupiao": 0
4860                 }, {
4861                     "seat_price": "122.5",
4862                     "seat_name": "軟臥下",
4863                     "seat_bookable": 0,
4864                     "seat_yupiao": 0
4865                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 30}]
4866             }, {
4867                 "train_no": "550000K18162",
4868                 "train_number": "K181",
4869                 "from_station": "上海南",
4870                 "to_station": "杭州",
4871                 "from_time": "18:26",
4872                 "to_time": "20:32",
4873                 "from_station_type": "起點",
4874                 "to_station_type": "途經",
4875                 "day_diff": "0",
4876                 "use_time": "126",
4877                 "sale_time": "15:30",
4878                 "control_day": 59,
4879                 "from_telecode": "SNH",
4880                 "to_telecode": "HZH",
4881                 "can_web_buy": "Y",
4882                 "note": "",
4883                 "seats": [{
4884                     "seat_price": "28.5",
4885                     "seat_name": "硬座",
4886                     "seat_bookable": 0,
4887                     "seat_yupiao": 0
4888                 }, {
4889                     "seat_price": "74.5",
4890                     "seat_name": "硬臥上",
4891                     "seat_bookable": 0,
4892                     "seat_yupiao": 0
4893                 }, {
4894                     "seat_price": "77.5",
4895                     "seat_name": "硬臥中",
4896                     "seat_bookable": 0,
4897                     "seat_yupiao": 0
4898                 }, {
4899                     "seat_price": "84.5",
4900                     "seat_name": "硬臥下",
4901                     "seat_bookable": 0,
4902                     "seat_yupiao": 0
4903                 }, {
4904                     "seat_price": "112.5",
4905                     "seat_name": "軟臥上",
4906                     "seat_bookable": 0,
4907                     "seat_yupiao": 0
4908                 }, {
4909                     "seat_price": "127.0",
4910                     "seat_name": "軟臥下",
4911                     "seat_bookable": 0,
4912                     "seat_yupiao": 0
4913                 }, {"seat_price": "28.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4914             }, {
4915                 "train_no": "5l000G139510",
4916                 "train_number": "G1395",
4917                 "from_station": "上海虹橋",
4918                 "to_station": "杭州東",
4919                 "from_time": "18:30",
4920                 "to_time": "19:29",
4921                 "from_station_type": "起點",
4922                 "to_station_type": "途經",
4923                 "day_diff": "0",
4924                 "use_time": "59",
4925                 "sale_time": "13:30",
4926                 "control_day": 59,
4927                 "from_telecode": "AOH",
4928                 "to_telecode": "HGH",
4929                 "can_web_buy": "Y",
4930                 "note": "",
4931                 "seats": [{
4932                     "seat_price": "73.0",
4933                     "seat_name": "二等座",
4934                     "seat_bookable": 1,
4935                     "seat_yupiao": 750
4936                 }, {
4937                     "seat_price": "117.0",
4938                     "seat_name": "一等座",
4939                     "seat_bookable": 1,
4940                     "seat_yupiao": 27
4941                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 10}]
4942             }, {
4943                 "train_no": "5500000K79B3",
4944                 "train_number": "K79",
4945                 "from_station": "上海南",
4946                 "to_station": "杭州東",
4947                 "from_time": "18:34",
4948                 "to_time": "20:46",
4949                 "from_station_type": "起點",
4950                 "to_station_type": "途經",
4951                 "day_diff": "0",
4952                 "use_time": "132",
4953                 "sale_time": "15:00",
4954                 "control_day": 57,
4955                 "from_telecode": "SNH",
4956                 "to_telecode": "HGH",
4957                 "can_web_buy": "Y",
4958                 "note": "",
4959                 "seats": [{
4960                     "seat_price": "24.5",
4961                     "seat_name": "硬座",
4962                     "seat_bookable": 1,
4963                     "seat_yupiao": 209
4964                 }, {
4965                     "seat_price": "70.5",
4966                     "seat_name": "硬臥上",
4967                     "seat_bookable": 0,
4968                     "seat_yupiao": 0
4969                 }, {
4970                     "seat_price": "73.5",
4971                     "seat_name": "硬臥中",
4972                     "seat_bookable": 0,
4973                     "seat_yupiao": 0
4974                 }, {
4975                     "seat_price": "80.0",
4976                     "seat_name": "硬臥下",
4977                     "seat_bookable": 0,
4978                     "seat_yupiao": 0
4979                 }, {
4980                     "seat_price": "108.5",
4981                     "seat_name": "軟臥上",
4982                     "seat_bookable": 0,
4983                     "seat_yupiao": 0
4984                 }, {
4985                     "seat_price": "122.5",
4986                     "seat_name": "軟臥下",
4987                     "seat_bookable": 0,
4988                     "seat_yupiao": 0
4989                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
4990             }, {
4991                 "train_no": "5l000G733950",
4992                 "train_number": "G7339",
4993                 "from_station": "上海虹橋",
4994                 "to_station": "杭州東",
4995                 "from_time": "18:36",
4996                 "to_time": "19:42",
4997                 "from_station_type": "起點",
4998                 "to_station_type": "途經",
4999                 "day_diff": "0",
5000                 "use_time": "66",
5001                 "sale_time": "13:30",
5002                 "control_day": 59,
5003                 "from_telecode": "AOH",
5004                 "to_telecode": "HGH",
5005                 "can_web_buy": "Y",
5006                 "note": "",
5007                 "seats": [{
5008                     "seat_price": "73.0",
5009                     "seat_name": "二等座",
5010                     "seat_bookable": 1,
5011                     "seat_yupiao": 312
5012                 }, {
5013                     "seat_price": "117.0",
5014                     "seat_name": "一等座",
5015                     "seat_bookable": 1,
5016                     "seat_yupiao": 8
5017                 }, {
5018                     "seat_price": "219.5",
5019                     "seat_name": "商務座",
5020                     "seat_bookable": 1,
5021                     "seat_yupiao": 7
5022                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5023             }, {
5024                 "train_no": "5l000D332100",
5025                 "train_number": "D3321",
5026                 "from_station": "上海虹橋",
5027                 "to_station": "杭州東",
5028                 "from_time": "18:46",
5029                 "to_time": "19:47",
5030                 "from_station_type": "起點",
5031                 "to_station_type": "途經",
5032                 "day_diff": "0",
5033                 "use_time": "61",
5034                 "sale_time": "13:30",
5035                 "control_day": 59,
5036                 "from_telecode": "AOH",
5037                 "to_telecode": "HGH",
5038                 "can_web_buy": "Y",
5039                 "note": "",
5040                 "seats": [{
5041                     "seat_price": "49.0",
5042                     "seat_name": "二等座",
5043                     "seat_bookable": 1,
5044                     "seat_yupiao": 441
5045                 }, {
5046                     "seat_price": "59.0",
5047                     "seat_name": "一等座",
5048                     "seat_bookable": 1,
5049                     "seat_yupiao": 87
5050                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 84}]
5051             }, {
5052                 "train_no": "5l000G753542",
5053                 "train_number": "G7535",
5054                 "from_station": "上海虹橋",
5055                 "to_station": "杭州東",
5056                 "from_time": "18:59",
5057                 "to_time": "19:58",
5058                 "from_station_type": "起點",
5059                 "to_station_type": "途經",
5060                 "day_diff": "0",
5061                 "use_time": "59",
5062                 "sale_time": "13:30",
5063                 "control_day": 59,
5064                 "from_telecode": "AOH",
5065                 "to_telecode": "HGH",
5066                 "can_web_buy": "Y",
5067                 "note": "",
5068                 "seats": [{
5069                     "seat_price": "73.0",
5070                     "seat_name": "二等座",
5071                     "seat_bookable": 1,
5072                     "seat_yupiao": 482
5073                 }, {
5074                     "seat_price": "117.0",
5075                     "seat_name": "一等座",
5076                     "seat_bookable": 1,
5077                     "seat_yupiao": 51
5078                 }, {
5079                     "seat_price": "219.5",
5080                     "seat_name": "商務座",
5081                     "seat_bookable": 1,
5082                     "seat_yupiao": 26
5083                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5084             }, {
5085                 "train_no": "550000K49530",
5086                 "train_number": "K495",
5087                 "from_station": "上海南",
5088                 "to_station": "杭州東",
5089                 "from_time": "19:02",
5090                 "to_time": "21:00",
5091                 "from_station_type": "起點",
5092                 "to_station_type": "途經",
5093                 "day_diff": "0",
5094                 "use_time": "118",
5095                 "sale_time": "15:30",
5096                 "control_day": 59,
5097                 "from_telecode": "SNH",
5098                 "to_telecode": "HGH",
5099                 "can_web_buy": "Y",
5100                 "note": "",
5101                 "seats": [{
5102                     "seat_price": "24.5",
5103                     "seat_name": "硬座",
5104                     "seat_bookable": 1,
5105                     "seat_yupiao": 146
5106                 }, {
5107                     "seat_price": "70.5",
5108                     "seat_name": "硬臥上",
5109                     "seat_bookable": 1,
5110                     "seat_yupiao": 31
5111                 }, {
5112                     "seat_price": "73.5",
5113                     "seat_name": "硬臥中",
5114                     "seat_bookable": 1,
5115                     "seat_yupiao": 31
5116                 }, {
5117                     "seat_price": "80.0",
5118                     "seat_name": "硬臥下",
5119                     "seat_bookable": 1,
5120                     "seat_yupiao": 31
5121                 }, {
5122                     "seat_price": "108.5",
5123                     "seat_name": "軟臥上",
5124                     "seat_bookable": 0,
5125                     "seat_yupiao": 0
5126                 }, {
5127                     "seat_price": "122.5",
5128                     "seat_name": "軟臥下",
5129                     "seat_bookable": 0,
5130                     "seat_yupiao": 0
5131                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5132             }, {
5133                 "train_no": "5l000G734350",
5134                 "train_number": "G7343",
5135                 "from_station": "上海虹橋",
5136                 "to_station": "杭州東",
5137                 "from_time": "19:04",
5138                 "to_time": "20:03",
5139                 "from_station_type": "起點",
5140                 "to_station_type": "途經",
5141                 "day_diff": "0",
5142                 "use_time": "59",
5143                 "sale_time": "13:30",
5144                 "control_day": 59,
5145                 "from_telecode": "AOH",
5146                 "to_telecode": "HGH",
5147                 "can_web_buy": "Y",
5148                 "note": "",
5149                 "seats": [{
5150                     "seat_price": "73.0",
5151                     "seat_name": "二等座",
5152                     "seat_bookable": 1,
5153                     "seat_yupiao": 980
5154                 }, {
5155                     "seat_price": "117.0",
5156                     "seat_name": "一等座",
5157                     "seat_bookable": 1,
5158                     "seat_yupiao": 47
5159                 }, {
5160                     "seat_price": "219.5",
5161                     "seat_name": "商務座",
5162                     "seat_bookable": 1,
5163                     "seat_yupiao": 20
5164                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5165             }, {
5166                 "train_no": "550000K807C2",
5167                 "train_number": "K807",
5168                 "from_station": "上海南",
5169                 "to_station": "杭州",
5170                 "from_time": "19:08",
5171                 "to_time": "21:09",
5172                 "from_station_type": "途經",
5173                 "to_station_type": "途經",
5174                 "day_diff": "0",
5175                 "use_time": "121",
5176                 "sale_time": "15:30",
5177                 "control_day": 59,
5178                 "from_telecode": "SNH",
5179                 "to_telecode": "HZH",
5180                 "can_web_buy": "Y",
5181                 "note": "",
5182                 "seats": [{
5183                     "seat_price": "28.5",
5184                     "seat_name": "硬座",
5185                     "seat_bookable": 1,
5186                     "seat_yupiao": 39
5187                 }, {
5188                     "seat_price": "74.5",
5189                     "seat_name": "硬臥上",
5190                     "seat_bookable": 1,
5191                     "seat_yupiao": 14
5192                 }, {
5193                     "seat_price": "77.5",
5194                     "seat_name": "硬臥中",
5195                     "seat_bookable": 1,
5196                     "seat_yupiao": 14
5197                 }, {
5198                     "seat_price": "84.5",
5199                     "seat_name": "硬臥下",
5200                     "seat_bookable": 1,
5201                     "seat_yupiao": 14
5202                 }, {
5203                     "seat_price": "112.5",
5204                     "seat_name": "軟臥上",
5205                     "seat_bookable": 0,
5206                     "seat_yupiao": 0
5207                 }, {
5208                     "seat_price": "127.0",
5209                     "seat_name": "軟臥下",
5210                     "seat_bookable": 0,
5211                     "seat_yupiao": 0
5212                 }, {"seat_price": "28.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5213             }, {
5214                 "train_no": "5l000D332300",
5215                 "train_number": "D3323",
5216                 "from_station": "上海虹橋",
5217                 "to_station": "杭州東",
5218                 "from_time": "19:09",
5219                 "to_time": "20:10",
5220                 "from_station_type": "起點",
5221                 "to_station_type": "途經",
5222                 "day_diff": "0",
5223                 "use_time": "61",
5224                 "sale_time": "13:30",
5225                 "control_day": 59,
5226                 "from_telecode": "AOH",
5227                 "to_telecode": "HGH",
5228                 "can_web_buy": "Y",
5229                 "note": "",
5230                 "seats": [{
5231                     "seat_price": "49.0",
5232                     "seat_name": "二等座",
5233                     "seat_bookable": 1,
5234                     "seat_yupiao": 545
5235                 }, {
5236                     "seat_price": "59.0",
5237                     "seat_name": "一等座",
5238                     "seat_bookable": 1,
5239                     "seat_yupiao": 89
5240                 }, {"seat_price": "49.0", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 84}]
5241             }, {
5242                 "train_no": "540000K527A0",
5243                 "train_number": "K527",
5244                 "from_station": "上海南",
5245                 "to_station": "杭州東",
5246                 "from_time": "19:14",
5247                 "to_time": "21:13",
5248                 "from_station_type": "途經",
5249                 "to_station_type": "途經",
5250                 "day_diff": "0",
5251                 "use_time": "119",
5252                 "sale_time": "15:30",
5253                 "control_day": 59,
5254                 "from_telecode": "SNH",
5255                 "to_telecode": "HGH",
5256                 "can_web_buy": "Y",
5257                 "note": "",
5258                 "seats": [{
5259                     "seat_price": "24.5",
5260                     "seat_name": "硬座",
5261                     "seat_bookable": 1,
5262                     "seat_yupiao": 41
5263                 }, {
5264                     "seat_price": "70.5",
5265                     "seat_name": "硬臥上",
5266                     "seat_bookable": 1,
5267                     "seat_yupiao": 15
5268                 }, {
5269                     "seat_price": "73.5",
5270                     "seat_name": "硬臥中",
5271                     "seat_bookable": 1,
5272                     "seat_yupiao": 15
5273                 }, {
5274                     "seat_price": "80.0",
5275                     "seat_name": "硬臥下",
5276                     "seat_bookable": 1,
5277                     "seat_yupiao": 15
5278                 }, {
5279                     "seat_price": "108.5",
5280                     "seat_name": "軟臥上",
5281                     "seat_bookable": 0,
5282                     "seat_yupiao": 0
5283                 }, {
5284                     "seat_price": "122.5",
5285                     "seat_name": "軟臥下",
5286                     "seat_bookable": 0,
5287                     "seat_yupiao": 0
5288                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5289             }, {
5290                 "train_no": "5l000G738112",
5291                 "train_number": "G7381",
5292                 "from_station": "上海虹橋",
5293                 "to_station": "杭州東",
5294                 "from_time": "19:15",
5295                 "to_time": "20:24",
5296                 "from_station_type": "起點",
5297                 "to_station_type": "途經",
5298                 "day_diff": "0",
5299                 "use_time": "69",
5300                 "sale_time": "13:30",
5301                 "control_day": 59,
5302                 "from_telecode": "AOH",
5303                 "to_telecode": "HGH",
5304                 "can_web_buy": "Y",
5305                 "note": "",
5306                 "seats": [{
5307                     "seat_price": "73.0",
5308                     "seat_name": "二等座",
5309                     "seat_bookable": 1,
5310                     "seat_yupiao": 857
5311                 }, {
5312                     "seat_price": "117.0",
5313                     "seat_name": "一等座",
5314                     "seat_bookable": 1,
5315                     "seat_yupiao": 116
5316                 }, {
5317                     "seat_price": "219.5",
5318                     "seat_name": "商務座",
5319                     "seat_bookable": 1,
5320                     "seat_yupiao": 26
5321                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5322             }, {
5323                 "train_no": "550000K51160",
5324                 "train_number": "K511",
5325                 "from_station": "上海南",
5326                 "to_station": "杭州東",
5327                 "from_time": "19:20",
5328                 "to_time": "21:41",
5329                 "from_station_type": "起點",
5330                 "to_station_type": "途經",
5331                 "day_diff": "0",
5332                 "use_time": "141",
5333                 "sale_time": "15:30",
5334                 "control_day": 59,
5335                 "from_telecode": "SNH",
5336                 "to_telecode": "HGH",
5337                 "can_web_buy": "Y",
5338                 "note": "",
5339                 "seats": [{
5340                     "seat_price": "24.5",
5341                     "seat_name": "硬座",
5342                     "seat_bookable": 1,
5343                     "seat_yupiao": 155
5344                 }, {
5345                     "seat_price": "70.5",
5346                     "seat_name": "硬臥上",
5347                     "seat_bookable": 0,
5348                     "seat_yupiao": 0
5349                 }, {
5350                     "seat_price": "73.5",
5351                     "seat_name": "硬臥中",
5352                     "seat_bookable": 0,
5353                     "seat_yupiao": 0
5354                 }, {
5355                     "seat_price": "80.0",
5356                     "seat_name": "硬臥下",
5357                     "seat_bookable": 0,
5358                     "seat_yupiao": 0
5359                 }, {
5360                     "seat_price": "108.5",
5361                     "seat_name": "軟臥上",
5362                     "seat_bookable": 0,
5363                     "seat_yupiao": 0
5364                 }, {
5365                     "seat_price": "122.5",
5366                     "seat_name": "軟臥下",
5367                     "seat_bookable": 0,
5368                     "seat_yupiao": 0
5369                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 100}]
5370             }, {
5371                 "train_no": "5l000G756140",
5372                 "train_number": "G7561",
5373                 "from_station": "上海虹橋",
5374                 "to_station": "杭州東",
5375                 "from_time": "19:21",
5376                 "to_time": "20:14",
5377                 "from_station_type": "起點",
5378                 "to_station_type": "途經",
5379                 "day_diff": "0",
5380                 "use_time": "53",
5381                 "sale_time": "13:30",
5382                 "control_day": 59,
5383                 "from_telecode": "AOH",
5384                 "to_telecode": "HGH",
5385                 "can_web_buy": "Y",
5386                 "note": "",
5387                 "seats": [{
5388                     "seat_price": "73.0",
5389                     "seat_name": "二等座",
5390                     "seat_bookable": 1,
5391                     "seat_yupiao": 244
5392                 }, {
5393                     "seat_price": "117.0",
5394                     "seat_name": "一等座",
5395                     "seat_bookable": 1,
5396                     "seat_yupiao": 12
5397                 }, {
5398                     "seat_price": "219.5",
5399                     "seat_name": "商務座",
5400                     "seat_bookable": 1,
5401                     "seat_yupiao": 10
5402                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5403             }, {
5404                 "train_no": "5l000G755720",
5405                 "train_number": "G7557",
5406                 "from_station": "上海虹橋",
5407                 "to_station": "杭州東",
5408                 "from_time": "19:32",
5409                 "to_time": "20:32",
5410                 "from_station_type": "起點",
5411                 "to_station_type": "終點",
5412                 "day_diff": "0",
5413                 "use_time": "60",
5414                 "sale_time": "13:30",
5415                 "control_day": 59,
5416                 "from_telecode": "AOH",
5417                 "to_telecode": "HGH",
5418                 "can_web_buy": "Y",
5419                 "note": "",
5420                 "seats": [{
5421                     "seat_price": "73.0",
5422                     "seat_name": "二等座",
5423                     "seat_bookable": 1,
5424                     "seat_yupiao": 749
5425                 }, {
5426                     "seat_price": "117.0",
5427                     "seat_name": "一等座",
5428                     "seat_bookable": 1,
5429                     "seat_yupiao": 179
5430                 }, {
5431                     "seat_price": "219.5",
5432                     "seat_name": "商務座",
5433                     "seat_bookable": 1,
5434                     "seat_yupiao": 25
5435                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5436             }, {
5437                 "train_no": "550000K73905",
5438                 "train_number": "K739",
5439                 "from_station": "上海南",
5440                 "to_station": "杭州東",
5441                 "from_time": "19:36",
5442                 "to_time": "21:54",
5443                 "from_station_type": "起點",
5444                 "to_station_type": "途經",
5445                 "day_diff": "0",
5446                 "use_time": "138",
5447                 "sale_time": "15:00",
5448                 "control_day": 57,
5449                 "from_telecode": "SNH",
5450                 "to_telecode": "HGH",
5451                 "can_web_buy": "Y",
5452                 "note": "",
5453                 "seats": [{
5454                     "seat_price": "24.5",
5455                     "seat_name": "硬座",
5456                     "seat_bookable": 1,
5457                     "seat_yupiao": 89
5458                 }, {
5459                     "seat_price": "70.5",
5460                     "seat_name": "硬臥上",
5461                     "seat_bookable": 1,
5462                     "seat_yupiao": 14
5463                 }, {
5464                     "seat_price": "73.5",
5465                     "seat_name": "硬臥中",
5466                     "seat_bookable": 1,
5467                     "seat_yupiao": 14
5468                 }, {
5469                     "seat_price": "80.0",
5470                     "seat_name": "硬臥下",
5471                     "seat_bookable": 1,
5472                     "seat_yupiao": 14
5473                 }, {
5474                     "seat_price": "108.5",
5475                     "seat_name": "軟臥上",
5476                     "seat_bookable": 0,
5477                     "seat_yupiao": 0
5478                 }, {
5479                     "seat_price": "122.5",
5480                     "seat_name": "軟臥下",
5481                     "seat_bookable": 0,
5482                     "seat_yupiao": 0
5483                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5484             }, {
5485                 "train_no": "2400000G4305",
5486                 "train_number": "G43",
5487                 "from_station": "上海虹橋",
5488                 "to_station": "杭州東",
5489                 "from_time": "19:40",
5490                 "to_time": "20:47",
5491                 "from_station_type": "途經",
5492                 "to_station_type": "終點",
5493                 "day_diff": "0",
5494                 "use_time": "67",
5495                 "sale_time": "13:30",
5496                 "control_day": 59,
5497                 "from_telecode": "AOH",
5498                 "to_telecode": "HGH",
5499                 "can_web_buy": "Y",
5500                 "note": "",
5501                 "seats": [{
5502                     "seat_price": "73.0",
5503                     "seat_name": "二等座",
5504                     "seat_bookable": 1,
5505                     "seat_yupiao": 171
5506                 }, {
5507                     "seat_price": "117.0",
5508                     "seat_name": "一等座",
5509                     "seat_bookable": 1,
5510                     "seat_yupiao": 151
5511                 }, {"seat_price": "219.5", "seat_name": "商務座", "seat_bookable": 1, "seat_yupiao": 20}]
5512             }, {
5513                 "train_no": "5l000G752751",
5514                 "train_number": "G7527",
5515                 "from_station": "上海虹橋",
5516                 "to_station": "杭州東",
5517                 "from_time": "20:21",
5518                 "to_time": "21:22",
5519                 "from_station_type": "起點",
5520                 "to_station_type": "途經",
5521                 "day_diff": "0",
5522                 "use_time": "61",
5523                 "sale_time": "13:30",
5524                 "control_day": 59,
5525                 "from_telecode": "AOH",
5526                 "to_telecode": "HGH",
5527                 "can_web_buy": "Y",
5528                 "note": "",
5529                 "seats": [{
5530                     "seat_price": "73.0",
5531                     "seat_name": "二等座",
5532                     "seat_bookable": 1,
5533                     "seat_yupiao": 998
5534                 }, {
5535                     "seat_price": "117.0",
5536                     "seat_name": "一等座",
5537                     "seat_bookable": 1,
5538                     "seat_yupiao": 53
5539                 }, {
5540                     "seat_price": "219.5",
5541                     "seat_name": "商務座",
5542                     "seat_bookable": 1,
5543                     "seat_yupiao": 20
5544                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5545             }, {
5546                 "train_no": "550000K28702",
5547                 "train_number": "K287",
5548                 "from_station": "上海南",
5549                 "to_station": "杭州東",
5550                 "from_time": "20:25",
5551                 "to_time": "22:37",
5552                 "from_station_type": "起點",
5553                 "to_station_type": "途經",
5554                 "day_diff": "0",
5555                 "use_time": "132",
5556                 "sale_time": "15:30",
5557                 "control_day": 59,
5558                 "from_telecode": "SNH",
5559                 "to_telecode": "HGH",
5560                 "can_web_buy": "Y",
5561                 "note": "",
5562                 "seats": [{
5563                     "seat_price": "24.5",
5564                     "seat_name": "硬座",
5565                     "seat_bookable": 1,
5566                     "seat_yupiao": 40
5567                 }, {
5568                     "seat_price": "70.5",
5569                     "seat_name": "硬臥上",
5570                     "seat_bookable": 1,
5571                     "seat_yupiao": 6
5572                 }, {
5573                     "seat_price": "73.5",
5574                     "seat_name": "硬臥中",
5575                     "seat_bookable": 1,
5576                     "seat_yupiao": 6
5577                 }, {
5578                     "seat_price": "80.0",
5579                     "seat_name": "硬臥下",
5580                     "seat_bookable": 1,
5581                     "seat_yupiao": 6
5582                 }, {
5583                     "seat_price": "108.5",
5584                     "seat_name": "軟臥上",
5585                     "seat_bookable": 0,
5586                     "seat_yupiao": 0
5587                 }, {
5588                     "seat_price": "122.5",
5589                     "seat_name": "軟臥下",
5590                     "seat_bookable": 0,
5591                     "seat_yupiao": 0
5592                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5593             }, {
5594                 "train_no": "5l000G738310",
5595                 "train_number": "G7383",
5596                 "from_station": "上海虹橋",
5597                 "to_station": "杭州東",
5598                 "from_time": "20:33",
5599                 "to_time": "21:50",
5600                 "from_station_type": "起點",
5601                 "to_station_type": "途經",
5602                 "day_diff": "0",
5603                 "use_time": "77",
5604                 "sale_time": "13:30",
5605                 "control_day": 59,
5606                 "from_telecode": "AOH",
5607                 "to_telecode": "HGH",
5608                 "can_web_buy": "Y",
5609                 "note": "",
5610                 "seats": [{
5611                     "seat_price": "73.0",
5612                     "seat_name": "二等座",
5613                     "seat_bookable": 1,
5614                     "seat_yupiao": 767
5615                 }, {
5616                     "seat_price": "117.0",
5617                     "seat_name": "一等座",
5618                     "seat_bookable": 1,
5619                     "seat_yupiao": 184
5620                 }, {
5621                     "seat_price": "219.5",
5622                     "seat_name": "商務座",
5623                     "seat_bookable": 1,
5624                     "seat_yupiao": 28
5625                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5626             }, {
5627                 "train_no": "5l000G752911",
5628                 "train_number": "G7529",
5629                 "from_station": "上海虹橋",
5630                 "to_station": "杭州東",
5631                 "from_time": "20:40",
5632                 "to_time": "21:46",
5633                 "from_station_type": "起點",
5634                 "to_station_type": "途經",
5635                 "day_diff": "0",
5636                 "use_time": "66",
5637                 "sale_time": "13:30",
5638                 "control_day": 59,
5639                 "from_telecode": "AOH",
5640                 "to_telecode": "HGH",
5641                 "can_web_buy": "Y",
5642                 "note": "",
5643                 "seats": [{
5644                     "seat_price": "73.0",
5645                     "seat_name": "二等座",
5646                     "seat_bookable": 1,
5647                     "seat_yupiao": 101
5648                 }, {
5649                     "seat_price": "117.0",
5650                     "seat_name": "一等座",
5651                     "seat_bookable": 1,
5652                     "seat_yupiao": 26
5653                 }, {
5654                     "seat_price": "219.5",
5655                     "seat_name": "商務座",
5656                     "seat_bookable": 1,
5657                     "seat_yupiao": 10
5658                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5659             }, {
5660                 "train_no": "550000Z24700",
5661                 "train_number": "Z247",
5662                 "from_station": "上海南",
5663                 "to_station": "杭州東",
5664                 "from_time": "20:42",
5665                 "to_time": "22:23",
5666                 "from_station_type": "起點",
5667                 "to_station_type": "途經",
5668                 "day_diff": "0",
5669                 "use_time": "101",
5670                 "sale_time": "15:30",
5671                 "control_day": 59,
5672                 "from_telecode": "SNH",
5673                 "to_telecode": "HGH",
5674                 "can_web_buy": "Y",
5675                 "note": "",
5676                 "seats": [{
5677                     "seat_price": "24.5",
5678                     "seat_name": "硬座",
5679                     "seat_bookable": 1,
5680                     "seat_yupiao": 186
5681                 }, {
5682                     "seat_price": "70.5",
5683                     "seat_name": "硬臥上",
5684                     "seat_bookable": 0,
5685                     "seat_yupiao": 0
5686                 }, {
5687                     "seat_price": "73.5",
5688                     "seat_name": "硬臥中",
5689                     "seat_bookable": 0,
5690                     "seat_yupiao": 0
5691                 }, {
5692                     "seat_price": "80.0",
5693                     "seat_name": "硬臥下",
5694                     "seat_bookable": 0,
5695                     "seat_yupiao": 0
5696                 }, {
5697                     "seat_price": "108.5",
5698                     "seat_name": "軟臥上",
5699                     "seat_bookable": 0,
5700                     "seat_yupiao": 0
5701                 }, {
5702                     "seat_price": "122.5",
5703                     "seat_name": "軟臥下",
5704                     "seat_bookable": 0,
5705                     "seat_yupiao": 0
5706                 }, {"seat_price": "24.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5707             }, {
5708                 "train_no": "5l000G755510",
5709                 "train_number": "G7555",
5710                 "from_station": "上海虹橋",
5711                 "to_station": "杭州東",
5712                 "from_time": "20:52",
5713                 "to_time": "22:07",
5714                 "from_station_type": "起點",
5715                 "to_station_type": "終點",
5716                 "day_diff": "0",
5717                 "use_time": "75",
5718                 "sale_time": "13:30",
5719                 "control_day": 59,
5720                 "from_telecode": "AOH",
5721                 "to_telecode": "HGH",
5722                 "can_web_buy": "Y",
5723                 "note": "",
5724                 "seats": [{
5725                     "seat_price": "73.0",
5726                     "seat_name": "二等座",
5727                     "seat_bookable": 1,
5728                     "seat_yupiao": 129
5729                 }, {
5730                     "seat_price": "117.0",
5731                     "seat_name": "一等座",
5732                     "seat_bookable": 1,
5733                     "seat_yupiao": 54
5734                 }, {
5735                     "seat_price": "219.5",
5736                     "seat_name": "商務座",
5737                     "seat_bookable": 1,
5738                     "seat_yupiao": 20
5739                 }, {"seat_price": "73.0", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5740             }, {
5741                 "train_no": "5l000G7315A1",
5742                 "train_number": "G7315",
5743                 "from_station": "上海虹橋",
5744                 "to_station": "杭州",
5745                 "from_time": "21:30",
5746                 "to_time": "22:28",
5747                 "from_station_type": "起點",
5748                 "to_station_type": "終點",
5749                 "day_diff": "0",
5750                 "use_time": "58",
5751                 "sale_time": "13:30",
5752                 "control_day": 59,
5753                 "from_telecode": "AOH",
5754                 "to_telecode": "HZH",
5755                 "can_web_buy": "Y",
5756                 "note": "",
5757                 "seats": [{
5758                     "seat_price": "77.5",
5759                     "seat_name": "二等座",
5760                     "seat_bookable": 1,
5761                     "seat_yupiao": 962
5762                 }, {
5763                     "seat_price": "123.5",
5764                     "seat_name": "一等座",
5765                     "seat_bookable": 1,
5766                     "seat_yupiao": 54
5767                 }, {
5768                     "seat_price": "233.5",
5769                     "seat_name": "商務座",
5770                     "seat_bookable": 1,
5771                     "seat_yupiao": 20
5772                 }, {"seat_price": "77.5", "seat_name": "無座", "seat_bookable": 0, "seat_yupiao": 0}]
5773             }, {
5774                 "train_no": "53000K8401A0",
5775                 "train_number": "K8401",
5776                 "from_station": "上海南",
5777                 "to_station": "杭州",
5778                 "from_time": "23:30",
5779                 "to_time": "02:57",
5780                 "from_station_type": "途經",
5781                 "to_station_type": "途經",
5782                 "day_diff": "1",
5783                 "use_time": "207",
5784                 "sale_time": "15:30",
5785                 "control_day": 59,
5786                 "from_telecode": "SNH",
5787                 "to_telecode": "HZH",
5788                 "can_web_buy": "Y",
5789                 "note": "",
5790                 "seats": [{
5791                     "seat_price": "28.5",
5792                     "seat_name": "硬座",
5793                     "seat_bookable": 1,
5794                     "seat_yupiao": 812
5795                 }, {
5796                     "seat_price": "74.5",
5797                     "seat_name": "硬臥上",
5798                     "seat_bookable": 1,
5799                     "seat_yupiao": 247
5800                 }, {
5801                     "seat_price": "77.5",
5802                     "seat_name": "硬臥中",
5803                     "seat_bookable": 1,
5804                     "seat_yupiao": 247
5805                 }, {
5806                     "seat_price": "84.5",
5807                     "seat_name": "硬臥下",
5808                     "seat_bookable": 1,
5809                     "seat_yupiao": 247
5810                 }, {
5811                     "seat_price": "112.5",
5812                     "seat_name": "軟臥上",
5813                     "seat_bookable": 1,
5814                     "seat_yupiao": 29
5815                 }, {
5816                     "seat_price": "127.0",
5817                     "seat_name": "軟臥下",
5818                     "seat_bookable": 1,
5819                     "seat_yupiao": 29
5820                 }, {"seat_price": "28.5", "seat_name": "無座", "seat_bookable": 1, "seat_yupiao": 430}]
5821             }];
View Code

咱們這裏作的第一個事情是將數據所有展現出來,在具體渲染前,原始數據須要作一些處理:

  1 define([
  2     'AbstractView',
  3     'pages/list.data',
  4     'text!pages/tpl.layout.html',
  5     'text!pages/tpl.list.html'
  6 
  7 
  8 ], function (
  9     AbstractView,
 10     listData,
 11 
 12     layoutHtml,
 13     listTpl
 14 
 15 ) {
 16     return _.inherit(AbstractView, {
 17 
 18         propertys: function ($super) {
 19             $super();
 20 
 21             this.viewId = 'list';
 22 
 23             this.template = layoutHtml;
 24 
 25             this.events = {};
 26 
 27             //班車信息
 28             this.listData = listData;
 29 
 30         },
 31 
 32         initElement: function () {
 33             this.d_list_wrapper = this.$('.js_list_wrapper');
 34             this.d_none_data = this.$('.js_none_data');
 35 
 36             this.d_js_show_setoutdate = this.$('.js_show_setoutdate');
 37             this.d_js_show_setstation = this.$('.js_show_setstation');
 38             this.d_js_show_arrivalstation = this.$('.js_show_arrivalstation');
 39             this.d_js_list_loading = this.$('.js_list_loading');
 40             this.d_js_tabs = this.$('.js_tabs');
 41 
 42             this.d_js_day_sec = this.$('.js_day_sec');
 43             this.d_js_start_sec = this.$('.js_start_sec');
 44             this.d_js_arrival_sec = this.$('.js_arrival_sec');
 45 
 46         },
 47 
 48         //複雜的業務數據處理,爲了達到產品的需求,這段代碼邏輯與業務相關
 49         //這段數據處理的代碼過長(超過50行就過長),應該重構掉
 50         formatData: function (data) {
 51             var item, seat;
 52             var typeMap = {
 53                 'g': 'g',
 54                 'd': 'd',
 55                 't': 't',
 56                 'c': 'g'
 57             };
 58 
 59             //出發時間對應的分鐘數
 60             var fromMinute = 0;
 61 
 62             //獲取當前班車日期當前的時間戳,這個數據是動態的,這裏寫死了
 63             var d = 1464192000000;
 64             var date = new Date();
 65             var now = parseInt(date.getTime() / 1000);
 66             date.setTime(d);
 67             var year = date.getFullYear();
 68             var month = date.getMonth();
 69             var day = date.getDate();
 70             var toBegin;
 71             var seatName, seatIndex, iii;
 72 
 73             //處理坐席問題,僅顯示二等座,一等座,特等座 無座
 74             //                二等座 一等座 商務座 無座 動臥 特等座
 75             var my_seats = {};
 76             var seatSort = ['二等座', '一等座', '硬座', '硬臥', '軟臥', '商務座', '無座', '動臥', '特等座', '軟座'];
 77 
 78             for (var i = 0, len = data.length; i < len; i++) {
 79                 fromMinute = data[i].from_time.split(':');
 80                 fromMinute[0] = fromMinute[0] + '';
 81                 fromMinute[1] = fromMinute[1] + '';
 82                 if ((fromMinute[0].charAt(0) == '0')) fromMinute[0] = fromMinute[0].charAt(1);
 83                 if ((fromMinute[1].charAt(0) == '0')) fromMinute[1] = fromMinute[1].charAt(1);
 84                 date = new Date(year, month, day, fromMinute[0], fromMinute[1], 0);
 85                 fromMinute = parseInt(date.getTime() / 1000)
 86                 toBegin = parseInt((fromMinute - now) / 60);
 87 
 88                 data[i].toBegin = toBegin;
 89 
 90                 //處理車次類型問題
 91                 data[i].my_train_number = typeMap[data[i].train_number.charAt(0).toLowerCase()] || 'other';
 92 
 93                 seat = data[i].seats;
 94                 //全部餘票
 95                 data[i].sum_ticket = 0;
 96                 //最低價
 97                 data[i].min_price = null;
 98 
 99                 for (var j = 0, len1 = seat.length; j < len1; j++) {
100                     if (!data[i].min_price || data[i].min_price > seat[j].seat_price) data[i].min_price = parseFloat(seat[j].seat_price);
101                     data[i].sum_ticket += parseInt(seat[j].seat_yupiao);
102 
103                     //坐席問題若是坐席不包括上中下則去掉
104                     seatName = seat[j].seat_name;
105                     //去掉上中下
106                     seatName = seatName.replace(/上|中|下/g, '');
107                     if (!my_seats[seatName]) {
108                         my_seats[seatName] = parseInt(seat[j].seat_yupiao);
109                     } else {
110                         my_seats[seatName] = my_seats[seatName] + parseInt(seat[j].seat_yupiao);
111                     }
112                 }
113                 //這裏myseat爲對象,須要轉換爲數組
114                 //將定製坐席轉爲排序後的數組
115                 data[i].my_seats = [];
116                 for (iii = 0; iii < seatSort.length; iii++) {
117                     if (typeof my_seats[seatSort[iii]] == 'number') data[i].my_seats.push({ name: seatSort[iii], yupiao: my_seats[seatSort[iii]] });
118                 }
119 
120                 my_seats = {};
121             }
122 
123             return data;
124         },
125 
126         //渲染列表
127         renderList: function() {
128             var data = this.formatData(this.listData);
129 
130             var html = '';
131             window.scrollTo(0, 0);
132 
133             if (data.length === 0) {
134                 this.d_none_data.show();
135                 this.d_list_wrapper.hide();
136                 return;
137             }
138 
139             this.d_none_data.hide();
140             this.d_list_wrapper.show();
141             html = this.renderTpl(listTpl, { data: data });
142             this.d_list_wrapper.html(html);
143         },
144 
145         addEvent: function () {
146             this.on('onShow', function () {
147 
148                 this.renderList();
149 
150             });
151         }
152 
153     });
154 
155 });
View Code

而後第一步的效果出來了,後面只須要處理數據篩選便可:

這裏開始實現第一個業務組件,頂部的搜索欄,這個搜索欄有如下需求:

① 默認以時間升序排列

② 三個tab彼此互斥,點擊時候仍然使用升序,再次點擊爲倒序

頂部導航組件

這裏的交互就有必定複雜性了,這種場景是有數據實體出現的必要了,因此咱們先實現數據實體:

複製代碼
 1 define(['AbstractEntity'], function (AbstractEntity) {
 2 
 3     var Entity = _.inherit(AbstractEntity, {
 4         propertys: function ($super) {
 5             $super();
 6 
 7             //三個對象,時間,耗時,價格,升序降序,三個數據互斥
 8             //默認down up null
 9             this.data = {
10                 time: 'up',
11                 sumTime: '',
12                 price: ''
13             };
14         },
15 
16         _resetData: function () {
17             this.data = {
18                 time: '',
19                 sumTime: '',
20                 price: ''
21             };
22         },
23 
24         setTime: function () {
25             this._setData('time');
26         },
27 
28         setSumTime: function () {
29             this._setData('sumTime');
30         },
31 
32         setPrice: function () {
33             this._setData('price');
34         },
35 
36         _setData: function (key) {
37 
38             //若是設置當前key存在,則反置,不然清空篩選,設置默認值
39             if (this.data[key] != '') {
40                 if (this.data[key] == 'up') this.data[key] = 'down';
41                 else this.data[key] = 'up';
42             } else {
43                 this._resetData();
44                 this.data[key] = 'down';
45             }
46             this.update();
47         }
48 
49     });
50 
51     return Entity;
52 });
複製代碼

對應視覺展現比較簡單:

1 <ul class="bus-tabs sort-bar js_sort_item">
2     <li class="tabs-item " data-sort="Time" style="-webkit-flex: 1.5; flex: 1.5;">出發時間<i class="icon-sort <%=time %>"></i></li>
3     <li class="tabs-item " data-sort="SumTime" >耗時<i class="icon-sort <%=sumTime %>"></i></li>
4     <li class="tabs-item " data-sort="Price" >價格<i class="icon-sort <%=price %>"></i></li>
5 </ul>

事實上這個數據實體是徹底獨立的,這個視覺模板也僅僅負責了展現,而在哪展現,數據怎麼與模板產生關聯其中就是咱們的組件控制器了:

複製代碼
 1 define(['ModuleView', 'text!pages/tpl.sort.bar.html'], function (ModuleView, tpl) {
 2     return _.inherit(ModuleView, {
 3 
 4         //此處如果要使用model,處實例化時候必定要保證entity的存在,若是不存在即是業務BUG
 5         initData: function () {
 6 
 7             this.template = tpl;
 8             this.events = {
 9                 'click .js_sort_item li ': function (e) {
10                     var el = $(e.currentTarget);
11                     var sort = el.attr('data-sort');
12                     _hmt.push(['_trackEvent', 'train.list.sort.' + sort, 'click']);
13 
14                     this.sortEntity['set' + sort]();
15                 }
16             };
17 
18             this.sortEntity.subscribe('init', this.render, this);
19             this.sortEntity.subscribe(this.render, this);
20 
21         },
22 
23         getViewModel: function () {
24             return this.sortEntity.get();
25         }
26 
27     });
28 
29 });
複製代碼

至此,能夠看到,一個組件就已經完成了,組件的功能很簡單:

PS:注意組件是不能脫離根組件View而存在,一個組件必定會有一個this.view對象

① 組件控制器獲取了模板

② 組件控制器獲取了根組件View給予(實例化時注入)的數據實體sortEntiy

因而咱們在主控制器中實例化咱們的數據實體與組件:

複製代碼
 1 initEntity: function() {
 2 
 3     //實例化排序的導航欄的實體
 4     this.sortEntity = new SortEntity();
 5 
 6 },
 7 
 8 initModule: function() {
 9 
10     //view爲注入給組件的根元素
11     //selector爲組件將要顯示的容器
12     //sortEntity爲注入給組件的數據實體,作通訊用
13     //這個module在數據顯示後會自動展現
14     this.sortModule = new SortModule({
15         view: this,
16         selector: '.js_sort_wrapper',
17         sortEntity: this.sortEntity
18     });
19 
20 },
複製代碼

這裏簡單說明下代碼,首先這裏說明一個錯誤的實踐,一個筆誤:

this.sortEntity.subscribe(this.render, this);

在mod.sort中有這麼一段代碼,事實上這段代碼是有問題的,由於數據實體是做爲被觀察者實現的,因此subscribe應該爲subscribed!!!

可是由於最初一個筆誤致使全部團隊全部業務團隊都這樣用了下去,產生了很大的誤導做用,這裏繼續寫錯,提醒你們作框架層的東西要慎重。

這裏事實上觀察者爲View或者Module,按道理說該是:

view.subscribe(entity, callback)

可是當時考慮到一個view未必會有數據實體,而view實現後module還要作實現,因而這塊代碼就寫到了entity上,如今看來寫到View上更合理,這裏很少說,回到咱們的業務代碼。

這裏對entity的變化綁定了一個回調,「數據變化的話從新渲染自己」,因而咱們每次點擊的話:

var el = $(e.currentTarget);
var sort = el.attr('data-sort');
this.sortEntity['set' + sort]();

由標籤獲取了當前設置的key,完了引發數據更新,便致使了組件自己的從新渲染,因而功能完成。

可是咱們知道這個數據變化除了組件自己變化之外還應該引發列表的變化,因此咱們在View中也應該觀察這個數據實體的變化,以便從新渲染數據:

//實例化排序的導航欄的實體
this.sortEntity = new SortEntity();
this.sortEntity.subscribe(this.renderList, this);

這個時候因爲排序的產生,咱們須要重寫renderList的實現:

複製代碼
 1 _timeSort: function (data, sort) {
 2     data = _.sortBy(data, function (item) {
 3         item = item.from_time.split(':');
 4         item = item[0] + '.' + item[1];
 5         item = parseFloat(item);
 6         return item;
 7     });
 8     if (sort == 'down') data.reverse();
 9     return data;
10 },
11 
12 _sumTimeSort: function (data, sort) {
13     data = _.sortBy(data, function (item) {
14         return parseInt(item.use_time);
15     });
16     if (sort == 'down') data.reverse();
17     return data;
18 },
19 
20 _priceSort: function (data, sort) {
21     data = _.sortBy(data, function (item) {
22         return item.min_price;
23     });
24     if (sort == 'down') data.reverse();
25     return data;
26 },
27 
28 //獲取導航欄排序後的數據
29 getSortData: function (data) {
30     var tmp = [];
31     var sort = this.sortEntity.get();
32 
33     for (var k in sort) {
34         if (sort[k].length > 0) {
35             tmp = this['_' + k + 'Sort'](data, sort[k])
36             return tmp;
37         }
38     }
39 },
40 
41 //完成全部的篩選條件,邏輯比較重
42 getFilteData: function () {
43     var data = this.formatData(this.listData);
44     data = this.getSortData(data);
45 
46     return data;
47 },
48 
49 //渲染列表
50 renderList: function() {
51     var data = this.getFilteData();
52 
53     var html = '';
54     window.scrollTo(0, 0);
55 
56     if (data.length === 0) {
57         this.d_none_data.show();
58         this.d_list_wrapper.hide();
59         return;
60     }
61 
62     this.d_none_data.hide();
63     this.d_list_wrapper.show();
64     html = this.renderTpl(listTpl, { data: data });
65     this.d_list_wrapper.html(html);
66 },
複製代碼

能夠看到,這裏複雜操做被分解爲了一個個小小的方法,配合underscore釋放的一些數組操做,即可以簡單的完成列表渲染功能,由於這裏最終的渲染邏輯沒有改變,改變的僅僅是排序後的數組。

此處對班次數據的處理篇幅已經超過了50行,若是再增長,能夠實例化一個班次Entity用於格式化的數據輸出,由於咱們這裏沒有實現這個實體,放到根View中又過於臃腫,因此將之放到Module中,這樣關於篩選的全部API所有下放到了排序模塊,而主View代碼就會清晰的多:

複製代碼
1 //完成全部的篩選條件,邏輯比較重
2 getFilteData: function () {
3     var data = this.formatData(this.listData);
4     data = this.sortModule.getSortData(data);
5     return data;
6 },
複製代碼
 1 define(['ModuleView', 'text!pages/tpl.sort.bar.html'], function (ModuleView, tpl) {
 2     return _.inherit(ModuleView, {
 3 
 4         //此處如果要使用model,處實例化時候必定要保證entity的存在,若是不存在即是業務BUG
 5         initData: function () {
 6 
 7             this.template = tpl;
 8             this.events = {
 9                 'click .js_sort_item li ': function (e) {
10                     var el = $(e.currentTarget);
11                     var sort = el.attr('data-sort');
12                     this.sortEntity['set' + sort]();
13                 }
14             };
15 
16             this.sortEntity.subscribe(this.render, this);
17 
18         },
19 
20         _timeSort: function (data, sort) {
21             data = _.sortBy(data, function (item) {
22                 item = item.from_time.split(':');
23                 item = item[0] + '.' + item[1];
24                 item = parseFloat(item);
25                 return item;
26             });
27             if (sort == 'down') data.reverse();
28             return data;
29         },
30 
31         _sumTimeSort: function (data, sort) {
32             data = _.sortBy(data, function (item) {
33                 return parseInt(item.use_time);
34             });
35             if (sort == 'down') data.reverse();
36             return data;
37         },
38 
39         _priceSort: function (data, sort) {
40             data = _.sortBy(data, function (item) {
41                 return item.min_price;
42             });
43             if (sort == 'down') data.reverse();
44             return data;
45         },
46 
47         //獲取導航欄排序後的數據
48         getSortData: function (data) {
49             var tmp = [];
50             var sort = this.sortEntity.get();
51 
52             for (var k in sort) {
53                 if (sort[k].length > 0) {
54                     tmp = this['_' + k + 'Sort'](data, sort[k])
55                     return tmp;
56                 }
57             }
58         },
59 
60         getViewModel: function () {
61             return this.sortEntity.get();
62         }
63 
64     });
65 
66 });
sort模塊

至此,一個完整的業務組件便實現結束了,那麼這裏也實現了一個簡單的View組件系統,那麼這麼作有什麼不足呢?

不足

首先,咱們這裏的實現扔是以js爲基礎,這種作法彷佛不太「組件化」,更好的實現彷佛是直接以一個標籤的方式使用。

而後,能夠看出,咱們每次點擊先是改變數據,而後數據觸發更新,刷新了整個列表,也改變了組件自己的展現,這裏的方案簡單粗暴,徹底是從新渲染,這種從新渲染的作法,在數據列表達到必定數量的話是一種資源浪費。

可是樓主基本無力解決以上問題,這種問題咱們看看Vue與React後面是如何解決的,這裏暫時擱置。

底部菜單

咱們這裏作的第二個業務組件是底部菜單欄:

 

觀察這個視覺,咱們這裏出現了一個純粹的UI組件,因而咱們作的第一步是實現這個UI組件。

UI組件的實現

所謂UI組件是不包含任何業務代碼,由於UI組件不是今天的重點,我這裏貼出實現不作過多講解:

 1 define([
 2     'AbstractView'
 3 ], function (
 4     AbstractView
 5 ) {
 6 
 7     //實現一個方法產生最大的zindex
 8     var getBiggerzIndex = (function () {
 9         var index = 2000;
10         return function (level) {
11             return level + (++index);
12         };
13     })();
14 
15     return _.inherit(AbstractView, {
16 
17         propertys: function ($super) {
18             $super();
19 
20             //這裏設置UI的根節點所處包裹層
21             this.wrapper = $('body');
22             this.viewId = _.uniqueId('ui-view-');
23 
24         },
25 
26         //爲當前View設置最大的zindex,這裏用於彈出層狀況
27         setzIndexTop: function (el, level) {
28             if (!el) el = this.$el;
29             if (!level || level > 10) level = 0;
30             level = level * 1000;
31             el.css('z-index', getBiggerzIndex(level));
32 
33         },
34 
35         _getDefaultViewModel: function (arr) {
36             var k, i, len, obj = {};
37             for (i = 0, len = arr.length; i < len; i++) {
38                 k = arr[i];
39                 if (!_.isUndefined(this[k]) && !_.isNull(this[k])) obj[k] = this[k];
40             }
41             return obj;
42         }
43 
44     });
45 
46 });
UIView
 1 define([
 2     'ui/ui.view'
 3 ], function (
 4     UIView
 5 ) {
 6 
 7     return _.inherit(UIView, {
 8 
 9         setRootStyle: function () {
10             this.$el.addClass('cm-overlay');
11         },
12 
13         addEvent: function ($super) {
14             $super();
15 
16             this.on('onShow', function () {
17                 this.setRootStyle();
18                 this.setzIndexTop();
19             });
20 
21         }
22 
23     });
24 
25 });
UIMask
  1 define([
  2     'ui/ui.view',
  3     'ui/ui.mask',
  4     'text!ui/ui.list.html'
  5 
  6 ], function (
  7     UIView,
  8     UIMask,
  9     template
 10 
 11 ) {
 12     return _.inherit(UIView, {
 13 
 14         propertys: function ($super) {
 15             $super();
 16 
 17             this.mask = new UIMask();
 18 
 19             this.viewId = 'uilist';
 20 
 21             this.template = template;
 22             this.classname = 'cm-layer-list';
 23             this.list = [];
 24             this.cancelText = '取消';
 25             this.index = -1;
 26             this.displayNum = 5;
 27             this.curClass = 'active';
 28 
 29 
 30             this.addEvents({
 31                 'click .js_cancel': 'cancelAction',
 32                 'click .js_item': 'itemAction'
 33             });
 34 
 35             this.onItemAction = function (data, index, e) {
 36             };
 37 
 38         },
 39 
 40         getViewModel: function () {
 41             return this._getDefaultViewModel(['list', 'cancelText', 'index', 'curClass', 'itemFn', 'title']);
 42         },
 43 
 44         setIndex: function (i, position) {
 45             if (i < 0 || i > this.list.length) return;
 46             this.index = i;
 47             this.$('li').removeClass(this.curClass);
 48             this.$('li[data-index="' + i + '"]').addClass(this.curClass);
 49 
 50         },
 51 
 52         cancelAction: function (e) {
 53             this.hide();
 54         },
 55 
 56         //彈出層類垂直居中使用
 57         reposition: function () {
 58             this.$el.css({
 59                 'position': 'fixed',
 60                 '-webkit-box-sizing': 'border-box',
 61                 'box-sizing': 'border-box',
 62                 'width': '100%',
 63                 'left': '0',
 64                 'background-color': '#fff',
 65                 'bottom': '36px'
 66             });
 67         },
 68 
 69         itemAction: function (e) {
 70             var el = $(e.currentTarget);
 71             if (el.hasClass('disabled')) return;
 72 
 73             var index = el.attr('data-index');
 74             var data = this.list[index];
 75             this.setIndex(index);
 76             this.onItemAction.call(this, data, index, e);
 77 
 78         },
 79 
 80         addEvent: function () {
 81 
 82             this.on('onPreShow', function () {
 83                 this.mask.show();
 84             });
 85 
 86             this.on('onShow', function () {
 87 
 88                 this.setzIndexTop();
 89                 this.reposition();
 90 
 91             });
 92 
 93             this.on('onHide', function () {
 94                 this.mask.hide();
 95             });
 96 
 97         }
 98 
 99     });
100 
101 });
UIList
<section class="cm-modal cm-modal--action">
  <%if(typeof title == 'string' && title.length > 0){ %>
   <header class="cm-modal-hd">
        <h3 class="cm-modal-title js_title"><%=title %></h3>
     </header>
  <%} %>
  <div class="cm-modal-bd js_wrapper">
    <ul class="cm-actions cm-actions--full js_scroller" >
      <%for(var i = 0, len = list.length; i < len; i++) {%>
        <li data-index="<%=i%>" class="cm-actions-btn js_item <%if(list[i].disabled){ %>disabled<%} %> <%if(i == index) { %>active<% } %>"><%=((typeof itemFn == "function" && itemFn(list[i])) || list[i].name)%></li>
      <%}%>
    </ul>
  </div>
  <div class="cm-modal-ft cm-actions">
    <span class="cm-actions-btn js_cancel"><%=cancelText%></span>
  </div>
</section>
UIList模板

這裏的UIView是繼承至基礎View的代碼,作了簡單改造,讓他更適合作UI的基類

UIMask就是咱們經常使用的蒙版

UIList是咱們真實使用的組件,繼承至UIView,其中會實例化一個Mask的實例

有興趣的朋友這裏本身看看,咱們將關注點放到底部的業務組件。

底部業務組件

細心的朋友應該看到了,事實上在佈局之初的時候(list還未渲染),底部菜單欄DOM結構便已經存在,咱們這裏作的一件事情就是當組件已經存在如何和組件交互邏輯關聯起來,這裏作的第一步也是最重要一部依舊是數據實體的抽象。

他這個數據是一個多選框類型的數據,數組的第一項是全選功能,根據需求咱們抽象出了這種數據實體:

 1 define(['AbstractEntity'], function (AbstractEntity) {
 2 
 3     var Entity = _.inherit(AbstractEntity, {
 4         propertys: function ($super) {
 5             $super();
 6             this.data = [];
 7         },
 8 
 9         getLength: function () {
10             return this.data.length;
11         },
12 
13         unCheckAll: function () {
14             for (var i = 0, len = this.getLength(); i < len; i++) {
15                 this.data[i].checked = false;
16             }
17         },
18 
19         checkAll: function (noEvent) {
20             if (this.getLength() == 0) return;
21             this.unCheckAll();
22             this.data[0].checked = true;
23             if (!noEvent) this.update();
24         },
25 
26         setIndex: function (i, noEvent) {
27             if (typeof i === 'string') i = parseInt(i);
28             if (i < 0 || i > this.getLength()) return;
29             if (i === 0) {
30                 this.checkAll(noEvent);
31                 return;
32             }
33             this.data[0].checked = false;
34             if (this.data[i].checked) this.data[i].checked = false;
35             else this.data[i].checked = true;
36 
37             //若是除了第一個都被選了的話,那麼就是全選,若是所有沒被選也得全選
38             if (this.getCheckedIndex().length == this.getLength() - 1 || this.getCheckedIndex().length == 0) {
39                 this.checkAll(noEvent);
40             }
41 
42             if (!noEvent) this.update();
43         },
44 
45         getCheckedIndex: function (index) {
46             var indexArr = [];
47             for (var i = 0, len = this.getLength(); i < len; i++) {
48                 if (index === i && this.data[i].checked) continue;
49                 if (this.data[i].checked) indexArr.push(i);
50             }
51             return indexArr;
52         },
53 
54         getCheckedKey: function () {
55             if (this.data[0].checked) return null;
56             var checed = [], index = this.getCheckedIndex();
57             for (var i = 0, len = index.length; i < len; i++) {
58                 checed.push(this.data[index[i]].id);
59             }
60             return checed;
61         },
62 
63         initData: function (data) {
64             this.data = data;
65         }
66 
67     });
68 
69     return Entity;
70 });
多選數據實體

有了數據實體,咱們這裏便須要實現使用數據實體的組件(非最終代碼):

 1 define(['ModuleView', 'ui/ui.list'], function (ModuleView, UILayerList) {
 2     return _.inherit(ModuleView, {
 3 
 4         //此處如果要使用model,處實例化時候必定要保證entity的存在,若是不存在即是業務BUG
 5         initData: function () {
 6 
 7             this.events = {
 8                 'click': 'showLayer'
 9             };
10 
11             this.entity.checkAll(true);
12 
13         },
14 
15         onHide: function () {
16             if (this.layer) {
17                 this.layer.destroy();
18             }
19         },
20 
21         showLayer: function () {
22 
23             var scope = this;
24             var data = this.entity.get();
25             if (data.length == 0) return;
26 
27             if (!this.layer) {
28 
29                 //這裏註釋了車站地圖需求
30                 this.layer = new UILayerList({
31                     list: data,
32                     events: {
33                         'click .js_ok': function () {
34                             scope.entity.update();
35                             this.hide();
36                         }
37                     },
38                     onHide: function () {
39                         scope.searchBarEntity.resetData(true);
40                     },
41                     title: '<span class="fl js_cancel" style="font-weight: 500;">取消</span><span class="fr js_ok" style="color: #00b358; font-weight: 500;">肯定</span>',
42                     itemFn: function (item) {
43                         return '<div style="text-align: left; padding-left: 10px; ">' + item.name + '</div>';
44                     },
45                     setIndex: function (i) {
46                         scope.entity.setIndex(i, true);
47                         this.setIndexArr();
48                     },
49                     setIndexArr: function () {
50                         var indexArr = scope.entity.getCheckedIndex();
51                         if (typeof indexArr == 'number') indexArr = [indexArr];
52                         this.$('li').removeClass(this.curClass);
53                         for (var i = 0, len = indexArr.length; i < len; i++) this._setIndex(indexArr[i])
54                     },
55                     _setIndex: function (i) {
56                         if (i < 0 || i > this.list.length) return;
57                         this.index = i;
58                         this.$('li[data-index="' + i + '"]').addClass(this.curClass);
59                     }
60                 });
61             } else {
62                 this.layer.list = data;
63                 this.layer.refresh();
64             }
65 
66             this.layer.show();
67             this.layer.setIndexArr();
68         },
69 
70         getViewModel: function () {
71             return this.entity.get();
72         }
73 
74     });
75 
76 });
組件代碼

而後在根View中將View與組件關聯起來:

複製代碼
 1 //車次類型數據實體
 2 this.trainTypeEntity = new CheckBoxEntity({
 3     data: [
 4         { name: '所有車次', id: 'all', checked: true },
 5         { name: '高鐵城際(G/C)', id: 'g' },
 6         { name: '動車(D)', id: 'd' },
 7         { name: '特快(T)', id: 't' },
 8         { name: '其它類型', id: 'other' }
 9     ]
10 });
11 
12 //車次類型模塊
13 this.trainTypeModule = new CheckBoxModule({
14     view: this,
15     selector: '.js_type',
16     tagname: 'Type',
17     entity: this.trainTypeEntity
18 });
複製代碼

這樣,咱們點擊車次類型便能很好的運行了,可是tab並無被選中:

這裏思考一個問題:底部有三個組件交互,依次是車次類型、出發站、更多,事實上組件之間並不知道當前是哪一個tab被點擊了,應該展現選中狀態,知道的是根View,因此咱們這裏須要在View中實現一個數據實體,注入給三個業務組件,告訴他們如今該誰被選中了,下面三個tab只有一個能選中,而且選擇了一個tab,另外一個tab的菜單若是是展現狀態須要將其隱藏,因此咱們實現了單選的實體:

 1 define(['AbstractEntity'], function (AbstractEntity) {
 2 
 3     var Entity = _.inherit(AbstractEntity, {
 4         propertys: function ($super) {
 5             $super();
 6             this.data = [];
 7         },
 8 
 9         getLength: function () {
10             return this.data.length;
11         },
12 
13         unCheckAll: function () {
14             for (var i = 0, len = this.getLength(); i < len; i++) {
15                 this.data[i].checked = false;
16             }
17             this.update();
18         },
19 
20         setIndex: function (i, noEvent) {
21             if (typeof i === 'string') i = parseInt(i);
22             if (i < 0 || i > this.getLength()) return;
23             this.unCheckAll();
24             this.data[i].checked = true;
25             if (!noEvent) this.update();
26         },
27 
28         setId: function(id) {
29 
30             for(var i = 0, len = this.getLength(); i < len; i++) {
31                 if(this.data[i].id == id) {
32                     this.setIndex(i);
33                     return;
34                 }
35             }
36         },
37 
38         getCheckedIndex: function () {
39             for (var i = 0, len = this.getLength(); i < len; i++) {
40                 if (this.data[i].checked) return i;
41             }
42             return null;
43         },
44 
45         getCheckedKey: function () {
46             var index = this.getCheckedIndex();
47             if (index !== null) return this.data[index].id;
48             return null;
49         },
50 
51         getCheckedName: function () {
52             var index = this.getCheckedIndex();
53             if (index !== null) return this.data[index].name;
54             return null;
55         }
56 
57     });
58 
59     return Entity;
60 });
單選數據實體

而後是出發站的實現,這裏出發站有一點特殊,首先這個數據須要列表加載結束,咱們去篩選數據得到出發站,因此實體有一個初始化的過程(並且這裏數據更新是不須要觸發事件的);其次他的交互與車次類型徹底一致,惟一不一樣的只是數據實體,因此這裏出發站的組件咱們能夠複用,只須要實例化一個數據出來便可:

 1 //由初始數據篩選出全部出發站
 2 initSetout: function () {
 3     var data = this.listData;
 4     var stations = [];
 5     var stationMap = {};
 6     var tmp = [{ id: 'all', name: '所有出發站'}];
 7 
 8     for (var i = 0, len = data.length; i < len; i++) {
 9         stationMap[data[i].from_telecode] = data[i].from_station;
10         if (data[i].from_station_type == '起點' && _.indexOf(stations, data[i].from_telecode) == -1) {
11             stations.push(data[i].from_telecode);
12         }
13     }
14 
15     for (i = 0, len = stations.length; i < len; i++) {
16         var key = stations[i];
17         var value = stationMap[key];
18         stations[i] = {
19             id: key,
20             name: value
21         };
22     }
23 
24     tmp = tmp.concat(stations);
25 
26     this.setoutEntity.initData(tmp);
27     this.setoutEntity.checkAll(true);
28 
29 },
view

如此底部菜單欄中的車次類型與出發站,咱們便基本實現了,這裏每次數據變化還須要更新列表數據,這裏在主View中綁定相關變化便可,而後再重寫下renderList,便結束了主要功能,這裏有個不一樣的地方,是列表數據的篩選卻不能放在Module中,由於車次類型與出發站的數據篩選可能不同,因此這樣看來最初的班次數據操做就應該封裝爲一個ListEntity作數據篩選,咱們這裏暫時放到主View中:

複製代碼
 1 //根據車次類型作篩選
 2 getTypeData: function (data) {
 3     var typeKeys = this.trainTypeEntity.getCheckedKey();
 4     if (!typeKeys) return data;
 5     var tmp = _.filter(data, function (item) {
 6         var no = item.my_train_number;
 7         if (_.indexOf(typeKeys, no) != -1) {
 8             return true;
 9         }
10         return false;
11     });
12 
13     return tmp;
14 },
15 
16 //根據出發站作篩選
17 //事實上這個方法與getTypeData不是徹底不能重構到一塊兒,可是可讀性可能會變得晦澀
18 getSetoutData: function (data) {
19     var keys = this.setoutEntity.getCheckedKey();
20     if (!keys) return data;
21 
22     var tmp = _.filter(data, function (item) {
23         var no = item.from_telecode;
24         if (_.indexOf(keys, no) != -1)
25             return true;
26         return false;
27     });
28 
29     return tmp;
30 },
31 
32 //完成全部的篩選條件,邏輯比較重
33 getFilteData: function () {
34     var data = this.formatData(this.listData);
35     data = this.getTypeData(data);
36     data = this.getSetoutData(data);
37     data = this.sortModule.getSortData(data);
38     return data;
39 },
複製代碼

更多功能

這裏更多功能也是比較複雜的,可是就算一個更多,裏面又會分爲幾個小組件,幾個數據實體,因此真實實現功能後代碼反而簡單,這裏我便不作實現,感興趣的同窗做爲家庭做業作吧。

總結

咱們這裏使用js實現了一個簡單的組件化View的實現,中間造成了純粹的UI組件,也將View拆分實現了一些業務組件,最終造成的目錄爲:

有興趣的朋友在git上面去看吧,這裏是入口js:

複製代碼
 1 (function () {
 2 
 3     require.config({
 4         paths: {
 5             'text': 'libs/require.text',
 6 
 7             'AbstractView': 'js/view',
 8             'AbstractEntity': 'js/entity',
 9             'ModuleView': 'js/module'
10 
11 
12         }
13     });
14 
15     require(['pages/list'], function (List) {
16 
17         var list = new List();
18         list.show();
19 
20     });
21 
22 })();
複製代碼

好了,通過上面的實現,若是看過以前個人博客的話,應該對組件化開發有必定了解了,咱們也能夠進入今日的正題了,首先咱們以Vue實現上述功能。

Vue的實現

首先,這裏說Vue的實現,不是底層源碼分析,而是實現上述功能,這裏你們不要誤會,由於我也是昨天才開始看Vue,暫時無能瞭解他的實現。

我雖然沒有使用過Vue作業務開發,可是在好久以前就聽我一個好基友誇耀Vue,到今日實現,Vue已經火的不行了。。。。。。

今天,就讓咱們來試試Vue的威力,由於是初次使用,若是有不對的地方,你們能夠指正,也不要噴了

組件拆分

根據以前的實現,咱們發現咱們的組件能夠輕易的分爲三個部分:

① 頂部導航

② 列表

③ 底部菜單

咱們以前作的第一件事情是將列表展現作掉,這種開發流程是不會改變的,因此使用Vue將列表展現實現。

組件定義

在使用組件化以前,咱們先看看Vue如何實現一個組件(這裏不得不說Vue的做者文檔確實寫的好):

複製代碼
 1 // 定義
 2 var MyComponent = Vue.extend({
 3   template: '<div>A custom component!</div>'
 4 })
 5 
 6 // 註冊
 7 Vue.component('my-component', MyComponent)
 8 
 9 // 建立根實例
10 new Vue({
11   el: '#example'
12 })
複製代碼
複製代碼
1 <!--正確作法-->
2 <article class="cm-page" id="main">
3     <my-component></my-component>
4 </article>
5 
6 <!--錯誤作法,組件必定要依賴根部View-->
7 <my-component></my-component>
複製代碼

做者這個實現很不錯,也考慮了不是全部組件都須要全局釋放的,通常來講能夠全局釋放的組件都與業務無關或者是公共業務,這裏是局部組件的實現:

複製代碼
1 var Child = Vue.extend({ /* ... */ })
2 
3 var Parent = Vue.extend({
4   template: '...',
5   components: {
6     // <my-component> 只能用在父組件模板內
7     'my-component': Child
8   }
9 })
複製代碼

上面的例子比較簡單,咱們立刻使用一個複雜一點的例子試試水:

複製代碼
 1 // 定義
 2 var MyList = Vue.extend({
 3 
 4     data: function () {
 5         return {
 6             data: /**/[
 7                 {name: '出發時間', id: 'time'},
 8                 {name: '耗時', id: 'sumTime'},
 9                 {name: '價格', id: 'price'}
10             ]
11         };
12     },
13     template: [
14         '<ul>',
15             '<li v-for="item in data" >',
16                 '{{item.name}}',
17             '</li>',
18         '</ul>'
19     ].join('')
20 })
21 
22 // 註冊
23 Vue.component('my-list', MyList)
24 
25 // 建立根實例
26 new Vue({
27     el: '#main'
28 })
複製代碼
<article class="cm-page" id="main">
    <my-component></my-component>
    <my-list></my-list>
</article>

這段代碼會輸出:

1 <article class="cm-page" id="main">
2     <div>A custom component!</div>
3     <ul><li>出發時間</li><li>耗時</li><li>價格</li></ul>
4 </article>

這裏瞭解到這裏便暫時結束,咱們來實現咱們的列表組件。

根實例

咱們在第一節的實現中不少初始化的動做與數據所有放到了根View中,一樣,咱們這裏須要實現一個根View:

複製代碼
 1 define([
 2     'Vue'
 3 ], function (Vue) {
 4     return new Vue({
 5         data: {
 6             a: 1
 7         },
 8         el: '#main',
 9         template: '<div>test</div>'
10     });
11 });
複製代碼

如今咱們在入口index.html將寫入list組件,而後在寫實現(不得不說,我也認爲這種作法很直觀):

<article class="cm-page" id="main">
    <my-list></my-list>
</article>

根據上面的知識咱們實現這個業務組件,這裏也碰到了第一個問題,根View如何將數據傳遞給他的組件也就是,組件與View之間如何通訊。

組件實例的做用域是孤立的。這意味着不能而且不該該在子組件的模板內直接引用父組件的數據。可使用 props 把數據傳給子組件。
「prop」 是組件數據的一個字段,指望從父組件傳下來。子組件須要顯式地用 props 選項 聲明 props:

根據文檔,我這裏寫個demo試試:

複製代碼
 1 var MyList = Vue.extend({
 2     props: ['data'],
 3     template: [
 4         '<ul>',
 5             '<li v-for="item in data" >',
 6                 '{{item.name}}',
 7             '</li>',
 8         '</ul>'
 9     ].join('')
10 })
11 
12 // 註冊
13 Vue.component('my-list', MyList)
14 
15 // 建立根實例
16 new Vue({
17     data: {
18         name: 'test',
19         data: /**/[
20             {name: '出發時間', id: 'time'},
21             {name: '耗時', id: 'sumTime'},
22             {name: '價格', id: 'price'}
23         ]
24     },
25     el: '#main'
26 })
複製代碼
<article class="cm-page" id="main">
    {{name}}
    <my-component></my-component>
    <my-list v-bind:data="data"></my-list>
</article>

代碼雖然和傳統習慣不同,可是確實完成了咱們要的實現。

PS:樓主這裏慢慢開始感受有點怪了,可能使用方法不太對

list組件

由於Vue的模板裏面不能寫表達式,因此全部的數據相關邏輯須要寫到組件代碼部分,由於以前的處理,咱們只須要簡單的改下模板便能正確的運行:

複製代碼
<article class="cm-page page-list" id="main">
    <my-list :data="data"></my-list>
</article>

<script type="text/javascript" src="./libs/underscore.js"></script>
<script type="text/javascript" src="./libs/require.js"></script>
<script type="text/javascript" src="main.js"></script>
複製代碼
  1 define([
  2     'Vue',
  3     'pages/list.data',
  4     'pages/mod.list'
  5 
  6 ], function (
  7     Vue,
  8     listData,
  9     ListModule
 10 
 11 ) {
 12 
 13     return new Vue({
 14         components: {
 15             'my-list': ListModule
 16         },
 17         data: {
 18             data: formatData(listData)
 19         },
 20         el: '#main'
 21     });
 22 
 23     //該方法放到這裏是否合適?
 24     function formatData(data) {
 25         var item, seat;
 26         var typeMap = {
 27             'g': 'g',
 28             'd': 'd',
 29             't': 't',
 30             'c': 'g'
 31         };
 32 
 33         //出發時間對應的分鐘數
 34         var fromMinute = 0;
 35 
 36         //獲取當前班車日期當前的時間戳,這個數據是動態的,這裏寫死了
 37         var d = 1464192000000;
 38         var date = new Date();
 39         var now = parseInt(date.getTime() / 1000);
 40         date.setTime(d);
 41         var year = date.getFullYear();
 42         var month = date.getMonth();
 43         var day = date.getDate();
 44         var toBegin;
 45         var seatName, seatIndex, iii;
 46 
 47         //處理坐席問題,僅顯示二等座,一等座,特等座 無座
 48         //                二等座 一等座 商務座 無座 動臥 特等座
 49         var my_seats = {};
 50         var seatSort = ['二等座', '一等座', '硬座', '硬臥', '軟臥', '商務座', '無座', '動臥', '特等座', '軟座'];
 51 
 52         for (var i = 0, len = data.length; i < len; i++) {
 53             fromMinute = data[i].from_time.split(':');
 54             fromMinute[0] = fromMinute[0] + '';
 55             fromMinute[1] = fromMinute[1] + '';
 56             if ((fromMinute[0].charAt(0) == '0')) fromMinute[0] = fromMinute[0].charAt(1);
 57             if ((fromMinute[1].charAt(0) == '0')) fromMinute[1] = fromMinute[1].charAt(1);
 58             date = new Date(year, month, day, fromMinute[0], fromMinute[1], 0);
 59             fromMinute = parseInt(date.getTime() / 1000)
 60             toBegin = parseInt((fromMinute - now) / 60);
 61 
 62             data[i].toBegin = toBegin;
 63 
 64             //處理車次類型問題
 65             data[i].my_train_number = typeMap[data[i].train_number.charAt(0).toLowerCase()] || 'other';
 66 
 67             seat = data[i].seats;
 68             //全部餘票
 69             data[i].sum_ticket = 0;
 70             //最低價
 71             data[i].min_price = null;
 72 
 73             for (var j = 0, len1 = seat.length; j < len1; j++) {
 74                 if (!data[i].min_price || data[i].min_price > seat[j].seat_price) data[i].min_price = parseFloat(seat[j].seat_price);
 75                 data[i].sum_ticket += parseInt(seat[j].seat_yupiao);
 76 
 77                 //坐席問題若是坐席不包括上中下則去掉
 78                 seatName = seat[j].seat_name;
 79                 //去掉上中下
 80                 seatName = seatName.replace(/上|中|下/g, '');
 81                 if (!my_seats[seatName]) {
 82                     my_seats[seatName] = parseInt(seat[j].seat_yupiao);
 83                 } else {
 84                     my_seats[seatName] = my_seats[seatName] + parseInt(seat[j].seat_yupiao);
 85                 }
 86             }
 87             //這裏myseat爲對象,須要轉換爲數組
 88             //將定製坐席轉爲排序後的數組
 89             data[i].my_seats = [];
 90             for (iii = 0; iii < seatSort.length; iii++) {
 91                 if (typeof my_seats[seatSort[iii]] == 'number') data[i].my_seats.push({
 92                     name: seatSort[iii],
 93                     yupiao: my_seats[seatSort[iii]]
 94                 });
 95             }
 96 
 97             my_seats = {};
 98         }
 99 
100         return data;
101     }
102 
103 });
根View

組件js代碼部分:

複製代碼
define([
    'Vue',
    'text!pages/tpl.list.html'
], function (Vue,
             template) {

    return Vue.extend({
        props: ['data'],
        data: function() {
           return {
               mapping: {
                   'g': '高速',
                   't': '特快',
                   'd': '高速動車',
                   'c': '城際高鐵',
                   'z': '直達'
               }
           };
        },
        template: template

    });

});
複製代碼

組件模板部分:

複製代碼
 1 <ul class="bus-list js_bus_list ">
 2     <li v-for="item in data" class="bus-list-item ">
 3         <div class="bus-seat">
 4             <span class=" fl">{{item.train_number }} | {{mapping[item.my_train_number] || '其它'}} </span>
 5             <span class=" fr">{{parseInt(item.use_time / 60) + '小時' + item.use_time % 60 + '分'}}</span>
 6         </div>
 7         <div class="detail">
 8             <div class="sub-list set-out">
 9                 <span class="bus-go-off">{{item.from_time}}</span> <span class="start"><span class="icon-circle s-icon1">
10                 </span>{{item.from_station }}</span> <span class="fr price">¥{{item.min_price}}起</span>
11             </div>
12             <div class="sub-list">
13                 <span class="bus-arrival-time">{{item.to_time}}</span> <span class="end"><span class="icon-circle s-icon2">
14                 </span>{{item.to_station}}</span> <span class="fr ">{{item.sum_ticket}}張</span>
15             </div>
16         </div>
17         <div class="bus-seats-info" >
18             <span v-for="seat in item.my_seats">{{seat.name}}({{seat.yupiao }}) </span>
19         </div>
20     </li>
21 </ul>
複製代碼

從代碼上看,其實主要的處理邏輯仍舊是最初數據的處理,我這裏其實有一個疑問?

這裏數據是寫死的,若是真實業務中數據由ajax返回,那麼這個業務代碼該在View哪一個位置進行?這個問題留待下次完整閱讀Vue文檔後分析

頂部導航組件

這裏回到頂部導航的實現,這個與列表不一樣的是他會多出不少交互了,首先嵌入一個新標籤:

<article class="cm-page page-list" id="main">
    <my-sort-bar></my-sort-bar>
    <my-list :data="data"></my-list>
</article>

這個標籤的模板能夠直接將以前的模板拷貝過來改爲Vue的語法便可:

複製代碼
1 <ul class="bus-tabs sort-bar js_sort_item">
2     <li class="tabs-item " v-on:click="setTime" style="-webkit-flex: 1.5; flex: 1.5;">
出發時間<i class="icon-sort {{time }}"></i></li> 3 <li class="tabs-item " v-on:click="setSumTime">耗時<i class="icon-sort {{sumTime }}"></i></li> 4 <li class="tabs-item " v-on:click="setPrice">價格<i class="icon-sort {{price }}"></i></li> 5 </ul>
複製代碼

完了完成最主要的組件模塊代碼實現,在這裏小釵發現以前的導航相關的Entity實體中的操做就是全部須要的處理,因此這裏能夠稍微改造下便使用:

複製代碼
 1 define([
 2     'Vue',
 3     'text!pages/tpl.sort.html'
 4 ], function (Vue,
 5              template) {
 6 
 7     return Vue.extend({
 8         props: ['data'],
 9         data: function () {
10             return {
11                 time: 'up',
12                 sumTime: '',
13                 price: ''
14             };
15         },
16         methods: {
17             _resetData: function () {
18                 this.time = '';
19                 this.sumTime = '';
20                 this.price = '';
21             },
22 
23             setTime: function () {
24                 this._setData('time');
25             },
26 
27             setSumTime: function () {
28                 this._setData('sumTime');
29             },
30 
31             setPrice: function () {
32                 this._setData('price');
33             },
34 
35             _setData: function (key) {
36                 //若是設置當前key存在,則反置,不然清空篩選,設置默認值
37                 if (this[key] != '') {
38                     if (this[key] == 'up') this[key] = 'down';
39                     else this[key] = 'up';
40                 } else {
41                     this._resetData();
42                     this[key] = 'down';
43                 }
44             }
45         },
46         template: template
47 
48     });
49 
50 });
複製代碼

對比下以前數據實體的代碼,以及組件控制器的實現:

複製代碼
 1 define(['ModuleView', 'text!pages/tpl.sort.bar.html'], function (ModuleView, tpl) {
 2     return _.inherit(ModuleView, {
 3 
 4         //此處如果要使用model,處實例化時候必定要保證entity的存在,若是不存在即是業務BUG
 5         initData: function () {
 6 
 7             this.template = tpl;
 8             this.events = {
 9                 'click .js_sort_item li ': function (e) {
10                     var el = $(e.currentTarget);
11                     var sort = el.attr('data-sort');
12                     this.sortEntity['set' + sort]();
13                 }
14             };
15 
16             this.sortEntity.subscribe(this.render, this);
17 
18         },
19 
20         getViewModel: function () {
21             return this.sortEntity.get();
22         }
23 
24     });
25 
26 });
複製代碼
 1 define(['AbstractEntity'], function (AbstractEntity) {
 2 
 3     var Entity = _.inherit(AbstractEntity, {
 4         propertys: function ($super) {
 5             $super();
 6 
 7             //三個對象,時間,耗時,架構,升序降序,三個數據互斥
 8             //默認down up null
 9             this.data = {
10                 time: 'up',
11                 sumTime: '',
12                 price: ''
13             };
14         },
15 
16         _resetData: function () {
17             this.data = {
18                 time: '',
19                 sumTime: '',
20                 price: ''
21             };
22         },
23 
24         setTime: function () {
25             this._setData('time');
26         },
27 
28         setSumTime: function () {
29             this._setData('sumTime');
30         },
31 
32         setPrice: function () {
33             this._setData('price');
34         },
35 
36         _setData: function (key) {
37 
38             //若是設置當前key存在,則反置,不然清空篩選,設置默認值
39             if (this.data[key] != '') {
40                 if (this.data[key] == 'up') this.data[key] = 'down';
41                 else this.data[key] = 'up';
42             } else {
43                 this._resetData();
44                 this.data[key] = 'down';
45             }
46             this.update();
47         }
48 
49     });
50 
51     return Entity;
52 });
數據實體

這裏是Vue根僅僅使用AMD方式引入該模塊便可,View的實現:

components: {
    'my-list': ListModule,
    'my-sort-bar': SortModule
},

如今第二個問題來了,這裏每次操做事實上應該影響列表組件的排序,以前咱們這塊是經過數據實體entity作通訊,不出意外的話Vue也該如此,可是小釵在這裏卻產生了疑惑,該怎麼作,怎麼實現?

由於根據以前經驗,主View與組件之間以數據實體的方式通訊是比較常見的操做,組件之間也能夠經過數據實體溝通,由於數據實體是實例化在根View中的,可是組件與組件之間不該該產生直接的關聯,通常來講主View或者組件使用數據之外的方式都是不可取的。

這裏頂部導航組件是獨立的,並無釋放對外的接口,根View也沒有注入數據對象給他,那麼他的變化該如何通知到列表組件,讓他從新排序呢?這個時候又開始查文檔ing。

小釵這裏沒有想到很好的辦法,因而將頂部導航的組件的數據上升到了主View中,主View以pros的方式傳遞了給兩個組件,因此上述代碼要有變更,首先是根節點:

複製代碼
1 data: {
2     data: formatData(listData),
3     sort: {
4         time: 'up',
5         sumTime: '',
6         price: ''
7     }
8 },
複製代碼

html中的調用:

複製代碼
1 <article class="cm-page page-list" id="main">
2     <div class="js_sort_wrapper sort-bar-wrapper">
3         <my-sort-bar :sort="sort"></my-sort-bar>
4     </div>
5     <my-list :data="data"></my-list>
6 </article>
複製代碼

最後是組件js與具體模板的實現:

 1 define([
 2     'Vue',
 3     'text!pages/tpl.sort.html'
 4 ], function (Vue,
 5              template) {
 6 
 7     return Vue.extend({
 8         props: ['sort'],
 9         methods: {
10             _resetData: function () {
11                 this.sort.time = '';
12                 this.sort.sumTime = '';
13                 this.sort.price = '';
14             },
15 
16             setTime: function () {
17                 this._setData('time');
18             },
19 
20             setSumTime: function () {
21                 this._setData('sumTime');
22             },
23 
24             setPrice: function () {
25                 this._setData('price');
26             },
27 
28             _setData: function (key) {
29                 //若是設置當前key存在,則反置,不然清空篩選,設置默認值
30                 if (this.sort[key] != '') {
31                     if (this.sort[key] == 'up') this.sort[key] = 'down';
32                     else this.sort[key] = 'up';
33                 } else {
34                     this._resetData();
35                     this.sort[key] = 'down';
36                 }
37             }
38         },
39         template: template
40 
41     });
42 
43 });
View Code
1 <ul class="bus-tabs sort-bar js_sort_item">
2     <li class="tabs-item " v-on:click="setTime" data-sort="Time" style="-webkit-flex: 1.5; flex: 1.5;">出發時間<i class="icon-sort {{sort.time }}"></i></li>
3     <li class="tabs-item " v-on:click="setSumTime" data-sort="SumTime" >耗時<i class="icon-sort {{sort.sumTime }}"></i></li>
4     <li class="tabs-item " v-on:click="setPrice" data-sort="Price" >價格<i class="icon-sort {{sort.price }}"></i></li>
5 </ul>
View Code

這樣一來主View又可使用pros的方式將sort字段釋放給列表組件了,這裏代碼再作變動。

PS:小釵注意觀察過每次數據變化,不是從新渲染的方式,替代的是局部更新,這個功能要實現好很難

PS:這裏代碼改來改去,一是但願你們看到思考過程,二是樓主幫助本身思考,最終你們仍是對着git看吧

而後這裏將原來寫在導航模塊的數據處理移到列表組件中,從這裏也能夠看出,咱們最開始的代碼實現中事實上也能夠將列表實現成一個組件,這應該是「強組件」思惟與「弱組件」思惟帶來的規則差別,強的框架會用規則限制你的代碼,讓你繞過錯誤,減小你思考的機率,弱的框架會更靈活些,也意味着能力不足易出錯,可是由於根View的data是共享的,要把全部的篩選數據透傳給列表組件又比較煩,因此咱們便直接在根View中操做數據了。

這裏數據變化了雖然會引發自身的的渲染,可是並不能執行對應的回調,因此咱們應該給他註冊回調,Vue使用watch爲數據綁定觀察回調,咱們這裏試試。

define([
    'Vue',
    'pages/list.data',
    'pages/mod.list',
    'pages/mod.sort'

], function (Vue,
             listData,
             ListModule,
             SortModule) {

    return new Vue({
        components: {
            'my-list': ListModule,
            'my-sort-bar': SortModule
        },
        data: {
            data: formatData(listData),
            sort: {
                time: 'up',
                sumTime: '',
                price: ''
            }
        },

        methods: {
            _timeSort: function (data, sort) {
                data = _.sortBy(data, function (item) {
                    item = item.from_time.split(':');
                    item = item[0] + '.' + item[1];
                    item = parseFloat(item);
                    return item;
                });
                if (sort == 'down') data.reverse();
                return data;
            },

            _sumTimeSort: function (data, sort) {
                data = _.sortBy(data, function (item) {
                    return parseInt(item.use_time);
                });
                if (sort == 'down') data.reverse();
                return data;
            },

            _priceSort: function (data, sort) {
                data = _.sortBy(data, function (item) {
                    return item.min_price;
                });
                if (sort == 'down') data.reverse();
                return data;
            },

            //獲取導航欄排序後的數據
            getSortData: function (data) {
                var tmp = [];
                var sort = this.sort;

                for (var k in sort) {
                    if (sort[k].length > 0) {
                        tmp = this['_' + k + 'Sort'](data, sort[k])
                        return tmp;
                    }
                }
            }
        },

        watch: {
            sort: {
                deep: true,
                handler: function() {
                    this.data = this.getSortData(this.data);
                }
            }
        },
        el: '#main'
    });

    //該方法放到這裏是否合適?
    function formatData(data) {
        var item, seat;
        var typeMap = {
            'g': 'g',
            'd': 'd',
            't': 't',
            'c': 'g'
        };

        //出發時間對應的分鐘數
        var fromMinute = 0;

        //獲取當前班車日期當前的時間戳,這個數據是動態的,這裏寫死了
        var d = 1464192000000;
        var date = new Date();
        var now = parseInt(date.getTime() / 1000);
        date.setTime(d);
        var year = date.getFullYear();
        var month = date.getMonth();
        var day = date.getDate();
        var toBegin;
        var seatName, seatIndex, iii;

        //處理坐席問題,僅顯示二等座,一等座,特等座 無座
        //                二等座 一等座 商務座 無座 動臥 特等座
        var my_seats = {};
        var seatSort = ['二等座', '一等座', '硬座', '硬臥', '軟臥', '商務座', '無座', '動臥', '特等座', '軟座'];

        for (var i = 0, len = data.length; i < len; i++) {
            fromMinute = data[i].from_time.split(':');
            fromMinute[0] = fromMinute[0] + '';
            fromMinute[1] = fromMinute[1] + '';
            if ((fromMinute[0].charAt(0) == '0')) fromMinute[0] = fromMinute[0].charAt(1);
            if ((fromMinute[1].charAt(0) == '0')) fromMinute[1] = fromMinute[1].charAt(1);
            date = new Date(year, month, day, fromMinute[0], fromMinute[1], 0);
            fromMinute = parseInt(date.getTime() / 1000)
            toBegin = parseInt((fromMinute - now) / 60);

            data[i].toBegin = toBegin;

            //處理車次類型問題
            data[i].my_train_number = typeMap[data[i].train_number.charAt(0).toLowerCase()] || 'other';

            seat = data[i].seats;
            //全部餘票
            data[i].sum_ticket = 0;
            //最低價
            data[i].min_price = null;

            for (var j = 0, len1 = seat.length; j < len1; j++) {
                if (!data[i].min_price || data[i].min_price > seat[j].seat_price) data[i].min_price = parseFloat(seat[j].seat_price);
                data[i].sum_ticket += parseInt(seat[j].seat_yupiao);

                //坐席問題若是坐席不包括上中下則去掉
                seatName = seat[j].seat_name;
                //去掉上中下
                seatName = seatName.replace(/上|中|下/g, '');
                if (!my_seats[seatName]) {
                    my_seats[seatName] = parseInt(seat[j].seat_yupiao);
                } else {
                    my_seats[seatName] = my_seats[seatName] + parseInt(seat[j].seat_yupiao);
                }
            }
            //這裏myseat爲對象,須要轉換爲數組
            //將定製坐席轉爲排序後的數組
            data[i].my_seats = [];
            for (iii = 0; iii < seatSort.length; iii++) {
                if (typeof my_seats[seatSort[iii]] == 'number') data[i].my_seats.push({
                    name: seatSort[iii],
                    yupiao: my_seats[seatSort[iii]]
                });
            }

            my_seats = {};
        }

        return data;
    }

});
頂部導航組件實現

至此,咱們完成了頂部導航組件,如今來完成底部菜單欄。

底部菜單欄

根據以前的開發模式,咱們依舊是造成一個組件,放到html裏面:

複製代碼
<article class="cm-page page-list" id="main">
    <div class="js_sort_wrapper sort-bar-wrapper">
        <my-sort-bar :sort="sort"></my-sort-bar>
    </div>
    <my-list :data="data" :sort="sort"></my-list>
    <my-tabs></my-tabs>
</article>
複製代碼

 

PS:這裏會用到的UI組件我不肯意再從新寫了,因此就直接將原來的拿來用,反正與業務無關。

PS:請注意,Vue自己是不包含任何dom操做的,由於使用UI組件加入了一些第三方庫,你們能夠無視掉

根據以前的經驗,這裏不管是車次類型仍是出發站,是幾個組件共享的,因此咱們仍然將之實如今根View中,而後傳遞給子組件,由於出發城市和車次類型事實上是一個組件,因此上面的結構有所變化:

複製代碼
 1 <article class="cm-page page-list" id="main">
 2     <div class="js_sort_wrapper sort-bar-wrapper">
 3         <my-sort-bar :sort="sort"></my-sort-bar>
 4     </div>
 5     <my-list :data="data" :sort="sort"></my-list>
 6     <ul class="bus-tabs list-filter js_tabs " style="z-index: 3000;">
 7         <my-tab-item :data="type" name="車次類型"></my-tab-item>
 8         <my-tab-item :data="setout" name="出發站"></my-tab-item>
 9         <li class="tabs-item js_more">更多<i class="icon-sec"></i>
10         </li>
11     </ul>
12 </article>
複製代碼

對應的組件第一步也結束了:

複製代碼
 1 data: {
 2     data: formatData(listData),
 3     sort: {
 4         time: 'up',
 5         sumTime: '',
 6         price: ''
 7     },
 8     //車次類型
 9     type: [
10         {name: '所有車次', id: 'all', checked: true},
11         {name: '高鐵城際(G/C)', id: 'g'},
12         {name: '動車(D)', id: 'd'},
13         {name: '特快(T)', id: 't'},
14         {name: '其它類型', id: 'other'}
15     ],
16     setout: [
17         {name: '所有出發站', id: 'all', checked: true}
18     ]
19 },
複製代碼
  1 define([
  2     'Vue',
  3     'text!pages/tpl.tabs.html',
  4     'ui/ui.list'
  5 ], function (Vue,
  6              template,
  7              UILayerList) {
  8 
  9     return Vue.extend({
 10         props: ['data', 'name'],
 11         methods: {
 12 
 13             getLength: function () {
 14                 return this.data.length;
 15             },
 16 
 17             unCheckAll: function () {
 18                 for (var i = 0, len = this.getLength(); i < len; i++) {
 19                     this.data[i].checked = false;
 20                 }
 21             },
 22 
 23             checkAll: function (noEvent) {
 24                 if (this.getLength() == 0) return;
 25                 this.unCheckAll();
 26                 this.data[0].checked = true;
 27                 //if (!noEvent) this.update();
 28             },
 29 
 30             setIndex: function (i, noEvent) {
 31                 if (typeof i === 'string') i = parseInt(i);
 32                 if (i < 0 || i > this.getLength()) return;
 33                 if (i === 0) {
 34                     this.checkAll(noEvent);
 35                     return;
 36                 }
 37                 this.data[0].checked = false;
 38                 if (this.data[i].checked) this.data[i].checked = false;
 39                 else this.data[i].checked = true;
 40 
 41                 //若是除了第一個都被選了的話,那麼就是全選,若是所有沒被選也得全選
 42                 if (this.getCheckedIndex().length == this.getLength() - 1 || this.getCheckedIndex().length == 0) {
 43                     this.checkAll(noEvent);
 44                 }
 45 
 46                 //if (!noEvent) this.update();
 47             },
 48 
 49             getCheckedIndex: function (index) {
 50                 var indexArr = [];
 51                 for (var i = 0, len = this.getLength(); i < len; i++) {
 52                     if (index === i && this.data[i].checked) continue;
 53                     if (this.data[i].checked) indexArr.push(i);
 54                 }
 55                 return indexArr;
 56             },
 57 
 58             getCheckedKey: function () {
 59                 if (this.data[0].checked) return null;
 60                 var checed = [], index = this.getCheckedIndex();
 61                 for (var i = 0, len = index.length; i < len; i++) {
 62                     checed.push(this.data[index[i]].id);
 63                 }
 64                 return checed;
 65             },
 66 
 67 
 68             showLayer: function() {
 69                 var data = this.data;
 70                 var scope = this;
 71 
 72                 if(!data) return;
 73 
 74                 if (this.layer && this.layer.status == 'show') return;
 75 
 76                 if (!this.layer) {
 77 
 78                     //這裏註釋了車站地圖需求
 79                     this.layer = new UILayerList({
 80                         list: data,
 81                         events: {
 82                             'click .js_ok': function () {
 83                                 this.hide();
 84                             }
 85                         },
 86                         onHide: function () {
 87 
 88                         },
 89                         title: '<span class="fl js_cancel" style="font-weight: 500;">取消</span><span class="fr js_ok" style="color: #00b358; font-weight: 500;">肯定</span>',
 90                         itemFn: function (item) {
 91                             return '<div style="text-align: left; padding-left: 10px; ">' + item.name + '</div>';
 92                         },
 93                         setIndex: function (i) {
 94                             scope.setIndex(i, true);
 95                             this.setIndexArr();
 96                         },
 97                         setIndexArr: function () {
 98                             var indexArr = scope.getCheckedIndex();
 99 
100                             if (typeof indexArr == 'number') indexArr = [indexArr];
101                             this.$('li').removeClass(this.curClass);
102                             for (var i = 0, len = indexArr.length; i < len; i++) this._setIndex(indexArr[i])
103                         },
104                         _setIndex: function (i) {
105                             if (i < 0 || i > this.list.length) return;
106                             this.index = i;
107                             this.$('li[data-index="' + i + '"]').addClass(this.curClass);
108                         }
109                     });
110                 } else {
111                     this.layer.list = data;
112                     this.layer.refresh();
113                 }
114 
115                 this.layer.show();
116                 this.layer.setIndexArr();
117 
118             },
119 
120             hideLayer: function() {
121 
122             }
123         },
124         template: template
125 
126     });
127 
128 });
View Code

從代碼能夠看出,組件中包含了原來的entity的操做,與module操做,事實上這兩塊東西應該也能夠按原來那種方式劃分,讓組件中的代碼更加純粹不去操做過多數據,第一步結束,第二步是當數據變化時候更新到列表,這裏又須要觀察數據變化了,最後造成了這個代碼:

  1 define([
  2     'Vue',
  3     'pages/list.data',
  4     'pages/mod.list',
  5     'pages/mod.sort',
  6     'pages/mod.tabs'
  7 
  8 ], function (Vue,
  9              listData,
 10              ListModule,
 11              SortModule,
 12              TabModule) {
 13 
 14     return new Vue({
 15         components: {
 16             'my-list': ListModule,
 17             'my-sort-bar': SortModule,
 18             'my-tab-item': TabModule
 19         },
 20         data: {
 21             data: formatData(listData),
 22             dataTmp: formatData(listData),
 23             sort: {
 24                 time: 'up',
 25                 sumTime: '',
 26                 price: ''
 27             },
 28             //車次類型
 29             type: [
 30                 {name: '所有車次', id: 'all', checked: true},
 31                 {name: '高鐵城際(G/C)', id: 'g', checked: false},
 32                 {name: '動車(D)', id: 'd', checked: false},
 33                 {name: '特快(T)', id: 't', checked: false},
 34                 {name: '其它類型', id: 'other', checked: false}
 35             ],
 36             setout: getSetout()
 37         },
 38 
 39         methods: {
 40 
 41             _timeSort: function (data, sort) {
 42                 data = _.sortBy(data, function (item) {
 43                     item = item.from_time.split(':');
 44                     item = item[0] + '.' + item[1];
 45                     item = parseFloat(item);
 46                     return item;
 47                 });
 48                 if (sort == 'down') data.reverse();
 49                 return data;
 50             },
 51 
 52             _sumTimeSort: function (data, sort) {
 53                 data = _.sortBy(data, function (item) {
 54                     return parseInt(item.use_time);
 55                 });
 56                 if (sort == 'down') data.reverse();
 57                 return data;
 58             },
 59 
 60             _priceSort: function (data, sort) {
 61                 data = _.sortBy(data, function (item) {
 62                     return item.min_price;
 63                 });
 64                 if (sort == 'down') data.reverse();
 65                 return data;
 66             },
 67 
 68             //獲取導航欄排序後的數據
 69             getSortData: function (data) {
 70                 var tmp = [];
 71                 var sort = this.sort;
 72 
 73                 for (var k in sort) {
 74                     if (sort[k].length > 0) {
 75                         tmp = this['_' + k + 'Sort'](data, sort[k])
 76                         return tmp;
 77                     }
 78                 }
 79             },
 80 
 81             //根據車次類型作篩選
 82             getTypeData: function (data) {
 83                 var typeKeys = [];
 84                 var _data = this.type;
 85 
 86                 for(var i = 0, len = _data.length; i < len; i++) {
 87                     if (_data[0].checked) return data;
 88                     if(_data[i].checked) typeKeys.push(_data[i].id);
 89                 }
 90 
 91                 if (!typeKeys) return data;
 92 
 93                 var tmp = _.filter(data, function (item) {
 94                     var no = item.my_train_number;
 95                     if (_.indexOf(typeKeys, no) != -1) {
 96                         return true;
 97                     }
 98                     return false;
 99                 });
100 
101                 return tmp;
102             },
103 
104             onCreate: function() {
105 
106                 console.log(1)
107 
108             },
109 
110             //根據出發站作篩選
111             //事實上這個方法與getTypeData不是徹底不能重構到一塊兒,可是可讀性可能會變得晦澀
112             getSetoutData: function (data) {
113                 var typeKeys = [];
114                 var _data = this.setout;
115 
116                 for(var i = 0, len = _data.length; i < len; i++) {
117                     if (_data[0].checked) return data;
118                     if(_data[i].checked) typeKeys.push(_data[i].id);
119                 }
120 
121                 if (!typeKeys) return data;
122 
123                 var tmp = _.filter(data, function (item) {
124                     var no = item.from_telecode;
125                     if (_.indexOf(typeKeys, no) != -1) {
126                         return true;
127                     }
128                     return false;
129                 });
130 
131                 return tmp;
132             },
133 
134             renderList: function() {
135                 //這樣實現彷佛很差
136                 var data = this.dataTmp;
137                 data= this.getTypeData(data);
138                 data= this.getSetoutData(data);
139                 data= this.getSortData(data);
140 
141                 this.data = data;
142 
143             }
144 
145         },
146 
147         watch: {
148             sort: {
149                 deep: true,
150                 handler: function () {
151                    this.renderList();
152                 }
153             },
154             type: {
155                 deep: true,
156                 handler: function() {
157                     this.renderList();
158                 }
159             },
160             setout: {
161                 deep: true,
162                 handler: function() {
163                     this.renderList();
164                 }
165             }
166         },
167         el: '#main'
168     });
169 
170     //該方法放到這裏是否合適?
171     function formatData(data) {
172         var item, seat;
173         var typeMap = {
174             'g': 'g',
175             'd': 'd',
176             't': 't',
177             'c': 'g'
178         };
179 
180         //出發時間對應的分鐘數
181         var fromMinute = 0;
182 
183         //獲取當前班車日期當前的時間戳,這個數據是動態的,這裏寫死了
184         var d = 1464192000000;
185         var date = new Date();
186         var now = parseInt(date.getTime() / 1000);
187         date.setTime(d);
188         var year = date.getFullYear();
189         var month = date.getMonth();
190         var day = date.getDate();
191         var toBegin;
192         var seatName, seatIndex, iii;
193 
194         //處理坐席問題,僅顯示二等座,一等座,特等座 無座
195         //                二等座 一等座 商務座 無座 動臥 特等座
196         var my_seats = {};
197         var seatSort = ['二等座', '一等座', '硬座', '硬臥', '軟臥', '商務座', '無座', '動臥', '特等座', '軟座'];
198 
199         for (var i = 0, len = data.length; i < len; i++) {
200             fromMinute = data[i].from_time.split(':');
201             fromMinute[0] = fromMinute[0] + '';
202             fromMinute[1] = fromMinute[1] + '';
203             if ((fromMinute[0].charAt(0) == '0')) fromMinute[0] = fromMinute[0].charAt(1);
204             if ((fromMinute[1].charAt(0) == '0')) fromMinute[1] = fromMinute[1].charAt(1);
205             date = new Date(year, month, day, fromMinute[0], fromMinute[1], 0);
206             fromMinute = parseInt(date.getTime() / 1000)
207             toBegin = parseInt((fromMinute - now) / 60);
208 
209             data[i].toBegin = toBegin;
210 
211             //處理車次類型問題
212             data[i].my_train_number = typeMap[data[i].train_number.charAt(0).toLowerCase()] || 'other';
213 
214             seat = data[i].seats;
215             //全部餘票
216             data[i].sum_ticket = 0;
217             //最低價
218             data[i].min_price = null;
219 
220             for (var j = 0, len1 = seat.length; j < len1; j++) {
221                 if (!data[i].min_price || data[i].min_price > seat[j].seat_price) data[i].min_price = parseFloat(seat[j].seat_price);
222                 data[i].sum_ticket += parseInt(seat[j].seat_yupiao);
223 
224                 //坐席問題若是坐席不包括上中下則去掉
225                 seatName = seat[j].seat_name;
226                 //去掉上中下
227                 seatName = seatName.replace(/上|中|下/g, '');
228                 if (!my_seats[seatName]) {
229                     my_seats[seatName] = parseInt(seat[j].seat_yupiao);
230                 } else {
231                     my_seats[seatName] = my_seats[seatName] + parseInt(seat[j].seat_yupiao);
232                 }
233             }
234             //這裏myseat爲對象,須要轉換爲數組
235             //將定製坐席轉爲排序後的數組
236             data[i].my_seats = [];
237             for (iii = 0; iii < seatSort.length; iii++) {
238                 if (typeof my_seats[seatSort[iii]] == 'number') data[i].my_seats.push({
239                     name: seatSort[iii],
240                     yupiao: my_seats[seatSort[iii]]
241                 });
242             }
243 
244             my_seats = {};
245         }
246 
247         return data;
248     }
249 
250 
251     //根據列表篩選出發站
252     function getSetout() {
253         var data = listData;
254         var stations = [];
255         var stationMap = {};
256         var tmp = [{id: 'all', name: '所有出發站', checked: true}];
257 
258         for (var i = 0, len = data.length; i < len; i++) {
259             stationMap[data[i].from_telecode] = data[i].from_station;
260             if (data[i].from_station_type == '起點' && _.indexOf(stations, data[i].from_telecode) == -1) {
261                 stations.push(data[i].from_telecode);
262             }
263         }
264 
265         for (i = 0, len = stations.length; i < len; i++) {
266             var key = stations[i];
267             var value = stationMap[key];
268             stations[i] = {
269                 id: key,
270                 name: value,
271                 checked: false
272             };
273         }
274 
275         tmp = tmp.concat(stations);
276 
277         return tmp;
278     }
279 
280 
281 });
View Code

這個應該不是最優的作法,後續值得深刻研究,最後咱們實現下tab的選擇效果便結束Vue的代碼。

PS:這個寫的有點累了,具體代碼你們去git上看吧,這裏很少寫了。

總結

Vue帶來了最大一個好處是:

擺脫DOM操做

你真的在頁面中就沒有看到任何DOM操做了!這個是很牛的一個事情,另外Vue的文檔寫的很完備,後面點有時間應該作更深刻全面的學習!

結語

介於篇幅過長,樓主體力虛脫,關於React的實現,下次再補齊吧,文中不足但願您的指出。

轉http://www.cnblogs.com/yexiaochai/p/5228871.html#3434517

相關文章
相關標籤/搜索