1 |
- import{d as c,D as i,Q as l,a as t,S as p,F as d,A as n,P as o,C as _}from"./index-b715015a.js";import{O as b}from"./index-2068901f.js";import{u as y,a as h}from"./index-0785159b.js";import{C as g}from"./index-4cc168e9.js";import{I as m}from"./index-9e29532a.js";const f="_member_container_wy4ei_10",E="_level_wy4ei_13",F="_userMember_wy4ei_17",w="_userImgSection_wy4ei_22",I="_userImg_wy4ei_22",C="_userInfo_wy4ei_35",v="_name_wy4ei_41",D="_phone_wy4ei_50",P="_timeRemaining_wy4ei_53",A="_remaining_wy4ei_58",S="_member_time_wy4ei_62",B="_memberImgs_wy4ei_68",N="_memberContainer_wy4ei_72",M="_memberItem_wy4ei_77",T="_title_wy4ei_86",G="_priceGroup_wy4ei_101",O="_price_wy4ei_101",U="_originalPrice_wy4ei_115",k="_btnGroup_wy4ei_123",x="_btn_wy4ei_123",V="_priceSection_wy4ei_144",L="_priceUnit_wy4ei_156",R="_memberDiscount_wy4ei_159",q="_discountAvatar_wy4ei_171",$="_discountName_wy4ei_179",H="_discountGift_wy4ei_186",r={"member-center":"_member-center_wy4ei_1",member_container:f,level:E,userMember:F,userImgSection:w,userImg:I,userInfo:C,name:v,phone:D,timeRemaining:P,remaining:A,member_time:S,memberImgs:B,memberContainer:N,memberItem:M,title:T,priceGroup:G,price:O,originalPrice:U,btnGroup:k,btn:x,priceSection:V,priceUnit:L,memberDiscount:R,discountAvatar:q,discountName:$,discountGift:H},J=""+new URL("icon-student-4155aac2.png",import.meta.url).href,W=""+new URL("member-1-06a91547.png",import.meta.url).href,Y=""+new URL("member-2-b3b0f0d4.png",import.meta.url).href,Z=c({name:"MemberCenter",data(){return this.$route.query,{functionList:[],selectMember:{},users:{},memberStatus:!1,background:"transparent",color:"#fff"}},computed:{userInfo(){const e=this.users;return{username:(e==null?void 0:e.nickname)||"",phone:(e==null?void 0:e.phone)||"",avatar:e==null?void 0:e.avatar,id:e==null?void 0:e.id,isVip:e==null?void 0:e.vipMember,membershipDays:e==null?void 0:e.membershipDays,membershipEndTime:e==null?void 0:e.membershipEndTime}}},async mounted(){y(document,"scroll",()=>{const{y:e}=h();e.value>52?(this.background="#fff",this.color="#323333"):(this.background="transparent",this.color="#fff")});try{const e=await i.get("/edu-app/student/member");this.users=e.data||{};const{data:s}=await i.post("/edu-app/cityFeeSetting/member");this.selectMember=s,this.paymentOrderUnpaid()}catch(e){}},methods:{async paymentOrderUnpaid(){try{const{data:e}=await i.get("/edu-app/userPaymentOrder/unpaid",{requestType:"form",params:{paymentType:"VIP"}});e.id&&l({message:"您有待支付的订单,是否继续支付",cancelButtonText:"取消订单",confirmButtonText:"继续支付"}).then(()=>{const s=e.paymentConfig;this.$router.push({path:"/order-detail",query:{config:JSON.stringify(s.paymentConfig),orderNo:s.orderNo}})}).catch(async()=>{try{await i.post("/edu-app/userPaymentOrder/cancelPayment/"+e.orderNo)}catch(s){}})}catch(e){}},calcSalePrice(e){if(e.discount===1){const s=Number((e.salePrice-e.discountPrice).toFixed(2));return s>=0?s:0}return e.salePrice},async onSubmit(){try{const e=this.selectMember,s=[{goodsId:e.id,goodsNum:1,goodsType:"VIP",paymentCashAmount:e.salePrice,paymentCouponAmount:0}],{data:u}=await i.post("/edu-app/userPaymentOrder/executeOrder",{data:{orderType:"VIP",paymentCashAmount:this.selectMember.salePrice||0,paymentCouponAmount:0,goodsInfos:s,orderName:"数字化乐器学练工具",orderDesc:"数字化乐器学练工具"}}),a=await i.get("/edu-app/userPaymentOrder/detail/"+u.orderNo);a.data.status!=="WAIT_PAY"&&a.data.status!=="PAYING"?this.$router.push({path:"/payment-result",query:{orderNo:u.orderNo}}):this.$router.push({path:"/order-detail",query:{config:JSON.stringify(u.paymentConfig),orderNo:u.orderNo}})}catch(e){console.log(e)}}},render(){return t("div",{class:r["member-center"]},[t(p,{background:this.background,color:this.color,border:!1},null),t("div",{class:r.member_container},[t(g,{class:[r.userMember],labelClass:r.timeRemaining,center:!0},{icon:()=>t("div",{class:r.userImgSection},[t(m,{class:r.userImg,src:this.userInfo.avatar||J,fit:"cover"},null)]),title:()=>t("div",{class:r.userInfo},[t("span",{class:r.name},[this.userInfo.username]),!!this.userInfo.isVip&&t(m,{class:r.level,src:"https://daya.ks3-cn-beijing.ksyun.com/202107/ScSTL1D.png"},null),this.userInfo.phone&&t("span",{class:r.phone,innerHTML:`(${this.userInfo.phone})`},null)]),label:()=>t("div",{class:r.member_time},[t(d,null,[this.userInfo.isVip?t("div",null,[n("使用有效期剩余"),t("span",{class:r.remaining},[this.userInfo.membershipDays]),n("天")]):t("div",null,[n("亲,您还不是会员哟")])])])})]),t("div",{class:[r.memberContainer]},[t("div",{class:r.memberItem},[t("p",{class:[r.title]},[t("strong",null,[n("数字化")]),n("乐器学练工具"),t("span",null,[n("12个月")])]),t("div",{class:r.priceGroup},[t("p",{class:r.price},[t("span",null,[n("¥")]),o(this.selectMember.salePrice)]),t("del",{class:r.originalPrice},[n("¥"),o(this.selectMember.originalPrice)])])]),t("div",{class:r.memberImgs},[t("img",{src:W},null),t("img",{src:Y},null)])]),t("div",{class:r.btnGroup},[t("div",{class:r.priceSection},[n("支付金额:"),t("div",{class:r.price},[t("span",{class:r.priceUnit},[n("¥")]),t("span",{class:r.priceNum},[o(this.calcSalePrice(this.selectMember)||0)])])]),this.userInfo.id?t(_,{round:!0,class:r.btn,onClick:this.onSubmit},{default:()=>[n("立即领取")]}):""]),t(b,{show:this.memberStatus,"onUpdate:show":e=>this.memberStatus=e,title:"待激活团练宝",message:"为让团员有效使用乐团学习工具,首次加入乐团且购买团练宝的团员,团练宝的生效时间为乐团首次训练之日,具体训练时间可查看课表。",messageAlign:"left",dialogMarginTop:"env(safe-area-inset-top)",confirmButtonText:"我知道了"},null)])}});export{Z as default};
|