PageSourceSearch

https://www.wpdaxue.com/wp-content/cache/min/1/wp-content/themes/b2/Assets/fontend/main.js?ver=1788334796

js wpdaxue.com collected 2026-10-02 17:03:46 UTC 91,036 bytes, 236 lines download raw bytes

1axios.defaults.timeout=1000000;Vue.prototype.$http=axios;Vue.prototype.$https=axios;Vue.prototype.$b2JsonData=[];var b2_rest_url=b2_global.rest_url+"b2/v1/";var b2zoom=new Zooming({enableGrab:!0,scrollThreshold:0,transitionDuration:0.2,scaleBase:0.96,scaleExtra:1,customSize:"100%",});var B2ClientWidth=document.body.clientWidth;const b2token=b2getCookie("b2_token");var lazyLoadInstance=new LazyLoad({elements_selector:".lazy",threshold:0,});if(b2token){Vue.prototype.$http.defaults.headers.common.Authorization="Bearer "+b2token}
2Vue.prototype.$store=new Vuex.Store({state:{userData:"",userRole:"",announcement:"",oauthLink:"",openOauth:!1,authorData:"",carts:{},_carts:{},canImg:!1,xieyi:0,},mutations:{setUserData(state,data){state.userData=data},setUserRole(state,data){state.userRole=data},setAnnouncement(state,data){state.announcement=data},setOauthLink(state,data){state.oauthLink=data},setOpenOauth(state,data){state.openOauth=data},setauthorData(state,data){state.authorData=data},setcartsData(state,data){state.carts=data},set_cartsData(state,data){state._carts=data},setcanImage(state,data){state.canImg=data},},});var passiveSupported=!1;try{var options=Object.defineProperty({},"passive",{get:function(){passiveSupported=!0}
2,});window.addEventListener("test",null,options)}catch(err){}
3b2WidgetImageLoaded();function b2WidgetImageLoaded(){imagesLoaded(document.querySelectorAll(".widget-area"),function(instance){b2SidebarSticky()})}
4function b2isWeixin(){var ua=navigator.userAgent.toLowerCase();return ua.match(/MicroMessenger/i)=="micromessenger"}
5document.ready=function(callback){if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,!1);callback()},passiveSupported?{passive:!0}:!1)}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState=="complete"){document.detachEvent("onreadystatechange",arguments.callee);callback()}})}else if(document.lastChild==document.body){callback()}};var topsearch=new Vue({el:".top-search",data:{type:"post",data:"",show:!1,b2token:!1,},mounted(){if(!this.$refs.topsearch)return;this.b2token=b2token;const s=this.$refs.topsearch.getAttribute("data-search");this.data=JSON.parse(s);if(b2GetQueryVariable("type")&&b2GetQueryVariable("s")){this.type=b2GetQueryVariable("type")}else{this.type=Object.keys(this.data)[0]}},});const goodsBoxs=document.querySelectorAll(".module-products");if(goodsBoxs.length>0){for(let i=0;i<goodsBoxs.length;i++){new Vue({el:goodsBoxs[i].querySelector(".shop-box"),data:{id:0,opts:[],locked:!1,paged:1,},mounted(){this.opts=JSON.parse(goodsBoxs[i].querySelector(".shop-box").getAttribute("data-opts"))},methods:{getGoods(id){if(this.loaded)return;this.locked=!0;var data={terms:[id],count:this.opts.count,w:this.opts.w,h:this.opts.h,open:this.opts.open,ratio:this.opts.ratio,paged:this.paged,};if(id==0){delete data.terms}
6this.id=id;this.$https.post(b2_rest_url+"getShopList",Qs.stringify(data)).then((res)=>{if(res.data){this.$el.querySelector(".b2_gap").innerHTML=res.data;this.$nextTick(()=>{lazyLoadInstance.update()})}
7this.locked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},},})}}
8var mobileMenu=new Vue({el:"#mobile-menu-button",data:{show:!1,b2token:!1,},mounted(){if(B2ClientWidth>=768)return;this.b2token=b2token;this.dorpMenu()},methods:{dorpMenu(){let drop=document.querySelectorAll(".has_children .b2-arrow-down-s-line");if(drop.length>0){for(let index=0;index<drop.length;index++){drop[index].onclick=(event)=>{event.stopPropagation();event.preventDefault();if(event.target.parentNode.parentNode.className.indexOf(" show")==-1){this.hideAll();event.target.parentNode.parentNode.className+=" show"}else{this.hideAll()}}}}},hideAll(){let sub=document.querySelectorAll(".has_children .sub-menu");for(let i=0;i<sub.length;i++){sub[i].parentNode.className=sub[i].parentNode.className.replace(" show","")}},showMenu(val){const menu=document.querySelector("#mobile-menu");body=document.querySelector("html");if(val){menu.className+=" show-menu-box";body.className+=" m-open";this.show=!0}else{menu.className=menu.className.replace(" show-menu-box","");setTimeout(()=>{body.className=body.className.replace(" m-open","")},300);this.show=!1}},showAc(){this.show=!this.show;this.showMenu(this.show)},},});Vue.component("search-box",{props:["show","searchType"],template:b2_global.search_box,data(){return{showSearch:!1,type:"post",}},mounted(){const search=document.querySelector(".top-search");if(search){const data=search.getAttribute("data-search");if(data){let json=JSON.parse(data);this.type=Object.keys(json)[0]}}},methods:{close(){this.$emit("close")},},watch:{searchType(val){this.type=val},},});var b2SearchBox=new Vue({el:"#search-box",data:{searchType:"all",show:!1,},methods:{close(){this.show=!this.show},},});function historyWidget(){let history=document.querySelectorAll(".b2-widget-history");if(history.length>0){for(let i=0;i<history.length;i++){new Vue({el:history[i],data:{data:[],count:10,},mounted(){this.count=history[i].querySelector(".history-widget").getAttribute("data-count");let historys=JSON.parse(localStorage.getItem("b2_view_history"))||[];this.data=historys.slice(0,this.count);this.$nextTick(()=>{b2RestTimeAgo(this.$el.querySelectorAll(".b2timeago"))})},methods:{clear(){let r=confirm(b2_global.js_text.global.clear_history);console.log(r);if(r){localStorage.removeItem("b2_view_history");this.data=[]}},},})}}}
9var userTools=new Vue({el:".top-user-info",data:{showDrop:!1,role:{write:!0,newsflashes:!1,binding_login:!1,create_circle:!1,create_topic:!1,distribution:!1,user_data:"",},b2token:!1,},computed:{userData(){return this.$store.state.userData},},mounted(){this.b2token=b2token;document.onclick=(e)=>{this.hideAction()};if(b2_global.post_id!=0){this.writeHistory()}
10historyWidget();if(b2token){let footer_text=document.querySelector("#footer-menu-user");if(footer_text){footer_text.innerText=b2_global.js_text.global.my}
11this.$http.post(b2_rest_url+"getUserInfo").then((res)=>{this.role=res.data;this.$store.commit("setUserRole",res.data);this.$store.commit("setUserData",res.data.user_data);this.$store.commit("setcanImage",res.data.can_img);b2AsideBar.count=res.data.carts;topMenuLeft.count=res.data.msg_unread;b2bindLogin.type=res.data.binding_login;payCredit.user.credit=res.data.user_data.credit;this.$nextTick(()=>{b2tooltip(".user-tips");
11lazyLoadInstance.update()})}).catch((err)=>{this.loginOut()})}else{this.$https.get(b2_rest_url+"getOauthLink").then((res)=>{this.$store.commit("setOauthLink",res.data);this.$nextTick(()=>{lazyLoadInstance.update()})});let ref=b2GetQueryVariable("ref");if(ref){b2setCookie("ref",ref)}}},methods:{writeHistory(){let address=JSON.parse(localStorage.getItem("b2_view_history"))||[];let url=window.location.origin+window.location.pathname;let siteName=b2_global.site_name;let siteSeparator=b2_global.site_separator;let title=document.title;title=title.replace(/\s+/g,"");title=title.substring(0,title.length-siteName.length);title=title.substring(0,title.length-siteSeparator.length);let thumb=document.querySelector('meta[property="og:image"]');if(!thumb){thumb=b2_global.default_thumb}else{thumb=thumb.getAttribute("content")}
12for(let i=0;i<address.length;i++){if(address[i].url==url){address.splice(i,1)}}
13if(address.length>=30){address.pop()}
14let time=new Date().toLocaleString("zh",{hour12:!1}).replace(/\//g,"-");let type=b2_global.post_type;address.unshift({url:url,title:title,thumb:thumb,time:time,type:type,});localStorage.setItem("b2_view_history",JSON.stringify(address))},hideAction(){this.showDrop=!1;if(typeof b2Comment!=="undefined"){b2Comment.show.smile=!1;b2Comment.show.image=!1}
15if(typeof b2infomation!=="undefined"){b2infomation.showFliter=!1}
16if(typeof b2TaxTop!=="undefined"){b2TaxTop.showFliter.hot=!1;b2TaxTop.showFliter.cat=!1}
17if(typeof topsearch!=="undefined"){topsearch.show=!1}
18if(typeof writeHead!=="undefined"){Qmsg.closeAll()}
19if(typeof b2CirclePostBox!=="undefined"){b2CirclePostBox.ask.focus=!1;if(b2CirclePostBox.ask.userInput){b2CirclePostBox.ask.picked=!0}
20b2CirclePostBox.role.show=!1;b2CirclePostBox.smileShow=!1}
21if(typeof poAsk!=="undefined"){poAsk.ask.focus=!1;if(poAsk.userInput){poAsk.ask.picked=!0}}
22if(typeof b2CircleList!=="undefined"){if(!b2CircleList.$refs.topicForm)return;if(!b2CircleList.commentBox.content){if(b2CircleList.$refs.topicForm.value==""){b2CircleList.commentBox.focus=!1}
23b2CircleList.smileShow=!1}
24b2CircleList.circle.showBox="";b2CircleList.topicFliter.show=!1;b2CircleList.answer.showSmile=!1}
25b2AsideBar.close()},login(type){login.show=!0;login.loginType=type},showDropMenu(){this.showDrop=!this.showDrop},loginOut(){axios.get(b2_rest_url+"loginOut").then((res)=>{b2delCookie("b2_token");b2CurrentPageReload()}).catch((err)=>{b2delCookie("b2_token");b2CurrentPageReload()})},out(){this.loginOut()},goUserPage(type){if(type==="back"){window.location=b2getCookie("b2_back_url")}else if(type){if(!b2token){this.login(1);return}
26window.location=this.$store.state.userData.link+"/"+type}else{if(!b2token){this.login(1);return}
27window.location=this.$store.state.userData.link}},},});var topMenuLeft=new Vue({el:".change-theme",data:{theme:"light",count:0,login:!1,},mounted(){if(b2token){this.login=!0}},methods:{changeTheme(type){this.theme=type},showBox(){postPoBox.show=!0},go(type){if(type==="orders"){if(b2token){window.location.href=this.$store.state.userData.link+"/orders"}else{login.show=!0;login.loginType=1}}
28if(type==="requests"){if(b2token){window.location.href=b2_global.home_url+"/requests"}else{login.show=!0;login.loginType=1}}},},});var headerTools=new Vue({el:".header-tools",computed:{userData(){return this.$store.state.userData},},methods:{showSearch(){b2SearchBox.close()},},});Vue.component("login-box",{props:["show","allowRegister","checkType","loginType","loginText","invitation","invitationLink","invitationText","imgBoxCode",],template:b2_global.login,data(){return{data:{nickname:"",username:"",password:"",code:"",img_code:"",invitation_code:"",token:"",smsToken:"",luoToken:"",confirmPassword:"",loginType:"",tencentTicket:"",},loginSocialType:b2_global.login_type,invitationPass:!1,eye:!1,codeImg:"",locked:!1,showLuo:!1,issetLuo:!1,issetTencent:!1,imgLocked:!1,SMSLocked:!1,count:60,repass:!1,type:"",isWeixin:!1,}},computed:{oauth(){return this.$store.state.oauthLink},openOauth(){return this.$store.state.openOauth},},mounted(){if(this.checkType=="tencent"){document.getElementById("CaptchaId").onclick=()=>{try{var captcha=new TencentCaptcha(b2_global.tencent_captcha_appid,this.callback,{});captcha.show()}catch(error){this.loadErrorCallback()}}}},created(){window.getResponse=(resp)=>
28{if(this.type=="edit"){b2AuthorEdit.sendCode(resp);recaptcha.close()}else{this.data.img_code=resp;this.$nextTick(()=>{recaptcha.close();this.sendSMS()})}};this.isWeixin=b2isWeixin()},methods:{callback(res){if(res.ret===0){var str="【randstr】->【"+res.randstr+"】      【ticket】->【"+res.ticket+"】";var ipt=document.createElement("input");ipt.value=str;document.body.appendChild(ipt);ipt.select();document.execCommand("Copy");document.body.removeChild(ipt);alert("1. 返回结果(randstr、ticket)已复制到剪切板,ctrl+v 查看。 2. 打开浏览器控制台,查看完整返回结果。")}},loadErrorCallback(){var appid="您的CaptchaAppId";var ticket="terror_1001_"+appid+"_"+Math.floor(new Date().getTime()/1000);callback({ret:0,randstr:"@"+Math.random().toString(36).substr(2),ticket:ticket,errorCode:1001,errorMessage:"jsload_error",})},close(val){this.$emit("close-form",val)},loginAc(val){this.$emit("login-ac",val)},loginSubmit(e){e.preventDefault();if(this.locked==!0)return;this.locked=!0;if(this.invitation!=0&&this.loginType==2&&!this.invitationPass){this.invitationCheck()}else if(this.loginType==1){this.$https.post(b2_global.rest_url+"jwt-auth/v1/token",Qs.stringify(this.data)).then((res)=>{b2CurrentPageReload();return}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0,timeout:10000,});this.locked=!1})}else if(this.loginType==2){if(!this.$store.state.xieyi&&this.loginType==2){e.preventDefault();Qmsg.warning(b2_global.js_text.global.xieyi,{html:!0});this.locked=!1;return}
29this.$https.post(b2_rest_url+"regeister",Qs.stringify(this.data)).then((res)=>{b2CurrentPageReload();return}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})}else if(this.loginType==3){this.$https.post(b2_rest_url+"forgotPass",Qs.stringify(this.data)).then((res)=>{this.loginAc(4);this.locked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})}else if(this.loginType==4){this.$https.post(b2_rest_url+"resetPass",Qs.stringify(this.data)).then((res)=>{this.repass=!0;this.data.password="";this.loginAc(1);this.locked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})}},b2IsPhoneAvailable(val){if(b2IsPhoneAvailable(val))return!0;return!1},invitationCheck(){this.$https.post(b2_rest_url+"invitationCheck","code="+this.data.invitation_code).then((res)=>{this.invitationPass=!0;this.locked=!1;this.showLuo=!0}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},sendCode(){recaptcha.show=!0;this.close(!1)},getCode(){if(this.imgLocked)return;this.codeImg="";this.imgLocked=!0;this.$https.post(b2_rest_url+"getRecaptcha","number=4&width=186&height=50").then((res)=>{if(res.data){this.codeImg=res.data.base;this.data.token=res.data.token}
30this.imgLocked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.imgLocked=!1})},changeCode(){this.getCode()},isEmail(email){var pattern=/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;return pattern.test(email)},checkTips(){let text="";if(this.checkType=="tel"){text=b2_global.js_text.global.check_type.tel}
31if(this.checkType=="email"){text=b2_global.js_text.global.check_type.mail}
32if(this.checkType=="telandemail"){if(this.isEmail(this.data.username)){text=b2_global.js_text.global.check_type.mail}else{text=b2_global.js_text.global.check_type.tel}}
33if(text){Qmsg.info(b2_global.js_text.global.check_message,{showClose:!0,autoClose:!1,})}},sendSMS(){if(this.SMSLocked)return;this.SMSLocked=!0;this.data.loginType=this.loginType;this.$https.post(b2_rest_url+"sendCode",Qs.stringify(this.data)).then((res)=>{if(res.data.token){this.data.smsToken=res.data.token}
34this.SMSLocked=!1;this.countdown();this.checkTips()}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.SMSLocked=!1})},markHistory(mp,e){if(!this.$store.state.xieyi&&this.loginType==2&&e){e.preventDefault();Qmsg.warning(b2_global.js_text.global.xieyi,{html:!0});return}
35if(mp){this.close();mpCode.show=!0;mpCode.type=this.loginType}
36b2setCookie("b2_back_url",window.location.href)},countdown(){if(this.count<=1){this.count=60;return}
37this.count--;setTimeout(()=>{this.countdown()},1000)},resetPssNext(){this.loginAc(4)},},watch:{oauth(val){if(val){Object.keys(val).forEach((key)=>{if(val[key].open){this.$store.commit("setOpenOauth",!0)}});if(b2isWeixin()&&b2_global.wx_mp_in_login==1){if(!b2token&&document.querySelector("#open-page")===null){b2setCookie("b2_back_url",window.location.href);window.location.href=this.oauth.weixin.url}}}},loginType(val){if((this.invitation==0||this.invitationPass)&&val==2){this.showLuo=!0}else{this.showLuo=!1}
38if(this.issetLuo){LUOCAPTCHA&&LUOCAPTCHA.reset()}},invitationPass(val){if(this.issetLuo&&val){setTimeout(()=>{LUOCAPTCHA&&LUOCAPTCHA.reset()},100)}},show(val){if((val&&this.checkType=="text")||b2isWeixin()){this.getCode();this.type=""}else if(val&&login.qrcode!=="0"&&this.loginType==1){this.markHistory(!0,null)}}
38,imgBoxCode(val){this.data.img_code=val.value;this.data.token=val.token},showLuo(val){if(this.show&&this.checkType=="luo"&&val&&!this.issetLuo){let s=document.createElement("script");s.id="luosimao";s.type="text/javascript";s.src="//captcha.luosimao.com/static/dist/api.js";document.getElementsByTagName("head")[0].appendChild(s);this.issetLuo=!0}
39if(this.show&&this.checkType=="tencent"&&val&&!this.issetTencent){let s=document.createElement("script");s.id="tencent";s.type="text/javascript";s.src="//turing.captcha.qcloud.com/TCaptcha.js";document.getElementsByTagName("head")[0].appendChild(s);this.issetTencent=!0}},},});Vue.component("mp-box",{props:["show","invitation","invitationLink","invitationText"],template:b2_global.mp_box,data(){return{code:"",locked:!1,token:!1,invitationCode:"",locked:!1,qrcode:"",t:!1,count:100,}},computed:{oauthLink(){return this.$store.state.oauthLink},},methods:{close(){this.$emit("close");this.t=null},submit(){if(this.locked==!0)return;this.locked=!0;if(this.count<=1||this.t===null){this.t=null;this.count=100;return}
40this.$http.post(b2_rest_url+"mpLogin","code="+this.code).then((res)=>{if(res.data==="waiting"){this.locked=!1;this.t=setTimeout(()=>{this.submit()},1000);return}
41if(res.data.type==="invitation"){this.token=res.data.token}else{if(res.data===!0){b2CurrentPageReload()}else{this.$store.commit("setUserData",res.data);Vue.prototype.$http.defaults.headers.common.Authorization="Bearer "+b2token;b2CurrentPageReload()}}
42this.t=null;this.locked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},checkInv(){if(this.locked==!0)return;this.locked=!0;this.$https.post(b2_rest_url+"mpLoginInv","token="+this.token+"&inv="+this.invitationCode).then((res)=>{if(res.data.token){b2CurrentPageReload()}
43this.locked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},getQrcode(){this.$https.post(b2_rest_url+"getLoginQrcode").then((res)=>{this.code=res.data.sence_id;this.qrcode=res.data.qrcode;this.submit()}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0})})},},watch:{show(val){if(val){if(this.oauthLink.weixin.pc_open){b2loadScript("https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js","",()=>{new WxLogin({self_redirect:!1,id:"mp-login-box",appid:b2_global.wx_appid,scope:"snsapi_login",redirect_uri:b2_global.home_url+"/open?type=weixin",state:"",style:"black",href:"data:text/css;base64,LmltcG93ZXJCb3ggLnFyY29kZSB7DQogICAgd2lkdGg6IDEwMCU7DQogICAgbWFyZ2luLXRvcDogMDsNCiAgICBib3JkZXI6IDA7DQp9DQouaW1wb3dlckJveCAuaW5mbyB7DQogICAgZGlzcGxheTogbm9uZTsNCn0NCi5pbXBvd2VyQm94IC50aXRsZXsNCmRpc3BsYXk6bm9uZQ0KfQ==",})})}else{this.locked=!1;this.t=!1;this.count=100;this.getQrcode()}}},},});var mpCode=new Vue({el:"#mp-box",data:{show:!1,qrcode:"",type:"1",},methods:{close(){this.show=!this.show;if(!b2token&&login.qrcode==="0"){login.show=!0;login.loginType=this.type}},},});var login=new Vue({el:"#login-box",data:{show:!1,loginType:1,checkCodeSendSuccess:!1,isAdmin:!1,imgCode:"",qrcode:"0",loginSocialType:b2_global.login_type,},mounted(){this.qrcode=b2_global.mp_qrcode},methods:{close(val){this.show=val;this.qrcode=b2_global.mp_qrcode},loginAc(val){this.loginType=val},imgCodeAc(val){this.imgCode=val},},});Vue.component("recaptcha-box",{props:["show","type"],template:b2_global.check_code,data(){return{recaptcha:"",token:"",recaptchaUrl:"",disabled:!0,issetLuo:!1,locked:!1,loginType:2,checkType:b2_global.check_type,}},methods:{close(){this.$emit("close-form")},change(){if(this.locked)return;this.recaptchaUrl="";this.locked=!0;this.$https.post(b2_rest_url+"getRecaptcha","number=4&width=186&height=50").then((res)=>{if(res.data){this.recaptchaUrl=res.data.base;this.token=res.data.token}
44this.locked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},checkCode(){if(this.disabled)return;this.disabled=!0;this.$https.post(b2_rest_url+"imgCodeCheck","img_code="+this.recaptcha+"&token="+this.token+"&loginType="+login.loginType).then((res)=>{if(this.type=="edit"){b2AuthorEdit.imgCodeAc({value:this.recaptcha,token:this.token,})}
44else if(this.type=="bind"){b2bindLogin.imgCodeAc({value:this.recaptcha,token:this.token,})}else{login.imgCodeAc({value:this.recaptcha,token:this.token,});setTimeout(()=>{login.$refs.loginBox.sendSMS()},50)}
45this.disabled=!1;this.close()}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.disabled=!1})},},watch:{show(val){if(val&&b2_global.check_type=="normal"){this.change()}
46if(val&&!this.issetLuo&&login.loginType!=3){let s=document.createElement("script");s.id="luosimao";s.type="text/javascript";s.src="//captcha.luosimao.com/static/dist/api.js?time="+new Date().getTime();document.getElementsByTagName("head")[0].appendChild(s);this.issetLuo=!0}else if(val&&this.issetLuo&&login.loginType!=3){LUOCAPTCHA&&LUOCAPTCHA.reset()}
47if(this.type!="edit"){this.loginType=login.loginType}},recaptcha(val){if(val.length==5||val.length==6){this.disabled=!1}else{this.disabled=!0}},},});var recaptcha=new Vue({el:"#recaptcha-form",data:{show:!1,type:"",},methods:{close(){this.show=!1;if(this.type!="edit"&&this.type!="bind"){login.show=!0}
48if(this.type==="bind"){b2bindLogin.show=!0}},},});function indexPostModules(){let m=document.querySelectorAll(".post-list");if(m.length>0){for(let i=0;i<m.length;i++){let key=m[i].getAttribute("data-key");if(m[i].id!="undefined"){new Vue({el:"#post-item-"+key,data:{key:0,index:0,box:"",paged:1,pages:0,type:"cat",showButton:!1,locked:!1,cat:[],finish:!1,id:0,},mounted(){if(this.$el.querySelector(".load-more")){this.key=key;this.index=this.$el.getAttribute("data-i");this.box=this.$el.querySelectorAll(".b2_gap")[0];this.showButton=this.$el.querySelector(".load-more").getAttribute("data-showButton")}},methods:{getList(id,type,postType){if(this.finish&&type=="more"){return}else{this.finish=!1}
49if(this.locked)return;this.locked=!0;this.id=id;if(type){this.type=type}
50if(this.type=="cat"){this.paged=1;if(id){this.cat=[id]}else{this.cat=[]}
51this.finish=!1}else{this.paged=this.paged+1}
52let data={index:this.index,id:this.cat,post_paged:this.paged,};axios.post(b2_rest_url+"getModulePostList",Qs.stringify(data)).then((res)=>{if(res.data.count>0){this.pages=res.data.pages;if(this.type=="cat"){if(this.pages==1){this.box.innerHTML=res.data.data}else{this.box.innerHTML=res.data.data}
53if(postType=="post-2"){b2PackeryLoad()}
54this.showButton=!0}else if(this.type=="more"){this.box.insertAdjacentHTML("beforeend",res.data.data);if(postType=="post-2"){b2PackeryLoad()}
55this.showButton=!0}
56if(this.paged>=this.pages){this.finish=!0}}else{if(postType=="post-6"){this.box.innerHTML='<tr><td colspan="10" style="border:0">'+b2_global.empty_page+"</td></tr>"}else{this.box.innerHTML=b2_global.empty_page}
57this.showButton=!1}
58this.locked=!1;b2SidebarSticky();this.$nextTick(()=>{lazyLoadInstance.update()})})},},})}}}}
59indexPostModules();function listFadein(dom,time){return;var i=0;dom.forEach((e)=>{if(e.className.indexOf("is-visible")===-1){i++;if(i==1){e.className+=" is-visible"}else{setTimeout(function(){e.className+=" is-visible"},i*time)}}})}
60listFadein(document.querySelectorAll(".post-list ul.b2_gap > li"),10);function b2PackeryLoad(e){var grid=document.querySelectorAll(".grid");if(grid.length>0){for(let index=0;index<grid.length;index++){let pack=new Packery(grid[index]);pack.on("layoutComplete",()=>{b2SidebarSticky()})}}}
61b2PackeryLoad();Vue.component("pagenav-new",{props:["type","paged","pages","opt","api","rote"],template:b2_global.page_nav,data:function(){return{locked:!1,next:!1,per:!1,cpage:0,cpaged:1,cpages:[],mobile:!1,showGo:!1,}},created(){window.addEventListener("scroll",_debounce(this.autoLoadMore),passiveSupported?{passive:!0}:!1);this.cpaged=parseInt(this.paged);this.cpages=this.pagesInit();window.addEventListener("popstate",()=>{let state=history.state;if(state&&state.page&&this.type=="p"){this.go(state.page)}},passiveSupported?{passive:!0}:!1);this.mobile=B2ClientWidth>768?!1:!0},methods:{disabled(page){return page==this.cpaged&&this.locked==!0},pagesInit(){let pagearr=[];if(this.pages<=6){for(let i=1;i<=this.pages;i++){pagearr.push(i)}}else{if(!this.cpaged)this.cpaged=this.paged;if(this.cpaged<4){for(let i=1;i<=this.pages;i++){if(i>=5)break;pagearr.push(i)}
62pagearr.push(0,this.pages)}else if(this.cpaged>=4&&this.pages-2>this.cpaged){pagearr.push(1,0);for(let i=this.cpaged-1;i<=this.cpaged+1;i++){pagearr.push(i)}
63pagearr.push(0,this.pages)}else if(this.pages-2<=this.cpaged){pagearr.push(1,0);for(let i=this.cpaged-2;i<=this.pages;i++){pagearr.push(i)}}}
64return pagearr},focus(){this.showGo=!0},blur(){setTimeout(()=>{this.showGo=!1},100)},autoLoadMore(){if(this.type=="p")return;if(this.cpaged==this.pages)return;let scrollTop=document.documentElement.scrollTop;if(scrollTop+window.innerHeight>=document.body.clientHeight-550){this.go(this.cpaged+1)}},trimSlashes(str){return str.replace(/\/+$/,"")},go(page,type,action){page=parseInt(page);if(this.opt.length>0)return;if(this.cpaged==page&&!action)return;if(this.locked==!0)return;this.locked=!0;if(this.type==="m"&&this.pages<=this.cpaged&&page!=1)return;if(type=="next"){this.next=!0;this.per=!1}else if(type=="per"){this.per=!0;this.next=!1}
65this.cpaged=page;this.opt.post_paged=page;this.opt.paged=page;this.$http.post(b2_rest_url+this.api,Qs.stringify(this.opt)).then((res)=>{this.locked=!1;this.cpages=this.pagesInit();this.$emit("return",res.data);if(this.rote){let currentURL=window.location.href,url=this.trimSlashes(currentURL.split("?")[0]),newURL;console.log(url);if(this.cpaged==1){newURL=url.replace(/\/page\/\d/,"")}else{if(currentURL.indexOf("/page/")==-1){newURL=url+"/page/"+this.cpaged}else{newURL=url.replace(/\/page\/[0-9]*$/,"/page/"+page)}}
66url=currentURL.replace(url,newURL);window.history.pushState({page:page},null,url);if(this.type==="p"){b2AsideBar.goTop()}}
67b2SidebarSticky();this.$nextTick(()=>{lazyLoadInstance.update()})}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0})})},getData(fn,data){this.cpaged=this.cpage;
67this.cpages=this.pagesInit()},jump(event){var val=event.target.value||event.target.previousElementSibling.value||this.$refs.pagenavnumber.value;val=parseInt(val);if(val>this.pages)return;this.go(val,"p",!0)},},watch:{pages(val){this.cpages=this.pagesInit()},paged(){this.cpaged=parseInt(this.paged);this.cpages=this.pagesInit()},},});Vue.component("page-nav",{props:["paged","navtype","pages","type","box","opt","api","url","title",],template:b2_global.page_nav,data:function(){return{locked:!1,next:!1,per:!1,cpage:0,cpaged:1,cpages:[],mobile:!1,showGo:!1,}},created(){window.addEventListener("scroll",_debounce(this.autoLoadMore),passiveSupported?{passive:!0}:!1);this.cpaged=parseInt(this.paged);this.cpages=this.pagesInit();window.addEventListener("popstate",()=>{let state=history.state;if(state&&state.page&&this.type=="p"){this.go(state.page)}},passiveSupported?{passive:!0}:!1);this.mobile=B2ClientWidth>768?!1:!0},methods:{disabled(page){return page==this.cpaged&&this.locked==!0},pagesInit(){let pagearr=[];if(this.pages<=7){for(let i=1;i<=this.pages;i++){pagearr.push(i)}}else{if(!this.cpaged)this.cpaged=this.paged;if(this.cpaged<5){for(let i=1;i<=this.pages;i++){if(i>=6)break;pagearr.push(i)}
68pagearr.push(0,this.pages)}else if(this.cpaged>=5&&this.pages-3>this.cpaged){pagearr.push(1,0);for(let i=this.cpaged-2;i<=this.cpaged+2;i++){pagearr.push(i)}
69pagearr.push(0,this.pages)}else if(this.pages-3<=this.cpaged){pagearr.push(1,0);for(let i=this.cpaged-3;i<=this.pages;i++){pagearr.push(i)}}}
70return pagearr},autoLoadMore(){setTimeout(()=>{if(this.type=="p")return;let scrollTop=document.documentElement.scrollTop;if(scrollTop+window.innerHeight>=document.body.clientHeight-550){this.go(this.cpaged+1)}},300)},focus(){this.showGo=!0},blur(){setTimeout(()=>{this.showGo=!1},100)},go(page,type,action){page=parseInt(page);if(this.opt.length>0)return;if(this.cpaged==page&&!action)return;if(this.locked==!0)return;if(this.type==="m"&&this.pages<=this.cpaged&&page!=1)return;this.locked=!0;if(type=="next"){this.next=!0;this.per=!1}else if(type=="per"){this.per=!0;this.next=!1}
71this.cpaged=page;console.log(this.cpaged);this.opt.post_paged=page;this.opt.paged=page;this.$http.post(b2_rest_url+this.api,Qs.stringify(this.opt)).then((res)=>{this.locked=!1;this.cpages=this.pagesInit();let dom=document.querySelector(this.box);if(this.navtype==="json"){this.$emit("return",res.data)}else{if(this.type==="p"){dom.innerHTML=res.data.data}else{dom.insertAdjacentHTML("beforeend",res.data.data)}}
72if(page!=1){this.url=b2removeURLParameter(this.url,"action")}
73if(!!(window.history&&history.pushState)&&!(b2_global.is_front_page&&this.api=="getNewsflashesList")){if(page!=1){if(this.navtype==="comment"){if(b2_global.structure){window.history.pushState({page:page},null,this.url+"/comment-page-"+page+"#comment")}else{window.history.pushState({page:page},null,this.url+"&cpage="+page+"#comment")}}else{if(this.navtype!="authorComments"&&this.title){document.title=this.title+" "+b2_global.site_separator+" "+b2_global.page_title.replace("{#}",page)+" "+b2_global.site_separator+" "+b2_global.site_name}
74let currentURL=window.location.href,url=currentURL.split("?")[0],newURL;if(this.cpaged==1){newURL=url.replace(/\/page\/\d/,"")}else{if(currentURL.indexOf("/page/")==-1){newURL=url+"/page/"+this.cpaged}else{newURL=url.replace(/\/page\/[0-9]*$/,"/page/"+page)}}
75url=currentURL.replace(url,newURL);window.history.pushState({page:page},null,url);if(this.type==="p"){b2AsideBar.goTop()}}}else{if(this.navtype==="comment"){window.history.pushState({page:page},null,this.url+"#comment")}else{if(this.navtype!="authorComments"&&this.title){document.title=this.title+" "+b2_global.site_separator+" "+b2_global.site_name}
76window.history.pushState({page:page},null,this.url)}}}
77if(this.navtype==="comment"||this.navtype==="authorComments"){let img=document.querySelectorAll(".comment-img-box img");if(img.length>0){for(let index=0;index<img.length;index++){b2zoom.listen(img[index])}}
78if(this.navtype==="comment"){b2CommentList.showSticky();b2SidebarSticky()}}else if(this.navtype==="post"){b2PackeryLoad();setTimeout(()=>{listFadein(document.querySelectorAll(this.box+" > li"),20)},500)}
79this.$emit("finish");b2SidebarSticky();this.$nextTick(()=>
79{lazyLoadInstance.update()})}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0})})},getData(fn,data){this.cpaged=this.cpage;this.cpages=this.pagesInit()},jump(event){var val=event.target.value||event.target.previousElementSibling.value||this.$refs.pagenavnumber.value;val=parseInt(val);if(val>this.pages)return;this.go(val,"p",!0)},},watch:{pages(val){this.cpages=this.pagesInit()},paged(){this.cpaged=parseInt(this.paged);this.cpages=this.pagesInit()},},});function b2RestTimeAgo(dom){}
80let pageNavBox=new Vue({el:".post-nav",data:{selecter:"#post-list .b2_gap",opt:"",api:"getPostList",options:[],value:1,showGoN:!1,},mounted(){if(typeof b2_cat!=="undefined"){this.opt=b2_cat.opt}},methods:{jumpAc:function(event){var val=event.target.value||event.target.previousElementSibling.value||this.$refs.pagenavnumber.value;if(val>this.opt.pages)return;let currentURL=window.location.href,url=currentURL.split("?")[0],newURL;if(val==1){newURL=url.replace(/\/page\/\d/,"")}else{if(currentURL.indexOf("/page/")==-1){newURL=url+"/page/"+val}else{newURL=url.replace(/\/page\/[0-9]*$/,"/page/"+val)}}
81url=currentURL.replace(url,newURL);window.location.href=url},focus(){this.showGoN=!0},blur(){setTimeout(()=>{this.showGoN=!1},100)},},});let b2Audio=new Vue({el:".b2-audio-content",data:{url:"",textList:[],playStatus:!1,api:"https://tts.baidu.com/text2audio?cuid=baike&lan=ZH&ctp=1&pdt=301&tex=",index:0,currentTime:"00:00",startTime:"00:00",step:0,duration:0,ds:"",width:"0%",},methods:{play(){if(!this.url){this.getPlayList()}else{this.playList()}},getPlayList(){this.$https.post(b2_rest_url+"getPostAudio","post_id="+this.$refs.audio.getAttribute("data-id")).then((res)=>{if(res.data.length>0){this.textList=res.data;this.playList();this.watchPlay()}})},playList(){this.url=this.api+this.textList[this.index];setTimeout(()=>{this.button()})},watchPlay(){this.$refs.audio.addEventListener("ended",()=>{if(this.index>=this.textList.length-1){this.playStatus=!1;this.index=0;this.step=0;return}
82this.step=0;this.index=this.index+1;this.playList()},passiveSupported?{passive:!0}:!1)},button(){if(this.$refs.audio!==null){if(this.$refs.audio.paused){this.$refs.audio.play();this.playStatus=!0;this.timeSetp()}else{this.$refs.audio.pause();this.playStatus=!1}
83this.$refs.audio.addEventListener("loadedmetadata",()=>{this.duration=Math.round(this.$refs.audio.duration);this.currentTime=this.secondToDate(this.duration)},passiveSupported?{passive:!0}:!1)}},timeSetp(){if(this.playStatus==!0){this.startTime=this.secondToDate(this.step++);if(this.ds){clearTimeout(this.ds)}
84this.ds=setTimeout(()=>{this.timeSetp();this.width=(this.step/this.duration)*100+"%"},1000)}},secondToDate(s){var t;if(s>-1){var hour=Math.floor(s/3600);var min=Math.floor(s/60)%60;var sec=s%60;if(hour>1){if(hour<10){t="0"+hour+":"}else{t=hour+":"}}else{t=""}
85if(min<10){t+="0"}
86t+=min+":";if(sec<10){t+="0"}
87t+=sec.toFixed(0)}
88return t},},});var socialLogin=new Vue({el:"#juhe-social",data:{locked:!1,error:"",},mounted(){if(!this.$refs.juhebox)return;let type=b2GetQueryVariable("type");this.locked=!0;this.$http.post(b2_rest_url+"juheSocialLogin","type="+type).then((res)=>{window.location.href=res.data}).catch((err)=>{this.error=err.response.data.message;this.locked=!1})},methods:{back(){let url=b2getCookie("b2_back_url");if(url){window.location.href=url}else{window.location.href=b2_global.home_url}},},});var socialBox=new Vue({el:"#social-box",data:{locked:!1,type:"",data:{token:"",invitation:"",subType:"",},error:"",oauth:"",name:"",},mounted(){if(this.$refs.socialBox){let code=b2GetQueryVariable("code"),juhe=b2GetQueryVariable("juhe")?b2GetQueryVariable("juhe"):0;this.type=b2GetQueryVariable("type")||"weixin";if(code){this.locked=!0;this.$http.post(b2_rest_url+"socialLogin","code="+code+"&type="+this.type+"&juhe="+juhe).then((res)=>{this.locked=!1;if(res.data===!0){this.back()}else if(res.data.type=="invitation"){(this.type="invitation"),(this.data.token=res.data.token)}else{this.back()}}).catch((err)=>{if(err.response.data.message.msg){this.oauth=err.response.data.message.oauth;this.error=err.response.data.message.msg;this.name=err.response.data.message.name}else{this.error=err.response.data.message}
89this.locked=!1})}}},methods:{back(){let url=b2getCookie("b2_back_url");
89if(url){window.location.href=url}else{window.location.href=b2_global.home_url}},invRegeister(type){if(this.locked=="pass"||this.locked=="sub")return;this.locked=type;this.data.subType=type;this.$http.post(b2_rest_url+"invRegeister",Qs.stringify(this.data)).then((res)=>{this.back()}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},loginOut(url){b2delCookie("b2_token");b2CurrentPageReload(url)},rebuild(ev){this.$http.post(b2_rest_url+"unBuild","type="+this.type+"&user_id="+b2_author.author_id).then((res)=>{}).catch((err)=>{ev.preventDefault();Qmsg.warning(err.response.data.message,{html:!0})})},},});Vue.component("gg-box",{props:["show"],template:b2_global.gg_box,computed:{ggdata(){return this.$store.state.announcement[0]},},methods:{close(){this.$emit("close")},},});var b2GG=new Vue({el:"#gong-box",data:{show:!1,},mounted(){this.$http.post(b2_rest_url+"getLatestAnnouncement","count=3").then((res)=>{if(res.data.length>0){this.$store.commit("setAnnouncement",res.data);this.show=res.data[0].show}else{this.$store.commit("setAnnouncement","none")}})},methods:{close(){this.show=!1;let timestamp=new Date().getTime();timestamp=parseInt(timestamp/1000);b2setCookie("gg_info",timestamp)},},});Vue.component("jubao",{props:["show","idType","id"],template:b2_global.jubao_box,data:function(){return{type:"",content:"",locked:!1,types:b2_global.report_types,jubaoImg:0,jubaoImgUrl:"",submitLocked:!1,}}
89,created(){this.type=this.types[0]},computed:{email(){return userTools?.role?.user_data?.email||""},},methods:{close(){this.$emit("close")},getFile(event,type){if(event.target.files.length<=0)return;if(this.locked==!0)return;this.locked=!0;let file=event.target.files[0];let formData=new FormData();formData.append("file",file,file.name);formData.append("post_id",1);formData.append("type","qrcode");this.$http.post(b2_rest_url+"fileUpload",formData).then((res)=>{this.jubaoImg=res.data.id;this.jubaoImgUrl=res.data.url;this.locked=!1;this.$refs.fileInput.value=null}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.jubaoImg="";this.$refs.fileInput.value=null;this.locked=!1})},submit(){if(this.locked==!0||this.submitLocked==!0)return;this.submitLocked=!0;this.$http.post(b2_rest_url+"submitReport","type="+this.type+"&post_id="+this.id+"&post_type="+this.idType+"&content="+this.content+"&img="+this.jubaoImg+"&email="+this.email).then((res)=>{this.submitLocked=!1;this.content="";this.jubaoImg=0;this.idType="";this.id=0;this.jubaoImgUrl="";this.close();Qmsg.success(b2_global.js_text.global.jubao_success,{html:!0,})}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.submitLocked=!1})},},});const jubao=new Vue({el:"#jubao-box",data:{show:!1,idType:"",id:0,},mounted(){autosize(this.$el.querySelector("textarea"))},methods:{close(idType,id){if(!b2token){login.show=!0;login.loginType=1;return}
90console.log(idType,id);this.idType=idType;this.id=id;this.show=!this.show},},});Vue.component("dmsg-box",{props:["show","userid","type"],template:b2_global.dmsg_box,data(){return{user:[],content:"",locked:!1,nickname:"",UserList:[],search:!1,}},methods:{close(){this.$emit("close");setTimeout(()=>{this.user=[];this.content="";this.nickname="";this.UserList=[]},100)},getUserData(id=0){id=!id?this.userid:id;this.$http.post(b2_rest_url+"getUserPublicData","user_id="+id).then((res)=>{this.user=res.data;b2Dmsg.userid=id;b2Dmsg.select="";this.UserList=[]}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0})})},edit(){b2Dmsg.select="select"},send(){if(this.locked==!0)return;this.locked=!0;this.$http.post(b2_rest_url+"sendDirectmessage","user_id="+this.userid+"&content="+this.content).then((res)=>{if(res.data==!0){this.close()}
91if(b2DmsgPage.$refs.dmsgPage){b2DmsgPage.getList()}
92this.locked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},searchUser(val){if(this.locked==!0)return;this.locked=!0;this.search=!0;this.$http.post(b2_rest_url+"searchUsers","nickname="+val).then((res)=>{if(res.data.length>0){this.UserList=res.data}else{this.UserList=[]}
93this.locked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1;this.UserList=[]})},},watch:{show(val){if(val&&this.type!=="select"){this.getUserData()}},nickname(val){if(val){this.searchUser(val)}},},});var b2Dmsg=new Vue({el:"#dmsg-box",data:{userid:0,show:!1,select:"",},methods:{close(){this.show=!this.show},},});var b2DmsgPage=new Vue({el:".dmsg-page",data:{list:!1,locked:!1,count:0,pages:0,selecter:".dmsg-header",opt:{paged:1,},api:"getUserDirectmessageList",},mounted(){if(this.$refs.dmsgPage){this.opt.paged=this.$refs.dmsgPage.getAttribute("data-paged");this.getList()}},methods:{getList(){this.$http.post(b2_rest_url+"getUserDirectmessageList",Qs.stringify(this.opt)).then((res)=>{this.list=res.data.data;this.pages=res.data.count;this.locked=!1;this.$nextTick(()=>{b2RestTimeAgo(this.$el.querySelectorAll(".b2timeago"))})}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},showDmsgBox(){b2Dmsg.select="select";b2Dmsg.show=!0},get(data){this.list=data.data;this.pages=data.count;this.$nextTick(()=>{b2RestTimeAgo(this.$el.querySelectorAll(".b2timeago"))})},jump(id){window.location.href=this.$refs.dmsgPage.getAttribute("data-url")+"/to/"+id},deleteDmsg(id){},},});var b2dmsgPageTo=new Vue({el:".dmsg-page-to",data:{list:!1,locked:!1,opt:{paged:1,userid:0,},count:0,pages:0,selecter:".dmsg-header",api:"getMyDirectmessageList",content:"",sendLocked:!1,},mounted(){if(this.$refs.mydmsg){this.opt.userid=this.$refs.mydmsg.getAttribute("data-id");this.opt.paged=this.$refs.mydmsg.getAttribute("data-paged");this.getList()}},methods:{getList(){this.$http.post(b2_rest_url+"getMyDirectmessageList",Qs.stringify(this.opt)).then((res)=>{this.list=res.data.data;this.locked=!1;this.count=res.data.count;this.pages=res.data.pages;this.$nextTick(()=>{b2RestTimeAgo(this.$el.querySelectorAll(".b2timeago"))})}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},get(val){this.list=val.data;this.count=val.count;this.pages=val.pages},send(){if(this.sendLocked==!0)return;this.sendLocked=!0;this.$http.post(b2_rest_url+"sendDirectmessage","user_id="+this.opt.userid+"&content="+this.content).then((res)=>{this.getList();this.content="";this.sendLocked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.sendLocked=!1})},},});var b2DownloadPage=new Vue({el:"#download-page",data:{data:"",postId:0,index:0,i:0,},mounted(){if(this.$refs.downloadPage){this.postId=b2GetQueryVariable("post_id");this.index=b2GetQueryVariable("index");this.i=b2GetQueryVariable("i");this.getData();var clipboard=new ClipboardJS(".fuzhi");clipboard.on("success",(e)=>{Qmsg.success(b2_global.js_text.global.copy_success,{html:!0})});clipboard.on("error",(e)=>{Qmsg.warning(b2_global.js_text.global.copy_select,{html:!0})})}},methods:{getData(){let guest=b2getCookie("b2_guest_buy_"+this.postId+"_x");if(guest){guest=JSON.parse(guest)}
94let data={post_id:this.postId,index:this.index,i:this.i,guest:guest,};this.$http.post(b2_rest_url+"getDownloadPageData",Qs.stringify(data)).then((res)=>{this.data=res.data}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0})})},login(){login.show=!0},},});Vue.component("check-box",{props:["show","title","type","payt"],template:b2_global.pay_check,data(){return{success:!1,timeOut:300,timesec:"",sTime:"",check:!1,checkTime:"",orderType:"",}},methods:{close(){this.$emit("close");this.sTime="";this.checkTime=""},checkAc(){if((this.sTime===null&&this.success=="fail")||this.checkTime===null||this.success===!0){this.checkTime=null;return}
95let value=b2getCookie("order_id");this.$http.post(b2_rest_url+"payCheck","order_id="+value).then((res)=>{if(res.data.status==="success"){this.orderType=res.data.type;if(!b2token){let list=b2getCookie("b2_guest_buy_"+res.data.id+"_"+res.data.type);if(!list){list=new Object()}else{list=JSON.parse(list)}
96Reflect.set(list,res.data.index,{id:res.data.id,order_id:value,type:res.data.type,index:res.data.index,});list=JSON.stringify(list);b2setCookie("b2_guest_buy_"+res.data.id+"_"+res.data.type,list)}
97if(typeof B2VerifyPage!=="undefined"){B2VerifyPage.data.money=!0;this.close()}else if(typeof carts!=="undefined"){carts.step=3;this.close()}else if(this.payt==="ask"){b2CircleList.afterCommentGetData(b2CircleList.answer.listParent,b2CircleList.data[b2CircleList.answer.listParent].topic_id,"ask");this.close()}else if(this.payt==="hidden"){b2CircleList.afterCommentGetData(b2CircleList.hiddenIndex,b2CircleList.data[b2CircleList.hiddenIndex].topic_id,"hidden");this.close()}
98this.success=!0;this.checkTime=null;this.sTime=null}else{this.checkTime=setTimeout(()=>{this.checkAc()},1000)}})},time(){this.currTime=parseInt(Date.parse(new Date())/1000);this.endTime=parseInt(this.currTime+this.timeOut);this.setTime()},setTime(){if(this.show==!1||this.success===!0){this.sTime=null;this.checkTime=null;return}
99let diff_time=parseInt(this.endTime-this.currTime);let m=Math.floor((diff_time/60)%60);let s=Math.floor(diff_time%60);this.timesec=(m>0?m+"<b>"+b2_global.js_text.global.min+"</b>":"")+s+"<b>"+b2_global.js_text.global.sec+"</b>";if(diff_time>0){this.sTime=setTimeout(()=>{this.endTime=this.endTime-1;this.setTime()},1000)}else{this.sTime=null;this.success="fail"}},refresh(){if(typeof B2VerifyPage!=="undefined"){B2VerifyPage.data.money=!0;this.close()}else if(typeof carts!=="undefined"){carts.step=3;this.close()}else if(this.payt==="ask"){b2CircleList.afterCommentGetData(b2CircleList.answer.listParent,b2CircleList.data[b2CircleList.answer.listParent].topic_id,"ask");this.close()}else if(this.payt==="hidden"){b2CircleList.afterCommentGetData(b2CircleList.hiddenIndex,b2CircleList.data[b2CircleList.hiddenIndex].topic_id,"hidden");this.close()}else if(typeof b2poinfomation!=="undefined"&&b2poinfomation.$refs.poinfomation){b2poinfomation.getPoinfomationOpts();this.close()}else if(this.orderType==="x"){b2DownloadBox.getList();this.close()}else{var url=new URL(window.location.href);
99url.searchParams.delete("b2paystatus");window.location.href=url.href;b2CurrentPageReload()}},},watch:{show(val){if(this.type=="card")return;if(val){this.sTime="";this.checkTime="";this.time();this.checkAc()}else{this.sTime=null;this.success=!1;this.checkTime=null}},},});var b2PayCheck=new Vue({el:"#pay-check",data:{show:!1,title:"",type:"",payType:"",},mounted(){if(b2GetQueryVariable("b2paystatus")=="check"){this.show=!0}},methods:{close(){this.show=!this.show;if(!this.show){this.payType=""}},},});var b2Pay=new Vue({el:"#pay-page",data:{data:[],token:"",error:"",locked:!1,payUrl:"",},mounted(){if(this.$refs.payPage){this.token=this.$refs.payPage.getAttribute("data-token");if(!this.token){this.data=JSON.parse(this.$refs.payPage.getAttribute("data-pay"));this.pay()}}},methods:{pay(){if(this.locked==!0)return;this.locked=!0;this.$http.post(b2_rest_url+"buildOrder",Qs.stringify(this.data)).then((res)=>{this.token=res.data;this.payUrl=window.location.href.split("?")[0]+"?token="+this.token;this.locked=!1}).catch((err)=>{this.error=err.response.data.message;this.locked=!1})},},});function b2MakeForm(url,token){var form1=document.createElement("form");form1.id="form1";form1.name="form1";document.body.appendChild(form1);var input=document.createElement("input");input.name="token";input.value=token;form1.appendChild(input);form1.method="POST";form1.action=url;form1.submit();document.body.removeChild(form1)}
100Vue.component("scan-box",{props:["show","data"],template:b2_global.scan_box,data(){return{locked:!1,qrcode:"",timeOut:300,timesec:"",sTime:"",success:"",checkTime:"",backData:[],}},methods:{close(){this.$emit("close");this.backData=[];this.checkTime=null},buildOrder(){if(this.locked==!0)return;this.locked=!0;this.currTime=parseInt(Date.parse(new Date())/1000);this.endTime=parseInt(this.currTime+this.timeOut);this.setTime();this.$http.post(b2_rest_url+"buildOrder",Qs.stringify(this.data)).then((res)=>{this.backData=res.data;if(res.data.type!=="mapay"&&res.data.type!=="pay020"&&res.data.type!=="xunhu"){var qr=new QRious({value:this.backData.qrcode,size:200,level:"L",});this.backData.qrcode=qr.toDataURL("image/jpeg")}
101this.writeOrder(res.data.order_id);this.locked=!1;this.checkAc()}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},writeOrder(id){b2setCookie("order_id",id)},checkAc(){if((this.sTime===null&&this.success=="fail")||this.checkTime===null||this.show==!1){this.checkTime=null;return}
102let value=b2getCookie("order_id");this.$http.post(b2_rest_url+"payCheck","order_id="+value).then((res)=>{if(res.data.status==="success"){if(!b2token){let list=b2getCookie("b2_guest_buy_"+res.data.id+"_"+res.data.type);if(!list){list=new Object()}else{list=JSON.parse(list)}
103Reflect.set(list,res.data.index,{id:res.data.id,order_id:value,type:res.data.type,index:res.data.index,});list=JSON.stringify(list);b2setCookie("b2_guest_buy_"+res.data.id+"_"+res.data.type,list)}
104this.success=!0;this.checkTime=null;if(typeof B2VerifyPage!=="undefined"){B2VerifyPage.data.money=!0;this.close()}
105if(typeof carts!=="undefined"){carts.step=3;this.close()}
106if(this.data.order_type==="circle_read_answer_pay"){b2CircleList.afterCommentGetData(b2CircleList.answer.listParent,b2CircleList.data[b2CircleList.answer.listParent].topic_id,"ask");this.close()}
107if(this.data.order_type==="circle_hidden_content_pay"){b2CircleList.afterCommentGetData(b2CircleList.hiddenIndex,b2CircleList.data[b2CircleList.hiddenIndex].topic_id,"hidden");this.close()}}else{this.checkTime=setTimeout(()=>{this.checkAc()},1000)}})},setTime(){if(this.show==!1)return;let diff_time=parseInt(this.endTime-this.currTime);let m=Math.floor((diff_time/60)%60);let s=Math.floor(diff_time%60);this.timesec=(m>0?m+"<b>"+b2_global.js_text.global.min+"</b>":"")+s+"<b>"+b2_global.js_text.global.sec+"</b>";if(diff_time>0){this.sTime=setTimeout(()=>{this.endTime=this.endTime-1;this.setTime()},1000)}else{this.sTime=null;this.success="fail"}},refresh(){if(this.data.order_type==="circle_read_answer_pay"){b2CircleList.afterCommentGetData(b2CircleList.answer.listParent,b2CircleList.data[b2CircleList.answer.listParent].topic_id,"ask");this.close()}else if(this.data.order_type==="circle_hidden_content_pay"){b2CircleList.afterCommentGetData(b2CircleList.hiddenIndex,b2CircleList.data[b2CircleList.hiddenIndex].topic_id,"hidden");this.close()}else{b2CurrentPageReload()}},},watch:{show(val){if(val){this.sTime="";this.success=!1;this.checkTime=""}else{this.sTime=null;this.success=!1;this.checkTime=null}},data:{deep:!0,handler(newName,oldName){this.buildOrder()},},},});var b2ScanPay=new Vue({el:"#scan-box",data:{data:[],show:!1,},methods:{close(){this.show=!this.show},},});Vue.component("ds-box",{props:["show","money","msg","user","author","data","showtype"],template:b2_global.ds_box,data(){return{value:0,custom:0,content:"",payType:"",payMoney:"",locked:!1,jump:"",href:"",isWeixin:"",isMobile:"",allow:[],card:[],cg:[],newWin:null,login:!1,redirect:"",payData:"",waitOrder:!1,}},created(){this.isWeixin=b2isWeixin();if(b2token){this.login=!0}
108this.redirect=b2getCookie("b2_back_url")},methods:{close(){this.$emit("close");this.locked=!1},clean(){this.$emit("clean")},picked(m,val){this.value=val;this.payMoney=m},post(url,params){var temp=document.createElement("form");temp.action=url;temp.method="post";temp.target="_blank";temp.style.display="none";if(Object.keys(params).length>
1080){Object.keys(params).forEach((key)=>{var opt=document.createElement("input");opt.name=key;opt.value=params[key];temp.appendChild(opt)})}
109document.body.appendChild(temp);temp.submit();return temp},restData(data=[]){if(this.showtype=="ds"){data=Object.assign(data,{title:this.$refs.dstitle.innerText,order_price:this.payMoney,order_type:"ds",post_id:b2_global.post_id,pay_type:this.payType,order_content:this.content,})}else if(this.showtype=="cz"){data={title:b2_global.js_text.global.pay_money,order_price:this.payMoney,order_type:"cz",post_id:0,pay_type:this.payType,}}else if(this.showtype=="cg"){data={title:b2_global.js_text.global.pay_credit,order_price:this.payMoney,order_type:"cg",post_id:0,pay_type:this.payType,}}else{data=Object.assign(this.data,data)}
110data.pay_type=this.payType;var url=new URL(window.location.href);url.searchParams.set("b2paystatus","check");data.redirect_url=url.href;return data},disabled(){if(this.data.pay_type!=="card"){if(this.jump=="")return!0;if((this.jump=="jump"||this.jump=="mweb"||this.jump=="jsapi")&&this.href==""&&this.payData=="")
111return!0;if(this.locked==!0)return!0;if(this.payType=="")return!0;if(this.payMoney===""&&(this.showtype=="ds"||this.showtype=="cz"||this.showtype=="cg"))
112return!0}else{if(!this.card.number||!this.card.password)return!0}
113return!1},chosePayType(val){if(this.locked==!0)return;this.locked=!0;this.payType=val;this.href="";this.payData="";this.jump="";this.$http.post(b2_rest_url+"checkPayType","pay_type="+val).then((res)=>{if(res.data.pay_type=="card"){this.$emit("change","card");this.card.text=res.data.card_text;this.jump=res.data.pay_type;this.locked=!1}else{if(this.showtype=="card"){this.$emit("change","cz")}
114this.jump=res.data.pay_type;this.isMobile=res.data.is_mobile;if(this.jump=="jump"||this.jump==="mweb"||this.jump==="jsapi"){let data=Qs.stringify(this.restData());this.waitOrder=!0;this.$http.post(b2_rest_url+"buildOrder",data).then((res)=>{this.writeOrder(res.data.id);if(typeof res.data.url=="string"){this.href=res.data.url}else{this.payData=res.data.url}
115this.waitOrder=!1;this.locked=!1}).catch((err)=>{if(err.response.data.message.msg==="bind_weixin"){b2setCookie("b2_back_url",window.location.href);if(typeof err.response.data.message.oauth=="string"){b2weixinBind.msg=err.response.data.message.oauth;b2weixinBind.show=!0}else{b2weixinBind.show=!0;b2weixinBind.url=err.response.data.message.oauth.weixin.url}}else{Qmsg.warning(err.response.data.message,{html:!0})}
116this.waitOrder=!1;this.locked=!1})}else{this.locked=!1}}
117b2setCookie("b2_back_url",window.location.href)}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},writeOrder(id){b2setCookie("order_id",id)},balancePay(order_id){let data=this.restData();this.$http.post(b2_rest_url+"balancePay","order_id="+order_id).then((res)=>{this.close();b2PayCheck.show=!0;b2PayCheck.title=data.title;this.locked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},pay(){if(this.disabled())return;if(this.jump==="card"){if(this.locked==!0)return;this.locked=!0;this.$http.post(b2_rest_url+"cardPay",Qs.stringify(this.card)).then((res)=>{if(res.data==="success"){b2PayCheck.show=!0;b2PayCheck.title=b2_global.js_text.global.pay_money_success;b2PayCheck.type="card";this.close()}
118this.locked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})}else if(this.jump==="jump"||this.jump==="mweb"){b2PayCheck.show=!0;b2PayCheck.title=this.$refs.dstitle.innerHTML;this.close();if(this.payData){this.post(this.payData.url,this.payData.data)}}else if(this.jump==="balance"){if(this.locked==!0)return;this.locked=!0;let data=Qs.stringify(this.restData());this.$http.post(b2_rest_url+"buildOrder",data).then((res)=>{this.writeOrder(res.data);this.balancePay(res.data)}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})}else if(this.jump==="scan"){if(this.isMobile){b2ScanPay.data=this.restData({is_weixin:this.isWeixin,is_mobile:this.isMobile,})}else{b2ScanPay.data=this.restData()}
119b2ScanPay.show=!0;this.close()}else if(this.jump==="jsapi"){let data=this.restData();jsApiCall(this.payData);this.close();b2PayCheck.show=!0;b2PayCheck.title=data.title}},allowPayType(){this.$http.post(b2_rest_url+"allowPayType","show_type="+this.showtype).then((res)=>{this.allow=res.data;this.user.money=res.data.money;if(res.data.dh){this.cg.min=res.data.min;this.cg.dh=res.data.dh;this.payMoney=this.cg.min}})},creditAdd(){return parseInt(this.payMoney*this.cg.dh)},},watch:{money(val){if(this.payMoney==0){this.payMoney=val[0]}},show(val){if(val){b2setCookie("b2_back_url",window.location.href);this.allowPayType()}
120if(val&&this.money.length>0){this.payMoney=this.money[0]}else if(val&&this.data.length!=0){this.payMoney=this.data.order_price}else if(val==!1){setTimeout(()=>{this.value=0;this.payMoney=0;this.payType="";this.clean()},300)}},payType(val){this.data.pay_type=val},showtype(val){},},});var b2DsBox=new Vue({el:"#ds-box",data:{money:[],show:!1,msg:"",user:[],author:[],data:[],showtype:"",},methods:{close(){this.show=!this.show},clean(){this.data=[];this.money=[]},change(type){this.showtype=type},},});var b2Ds=new Vue({el:"#content-ds",data:{data:"",},methods:{show(){b2DsBox.money=this.data.moneys;b2DsBox.show=!0;b2DsBox.showtype="ds";b2DsBox.msg=this.data.single_post_ds_text},},});function b2pay(event){let data=JSON.parse(event.getAttribute("data-pay"));b2DsBox.data=data;b2DsBox.show=!0;b2DsBox.showtype="normal"}
121function b2creditpay(event){if(!b2token){login.show=!0}else{let data=JSON.parse(event.getAttribute("data-pay"));payCredit.data=data;payCredit.show=!0}}
122function uuid(len,radix){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");var uuid=[],i;radix=radix||chars.length;if(len){for(i=0;i<len;i++)uuid[i]=chars[0|(Math.random()*radix)]}else{var r;
122uuid[8]=uuid[13]=uuid[18]=uuid[23]="-";uuid[14]="4";for(i=0;i<36;i++){if(!uuid[i]){r=0|(Math.random()*16);uuid[i]=chars[i==19?(r&0x3)|0x8:r]}}}
123return uuid.join("")}
124function openWin(url,name,iWidth,iHeight){var iTop=(window.screen.availHeight-30-iHeight)/2;var iLeft=(window.screen.availWidth-10-iWidth)/2;window.open(url,name,"height="+iHeight+",innerHeight="+iHeight+",width="+iWidth+",innerWidth="+iWidth+",top="+iTop+",left="+iLeft+",status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no")}
125function deleteHtmlTag(str){str=str.replace(/<[^>]+>|&[^>]+;/g,"").trim();return str}
126var b2cache=[];function b2addJs(path,callback){var flag=0;for(var i=b2cache.length;i--;){b2cache[i]==path?(flag=1):(flag=0)}
127if(flag){return}
128var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=path;script.type="text/javascript";head.appendChild(script);script.onload=script.onreadystatechange=function(){if(!this.readyState||this.readyState==="loaded"||this.readyState==="complete"){script.onload=script.onreadystatechange=null;callback()}};b2cache.push(path)}
129function jsApiCall(data){WeixinJSBridge.invoke("getBrandWCPayRequest",data,function(res){})}
130function callpay(){if(typeof WeixinJSBridge=="undefined"){if(document.addEventListener){document.addEventListener("WeixinJSBridgeReady",jsApiCall,passiveSupported?{passive:!0}:!1)}else if(document.attachEvent){document.attachEvent("WeixinJSBridgeReady",jsApiCall);document.attachEvent("onWeixinJSBridgeReady",jsApiCall)}
130}else{jsApiCall()}}
131function b2SidebarSticky(){if(B2ClientWidth<=768)return;if(document.querySelector(".post-style-5"))return;if(typeof window.b2Stick!=="undefined"){for(let i=0;i<window.b2Stick.length;i++){if(window.b2Stick[i]){window.b2Stick[i].updateSticky()}}
132return}
133let b2sidebar=document.querySelectorAll(".sidebar");if(b2sidebar){if(B2ClientWidth>768){var b2Stick=[];for(let i=0;i<b2sidebar.length;i++){if(!b2sidebar[i].querySelector(".widget-ffixed"))continue;b2Stick[i]=new StickySidebar(b2sidebar[i],{containerSelector:".widget-area",topSpacing:20,resizeSensor:!0,bottomSpacing:20,})}
134window.b2Stick=b2Stick}}}
135Vue.component("credit-box",{props:["show","data","user"],template:b2_global.credit_box,data(){return{locked:!1,}},methods:{close(){this.$emit("close")},writeOrder(id){b2setCookie("order_id",id)},disabled(){if(this.locked===!0)return!0;if(parseInt(this.user.credit)<parseInt(this.data.order_price))
136return!0;return!1},creditPay(order_id){this.writeOrder(order_id);this.$http.post(b2_rest_url+"creditPay","order_id="+order_id).then((res)=>{this.locked=!1;b2PayCheck.show=!0;this.close()}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},pay(){if(this.locked==!0)return;this.locked=!0;this.data.pay_type="credit";let data=Qs.stringify(this.data);this.$http.post(b2_rest_url+"buildOrder",data).then((res)=>{this.creditPay(res.data)}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},},});var payCredit=new Vue({el:"#credit-box",data:{show:!1,data:[],user:{credit:0,},author:[],},methods:{close(){this.show=!this.show},},});var B2UserWidget=new Vue({el:".b2-widget-user",data:{show:!1,b2token:!1,},mounted(){this.b2token=b2token},computed:{userData(){return this.$store.state.userData},oauth(){return this.$store.state.oauthLink},announcement(){return this.$store.state.announcement},openOauth(){return this.$store.state.openOauth},},watch:{announcement(val){if(val&&!this.show){this.resize()}},},methods:{resize(){this.$nextTick(()=>{if(!this.$refs.userWidget)return;if(this.$refs.gujia){this.$refs.gujia.style.display="none"}
137setTimeout(()=>{b2tooltip(".user-w-tips")},300);this.show=!0})},markHistory(type){if(this.oauth.weixin.mp&&type==="weixin"){mpCode.show=!0}
138b2setCookie("b2_back_url",window.location.href)},},});var b2Mission=new Vue({el:".b2-widget-mission",data:{data:"",locked:!1,type:"today",paged:1,count:0,pages:{today:1,always:1,},},mounted(){if(this.$refs.missionWidget){this.getData()}},methods:{getData(count,paged){if(this.$refs.missionWidget){this.count=this.$refs.missionWidget.getAttribute("data-count")}else{this.count=10}
139if(paged){this.paged=paged}
140this.$http.post(b2_rest_url+"getUserMission","count="+this.count+"&paged="+this.paged).then((res)=>{this.data=res.data;this.pages.today=res.data.mission_today_list.pages;this.pages.always=res.data.mission_always_list.pages;if(this.$refs.missiongujia){this.$refs.missiongujia.style.display="none"}
141this.$nextTick(()=>{b2RestTimeAgo(this.$el.querySelectorAll(".b2timeago"))})})},mission(){if(!b2token){login.show=!0}else{if(this.data.mission.credit){Qmsg.warning(b2_global.js_text.global.has_mission,{html:!0});return}
142if(this.locked==!0)return;this.locked=!0;this.$http.post(b2_rest_url+"userMission").then((res)=>{this.$nextTick(()=>{this.data.mission=res.data.mission;this.locked=!1});this.getData(this.count,this.paged)}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})}},},});var b2NewComment=new Vue({el:".b2-widget-comment",data:{data:"",paged:1,pages:1,count:5,hidden:1,next:!1,prev:!1,locked:!1,},mounted(){if(this.$refs.commentWidget){this.count=this.$refs.commentWidget.getAttribute("data-count");this.hidden=this.$refs.commentWidget.getAttribute("data-hidden");this.getList();if(this.paged==1){this.prev=!0}}},methods:{getList(){if(this.locked==!0)return;this.locked=!0;this.$https.post(b2_rest_url+"getNewComments","paged="+this.paged+"&count="+this.count+"&hidden="+this.hidden).then((res)=>{this.data=res.data.data;this.pages=res.data.pages;if(this.$refs.gujia){this.$refs.gujia.style.display="none"}
143this.$nextTick(()=>{b2SidebarSticky();b2RestTimeAgo(this.$refs.commentWidget.querySelectorAll(".b2timeago"))});this.locked=!1})},nexAc(){if(this.next||this.locked)return;this.paged++;this.getList()},prevAc(){if(this.prev||this.locked)return;this.paged--;this.getList()},},watch:{paged(val){if(val<=1){this.prev=!0}else{this.prev=!1}
144if(val>=this.pages){this.next=!0}else{this.next=!1}},},});var b2mobileFooterMenu=new Vue({el:"#mobile-footer-menu",data:{msg:0,show:!0},computed:{userData(){return this.$store.state.userData}}});var postPoBox=new Vue({el:"#post-po-box",data:{show:!1,login:!1,allow:"",},mounted(){if(b2token){this.login=!0}},methods:{close(){this.showPost=!this.showPost},go(val,type){if(!this.login){login.show=!0;login.type=0;return}
145if(type!="request"){if(!userTools.role[type]){Qmsg.warning(b2_global.js_text.global.not_allow,{html:!0});return}}
146setTimeout(()=>{window.location.href=val},250)},},});var b2AsideBar=new Vue({el:".aside-container",data:{dmsg:{count:0,},msg:{count:0,},showBox:!1,showType:{user:!1,msg:!1,dmsg:!1,mission:!1,coupon:!1,},locked:!1,mission:[],bool:!1,coupon:{count:0,data:"",},showCouponInfo:[],qrcode:"",ref:"",dlocked:!1,count:0,cartLocked:!1,b2token:!1,},computed:{userData(){return this.$store.state.userData},carts(){if(this.count&&!this.cartLocked){return{count:this.count,data:"",}}else{let carts=this.$store.state.carts;return{count:carts!==null&&carts!==undefined?Object.keys(carts).length:0,data:carts,}}},},mounted(){this.b2token=b2token},methods:{getQrcode(url){var url=new URL(url);url.searchParams.set("ref",this.ref);var qr=new QRious({value:url.href,size:120,level:"L",});return qr.toDataURL("image/jpeg")},goMyPage(){if(!b2token){login.show=!0;login.type=0;return}
147window.location.href=this.userData.link},chat(){if(b2_global.chat.type=="crisp"){$crisp.push(["do","chat:open"])}
148if(b2_global.chat.type=="qq"){window.open("http://wpa.qq.com/msgrd?v=3&uin="+b2_global.chat.qq+"&site=qq&menu=yes","_blank")}
149if(b2_global.chat.type=="weixin"){window.open(b2_global.chat.weixin,"_blank")}
150if(b2_global.chat.type=="dmsg"){if(!b2token){login.show=!0}else{b2Dmsg.userid=b2_global.chat.dmsg;b2Dmsg.show=!0}}
151if(b2_global.chat.type=="requests"){if(!b2token){login.show=!0}else{window.open(b2_global.home_url+"/requests","_blank")}}},show(type,value){this.closeBox();if(type==="user"){if(!b2token){login.show=!0;login.type=0;return}}
152if(type==="dmsg"&&this.dmsg.count==0){if(!b2token){login.show=!0;login.type=0;return}
153this.jumpTo(value);return}
154if(type==="msg"){if(!b2token){login.show=!0;login.type=0;return}
155this.jumpTo(value);return}
156if(type=="mission"){this.mission=b2Mission;if(this.mission.data.length==0){this.mission.getData(10)}}
157if(type==="coupon"){this.getMyCoupons()}
158if(type==="cart"){if(!b2token){login.show=!0;login.type=0;return}
159this.getMycarts()}
160this.showType[type]=!0;this.showBox=!0;this.$nextTick(()=>{b2RestTimeAgo(this.$el.querySelectorAll(".b2timeago"))})},getMycarts(){if(this.cartLocked==!0)return;this.cartLocked=!0;this.$http.get(b2_rest_url+"getMyCarts").then((res)=>{if(Object.keys(res.data).length>0){this.$store.commit("setcartsData",res.data)}})},showAc(val){if(!b2token){login.show=!0;return}
161if(val){this.show("user")}else{this.close()}},closeBox(){Object.keys(this.showType).forEach((key)=>{this.showType[key]=!1});this.showBox=!1},getNewDmsg(){if(b2token){if(this.locked)return;this.locked=!0;this.$http.post(b2_rest_url+"getNewDmsg").then((res)=>{this.dmsg=res.data.dmsg;this.locked=!1})}},close(){if(this.$refs.asideContainer&&this.$refs.asideContainer.className.indexOf("aside-show")&&B2ClientWidth<768){this.$refs.asideContainer.className=this.$refs.asideContainer.className.replace(" aside-show","");this.showBox=!1}else{this.closeBox()}},goTop(){this.$scrollTo(".site",300,{offset:0})},login(){if(!b2token){login.show=!0;return}else if(!this.$refs.asideContent){self.location=this.$store.state.userData.link}else{this.show("user");this.$refs.asideContainer.className+=" aside-show"}},showSearch(){b2SearchBox.close()},jumpTo(url){window.location.href=url},updateCarts(){let data=b2getCookie("carts");if(data){this.carts.data=JSON.parse(data)}else{this.carts.data=""}
162if(this.carts.data){if(this.carts.count>Object.keys(this.carts.data).length){b2mobileFooterMenu.msg=b2mobileFooterMenu.msg-(this.carts.count-Object.keys(this.carts.data).length)}else{b2mobileFooterMenu.msg=b2mobileFooterMenu.msg+(Object.keys(this.carts.data).length-this.carts.count)}
162
163this.carts.count=Object.keys(this.carts.data).length}},deleteCarts(id){this.$https.post(b2_rest_url+"deleteMyCarts","id="+id).then((res)=>{if(res.data.length==0){this.$store.commit("setcartsData",{})}else{this.$store.commit("setcartsData",res.data)}})},getMyCoupons(){if(!b2token){login.show=!0;return}
164this.showType.coupon=!0;this.$https.get(b2_rest_url+"getMyCoupons").then((res)=>{this.coupon=res.data})},couponClass(item){if(item.expiration_date.expired)return"stamp04";if(item.products.length>0)return"stamp01";if(item.cats.length>0)return"stamp02";return"stamp03"},couponMoreInfo(id){this.$set(this.showCouponInfo,id,!this.showCouponInfo[id])},deleteCoupon(id){var r=confirm(b2_global.js_text.global.delete_coupon);if(r){this.$https.post(b2_rest_url+"deleteMyCoupon","id="+id).then((res)=>{this.$delete(this.coupon.data,id);this.$set(this.coupon,"count",this.coupon.count-1)})}
165return},},watch:{userData(val){if(val&&this.$refs.asideContent){if(b2token){this.ref=val.user_code;this.getNewDmsg()}
166this.updateCarts()}},dmsg:{handler(newVal,old){if(newVal.count>0){b2mobileFooterMenu.msg+=parseInt(newVal.count)}},immediate:!0,deep:!0,},msg:{handler(newVal,old){if(newVal.count>0){b2mobileFooterMenu.msg+=parseInt(newVal.count)}},immediate:!0,deep:!0,},showBox(val){if(val&&B2ClientWidth<768){this.$refs.asideContainer.className+=" aside-show"}},},});function b2HiddenFilterBox(event){event.parentNode.parentNode.className=event.parentNode.parentNode.className.replace("b2-show","")}
167function b2flickity(){if(B2ClientWidth<768)return;var f=document.querySelectorAll(".home-collection-silder");if(f){var collection=[];for(let i=0;i<f.length;i++){collection[i]=new Flickity(f[i],{pageDots:!1,groupCells:!0,draggable:!0,prevNextButtons:!1,freeScroll:!1,wrapAround:!0,selectedAttraction:0.15,friction:1,freeScrollFriction:0.1,cellAlign:"left",});let previous,next;if(f[i].querySelector(".coll-3-box")){previous=f[i].parentNode.querySelector(".collection-previous")}else{previous=f[i].parentNode.parentNode.parentNode.querySelector(".collection-previous")}
168previous.addEventListener("click",function(){collection[i].previous()},passiveSupported?{passive:!0}:!1);if(f[i].querySelector(".coll-3-box")){next=f[i].parentNode.querySelector(".collection-next")}else{next=f[i].parentNode.parentNode.parentNode.querySelector(".collection-next")}
169next.addEventListener("click",function(){collection[i].next()},passiveSupported?{passive:!0}:!1)}}}
170b2flickity();function b2HiddenFooter(){let footer=document.querySelector(".site-footer .site-footer-widget-in");if(!footer)return;let footerWidget=footer.querySelectorAll(".mobile-hidden");if(footerWidget&&footerWidget.length>=footer.childNodes.length){document.querySelector(".site-footer").className+=" mobile-hidden"}}
171b2HiddenFooter();var b2SearchUser=new Vue({el:"#user-list",data:{follow:[],ids:[],},mounted(){if(this.$refs.searchUser){this.ids=b2_search_data.users;this.checkFollowByids()}},methods:{checkFollowByids(){let data={ids:this.ids,};this.$http.post(b2_rest_url+"checkFollowByids",Qs.stringify(data)).then((res)=>{this.follow=res.data})},followAc(id){if(!b2token){login.show=!0}else{this.$http.post(b2_rest_url+"AuthorFollow","user_id="+id).then((res)=>{this.follow[id]=res.data}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0})})}},dmsg(id){if(!b2token){login.show=!0}else{b2Dmsg.userid=id;b2Dmsg.show=!0}},},});(function(){var calc={Add:function(arg1,arg2){(arg1=arg1.toString()),(arg2=arg2.toString());var arg1Arr=arg1.split("."),arg2Arr=arg2.split("."),d1=arg1Arr.length==2?arg1Arr[1]:"",d2=arg2Arr.length==2?arg2Arr[1]:"";var maxLen=Math.max(d1.length,d2.length);var m=Math.pow(10,maxLen);var result=Number(((arg1*m+arg2*m)/m).toFixed(maxLen));var d=arguments[2];return typeof d==="number"?Number(result.toFixed(d)):result},Sub:function(arg1,arg2){return Calc.Add(arg1,-Number(arg2),arguments[2])},Mul:function(arg1,arg2){var r1=arg1.toString(),r2=arg2.toString(),m,resultVal,d=arguments[2];m=(r1.split(".")[1]?r1.split(".")[1].length:0)+(r2.split(".")[1]?r2.split(".")[1].length:0);resultVal=(Number(r1.replace(".",""))*Number(r2.replace(".","")))/Math.pow(10,m);return typeof d!=="number"?Number(resultVal):Number(resultVal.toFixed(parseInt(d)))},Div:function(arg1,arg2){var r1=arg1.toString(),r2=arg2.toString(),m,resultVal,d=arguments[2];m=(r2.split(".")[1]?r2.split(".")[1].length:0)-(r1.split(".")[1]?r1.split(".")[1].length:0);resultVal=(Number(r1.replace(".",""))/Number(r2.replace(".","")))*Math.pow(10,m);return typeof d!=="number"?Number(resultVal):Number(resultVal.toFixed(parseInt(d)))},};window.Calc=calc})();function b2stmap(){let stmaps=document.querySelectorAll(".stamp");if(stmaps.length>0){let h_axios=axios;if(b2token){h_axios.defaults.headers.common.Authorization="Bearer "+b2token}
172for(let i=0;i<stmaps.length;i++){if(stmaps[i].querySelector(".coupon-receive")){stmaps[i].querySelector(".coupon-receive").onclick=(event)=>{if(!b2token){login.show=!0;return}
173h_axios.post(b2_rest_url+"ShopCouponReceive","&id="+event.target.getAttribute("data-id")).then((res)=>{if(res.data){Qmsg.success(b2_global.js_text.global.get_success,{html:!0,})}}).catch((err)=>{Qmsg.success(err.response.data.message,{html:!0})})};stmaps[i].querySelector(".more-coupon-info").onclick=(event)=>{event.target.nextElementSibling.style.display="block"};stmaps[i].querySelector(".close-coupon-info").onclick=(event)=>{event.target.parentNode.parentNode.style.display="none"}}}}}
174b2stmap();function b2IsPhoneAvailable(phonevalue){var phoneReg=/^1[0-9]{10}/;var emailReg=/[a-zA-Z0-9]{1,10}@[a-zA-Z0-9]{1,5}\.[a-zA-Z0-9]{1,5}/;if(phoneReg.test(phonevalue)||emailReg.test(phonevalue)){return!0}else{return!1}}
175var b2TaxTop=new Vue({el:".tax-header",data:{showFliter:{hot:!1,cat:!1,},}
175,methods:{show(type){if(type==="hot"){this.showFliter.hot=!this.showFliter.hot;this.showFliter.cat=!1}
176if(type==="cat"){this.showFliter.cat=!this.showFliter.cat;this.showFliter.hot=!1}},},});function b2scroll(fn){var beforeScrollTop=document.documentElement.scrollTop,fn=fn||function(){};window.bodyScrool=function(){var afterScrollTop=document.documentElement.scrollTop||document.body.scrollTop,delta=afterScrollTop-beforeScrollTop;if(delta===0)return!1;fn(delta>0?"down":"up",afterScrollTop);beforeScrollTop=afterScrollTop};window.addEventListener("scroll",window.bodyScrool,passiveSupported?{passive:!0}:!1)}
177function b2HeaderTop(){const banner=document.querySelector(".header-banner-left");const header=document.querySelector(".site");const aside=document.querySelector(".bar-user-info");const socialTop=document.querySelector(".social-top");const nosub=document.querySelector(".social-no-sub");const footer=document.querySelector(".mobile-footer-menu");if(!banner)return;let h=96;if(B2ClientWidth<768){h=77}
178if(socialTop){h=113}
179if(nosub){h=58}
180b2scroll(function(direction,top){if(top>h){if(direction==="down"){if(banner.className.indexOf(" hidden")===-1){banner.className+=" hidden"}
181if(header.className.indexOf(" up")===-1){header.className+=" up"}
182if(footer&&B2ClientWidth<768&&footer.className.indexOf(" footer-down")===-1){footer.className+=" footer-down"}}else{banner.className=banner.className.replace(" hidden","");header.className=header.className.replace(" up","");if(footer&&B2ClientWidth<768){footer.className=footer.className.replace(" footer-down","")}}
183if(header.className.indexOf(" action")===-1){header.className+=" action"}}else{header.className=header.className.replace(" action","");banner.className=banner.className.replace(" hidden","");header.className=header.className.replace(" up","")}})}
184b2HeaderTop();var b2NewsfalshesWidget=new Vue({el:".widget-newsflashes-box",data:{options:[],list:"",},mounted(){if(this.$refs.newsWidget){this.options=JSON.parse(this.$refs.newsWidget.getAttribute("data-json"));this.getList()}},methods:{getList(){this.$https.post(b2_rest_url+"getWidgetNewsflashes",Qs.stringify(this.options)).then((res)=>{this.list=res.data;this.$refs.gujia.style.display="none"})},},});Vue.component("weixin-bind",{props:["show","url","msg"],template:b2_global.weixin_bind,methods:{close(){this.$emit("close")},},});var b2weixinBind=new Vue({el:"#weixin-bind",data:{show:!1,url:"",msg:"",},methods:{close(){this.show=!this.show},},});function b2CurrentPageReload(url){if(!url){url=location.href}
185setTimeout(()=>{location.replace(url)},200)}
186function b2GetQueryVariable(variable){var query=window.location.search.substring(1);var vars=query.split("&");for(var i=0;i<vars.length;i++){var pair=vars[i].split("=");if(pair[0]==variable){return pair[1]}}
187return!1}
188function b2removeURLParameter(url,parameter){var urlparts=url.split("?");if(urlparts.length>=2){var prefix=encodeURIComponent(parameter)+"=";var pars=urlparts[1].split(/[&;]/g);for(var i=pars.length;i-->0;){if(pars[i].lastIndexOf(prefix,0)!==-1){pars.splice(i,1)}}
189return urlparts[0]+(pars.length>0?"?"+pars.join("&"):"")}
190return url}
191function updateURLParameter(uri,key,value){if(!value){return uri}
192var re=new RegExp("([?&])"+key+"=.*?(&|$)","i");var separator=uri.indexOf("?")!==-1?"&":"?";if(uri.match(re)){return uri.replace(re,"$1"+key+"="+value+"$2")}else{return uri+separator+key+"="+value}}
193function validate(evt){var theEvent=evt||window.event;if(theEvent.type==="paste"){key=event.clipboardData.getData("text/plain")}else{var key=theEvent.keyCode||theEvent.which;key=String.fromCharCode(key)}
194var regex=/[0-9]|\./;if(!regex.test(key)){theEvent.returnValue=!1;if(theEvent.preventDefault)theEvent.preventDefault()}}
195Vue.component("bind-login",{props:["show","type"],template:b2_global.bind_login,data(){return{locked:!1,count:60,SMSLocked:!1,data:{img_code:"",token:"",username:"",password:"",confirmPassword:"",code:"",},eye:!1,success:"",}},computed:{userData(){return this.$store.state.userData},},methods:{close(){this.$emit("close")},showCheck(){if(this.type!=="text"&&this.type!=="luo"&&this.data.username&&this.show){return!0}
196return!1}
196,sendCode(){recaptcha.show=!0;recaptcha.type="bind";this.close()},sendSMS(){if(this.SMSLocked==!0)return;this.SMSLocked=!0;this.$http.post(b2_rest_url+"sendCode",Qs.stringify(this.data)).then((res)=>{if(res.data.token){this.countdown();this.data.smsToken=res.data.token}
197this.SMSLocked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.SMSLocked=!1})},countdown(){if(this.count<=1){this.count=60;return}
198this.count--;setTimeout(()=>{this.countdown()},1000)},setToken(val){this.data.img_code=val.value;this.data.token=val.token;this.sendSMS()},submit(){if(this.locked)return;this.locked=!0;this.$http.post(b2_rest_url+"bindUserLogin",Qs.stringify(this.data)).then((res)=>{this.success=res.data;this.locked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},},});var b2bindLogin=new Vue({el:"#binding-login",data:{show:!1,type:!1,},methods:{close(){this.show=!this.show},imgCodeAc(val){this.$refs.bindBox.setToken(val)},},watch:{type(val){if(val){this.show=!0}},},});var b2CreditTop=new Vue({el:".credit-top",data:{settings:[],data:"",},mounted(){if(this.$refs.creditTop){this.settings=JSON.parse(this.$refs.creditTop.getAttribute("data-settings"));this.getList()}},methods:{getList(){this.$http.post(b2_rest_url+"getGoldTop",Qs.stringify(this.settings)).then((res)=>{this.data=res.data;this.$nextTick(()=>{this.$refs.creditTopGujia.style.display="none"})})},},});function grin(tag,myField){if(document.selection){myField.focus();sel=document.selection.createRange();sel.text=tag;myField.focus()}else if(myField.selectionStart||myField.selectionStart=="0"){var startPos=myField.selectionStart;var endPos=myField.selectionEnd;var cursorPos=startPos;myField.value=myField.value.substring(0,startPos)+tag+myField.value.substring(endPos,myField.value.length);cursorPos+=tag.length;myField.focus();myField.selectionStart=cursorPos;myField.selectionEnd=cursorPos}else{myField.value+=tag;myField.focus()}}
199var b2HotCircle=new Vue({el:".b2-widget-hot-circle",data:{data:"",count:6,type:"hot",paged:{hot:1,join:1,create:1,},locked:!1,},mounted(){if(!this.$refs.hotCircle)return;this.count=this.$refs.hotCircle.getAttribute("data-count");this.getCirclesList("hot")},methods:{go(link){window.location.href=link},getCirclesList(type){if(!b2token&&type!=="hot"){login.show=!0;login.type=1;return}
200if(this.locked===!0)return;this.locked=!0;let data={count:this.count,type:type,paged:this.paged[type],};this.$refs.gujia.style.display="block";this.data="";this.$http.post(b2_rest_url+"getCirclesList",Qs.stringify(data)).then((res)=>{this.data=res.data;this.$nextTick(()=>{this.$refs.gujia.style.display="none";b2SidebarSticky();lazyLoadInstance.update()});this.type=type;this.locked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})},},});if(!window.scrollTo){window.scrollTo=function(x,y){window.pageXOffset=x;window.pageYOffset=y}}
201if(!window.scrollBy){window.scrollBy=function(x,y){window.pageXOffset+=x;window.pageYOffset+=y}}
202if(!document.body.scrollTo){Element.prototype.scrollTo=function(x,y){this.scrollLeft=x;this.scrollTop=y}}
203if(!document.body.scrollBy){Element.prototype.scrollBy=function(x,y){this.scrollLeft+=x;this.scrollTop+=y}}
204var payReturn=new Vue({el:"#pay-return",data:{login:!1,},mounted(){if(b2token){this.login=!0}},});const searchBox=document.querySelectorAll(".search-module");if(searchBox){for(let index=0;index<searchBox.length;index++){let id=searchBox[index].getAttribute("data-i");new Vue({el:"#search-module-"+id,data:{link:b2_global.home_url,keyword:"",category:b2_global.js_text.global.all,show:!1,},mounted(){document.onclick=(e)=>{this.show=!1;userTools.hideAction()}},methods:{picked(id,category,link){this.link=link;this.category=category;this.show=!1},pickedKey(key){},},})}}
205var b2recommendedCircle=new Vue({el:".b2-widget-recommended-circle",data:{data:"",current:0,},mounted(){if(!this.$refs.recommendedGujia)return;this.getCircles()},methods:{create(){if(!b2token){login.show=!0;login.loginType=1}else{window.open(b2_global.home_url+"/create-circle","_blank")}},getCircles(){let ids=JSON.parse(this.$refs.recommendedGujia.getAttribute("data-ids"));if(ids.length==0)return;let data={ids:ids,};this.$http.post(b2_rest_url+"getCircleDataByCircleIds",Qs.stringify(data)).then((res)=>{this.data=res.data;this.$nextTick(()=>{this.$refs.recommendedGujia.style.display="none";if(typeof b2CirclePostBox!="undefined"){if(b2CirclePostBox.$refs.textareaTopic){this.current=parseInt(b2CirclePostBox.$refs.textareaTopic.getAttribute("data-circle"))}}
206this.$nextTick(()=>
206{lazyLoadInstance.update()});b2SidebarSticky()})})},go(even,index){if(typeof b2CirclePostBox!="undefined"){even.stopPropagation();even.preventDefault();let id=this.data[index].id;b2CirclePostBox.circle.picked=id;this.current=id;b2CircleList.pickedCircle("widget",id);b2CirclePostBox.getCurrentUserCircleData();window.history.pushState(id,this.data[index].name,this.data[index].link);document.title=this.data[index].name+" "+b2_global.site_separator+" "+b2_global.site_name;return!1}},},});document.b2ready=function(callback){if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,!1);callback()},!1)}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState=="complete"){document.detachEvent("onreadystatechange",arguments.callee);callback()}})}else if(document.lastChild==document.body){callback()}};function b2tooltip(cla){const d=document.querySelectorAll(cla);if(!d)return;if(B2ClientWidth<768)return;var x=15;var y=10;window.b2thistip=[];for(let i=0;i<d.length;i++){d[i].addEventListener("mouseover",function(e){var tooltip="<div class='b2tooltip' id='b2tooltip"+i+"'>"+this.getAttribute("data-title")+"</div>";document.body.insertAdjacentHTML("beforeend",tooltip);window.b2thistip[i]=document.querySelector("#b2tooltip"+i);window.b2thistip[i].style.top=e.pageY+y+"px";window.b2thistip[i].style.left=e.pageX+x+"px";window.b2thistip[i].style.display="block"},passiveSupported?{passive:!0}:!1);d[i].addEventListener("mouseout",function(e){if(typeof window.b2thistip[i]!="undefined")
207window.b2thistip[i].remove()},passiveSupported?{passive:!0}:!1);d[i].addEventListener("mousemove",function(e){window.b2thistip[i].style.top=e.pageY+y+"px";window.b2thistip[i].style.left=e.pageX+x+"px"},passiveSupported?{passive:!0}:!1)}}
208b2tooltip(".b2tooltipbox");function b2cpay(){const paybox=document.querySelectorAll(".custom-pay-box");if(paybox.length>0){for(let i=0;i<paybox.length;i++){new Vue({el:paybox[i],data:{locked:{},count:{},files:{},progress:{},related:!1,related_field:"",related_prices:[],active_time:{active:!1,tips:"",},price:"",api:"getCpayResout",selecter:"cpay-resout-list-in",list:{pages:0,paged:1,count:20,id:0,data:"",},allow:0,tab:"form",},mounted(){if(this.$refs.pickprice){this.price=this.$refs.pickprice.getAttribute("data-price")}
209if(this.$refs.cpayresout){this.list.id=this.$refs.cpayresout.getAttribute("data-id");this.$refs.reslist.go(this.list.paged,"comment",!0,!0)}
210this.getCpayInfo()},watch:{related_field:function(val){this.price=this.related_prices[val]},},methods:{getCpayInfo(){this.$http.post(b2_rest_url+"getCpayInfo","post_id="+this.list.id).then((res)=>{if(res.data.related===!0){this.related=!0;this.related_field=res.data.related_field_value;this.related_prices=res.data.related_prices}
211this.active_time=res.data.active_time}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0})})},getList(res){this.list.data=res.data;this.allow=res.allow;this.list.pages=res.pages},submit(title,id,postid){let obj={};let data=new FormData(this.$refs.form);for(let[key,value]of data){if(obj[key]!==undefined){if(!Array.isArray(obj[key])){obj[key]=[obj[key]]}
212obj[key].push(value)}else{obj[key]=value}
213if(typeof obj[key]=="object"){if(obj[key].lastModified){delete obj[key]}}
214if(this.files.hasOwnProperty(key)){obj[key]=this.files[key]}
215if(this.$refs[key+"required"]){let required=this.$refs[key+"required"].getAttribute("data-required");required=parseInt(required);if(required&&(!obj[key]||(Array.isArray(obj[key])&&obj[key].length==0))){Qmsg.warning(b2_global.js_text.global.cpay_required_fields,{html:!0});return}}}
216if(!obj.price){Qmsg.warning(b2_global.js_text.global.cpay_required_fields,{html:!0,});return}
217b2DsBox.data={title:title,order_type:"custom",order_price:obj.price,post_id:id,order_key:postid,order_value:JSON.stringify(obj),};b2DsBox.show=!0;console.log(b2DsBox.data);return obj},deleteAc(key,index){if(confirm(b2_global.js_text.circle.remove_file)){this.$delete(this.files[key],index);this.$delete(this.progress[key],index);this.locked[key]=!1;this.$set(this.count,key,this.count[key]-1)}},fileExists(mime){let index=mime.lastIndexOf(".");let ext=mime.substr(index+1);return ext.toLowerCase()},readablizeBytes(bytes){let s=["B","KB","MB","GB","TB","PB"];let e=Math.floor(Math.log(bytes)/Math.log(1024));return((bytes/Math.pow(1024,Math.floor(e))).toFixed(2)+" "+s[e])},fileType(ext){ext=ext.toLowerCase();switch(ext){case "jpg":case "png":case "gif":case "jpeg":case "ico":case "webp":return"image";case "mp3":case "m4a":case "ogg":case "wav":return"video";case "mp4":case "mov":case "avi":case "mpg":case "ogv":case "3gp":case "3g2":return"audio";default:return"file"}},fileChange(event,count,key,id){if(event.target.files.length>count){let msg=b2_global.js_text.global.cpay_file_count;msg=msg.replace("${count}",count);Qmsg.warning(msg,{html:!0});return}
218if(event.target.files.length<=0)return;if(!this.files.hasOwnProperty(key)){this.$set(this.files,key,[]);this.$set(this.progress,key,[]);this.$set(this.locked,key,[]);this.$set(this.count,key,0)}
219if(event.target.files.length>count-this.count[key]){let msg=b2_global.js_text.global.cpay_file_count_less;msg=msg.replace("${count}",count-this.count[key]);Qmsg.warning(msg,{html:!0});return}
220if(this.locked[key]==!0)return;let index=parseInt(this.files[key].length);
220Object.keys(event.target.files).forEach((k)=>{console.log(k);this.$set(this.count,key,this.count[key]+1);this.locked[key]=!0;k=parseInt(k);const ext=this.fileExists(event.target.files[k].name);this.$set(this.files[key],k+index,{size:this.readablizeBytes(event.target.files[k].size),name:event.target.files[k].name,ext:ext,type:this.fileType(ext),});this.$set(this.progress[key],k+index,{status:"doing",number:0,msg:"",});let formData=new FormData();formData.append("file",event.target.files[k],event.target.files[k].name);formData.append("post_id",id);formData.append("type","cpay");let config={onUploadProgress:(progressEvent)=>{this.$set(this.progress[key][k+index],"number",((progressEvent.loaded/progressEvent.total)*100)|0)},};this.$http.post(b2_rest_url+"fileUpload",formData,config).then((res)=>{console.log(res);if(res.data.status==401){Qmsg.warning(res.data.message,{html:!0});this.$set(this.progress[key][k+index],"status","fail");this.$set(this.progress[key][k+index],"msg",res.data.message)}else{this.$set(this.files[key][k+index],"url",res.data.url);this.$set(this.files[key][k+index],"id",res.data.id);this.$set(this.progress[key][k+index],"status","success")}
221console.log(this.files);if(this.count[key]>=count){this.locked[key]=!0}else{this.locked[key]=!1}
222event.target.value=""}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked[key]=!1;this.$set(this.progress[key][k+index],"status","fail");this.$set(this.progress[key][k+index],"msg",err.response.data.message);event.target.value=""})})},},})}}}
223b2cpay();function b2fingerprint(){var canvas=document.createElement("canvas");var ctx=canvas.getContext("2d");var txt="i9asdm..$#po((^@KbXrww!~cz";ctx.textBaseline="top";ctx.font="16px 'Arial'";ctx.textBaseline="alphabetic";ctx.rotate(0.05);ctx.fillStyle="#f60";ctx.fillRect(125,1,62,20);ctx.fillStyle="#069";ctx.fillText(txt,2,15);ctx.fillStyle="rgba(102, 200, 0, 0.7)";ctx.fillText(txt,4,17);ctx.shadowBlur=10;ctx.shadowColor="blue";ctx.fillRect(-20,10,234,5);var strng=canvas.toDataURL();var hash=0;if(strng.length==0)return;for(i=0;i<strng.length;i++){char=strng.charCodeAt(i);hash=(hash<<5)-hash+char;hash=hash&hash}
224return hash}
225var b2stream=new Vue({el:"#b2-stream",data:{paged:1,pages:0,author:1,data:"",empty:!1,locked:!1,},mounted(){if(!this.$refs.b2stream)return;this.paged=this.$refs.b2stream.getAttribute("data-paged");this.author=this.$refs.b2stream.getAttribute("data-author");this.getList()},methods:{getList(){this.$http.post(b2_rest_url+"getStreamList","paged="+this.paged+"&author="+this.author).then((res)=>{this.data=res.data;if(this.data.length==0){this.empty=!0}
226this.$refs.gujia.style.display="none";this.$nextTick(()=>{b2SidebarSticky();lazyLoadInstance.update()})})},vote(type,id,index){if(!b2token){login.show=!0}else{if(this.locked==!0)return;this.locked=!0;this.$http.post(b2_rest_url+"postVote","type="+type+"&post_id="+id).then((res)=>{this.$set(this.data[index].data.data,"up",parseInt(this.data[index].data.data.up)+parseInt(res.data.up));this.$set(this.data[index].data.data,"down",parseInt(this.data[index].data.data.down)+parseInt(res.data.down));if(res.data.up>0){this.$set(this.data[index].data.data,"up_isset",1)}else{this.$set(this.data[index].data.data,"up_isset",0)}
227if(res.data.down>0){this.$set(this.data[index].data.data,"down_isset",1)}else{this.$set(this.data[index].data.data,"down_isset",0)}
228this.locked=!1}).catch((err)=>{Qmsg.warning(err.response.data.message,{html:!0});this.locked=!1})}},},});function _debounce(fn,delay){var delay=delay||200;var timer;return function(){var th=this;var args=arguments;if(timer){clearTimeout(timer)}
229timer=setTimeout(function(){timer=null;fn.apply(th,args)},delay)}}
230function _throttle(fn,interval){var last;var timer;var interval=interval||200;return function(){var th=this;var args=arguments;var now=+new Date();if(last&&now-last<interval){clearTimeout(timer);timer=setTimeout(function(){last=now;fn.apply(th,args)},interval)}else{last=now;fn.apply(th,args)}}}
231var askWidget=new Vue({el:".b2-widget-ask",data:{data:"",fliter:"last",paged:1,pages:0,count:0,cat:0,empty:!1,locked:!1,prev:!0,next:!1,},mounted(){if(!this.$refs.askwidget)return;this.count=this.$refs.askwidget.getAttribute("data-count");this.time=this.$refs.askwidget.getAttribute("data-time");const archive=document.querySelector(".ask-archive");
231if(archive){this.cat=archive.getAttribute("data-term")}
232const single=document.querySelector(".ask-single-top");if(single){this.cat=single.getAttribute("data-term")}
233this.getData()},watch:{fliter(val){this.prev=!0;this.next=!1;this.data="";this.paged=1;this.empty=!1;this.$refs.askwidget.querySelector(".gujia").style.display="block";this.getData()},},methods:{nexAc(){if(this.paged>=this.data.pages)return;if(this.locked)return;this.next=!0;this.paged++;this.getData()},prevAc(){if(this.paged<1)return;if(this.locked)return;this.prev=!0;this.paged--;this.getData()},getData(){if(this.locked)return;this.locked=!0;this.$http.post(b2_rest_url+"getAskData","paged="+this.paged+"&type="+this.fliter+"&count="+this.count+"&cat="+this.cat).then((res)=>{this.locked=!1;if(this.paged==1){if(res.data.data.length==0){this.empty=!0;this.data.data=[]}else{this.data=res.data}}else{this.data.data=res.data.data}
234if(this.data.pages>1&&this.paged<this.data.pages){this.next=!1}
235if(this.paged>1){this.prev=!1}
236this.$nextTick(()=>{this.$refs.askwidget.querySelector(".gujia").style.display="none"})})},},})

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.