1 |
- import{d as c,r as s,j as l,f as t,O as p,F as d,g as r,m as o,B as _}from"./index-4fdf58de.js";import{O as b}from"./index-f83b05de.js";import{u as h,a as y}from"./index-0b09f62f.js";import{C as g}from"./index-c2b2e34a.js";import{I as m}from"./index-7fda46b5.js";const f="_member_container_wy4ei_10",E="_level_wy4ei_13",F="_userMember_wy4ei_17",w="_userImgSection_wy4ei_22",I="_userImg_wy4ei_22",v="_userInfo_wy4ei_35",C="_name_wy4ei_41",D="_phone_wy4ei_50",P="_timeRemaining_wy4ei_53",A="_remaining_wy4ei_58",B="_member_time_wy4ei_62",S="_memberImgs_wy4ei_68",N="_memberContainer_wy4ei_72",M="_memberItem_wy4ei_77",T="_title_wy4ei_86",O="_priceGroup_wy4ei_101",G="_price_wy4ei_101",k="_originalPrice_wy4ei_115",U="_btnGroup_wy4ei_123",V="_btn_wy4ei_123",x="_priceSection_wy4ei_144",L="_priceUnit_wy4ei_156",R="_memberDiscount_wy4ei_159",q="_discountAvatar_wy4ei_171",$="_discountName_wy4ei_179",j="_discountGift_wy4ei_186",n={"member-center":"_member-center_wy4ei_1",member_container:f,level:E,userMember:F,userImgSection:w,userImg:I,userInfo:v,name:C,phone:D,timeRemaining:P,remaining:A,member_time:B,memberImgs:S,memberContainer:N,memberItem:M,title:T,priceGroup:O,price:G,originalPrice:k,btnGroup:U,btn:V,priceSection:x,priceUnit:L,memberDiscount:R,discountAvatar:q,discountName:$,discountGift:j},H=""+new URL("icon-student-4155aac2.png",import.meta.url).href,J=""+new URL("member-1-06a91547.png",import.meta.url).href,W=""+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 console.log(this.users,{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}),{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 s.get("/edu-app/student/member");this.users=e.data||{};const{data:i}=await s.post("/edu-app/cityFeeSetting/member");this.selectMember=i,this.paymentOrderUnpaid()}catch(e){}},methods:{async paymentOrderUnpaid(){try{const{data:e}=await s.get("/edu-app/userPaymentOrder/unpaid",{requestType:"form",params:{paymentType:"VIP"}});e.id&&l({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 s.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=[{goodsId:e.id,goodsNum:1,goodsType:"VIP",paymentCashAmount:e.salePrice,paymentCouponAmount:0}],{data:a}=await s.post("/edu-app/userPaymentOrder/executeOrder",{data:{orderType:"VIP",paymentCashAmount:this.selectMember.salePrice||0,paymentCouponAmount:0,goodsInfos:i,orderName:"数字化乐器学练工具",orderDesc:"数字化乐器学练工具"}});console.log(a);const u=await s.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:"/orderDetail",query:{config:JSON.stringify(a.paymentConfig),orderNo:a.orderNo}})}catch(e){console.log(e)}}},render(){return t("div",{class:n["member-center"]},[t(p,{background:this.background,color:this.color,border:!1},null),t("div",{class:n.member_container},[t(g,{class:[n.userMember],labelClass:n.timeRemaining,center:!0},{icon:()=>t("div",{class:n.userImgSection},[t(m,{class:n.userImg,src:this.userInfo.avatar||H,fit:"cover"},null)]),title:()=>t("div",{class:n.userInfo},[t("span",{class:n.name},[this.userInfo.username]),!!this.userInfo.isVip&&t(m,{class:n.level,src:"https://daya.ks3-cn-beijing.ksyun.com/202107/ScSTL1D.png"},null),this.userInfo.phone&&t("span",{class:n.phone,innerHTML:`(${this.userInfo.phone})`},null)]),label:()=>t("div",{class:n.member_time},[t(d,null,[this.userInfo.isVip?t("div",null,[r("使用有效期剩余"),t("span",{class:n.remaining},[this.userInfo.membershipDays]),r("天")]):t("div",null,[r("亲,您还不是会员哟")])])])})]),t("div",{class:[n.memberContainer]},[t("div",{class:n.memberItem},[t("p",{class:[n.title]},[t("strong",null,[r("数字化")]),r("乐器学练工具"),t("span",null,[r("12个月")])]),t("div",{class:n.priceGroup},[t("p",{class:n.price},[t("span",null,[r("¥")]),o(this.selectMember.salePrice)]),t("del",{class:n.originalPrice},[r("¥"),o(this.selectMember.originalPrice)])])]),t("div",{class:n.memberImgs},[t("img",{src:J},null),t("img",{src:W},null)])]),t("div",{class:n.btnGroup},[t("div",{class:n.priceSection},[r("支付金额:"),t("div",{class:n.price},[t("span",{class:n.priceUnit},[r("¥")]),t("span",{class:n.priceNum},[o(this.calcSalePrice(this.selectMember)||0)])])]),this.userInfo.id?t(_,{round:!0,class:n.btn,onClick:this.onSubmit},{default:()=>[r("立即领取")]}):""]),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};
|