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