import{o as e,c as s,w as o,a as t,f as a,b as l,d as n,F as i,n as d,e as u,k as c,i as r,r as f,S as m,x as _,t as p,y as g,Z as h,u as x,v as k,V as S}from"./index-ae8bbb19.js";import{_ as y}from"./mp-html.c15e78a1.js";import{r as w}from"./uni-app.es.ee1d5b08.js";import{_ as v}from"./u-modal.b5d074c6.js";import{W as b}from"./wxofficial.cfa745b7.js";import{S as C,a as T,C as A}from"./Comment.4c49b5d2.js";import{C as I}from"./index.88bc1a11.js";import{S as L}from"./SkuPopup.f6422807.js";import{A as P}from"./index.0c0be40a.js";import{C as j}from"./index.002ef29d.js";import{l as M}from"./task.c545452c.js";import{_ as G}from"./_plugin-vue_export-helper.1b428a4d.js";import{p as E,d as V}from"./goods.6f5948a4.js";import{t as R}from"./cart.414ee15f.js";import{A as D,a as U}from"./ActiveStatus.281bae5f.js";import"./u-loading.01f91c7b.js";import"./u-popup.d74d5514.js";import"./u-icon.b463ad8a.js";import"./comment.92b0fbb1.js";import"./color.813a9497.js";const $=G({components:{ShareSheet:C,CustomerBtn:I,SlideImage:T,TaskList:G({components:{AvatarImage:P,CountDown:j},props:{grouponGoodsId:{type:Number,default:null},list:{type:Array,default:[]}},data:()=>({showMore:!1,moreList:[]}),methods:{onShowMore(){const e=this;e.moreList.length?e.showMore=!0:M(e.grouponGoodsId).then((s=>{e.moreList=s.data.list,e.showMore=!0}))},onTargetTask(e){this.$navTo("pages/groupon/task/index",{taskId:e})}}},[["render",function(g,h,x,k,S,y){const b=c,C=r,T=f("avatar-image"),A=f("count-down"),I=m,L=w(_("u-modal"),v);return x.list.length?(e(),s(C,{key:0,class:"goods-task m-top20",style:d(g.appThemeStyle)},{default:o((()=>[t(C,{class:"item-title dis-flex"},{default:o((()=>[t(C,{class:"block-left flex-box"},{default:o((()=>[t(b,null,{default:o((()=>[a("进行中的团购")])),_:1})])),_:1}),t(C,{class:"block-right"},{default:o((()=>[t(b,{class:"iconfont icon-arrow-right col-9",onClick:h[0]||(h[0]=e=>y.onShowMore())})])),_:1})])),_:1}),t(C,{class:"task-list"},{default:o((()=>[(e(!0),l(i,null,n(x.list,((l,n)=>(e(),s(C,{class:"task-item",key:n},{default:o((()=>[t(C,{class:"user-info"},{default:o((()=>[t(C,{class:"user-avatar"},{default:o((()=>[t(T,{url:l.user.avatar_url,width:60},null,8,["url"])])),_:2},1024),t(b,{class:"user-name oneline-hide"},{default:o((()=>[a(p(l.user.nick_name),1)])),_:2},1024)])),_:2},1024),t(C,{class:"task-status"},{default:o((()=>[t(C,{class:"people"},{default:o((()=>[t(b,null,{default:o((()=>[a("还差")])),_:1}),t(b,{class:"col-m"},{default:o((()=>[a(p(l.surplus_people)+"人",1)])),_:2},1024),t(b,null,{default:o((()=>[a("成团")])),_:1})])),_:2},1024),t(C,{class:"count-down"},{default:o((()=>[t(b,null,{default:o((()=>[a("剩余")])),_:1}),t(A,{date:l.end_time,separator:"colon",theme:"text"},null,8,["date"])])),_:2},1024)])),_:2},1024),t(C,{class:"item-action"},{default:o((()=>[t(C,{class:"button",onClick:e=>y.onTargetTask(l.task_id)},{default:o((()=>[a("去参团")])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1024)))),128))])),_:1}),t(L,{modelValue:S.showMore,"onUpdate:modelValue":h[1]||(h[1]=e=>S.showMore=e),title:"可参与的拼单"},{default:o((()=>[t(I,{style:{"max-height":"610rpx","touch-action":"none"},"scroll-y":!0},{default:o((()=>[t(C,{class:"pops-content"},{default:o((()=>[(e(!0),l(i,null,n(S.moreList,((l,n)=>(e(),s(C,{class:"task-item",key:n},{default:o((()=>[t(C,{class:"user-info"},{default:o((()=>[t(C,{class:"user-avatar"},{default:o((()=>[t(T,{url:l.user.avatar_url,width:60},null,8,["url"])])),_:2},1024),t(b,{class:"user-name oneline-hide"},{default:o((()=>[a(p(l.user.nick_name),1)])),_:2},1024)])),_:2},1024),t(C,{class:"item-action"},{default:o((()=>[t(C,{class:"button",onClick:e=>y.onTargetTask(l.task_id)},{default:o((()=>[a("去参团")])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1})])),_:1},8,["modelValue"])])),_:1},8,["style"])):u("",!0)}],["__scopeId","data-v-8b507ab9"]]),SkuPopup:L,Comment:A,CountDown:j},mixins:[b],data:()=>({isLoading:!0,ActiveTypeEnum:D,ActiveStatusEnum:U,showSkuPopup:!1,skuMode:3,buyMode:1,showShareSheet:!1,posterApiCall:E,showRules:!1,setting:{},grouponGoodsId:null,goods:{},cartTotal:0,isShowCustomerBtn:!1}),async onLoad(e){this.onRecordQuery(e),this.onRefreshPage(),this.isShowCustomerBtn=await g.isShowCustomerBtn()},methods:{onRecordQuery(e){const s=h(e);this.grouponGoodsId=e.grouponGoodsId?parseInt(e.grouponGoodsId):parseInt(s.gid)},onRefreshPage(){const e=this;e.isLoading=!0,Promise.all([e.getActiveDetail(),e.getCartTotal()]).then((()=>e.setWxofficialShareData())).finally((()=>e.isLoading=!1))},getActiveDetail(){const e=this;return new Promise(((s,o)=>{V(e.grouponGoodsId).then((o=>{e.goods=o.data.detail,e.setting=o.data.setting,s(o)})).catch(o)}))},getCartTotal(){const e=this;return new Promise(((s,o)=>{R().then((o=>{e.cartTotal=o.data.cartTotal,s(o)})).catch(o)}))},handleShowRules(){this.showRules=!0},onShowSkuPopup(e=1){this.buyMode=e,this.showSkuPopup=!this.showSkuPopup},onShowShareSheet(){this.showShareSheet=!this.showShareSheet},onTargetHome(e){this.$navTo("pages/index/index")},onTargetCart(){this.$navTo("pages/cart/index")},setWxofficialShareData(){const{goods:e}=this;this.updateShareCardData({title:e.goods_name,desc:e.selling_point,imgUrl:e.goods_image})}},onShareAppMessage(){const e=this,s=e.$getShareUrlParams({grouponGoodsId:e.grouponGoodsId});return{title:e.goods.goods_name,path:`/pages/groupon/goods/index?${s}`}},onShareTimeline(){const e=this,s=e.$getShareUrlParams({grouponGoodsId:e.grouponGoodsId});return{title:e.goods.goods_name,path:`/pages/groupon/goods/index?${s}`}}},[["render",function(g,h,b,C,T,A){const I=f("SlideImage"),L=c,P=r,j=S,M=f("count-down"),G=f("TaskList"),E=f("SkuPopup"),V=f("Comment"),R=w(_("mp-html"),y),D=f("customer-btn"),U=f("share-sheet"),$=m,B=w(_("u-modal"),v);return x((e(),s(P,{class:"container",style:d(g.appThemeStyle)},{default:o((()=>[T.isLoading?u("",!0):(e(),s(I,{key:0,video:T.goods.video,videoCover:T.goods.videoCover,images:T.goods.goods_images},null,8,["video","videoCover","images"])),T.isLoading?u("",!0):(e(),s(P,{key:1,class:"goods-info m-top20"},{default:o((()=>[t(P,{class:"info-item info-item__top dis-flex flex-x-between flex-y-end"},{default:o((()=>[t(P,{class:"block-left dis-flex flex-y-center"},{default:o((()=>[t(P,{class:"active-tag"},{default:o((()=>[t(L,null,{default:o((()=>[a(p(T.goods.active_type!=T.ActiveTypeEnum.NORMAL.value?T.ActiveTypeEnum[T.goods.active_type].name2:"多人拼团"),1)])),_:1})])),_:1}),t(L,{class:"floor-price__samll"},{default:o((()=>[a("¥")])),_:1}),t(L,{class:"floor-price"},{default:o((()=>[a(p(T.goods.groupon_price),1)])),_:1}),t(L,{class:"original-price"},{default:o((()=>[a("¥"+p(T.goods.original_price),1)])),_:1})])),_:1}),t(P,{class:"block-right dis-flex"},{default:o((()=>[t(P,{class:"goods-sales"},{default:o((()=>[t(L,null,{default:o((()=>[a("已抢"+p(T.goods.active_sales)+"件",1)])),_:1})])),_:1})])),_:1})])),_:1}),t(P,{class:"info-item info-item__name dis-flex flex-y-center"},{default:o((()=>[t(P,{class:"goods-name flex-box"},{default:o((()=>[t(L,{class:"twoline-hide"},{default:o((()=>[a(p(T.goods.goods_name),1)])),_:1})])),_:1}),t(P,{class:"goods-share__line"}),t(P,{class:"goods-share"},{default:o((()=>[t(j,{class:"share-btn dis-flex flex-dir-column",onClick:h[0]||(h[0]=e=>A.onShowShareSheet())},{default:o((()=>[t(L,{class:"share__icon iconfont icon-fenxiang"}),t(L,{class:"f-24"},{default:o((()=>[a("分享")])),_:1})])),_:1})])),_:1})])),_:1}),T.goods.selling_point?(e(),s(P,{key:0,class:"info-item info-item_selling-point"},{default:o((()=>[t(L,null,{default:o((()=>[a(p(T.goods.selling_point),1)])),_:1})])),_:1})):u("",!0),T.goods.active_status!=T.ActiveStatusEnum.STATE_END.value?(e(),s(P,{key:1,class:"info-item info-item_status info-item_countdown dis-flex flex-y-center"},{default:o((()=>[t(L,{class:"countdown-icon iconfont icon-naozhong"}),t(L,null,{default:o((()=>[a("距离拼团活动"+p(T.goods.active_status==T.ActiveStatusEnum.STATE_SOON.value?"开始":"结束"),1)])),_:1}),t(L,{class:"m-r-10"},{default:o((()=>[a("还剩")])),_:1}),t(M,{date:T.goods.end_time,separator:"zh",theme:"text"},null,8,["date"])])),_:1})):(e(),s(P,{key:2,class:"info-item info-item_status info-item_end"},{default:o((()=>[t(L,{class:"countdown-icon iconfont icon-naozhong"}),t(L,null,{default:o((()=>[a("拼团活动已结束,下次记得早点来哦~")])),_:1})])),_:1}))])),_:1})),T.isLoading?u("",!0):(e(),s(G,{key:2,grouponGoodsId:T.goods.groupon_goods_id,list:T.goods.taskQuickJoinList},null,8,["grouponGoodsId","list"])),20==T.goods.spec_type?(e(),s(P,{key:3,class:"goods-choice m-top20 b-f",onClick:h[1]||(h[1]=e=>A.onShowSkuPopup(1))},{default:o((()=>[t(P,{class:"spec-list"},{default:o((()=>[t(P,{class:"flex-box"},{default:o((()=>[t(L,{class:"col-8"},{default:o((()=>[a("选择:")])),_:1}),(e(!0),l(i,null,n(T.goods.specList,((t,l)=>(e(),s(L,{class:"spec-name",key:l},{default:o((()=>[a(p(t.spec_name),1)])),_:2},1024)))),128))])),_:1}),t(P,{class:"f-26 col-9 t-r"},{default:o((()=>[t(L,{class:"iconfont icon-arrow-right"})])),_:1})])),_:1})])),_:1})):u("",!0),t(P,{class:"rule-nav m-top20 b-f",onClick:h[2]||(h[2]=e=>A.handleShowRules())},{default:o((()=>[t(P,{class:"top-nav dis-flex flex-x-between"},{default:o((()=>[t(L,null,{default:o((()=>[a("拼团玩法")])),_:1}),t(L,{class:"f-25 col-9"},{default:o((()=>[a("查看规则")])),_:1})])),_:1}),t(P,{class:"rule-simple dis-flex flex-x-around"},{default:o((()=>[t(P,{class:"simple-item dis-flex flex-dir-column flex-y-center"},{default:o((()=>[t(P,{class:"i-number dis-flex flex-x-center flex-y-center"},{default:o((()=>[t(L,{class:"f-30"},{default:o((()=>[a("1")])),_:1})])),_:1}),t(P,{class:"i-text f-28"},{default:o((()=>[a("选择商品")])),_:1})])),_:1}),t(P,{class:"simple-item dis-flex flex-dir-column flex-y-center"},{default:o((()=>[t(P,{class:"i-number dis-flex flex-x-center flex-y-center"},{default:o((()=>[t(L,{class:"f-30"},{default:o((()=>[a("2")])),_:1})])),_:1}),t(P,{class:"i-text f-28"},{default:o((()=>[a("开团/参团")])),_:1})])),_:1}),t(P,{class:"simple-item dis-flex flex-dir-column flex-y-center"},{default:o((()=>[t(P,{class:"i-number dis-flex flex-x-center flex-y-center"},{default:o((()=>[t(L,{class:"f-30"},{default:o((()=>[a("3")])),_:1})])),_:1}),t(P,{class:"i-text f-28"},{default:o((()=>[a("邀请好友")])),_:1})])),_:1}),t(P,{class:"simple-item dis-flex flex-dir-column flex-y-center"},{default:o((()=>[t(P,{class:"i-number dis-flex flex-x-center flex-y-center"},{default:o((()=>[t(L,{class:"f-30"},{default:o((()=>[a("4")])),_:1})])),_:1}),t(P,{class:"i-text f-28"},{default:o((()=>[a("人满成团")])),_:1})])),_:1})])),_:1})])),_:1}),T.isLoading?u("",!0):(e(),s(E,{key:4,modelValue:T.showSkuPopup,"onUpdate:modelValue":h[3]||(h[3]=e=>T.showSkuPopup=e),skuMode:T.skuMode,goods:T.goods,buyMode:T.buyMode},null,8,["modelValue","skuMode","goods","buyMode"])),T.isLoading?u("",!0):(e(),s(V,{key:5,"goods-id":T.goods.goods_id,limit:2},null,8,["goods-id"])),T.isLoading?u("",!0):(e(),s(P,{key:6,class:"goods-content m-top20"},{default:o((()=>[t(P,{class:"item-title b-f"},{default:o((()=>[t(L,null,{default:o((()=>[a("商品描述")])),_:1})])),_:1}),""!=T.goods.content?(e(),s(P,{key:0,class:"goods-content__detail b-f"},{default:o((()=>[t(R,{content:T.goods.content},null,8,["content"])])),_:1})):u("",!0)])),_:1})),t(P,{class:"footer-fixed"},{default:o((()=>[t(P,{class:"footer-container"},{default:o((()=>[t(P,{class:"foo-item-fast"},{default:o((()=>[t(P,{class:"fast-item fast-item--home",onClick:A.onTargetHome},{default:o((()=>[t(P,{class:"fast-icon"},{default:o((()=>[t(L,{class:"iconfont icon-shouye"})])),_:1}),t(P,{class:"fast-text"},{default:o((()=>[t(L,null,{default:o((()=>[a("首页")])),_:1})])),_:1})])),_:1},8,["onClick"]),T.isShowCustomerBtn?(e(),s(D,{key:0},{default:o((()=>[t(P,{class:"fast-item"},{default:o((()=>[t(P,{class:"fast-icon"},{default:o((()=>[t(L,{class:"iconfont icon-kefu1"})])),_:1}),t(P,{class:"fast-text"},{default:o((()=>[t(L,null,{default:o((()=>[a("客服")])),_:1})])),_:1})])),_:1})])),_:1})):u("",!0),T.isShowCustomerBtn?u("",!0):(e(),s(P,{key:1,class:"fast-item fast-item--cart",onClick:A.onTargetCart},{default:o((()=>[T.cartTotal>0?(e(),s(P,{key:0,class:"fast-badge fast-badge--fixed"},{default:o((()=>[a(p(T.cartTotal>99?"99+":T.cartTotal),1)])),_:1})):u("",!0),t(P,{class:"fast-icon"},{default:o((()=>[t(L,{class:"iconfont icon-gouwuche"})])),_:1}),t(P,{class:"fast-text"},{default:o((()=>[t(L,null,{default:o((()=>[a("购物车")])),_:1})])),_:1})])),_:1},8,["onClick"]))])),_:1}),t(P,{class:"foo-item-btn"},{default:o((()=>[t(P,{class:"btn-wrapper"},{default:o((()=>[T.goods.active_status==T.ActiveStatusEnum.STATE_BEGIN.value?(e(),l(i,{key:0},[T.goods.is_alone_buy?(e(),s(P,{key:0,class:"btn-item btn-item-deputy",onClick:h[4]||(h[4]=e=>A.onShowSkuPopup(2))},{default:o((()=>[t(P,{class:"price"},{default:o((()=>[a("¥"+p(T.goods.original_price),1)])),_:1}),t(P,null,{default:o((()=>[a("单独购买")])),_:1})])),_:1})):u("",!0),t(P,{class:"btn-item btn-item-main",onClick:h[5]||(h[5]=e=>A.onShowSkuPopup(1))},{default:o((()=>[t(P,{class:"price"},{default:o((()=>[a("¥"+p(T.goods.groupon_price),1)])),_:1}),t(P,null,{default:o((()=>[a("发起拼团")])),_:1})])),_:1})],64)):(e(),s(P,{key:1,class:"btn-item btn-item-gray"},{default:o((()=>[t(L,null,{default:o((()=>[a(p(T.goods.active_status==T.ActiveStatusEnum.STATE_SOON.value?"活动未开始":"活动已结束"),1)])),_:1})])),_:1}))])),_:1})])),_:1})])),_:1})])),_:1}),t(U,{modelValue:T.showShareSheet,"onUpdate:modelValue":h[6]||(h[6]=e=>T.showShareSheet=e),shareTitle:T.goods.goods_name,shareImageUrl:T.goods.goods_image,posterApiCall:T.posterApiCall,posterApiParam:{grouponGoodsId:T.grouponGoodsId}},null,8,["modelValue","shareTitle","shareImageUrl","posterApiCall","posterApiParam"]),T.isLoading?u("",!0):(e(),s(B,{key:7,modelValue:T.showRules,"onUpdate:modelValue":h[7]||(h[7]=e=>T.showRules=e),title:"拼团规则"},{default:o((()=>[t($,{style:{height:"610rpx","touch-action":"none"},"scroll-y":!0},{default:o((()=>[t(P,{class:"pops-content"},{default:o((()=>[t(L,null,{default:o((()=>[a(p(T.setting.ruleDetail),1)])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"]))])),_:1},8,["style"])),[[k,!T.isLoading]])}],["__scopeId","data-v-4b7966cc"]]);export{$ as default};