pages-activity-groupon-detail.BKXZZrQZ.js 8.2 KB

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