index.52a60bda.js 9.8 KB

1
  1. import{d,g as l,j as t,w as p,T as o,p as c,n as m,F as i,z as n,B as u}from"./index.394decd7.js";import{S as h,a as _}from"./index.f1b52763.js";import{s as r,C as v}from"./code-down-load.37c8e9cc.js";import{h as g}from"./html2canvas.esm.3d083717.js";import{C as f}from"./index.9e0d46e4.js";import{i as b}from"./icon_teacher.40b6f077.js";var y="./assets/album1.4ef36b22.png",S=Object.freeze(Object.defineProperty({__proto__:null,default:y},Symbol.toStringTag,{value:"Module"})),T="./assets/bg1.0bb46a9c.png",j=Object.freeze(Object.defineProperty({__proto__:null,default:T},Symbol.toStringTag,{value:"Module"})),A="./assets/bg2.c74c33b8.png",w=Object.freeze(Object.defineProperty({__proto__:null,default:A},Symbol.toStringTag,{value:"Module"})),O="./assets/bg3.1326855b.png",P=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"})),z="./assets/live1.15180050.png",U=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"})),I="./assets/live2.f2f5ddbf.png",M=Object.freeze(Object.defineProperty({__proto__:null,default:I},Symbol.toStringTag,{value:"Module"})),L="./assets/live3.bcea3cd3.png",C=Object.freeze(Object.defineProperty({__proto__:null,default:L},Symbol.toStringTag,{value:"Module"})),H="./assets/music1.ff71319a.png",D=Object.freeze(Object.defineProperty({__proto__:null,default:H},Symbol.toStringTag,{value:"Module"})),E="./assets/music11.0ee3dcca.png",B=Object.freeze(Object.defineProperty({__proto__:null,default:E},Symbol.toStringTag,{value:"Module"})),R="./assets/music2.280fcf95.png",X=Object.freeze(Object.defineProperty({__proto__:null,default:R},Symbol.toStringTag,{value:"Module"})),G="./assets/music3.659e089e.png",k=Object.freeze(Object.defineProperty({__proto__:null,default:G},Symbol.toStringTag,{value:"Module"})),F="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAAAcCAMAAAD4MnnTAAABUFBMVEUAAAD/jGX//wD/m3b/c0//cU7/iWX/n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phmGdz3XSMSlA8AyqsAsYsOKNyQTmJgUF2mb5yjOIu1Br6iZ8YijxnKxfjuycZNQl53Br0IT4GhTe6CdMrWERotuqYQ3VJjRM8hSOmdllXI6LCldgU49TwndKEKB9uDPKgPV1QmljdwZU8CD8wjMGjClqANVntbaIoLpmBWo6xWRN0pQkFuwknvQkYWMRn+i0TEGLI+gmmu4kwKGwnBk86KV7GMpvCMBlywbUAy0IF+r4qn1sJXRxGT8RyQD2v1ywVYjSG2pcoMN7YDQG7EzmT882DlfpwHrBVQYJgXbXSfn87DkczqYBGwTPIUS5FsBVysPa57vErLnMY5ye3vyEoPHqGLI1BotUR3x1CsZ8/kRkveMwPnNQIHHO4SQD1tz4xKue78tV6+QLa67gdvQp+24c4kIX7bh4V3i+vafrt5/9uLKDnH9BRp3kRQzAJCiAAAAAElFTkSuQmCC",V=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"})),Q="./assets/shop1.81f654af.png",Y=Object.freeze(Object.defineProperty({__proto__:null,default:Q},Symbol.toStringTag,{value:"Module"})),x="./assets/shop2.9d3386e0.png",J=Object.freeze(Object.defineProperty({__proto__:null,default:x},Symbol.toStringTag,{value:"Module"})),N="./assets/shop3.3d83d9de.png",q=Object.freeze(Object.defineProperty({__proto__:null,default:N},Symbol.toStringTag,{value:"Module"})),K="./assets/video1.53604fa1.png",W=Object.freeze(Object.defineProperty({__proto__:null,default:K},Symbol.toStringTag,{value:"Module"})),Z="./assets/video2.ed18546a.png",$=Object.freeze(Object.defineProperty({__proto__:null,default:Z},Symbol.toStringTag,{value:"Module"})),ee="./assets/video3.6849177a.png",te=Object.freeze(Object.defineProperty({__proto__:null,default:ee},Symbol.toStringTag,{value:"Module"})),ae="./assets/vip1.8df41b3e.png",re=Object.freeze(Object.defineProperty({__proto__:null,default:ae},Symbol.toStringTag,{value:"Module"})),se="./assets/vip2.72fa722b.png",oe=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"}));const le=e=>{const a=`./images/${e}`;return{"./images/album1.png":S,"./images/bg1.png":j,"./images/bg2.png":w,"./images/bg3.png":P,"./images/live1.png":U,"./images/live2.png":M,"./images/live3.png":C,"./images/music1.png":D,"./images/music11.png":B,"./images/music2.png":X,"./images/music3.png":k,"./images/recommend.png":V,"./images/shop1.png":Y,"./images/shop2.png":J,"./images/shop3.png":q,"./images/video1.png":W,"./images/video2.png":$,"./images/video3.png":te,"./images/vip1.png":re,"./images/vip2.png":oe}[a].default};var ne=d({name:"share-item",props:{id:{type:String},teacherId:{type:Number},shareUrl:{type:String,default:""},showType:{type:String,default:"default"},shareType:{type:String,default:""}},data(){return{heardUrl:null}},computed:{getString(){return this.shareType==="music"?"\u8FD9\u9996\u66F2\u76EE\u633A\u4E0D\u9519\uFF01\u63A8\u8350\u7ED9\u4F60\uFF5E":this.shareType==="mall"?"\u8FD9\u4EF6\u5546\u54C1\u633A\u4E0D\u9519\uFF01\u63A8\u8350\u7ED9\u4F60\uFF5E":this.shareType==="vip"?"\u5C0F\u9177Ai\u667A\u80FD\u966A\u7EC3VIP\uFF01\u63A8\u8350\u7ED9\u4F60~":this.shareType==="album"?"\u66F4\u591A\u66F2\u76EE\u626B\u7801\u4E0B\u8F7D\u9177\u4E50\u79C0\u67E5\u770B":"\u8FD9\u4E2A\u8BFE\u7A0B\u633A\u4E0D\u9519\uFF01\u63A8\u8350\u7ED9\u4F60\uFF5E"}},mounted(){this.heardUrl=l.user.data.heardUrl+"?t="+ +new Date},render(){return t("div",{id:this.id,class:[r.shareSection,r.shareContainer,r[this.shareType],r[this.showType]]},[t("div",{class:r.shareContent},[this.$slots.default&&this.$slots.default()]),t(f,{center:!0,border:!1,class:[r.shareTeacher,"shareTeacherCustom"]},{icon:()=>t("div",{class:r.teacherImg},[t("img",{src:l.user.data.heardUrl?this.heardUrl:b,class:r.img,style:{objectFit:"cover"},crossorigin:"anonymous"},null),l.platformType=="TEACHER"&&t("img",{class:r.recommend,src:le("recommend.png")},null)]),title:()=>t("div",null,[t("p",{class:r.name},[this.getString]),t("p",{class:r.titleTips},[t("span",null,[l.user.data.username]),l.platformType=="TEACHER"?" \u9177\u4E50\u79C0\u5165\u9A7B\u8001\u5E08":" \u4E3A\u60A8\u63A8\u8350"])])}),t(v,{shareUrl:this.shareUrl},null)])}}),me=d({name:"col-share",props:{type:{type:String,default:"default"},teacherId:{type:Number},shareUrl:{type:String,default:""},shareType:{type:String,default:""},shareLength:{type:Number,default:3}},data(){const e=[];for(let a=0;a<this.shareLength;a++)e.push(a);return console.log(e),{swiperIndex:0,image:null,codeUrl:"",copyCodeUrl:"",shareLoading:!1,shareArray:e||[],saveLoading:!1,showType:["","yellow","pink"]}},async mounted(){try{const e=await p.post("/api-teacher/sysConfig/shortURL",{requestType:"form",data:{orginURL:this.shareUrl}});this.copyCodeUrl=e.data,this.codeUrl=this.shareUrl}catch{}},methods:{async onSaveImg(){if(!this.saveLoading)if(this.saveLoading=!0,this.image)this.saveImg();else{const e=document.getElementById(`share-preview-container${this.swiperIndex}`);g(e,{allowTaint:!0,useCORS:!0,backgroundColor:null}).then(async a=>{const s=a.toDataURL("image/png");this.image=s,this.saveImg()}).catch(()=>{o.clear(),this.saveLoading=!1})}},async saveImg(){var a;o.loading({message:"\u56FE\u7247\u751F\u6210\u4E2D...",forbidClick:!0}),setTimeout(()=>{this.saveLoading=!1},100);const e=await c({api:"savePicture",content:{base64:this.image}});((a=e==null?void 0:e.content)==null?void 0:a.status)==="success"?o.success("\u5DF2\u4FDD\u5B58\u5230\u76F8\u518C"):o.fail("\u4FDD\u5B58\u5931\u8D25")},async shareShow(){if(!this.shareLoading)if(this.shareLoading=!0,this.image)this.openShare();else{const e=document.getElementById(`share-preview-container${this.swiperIndex}`);g(e,{allowTaint:!0,useCORS:!0,backgroundColor:null}).then(async a=>{const s=a.toDataURL("image/png");this.image=s,this.openShare()}).catch(()=>{o.clear(),this.shareLoading=!1})}},openShare(){const e=this.image;setTimeout(()=>{this.shareLoading=!1},100),e&&m({api:"shareAchievements",content:{title:"",desc:"",image:e,video:"",type:"image",button:["copy"],url:this.copyCodeUrl}},a=>{a&&a.content&&o(a.content.message||(a.content.status?"\u5206\u4EAB\u6210\u529F":"\u5206\u4EAB\u5931\u8D25"))})}},render(){return t(i,null,[this.codeUrl&&t(i,null,[t("div",{class:r.shareContainer,id:"share-preview-container"},[t(h,{showIndicators:!0,lazyRender:!0,onChange:e=>{this.swiperIndex=e,this.image=null}},{default:()=>[this.shareArray.map((e,a)=>t(_,null,{default:()=>[t(ne,{id:`share-preview-container${a}`,teacherId:this.teacherId,shareUrl:this.codeUrl,shareType:this.shareType,showType:this.showType[a]},{default:()=>[this.$slots.default&&this.$slots.default()]})]}))],indicator:e=>this.shareArray.length>1&&t("div",{class:r.swipe__indicators},[t("div",{class:r.indicators},[Array.from({length:e.total},(a,s)=>t("div",{class:[r.swipe__indicator,s==e.active&&r["swipe__indicator--active"]]},null))]),t("div",{class:r.total},[n("\u5206\u4EAB\u6A21\u677F "),e.active+1,n("/"),e.total])])})]),t("div",{class:["btnGroup",r.shareGroupBtn,this.type==="tenant"?r.shareGroupTenantBtn:""]},[t(u,{type:"primary",plain:!0,round:!0,loading:this.saveLoading,loadingText:"\u4FDD\u5B58\u4E2D",onClick:this.onSaveImg},{default:()=>[n("\u4FDD\u5B58\u56FE\u7247")]}),t(u,{type:"primary",round:!0,loading:this.shareLoading,loadingText:"\u5206\u4EAB\u4E2D",onClick:()=>{this.shareShow()}},{default:()=>[n("\u7ACB\u5373\u5206\u4EAB")]})])])])}});export{me as C};