pages-activity-groupon-detail.47635d32.js 7.9 KB

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