1 |
- import{i as v,a as p,b as F,_ as y,c as D,d as E,e as C,f as A,g as S,h as T,j as P,k as B,l as U,m as M,n as L,o as V,p as N,q as x,r as R}from"./tip_bg.2a396e3e.js";import{C as Y}from"./index.c5bf3ab5.js";import{d as j,s as _,e as l,f as $,x as u,i as e,A as n,by as h,N as k,B as w,aT as G}from"./index.7994470a.js";import{C as O}from"./index.777f4790.js";import{I as m}from"./index.2fbdc579.js";import{i as q}from"./icon_student.bbb32387.js";import{i as H}from"./icon_teacher.40b6f077.js";import{i as z}from"./icon_share2.a7c878ef.js";import{o}from"./orderStatus.020f67a3.js";import{m as Q}from"./index.e6c57a63.js";import{C as J}from"./index.fdb4c454.js";import"./index.0a2aeb2c.js";import"./use-height.ffa5a0f3.js";import"./index.889feca1.js";import"./code-down-load.acc044c4.js";import"./logo.bcac726b.js";import"./browser.8c23ea5b.js";const K="_member_container_1811c_9",W="_title_1811c_12",X="_level_1811c_29",Z="_userMember_1811c_33",ee="_userImgSection_1811c_40",te="_userImg_1811c_40",se="_userInfo_1811c_54",ie="_name_1811c_60",ne="_phone_1811c_68",re="_timeRemaining_1811c_71",ce="_remaining_1811c_76",ae="_member_time_1811c_80",oe="_intro_1811c_85",ue="_memberContainer_1811c_97",me="_memberItem_1811c_105",_e="_member_function_1811c_116",le="_function_item__content_1811c_121",de="_function_item_1811c_121",pe="_function_text_1811c_133",he="_price_1811c_177",ge="_originalPrice_1811c_185",be="_active_1811c_189",fe="_btnGroup_1811c_218",Ie="_btn_1811c_218",ve="_priceSection_1811c_235",Fe="_priceUnit_1811c_246",ye="_memberDiscount_1811c_249",De="_discountAvatar_1811c_261",Ee="_discountName_1811c_269",Ce="_discountGift_1811c_276",Ae="_discountItem_1811c_283",Se="_discountBuy_1811c_290",Te="_shareBtn_1811c_295",Pe="_shareVip_1811c_307",Be="_icon_1811c_317",Ue="_info_1811c_322",Me="_tagDiscount_1811c_336";var s={"member-center":"_member-center_1811c_1",member_container:K,title:W,level:X,userMember:Z,userImgSection:ee,userImg:te,userInfo:se,name:ie,phone:ne,timeRemaining:re,remaining:ce,member_time:ae,intro:oe,memberContainer:ue,memberItem:me,member_function:_e,function_item__content:le,function_item:de,function_text:pe,"system-list":"_system-list_1811c_138","system-item":"_system-item_1811c_154",price:he,originalPrice:ge,active:be,btnGroup:fe,btn:Ie,priceSection:ve,priceUnit:Fe,memberDiscount:ye,discountAvatar:De,discountName:Ee,discountGift:Ce,discountItem:Ae,discountBuy:Se,shareBtn:Te,shareVip:Pe,icon:Be,info:Ue,tagDiscount:Me};const Le=t=>{const i=`./images/${t}`;return{"./images/1.png":y,"./images/2.png":D,"./images/3.png":E,"./images/4.png":C,"./images/5.png":A,"./images/6.png":S,"./images/7.png":T,"./images/8.png":P,"./images/discount_bg.png":B,"./images/icon_discount.png":U,"./images/icon_gift.png":M,"./images/icon_video.png":L,"./images/member_bg.png":V,"./images/member_logo.png":N,"./images/record_bg.png":x,"./images/tip_bg.png":R}[i].default};var We=j({name:"MemberCenter",data(){const t=this.$route.query;return{activityId:t.activityId,recomUserId:t.recomUserId,apiSuffix:_.platformType==="STUDENT"?"/api-student":"/api-teacher",agreeStatus:!1,functionList:[],memberList:[],selectMember:{},params:{page:1,rows:20},discountTeacher:{avatar:"",discount:0,username:""},shareStatus:!1,shareUrl:"",shareDiscount:0}},computed:{userInfo(){const t=_.user.data;return{username:t==null?void 0:t.username,phone:t==null?void 0:t.phone,avatar:t==null?void 0:t.heardUrl,id:t==null?void 0:t.userId,memberRankSettingId:t==null?void 0:t.memberRankSettingId,isVip:t==null?void 0:t.isVip,membershipDays:t==null?void 0:t.membershipDays,membershipEndTime:t==null?void 0:t.membershipEndTime}}},async mounted(){try{const t=await l.get(_.platformType==="TEACHER"?"/api-teacher/teacher/queryUserInfo":"/api-student/student/queryUserInfo");$(t.data);const c=(await l.post(`${this.apiSuffix}/memberPriceSettings/vipPermissions`)).data||[];this.functionList=c.map(r=>({title:r.paramName,icon:Le(`${r.paramValue}.png`)}));const g=await l.post(`${this.apiSuffix}/memberPriceSettings/list`,{data:{activityId:Number(this.activityId),userId:this.recomUserId}}),{list:b,...f}=g.data;this.discountTeacher={...f};const I=b||[];let a=[];I.forEach(r=>{const d={title:"",salePrice:r.salePrice,originalPrice:r.originalPrice,period:r.period,id:r.id,discount:r.discount,discountPrice:r.discountPrice,status:!1};d.title=Q[r.period],r.period!=="DAY"&&a.push(d)}),a=a?a.reverse():[],a.length>0&&(a[0].status=!0,this.selectMember=a[0]),console.log(a),this.memberList=a}catch{}},methods:{async onShare(){try{const t=await l.post("/api-teacher/open/vipProfit",{data:{userId:this.userInfo.id}});this.shareUrl=`${location.origin}/teacher#/shareVip?recomUserId=${this.userInfo.id}&userType=${_.platformType}`,t.data&&t.data.activityId&&(this.shareUrl=this.shareUrl+"&activityId="+t.data.activityId),this.shareStatus=!0,this.shareDiscount=t.data.discount||0;return}catch{}},calcSalePrice(t){if(t.discount===1){const i=Number((t.salePrice-t.discountPrice).toFixed(2));return i>=0?i:0}return t.salePrice},onSubmit(){const t=this.selectMember,i=this.userInfo.isVip?u(this.userInfo.membershipEndTime).toDate():new Date;let c=new Date;t.period==="MONTH"?c=u(i).add(1,"month").toDate():t.period==="QUARTERLY"?c=u(i).add(3,"month").toDate():t.period==="YEAR_HALF"?c=u(i).add(6,"month").toDate():t.period==="YEAR"&&(c=u(i).add(1,"year").toDate()),o.orderObject.orderType="VIP",o.orderObject.orderName="\u5C0F\u9177Ai"+t.title,o.orderObject.orderDesc="\u5C0F\u9177Ai"+t.title,o.orderObject.actualPrice=this.calcSalePrice(t),o.orderObject.recomUserId=this.recomUserId,o.orderObject.activityId=this.activityId,o.orderObject.orderNo="",o.orderObject.orderList=[{orderType:"VIP",goodsName:"\u5C0F\u9177Ai"+t.title,id:t.id,title:t.title,price:this.calcSalePrice(t),startTime:u(i).format("YYYY-MM-DD"),endTime:u(c).format("YYYY-MM-DD"),recomUserId:this.recomUserId}],this.$router.push({path:"/orderDetail",query:{orderType:"VIP"}})}},render(){var t;return e("div",{class:s["member-center"]},[e(Y,{background:"#ffe5cc"},{right:()=>e("div",{class:s.shareBtn,onClick:this.onShare},[e(m,{src:z},null),n("\u5206\u4EAB")])}),e("div",{class:s.member_container},[e(O,{class:s.userMember,labelClass:s.timeRemaining},{icon:()=>e("div",{class:s.userImgSection},[e(m,{class:s.userImg,src:this.userInfo.avatar||q,fit:"cover"},null)]),title:()=>e("div",{class:s.userInfo},[e("span",{class:s.name},[this.userInfo.username]),!!this.userInfo.isVip&&e(m,{class:s.level,src:"https://daya.ks3-cn-beijing.ksyun.com/202107/ScSTL1D.png"},null),e("span",{class:s.phone,innerHTML:`\uFF08${this.userInfo.phone}\uFF09`},null)]),label:()=>e("div",{class:s.member_time},[this.userInfo.isVip?e("div",null,[n("\u4F1A\u5458\u6743\u76CA\u6709\u6548\u671F\u5269\u4F59"),e("span",{class:s.remaining},[this.userInfo.membershipDays]),n("\u5929")]):e("div",null,[n("\u4EB2\uFF0C\u60A8\u8FD8\u4E0D\u662F\u4F1A\u5458\u54DF")])])})]),e("div",{class:s.memberContainer},[e("div",{class:s.memberItem},[e("div",{class:s.title},[n("\u4F1A\u5458"),e("span",null,[n("VIP")])]),this.discountTeacher.discount==1&&e("div",{class:s.memberDiscount},[e(m,{src:this.discountTeacher.avatar||H,class:s.discountAvatar},null),e("span",{class:s.discountName},[this.discountTeacher.username,n("\u8001\u5E08\u7684\u4E13\u5C5E\u4F18\u60E0\uFF5E")]),e(m,{src:v,class:s.discountGift},null)]),e("div",{class:s["system-list"]},[this.memberList.map(i=>e("div",{class:[s["system-item"],i.status&&s.active],onClick:()=>{this.memberList.forEach(c=>{c.status=!1}),i.status=!0,this.selectMember=i}},[e("div",{class:s.discountItem},[i.discount==1&&e("img",{src:p},null)]),e("p",{class:s.title},[i.title]),e("p",{class:s.price},[e("span",null,[n("\uFFE5")]),h(this.calcSalePrice(i),"0,0[.]00")]),e("del",{class:s.originalPrice},[n("\uFFE5"),h(i.originalPrice,"0,0[.]00")])]))])]),e("div",{class:[s.intro]},[e("p",null,[n("\u9177\u4E50\u79C0\u4F1A\u5458\u53EF\u4F7F\u7528\u5305\u62EC\u5E73\u53F0\u63D0\u4F9B\u7684\u6240\u6709\u8BAD\u7EC3\u4E50\u8C31\uFF0C\u5E76\u4E13\u4EAB\u201C"),e("b",null,[n("\u5C0F\u9177Ai")]),n("\u201D\u516B\u5927\u6838\u5FC3\u529F\u80FD\uFF0C\u5B69\u5B50\u5728\u5BB6\u5C31\u80FD\u8F7B\u677E\u5B8C\u6210\u4E50\u5668\u81EA\u4E3B\u89C4\u8303\u7EC3\u4E60\u3002")])]),this.functionList.length>0&&e("div",{class:s.memberItem},[e("div",{class:s.title},[n("\u4F1A\u5458\u529F\u80FD")]),e("div",{class:s.member_function},[this.functionList.map(i=>e("div",{class:s.function_item},[e(k,{name:i.icon,size:34},null),e("div",{class:s.function_text,innerHTML:i.title},null)]))])])]),e("div",{class:s.btnGroup},[e("div",{class:s.priceSection},[n("\u652F\u4ED8\u91D1\u989D\uFF1A"),e("div",{class:s.price},[e("span",{class:s.priceUnit},[n("\uFFE5")]),e("span",{class:s.priceNum},[this.$filters.moneyFormat(this.calcSalePrice(this.selectMember)||0)])]),((t=this.selectMember)==null?void 0:t.discount)==1&&e("div",{class:[s.discountItem,s.discountBuy]},[e("img",{src:p},null)])]),e(w,{color:"linear-gradient(220deg, #DFA164 0%, #FAC87E 100%)",round:!0,class:s.btn,onClick:this.onSubmit},{default:()=>[n("\u7ACB\u5373\u652F\u4ED8")]})]),e(G,{show:this.shareStatus,"onUpdate:show":i=>this.shareStatus=i,style:{background:"transparent"}},{default:()=>[e(J,{teacherId:this.userInfo.id,shareUrl:this.shareUrl,shareType:"vip",shareLength:2},{default:()=>[e("div",{class:s.shareVip},[this.shareDiscount===1&&e("div",{class:s.tagDiscount},[n("\u4E13\u5C5E\u4F18\u60E0")]),e("img",{class:s.icon,src:F},null),e("div",{class:s.info},[e("h4",{class:"van-multi-ellipsis--l2"},[n("\u5C0F\u9177Ai\u4F1A\u5458")]),e("p",null,[n("\u6D77\u91CF\u66F2\u8C31\u3001\u667A\u80FD\u8BC4\u6D4B\uFF0C\u4E13\u4E3A\u5668\u4E50\u5B66\u4E60\u8005\u91CF\u8EAB\u6253\u9020")])])])]})]})])}});export{We as default,Le as getAssetsHomeFile};
|