1 |
- import{s as a,z as e,c as s,o as t,f as o,g as d,w as r,a8 as l,m as n,i as c,B as i,k as u,u as m,v as f,x as p,l as g,r as _,F as y,H as h,a7 as b,ad as k,j as v,n as w,I as x,y as R,J as I}from"./index-ba48620e.js";import{_ as j}from"./s-goods-item.32271aab.js";import{_ as S}from"./s-select-groupon-sku.19d2b9df.js";import{_ as C}from"./s-empty.a75760f9.js";import{_ as N}from"./s-layout.04b95866.js";import{u as $}from"./useGoods.edb8879f.js";import{_ as A}from"./_plugin-vue_export-helper.1b428a4d.js";import"./points.c381a8e1.js";/* empty css */import"./su-number-box.45a74a8f.js";import"./phone-international-input.dd3ca29e.js";/* empty css */const T=A({__name:"detail",setup(A){h((a=>({"391440f4":p(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 b.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 q(a){z.selectedSkuPrice=a}function E(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((()=>$(z.data.headRecord.expireTime)));function M(){k()}return t((a=>{!async function(a){const{code:e,data:s}=await l.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 l.getCombinationActivity(s.headRecord.activityId);z.activity=e}else z.data=null;z.loading=!1}(a.id)})),(e,s)=>{const t=v,l=n(w("s-goods-item"),j),h=x,b=R,k=I,$=n(w("s-select-groupon-sku"),S),A=n(w("s-empty"),C),T=n(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})):c("",!0),z.data&&!z.loading?(o(),d(t,{key:1},{default:r((()=>[z.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(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=>p(a).$router.go("/pages/goods/groupon",{id:z.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(z.data.headRecord.userSize)+"人团",1)])),_:1}),u(t,{class:"num-title ss-m-l-20"},{default:r((()=>[m("已拼"+f(z.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===z.data.headRecord.status?(o(),d(t,{key:0},{default:r((()=>[z.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===z.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(z.data.orderId?"拼团超时,已自动退款":"该团已解散"),1)])),_:1})])),_:1})):c("",!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((()=>[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(z.data.headRecord.userSize-z.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(J.value.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(J.value.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(J.value.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:p(a).$url.cdn(z.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),g(y,null,_(z.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:p(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),g(y,null,_(z.remainNumber,(e=>(o(),d(t,{class:"default-avatar ss-m-r-24 ss-m-b-20",key:e},{default:r((()=>[u(b,{src:p(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((()=>[m(" 查看订单 ")])),_:1})):(o(),d(k,{key:1,class:"ss-reset-button join-btn",onClick:U},{default:r((()=>[m(" 我要开团 ")])),_:1}))])),_:1})):c("",!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((()=>[m(" 查看订单 ")])),_: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((()=>[m(" 去参团 ")])),_: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((()=>[u(k,{class:"ss-reset-button join-btn",disabled:J.value.ms<=0,onClick:M},{default:r((()=>[m(" 邀请好友来拼团 ")])),_:1},8,["disabled"])])),_:1})):(o(),d(t,{key:1},{default:r((()=>[u(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((()=>[m(" 立即参团 ")])),_:1},8,["disabled"])])),_:1}))])),_:1}))])),_:1})):c("",!0),z.data.goods?(o(),d(t,{key:3},{default:r((()=>[u($,{show:z.showSelectSku,goodsInfo:z.data.goods,grouponAction:z.grouponAction,grouponNum:z.grouponNum,onBuy:E,onChange:q,onClose:s[5]||(s[5]=a=>z.showSelectSku=!1)},null,8,["show","goodsInfo","grouponAction","grouponNum"])])),_:1})):c("",!0)])),_:1})):c("",!0),z.data||z.loading?c("",!0):(o(),d(A,{key:2,icon:"/static/goods-empty.png"}))])),_:1},8,["navbar","onShareAppMessage"])}}},[["__scopeId","data-v-02f05b27"]]);export{T as default};
|