1 |
- import{d as l,D as i,Q as d,a as t,S as p,F as _,A as s,P as o,C as b}from"./index-2f914f39.js";import{i as f}from"./icon-gift-94736468.js";import{O as g}from"./index-adb4fe4d.js";import{u as h,a as y}from"./index-2e9c01fc.js";import{C as a}from"./index-dfd89f44.js";import{I as m}from"./index-dd209d50.js";const E="_member_container_c0edz_10",F="_level_c0edz_13",I="_userMember_c0edz_17",C="_userImgSection_c0edz_22",D="_userImg_c0edz_22",z="_userInfo_c0edz_35",v="_name_c0edz_41",P="_phone_c0edz_50",A="_timeRemaining_c0edz_53",S="_remaining_c0edz_58",B="_member_time_c0edz_62",G="_memberImgs_c0edz_68",M="_memberContainer_c0edz_75",N="_memberItem_c0edz_80",T="_title_c0edz_89",w="_priceGroup_c0edz_104",O="_price_c0edz_104",U="_originalPrice_c0edz_118",k="_memberGift_c0edz_126",x="_giftCell_c0edz_132",V="_gift_c0edz_132",L="_iconGift_c0edz_150",R="_btnGroup_c0edz_155",q="_btn_c0edz_155",$="_priceSection_c0edz_176",H="_priceUnit_c0edz_188",J="_memberDiscount_c0edz_191",W="_discountAvatar_c0edz_203",Y="_discountName_c0edz_211",j="_discountGift_c0edz_218",r={"member-center":"_member-center_c0edz_1",member_container:E,level:F,userMember:I,userImgSection:C,userImg:D,userInfo:z,name:v,phone:P,timeRemaining:A,remaining:S,member_time:B,memberImgs:G,memberContainer:M,memberItem:N,title:T,priceGroup:w,price:O,originalPrice:U,memberGift:k,giftCell:x,gift:V,iconGift:L,btnGroup:R,btn:q,priceSection:$,priceUnit:H,memberDiscount:J,discountAvatar:W,discountName:Y,discountGift:j},Q=""+new URL("icon-student-4155aac2.png",import.meta.url).href,K=""+new URL("member-1-28d3dedd.png",import.meta.url).href,X=""+new URL("member-2-f5aa1a1d.png",import.meta.url).href,ie=l({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(){h(document,"scroll",()=>{const{y:e}=y();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: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:u}=await i.post("/edu-app/userPaymentOrder/executeOrder",{data:{orderType:"VIP",paymentCashAmount:this.selectMember.salePrice||0,paymentCouponAmount:0,goodsInfos:n,orderName:"数字化器乐学练工具",orderDesc:"数字化器乐学练工具"}}),c=await i.get("/edu-app/userPaymentOrder/detail/"+u.orderNo);c.data.status!=="WAIT_PAY"&&c.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(a,{class:[r.userMember],labelClass:r.timeRemaining,center:!0},{icon:()=>t("div",{class:r.userImgSection},[t(m,{class:r.userImg,src:this.userInfo.avatar||Q,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(_,null,[this.userInfo.isVip?t("div",null,[s("使用有效期剩余"),t("span",{class:r.remaining},[this.userInfo.membershipDays]),s("天")]):t("div",null,[s("您还未开通器乐学练工具哟")])])])})]),t("div",{class:[r.memberContainer]},[t("div",{class:[r.memberItem,this.selectMember.membershipDays>0?r.memberGift:""]},[t("p",{class:[r.title]},[t("strong",null,[s("数字化")]),s("器乐学练工具"),t("span",null,[s("12个月")])]),t("div",{class:r.priceGroup},[t("p",{class:r.price},[t("span",null,[s("¥")]),o(this.selectMember.salePrice)]),t("del",{class:r.originalPrice},[s("¥"),o(this.selectMember.originalPrice)])]),this.selectMember.membershipDays>0&&t(a,{border:!1,class:r.giftCell},{title:()=>t("div",{class:r.gift},[t("img",{src:f,class:r.iconGift},null),s("现在购买赠送")," ",t("span",null,[this.selectMember.membershipDays||0]),s("天有效期")])})]),t("div",{class:r.memberImgs},[t("img",{src:K},null),t("img",{src:X},null)])]),t("div",{class:r.btnGroup},[t("div",{class:r.priceSection},[s("工具领取:"),t("div",{class:r.price},[t("span",{class:r.priceUnit},[s("¥")]),t("span",{class:r.priceNum},[o(this.calcSalePrice(this.selectMember)||0)])])]),this.userInfo.id?t(b,{round:!0,class:r.btn,onClick:this.onSubmit},{default:()=>[s("立即领取")]}):""]),t(g,{show:this.memberStatus,"onUpdate:show":e=>this.memberStatus=e,title:"待激活团练宝",message:"为让团员有效使用乐团学习工具,首次加入乐团且购买团练宝的团员,团练宝的生效时间为乐团首次训练之日,具体训练时间可查看课表。",messageAlign:"left",dialogMarginTop:"env(safe-area-inset-top)",confirmButtonText:"我知道了"},null)])}});export{ie as default};
|