chunk-1b76ab02.24c0ed8d.js 7.4 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1b76ab02"],{"0a26":function(e,t,l){"use strict";l.r(t);l("14d9"),l("0643"),l("4e3e");var a=l("7a23"),o=l("5502"),n=l("af58"),i=l("54a5"),u=l("fa83"),d=l("1478"),c=l("2ef0"),s=l.n(c),v=l("c1df"),r=l.n(v);const m={class:"live-result-page acce-render"},f={key:2},h={name:"LiveResult"};var b=Object(a["defineComponent"])({...h,props:{fitterIndex:{type:Number,required:!0,default:()=>0},fitterTimeResult:{type:Object,required:!1,default:()=>({})}},setup(e){const t=Object(o["b"])(),l=Object(a["ref"])(!0),c=Object(a["ref"])(!1),v=Object(a["ref"])(!1),h=Object(a["ref"])(!1),b=r()(t.state.server_time),g=e,p=Object(a["toRef"])(g,"fitterIndex"),j=Object(a["computed"])(()=>{let e=g.fitterTimeResult;return"{}"!=JSON.stringify(e)?e:b});Object(a["watch"])(()=>j.value,()=>{O(),window.scrollTo({top:0})});const O=async()=>{try{var e;l.value?c.value=!0:v.value=!0,h.value=!1;let a=await u["c"]({match_date:r()(j.value).format("YYYY-MM-DD")});null!==a&&void 0!==a&&null!==(e=a.data)&&void 0!==e&&null!==(e=e.data)&&void 0!==e&&e.nm_match_list&&(t.commit("updateMatchListResult",a.data.data.nm_match_list),c.value=!1,h.value=!0),l.value?c.value=!1:v.value=!1,h.value=!0,l.value=!1}catch(a){l.value?c.value=!1:v.value=!1,h.value=!0,l.value=!1}},w=e=>{let l=t.state.updateWsTime||null,a=(null===e||void 0===e?void 0:e.status)||null,o=!1;return l&&a?((l>e.match_time&&a<2||[2,3,4,5,6,7].includes(a)&&!t.state.nm_live_message[e.id])&&(o=!0),o):o},B=e=>{const t={8:1,9:2,10:3,11:4,12:5,13:6,0:7};return e.sort((e,l)=>{const a=t[e.status]||0,o=t[l.status]||0;return a-o||e.match_time-l.match_time})},E=Object(a["computed"])(()=>s.a.clone(t.state.match_list_result)),y=Object(a["computed"])(()=>{let e=[[],[],[],[],[]];for(let t=0;t<E.value.length;t++){let l=E.value[t];l&&!w(l)&&l.status>=8&&(e[0].push(l),l.is_zucai&&e[3].push(l),(l.is_jingcai||l.is_beidan)&&(e[4].push(l),l.is_jingcai&&e[1].push(l),l.is_beidan&&e[2].push(l)))}for(let t=0;t<e.length;t++)e[t]=B(e[t]);return e}),_=Object(a["computed"])(()=>t.state.nm_live_message),k=Object(a["ref"])([0,25]),x=Object(a["ref"])({header:0,top:0,center:0,bottom:0,more:0,note:0,paddingBottom:0,finishedText:0}),H=Object(a["computed"])(()=>x.value.top+x.value.center+x.value.bottom+x.value.paddingBottom),C=Object(a["ref"])(0),N=Object(a["ref"])(0),T=Object(a["ref"])({}),R=(e,t)=>{T.value[e]===t||t<1||(T.value[e]=t)},S=async()=>{if(x.value.header<1){let e=document.getElementsByClassName("reserve-box")[0];(null===e||void 0===e?void 0:e.offsetHeight)>0&&(x.value.header=null===e||void 0===e?void 0:e.offsetHeight)}if(x.value.top<1){let e=document.getElementsByClassName("match-top")[0];(null===e||void 0===e?void 0:e.offsetHeight)>0&&(x.value.top=null===e||void 0===e?void 0:e.offsetHeight)}if(x.value.top<1){let e=document.getElementsByClassName("match-top")[0];(null===e||void 0===e?void 0:e.offsetHeight)>0&&(x.value.top=null===e||void 0===e?void 0:e.offsetHeight)}if(x.value.center<1){let e=document.getElementsByClassName("match-center")[0];(null===e||void 0===e?void 0:e.offsetHeight)>0&&(x.value.center=null===e||void 0===e?void 0:e.offsetHeight)}if(x.value.bottom<1){let e=document.getElementsByClassName("match-bottom")[0];(null===e||void 0===e?void 0:e.offsetHeight)>0&&(x.value.bottom=null===e||void 0===e?void 0:e.offsetHeight)}if(x.value.more<1){let e=document.getElementsByClassName("match-more")[0];(null===e||void 0===e?void 0:e.offsetHeight)>0&&(x.value.more=null===e||void 0===e?void 0:e.offsetHeight)}if(x.value.note<1){let e=document.getElementsByClassName("match-note")[0];(null===e||void 0===e?void 0:e.offsetHeight)>0&&(x.value.note=null===e||void 0===e?void 0:e.offsetHeight)}if(x.value.finishedText<1){let e=document.getElementsByClassName("van-list__finished-text")[0];(null===e||void 0===e?void 0:e.offsetHeight)>0&&(x.value.finishedText=null===e||void 0===e?void 0:e.offsetHeight)}if(x.value.paddingBottom<1){var e;let t=document.getElementsByClassName("match-box")[0];t&&null!==(e=window)&&void 0!==e&&null!==(e=e.getComputedStyle(t))&&void 0!==e&&e.paddingBottom&&(x.value.paddingBottom=Number(window.getComputedStyle(t).paddingBottom.split("px")[0]))}},L=e=>{let t=s.a.clone(y.value[p.value]),l=e+window.innerHeight;if(e+200<window.innerHeight)return[0,25];if(l+200>=document.body.clientHeight)return[t.length-25,t.length];let a=x.value.header,o={isEnd:!1,index:k.value[0]},n=x.value.header,i={isEnd:!1,index:k.value[1]};t.forEach((u,d)=>{a<e?a+=T[u.id]||H.value:o.isEnd||(o.index=d-10<0?0:d-10,o.isEnd=!0),n<l?n+=T[u.id]||H.value:i.isEnd||(i.index=d+10>t.length?t.length:d+10,i.isEnd=!0),!o.isEnd||i.isEnd});let u=o.index>t.length-25?t.length-25:o.index,d=i.index<25?25:i.index;return[u,d]},z=()=>{let e=document.documentElement.scrollTop;C.value>0&&Math.abs(C.value-e)<80||(C.value=e,S(),k.value=L(e))},D=async()=>{x.value={header:0,top:0,center:0,bottom:0,more:0,note:0,paddingBottom:0,finishedText:0},T.value={},C.value=0},M=(e,t)=>e==p.value&&t>=k.value[0]&&t<k.value[1],V=e=>{var t;return null===(t=_.value[e])||void 0===t?void 0:t.stats},J=e=>{var t;return null===(t=_.value[e])||void 0===t?void 0:t.score[5]},F=Object(a["ref"])(null),I=(e,t)=>{F.value&&F.value==e?F.value=null:F.value=e},Y=Object(a["computed"])(()=>window.innerHeight-x.value.header);return Object(a["onBeforeMount"])(async()=>{await O()}),Object(a["onActivated"])(()=>{C.value=0,window.addEventListener("scroll",z),window.addEventListener("resize",D);let e=setTimeout(()=>{window.scrollTo({top:N.value}),clearTimeout(e),e=null},300)}),Object(a["onDeactivated"])(()=>{window.removeEventListener("scroll",z),window.removeEventListener("resize",D),N.value=document.documentElement.scrollTop}),(e,t)=>(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",m,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(y.value,(e,l)=>(Object(a["openBlock"])(),Object(a["createElementBlock"])(a["Fragment"],null,[e?(Object(a["openBlock"])(),Object(a["createBlock"])(a["Transition"],{name:"slideInRight",key:e},{default:Object(a["withCtx"])(()=>[Object(a["withDirectives"])(Object(a["createVNode"])(Object(a["unref"])(i["a"]),{modelValue:v.value,"onUpdate:modelValue":t[0]||(t[0]=e=>v.value=e),onRefresh:O},{default:Object(a["withCtx"])(()=>[Object(a["createVNode"])(Object(a["unref"])(n["a"]),{id:"liveResult",ref_for:!0,ref:"liveResult",loading:c.value,finished:h.value,"finished-text":"没有更多了",style:Object(a["normalizeStyle"])({"min-height":Y.value+"px"})},{default:Object(a["withCtx"])(()=>[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e,(e,t)=>(Object(a["openBlock"])(),Object(a["createElementBlock"])(a["Fragment"],{key:e},[M(l,t)?(Object(a["openBlock"])(),Object(a["createBlock"])(d["a"],{key:0,class:"match-box",data:e,note:J(e.id),otherData:V(e.id),onDomHeight:R,onShowMore:I,isShow:F.value==e.id,isJz:1==p.value},null,8,["data","note","otherData","isShow","isJz"])):T.value[e.id]?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{key:1,style:Object(a["normalizeStyle"])({height:T.value[e.id]+"px"})},null,4)):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",f))],64))),128))]),_:2},1032,["loading","finished","style"])]),_:2},1032,["modelValue"]),[[a["vShow"],l==p.value]])]),_:2},1024)):Object(a["createCommentVNode"])("",!0)],64))),256))]))}}),g=(l("4653"),l("6b0d")),p=l.n(g);const j=p()(b,[["__scopeId","data-v-e4067d5c"]]);t["default"]=j},"3bcb":function(e,t,l){},4653:function(e,t,l){"use strict";l("3bcb")}}]);