|
|
|
|
import{$ as a,q as s,p as t,o as e,c as l,w as o,n as r,i as c,a as i,b as n,d,F as u,f,t as m,e as p,S as h,k as g,r as _,x as b,j as x,g as T}from"./index-ae8bbb19.js";import{M as y,_ as v}from"./mescroll-mixins.7cda1bf3.js";import{r as S}from"./uni-app.es.ee1d5b08.js";import{W as I}from"./wxofficial.cfa745b7.js";import{C as k}from"./index.002ef29d.js";import{h as C}from"./color.813a9497.js";import{A as L}from"./GoodsStatus.1f0790af.js";import{l as w}from"./goods.9ba1a26c.js";import{_ as E}from"./_plugin-vue_export-helper.1b428a4d.js";const A="sharp.home/data";const j=E({components:{CountDown:k},mixins:[y,I],data:()=>({isLoading:!0,curTabIndex:0,scrollLeft:0,upOption:{auto:!1,page:{size:15},noMoreSize:3},ActiveStatusEnum:L,tabbar:[],goodsList:[]}),computed:{progressBackgroundColor(){return C(this.appTheme.mainBg,.2)}},onLoad(a){this.onRefreshPage(),this.setWxofficialShareData()},methods:{onRefreshPage(){const s=this;return new Promise(((t,e)=>{var l;a.get(A,l).then((a=>{s.tabbar=a.data.tabbar,s.goodsList=a.data.goodsList,s.curTabIndex=0,s.scrollLeft=0,s.goodsList.data.length||s.mescroll.showEmpty(),t()})).catch(e)}))},getListData(a=1){const t=this,e=t.getCurTabbarId();return new Promise(((l,o)=>{w(e,{page:a},{load:!1}).then((e=>{const o=e.data.list;t.goodsList.data=s(o,t.goodsList,a),l(o)})).catch(o)}))},downCallback(){this.onRefreshPage().finally((()=>this.mescroll.endSuccess()))},upCallback(a){const s=this;s.getListData(a.num).then((a=>{const t=a.data.length,e=a.data.total;s.mescroll.endBySize(t,e)})).catch((()=>s.mescroll.endErr()))},scroll({detail:a}){this.scrollLeft=a.scrollLeft},handleTab(a){const s=this;s.curTabIndex=a,s.goodsList=t(),s.mescroll.resetUpScroll()},getCurTabbar(){return this.tabbar[this.curTabIndex]},getCurTabbarId(){const a=this.getCurTabbar();return a?a.active_time_id:0},handleTargetGoods(a){this.$navTo("pages/sharp/goods/index",{activeTimeId:this.getCurTabbarId(),sharpGoodsId:a})},setWxofficialShareData(){this.updateShareCardData({title:"整点秒杀会场"})}},onShareAppMessage(){return{title:"整点秒杀会场",path:`/pages/sharp/index?${this.$getShareUrlParams()}`}},onShareTimeline(){return{title:"整点秒杀会场",path:`/pages/sharp/index?${this.$getShareUrlParams()}`}}},[["render",function(a,s,t,y,I,k){const C=c,L=h,w=g,E=_("count-down"),A=T,j=S(b("mescroll-body"),v);return e(),l(C,{class:"container",style:r(a.appThemeStyle)},{default:o((()=>[i(j,{ref:"mescrollRef",sticky:!0,onInit:a.mescrollInit,down:{native:!0,auto:!1},onDown:k.downCallback,up:I.upOption,onUp:k.upCallback},{default:o((()=>[i(C,{class:"sharp-tabs"},{default:o((()=>[i(L,{"scroll-x":!0,"scroll-left":I.scrollLeft,onScroll:k.scroll},{default:o((()=>[i(C,{class:"sharp-tabs--container dis-flex"},{default:o((()=>[(e(!0),n(u,null,d(I.tabbar,((a,s)=>(e(),l(C,{key:s,class:x(["tabs-item dis-flex flex-dir-column flex-x-center flex-y-center",{active:I.curTabIndex==s}]),onClick:a=>k.handleTab(s)},{default:o((()=>[a.status==I.ActiveStatusEnum.STATE_NOTICE.value?(e(),l(C,{key:0,class:"item-title"},{default:o((()=>[f(m(a.status_text),1)])),_:2},1024)):(e(),n(u,{key:1},[i(C,{class:"item-time"},{default:o((()=>[f(m(a.active_time),1)])),_:2},1024),i(C,{class:"item-status"},{default:o((()=>[f(m(a.status_text),1)])),_:2},1024)],64))])),_:2},1032,["class","onClick"])))),128))])),_:1})])),_:1},8,["scroll-left","onScroll"])])),_:1}),I.tabbar.length?(e(),l(C,{key:0,class:"sharp-active dis-flex flex-dir-column flex-y-center"},{default:o((()=>[i(C,{class:"active-status"},{default:o((()=>[i(w,{class:"active-status--icon iconfont icon-artboard"}),I.tabbar[I.curTabIndex].status!=I.ActiveStatusEnum.STATE_NOTICE.value?(e(),l(w,{key:0,class:"active-status--time"},{default:o((()=>[f(m(I.tabbar[I.curTabIndex].active_time),1)])),_:1})):p("",!0),i(w,{class:"active-status--text"},{default:o((()=>[f(m(I.tabbar[I.curTabIndex].status_text2),1)])),_:1})])),_:1}),i(C,{class:"active--count-down dis-flex flex-y-center"},{default:o((()=>[i(w,{class:"m-r-10"},{default:o((()=>[f(m(I.tabbar[I.curTabIndex].status==I.ActiveStatusEnum.STATE_BEGIN.value?"距结束":"距<EFBFBD><EFBFBD>
|