1function hs_doupload(cmp_photo, callback) { 2 var img = cmp_photo.split(',')[1]; 3 img = window.atob(img); 4 var ia = new Uint8Array(img.length); 5 for (var i = 0; i < img.length; i++) { 6 ia[i] = img.charCodeAt(i) 7 } 8 var blob = new Blob([ia], {type: "image/jpeg"}); 9 var formdata = new FormData(); 10 formdata.append('file', blob); 11 $.ajax({ 12 type: 'post', 13 url: _APPNAME + '?id=xigua_hb&ac=uploader&inajax=1&formhash=' + FORMHASH, 14 data: formdata, 15 processData: false, 16 contentType: false, 17 dataType: 'xml', 18 success: function (data) { 19 if (null == data) { 20 tip_common('error|' + ERROR_TIP); 21 return false 22 } 23 var s = data.lastChild.firstChild.nodeValue; 24 if (s.indexOf('success') !== -1) { 25 var html = '<li class="weui-uploader__file weui-uploader__file_status" style="background-image:url(' + cmp_photo + ')"><input type="hidden" name="' + filedname + '[]" value="' + s.split('|')[1] + '"/><div class="weui-uploader__file-content"><i class="weui-icon-warn iconfont icon-shanchu"></i></div></li>'; 26 $('#loadingimg').remove(); 27 if (boxer.data('only')) { 28 boxer.html(html) 29 } else { 30 boxer.append(html) 31 } 32 if (callback && typeof callback === 'function') { 33 callback() 34 } 35 } else { 36 tip_common(s) 37 } 38 } 39 }) 40} 41 42var vvv = {}; 43 44function bslset(result) { 45 vvv = JSON.parse(result); 46 vvv.latitude = vvv.Latitude; 47 vvv.longitude = vvv.Longitude; 48 callback(vvv) 49} 50 51function hs_getlocation(callback) { 52 if (0 && typeof mag != 'undefined') { 53 mag.getLocation(function (res) { 54 callback(res) 55 }) 56 } else if (typeof sq != 'undefined') { 57 sq.getLocation(function (res) { 58 callback(res) 59 }) 60 } else if (typeof QFH5 != 'undefined') { 61 QFH5.getLocation(function (state, data) { 62 if (state == 1) { 63 callback(data) 64 } else { 65 // alert(data.error) 66 } 67 }) 68 } else if ((HB_INWECHAT && HS_MULTIUPLOAD) == 1) { 69 wx.getLocation({ 70 type: 'gcj02', success: function (res) { 71 callback(res) 72 }, cancel: function (res) { 73 } 74 }) 75 } else if (IN_TT) { 76 tt.getLocation({ 77 success(res) { 78 callback(res) 79 }, fail(res) { 80 console.log("getLocationè°ç¨å¤±è´¥", res) 81 }, 82 }) 83 } else if (mkey && !IN_PROG) { 84 console.log('myapp'); 85 new qq.maps.Geolocation(mkey, "myapp").getLocation(callback, function (err) { 86 }, {timeout: 4000, failTipFlag:false}) 87 }else if(baiduKey){ 88 var geolocation = new BMap.Geolocation(); 89 geolocation.getCurrentPosition(function(r) { 90 if (this.getStatus() == BMAP_STATUS_SUCCESS) { 91 callback({lat:r.point.lat, lng: r.point.lng}); 92 } else { 93 $.alert('BAIDU ' + this.getStatus()); 94 } 95 }); 96 } else { 97 const goptions = { 98 enableHighAccuracy: true, 99 timeout: 5000, 100 maximumAge: 0, 101 }; 102 navigator.geolocation.getCurrentPosition(function (pos) { 103 callback({lat: pos.coords.latitude, lng: pos.coords.longitude}); 104 }, function (err) { 105 if(GOOGLE){ 106 $.ajax({type : 'POST',data: '', 107 url: "https://www.googleapis.com/geolocation/v1/geolocate?key="+GOOGLE, 108 success: function(result){ 109 callback({lat: result['location']['lat'], lng: result['location']['lng']}); 110 }}); 111 }else{ 112 $.alert(`ERROR(${err.code}): ${err.message}`); 113 } 114 }, goptions); 115 } 116} 117 118function hs_comment(shid, touid, title) { 119 $.prompt({ 120 title: title, input: PLZINPUT, empty: false, onOK: function (input) { 121 $.showLoading(); 122 $.ajax({ 123 type: 'post', 124 url: _APPNAME + '?id=xigua_hs&ac=comment&do=add&inajax=1&shid=' + shid, 125 data: {'comment': input, 'touid': touid, 'formhash': FORMHASH}, 126 dataType: 'xml', 127 success: function (data) { 128 $.hideLoading(); 129 if (null == data) {
130 tip_common('error|' + ERROR_TIP); 131 return false 132 } 133 var s = data.lastChild.firstChild.nodeValue; 134 var msgar = tip_common(s); 135 if (msgar[0] == 'success') { 136 var cmurl = _APPNAME + '?id=xigua_hb&ac=comment_li&cid=' + msgar[3] + '&inajax=1'; 137 if ($('#comment_ul_' + pubid).length > 0) { 138 cmurl = cmurl + '&multi=1' 139 } 140 $.ajax({ 141 type: 'get', url: cmurl, dataType: 'xml', success: function (data) { 142 if (null == data) { 143 tip_common('error|' + ERROR_TIP); 144 return false 145 } 146 var s = data.lastChild.firstChild.nodeValue; 147 $('#cmt_wrap_' + pubid).show(); 148 $('#r_' + pubid).show(); 149 $('#cmt_list_' + pubid).show().prepend(s); 150 $('#comment_ul_' + pubid).show().prepend(s) 151 } 152 }) 153 } 154 }, 155 error: function () { 156 $.hideLoading() 157 } 158 }) 159 }, onCancel: function () { 160 } 161 }) 162} 163 164function jumpmanagesh(newshid) { 165 hb_setcookie('newshid', newshid, 7200); 166 window.location.href = _APPNAME + '?id=xigua_hs&ac=myshop&mobile=2&shid=' + newshid + _URLEXT 167} 168 169function hs_getnext(id, name, datahref) { 170 $('.sub_check a').removeClass('checked').removeClass('main_color'); 171 $('.sub_check a').parent().removeClass('checked').removeClass('main_color'); 172 $('#sub_check' + id).addClass('checked').addClass('main_color'); 173 $.ajax({ 174 type: 'get', 175 url: _APPNAME + '?id=xigua_hs&ac=chosecity&province=' + $('.first_check+.checked').find('a').text() + '&name=' + name + '&ctid=' + id + '&datahref=' + encodeURIComponent(datahref) + '&inajax=1', 176 dataType: 'xml', 177 success: function (data) { 178 if (null == data) { 179 tip_common('error|' + ERROR_TIP); 180 return false 181 } 182 var s = data.lastChild.firstChild.nodeValue; 183 $('.ajaxbox_cheker').html(s); 184 let retli = $('.ajaxbox_cheker').find('li'); 185 console.log(retli.length); 186 if(retli.length==1){ 187 retli.find('a').trigger('click'); 188 } 189 } 190 }) 191} 192 193function hs_paytel(id, pri, pricat) { 194 $.confirm({ 195 title: LXFS, text: CKXFF + pri + QRZF, onOK: function () { 196 $.showLoading(); 197 $.ajax({ 198 type: 'post', 199 url: _APPNAME + '?id=xigua_hs&ac=telpay&inajax=1&hyid=' + pricat + '&shid=' + id, 200 dataType: 'xml', 201 success: function (data) { 202 $.hideLoading(); 203 if (null == data) { 204 tip_common('error|' + ERROR_TIP); 205 return false 206 } 207 var s = data.lastChild.firstChild.nodeValue; 208 tip_common(s) 209 }, 210 error: function () { 211 $.hideLoading() 212 } 213 }) 214 } 215 }) 216} 217 218var pge = 1; 219 220function comment_profile(shid) { 221 lst = $('#clist'); 222 var cloadingurl = _APPNAME + '?id=xigua_hs&ac=comment&shid=' + shid + '&inajax=1&pagesize=10&page='; 223 DOAPPEND = 0; 224 $.showLoading(); 225 $.ajax({ 226 type: 'post', url: cloadingurl + '' + pge, dataType: 'xml', success: function (data) { 227 $.hideLoading(); 228 if (null == data) { 229 tip_common('error|' + ERROR_TIP); 230 return false 231 } 232 var s = data.lastChild.firstChild.nodeValue; 233 $('#loading-show').addClass('hidden'); 234 if (!s) { 235 $('#loading-show').addClass('hidden'); 236 $('#loading-none').removeClass('hidden'); 237 setTimeout(function () { 238 $('#loading-show').addClass('hidden'); 239 $('#loading-none').removeClass('hidden') 240 }, 300); 241 $('#comment_ul_more').remove(); 242 return 243 } else { 244 $('#comment_ul_more').show() 245 } 246 lst.append(s); 247 pge++; 248 lm = false 249 }, error: function () { 250 lm = false;
251 $.hideLoading() 252 } 253 }); 254 return false 255} 256 257$(function () { 258 $(document).on('click', '.center_upload_save', function () { 259 var that = $(this), form = $('#formnew'); 260 $.showLoading(); 261 that.attr('disabled', '1'); 262 $.ajax({ 263 type: 'post', 264 url: form.attr('action') + '&save_jieshao=1&inajax=1', 265 data: form.serialize(), 266 dataType: 'xml', 267 success: function (data) { 268 $.hideLoading(); 269 that.removeAttr('disabled'); 270 if (null == data) { 271 tip_common('error|' + ERROR_TIP); 272 return false 273 } 274 var s = data.lastChild.firstChild.nodeValue; 275 tip_common(s); 276 setTimeout(function () { 277 $.closePopup() 278 }, 300) 279 }, 280 error: function () { 281 $.hideLoading(); 282 that.removeAttr('disabled') 283 } 284 }); 285 return false 286 }); 287 $(document).on('click', '#v_openLocation,.v2_openLocation', function () { 288 var that = $(this); 289 if ((HB_INWECHAT && HS_MULTIUPLOAD) == 1) { 290 wx.openLocation({ 291 latitude: that.data('lat'), 292 longitude: that.data('lng'), 293 name: that.data('name'), 294 address: that.data('addr'), 295 scale: 14, 296 infoUrl: window.location.href 297 }) 298 } else if (GOOGLE) { 299 window.location.href = 'https://www.google.com/maps/search/?api=1&query=' + that.data('lat') + ',' + that.data('lng') 300 } else if (typeof BAIDUSDK != 'undefined') { 301 window.location.href = '//api.map.baidu.com/marker?location=' + that.data('lat') + "," + that.data('lng') + '&coord_type=gcj02&zoom=10&title=' + encodeURIComponent(that.data('name')) + '&output=html&src=webapp.baidu.openAPIdemo&content=' + encodeURIComponent(that.data('addr')) 302 } else { 303 window.location.href = "//apis.map.qq.com/uri/v1/marker?marker=coord:" + that.data('lat') + "," + that.data('lng') + ";title:" + encodeURIComponent(that.data('name')) + ";addr:" + encodeURIComponent(that.data('addr')) 304 } 305 return false 306 }); 307 $(document).on('click', '.hs_share', function () { 308 if (navigator.userAgent.indexOf('bsl') >= 0 && typeofBSL != 'undefined') { 309 var opter = f_getOption(); 310 BSL.Share(opter.desc, opter.imgUrl, opter.link, opter.title, null); 311 return false 312 } 313 var that = $(this); 314 var hsid = that.data('id'); 315 $('#wechat-mask').show(); 316 if (sessionStorage.getItem('hws' + hsid)) { 317 return false 318 } 319 $.ajax({ 320 type: 'post', 321 url: _APPNAME + '?id=xigua_hs&ac=incr&incr_type=shares&shid=' + hsid + '&inajax=1', 322 data: {'formhash': FORMHASH}, 323 dataType: 'xml', 324 success: function (data) { 325 sessionStorage.setItem('hws' + hsid, 1) 326 } 327 }) 328 }); 329 $(document).on('click', '.do_follow', function () { 330 var that = $(this); 331 $.showLoading(); 332 $.ajax({ 333 type: 'post', 334 url: _APPNAME + '?id=xigua_hs&ac=follow&do=do_follow&shid=' + that.data('id') + '&inajax=1', 335 data: {'formhash': FORMHASH}, 336 dataType: 'xml', 337 success: function (data) { 338 $.hideLoading(); 339 if (null == data) { 340 tip_common('error|' + ERROR_TIP); 341 return false 342 } 343 var s = data.lastChild.firstChild.nodeValue; 344 if (s.split('|')[1] == '1') { 345 that.html(yiguanzhu).addClass('weui-btn_disabled'); 346 if (that.data('qr') && IN_WECHAT) { 347 $.alert("<img src='" + that.data('qr') + "' /><br>" + gengduodongtai, guanzhu_sj) 348 } 349 } else { 350 tip_common(s); 351 that.html(jiaguanzhu).removeClass('weui-btn_disabled') 352 } 353 }, 354 error: function () { 355 $.hideLoading() 356 } 357 }) 358 }); 359 $(document).on('click', '.index_search', function () { 360 var that = $(this); 361 $('#search_popup').popup(); 362 setTimeout(function () { 363 $('#search_popup').show() 364 }, 500) 365 }); 366 $(document).on('click', '#index_search', function () { 367 var that = $(this); 368 $('#search_popup').popup(); 369 setTimeout(function () { 370 $('#search_popup').show() 371 }, 500) 372 }); 373 $(document).on('click', '#history_gonggao', function () { 374 var that = $(this); 375 $.showLoading(); 376 $.ajax({ 377 type: 'get', 378 url: _APPNAME + '?id=xigua_hs&ac=notice&do=history&inajax=1&shid=' + that.data('id'), 379 dataType: 'xml', 380 success: function (data) { 381 $.hideLoading(); 382 if (null == data) {
383 tip_common('error|' + ERROR_TIP); 384 return false 385 } 386 var s = data.lastChild.firstChild.nodeValue; 387 $('#history_outer').html(s); 388 $('#history_popup').popup() 389 }, 390 error: function () { 391 $.hideLoading() 392 } 393 }) 394 }); 395 $(document).on('click', '.hscat', function () { 396 var that = $(this); 397 var id = that.data('id'), shid = that.data('shid'); 398 that.addClass('weui_bar__item_on').siblings().removeClass('weui_bar__item_on'); 399 if (id && isNaN(id)) { 400 if (id !== 'newdt') { 401 $("#list").html($('#' + id).html()); 402 scrollto = 0; 403 return false 404 } 405 } 406 page = 1; 407 if (id) { 408 loadingurl = _APPNAME + '?id=xigua_hb&ac=list_item&inajax=1&shid=' + shid + '&cat_id=' + id + '&page='; 409 if (id === 'newdt') { 410 loadingurl = _APPNAME + '?id=xigua_hb&ac=list_item&inajax=1&newdt=' + shid + '&page=' 411 } 412 scrollto = 1 413 } else if (shid) { 414 loadingurl = _APPNAME + '?id=xigua_hs&ac=follow&do=fans&inajax=1&shid=' + shid + '&page='; 415 scrollto = 0 416 } else if (that.data('loadurl')) { 417 loadingurl = that.data('loadurl'); 418 scrollto = 1 419 } 420 DOAPPEND = 0; 421 $.showLoading(); 422 $.ajax({ 423 type: 'get', url: loadingurl + '' + page, dataType: 'xml', success: function (data) { 424 $.hideLoading(); 425 if (null == data) { 426 tip_common('error|' + ERROR_TIP); 427 return false 428 } 429 var s = data.lastChild.firstChild.nodeValue; 430 $('#loading-show').addClass('hidden'); 431 if (!s) { 432 $('#loading-show').addClass('hidden'); 433 $('#loading-none').removeClass('hidden'); 434 setTimeout(function () { 435 $('#loading-show').addClass('hidden'); 436 $('#loading-none').removeClass('hidden') 437 }, 300); 438 $("#list").html(s); 439 page = -1; 440 return 441 } 442 $("#list").html(s); 443 if (typeof loadingCallback !== 'undefined') { 444 loadingCallback() 445 } 446 page++ 447 }, error: function () { 448 $.hideLoading() 449 } 450 }) 451 }); 452 $(document).on('click', '.do_comment', function () { 453 var that = $(this); 454 $('#comment_popup').popup(); 455 return false 456 }); 457 $(document).on('click', '.comment_tijiao', function () { 458 var that = $(this), cmtpic = '', cmtmsg = $('#comment_content').val(); 459 $('input[name="comment_photo[]"]').each(function () { 460 cmtpic += ',' + $(this).val() 461 }); 462 $('input[name="form[album][]"]').each(function () { 463 cmtpic += ',' + $(this).val() 464 }); 465 $.showLoading(); 466 $.ajax({ 467 type: 'post', 468 url: _APPNAME + '?id=xigua_hs&ac=comment&do=comment&shid=' + that.data('id') + '&inajax=1', 469 data: {'formhash': FORMHASH, comment: cmtmsg, cmtphoto: cmtpic}, 470 dataType: 'xml', 471 success: function (data) { 472 $.hideLoading(); 473 if (null == data) { 474 tip_common('error|' + ERROR_TIP); 475 return false 476 } 477 var s = data.lastChild.firstChild.nodeValue; 478 var msgar = tip_common(s); 479 if (msgar[0] == 'success') { 480 $('.weui-uploader__files').html(''); 481 $('#comment_content').val('').html(''); 482 $.closePopup(); 483 $.ajax({ 484 type: 'get', 485 url: _APPNAME + '?id=xigua_hs&ac=comment&cid=' + msgar[3] + '&inajax=1', 486 dataType: 'xml', 487 success: function (data) { 488 if (null == data) {
489 tip_common('error|' + ERROR_TIP); 490 return false 491 } 492 var s = data.lastChild.firstChild.nodeValue; 493 $('#comment_ul_first').after(s) 494 } 495 }) 496 } 497 }, 498 error: function () { 499 $.hideLoading() 500 } 501 }); 502 return false 503 }); 504 $(document).on('click', '.cmt_sh', function () { 505 var that = $(this); 506 var shid = that.data('shid'), touid = that.data('authorid'), title = HUIFU1 + that.data('author'); 507 var cmtid = that.data('cmtid'); 508 if (cmtid) { 509 $.modal({ 510 title: title, 511 text: "<div class=\"b-color13 fixipt13\"><textarea class=\"weui-textarea weui-prompt-input needsclick\" id=\"weui-modal-input\" placeholder=\"" + PLZINPUT + "\" rows=\"3\"></textarea></div>", 512 buttons: [{ 513 text: QUXIAO, className: "default", onClick: function () { 514 } 515 }, { 516 text: SHANCHU, className: "default", onClick: function () { 517 $.showLoading(); 518 $.ajax({ 519 type: 'post', 520 url: _APPNAME + '?id=xigua_hs&ac=cmt&do1=del&inajax=1', 521 data: {'cmtid': cmtid, 'formhash': FORMHASH}, 522 dataType: 'xml', 523 success: function (data) { 524 $.hideLoading(); 525 if (null == data) { 526 tip_common('error|' + ERROR_TIP); 527 return false 528 } 529 var s = data.lastChild.firstChild.nodeValue; 530 tip_common(s) 531 }, 532 error: function () { 533 $.hideLoading() 534 } 535 }) 536 } 537 }, { 538 text: QUEDING, className: "primary", onClick: function () { 539 var input = $('#weui-modal-input').val(); 540 $.showLoading(); 541 $.ajax({ 542 type: 'post', 543 url: _APPNAME + '?id=xigua_hs&ac=comment&do=comment&inajax=1&shid=' + shid, 544 data: {'comment': input, 'touid': touid, 'formhash': FORMHASH}, 545 dataType: 'xml', 546 success: function (data) { 547 $.hideLoading(); 548 if (null == data) { 549 tip_common('error|' + ERROR_TIP); 550 return false 551 } 552 var s = data.lastChild.firstChild.nodeValue; 553 var msgar = tip_common(s); 554 if (msgar[0] == 'success') { 555 $.ajax({ 556 type: 'get', 557 url: _APPNAME + '?id=xigua_hs&ac=comment&cid=' + msgar[3] + '&inajax=1', 558 dataType: 'xml', 559 success: function (data) { 560 if (null == data) { 561 tip_common('error|' + ERROR_TIP); 562 return false 563 } 564 var s = data.lastChild.firstChild.nodeValue; 565 $('#comment_ul_first').after(s) 566 } 567 }) 568 } 569 }, 570 error: function () { 571 $.hideLoading() 572 } 573 }) 574 } 575 },] 576 }); 577 return false 578 } 579 $.prompt({ 580 title: title, input: PLZINPUT, empty: false, onOK: function (input) { 581 $.showLoading(); 582 $.ajax({ 583 type: 'post', 584 url: _APPNAME + '?id=xigua_hs&ac=comment&do=comment&inajax=1&shid=' + shid, 585 data: {'comment': input, 'touid': touid, 'formhash': FORMHASH}, 586 dataType: 'xml', 587 success: function (data) { 588 $.hideLoading(); 589 if (null == data) {
590 tip_common('error|' + ERROR_TIP); 591 return false 592 } 593 var s = data.lastChild.firstChild.nodeValue; 594 var msgar = tip_common(s); 595 if (msgar[0] == 'success') { 596 $.ajax({ 597 type: 'get', 598 url: _APPNAME + '?id=xigua_hs&ac=comment&cid=' + msgar[3] + '&inajax=1', 599 dataType: 'xml', 600 success: function (data) { 601 if (null == data) { 602 tip_common('error|' + ERROR_TIP); 603 return false 604 } 605 var s = data.lastChild.firstChild.nodeValue; 606 $('#comment_ul_first').after(s) 607 } 608 }) 609 } 610 }, 611 error: function () { 612 $.hideLoading() 613 } 614 }) 615 }, onCancel: function () { 616 } 617 }) 618 }); 619 $(document).on('click', '#near_cat', function () { 620 var that = $(this); 621 var href = that.data('href'); 622 hs_getlocation(function (position) { 623 var lat = (position.latitude || position.lat), lng = (position.longitude || position.lng); 624 window.location.href = href + '&lat=' + lat + '&lng=' + lng 625 }) 626 }); 627 if (typeof neednear != 'undefined') { 628 hs_getlocation(function (position) { 629 var lat = (position.latitude || position.lat), lng = (position.longitude || position.lng); 630 loadingurl = neednear + '&ac=myshop_li&viewtype=near&inajax=1&lat=' + lat + '&lng=' + lng + '&page='; 631 console.log(loadingurl); 632 console.log('load_morelist'); 633 load_morelist() 634 }) 635 } 636 if ($('.coupon_swiper').length > 0) { 637 var coupon_swiper = new Swiper('.coupon_swiper', { 638 slidesPerView: 'auto', 639 paginationClickable: true, 640 spaceBetween: 0 641 }) 642 } 643});
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.