import{q as e,u as t,o as a,c as s,w as o,n as l,i,a as n,e as r,b as c,d,F as u,k as m,f as g,g as p,l as f,y as _,t as h}from"./index-4ddb689d.js";import{_ as b}from"./u-tag.99b09b77.js";import{r as y}from"./uni-app.es.24af5d4f.js";import{M as T,_ as k}from"./mescroll-mixins.a7931123.js";import{W as x}from"./wxofficial.956096a5.js";import{h as v}from"./color.813a9497.js";import{a as L,A as S,T as C}from"./ActiveStatus.2bcdf502.js";import{m as j}from"./task.07a4f689.js";import{l as A}from"./goods.fb80a30a.js";import{G as w}from"./Setting.091c8879.js";import{_ as B}from"./_plugin-vue_export-helper.1b428a4d.js";import"./u-icon.e981d1c2.js";const E=B({mixins:[T,x],data:()=>({ActiveStatusEnum:L,ActiveTypeEnum:S,TaskStatusEnum:C,curTab:0,upOption:{auto:!0,page:{size:15},noMoreSize:3},setting:{},goodsList:e(),myList:e()}),watch:{curTab(e){uni.setNavigationBarTitle({title:0==e?"拼团活动":"我的拼团"})}},computed:{tagBackgroundColor(){return v(this.appTheme.mainBg,.1)},tagBorderColor(){return v(this.appTheme.mainBg,.6)}},onLoad(e){e.tab&&(this.curTab=e.tab),this.getSetting(),this.setWxofficialShareData()},methods:{getSetting(){w.data().then((e=>this.setting=e))},upCallback(e){const t=this;t.getListData(e.num).then((e=>{const a=e.data.length,s=e.data.total;t.mescroll.endBySize(a,s)})).catch((()=>t.mescroll.endErr()))},getListData(e){return{0:this.getGoodsList,1:this.getMyList}[this.curTab](e)},getGoodsList(e=1){const a=this;return new Promise(((s,o)=>{A({page:e}).then((o=>{const l=o.data.list;a.goodsList.data=t(l,a.goodsList,e),s(l)})).catch(o)}))},getMyList(e){const a=this;return new Promise(((s,o)=>{j({page:e}).then((o=>{const l=o.data.list;a.myList.data=t(l,a.myList,e),s(l)})).catch(o)}))},onChangeTab(t=0){const a=this;a.curTab=t,a.goodsList=e(),a.myList=e(),a.mescroll.resetUpScroll()},onTargetGoods(e){this.$navTo("pages/groupon/goods/index",{grouponGoodsId:e.groupon_goods_id})},onTargetTask(e){this.$navTo("pages/groupon/task/index",{taskId:e.task_id})},setWxofficialShareData(){this.updateShareCardData({title:"拼团活动"})}},onShareAppMessage(){return{title:"拼团活动",path:`/pages/groupon/index?${this.$getShareUrlParams()}`}},onShareTimeline(){return{title:"拼团活动",path:`/pages/groupon/index?${this.$getShareUrlParams()}`}}},[["render",function(e,t,T,x,v,L){const S=p,C=i,j=f,A=y(_("u-tag"),b),w=y(_("mescroll-body"),k);return a(),s(C,{class:"container",style:l(e.appThemeStyle)},{default:o((()=>[n(w,{ref:"mescrollRef",sticky:!0,onInit:e.mescrollInit,down:{use:!1},up:v.upOption,onUp:L.upCallback},{default:o((()=>[0==v.curTab&&v.setting.backdrop?(a(),s(C,{key:0,class:"banner"},{default:o((()=>[n(S,{class:"image",src:v.setting.backdrop.src,mode:"widthFix"},null,8,["src"])])),_:1})):r("",!0),0==v.curTab?(a(),s(C,{key:1,class:"groupon-hall active-list"},{default:o((()=>[(a(!0),c(u,null,d(v.goodsList.data,((t,l)=>(a(),s(C,{class:"goods-item--container",key:l},{default:o((()=>[n(C,{class:"goods-item",onClick:e=>L.onTargetGoods(t)},{default:o((()=>[n(C,{class:"goods-item-left"},{default:o((()=>[t.active_type!=v.ActiveTypeEnum.NORMAL.value?(a(),s(C,{key:0,class:"label"},{default:o((()=>[n(j,null,{default:o((()=>[g(h(v.ActiveTypeEnum[t.active_type].name2),1)])),_:2},1024)])),_:2},1024)):r("",!0),n(S,{class:"image",src:t.goods_image},null,8,["src"])])),_:2},1024),n(C,{class:"goods-item-right"},{default:o((()=>[n(C,{class:"goods-name"},{default:o((()=>[n(j,{class:"twoline-hide"},{default:o((()=>[g(h(t.goods_name),1)])),_:2},1024)])),_:2},1024),n(C,{class:"goods-item-desc"},{default:o((()=>[n(C,{class:"desc_situation"},{default:o((()=>[n(C,{class:"state-tag"},{default:o((()=>[n(A,{color:e.appTheme.mainBg,"border-color":e.appTheme.mainBg,text:`${t.show_people}人团`,type:"error",size:"mini",mode:"plain"},null,8,["color","border-color","text"])])),_:2},1024),n(C,{class:"state-tag"},{default:o((()=>[t.active_sales?(a(),s(A,{key:0,color:e.appTheme.mainBg,"border-color":L.tagBorderColor,"bg-color":L.tagBackgroundColor,text:`已团${t.active_sales}件`,type:"error",size:"mini"},null,8,["color","border-color","bg-color","text"])):r("",!0)])),_:2},1024)])),_:2},1024),n(C,{class:"desc-footer"},{default:o((()=>[n(C,{class:"item-prices oneline-hide"},{default:o((()=>[n(j,{class:"price-x"},{default:o((()=>[g("¥"+h(t.groupon_price),1)])),_:2},1024),n(j,{class:"price-y cl-9"},{default:o((()=>[g("¥"+h(t.original_price),1)])),_:2},1024)])),_:2},1024),n(C,{class:"settlement"},{default:o((()=>[g("去拼团")])),_:1})])),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:1})):r("",!0),1==v.curTab?(a(),s(C,{key:2,class:"groupon-hall my-list"},{default:o((()=>[(a(!0),c(u,null,d(v.myList.data,((e,t)=>(a(),s(C,{class:"goods-item--container",key:t},{default:o((()=>[n(C,{class:"goods-item",onClick:t=>L.onTargetTask(e)},{default:o((()=>[n(C,{class:"goods-item-left"},{default:o((()=>[e.active_type!=v.ActiveTypeEnum.NORMAL.value?(a(),s(C,{key:0,class:"label"},{default:o((()=>[n(j,null,{default:o((()=>[g(h(v.ActiveTypeEnum[e.active_type].name2),1)])),_:2},1024)])),_:2},1024)):r("",!0),n(S,{class:"image",src:e.goods.goods_image},null,8,["src"])])),_:2},1024),n(C,{class:"goods-item-right"},{default:o((()=>[n(C,{class:"goods-name"},{default:o((()=>[n(j,{class:"twoline-hide"},{default:o((()=>[g(h(e.goods.goods_name),1)])),_:2},1024)])),_:2},1024),n(C,{class:"goods-item-desc"},{default:o((()=>[n(C,{class:"desc_situation"},{default:o((()=>[e.status==v.TaskStatusEnum.NORMAL.value?(a(),s(A,{key:0,text:`已拼${e.joined_people}人,还差${e.people-e.joined_people}人`,type:"warning",size:"mini"},null,8,["text"])):(a(),s(A,{key:1,class:"people",text:`${e.people}人团`,type:"error",size:"mini",mode:"plain"},null,8,["text"]))])),_:2},1024),n(C,{class:"desc-footer"},{default:o((()=>[n(C,{class:"item-status"},{default:o((()=>[n(j,null,{default:o((()=>[g(h(v.TaskStatusEnum[e.status].name),1)])),_:2},1024)])),_:2},1024),e.status==v.TaskStatusEnum.NORMAL.value?(a(),s(C,{key:0,class:"settlement"},{default:o((()=>[g("查看拼单")])),_:1})):r("",!0)])),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:1})):r("",!0),n(C,{class:"footer-fixed"},{default:o((()=>[n(C,{class:"footer-container"},{default:o((()=>[n(C,{class:m(["tabbar-item flex-box",{active:0==v.curTab}])},{default:o((()=>[n(C,{class:"tabbar-item-content dis-flex flex-x-center flex-y-center",onClick:t[0]||(t[0]=e=>L.onChangeTab(0))},{default:o((()=>[n(C,{class:"tabbar-item-icon"},{default:o((()=>[n(j,{class:"iconfont icon-shangcheng"})])),_:1}),n(C,{class:"tabbar-item-name"},{default:o((()=>[n(j,null,{default:o((()=>[g("拼团活动")])),_:1})])),_:1})])),_:1})])),_:1},8,["class"]),n(C,{class:"tabbar-item__divider"},{default:o((()=>[n(C,{class:"divider-line"})])),_:1}),n(C,{class:m(["tabbar-item flex-box",{active:1==v.curTab}])},{default:o((()=>[n(C,{class:"tabbar-item-content dis-flex flex-x-center flex-y-center",onClick:t[1]||(t[1]=e=>L.onChangeTab(1))},{default:o((()=>[n(C,{class:"tabbar-item-icon"},{default:o((()=>[n(j,{class:"iconfont icon-sy-yh"})])),_:1}),n(C,{class:"tabbar-item-name"},{default:o((()=>[n(j,null,{default:o((()=>[g("我的拼团")])),_:1})])),_:1})])),_:1})])),_:1},8,["class"])])),_:1})])),_:1})])),_:1},8,["onInit","up","onUp"])])),_:1},8,["style"])}],["__scopeId","data-v-256b044a"]]);export{E as default};