You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/public/assets/pages-sharp-index.2d2fff42.js

1 lines
6.0 KiB

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?"距结束":"距开始"),1)])),_:1}),i(E,{date:I.tabbar[I.curTabIndex].count_down_time,separator:"colon",theme:"custom"},null,8,["date"])])),_:1})])),_:1})):p("",!0),i(C,{class:"goods-hall"},{default:o((()=>[(e(!0),n(u,null,d(I.goodsList.data,((a,s)=>(e(),l(C,{class:"goods-item",key:s,onClick:s=>k.handleTargetGoods(a.sharp_goods_id)},{default:o((()=>[i(C,{class:"goods-item--container dis-flex"},{default:o((()=>[i(C,{class:"goods-image"},{default:o((()=>[i(A,{src:a.goods_image},null,8,["src"])])),_:2},1024),i(C,{class:"goods-info"},{default:o((()=>[i(C,{class:"goods-name"},{default:o((()=>[i(w,{class:"twoline-hide"},{default:o((()=>[f(m(a.goods_name),1)])),_:2},1024)])),_:2},1024),i(C,{class:"sharp-progress dis-flex flex-y-center"},{default:o((()=>[i(C,{class:"yoo-progress",style:r({backgroundColor:k.progressBackgroundColor})},{default:o((()=>[i(C,{class:"yoo-progress--portion",style:r({width:`${a.progress}%`})},null,8,["style"]),i(w,{class:"yoo-progress--text"},{default:o((()=>[f(m(a.progress)+"%",1)])),_:2},1024)])),_:2},1032,["style"]),i(C,{class:"sharp-sales"},{default:o((()=>[f("已抢"+m(a.sales_actual)+"件",1)])),_:2},1024)])),_:2},1024),i(C,{class:"sharp-price dis-flex flex-y-end"},{default:o((()=>[i(C,{class:"seckill-price"},{default:o((()=>[i(w,{class:"f-24"},{default:o((()=>[f("¥")])),_:1}),i(w,{class:"money"},{default:o((()=>[f(m(a.seckill_price_min),1)])),_:2},1024)])),_:2},1024),i(C,{class:"original-price"},{default:o((()=>[i(w,{class:"f-24"},{default:o((()=>[f("¥")])),_:1}),i(w,{class:"money"},{default:o((()=>[f(m(a.original_price),1)])),_:2},1024)])),_:2},1024)])),_:2},1024),I.tabbar.length?(e(),l(C,{key:0,class:"opt-touch"},{default:o((()=>[i(C,{class:"touch-btn"},{default:o((()=>[i(w,null,{default:o((()=>[f(m(I.tabbar[I.curTabIndex].status==I.ActiveStatusEnum.STATE_BEGIN.value?"马上抢":"查看商品"),1)])),_:1})])),_:1})])),_:1})):p("",!0)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1},8,["onInit","onDown","up","onUp"])])),_:1},8,["style"])}],["__scopeId","data-v-acf0bf33"]]);export{j as default};