You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/public/assets/pages-groupon-task-index.0d...

1 lines
6.8 KiB

import{af as s,S as a,ag as e,o as t,c as o,w as l,n as i,e as d,i as u,a as n,f as r,t as c,b as p,d as m,F as _,l as g,g as f,r as h,U as k,j as S,y}from"./index-4ddb689d.js";import{_ as w}from"./u-modal.9219359e.js";import{r as j}from"./uni-app.es.24af5d4f.js";import{W as v}from"./wxofficial.956096a5.js";import{A as T}from"./index.1169d7d7.js";import{C as I}from"./index.994d85b2.js";import{R as b}from"./index.5efbe1fd.js";import{S as x}from"./SkuPopup.ff6d3645.js";import{A as P,a as C,T as A}from"./ActiveStatus.2bcdf502.js";import{d as E}from"./task.07a4f689.js";import{G as L}from"./Setting.091c8879.js";import{_ as R}from"./_plugin-vue_export-helper.1b428a4d.js";import"./u-loading.7bd69747.js";import"./u-popup.37b3343e.js";import"./u-icon.e981d1c2.js";import"./index.85d62ccb.js";import"./color.813a9497.js";const M=R({components:{AvatarImage:T,SkuPopup:x,CountDown:I,Recommended:b},mixins:[v],data:()=>({isLoading:!0,ActiveTypeEnum:P,ActiveStatusEnum:C,TaskStatusEnum:A,showRules:!1,showSkuPopup:!1,skuMode:3,taskId:null,detail:null,goods:null,setting:{}}),onLoad({taskId:s}){this.taskId=s,this.getSetting(),this.getTaskDetail()},methods:{getSetting(){L.data().then((s=>this.setting=s))},getTaskDetail(){const{taskId:s}=this;this.isLoading=!0,E(s).then((s=>{this.detail=s.data.detail,this.goods=s.data.goods,this.setWxofficialShareData()})).finally((()=>this.isLoading=!1))},onTargetGoods(){const{goods:s}=this;this.$navTo("pages/groupon/goods/index",{grouponGoodsId:s.groupon_goods_id})},handleShareBtn(){this.handleCopyLink()},handleCopyLink(){const s=this;s.getShareUrl().then((a=>{uni.setClipboardData({data:a,success:()=>s.$toast("复制链接成功,快去发送给朋友吧"),fail:({errMsg:a})=>s.$toast("复制失败 "+a)})}))},getShareUrl(){const{path:t,query:o}=s();return new Promise(((s,l)=>{a.h5Url().then((a=>{const l=e(a,t,o);s(l)}))}))},handleShowRules(){this.showRules=!0},onShowSkuPopup(){this.showSkuPopup=!this.showSkuPopup},setWxofficialShareData(){const{detail:s,goods:a}=this;this.updateShareCardData({title:a.goods_name,desc:a.selling_point,imgUrl:a.goods_image})}},onShareAppMessage(){const s=this,a=s.$getShareUrlParams({taskId:s.taskId});return{title:s.goods.goods_name,path:`/pages/groupon/task/index?${a}`}},onShareTimeline(){const s=this,a=s.$getShareUrlParams({taskId:s.taskId});return{title:s.goods.goods_name,path:`/pages/groupon/task/index?${a}`}}},[["render",function(s,a,e,v,T,I){const b=u,x=g,P=f,C=h("avatar-image"),A=h("count-down"),E=k,L=h("SkuPopup"),R=S,M=j(y("u-modal"),w),U=h("recommended");return!T.isLoading&&T.detail&&T.goods?(t(),o(b,{key:0,class:"container",style:i(s.appThemeStyle)},{default:l((()=>[n(b,{class:"bg-layer"}),n(b,{class:"goods-info",onClick:a[0]||(a[0]=s=>I.onTargetGoods())},{default:l((()=>[n(b,{class:"goods-image"},{default:l((()=>[T.detail.active_type!=T.ActiveTypeEnum.NORMAL.value?(t(),o(b,{key:0,class:"label"},{default:l((()=>[n(x,null,{default:l((()=>[r(c(T.ActiveTypeEnum[T.detail.active_type].name2),1)])),_:1})])),_:1})):d("",!0),n(P,{class:"image",src:T.goods.goods_image},null,8,["src"])])),_:1}),n(b,{class:"goods-detail"},{default:l((()=>[n(b,{class:"goods-name"},{default:l((()=>[n(x,{class:"twoline-hide"},{default:l((()=>[r(c(T.goods.goods_name),1)])),_:1})])),_:1}),n(b,{class:"goods-price"},{default:l((()=>[n(x,{class:"f-26 col-m"},{default:l((()=>[r("¥")])),_:1}),n(x,{class:"m-price"},{default:l((()=>[r(c(T.goods.groupon_price),1)])),_:1}),n(x,{class:"line-price"},{default:l((()=>[r("¥"+c(T.goods.original_price),1)])),_:1})])),_:1}),n(b,{class:"goods-tag"},{default:l((()=>[n(x,{class:"tag-item"},{default:l((()=>[r(c(T.detail.people)+"人团",1)])),_:1}),"0.00"!=T.goods.diff_price?(t(),o(x,{key:0,class:"tag-item"},{default:l((()=>[r("拼团省"+c(T.goods.diff_price)+"元",1)])),_:1})):d("",!0)])),_:1})])),_:1})])),_:1}),n(b,{class:"main"},{default:l((()=>[T.detail.status==T.TaskStatusEnum.FAIL.value?(t(),o(b,{key:0,class:"main_status main_status__fail"},{default:l((()=>[n(x,{class:"status-icon iconfont icon-shibai"}),n(x,null,{default:l((()=>[r("超过有效时间,拼团失败")])),_:1})])),_:1})):d("",!0),T.detail.status==T.TaskStatusEnum.SUCCESS.value?(t(),o(b,{key:1,class:"main_status main_status__success"},{default:l((()=>[n(x,{class:"status-icon iconfont icon-success"}),n(x,null,{default:l((()=>[r("拼团已成功")])),_:1})])),_:1})):d("",!0),n(b,{class:"main-user"},{default:l((()=>[(t(!0),p(_,null,m(T.detail.users,((s,a)=>(t(),o(b,{key:s.id,class:"user-item"},{default:l((()=>[n(C,{url:s.userInfo.avatar_url,width:100},null,8,["url"]),s.is_leader?(t(),o(b,{key:0,class:"user-role"},{default:l((()=>[n(x,{class:"role-name"},{default:l((()=>[r("团长")])),_:1})])),_:1})):d("",!0)])),_:2},1024)))),128)),(t(!0),p(_,null,m(T.detail.people-T.detail.joined_people,((s,a)=>(t(),o(b,{key:a,class:"user-item user-item__wait"},{default:l((()=>[n(x,{class:"iconfont icon-wenhao"})])),_:2},1024)))),128))])),_:1}),T.detail.status==T.TaskStatusEnum.NORMAL.value?(t(),o(b,{key:2,class:"main_tiem"},{default:l((()=>[n(x,null,{default:l((()=>[r("还差")])),_:1}),n(x,{class:"main_timer_color"},{default:l((()=>[r(c(T.detail.people-T.detail.joined_people),1)])),_:1}),n(x,null,{default:l((()=>[r("个名额,")])),_:1}),n(A,{date:T.detail.end_time,separator:"colon",theme:"custom",customBgColor:"#FE5246"},null,8,["date"]),n(x,null,{default:l((()=>[r("后结束")])),_:1})])),_:1})):d("",!0),T.detail.status==T.TaskStatusEnum.NORMAL.value?(t(),p(_,{key:3},[T.detail.is_join?(t(),o(E,{key:1,"open-type":"share",class:"button btn-normal",onClick:a[2]||(a[2]=s=>I.handleShareBtn())},{default:l((()=>[n(b,{class:"btn-item btn-item__main"},{default:l((()=>[n(x,null,{default:l((()=>[r("立即分享")])),_:1})])),_:1})])),_:1})):(t(),o(b,{key:0,class:"button",onClick:a[1]||(a[1]=s=>I.onShowSkuPopup())},{default:l((()=>[r("立即参团")])),_:1}))],64)):(t(),o(b,{key:4,class:"button",onClick:a[3]||(a[3]=s=>I.onTargetGoods())},{default:l((()=>[r("去开团")])),_:1}))])),_:1}),n(b,{class:"notice",onClick:a[4]||(a[4]=s=>I.handleShowRules())},{default:l((()=>[n(x,{class:"f-30"},{default:l((()=>[r("拼团须知")])),_:1}),n(x,{class:"t-brief"},{default:l((()=>[r(c(T.setting.ruleBrief),1)])),_:1}),n(x,{class:"icon-arrow"})])),_:1}),n(L,{modelValue:T.showSkuPopup,"onUpdate:modelValue":a[5]||(a[5]=s=>T.showSkuPopup=s),skuMode:T.skuMode,goods:T.goods,buyMode:1,taskId:T.detail.task_id,stepPeople:T.detail.people},null,8,["modelValue","skuMode","goods","taskId","stepPeople"]),n(M,{modelValue:T.showRules,"onUpdate:modelValue":a[6]||(a[6]=s=>T.showRules=s),title:"拼团规则"},{default:l((()=>[n(R,{style:{height:"610rpx","touch-action":"none"},"scroll-y":!0},{default:l((()=>[n(b,{class:"pops-content"},{default:l((()=>[n(x,null,{default:l((()=>[r(c(T.setting.ruleDetail),1)])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"]),n(U)])),_:1},8,["style"])):d("",!0)}],["__scopeId","data-v-5e73acbc"]]);export{M as default};