import{s as t,C as a,c as s,D as e,p as o,o as l,e as n,w as i,_ as c,b as d,i as r,E as u,y as _,z as f,u as p,k as m,f as g,h as y,F as v,H as b,m as x,d as h,S as w,B as I}from"./index-520dfaee.js";import{_ as k}from"./s-goods-column.9bd716a4.js";import{_ as j}from"./uni-load-more.ba4f287c.js";import{a as S}from"./s-layout.5146c957.js";import{u as $}from"./useGoods.7c6b9280.js";import{_ as C}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css                                                                     *//* empty css                                                                *//* empty css                                                                      */const H=C({__name:"list",setup(C){b((t=>({"8762c5bc":p(E)})));const{screenHeight:H,safeAreaInsets:z,screenWidth:A,safeArea:B}=t.$platform.device,M=t.$platform.navbar,T=2*t.$platform.device.statusBarHeight,D=2*(B.height+z.bottom)+T-M-350,E=t.$url.css("/assets/addons/shopro/uniapp/goods/seckill-header.png"),F=a({activityId:0,pagination:{data:[],current_page:1,total:1,last_page:1},loadStatus:"",activityInfo:{}}),G=s((()=>{if(F.activityInfo.end_time)return $(F.activityInfo.end_time)}));async function L(a,s=1,e=4){F.loadStatus="loading";const o=await t.$api.goods.activityList({list_rows:e,activity_id:a,page:s});if(1===o.code){let t=c.concat(F.pagination.data,o.data.data);F.pagination={...o.data,data:t},F.pagination.current_page<F.pagination.last_page?F.loadStatus="more":F.loadStatus="noMore"}}function N(){"noMore"!==F.loadStatus&&L(F.activityId,F.pagination.current_page+1)}return e((()=>{N()})),o((async a=>{if(!a.id)return void(F.activityInfo=null);F.activityId=a.id,L(F.activityId);const{code:s,data:e}=await t.$api.activity.activity(a.id);F.activityInfo=1===s?e:null})),(a,s)=>{const e=x,o=I,c=d(h("s-goods-column"),k),b=d(h("uni-load-more"),j),$=w,C=d(h("s-layout"),S);return l(),n(C,{navbar:"inner",bgStyle:{color:"rgb(245,28,19)"}},{default:i((()=>[r(e,{class:"page-bg",style:u([{marginTop:"-"+Number(T+88)+"rpx"}])},null,8,["style"]),r(e,{class:"list-content"},{default:i((()=>[r(e,{class:"content-header ss-flex-col ss-col-center ss-row-center"},{default:i((()=>[r(e,{class:"content-header-title ss-m-b-22 ss-flex ss-row-center"},{default:i((()=>[r(e,null,{default:i((()=>[_(f(F.activityInfo.title),1)])),_:1})])),_:1}),r(e,{class:"content-header-box ss-flex ss-row-center"},{default:i((()=>{var t,a;return[(null==(t=p(G))?void 0:t.ms)>0&&F.activityInfo?(l(),n(e,{key:0,class:"countdown-box ss-flex"},{default:i((()=>[r(e,{class:"countdown-title ss-m-r-12"},{default:i((()=>[_("距结束")])),_:1}),r(e,{class:"ss-flex countdown-time"},{default:i((()=>[r(e,{class:"ss-flex countdown-h"},{default:i((()=>[_(f(p(G).h),1)])),_:1}),r(e,{class:"ss-m-x-4"},{default:i((()=>[_(":")])),_:1}),r(e,{class:"countdown-num ss-flex ss-row-center"},{default:i((()=>[_(f(p(G).m),1)])),_:1}),r(e,{class:"ss-m-x-4"},{default:i((()=>[_(":")])),_:1}),r(e,{class:"countdown-num ss-flex ss-row-center"},{default:i((()=>[_(f(p(G).s),1)])),_:1})])),_:1})])),_:1})):m("",!0),(null==(a=p(G))?void 0:a.ms)<0&&F.activityInfo?(l(),n(e,{key:1,class:""},{default:i((()=>[_(" 活动已结束 ")])),_:1})):m("",!0)]})),_:1})])),_:1}),r($,{class:"scroll-box",style:u({height:D+"rpx"}),"scroll-y":"true","scroll-with-animation":!1,"enable-back-to-top":!0},{default:i((()=>[(l(!0),g(v,null,y(F.pagination.data,(a=>(l(),n(e,{class:"goods-box ss-m-b-20",key:a.id},{default:i((()=>[r(c,{class:"",size:"lg",data:a,seckillTag:!0,onClick:s=>p(t).$router.go("/pages/goods/seckill",{id:a.id,activity_id:F.activityId})},{cart:i((()=>[r(o,{class:"ss-reset-button cart-btn"},{default:i((()=>[_("去抢购")])),_:1})])),_:2},1032,["data","onClick"])])),_:2},1024)))),128)),F.pagination.total>0?(l(),n(b,{key:0,status:F.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:N},null,8,["status"])):m("",!0)])),_:1},8,["style"])])),_:1})])),_:1},8,["bgStyle"])}}},[["__scopeId","data-v-e6329caa"]]);export{H as default};
