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