-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
6302 lines (6302 loc) · 290 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
function setQiPaoStyle(e) {
$("#chat-msglist").find(".msg-content").each(function() {
var e = $(this);
if ("msg-content" == e.attr("class").trim() || "msg-content huifu" == e.attr("class").trim()) {
var t = t || Math.ceil(5 * Math.random()),
i = "msg-style-" + t,
o = "qipao-icon-" + t + ".png";
qipaoIndex = t, e.addClass(i);
$("<div class='qipao-icon'><img src='" + sourceurl + "/livecommon/skin/newyear/images/2018/" + o + "' ></div>").appendTo($(this))
}
})
}
function buffer2string(e) {
return String.fromCharCode.apply(null, new Uint16Array(e))
}
function string2buffer(e) {
for (var t = new ArrayBuffer(2 * e.length), i = new Uint16Array(t), o = 0, n = e.length; o < n; o++) i[o] = e.charCodeAt(o);
return t
}
function dropAnimate() {
var e = [],
t = document.querySelector(".box");
if (null != t) {
t.style.position = "relative";
for (var i = 0; i < 30; i++) {
var o = document.createElement("div"),
n = new Image,
s = Math.floor(6 * Math.random()) + 1;
n.src = sourceurl + "/livecommon/skin/newyear/images/2018/newyear" + s + ".png", $("body").hasClass("childrenday") && (n.src = sourceurl + "/livecommon/images/children/children-gift" + s + ".png"), o.appendChild(n), o.classList.add("drop-gift", "drop-gift-" + s);
var a = Math.random() * t.clientWidth;
a + n.width > t.clientWidth && (a = t.clientWidth - n.width), o.style.left = a + "px", o.style.bottom = t.clientHeight + Math.floor(500 * Math.random()) + "px", e.push(o), t.appendChild(o)
}
for (var d = 0; d < e.length; d++)!
function(t) {
setTimeout(function() {
Math.random() > .8 && (e[t].style.left = "-50px"), e[t].style.bottom = 0, e[t].style.bottom = "-999px"
}, 1500 * Math.random())
}(d);
dropAnimated = !1, setTimeout(function() {
$(".drop-gift").remove(), dropAnimated = !0, document.body.style.maxWidth = "none"
}, 5e3)
}
}
function startDropAnimate(e) {
if (dropAnimated) {
zbvd.JubilationKey = zbvd.JubilationKey.length > 0 ? zbvd.JubilationKey : ["恭贺新春", "年年有余", "财源滚滚", "万事大吉", "恭喜发财", "狗年吉祥", "新年快乐", "生意兴隆", "大吉大利", "新年", "年年有", "一帆风顺", "大展宏图", "狗", "新春", "春节", "恭喜", "恭贺"];
for (var t = zbvd.JubilationKey, i = 0; i < t.length; i++) if (-1 !== e.indexOf(t[i])) {
dropAnimate();
break
}
}
}
function setWeddingStyle(e) {
$("#chat-msglist").find(".msg-content").each(function() {
var e = $(this);
if ("msg-content" == e.attr("class").trim() || "msg-content huifu" == e.attr("class").trim()) {
var t = t || Math.floor(14 * Math.random()) + 1,
i = "msg-style-" + t,
o = "animation" + t + ".png";
weddingIndex = t, e.addClass(i);
$("<div class='wedding-icon'><img class=animation" + t + " src='" + sourceurl + "/weddingNew/image/" + o + "' ></div>").appendTo($(this))
}
})
}
function giftDrop(e) {
if (dropTimer) return void console.log("动画还在");
var t = document.createDocumentFragment(),
i = document.createElement("div"),
o = document.body.clientWidth - 50;
dropTimer = !0, i.classList.add("giftCon");
for (var n = 1; n < 15; n++) {
var s = document.createElement("div"),
a = document.createElement("img"),
d = Math.ceil(Math.random() * o),
r = Math.ceil(10 * Math.random()) + 70;
a.setAttribute("src", sourceurl + "/weddingNew/image/animation" + n + ".png"), a.classList.add("animation" + n), s.classList.add("drogGift"), s.style.cssText = "left:" + d + "px;transform:translate3d(0," + -r + "px,0)", s.appendChild(a), i.appendChild(s), t.appendChild(i)
}
document.getElementsByClassName("giftAnimationCon")[0].appendChild(t), setTimeout(function() {
for (var e = document.getElementsByClassName("drogGift"), t = 0; t < e.length; t++) {
var i = Math.ceil(6 * Math.random()) + 4,
o = (1.5 * Math.random()).toFixed(1);
e[t].style.cssText += "transform:translate3d(0,999px,0);transition:transform " + i + "s ease " + o + "s"
}
}, 100), setTimeout(function() {
dropTimer = !1, document.getElementsByClassName("giftAnimationCon")[0].innerHTML = ""
}, 9e3)
}
function startGiftDrop(e) {
if (dropAnimated) for (var t = ["新婚快乐", "早生贵子", "白头偕老", "一生一世", "相亲相爱", "恭喜恭喜", "百年好合", "新婚幸福", "祝福", "新福美满", "恭贺新禧", "幸福快乐", "永结同心"], i = 0; i < t.length; i++) if (-1 !== e.indexOf(t[i])) {
giftDrop();
break
}
}
function imReaded(e) {
recordReaded[e] && $("li[attr-id=" + e + "]").find(".recordingMsg").addClass("isReaded")
}
function rememberImReaded(e) {
recordReaded[e] || (recordReaded[e] = (new Date).getTime(), localStorage.setItem("recordReaded", JSON.stringify(recordReaded)))
}!
function() {
function e(e, t) {
var i = new XMLHttpRequest;
return "withCredentials" in i ? i.open(e, t, !0) : void 0 !== i ? (i = new XDomainRequest, i.open(e, t)) : i = null, i
}
function t(e) {}
function o(e, t, i) {
if (e.addEventListener) e.addEventListener(t, i, !1);
else {
if (!e.attachEvent) throw new Error("not supported or DOM not loaded");
e.attachEvent("on" + t, function() {
i.call(e)
})
}
}
function n(e, t) {
for (var i in t) t.hasOwnProperty(i) && (e.style[i] = t[i])
}
function s(e) {
return e.replace(/.*(\/|\\)/, "")
}
function a(e) {
return -1 !== e.indexOf(".") ? e.replace(/.*[.]/, "") : ""
}
function d(e, t) {
return e.currentStyle ? e.currentStyle[t] : window.getComputedStyle ? (propprop = t.replace(/([A-Z])/g, "-$1"), propprop = t.toLowerCase(), document.defaultView.getComputedStyle(e, null)[t]) : null
}
function r(e) {
e.parentNode.removeChild(e)
}
window.imgUpload = function(e, t) {
this._settings = {
project: "wtWap",
folder: "temp",
autoSubmit: !0,
responseType: !1,
multiple: "N",
onChange: function() {},
onComplete: function(e) {},
onError: function() {},
onAllComplete: function() {},
isPass: function() {
return !0
}
}, this.fileArray = [];
for (var i in t) t.hasOwnProperty(i) && (this._settings[i] = t[i]);
if (e.jquery ? e = e[0] : "string" == typeof e && (/^#.*/.test(e) && (e = e.slice(1)), e = document.getElementById(e)), !e || 1 !== e.nodeType) throw new Error("Please make sure that you're passing a valid element");
"A" == e.nodeName.toUpperCase() && o(e, "click", function(e) {
e && e.preventDefault ? e.preventDefault() : window.event && (window.event.returnValue = !1)
}), "CANVAS" == e.tagName ? this.canvasImg(e) : (e.style.overflow = "hidden", "static" == d(e, "position") && (e.style.position = "relative"), this._button = e, this._input = null, this.createInput())
}, imgUpload.prototype = {
createInput: function() {
var e = this,
t = document.createElement("input");
t.setAttribute("type", "file"), t.setAttribute("accept", "image/*"), t.setAttribute("onmousedown", "return false"), t.setAttribute("name", "file"), t.setAttribute("id", "file"), "Y" == e._settings.multiple && t.setAttribute("multiple", "multiple"), n(t, {
position: "absolute",
right: 0,
bottom: 0,
opacity: 0,
margin: 0,
padding: 0,
fontSize: "480px",
cursor: "pointer",
"z-index": "10",
filter: "alpha(opacity=0)"
}), o(t, "change", function() {
if (t && "" !== t.value) {
var i = s(t.value);
if (!i || !/^(jpg|JPG|png|PNG|gif|GIF|bmp|BMP|jpeg|JPEG)$/.test(a(i))) return $(this).popBox({
boxTitle: "温馨提示",
boxContent: "只支持jpg|JPG|png|PNG|gif|GIF|bmp,请重新选择!",
btnType: "confirm",
confirmFunction: function() {
return !1
}
}), !1;
e._settings.autoSubmit && e._settings.isPass() && (e._settings.onChange(), e.submit())
}
}), this._button.appendChild(t), this._input = t
},
canvasImg: function(e) {
var t = dataURLtoBlob(e.toDataURL("image/jpeg"));
this.send2OSS(t)
},
clearInputVal: function() {
r(this._input), this._input = null, this.createInput()
},
submit: function() {
var e = this;
if (e._input.files.length > 1) for (i = 1; i < e._input.files.length; i++) e.fileArray[i - 1] = e._input.files[i];
this.uploadFile(this._input.files[0]), e.clearInputVal()
},
uploadElseFile: function() {
var e = this;
this.uploadFile(e.fileArray.shift())
},
uploadFile: function(i) {
var o = this,
n = i,
s = new FormData;
imgLoadUrl = "", i.size > 10485760 ? ($(document).popBox({
boxTitle: "温馨提示",
boxContent: "请选择小于2M的图片",
btnType: "confirm",
confirmFunction: function() {}
}), $(".uploadStatus2").show(), $(".uploadStatus1").hide(), $(".marker").hide()) : function() {
s.append("Content-Type", i.type), s.append("file", n);
var a = e("POST", "/liveajax/UploadImages");
a.upload.addEventListener("progress", t, !1), a.addEventListener("load", function(e) {
a.status >= 200 && a.status < 300 || 304 == a.status ? o._settings.onComplete(a.responseText) : alert("Request was unsuccessful:" + a.status), o.fileArray.length > 0 ? o.uploadElseFile() : o._settings.onAllComplete()
}, !1), a.addEventListener("error", function(e) {
$(document).popBox({
boxContent: "上传失败,请重试。",
btnType: "confirm"
}), o._settings.onError()
}, !1), a.addEventListener("abort", function(e) {
$(document).popBox({
boxContent: "上传失败,请重试。",
btnType: "confirm"
}), o._settings.onError()
}, !1), a.send(s)
}()
},
uploadFailed: function() {
$(document).popBox({
boxContent: "上传失败,请重试。",
btnType: "confirm"
})
}
}
}(), define("jquery.imgUpload", function() {}), function(e) {
e.fn.extend({
popBox: function(t) {
function i() {
switch (e(o).html(t.boxContent), e(n).removeClass("both"), t.btnType) {
case "confirm":
e(n).html(s);
break;
case "cancel":
e(n).html(a);
break;
case "both":
e(n).addClass("both"), e(n).html(a + s);
break;
default:
e(n).html("")
}
}
t = e.extend({
boxType: "",
boxContent: "",
btnType: "",
confirmName: "确定",
cancelName: "取消",
textAlign: "center",
confirmFunction: function() {}
}, t);
var o = ".pop_content span",
n = ".pop_bottom",
s = '<span><a href="javascript:;" class="pop_btn btn_confirm">' + t.confirmName + "</a></span>",
a = '<span><a href="javascript:;" class="pop_btn btn_cancel">' + t.cancelName + "</a></span>",
d = '<div class="popBox"><b class="bg"></b><div class="main centerwin"><div class="pop_content';
"left" == t.textAlign && (d += " alignLeft"), d += '"><span></span></div><div class="pop_bottom"></div></div></div>', e(".popBox").length > 0 ? (i(), e(".popBox").show()) : (e(d).appendTo("body"), i()), e(document).on("click", ".btn_cancel", function() {
e(".popBox").hide()
}).off("click", ".btn_confirm").on("click", ".btn_confirm", function() {
t.confirmFunction(), e(".popBox").hide()
})
}
}), e.fn.extend({
minTipsBox: function(t) {
function i() {
e(o).html(t.tipsContent);
var i = e(o).width() / 2 + 10;
e(o).css("margin-left", "-" + i + "px")
}
t = e.extend({
tipsContent: "",
tipsTime: 1
}, t);
var o = ".min_tips_box .tips_content",
n = 1e3 * parseFloat(t.tipsTime);
e(".min_tips_box").length > 0 ? (e(".min_tips_box").show(), i(), setTimeout(function() {
e(".min_tips_box").hide()
}, n)) : (e('<div class="min_tips_box"><b class="bg"></b><span class="tips_content"></span></div>').appendTo("body"), i(), setTimeout(function() {
e(".min_tips_box").hide()
}, n))
}
})
}(jQuery), define("jquery.popBox", function() {}), Date.prototype.Format = function(e) {
var t = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"H+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
S: this.getMilliseconds()
};
/(y+)/.test(e) && (e = e.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)));
for (var i in t) new RegExp("(" + i + ")").test(e) && (e = e.replace(RegExp.$1, 1 == RegExp.$1.length ? t[i] : ("00" + t[i]).substr(("" + t[i]).length)));
return e
}, define("livecommon/module/utils", [], function() {
var e = {
symbolFilter: function(e) {
var t = e;
return t = t.replace(/\&/g, "&"), t = t.replace(/(\u0085)|(\u2028)|(\u2029)/g, ""), t = t.replace(/\%/g, "%25"), t = t.replace(/\</g, "<"), t = t.replace(/\>/g, ">"), t = t.replace(/\"/g, """), t = t.replace(/\'/g, "'"), t = t.replace(/\n|\r|(\r\n)/g, "<br/>")
},
IsNullOrEmpty: function(e) {
return void 0 == e || null == e || "" == e
},
getCookieHost: function() {
var e = window.location.host,
t = e.substr(e.indexOf("."), e.length - e.indexOf("."));
return t.length <= 4 && (t = "." + e), t
},
moveToEnd: function(e) {
var t = e.height(),
i = e.find(".liveBoxContent").outerHeight();
e.scrollTop();
e.scrollTop(i - t + 50)
},
moveToEndByOuPai: function(e) {
var t = e.height(),
i = e.find("div").outerHeight();
e.scrollTop();
e.scrollTop(i - t + 50)
},
IsPC: function() {
return -1 == navigator.userAgent.indexOf("Mobile")
},
IsWeiXinChat: function() {
return -1 != navigator.userAgent.toLowerCase().indexOf("micromessenger")
},
isWapBrowser: function() {
var t = navigator.userAgent;
return !e.IsNullOrEmpty(t) && !! (null != t.toLowerCase().match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i) && t.indexOf("MicroMessenger") <= -1)
},
isMobileQQBrowser: function() {
var t = navigator.userAgent;
return !!e.IsNullOrEmpty(t) || !(t.indexOf("MicroMessenger") > -1) && ((t.indexOf("QQBrowser") > -1 || t.indexOf("VivoBrowser") > -1) && t.indexOf("MicroMessenger") <= -1)
},
isAndroid: function() {
var e = navigator.userAgent;
navigator.appVersion;
return e.indexOf("Android") > -1 || e.indexOf("Linux") > -1
},
IsIOS: function() {
return /iphone|ipad|ipod|ios/.test(navigator.userAgent.toLowerCase())
},
getRandomColor: function() {
return "#" +
function(e) {
return new Array(7 - e.length).join("0") + e
}((16777216 * Math.random() << 0).toString(16))
},
getDmRandomColor: function() {
return ["#ff002a", "#007eff", "#00ff00", "#ffc000", "#ffffff"][Math.floor(5 * Math.random())]
},
iscommonleveltbs: function() {
var t = navigator.userAgent;
return !!e.IsNullOrEmpty(t) || (/TBS\/(\d{6})/gi.test(t) ? parseInt(t.match(/TBS\/(\d{6})/)[1]) > 36849 : !! /MQQBrowser\/(\d.\d)/gi.test(t) && parseFloat(t.match(/MQQBrowser\/(\d.\d)/)[1]).toFixed(1) >= 7.1)
},
FormatNum: function(e) {
return "[object Number]" != Object.prototype.toString.call(e) && (e = parseInt(e)), e > 1e4 ? parseFloat(e / 1e4).toFixed(2) + "万" : e.toString()
},
CustomStartAndEndSubstr: function(e, t, i) {
return i = i || "...", e.length <= 3 ? e : e.substr(0, t - 1) + "..." + e.substr(e.length - 1, 1)
},
checkFullScreenFn: function(e) {
for (var t, i, o, n, s, a = ["webkit", "moz"], d = 0, r = a.length; d < r; d++) {
var c = a[d] + "RequestFullScreen",
l = a[d] + "CancelFullScreen";
"function" == typeof e[c] && (t = c, o = e, s = a[d] + "fullscreenchange"), "function" == typeof document[l] && (i = l, n = document)
}
return t || "function" != typeof e.msRequestFullscreen || (t = "msRequestFullscreen", o = e), t || "function" != typeof e.webkitEnterFullScreen || (t = "webkitEnterFullScreen", o = e), i || "function" != typeof document.msExitFullscreen || (i = "webkitExitFullScreen", n = document), i || "function" != typeof e.webkitExitFullScreen || (i = "webkitExitFullScreen", n = e), {
requestFn: t,
requestEl: o,
cancelFn: i,
cancelEl: n,
changeEventName: s
}
},
replaceHtml: function(e) {
return e = e.replace(/<br>/g, ""), e = e.replace(/<br\/>/g, "")
},
getQueryString: function(e, t) {
var i = new RegExp("(^|&)" + e + "=([^&]*)(&|$)", "i"),
o = window.location.search.substr(1).match(i);
return null != o ? unescape(o[2]) : t || null
},
resizeImg: function(e, t, i, o, n, s, a, d) {
return d = d || 100, null == e || void 0 == e || "" == e ? "" : (e = e.replace("vzan-img.oss-cn-hangzhou.aliyuncs.com", "i.vzan.cc"), e.indexOf("//i2.vzan.cc/") > -1 && e.indexOf("imageView2") < 0 ? (1 == o && "" != n && void 0 != n && (e = e.replace("i2.vzan.cc", "i2cut.vzan.cc"), e += "?watermark/1/image/" + n + "/gravity/northwest/dx/" + s + "/dy/" + a), e.indexOf("watermark") > -1 ? e += "|" : e += "?", t && i && t > 0 && i > 0 ? e = e.replace("i2.vzan.cc", "i2cut.vzan.cc") + "imageMogr2/auto-orient/crop/" + 2 * t + "x" + 2 * i + "!/quality/" + d : t && t > 0 ? e = e.replace("i2.vzan.cc", "i2cut.vzan.cc") + "imageMogr2/auto-orient/thumbnail/" + 2 * t + "x/quality/" + d : i && i > 0 ? e = e.replace("i2.vzan.cc", "i2cut.vzan.cc") + "imageMogr2/auto-orient/thumbnail/x" + 2 * i + "/quality/" + d : t || i || (e = e.replace("i2.vzan.cc", "i2cut.vzan.cc") + "imageMogr2/auto-orient/quality/" + d), e) : e.indexOf("//i.vzan.cc/") > -1 && e.indexOf("imageView2") < 0 ? t && i && t > 0 && i > 0 ? e.replace("i.vzan.cc", "icut.vzan.cc") + "?imageMogr2/auto-orient/crop/" + 2 * t + "x" + 2 * i + "!/quality/" + d : t && t > 0 ? e.replace("i.vzan.cc", "icut.vzan.cc") + "?imageMogr2/auto-orient/thumbnail/" + 2 * t + "x/quality/" + d : i && i > 0 ? e.replace("i.vzan.cc", "icut.vzan.cc") + "?imageMogr2/auto-orient/thumbnail/x" + 2 * i + "/quality/" + d : e : e.indexOf("//i.vzan.cc/") > -1 && e.indexOf("?x-oss-process") < 0 ? (t && t > 0 && i && i > 0 ? e += "?x-oss-process=image/resize,limit_0,m_fill,w_" + t + ",h_" + i + "/format," : i && i > 0 ? e += "?x-oss-process=image/resize,h_" + i + "/format," : t && t > 0 && (e += "?x-oss-process=image/resize,w_" + t + "/format,"), e += "jpeg") : e)
},
drawImageByCanvas: function(e, t, i, o) {
var n = document.createElement("canvas"),
s = n.getContext("2d"),
a = 0,
d = [];
n.width = e, n.height = t, i.forEach(function(e, t) {
"" != e.src && (d[t] = new Image, d[t].src = e.src, d[t].onload = function() {
(a += 1) === i.length && d.forEach(function(e, t, a) {
"circle" === i[t].shape && (s.save(), s.arc(n.width / 2, n.height / 2, 77, 0, 2 * Math.PI), s.clip()), s.drawImage(e, i[t].x ? i[t].x : 0, i[t].y ? i[t].y : 0, i[t].w ? i[t].w : n.width, i[t].h ? i[t].h : n.height), s.restore(), t === a.length - 1 && "function" == typeof o && o(n.toDataURL("image/jpeg"))
})
})
})
}
};
return e
}), define("livecommon/module/redbag", ["livecommon/module/utils"], function(e, t) {
function i() {
if (!/\s+/.test($("#bagAmount").val()) && !/\s+/.test($("#bagMoney").val())) {
var e = parseInt($("#bagAmount").val()) || 0,
t = parseFloat($("#bagMoney").val()) || 0,
i = $("#bagAmount").closest(".line"),
o = $("#bagMoney").closest(".line"),
l = $(".service-money"),
p = $("#authCode").val(),
u = $("#redbagpresend").prop("checked") ? 1 : 0,
m = $("#redbagpresendtime").val();
if (e > 500) return i.addClass("line-error"), d.html("最多只能发送500个红包").show(), void $("#btnSendRedBag").attr("disabled", "disabled");
if ("" != p) {
if (!/^([\u2E80-\u9FFF]|[0-9]|[a-zA-Z]){2,}$/g.test(p)) return i.addClass("line-error"), d.html("请输入最少2位红包口令(只能是汉字,字母,数字)").show(), void $("#btnSendRedBag").attr("disabled", "disabled");
i.removeClass("line-error"), d.html("").hide()
}
c.bagAmount = e, c.bagMoney = t, e <= 0 ? (i.addClass("line-error"), d.html(a.msg1).show()) : (i.removeClass("line-error"), d.html("").hide());
var g = 100 * c.bagMoney / (100 * c.bagAmount);
console.log(g + "_" + n), g < n ? (o.addClass("line-error"), d.html(a.msg2).show()) : (o.removeClass("line-error"), d.html("").hide()), c.bagServiceMoney = .02 * c.bagMoney, r.text(parseFloat(c.bagMoney).toFixed(2)), c.bagMoney > 0 && c.bagMoney < s && (o.addClass("line-error"), d.html("红包总金额不能少于" + s + "元").show());
var v = 0,
h = 0,
f = !1;
1 == u && ("" == m ? d.html("请填写红包发送时间").show() : (v = new Date($("#redbagpresendtime").val().replace(/-/g, "/").replace("T", " ")).getTime(), h = (new Date).getTime(), v - h < 12e4 ? d.html("发送时间至少要提前2分钟").show() : f = !0)), c.bagAmount > 0 && c.bagMoney > 0 && g >= n && (1 == u && "" != m && f || 0 == u) && c.bagMoney >= s ? $("#btnSendRedBag").removeAttr("disabled") : $("#btnSendRedBag").attr("disabled", "disabled"), $(".service-money em").text(parseFloat(c.bagServiceMoney).toFixed(2)), c.bagServiceMoney > 0 ? l.show() : l.hide()
}
}
var o = !1,
n = .1,
s = 5,
a = {
randomBtn: "改为拼手气红包",
fixedBtn: "改为普通红包",
randomText: "金额随机",
fixedText: "金额固定",
bagMessage: "",
msg1: "红包个数不能低于1个",
msg2: "红包金额不能低于" + n + "元"
},
d = $("#msg-tipbar"),
r = $(".bag-money-show"),
c = {
bagAmount: 0,
bagMoney: 0,
bagType: 1,
bagMessage: a.bagMessage,
bagServiceMoney: 0
},
l = {
Init: function() {
this.BindEvent()
},
BindEvent: function() {
var t = !1;
$(".redbaglist .contentwrap").scroll(function() {
var e = $(".redbaglist .contentwrap"),
i = e.find(".redbaglist-top").height() + e.find(".info").height() + e.find(".redbag-title").height() + e.find(".redbag-list-wrap").height();
if ($(".redbaglist .contentwrap").scrollTop() + $(".redbaglist .contentwrap").height() >= .9 * i && !t) {
var o = $(".redbaglist .redbag-list"),
n = (parseInt(o.attr("pageindex")) || 0) + 1;
if (n > parseInt(o.attr("pages"))) return;
t = !0, $.post("/live/GetMoreRedBagUsers", {
rid: $(".redbaglist").attr("rid"),
lastid: $(".redbaglist .redbag-list li:last").attr("id"),
pageindex: n
}, function(i) {
if (console.log(n), "" != i && "object" != typeof i) {
o.attr("pageindex", (parseInt(o.attr("pageindex")) || 0) + 1), i = JSON.parse(i);
var s = juicer(document.getElementById("redbag-user-list").innerHTML, i);
e.find(".redbag-list").append(s), t = !1
}
})
}
}), $(document).on("click", "#redbagauthcode", function() {
$(this).attr("src", "/live/ValidateCode?v=" + Math.random())
}).on("click", "#redbagpresend", function() {
$(this).prop("checked") ? $("#redbagpresendtime").closest("li").slideDown("fast") : $("#redbagpresendtime").closest("li").slideUp("fast"), i()
}).on("click", "#redbagfocus", function() {
$("#authCode,#authCodeTip").prop("disabled", !$(this).prop("checked")), (zbvd.roleid > 0 || 1 == zbvd.levels) && ($(this).prop("checked") ? ($("#authCode").closest("li").slideDown("fast"), $("#authCodeTip").closest("li").slideDown("fast")) : ($("#authCode").closest("li").slideUp("fast"), $("#authCodeTip").closest("li").slideUp("fast")))
}).on("click", ".rpna-ul.hongbao,.qianghongbao,.side-tip_rb", function() {
var e = $(this).attr("rid"),
t = $(this);
if ("object" == typeof newredbag) return newredbag.newredbagContentApp.GetRedPacketCheck(e), void(newredbag.newredbagContentApp.tagelid = t.is(".qianghongbao") ? ".qianghongbao" : "");
$.ajax({
type: "POST",
url: "/live/GetRedPacketCheck",
data: {
rid: e
},
beforeSend: function() {
$("#loadingToast").show()
},
dataType: "json",
success: function(i) {
if (o = !1, $("#loadingToast").hide(), i && i.isok) i.msg.haspwd ? $(".openredbg .bag-open").data("haspwd", 1).data("redmsgtip", i.msg.redmsgtip).data("hasfocus", i.msg.hasfocus) : $(".openredbg .bag-open").data("haspwd", "").data("redmsgtip", i.msg.redmsgtip).data("hasfocus", i.msg.hasfocus), l.ShowRedBagOpen(i.msg);
else switch (i.code) {
case "notlogin":
window.location = "/live/tvchat-" + zbvd.topicid + "?types=oauths&t=" + Math.random();
break;
case "topic404":
case "redbag404":
return void alert(i.Msg);
case "over":
return void(t.is(".qianghongbao") ? $.post("/live/GetNewRedPacket", {
tpid: zbvd.topicid,
__RequestVerificationToken: gettoken()
}, function(t) {
t && t.isok ? t.Msg == e ? (l.RedBagIsOver(i), $(".qianghongbao").hide(), $(document).minTipsBox({
tipsContent: "红包抢完了,下次手速要快一点哦^_^",
tipsTime: 1
})) : $(".qianghongbao").attr("rid", t.Msg).fadeIn() : (l.RedBagIsOver(i), $(".qianghongbao").hide(), $(document).minTipsBox({
tipsContent: "红包抢完了,下次手速要快一点哦^_^",
tipsTime: 1
}))
}) : l.RedBagIsOver(i));
case "have":
t.is(".qianghongbao") ? $.post("/live/GetNewRedPacket", {
tpid: zbvd.topicid,
__RequestVerificationToken: gettoken()
}, function(t) {
t && t.isok ? t.Msg == e ? (l.ShowRedBagDetail(e), $(".qianghongbao").hide()) : $(".qianghongbao").attr("rid", t.Msg).fadeIn() : (l.ShowRedBagDetail(e), $(".qianghongbao").hide())
}) : l.ShowRedBagDetail(e);
break;
default:
alert(i.Msg)
}
},
error: function() {
o = !1, $("#loadingToast").hide(), $(document).minTipsBox({
tipsContent: "Error",
tipsTime: 1
})
}
})
}).on("click", ".bag-open", function() {
var e = $(this).attr("rid");
if (zbvd.userid) {
var t = $(".openredbg .bag-open").data("haspwd"),
i = $(".openredbg .bag-open").data("redmsgtip");
if (-1 == $(".openredbg .bag-open").data("hasfocus")) return void l.OpenRedBag("", e);
t ? layer.prompt({
title: "请输入红包口令,并确认",
formType: 0
}, function(t, i) {
if (layer.close(i), "" == t) return void layer.msg("请输入红包口令");
l.OpenRedBag(t, e)
}) : l.OpenRedBag("", e);
var o = setInterval(function() {
var e = $(".layui-layer-prompt .layui-layer-input");
1 == e.length && (clearInterval(o), e.removeAttr("placeholder"), void 0 != i && "" != i && e.attr("placeholder", "口令提醒:" + i))
}, 1)
} else window.location = baseURL + "/live/tvchat-" + zbvd.topicid + "?types=oauths"
}).on("click", ".lookothers,.news-alert-red-packet.redbag", function() {
if ($(".openredbg").hide(), "object" == typeof newredbag) return void newredbag.newredbagContentApp.lookRedbagDetail($(this).attr("rid"));
l.ShowRedBagDetail($(this).attr("rid"))
}).on("click", ".bag-close,.redbaglist,.bag-mask", function(e) {
$(e).is("img") || ($(".openredbg").hide(), $(".redbaglist").hide(), $(".openredbg .bag-open").data("haspwd", "").data("redmsgtip", ""))
}).on("input", "#bagAmount", function() {
i()
}).on("input", "#bagMoney,#redbagpresendtime", function() {
i()
}).on("input", "#bagMessage", function() {
var e = $(this).val();
e.length > 25 && $(this).val(e.substring(0, 25)), i()
}).on("input", "#authCode", function() {
i()
}).on("click", "#changeRedType", function() {
c.bagType = 1 == c.bagType ? 0 : 1, 1 == c.bagType ? ($(".redtype .typemsg").html(a.randomText), $("#changeRedType").html(a.fixedBtn), $(".totalmoney i").show()) : 0 == c.bagType && ($(".redtype .typemsg").html(a.fixedText), $("#changeRedType").html(a.randomBtn), $(".totalmoney i").hide())
}).on("click", ".redbagbtn,.fahongbao,.icon-user-red-packet,.inputicon.redpacket", function() {
$(".panel-more").hide(), $(".sendredbagwin").show()
}).on("click", ".btn-cancel", function() {
$("#redbagpresend").prop("checked") && ($("#redbagpresend").click(), $("#redbagpresendtime").val("")), $(".sendredbagwin").hide()
}).on("click", "#btnSendRedBag", function() {
i();
var e = !1;
if (!e) {
$("#loadingToast").show(), c.bagMessage = $("#bagMessage").val() || $("#bagMessage").attr("placeholder");
var t = {
liveId: zbvd.zbid || 0,
topicId: zbvd.topicid || 0,
total_fee: parseInt(100 * c.bagMoney),
byUserId: parseInt(zbvd.userid) || 0,
rtype: c.bagType,
focus: -1,
nums: c.bagAmount,
note: (c.bagMessage || "").replace(/\s/gi, ""),
redpwd: ($("#authCode").val() || "").replace(/\s/gi, ""),
redmsgtip: ($("#authCodeTip").val() || "").replace(/\s/gi, ""),
rptype: $("#redbagpresend").prop("checked") ? 1 : 0,
rptime: $("#redbagpresendtime").val(),
citys: ($("#scitys").val() || "").replace("所有城市", "").replace(",所有区域", ""),
shoperAd: $("#shoper_type_img").attr("src")
};
e = !0, $.ajax({
type: "POST",
url: baseURL + "/live/PayCenter",
data: t,
success: function(e) {
if (e && e.isok && null != e.Msg) callPay(e.Msg, t);
else {
if (e && "001" == e.code) return void(window.location.href = e.Msg);
$("#loadingToast").hide(), $(document).minTipsBox({
tipsContent: e.Msg,
tipsTime: 1
})
}
},
error: function() {
e = !1, $("#loadingToast").hide(), $(document).minTipsBox({
tipsContent: "error",
tipsTime: 1
})
}
})
}
}).on("click", ".tianjia-pic", function(t) {
e.IsWeiXinChat() ? wx.chooseImage({
count: 1,
success: function(e) {
var t = {
localId: [],
serverId: []
};
t.localId = e.localIds;
t.localId.length;
t.serverId = [], function() {
wx.uploadImage({
localId: t.localId[0],
isShowProgressTips: 1,
success: function(e) {
t.serverId.push(e.serverId), $.ajax({
type: "post",
url: "/liveajax/UploadImagesByWx",
data: {
mediaId: e.serverId,
zbid: zbvd.zbid,
tpid: zbvd.topicid,
types: "img",
upType: 1
},
dataType: "JSON",
success: function(e) {
e && e.isok ? $("#shoper_type_img").attr("src", e.filepath) : $(document).minTipsBox({
tipsContent: e.Msg,
tipsTime: 1
})
},
error: function() {
$(document).minTipsBox({
tipsContent: "图片上传错误!",
tipsTime: 1
})
}
})
},
fail: function(e) {
$(document).minTipsBox({
tipsContent: "图片上传失败!",
tipsTime: 1
})
}
})
}()
}
}) : $("#pcshoperfileUpload").click()
}).on("change", "#pcshoperfileUpload", function() {
$.ajaxFileUpload({
url: "/liveajax/UploadImagesByWx",
secureuri: !1,
data: {
mediaId: "pcUpload",
zbid: zbvd.zbid,
tpid: zbvd.topicid,
types: "img",
upType: 1
},
fileElementId: "pcshoperfileUpload",
dataType: "json",
success: function(e, t) {
e && e.isok ? $("#shoper_type_img").attr("src", e.filepath) : $(document).minTipsBox({
tipsContent: e.Msg,
tipsTime: 1
})
}
})
})
},
OpenRedBag: function(e, t) {
if (zbvd.userid) {
if (!o) {
o = !0, $("#loadingToast").show();
var i = {
zbid: zbvd.zbid || 0,
tpid: zbvd.enc_topicid,
rid: t,
code: e,
__RequestVerificationToken: gettoken()
};
$.ajax({
type: "POST",
url: "/live/GetRedPacket",
data: i,
beforeSend: function() {},
success: function(e) {
o = !1;
var t = null;
if (e && e.isok) {
l.ShowRedBagDetail(i.rid), window.openkey = "", window.lastmsg = "";
try {
$(".layui-layer-close").click(), clearInterval(t)
} catch (e) {}
} else if ($("#loadingToast").hide(), "抱歉,您已领取了红包!" == e.Msg) $(document).minTipsBox({
tipsContent: e.Msg,
tipsTime: 3
}), l.ShowRedBagDetail(i.rid);
else if ("抱歉,红包已抢完" == e.Msg) $(document).minTipsBox({
tipsContent: e.Msg,
tipsTime: 3
}), l.ShowRedBagDetail(i.rid);
else if ("shoperAd" == e.Msg) {
var n = e.code.split(",");
m = 0, layer.open({
title: "商家红包",
shade: .5,
area: ["90%", "225px"],
content: "<img src=" + n[1] + ' style="width:100%; height:120px;" />',
btn: ["等待[" + n[0] + "]", "关闭"],
btn1: function(e, t) {},
btn2: function(e, i) {
clearInterval(t), $.post("/live/DelRedPacketCache", {
tpId: zbvd.topicid,
uid: zbvd.userid
}, function(e) {})
},
success: function(e, i) {
t = setInterval(function() {
m == n[0] && (clearInterval(t), $(".bag-open").click()), $(".layui-layer-title").html("商家广告 <font color='red'>" + (n[0] - m) + " 秒</font>"), $(".layui-layer-btn0").html("等待 [<font color='red'>" + (n[0] - m) + " 秒</font>]"), m += 1
}, 1e3), $(".layui-layer-dialog .layui-layer-content").css("padding", "10px")
},
cancel: function(e) {
clearInterval(t), $.post("/live/DelRedPacketCache", {
tpId: zbvd.topicid,
uid: zbvd.userid
}, function(e) {})
}
})
} else $(document).minTipsBox({
tipsContent: e.Msg,
tipsTime: 3
})
},
error: function() {
o = !1, $("#loadingToast").hide(), $(document).minTipsBox({
tipsContent: "请求异常,请重试!",
tipsTime: 3
})
}
})
}
} else window.location = baseURL + "/live/tvchat-" + zbvd.topicid + "?types=oauths"
},
ShowRedBagOpen: function(e) {
$(".openredbg .bag-photo").attr("src", e.headimgurl), $(".openredbg .bag-username").html(e.nickname), $(".bag-open").attr("rid", e.id).show(), $(".lookothers").attr("rid", e.id).show(), $(".bag-bagtype").show(), $(".bag-des").html(e.content), 1 == e.type ? $(".bag-bagtype i").show() : $(".bag-bagtype i").hide(), $(".openredbg").show()
},
RedBagIsOver: function(e) {
$(".bag-bagtype").hide(), $(".bag-des").html("手慢了,红包派完了"), $(".bag-open").hide(), $(".openredbg .bag-photo").attr("src", e.headimgurl), $(".openredbg").attr("rid", e.id).show(), $(".bag-open").attr("rid", e.id), $(".lookothers").attr("rid", e.id).show(), $(".openredbg .bag-username").html(e.nickname)
},
ShowRedBagDetail: function(e) {
$(".openredbg").hide(), $.ajax({
type: "POST",
url: "/live/GetRedPacketInfo",
data: {
rid: e
},
beforeSend: function() {
$("#loadingToast").show()
},
dataType: "json",
success: function(t) {
if ($("#loadingToast").hide(), !t || !t.isok) return void alert(t.msg);
"null" != !t.mybag && ($(".info-moeny").hide(), $(".info-tips").hide());
var i = $(".redbaglist"),
o = (t.userinfo, t.redbag);
i.find(".bag-photo").attr("src", t.redbag.headimgurl), i.find(".info-name span").html(t.redbag.nickname), 1 == t.redbag.rtype ? i.find(".info-name i").show() : i.find(".info-name i").hide(), i.find(".info-moeny span").html(o), i.find(".redbag-title i").html(parseFloat(t.redbag.total_amount / 100).toFixed(2)), i.find(".redbag-title span").html(t.redbag.target_user_count);
var n = t.redbag.target_user_count - t.redbag.current_user_count;
n > 0 ? i.find(".redbag-title em").html(",还剩" + n + "个").show() : i.find(".redbag-title em").html("").hide(), null != t.mybag && (i.find(".info-moeny span").text(parseFloat(t.mybag.packet_money / 100).toFixed(2)), i.find(".info-moeny").show()), i.find(".info-des").html(t.redbag.content);
var s = juicer(document.getElementById("redbag-user-list").innerHTML, t);
i.find(".redbag-list").html(s);
var a = 0;
a = t.redbag.current_user_count <= 20 ? 1 : t.redbag.current_user_count % 20 > 0 ? parseInt(t.redbag.current_user_count / 20) + 1 : t.redbag.current_user_count / 20, i.find(".redbag-list").attr({
allcount: t.allcount,
pages: a,
pageindex: 0
}), i.attr("rid", e), i.show(), 1 == t.redbag.rtype && t.redbag.target_user_count == t.redbag.current_user_count && t.users.length > 0 && t.redbag.total_amount / t.redbag.target_user_count > 10 && $(".redbag-list li:first div:last").append("<span class='thebest'>手气最佳</span>")
}
})
},
GetNewRedBag: function() {
setTimeout(function() {
$.post("/live/GetNewRedPacket", {
tpid: zbvd.enc_topicid,
__RequestVerificationToken: gettoken()
}, function(e) {
e && e.isok && $(".qianghongbao").attr("rid", e.Msg).fadeIn()
})
}, 4e3)
}
};
return l
}), define("livecommon/module/shop", [], function(e) {
if ("Shop" != zbvd.tplname) return {};
window.shopReq = window.shopReq || {};
var t = {
Init: function() {
"" != window.shopReq.bid && this.BindEvent()
},
BindEvent: function() {
$(document).ajaxSuccess(function(e, i, o) {
for (var n = !0, s = ["getSpeak", "GetOnlineNumber", "savefocus"], a = 0; a < s.length; a++) if (-1 != o.url.indexOf(s[a])) {
n = !1;
break
}
n && t.log(JSON.parse(i.responseText))
}), $(document).ajaxError(function(e, i, o) {
t.log([e, i, o]), $("#loadingToast").hide()
}), this.loadData(), $(document).on("click", ".addshoplink", function() {
$("div#addshopBox").show()
}), $(".shopImg-up").length > 0 && new imgUpload($(".shopImg-up"), {
onComplete: function(e) {
$("#loadingToast").hide(), e = JSON.parse(e), e && e.isok ? ($(".shopImg-up img").attr("src", e.thumbimg), $("#shopImg").attr("hasImg", 1)) : alert(e.msg)
},
onChange: function() {
$("#loadingToast").show()
},
onError: function() {}
}), $("#shopAdd").click(function() {
var e = $("#shopTitle").val(),
i = $("#shopPrice").val(),
o = $("#shopBuyLink").val(),
n = $("#shopImg").attr("src");
return e ? i ? i && isNaN(i) ? $(document).minTipsBox({
tipsContent: "价格只能填写数字",
tipsTime: 1
}) : o ? isURL(o) ? 1 != $("#shopImg").attr("hasImg") ? $(document).minTipsBox({
tipsContent: "请上传商品图片",
tipsTime: 1
}) : void $.ajax({
type: "POST",
url: "/liveajax/addShop",
data: {
TopicId: zbvd.topicid,
ProductName: e,
BuyLinkUrl: o,
CurrentPrice: i,
PicIds: n
},
success: function(e) {
$(document).minTipsBox({
tipsContent: e.Msg,
tipsTime: 1
}), e && e.isok && ($("div#addshopBox").hide(), t.loadData(), $("#shopTitle,#shopPrice,#shopBuyLink").val(""), $("#shopImg").attr("src", "/livecontent/livecommon/images/img-upload.png"))
},
error: function() {
$(document).minTipsBox({
tipsContent: "网络异常",
tipsTime: 1
})
}
}) : void $(document).minTipsBox({
tipsContent: "请输入正确的Url",
tipsTime: 1
}) : $(document).minTipsBox({
tipsContent: "购买链接不能为空",
tipsTime: 1
}) : $(document).minTipsBox({
tipsContent: "价格不能为空",
tipsTime: 1
}) : $(document).minTipsBox({
tipsContent: "商品名称不能为空",
tipsTime: 1
})
}), $(document).on("click", ".icon-shop-del", function(e) {
var i = $(this),
o = i.data("id"),
n = i.data("gsps");
$(document).popBox({
boxContent: "确定要从购物车中移除?",
btnType: "both",
confirmFunction: function() {
t.ajaxApiProcess(t.shopApi.deleteGoodsOfCarts, {
topicId: zbvd.topicid,
sid: shopReq.sid,
bid: shopReq.bid,
gid: o,
gsps: n
}, function(e) {
$("#shopCar").html(parseInt($("#shopCar").html()) - 1), i.closest(".ul_car_shop").remove(), t.processCarList()
})
}
})
}), $(document).on("click", ".addvzlink", function() {
t.preventScroll(), $("#wzyxBox").show(), $(".shop-index-search-bt").click(), t.nodeScroll($("#search_pager"), function() {
t.loadvzyxData(!0)
})
}), $(document).on("click", ".shop-index-search-bt", function() {
$("#search_pager").data("pi", 1), t.loadFlag = !1, t.loadvzyxData()
}), $(document).on(ClickOrTap, ".vzyx_sel", function(e) {
var t = $(this).data("id");
$(this).hasClass("active") ? $(this).removeClass("active") : $(this).addClass("active"), $.post("/liveajax/VZYXShopOpt", {
topicId: zbvd.topicid,
Id: t
}, function(e) {
e && e.isok ? $(document).minTipsBox({
tipsContent: "已选择" + $(".vzyx_sel.active").length + "件商品",
tipsTime: 1
}) : $(document).minTipsBox({
tipsContent: e.Msg,
tipsTime: 1
})
}, "json"), e.preventDefault()
}), $("#wzyxBox .dianshang-black-mask").click(function(e) {
$("#wzyxBox").hide(), $(".shop-index-input").val(""), t.loadData()
}), $(document).on("click", "#shopList ul.look-buy-cell", function() {
var e = $(this).data("url");
e && 0 == $(this).data("type") && (window.location.href = e)
}), $(document).on("click", "#shopList .look-buy-head,#shopList .look-buy-title,#topShop .dianshang-head,#topShop .dianshang-hudong-title", function(e) {
var i = $(this).closest(".look-buy-cell"),
o = "1" == i.data("type") && i.data("id");
o || (o = $(this).closest("#topShop").find(".icon-tui-cart").data("id")), o && ($("#loadingToast").show(), t.preventScroll(), $("#yx_shop_intro").find("iframe").attr("src", shopReq.apiAddress + "getGoodsDetail-" + o + ".htm").data("id", o).end().stop().animate({
top: "0"
}, 500, function() {
$("#yx_shop_intro #shop_intro_box").css({
top: "",
bottom: 0
})
}))
}), $("#yx_shop_intro iframe").load(function() {
$("#loadingToast").hide()
}), $("#yx_shop_intro #shop_intro_buy").click(function(e) {
var t = $("#yx_shop_intro iframe").data("id");
$(".icon-tui-cart").trigger(ClickOrTap, t)
}), $("#yx_shop_intro #shop_intro_close").click(function(e) {
t.enabledScroll(), $("#yx_shop_intro").animate({
top: "100%"
}, 600).find("#shop_intro_box").css({
top: "100%",
bottom: ""
}).end().find("iframe").attr("src", "")
}), $("#div_carList .dianshang-black-mask").click(function(e) {
$("#div_carList").hide()
}), $(".address_cancle").click(function(e) {
t.videoOpt(1), $("#shop_user_address").hide(), $("#shopCar").show(), !t.isGoBuy && $("#div_carList").show(), t.isGoBuy = !1, t.goBuyData = null
}), $(document).on(ClickOrTap, ".icon-buy-cart,.icon-tui-cart", function(e, i) {
if (!zbvd.userid) return $(document).minTipsBox({
tipsContent: "请先登录!",
tipsTime: 1
});
t.ids = null, $("#i_byu_num").html("1"), $("#shopCar").hide();
var o = i || $(this).data("id");
$("#loadingToast").show(), t.ajaxApiProcess(t.shopApi.getGoods, {
gids: o,
wxid: shopReq.sid
}, function(e) {
$("div.sd-tk-option-infor ul:not(.choose-Num)").remove(), e && e.size > 0 ? (t.goodDetail = e.datas[0], $("#yxShopImg").css("background-image", "url(" + t.goodDetail.img + ")"), $("#yxShopPrice").html(t.goodDetail.price), $("#yxShopInventory").html("库存:" + t.goodDetail.inventory), $("#yxShopChoose").html(""), laytpl($("#yxShopDetailTpl").html()).render(t.goodDetail.specsList, function(e) {
$("div.sd-tk-option-infor").prepend(e), $("#yx_shop_detail").show()
})) : $(document).minTipsBox({
tipsContent: "没有找到对应商品",
tipsTime: 1
})
}), e.preventDefault()
}), $(document).on(ClickOrTap, "#icon_shop_close", function(e) {
$("#yx_shop_detail").hide(), $("ul.live-qiye-nav li.on").data("showcar") && $("#shopCar").show(), e.preventDefault()
}), $(document).on(ClickOrTap, "#i_byu_plus", function(e) {
var i = parseInt($("#i_byu_num").html()),
o = t.getInvetory_detail();
if (i < o.inventory) {
i += 1, $("#i_byu_num").html(i);
var n = (o.price * i).toFixed(2);
$("#yxShopPrice").html(n)
} else $(document).minTipsBox({
tipsContent: "已超出该商品库存",
tipsTime: .8
});
e.preventDefault()
}), $(document).on(ClickOrTap, "#i_byu_reduce", function(e) {
var i = parseInt($("#i_byu_num").html()),
o = t.getInvetory_detail();
if (i > 1) {
i -= 1, $("#i_byu_num").html(i);
var n = (o.price * i).toFixed(2);
$("#yxShopPrice").html(n)
}
e.preventDefault()
}), $(document).on(ClickOrTap, ".sd-option", function(e) {
var i = $(this).data("img"),