1/************************************************************* 2Auhtor <ChengFeng> 3Create Date <2013-05-15> 4Description <å°è£ 屿§> 5*************************************************************/ 6/** 7*å°è£ é¢è®¢æ¡åå¼ 8*/ 9let BookingInfo = { 10 /** 11 * åå§åé¢è®¢æ¡åºæ¬ä¿¡æ¯ 12 * @param cityName åå¸åç§° 13 * @param storeName é¨åºåç§° 14 * @param address å°åä¿¡æ¯ 15 * @param date [yyyy-MM-dd]åè½¦æ¥æ 16 * @param hour [HH]å车æ¶é´ 17 * @function 18 */ 19 Initialize: function(cityName, storeName, address, date, hour) { 20 this.CityName = cityName; 21 this.StoreName = storeName; 22 this.Address = address; 23 this.Date = date; 24 this.Hour = hour; 25 }, 26 27 /** 28 *å½åæä½ç±»å 29 *@param type [get/ret][å车/è¿è½¦] 30 *@function 31 */ 32 Type: function(type) { // æå彿° 33 this.Type = type; 34 }, 35 36 /** 37 *æ¯å¦é车ä¸é¨ 38 *@function 39 *@return boolean 40 */ 41 IsSendAndReturnService: function(value) { 42 this.IsSendAndReturnService = value; 43 } 44}; 45 46 47/** 48*æµ®æ¡æ§å¶ 49*/ 50let Floating = { 51 /** 52 * @param source æµ®å±DOMå ç´ 53 * @param targetSource é¼ æ ç¹å»DOMå ç´ 54 * @function 55 */ 56 Initialize: function (source, targetSource) { 57 this.Source = source; 58 this.TargetSource = targetSource; 59 }, 60 61 /** 62 * @param isMouseOut é¼ æ æ¯å¦ç§»å¼ 63 * @function 64 */ 65 IsMouseOut: function (isMouseOut) { 66 this.IsMouseOut = isMouseOut; 67 }, 68 /** 69 * @param IsServiceMouseOut é¼ æ æ¯å¦ç§»å¼ 70 * @function 71 */ 72 IsServiceMouseOut: function (isMouseOut) { 73 this.IsServiceMouseOut = isMouseOut; 74 }, 75 76 /** 77 * æµ®æ¡éèæ§å¶ 78 * @function 79 * @return boolean 80 */ 81 IsHide: function () { 82 return this.Source == null && this.Target == null; 83 }, 84 85 /** 86 * cssç±» 87 88 * @class 89 */ 90 XyOpts: {}, 91 92 /** 93 * 设置浮æ¡åæ å®ä½ 94 * @function 95 */ 96 VerticalPosition: function (source) { 97 let xy = $(source).position(); 98 let id = $(source).attr("id"); 99 if (!this.XyOpts[source]) { 100 this.XyOpts[id] = { 101 left: xy.left + "px", 102 top: xy.top + 26 + "px", 103 position: "absolute", 104 "z-index":99 105 }; 106 } 107 }, 108 InternationalVerticalPosition: function (source) { 109 let xy = $(source).position(); 110 let id = $(source).attr("id"); 111 if (!this.XyOpts[source]) { 112 this.XyOpts[id] = { 113 left: xy.left + "px", 114 top: xy.top + 30 + "px", 115 position: "absolute", 116 "z-index": 99 117 }; 118 } 119 }, 120 /** 121 * 设置浮æ¡åæ å®ä½ 122 * @function 123 */ 124 HorizontalPosition: function (source) { 125 let xy = $(source).position(); 126 let id = $(source).attr("id"); 127 let width = $(BookTarget.PickupStoreNameId).width(); 128 width = width > 150 ? width + 29 : width + 25; 129 if (!this.XyOpts[source]) { 130 this.XyOpts[id] = { 131 left: xy.left + width + "px", 132 top: xy.top + "px", 133 position: "absolute", 134 "z-index":99 135 }; 136 } 137 }, 138 /** 139 * æµ®æ¡å®ä½ 140 *@param type:å®ä½ç¹ 141 142 *@param currentId:å½åç¹å»Htmlå¯ä¸æ è®° 143 *@param floatBox:æµ®æ¡å¯ä¸æ è®° 144 * @function 145 */ 146 IsShow: function (type, currentId, floatBox) { 147 if (floatBox == FloatTarget.FlightNumber) { 148 this.HorizontalPosition(currentId); 149 $(floatBox).css(this.XyOpts[$(currentId).attr("id")]).show(); 150 } else { 151 this.VerticalPosition(currentId); 152 $(floatBox).css(this.XyOpts[$(currentId).attr("id")]).show(); 153 } 154 }, 155 InternationalIsShow: function (type, currentId, floatBox) { 156 this.InternationalVerticalPosition(currentId); 157 $(floatBox).css(this.XyOpts[$(currentId).attr("id")]).show(); 158 } 159}; 160 /** 161 *æµ®å± 162 */ 163FloatTarget = { 164 /** 165 * @param cityBoxId å叿µ®æ¡ID 166 * @param storeBoxId é¨åºæµ®æ¡ID 167 * @function 168 */ 169 Initialize: function (cityBoxId, storeBoxId, sendBoxId, getFree, timeselect, hbhbox, cityautoBoxId, timeselectminute) { 170 this.CityBoxId = "#" + cityBoxId; 171 this.StoreBoxId = "#" + storeBoxId; 172 this.SendBoxId = "#" + sendBoxId; 173 this.FreeId = "#" + getFree; 174 this.SelectTime = "#" + timeselect; 175 this.FlightNumber = "#" + hbhbox; 176 this.CityAutoBoxId = "#" + cityautoBoxId; 177 this.TimeSelectMinute = "#" + timeselectminute; 178 }, 179 180 FloatBoxIdList: function () { 181 return this.CityBoxId + "," + this.StoreBoxId + "," + this.SendBoxId + "," + this.FreeId + "," + FloatTarget.FlightNumber + "," + this.SelectTime + "," + this.CityAutoBoxId + ",#gjtimeselect,#gjCity," + this.TimeSelectMinute; 182 }, 183 184 /** 185 *å叿¡ 186 187 */ 188 CityBoxTarget: { 189 CitySpan: ".ydcity-box .list-city li dl dd span", 190 CityLi: ".ydcity-box .list-city li", 191 CityTab: " .ydcity-box .list-type li" 192 }, 193 /** 194 *é¨åºæ¡ 195 196 */ 197 StoreBoxTarget: { 198 StoreContentSpan: ".ydk-box .list-mendian li .dl-mendian dd span", 199 StoreTabLi: ".ydk-box .list-area li", 200 StoreContentLi: ".ydk-box .list-mendian li", 201 StoreDetail: ".ydk-box .inf-box", 202 StoreAdd: ".ydk-box .inf-box .inf-address .address", 203 StoreSend: ".ydk-box .inf-box .inf-address .sp-scd", 204 StoreTime: ".ydk-box .inf-box .inf-time .txt-time", 205 StoreMap: ".ydk-box .inf-box .inf-address li .link-map", 206 StorePhoneNumber: ".ydk-box .inf-box .inf-time .storephone span" 207 }, 208 209 /** 210 * éè¿è½¦æå¡ID 211 */ 212 ServiceTarger: { 213 City: "#shcBox .list-city li", 214 LeftInput: "#txtSelectType", 215 LeftSelectType: ".shc-form .select-type .select-showbox", 216 RightInput: "#txtSelectArea", 217 RightSelectArea: ".shc-form .select-area .select-showbox", 218 Address: "#txtShcAddress", 219 ListCityLi: ".shc-box .list-city li", 220 SelectBox: ".shc-form .select-showbox",
221 ServicePrice: ".shc-form .op-box .txt-price .price", 222 ServiceSelectShowBoxLi: ".shc-form .select-showbox .type-list li" 223 }, 224 /** 225 *å è´¹é车æå¡ 226 */ 227 FreeRoad: { 228 Roadspan: ".road ul li span", 229 Community: ".community ul.cun li", 230 Back: ".free .back", 231 CommunityId: "#community" 232 }, 233 /** 234 *æ¯å¦å è´¹æå¡ 235 *@param vArg å ç´ éä¸å¼ 236 237 *@param str å¹é ç®æ 238 *@function 239 *@return Boolean true æ¯ false 䏿¯ 240 */ 241 IsFreeSendService: function (vArg, str) { 242 return vArg !=null && vArg.indexOf(str) > -1; 243 }, 244 /** 245 *颿¿åæ¢ 246 */ 247 TabHF: { 248 tabTitleLi: ".tabHF-title li", 249 tabContent: ".tabHF-content", 250 tabContentLi: ".tabHF-content li" 251 } 252}; 253 254 /** 255 * é¢è®¢æ¡æ ç¾ID 256 */ 257let BookTarget = { 258 /** 259 *åå§åé¢å®æ¡æ ç¾ID 260 * @param pickupCityId å车åå¸ID 261 * @param returnCityId è¿è½¦åå¸ID 262 * @param pickupStoreId å车é¨åºID 263 * @param returnStoreId è¿è½¦é¨åºID 264 * @param pickupAddressId å车å°åID 265 * @param returnAddressId è¿è½¦å°åID 266 * @param fromDateId å¼å§æ¶é´ 267 268 * @param toDateId ç»ææ¶é´ 269 * @function 270 */ 271 Initialize: function (pickupCityId, returnCityId, pickupStoreId, returnStoreId, getCheck, retCheck, pickupAddressId, returnAddressId, fromDateId, toDateId, getTime, retTime, sameReturnAddress,pickupMinute,returnMinute) { 272 this.PickupCityId = "#" + pickupCityId; 273 this.ReturnCityId = "#" + returnCityId; 274 this.PickupStoreNameId = "#" + pickupStoreId; 275 this.ReturnStoreNameId = "#" + returnStoreId; 276 this.SendServiceCheckId = "#" + getCheck; 277 this.ReturnServiceCheckId = "#" + retCheck; 278 this.SendServiceId = "#" + pickupAddressId; 279 this.ReturnServiceId = "#" + returnAddressId; 280 this.FromDateId = "#" + fromDateId; 281 this.ToDateId = "#" + toDateId; 282 this.FromTimeId = "#" + getTime; 283 this.ToTimeId = "#" + retTime; 284 this.FromMinuteId = "#" + pickupMinute; 285 this.ToMinuteId = "#" + returnMinute; 286 this.SameReturnAddress = "#" + sameReturnAddress; 287 }, 288 PickupStoreID: "#getStoreId", 289 ReturnStoreID: "#retStoreId", 290 PickupHourID:"#getTime", 291 ReturnHourID:"#retTime", 292 FlightNumberID: "#flightNumber", 293 PickUpFreeServicePointId:"#PickUpFreeServicePointId", 294 ReturnFreeServicePointId: "#ReturnFreeServicePointId", 295 DisplayType:"#hdnDisplayType", 296 AhrNearStore:"#ahrNearStore", 297 Address:"#txtAddress" 298}; 299 300/* 301*é¢è®¢æ¡Ajax 302*ajax 请æ±è·¯å¾ 303*/ 304let BookingAjax = { 305 //请æ±è·¯å¾ 306 Url: { 307 }, 308 /** 309 *é¢è®¢æ¡è¯·æ± 310 *@param url 请æ±è·¯å¾ 311 *@param param 请æ±åæ° 312 *@param type è¿åæ°æ®ç±»å 313 *param callBack åè°å½æ° 314 */ 315 ReqStore: function (url, param, type, storeCallBack) { 316 let self = this; 317 // param type 为 object 318 let paramKey = JSON.stringify(param); 319 320 let config = []; 321 $.ajax({ 322 type: "POST", 323 url: "/Common/SiteConfig?key=2026011201&platform=1011026", 324 dataType: "json", 325 async: false, 326 success: function (res) { 327 let parsedConfig = []; 328 try { 329 let rawData = typeof res.data === 'string' ? JSON.parse(res.data) : res.data; 330 parsedConfig = Array.isArray(rawData) ? rawData : []; 331 } catch (e) { 332 parsedConfig = []; 333 } 334 config = parsedConfig; 335 }, 336 error: function () { 337 console.warn("è·åéèé¨åºé 置失败ï¼ä½¿ç¨ç©ºé ç½®"); 338 config = []; 339 } 340 }); 341 342 const processStoreData = function (htmlData) { 343 if ($("#pickUpCityId").val() != $("#returnCityId").val() && type === "ReturnStore") { 344 const parser = new DOMParser(); 345 const doc = parser.parseFromString(htmlData, 'text/html'); 346 347 const currentCityId = param.cityId; 348 const currentConfig = config.find(item => item.ReturnCityId == currentCityId); 349 350 if (currentConfig && currentConfig.HideStoreId) {
351 currentConfig.HideStoreId.forEach(storeId => { 352 const targetSpans = doc.querySelectorAll(`span[sid="${storeId}"]`); 353 targetSpans.forEach(span => { 354 if (span.parentElement) { 355 span.parentElement.remove(); 356 } 357 }); 358 }); 359 } 360 return doc.body.innerHTML; 361 } 362 return htmlData; 363 }; 364 365 // å·²å卿°æ®ï¼ç´æ¥è¿å 366 //if (paramKey in self.ResData[type]) { 367 // let processedData = processStoreData(self.ResData[type][paramKey]); 368 // storeCallBack(processedData); 369 // return false; 370 //} 371 372 $.ajax({ 373 type: "POST", 374 url: url, 375 data: param, 376 dataType: "html", 377 async: false, 378 success: function (data) { 379 let processedData = processStoreData(data); 380 381 self.ResData[type][paramKey] = processedData; 382 storeCallBack(processedData); 383 } 384 }); 385 return false; 386 }, 387 ReqStoreAsync: function (url, param, type, storeCallBack) { 388 let self = this; 389 390 // param type 为 object 391 let paramKey = JSON.stringify(param); 392 393 // å·²å卿°æ®ï¼ç´æ¥è¿å 394 if (paramKey in self.ResData[type]) { 395 storeCallBack(self.ResData[type][paramKey]); 396 return false; 397 } 398 $.ajax({ 399 type: "POST", 400 url: url, 401 data: param, 402 dataType: "html", 403 async: true, 404 success: function (data) { 405 self.ResData[type][paramKey] = data; 406 storeCallBack(data); 407 } 408 }); 409 return false; 410 }, 411 ReqAjax: function (url, param, httpVerbs, type, dataType, callback) { 412 let self = this; 413 if (param in self.ResData[type]) { 414 callback(self.ResData[type][param]); 415 return false; 416 } 417 $.ajax({ 418 type: httpVerbs, 419 data: param, 420 url: url, 421 dataType: dataType, 422 contentType: "application/json;charset=UTF-8", 423 async: false, 424 cache: false, 425 success: function (data) { 426 self.ResData[type][param] = data; 427 callback(data); 428 } 429 }); 430 return false; 431 }, 432 /** 433 *é¢è®¢æ¡è¯·æ± 434 435 *@param target æ¥æ¶è¿åDomå ç´ çID 436 *@param url 请æ±åæ° 437 *@param param 请æ±åæ° 438 *@param type è¿åæ°æ®ç±»å 439 */ 440 ReqService: function (url, param, target, type) { 441 let self = this; 442 // param type 为 object 443 let paramKey = JSON.stringify(param); 444 445 if (paramKey in self.ResData[type]) { 446 $(target).html(""); 447 $(target).html(self.ResData[type][paramKey]); 448 return false; 449 } 450 $(target).html("<li class=\"btn-subload\" style=\"display:block;\"></li>"); 451 $(target).load(url, param, function (data) { 452 self.ResData[type][paramKey] = data; 453 }); 454 return false; 455 }, 456 /* 457 *æé®æäº¤ 458 **/ 459 ReqSubmit: function(url,storeCallBack) { 460 $.ajax({ 461 type: "post", 462 url: url, 463 contentType: "application/json", 464 async: false, 465 success: function(data) { 466 storeCallBack(data); 467 } 468 }); 469 }, 470 471 /* 472 *ä¿åè¿åæ°æ® 473 **/ 474 ResData: { 475 DefaultCity:{}, 476 DefaultStore: {}, 477 ReturnStore: {}, 478 Store: {}, 479 NearStore: {}, 480 SendAndReturnService:{}, 481 SendAndReturnCity: {}, 482 FreeService: {}, 483 FreeServiceRoad: {}, 484 SelectedTime: {}, 485 ServiceMap: {}, 486 MapPositionAddress: {}, 487 MapPositionPath: {}, 488 IsAllowMapService: {}, 489 nba: {}, 490 initmap: {}, 491 HotCartype: {}, 492 InternationalCity: {}, 493 searchNearAddress: {}, 494 SportStore: {}, 495 ReturnSportStore: {}, 496 ReturnNearStore: {}, 497 CityList: {} 498 } 499};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.