import{d as l,a4 as p,D as i,Q as d,a as t,S as b,F as y,A as s,P as o,C as f}from"./index-74aaacd7.js";import{i as g}from"./icon-student-36c056f8.js";import{i as _}from"./icon-gift-94736468.js";import{O as h}from"./index-5703240b.js";import{u as A,a as E}from"./index-cc31fe60.js";import{C as m}from"./index-baa1bd27.js";import{I as c}from"./index-418977f3.js";const I="_member_container_176y3_10",v="_level_176y3_13",C="_userMember_176y3_17",P="_userImgSection_176y3_22",D="_userImg_176y3_22",F="_userInfo_176y3_35",z="_name_176y3_41",M="_phone_176y3_50",G="_timeRemaining_176y3_53",N="_remaining_176y3_58",L="_member_time_176y3_62",B="_memberImgs_176y3_68",R="_memberContainer_176y3_75",T="_memberItem_176y3_80",O="_title_176y3_89",S="_priceGroup_176y3_104",U="_price_176y3_104",V="_originalPrice_176y3_118",Y="_memberGift_176y3_126",q="_giftCell_176y3_132",X="_gift_176y3_132",k="_iconGift_176y3_150",w="_btnGroup_176y3_155",x="_btn_176y3_155",J="_priceSection_176y3_177",Q="_priceUnit_176y3_189",H="_allPrice_176y3_192",W="_memberDiscount_176y3_202",Z="_discountAvatar_176y3_214",j="_discountName_176y3_222",K="_discountGift_176y3_229",r={"member-center":"_member-center_176y3_1",member_container:I,level:v,userMember:C,userImgSection:P,userImg:D,userInfo:F,name:z,phone:M,timeRemaining:G,remaining:N,member_time:L,memberImgs:B,memberContainer:R,memberItem:T,title:O,priceGroup:S,price:U,originalPrice:V,memberGift:Y,giftCell:q,gift:X,iconGift:k,btnGroup:w,btn:x,priceSection:J,priceUnit:Q,allPrice:H,memberDiscount:W,discountAvatar:Z,discountName:j,discountGift:K},$="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAABy1BMVEUAAADpzYX+773335b96rfz257z3J/45Kvv1ZLmy33z4qLmyXz/78H75rPr0Iny257y253967r35K3t04755rHr0Yv34qr/7r/myXz/7b3oyX7967zoy4H14KXw2Jf76rjqz4X55K3u1ZH967jqzYT/8M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OnHhFQG0bFi4QAUr0czUDbuGIJiyYDogVQlIRdgB0iUOfDGQzpdxoEDJwx6anV2dgYvEHJ1FxWLygJBq/noxnxeJ8QGR6enfLvowAPYrxJybRclXG3RHa5vjM8v6EN4g748OgOULvs1qE7pGDAngV7MPgk36Ju2DQx0gkNZgerKDDpstQ28xYlFHDizz6Turm4gA4d5IupRYqOj4E3CwLGZGDgUQRDUavEJIVVZW2m0dzFGb9A3k2CamhLIVsEnzNrBgDlYtRqjn9i3edytFphkMpl6ghJ8QvJVZBISnHDQgdM9qFAJEb8R4IUUKI4WltjAzT2TSd0DEqJUbudeoCi/KVJJwEUxHLi5gEnoUNrFm3KCVOV2oIh1RdGb2aYCOsr29nZ7ropQWm9Lv+loKNuPwp3PMonS2+vK3W4ljLorWWWpCmEOYualK3WkyDuZqCyTCpqZF4/ekRLPZFm+VAaPGRwzz/PLkuwZ+Z9Xstx2MceMDsMTkr0iJ/n0OSy6IIglMZbF8JdPpJymR+Hwnof/hyu5Fw4/aiKnUP0gEpGJ6WBSkUylV2WRyINqcgYNNfciPxmRezUN5Dzk1R/e1Lz5UC0nZfwFq/VzDW8PhUQAAAAASUVORK5CYII=",ee=""+new URL("member-1-6bab617f.png",import.meta.url).href,te=""+new URL("member-2-9f8452ea.png",import.meta.url).href,me=l({name:"MemberCenter",data(){return{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,membershipGiftDays:e==null?void 0:e.membershipGiftDays,membershipDays:e==null?void 0:e.membershipDays,membershipEndTime:p(e==null?void 0:e.membershipEndTime).format("YYYY-MM-DD")}}},async mounted(){A(document,"scroll",()=>{const{y:e}=E();e.value>15?(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:n}=await i.post("/edu-app/cityFeeSetting/member");this.selectMember=n,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&&d({message:"您有待支付的订单,是否继续支付",cancelButtonText:"取消订单",confirmButtonText:"继续支付"}).then(()=>{const n=e.paymentConfig;this.$router.push({path:"/order-detail",query:{config:JSON.stringify(n.paymentConfig),orderNo:n.orderNo}})}).catch(async()=>{try{await i.post("/edu-app/userPaymentOrder/cancelPayment/"+e.orderNo)}catch(n){}})}catch(e){}},calcSalePrice(e){if(e.discount===1){const n=Number((e.salePrice-e.discountPrice).toFixed(2));return n>=0?n:0}return e.salePrice},async onSubmit(){try{const e=this.selectMember,n=[{goodsId:e.id,goodsNum:1,goodsType:"VIP",paymentCashAmount:e.salePrice,paymentCouponAmount:0}],{data:a}=await i.post("/edu-app/userPaymentOrder/executeOrder",{data:{orderType:"VIP",paymentCashAmount:this.selectMember.salePrice||0,paymentCouponAmount:0,goodsInfos:n,orderName:"乐器AI学练工具",orderDesc:"乐器AI学练工具"}}),u=await i.get("/edu-app/userPaymentOrder/detail/"+a.orderNo);u.data.status!=="WAIT_PAY"&&u.data.status!=="PAYING"?this.$router.push({path:"/payment-result",query:{orderNo:a.orderNo}}):this.$router.push({path:"/order-detail",query:{config:JSON.stringify({...a.paymentConfig,paymentType:a.paymentType}),orderNo:a.orderNo}})}catch(e){console.log(e)}}},render(){return t("div",{class:r["member-center"]},[t(b,{background:this.background,color:this.color,border:!1},null),t("div",{class:r.member_container},[t(m,{class:[r.userMember],labelClass:r.timeRemaining,center:!0},{icon:()=>t("div",{class:r.userImgSection},[t(c,{class:r.userImg,src:this.userInfo.avatar||g,fit:"cover"},null)]),title:()=>t("div",{class:r.userInfo},[t("span",{class:r.name},[this.userInfo.username]),!!this.userInfo.isVip&&t(c,{class:r.level,src:$},null),this.userInfo.phone&&t("span",{class:r.phone,innerHTML:`(${this.userInfo.phone})`},null)]),label:()=>t("div",{class:r.member_time},[t(y,null,[this.userInfo.isVip?t("div",null,[s("有效期至"),t("span",{class:r.remaining},[this.userInfo.membershipEndTime])]):t("div",null,[s("您还未领取器乐学练工具哟")])])])})]),t("div",{class:[r.memberContainer]},[t("div",{class:[r.memberItem,this.users.membershipGiftDays>0?r.memberGift:""]},[t("p",{class:[r.title]},[s("乐器AI学练工具"),t("span",null,[s("12个月")])]),t("div",{class:r.priceGroup},[t("p",{class:r.price},[t("span",null,[s("¥")]),o(this.selectMember.salePrice)]),this.selectMember.salePrice0&&t(m,{border:!1,class:r.giftCell},{title:()=>t("div",{class:r.gift},[t("img",{src:_,class:r.iconGift},null),s("现在领取赠送")," ",t("span",null,[this.users.membershipGiftDays||0]),s("天有效期")])})]),t("div",{class:r.memberImgs},[t("img",{src:ee},null),t("img",{src:te},null)])]),t("div",{class:r.btnGroup},[t("div",{class:r.priceSection},[t("div",{class:r.price},[t("span",{class:r.priceUnit},[s("¥")]),t("span",{class:r.priceNum},[o(this.calcSalePrice(this.selectMember)||0)])]),this.selectMember.originalPrice>this.calcSalePrice(this.selectMember)?t("del",{class:r.allPrice},[s("¥ "),o(this.selectMember.originalPrice)]):""]),this.userInfo.id?t(f,{round:!0,class:r.btn,onClick:this.onSubmit},{default:()=>[s("立即领取")]}):""]),t(h,{show:this.memberStatus,"onUpdate:show":e=>this.memberStatus=e,title:"待激活团练宝",message:"为让团员有效使用乐团学习工具,首次加入乐团且购买团练宝的团员,团练宝的生效时间为乐团首次训练之日,具体训练时间可查看课表。",messageAlign:"left",dialogMarginTop:"env(safe-area-inset-top)",confirmButtonText:"我知道了"},null)])}});export{me as default};