index.f2a1d018.js 9.9 KB

1
  1. import{i as E,a as h,b as v,_ as D,c as y,d as C,e as A,f as S,g as T,h as B,j as P,k as U,l as M,m as V,n as L,o as N,p as R,q as Y,r as j}from"./tip_bg.2a396e3e.js";import{d as x,g as _,w as l,i as $,u as c,j as e,z as o,bz as g,M as w,B as G,F as d,aR as O}from"./index.394decd7.js";import{C as k}from"./index.e6e212d8.js";import{C as q}from"./index.9e0d46e4.js";import{I as m}from"./index.ae2dd816.js";import{s as H}from"./icon_student.c3c58354.js";import{i as z}from"./icon_teacher.40b6f077.js";import{i as Q}from"./icon_share2.a7c878ef.js";import{o as u}from"./orderStatus.535346ee.js";import{m as J}from"./index.68f32c85.js";import{C as K}from"./index.52a60bda.js";import"./index.f1b52763.js";import"./code-down-load.37c8e9cc.js";import"./logo.bcac726b.js";import"./browser.8379baf6.js";import"./html2canvas.esm.3d083717.js";const W="_member_container_110os_9",X="_title_110os_12",Z="_level_110os_29",ee="_userMember_110os_33",se="_userImgSection_110os_40",te="_userImg_110os_40",ie="_userInfo_110os_56",oe="_name_110os_62",ne="_phone_110os_70",re="_timeRemaining_110os_73",ae="_remaining_110os_78",ue="_member_time_110os_82",ce="_intro_110os_87",me="_memberContainer_110os_99",_e="_memberItem_110os_107",le="_member_function_110os_118",de="_function_item__content_110os_123",pe="_function_item_110os_123",he="_function_text_110os_135",ge="_bat_110os_171",be="_price_110os_192",fe="_originalPrice_110os_200",Ie="_active_110os_204",Fe="_btnGroup_110os_241",Ee="_btn_110os_241",ve="_priceSection_110os_258",De="_priceUnit_110os_269",ye="_memberDiscount_110os_272",Ce="_discountAvatar_110os_284",Ae="_discountName_110os_292",Se="_discountGift_110os_299",Te="_discountItem_110os_306",Be="_discountBuy_110os_313",Pe="_shareBtn_110os_318",Ue="_shareVip_110os_330",Me="_icon_110os_340",Ve="_info_110os_345",Le="_tagDiscount_110os_359";var t={"member-center":"_member-center_110os_1",member_container:W,title:X,level:Z,userMember:ee,userImgSection:se,userImg:te,userInfo:ie,name:oe,phone:ne,timeRemaining:re,remaining:ae,member_time:ue,intro:ce,memberContainer:me,memberItem:_e,member_function:le,function_item__content:de,function_item:pe,function_text:he,"system-list":"_system-list_110os_140","system-item":"_system-item_110os_156",bat:ge,price:be,originalPrice:fe,active:Ie,btnGroup:Fe,btn:Ee,priceSection:ve,priceUnit:De,memberDiscount:ye,discountAvatar:Ce,discountName:Ae,discountGift:Se,discountItem:Te,discountBuy:Be,shareBtn:Pe,shareVip:Ue,icon:Me,info:Ve,tagDiscount:Le};const Ne=s=>{const i=`./images/${s}`;return{"./images/1.png":D,"./images/2.png":y,"./images/3.png":C,"./images/4.png":A,"./images/5.png":S,"./images/6.png":T,"./images/7.png":B,"./images/8.png":P,"./images/discount_bg.png":U,"./images/icon_discount.png":M,"./images/icon_gift.png":V,"./images/icon_video.png":L,"./images/member_bg.png":N,"./images/member_logo.png":R,"./images/record_bg.png":Y,"./images/tip_bg.png":j}[i].default};var Xe=x({name:"MemberCenter",data(){const s=this.$route.query;return{activityId:s.activityId,recomUserId:s.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 s=_.user.data;return{username:s==null?void 0:s.username,phone:s==null?void 0:s.phone,avatar:s==null?void 0:s.heardUrl,id:s==null?void 0:s.userId,memberRankSettingId:s==null?void 0:s.memberRankSettingId,isVip:s==null?void 0:s.isVip,membershipDays:s==null?void 0:s.membershipDays,membershipEndTime:s==null?void 0:s.membershipEndTime}}},async mounted(){try{const s=await l.get(_.platformType==="TEACHER"?"/api-teacher/teacher/queryUserInfo":"/api-student/student/queryUserInfo");$(s.data);const r=(await l.post(`${this.apiSuffix}/memberPriceSettings/vipPermissions`)).data||[];this.functionList=r.map(n=>({title:n.paramName,icon:Ne(`${n.paramValue}.png`)}));const b=await l.post(`${this.apiSuffix}/memberPriceSettings/list`,{data:{activityId:Number(this.activityId),userId:this.recomUserId}}),{list:f,...I}=b.data;this.discountTeacher={...I};const F=f||[];let a=[];F.forEach(n=>{const p={title:"",salePrice:n.salePrice,originalPrice:n.originalPrice,period:n.period,id:n.id,discount:n.discount,discountPrice:n.discountPrice,status:!1};p.title=J[n.period],n.period!=="DAY"&&a.push(p)}),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 s=await l.post("/api-teacher/open/vipProfit",{data:{userId:this.userInfo.id}});this.shareUrl=`${location.origin}/teacher#/shareVip?recomUserId=${this.userInfo.id}&userType=${_.platformType}`,s.data&&s.data.activityId&&(this.shareUrl=this.shareUrl+"&activityId="+s.data.activityId),this.shareStatus=!0,this.shareDiscount=s.data.discount||0;return}catch{}},calcSalePrice(s){if(s.discount===1){const i=Number((s.salePrice-s.discountPrice).toFixed(2));return i>=0?i:0}return s.salePrice},onSubmit(){const s=this.selectMember,i=this.userInfo.isVip?c(this.userInfo.membershipEndTime).toDate():new Date;let r=new Date;s.period==="MONTH"?r=c(i).add(1,"month").toDate():s.period==="QUARTERLY"?r=c(i).add(3,"month").toDate():s.period==="YEAR_HALF"?r=c(i).add(6,"month").toDate():s.period==="YEAR"&&(r=c(i).add(1,"year").toDate()),u.orderObject.orderType="VIP",u.orderObject.orderName="\u5C0F\u9177Ai"+s.title,u.orderObject.orderDesc="\u5C0F\u9177Ai"+s.title,u.orderObject.actualPrice=this.calcSalePrice(s),u.orderObject.recomUserId=this.recomUserId,u.orderObject.activityId=this.activityId,u.orderObject.orderNo="",u.orderObject.orderList=[{orderType:"VIP",goodsName:"\u5C0F\u9177Ai"+s.title,id:s.id,title:s.title,price:this.calcSalePrice(s),startTime:c(i).format("YYYY-MM-DD"),endTime:c(r).format("YYYY-MM-DD"),recomUserId:this.recomUserId}],this.$router.push({path:"/orderDetail",query:{orderType:"VIP"}})}},render(){var s;return e("div",{class:t["member-center"]},[e(k,{background:"#ffe5cc"},{right:()=>e("div",{class:t.shareBtn,onClick:this.onShare},[e(m,{src:Q},null),o("\u5206\u4EAB")])}),e("div",{class:t.member_container},[e(q,{class:t.userMember,labelClass:t.timeRemaining},{icon:()=>e("div",{class:t.userImgSection},[e(m,{class:t.userImg,src:this.userInfo.avatar||H,fit:"cover"},null)]),title:()=>e("div",{class:t.userInfo},[e("span",{class:t.name},[this.userInfo.username]),!!this.userInfo.isVip&&e(m,{class:t.level,src:"https://oss.dayaedu.com/daya/202107/ScSTL1D.png"},null),e("span",{class:t.phone,innerHTML:`\uFF08${this.userInfo.phone}\uFF09`},null)]),label:()=>e("div",{class:t.member_time},[this.userInfo.isVip?e("div",null,[o("\u4F1A\u5458\u6743\u76CA\u6709\u6548\u671F\u5269\u4F59"),e("span",{class:t.remaining},[this.userInfo.membershipDays]),o("\u5929")]):!this.userInfo.isVip&&this.userInfo.membershipEndTime?e("div",null,[o("\u60A8\u7684\u4F1A\u5458\u5DF2\u8FC7\u671F\uFF0C\u7EED\u8D39\u540E\u4F1A\u5458\u6743\u76CA\u53EF\u7EE7\u7EED\u4F7F\u7528")]):e("div",null,[o("\u4EB2\uFF0C\u60A8\u8FD8\u4E0D\u662F\u4F1A\u5458\u54E6~")])])})]),e("div",{class:t.memberContainer},[e("div",{class:t.memberItem},[e("div",{class:t.title},[o("\u4F1A\u5458"),e("span",null,[o("VIP")])]),this.discountTeacher.discount==1&&e("div",{class:t.memberDiscount},[e(m,{src:this.discountTeacher.avatar||z,class:t.discountAvatar},null),e("span",{class:t.discountName},[this.discountTeacher.username,o("\u8001\u5E08\u7684\u4E13\u5C5E\u4F18\u60E0\uFF5E")]),e(m,{src:E,class:t.discountGift},null)]),e("div",{class:t["system-list"]},[this.memberList.map(i=>e("div",{class:[t["system-item"],i.status&&t.active],onClick:()=>{this.memberList.forEach(r=>{r.status=!1}),i.status=!0,this.selectMember=i}},[i.period==="YEAR"&&e("span",{class:[t.bat]},[o("\u4F18\u60E0")]),e("div",{class:t.discountItem},[i.discount==1&&e("img",{src:h},null)]),e("p",{class:t.title},[i.title]),e("p",{class:t.price},[e("span",null,[o("\uFFE5")]),g(this.calcSalePrice(i),"0,0[.]00")]),e("del",{class:t.originalPrice},[o("\uFFE5"),g(i.originalPrice,"0,0[.]00")])]))])]),e("div",{class:[t.intro]},[e("p",null,[o("\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,[o("\u5C0F\u9177Ai")]),o("\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:t.memberItem},[e("div",{class:t.title},[o("\u4F1A\u5458\u529F\u80FD")]),e("div",{class:t.member_function},[this.functionList.map(i=>e("div",{class:t.function_item},[e(w,{name:i.icon,size:34},null),e("div",{class:t.function_text,innerHTML:i.title},null)]))])])]),e("div",{class:t.btnGroup},[e("div",{class:t.priceSection},[o("\u652F\u4ED8\u91D1\u989D\uFF1A"),e("div",{class:t.price},[e("span",{class:t.priceUnit},[o("\uFFE5")]),e("span",{class:t.priceNum},[this.$filters.moneyFormat(this.calcSalePrice(this.selectMember)||0)])]),((s=this.selectMember)==null?void 0:s.discount)==1&&e("div",{class:[t.discountItem,t.discountBuy]},[e("img",{src:h},null)])]),e(G,{color:"linear-gradient(220deg, #DFA164 0%, #FAC87E 100%)",round:!0,class:t.btn,onClick:this.onSubmit},{default:()=>[this.userInfo.isVip?e(d,null,[o("\u7ACB\u5373\u7EED\u8D39")]):!this.userInfo.isVip&&this.userInfo.membershipEndTime?e(d,null,[o("\u7ACB\u5373\u7EED\u8D39")]):e(d,null,[o("\u7ACB\u5373\u652F\u4ED8")])]})]),e(O,{show:this.shareStatus,"onUpdate:show":i=>this.shareStatus=i,style:{background:"transparent"}},{default:()=>[e(K,{teacherId:this.userInfo.id,shareUrl:this.shareUrl,shareType:"vip",shareLength:2},{default:()=>[e("div",{class:t.shareVip},[this.shareDiscount===1&&e("div",{class:t.tagDiscount},[o("\u4E13\u5C5E\u4F18\u60E0")]),e("img",{class:t.icon,src:v},null),e("div",{class:t.info},[e("h4",{class:"van-multi-ellipsis--l2"},[o("\u5C0F\u9177Ai\u4F1A\u5458")]),e("p",null,[o("\u6D77\u91CF\u66F2\u8C31\u3001\u667A\u80FD\u8BC4\u6D4B\uFF0C\u4E13\u4E3A\u5668\u4E50\u5B66\u4E60\u8005\u91CF\u8EAB\u6253\u9020")])])])]})]})])}});export{Xe as default,Ne as getAssetsHomeFile};