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