1 |
- import{d as f,a7 as g,D as n,a4 as h,a as t,V as _,F as u,A as i,W as o,S as l,C as y}from"./index-869d77fb.js";import{i as A}from"./icon-student-36c056f8.js";import{i as E}from"./icon-gift-94736468.js";import{O as p}from"./index-b286ae32.js";import{u as C,a as I}from"./index-155c29c2.js";import{C as b}from"./index-1c6c2ec0.js";import{I as d}from"./index-e76f2a88.js";const q="_member_container_7ie1q_10",v="_level_7ie1q_13",D="_userMember_7ie1q_17",P="_userImgSection_7ie1q_22",F="_userImg_7ie1q_22",M="_userInfo_7ie1q_35",z="_name_7ie1q_41",T="_phone_7ie1q_50",G="_timeRemaining_7ie1q_53",w="_remaining_7ie1q_58",N="_member_time_7ie1q_62",L="_memberImgs_7ie1q_68",B="_memberContainer_7ie1q_75",R="_memberItem_7ie1q_80",O="_title_7ie1q_89",U="_priceGroup_7ie1q_104",V="_price_7ie1q_104",S="_originalPrice_7ie1q_118",Y="_memberGift_7ie1q_126",x="_giftCell_7ie1q_132",X="_gift_7ie1q_132",k="_iconGift_7ie1q_150",J="_btnGroup_7ie1q_155",Q="_btn_7ie1q_155",H="_priceSection_7ie1q_178",W="_priceUnit_7ie1q_190",Z="_allPrice_7ie1q_193",j="_memberDiscount_7ie1q_203",K="_discountAvatar_7ie1q_215",$="_discountName_7ie1q_223",ee="_discountGift_7ie1q_230",te="_memberCenterTablet_7ie1q_237",r={"member-center":"_member-center_7ie1q_1",member_container:q,level:v,userMember:D,userImgSection:P,userImg:F,userInfo:M,name:z,phone:T,timeRemaining:G,remaining:w,member_time:N,memberImgs:L,memberContainer:B,memberItem:R,title:O,priceGroup:U,price:V,originalPrice:S,memberGift:Y,giftCell:x,gift:X,iconGift:k,btnGroup:J,btn:Q,priceSection:H,priceUnit:W,allPrice:Z,memberDiscount:j,discountAvatar:K,discountName:$,discountGift:ee,memberCenterTablet:te},re="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAABy1BMVEUAAADpzYX+773335b96rfz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YVkrwD3qWVJWNhzyF4v9ZUVvgrvjg5ODoyZlepLBadLrByCY6SjkOeFhclQnPetbwNM7yTg0PTY39AQtRpOM7jFZyMqJbmvMf59QR4CfCGp0ZsVDMY9OnHhFQG0bFi4QAUr0czUDbuGIJiyYDogVQlIRdgB0iUOfDGQzpdxoEDJwx6anV2dgYvEHJ1FxWLygJBq/noxnxeJ8QGR6enfLvowAPYrxJybRclXG3RHa5vjM8v6EN4g748OgOULvs1qE7pGDAngV7MPgk36Ju2DQx0gkNZgerKDDpstQ28xYlFHDizz6Turm4gA4d5IupRYqOj4E3CwLGZGDgUQRDUavEJIVVZW2m0dzFGb9A3k2CamhLIVsEnzNrBgDlYtRqjn9i3edytFphkMpl6ghJ8QvJVZBISnHDQgdM9qFAJEb8R4IUUKI4WltjAzT2TSd0DEqJUbudeoCi/KVJJwEUxHLi5gEnoUNrFm3KCVOV2oIh1RdGb2aYCOsr29nZ7ropQWm9Lv+loKNuPwp3PMonS2+vK3W4ljLorWWWpCmEOYualK3WkyDuZqCyTCpqZF4/ekRLPZFm+VAaPGRwzz/PLkuwZ+Z9Xstx2MceMDsMTkr0iJ/n0OSy6IIglMZbF8JdPpJymR+Hwnof/hyu5Fw4/aiKnUP0gEpGJ6WBSkUylV2WRyINqcgYNNfciPxmRezUN5Dzk1R/e1Lz5UC0nZfwFq/VzDW8PhUQAAAAASUVORK5CYII=",ie=""+new URL("member-1-6bab617f.png",import.meta.url).href,se=""+new URL("member-2-9f8452ea.png",import.meta.url).href,ne=""+new URL("member-1-tablet-0fceeb18.png",import.meta.url).href,ae=""+new URL("member-2-tablet-a8f2cefd.png",import.meta.url).href,de=f({name:"MemberCenter",data(){return{functionList:[],selectMember:{},users:{},memberStatus:!1,background:"transparent",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:g(e==null?void 0:e.membershipEndTime).format("YYYY-MM-DD")}}},async mounted(){C(document,"scroll",()=>{const{y:e}=I();e.value>15?this.background="#fff":this.background="transparent"}),this.__init()},methods:{async __init(){try{const e=await n.get("/edu-app/student/member");this.users=e.data||{};const{data:s}=await n.post("/edu-app/cityFeeSetting/member");this.selectMember=s,this.paymentOrderUnpaid()}catch(e){}},async paymentOrderUnpaid(){try{const{data:e}=await n.get("/edu-app/userPaymentOrder/unpaid",{requestType:"form",params:{paymentType:"VIP"}});e.id&&h({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 n.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=[{giftVipDay:this.users.membershipGiftDays,goodsId:e.id,goodsNum:1,goodsType:"VIP",paymentCashAmount:e.salePrice,paymentCouponAmount:0}],m=await n.post("/edu-app/userPaymentOrder/executeOrder",{data:{orderType:"VIP",paymentCashAmount:this.selectMember.salePrice||0,paymentCouponAmount:0,goodsInfos:s,orderName:"乐器AI学练工具",orderDesc:"乐器AI学练工具"}});if(m.code===5435){this.showTips=!0,this.showMessage=m.message;return}const a=m.data,c=await n.get("/edu-app/userPaymentOrder/detail/"+a.orderNo);c.data.status!=="WAIT_PAY"&&c.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"],l().isTablet?r.memberCenterTablet:""]},[t(_,{background:this.background,border:!1},null),t("div",{class:r.member_container},[t(b,{class:[r.userMember],labelClass:r.timeRemaining,center:!0},{icon:()=>t("div",{class:r.userImgSection},[t(d,{class:r.userImg,src:this.userInfo.avatar||A,fit:"cover"},null)]),title:()=>t("div",{class:r.userInfo},[t("span",{class:r.name},[this.userInfo.username]),!!this.userInfo.isVip&&t(d,{class:r.level,src:re},null),this.userInfo.phone&&t("span",{class:r.phone,innerHTML:`(${this.userInfo.phone})`},null)]),label:()=>t("div",{class:r.member_time},[t(u,null,[this.userInfo.isVip?t("div",null,[i("有效期至"),t("span",{class:r.remaining},[this.userInfo.membershipEndTime])]):t("div",null,[i("您还未领取器乐学练工具哟")])])])})]),t("div",{class:[r.memberContainer]},[t("div",{class:[r.memberItem,this.users.membershipGiftDays>0?r.memberGift:""]},[t("p",{class:[r.title]},[i("乐器AI学练工具"),t("span",null,[i("12个月")])]),t("div",{class:r.priceGroup},[t("p",{class:r.price},[t("span",null,[i("¥")]),o(this.selectMember.salePrice)]),this.selectMember.salePrice<this.selectMember.originalPrice&&t("del",{class:r.originalPrice},[i("¥"),o(this.selectMember.originalPrice)])]),this.users.membershipGiftDays>0&&t(b,{border:!1,class:r.giftCell},{title:()=>t("div",{class:r.gift},[t("img",{src:E,class:r.iconGift},null),i("现在领取赠送")," ",t("span",null,[this.users.membershipGiftDays||0]),i("天有效期")])})]),t("div",{class:r.memberImgs},[l().isTablet?t(u,null,[t("img",{src:ne},null),t("img",{src:ae},null)]):t(u,null,[t("img",{src:ie},null),t("img",{src:se},null)])])]),t("div",{class:r.btnGroup},[t("div",{class:r.priceSection},[t("div",{class:r.price},[t("span",{class:r.priceUnit},[i("¥")]),t("span",{class:r.priceNum},[o(this.calcSalePrice(this.selectMember)||0)])]),this.selectMember.originalPrice>this.calcSalePrice(this.selectMember)?t("del",{class:r.allPrice},[i("¥ "),o(this.selectMember.originalPrice)]):""]),this.userInfo.id?t(y,{round:!0,class:r.btn,onClick:this.onSubmit},{default:()=>[i("立即领取")]}):""]),t(p,{show:this.memberStatus,"onUpdate:show":e=>this.memberStatus=e,title:"待激活团练宝",message:"为让团员有效使用乐团学习工具,首次加入乐团且购买团练宝的团员,团练宝的生效时间为乐团首次训练之日,具体训练时间可查看课表。",messageAlign:"left",dialogMarginTop:"env(safe-area-inset-top)",confirmButtonText:"我知道了"},null),t(p,{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{de as default};
|