pages-activity-groupon-detail.285c9fdf.js 7.9 KB

1
  1. import{s as a,z as e,c as s,o as t,f as o,g as d,w as r,a6 as l,a8 as n,m as c,i,B as u,k as m,u as f,v as p,x as g,l as _,r as y,F as h,H as b,ad as k,j as v,n as w,I as x,y as R,J as I}from"./index-a116b7fa.js";import{_ as j}from"./s-goods-item.e5b69bb0.js";import{_ as S}from"./s-select-groupon-sku.fa8904fa.js";import{_ as C}from"./s-empty.4d7f5239.js";import{_ as N}from"./s-layout.4ae51839.js";import{u as A}from"./useGoods.6b315a78.js";import{_ as $}from"./_plugin-vue_export-helper.1b428a4d.js";import"./points.c381a8e1.js";/* empty css */import"./su-number-box.7b9bb097.js";import"./phone-international-input.b9f6c8e6.js";/* empty css */const T=$({__name:"detail",setup($){b((a=>({"391440f4":g(T)})));const T=a.$url.css("/static/img/shop/user/withdraw_bg.png"),H=2*a.$platform.device.statusBarHeight,z=e({data:{},loading:!0,grouponAction:"create",showSelectSku:!1,grouponNum:0,number:0,activity:{},combinationHeadId:null}),B=s((()=>{var e,s,t;return l.isEmpty(z.data)?{}:a.$platform.share.getShareInfo({title:z.data.headRecord.spuName,image:a.$url.cdn(z.data.headRecord.picUrl),desc:null==(e=z.data.goods)?void 0:e.subtitle,params:{page:"5",query:z.data.id}},{type:"groupon",title:z.data.headRecord.spuName,image:a.$url.cdn(z.data.headRecord.picUrl),price:null==(s=z.data.goods)?void 0:s.price,original_price:null==(t=z.data.goods)?void 0:t.original_price})}));function D(e){a.$router.go("/pages/order/detail",{id:e})}function U(){z.grouponAction="create",z.grouponId=0,z.showSelectSku=!0}function E(a){z.selectedSkuPrice=a}function F(e){a.$router.go("/pages/order/confirm",{data:JSON.stringify({order_type:"goods",combinationActivityId:z.data.activity.id,combinationHeadId:z.combinationHeadId,items:[{skuId:e.id,count:e.count}]})})}const J=s((()=>A(z.data.headRecord.expireTime)));function M(){k()}return t((a=>{!async function(a){const{code:e,data:s}=await n.getCombinationRecordDetail(a);if(0===e){z.data=s;const a=Number(z.data.headRecord.userSize-z.data.headRecord.userCount);z.remainNumber=a>0?a:0;const{data:e}=await n.getCombinationActivity(s.headRecord.activityId);z.activity=e}else z.data=null;z.loading=!1}(a.id)})),(e,s)=>{const t=v,l=c(w("s-goods-item"),j),n=x,b=R,k=I,A=c(w("s-select-groupon-sku"),S),$=c(w("s-empty"),C),T=c(w("s-layout"),N);return o(),d(T,{title:"拼团详情",class:"detail-wrap",navbar:z.data&&!z.loading?"inner":"normal",onShareAppMessage:B.value},{default:r((()=>[z.loading?(o(),d(t,{key:0})):i("",!0),z.data&&!z.loading?(o(),d(t,{key:1},{default:r((()=>[z.data.headRecord?(o(),d(t,{key:0,class:"recharge-box",style:u([{marginTop:"-"+Number(H+88)+"rpx",paddingTop:Number(H+108)+"rpx"}])},{default:r((()=>[m(l,{class:"goods-box",img:z.data.headRecord.picUrl,title:z.data.headRecord.spuName,price:z.data.headRecord.combinationPrice,priceColor:"#E1212B",onClick:s[0]||(s[0]=e=>g(a).$router.go("/pages/goods/groupon",{id:z.data.headRecord.activityId})),style:u([{top:Number(H+108)+"rpx"}])},{groupon:r((()=>[m(t,{class:"ss-flex"},{default:r((()=>[m(t,{class:"sales-title"},{default:r((()=>[f(p(z.data.headRecord.userSize)+"人团",1)])),_:1}),m(t,{class:"num-title ss-m-l-20"},{default:r((()=>[f("已拼"+p(z.data.headRecord.userCount)+"件",1)])),_:1})])),_:1})])),_:1},8,["img","title","price","style"])])),_:1},8,["style"])):i("",!0),m(t,{class:"countdown-box detail-card ss-p-t-44 ss-flex-col ss-col-center"},{default:r((()=>[1===z.data.headRecord.status?(o(),d(t,{key:0},{default:r((()=>[z.data.orderId?(o(),d(t,{key:0},{default:r((()=>[m(t,{class:"countdown-title ss-flex"},{default:r((()=>[m(n,{class:"cicon-check-round"}),f(" 恭喜您~拼团成功 ")])),_:1})])),_:1})):(o(),d(t,{key:1},{default:r((()=>[m(t,{class:"countdown-title ss-flex"},{default:r((()=>[m(n,{class:"cicon-info"}),f(" 抱歉~该团已满员 ")])),_:1})])),_:1}))])),_:1})):i("",!0),2===z.data.headRecord.status?(o(),d(t,{key:1},{default:r((()=>[m(t,{class:"countdown-title ss-flex"},{default:r((()=>[m(n,{class:"cicon-info"}),f(" "+p(z.data.orderId?"拼团超时,已自动退款":"该团已解散"),1)])),_:1})])),_:1})):i("",!0),0===z.data.headRecord.status?(o(),d(t,{key:2},{default:r((()=>[z.data.headRecord.expireTime<=(new Date).getTime()?(o(),d(t,{key:0},{default:r((()=>[m(t,{class:"countdown-title ss-flex"},{default:r((()=>[m(n,{class:"cicon-info"}),f(" 拼团已结束,请关注下次活动 ")])),_:1})])),_:1})):(o(),d(t,{key:1,class:"countdown-title ss-flex"},{default:r((()=>[f(" 还差 "),m(t,{class:"num"},{default:r((()=>[f(p(z.data.headRecord.userSize-z.data.headRecord.userCount)+"人",1)])),_:1}),f(" 拼团成功 "),m(t,{class:"ss-flex countdown-time"},{default:r((()=>[m(t,{class:"countdown-h ss-flex ss-row-center"},{default:r((()=>[f(p(J.value.h),1)])),_:1}),m(t,{class:"ss-m-x-4"},{default:r((()=>[f(":")])),_:1}),m(t,{class:"countdown-num ss-flex ss-row-center"},{default:r((()=>[f(p(J.value.m),1)])),_:1}),m(t,{class:"ss-m-x-4"},{default:r((()=>[f(":")])),_:1}),m(t,{class:"countdown-num ss-flex ss-row-center"},{default:r((()=>[f(p(J.value.s),1)])),_:1})])),_:1})])),_:1}))])),_:1})):i("",!0),m(t,{class:"ss-m-t-60 ss-flex ss-flex-wrap ss-row-center"},{default:r((()=>[m(t,{class:"header-avatar ss-m-r-24 ss-m-b-20"},{default:r((()=>[m(b,{src:g(a).$url.cdn(z.data.headRecord.avatar),class:"avatar-img"},null,8,["src"]),m(t,{class:"header-tag ss-flex ss-col-center ss-row-center"},{default:r((()=>[f("团长")])),_:1})])),_:1}),(o(!0),_(h,null,y(z.data.memberRecords,(e=>(o(),d(t,{class:"header-avatar ss-m-r-24 ss-m-b-20",key:e.id},{default:r((()=>[m(b,{src:g(a).$url.cdn(e.avatar),class:"avatar-img"},null,8,["src"]),"1"==e.is_leader?(o(),d(t,{key:0,class:"header-tag ss-flex ss-col-center ss-row-center"},{default:r((()=>[f(" 团长 ")])),_:1})):i("",!0)])),_:2},1024)))),128)),(o(!0),_(h,null,y(z.remainNumber,(e=>(o(),d(t,{class:"default-avatar ss-m-r-24 ss-m-b-20",key:e},{default:r((()=>[m(b,{src:g(a).$url.static("/static/images/unknown.png"),class:"avatar-img"},null,8,["src"])])),_:2},1024)))),128))])),_:1})])),_:1}),1===z.data.headRecord.status||2===z.data.headRecord.status?(o(),d(t,{key:1,class:"ss-m-t-40 ss-flex ss-row-center"},{default:r((()=>[z.data.orderId?(o(),d(k,{key:0,class:"ss-reset-button order-btn",onClick:s[1]||(s[1]=a=>D(z.data.orderId))},{default:r((()=>[f(" 查看订单 ")])),_:1})):(o(),d(k,{key:1,class:"ss-reset-button join-btn",onClick:U},{default:r((()=>[f(" 我要开团 ")])),_:1}))])),_:1})):i("",!0),0===z.data.headRecord.status?(o(),d(t,{key:2,class:"ss-m-t-40 ss-flex ss-row-center"},{default:r((()=>[z.data.headRecord.expireTime<=(new Date).getTime()?(o(),d(t,{key:0},{default:r((()=>[z.data.orderId?(o(),d(k,{key:0,class:"ss-reset-button join-btn",onClick:s[2]||(s[2]=a=>D(z.data.orderId))},{default:r((()=>[f(" 查看订单 ")])),_:1})):(o(),d(k,{key:1,class:"ss-reset-button disabled-btn",disabled:"",onClick:s[3]||(s[3]=a=>D(z.data.orderId))},{default:r((()=>[f(" 去参团 ")])),_:1}))])),_:1})):(o(),d(t,{key:1,class:"ss-flex ss-row-center"},{default:r((()=>[z.data.orderId?(o(),d(t,{key:0},{default:r((()=>[m(k,{class:"ss-reset-button join-btn",disabled:J.value.ms<=0,onClick:M},{default:r((()=>[f(" 邀请好友来拼团 ")])),_:1},8,["disabled"])])),_:1})):(o(),d(t,{key:1},{default:r((()=>[m(k,{class:"ss-reset-button join-btn",disabled:J.value.ms<=0,onClick:s[4]||(s[4]=a=>(z.grouponAction="join",z.grouponId=z.data.activityId,z.combinationHeadId=z.data.id,z.grouponNum=z.data.num,void(z.showSelectSku=!0)))},{default:r((()=>[f(" 立即参团 ")])),_:1},8,["disabled"])])),_:1}))])),_:1}))])),_:1})):i("",!0),z.data.goods?(o(),d(t,{key:3},{default:r((()=>[m(A,{show:z.showSelectSku,goodsInfo:z.data.goods,grouponAction:z.grouponAction,grouponNum:z.grouponNum,onBuy:F,onChange:E,onClose:s[5]||(s[5]=a=>z.showSelectSku=!1)},null,8,["show","goodsInfo","grouponAction","grouponNum"])])),_:1})):i("",!0)])),_:1})):i("",!0),z.data||z.loading?i("",!0):(o(),d($,{key:2,icon:"/static/goods-empty.png"}))])),_:1},8,["navbar","onShareAppMessage"])}}},[["__scopeId","data-v-02f05b27"]]);export{T as default};