1 |
- import{g as e,s,a as t,b as o,h as l,c as a,r as i,n,d as c,e as r,w as d,i as u,o as f,f as h,j as p,t as g,k as m,l as _}from"./index-0tw8ZWev.js";import{g as v,l as w,r as T,_ as C,a as b}from"./home.228U5_5X.js";import{_ as k}from"./_plugin-vue_export-helper.BCo6x5W8.js";const x=()=>"micromessenger"===String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i));const L=k({data:()=>({code:"",livedata:{},path:"http://live.ylrzcloud.com/prod-api",iskefu:!1,isLongPress:!1,timeout:null,liveId:2}),onLoad(){this.code?this.loginByMp():this.getWechatCode()},onShow(){e("AppToken")&&this.getliving()},methods:{open(){},close(){this.iskefu=!this.iskefu},longPress(){this.timeout=setTimeout((()=>{this.isLongPress=!0,s({filePath:this.livedata.qwQrCode,success:()=>{t({title:"保存成功"})},fail:()=>{t({title:"保存失败",icon:"none"})}})}),500)},cancelLongPress(){clearTimeout(this.timeout),this.isLongPress=!1},getliving(){const e={id:this.liveId};v(e).then((e=>{200==e.code?this.livedata=e.data:t({title:e.msg,icon:"none",duration:2e3})}))},getWechatCode(){if(x){let e="wx93ce67750e3cfba3",s=this.getUrlCode().code,t=window.location.href.split("#")[0];null==s||""===s?window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+e+"&redirect_uri="+encodeURIComponent(t)+"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect":(this.code=s,this.loginByMp())}},loginByMp(){if(null!=this.code){o({title:"处理中..."});var s={code:this.code};w(s).then((s=>{if(l(),200==s.code){console.log(s),a("AppToken",s.token),a("userInfo",JSON.stringify(s.user));let o=e("beforLoginPage");i({url:o}),t({title:"登录成功",icon:"none"}),this.getliving()}else t({title:s.msg,icon:"none"})}),(e=>{}))}},getUrlCode(){var e=location.search,s=new Object;if(-1!=e.indexOf("?"))for(var t=e.substr(1).split("&"),o=0;o<t.length;o++)s[t[o].split("=")[0]]=t[o].split("=")[1];return s},comelive(){e("AppToken")?n({url:"/pages/home/live"}):t({title:"请登录授权!",icon:"none"})}}},[["render",function(e,s,t,o,l,a){const i=m,n=u,v=_,w=T(c("u-icon"),C),k=T(c("u-popup"),b);return f(),r(n,{class:"home column"},{default:d((()=>[h(n,{class:"justify-start align-center"},{default:d((()=>[h(i,{src:"/assets/shipin-DiK3gseC.png",class:"wh50 p20"}),h(n,{class:"fs32 bold"},{default:d((()=>[p("道中")])),_:1})])),_:1}),h(i,{src:l.livedata.liveImgUrl,mode:"widthFix",class:"w100"},null,8,["src"]),h(n,{class:"p20"},{default:d((()=>[h(n,{class:"column"},{default:d((()=>[h(v,{class:"fs32"},{default:d((()=>[p(g(l.livedata.liveName),1)])),_:1}),h(v,{class:"color9 fs24 mt20"},{default:d((()=>[p(" 直播时间 "+g(l.livedata.startTime)+" —— "+g(l.livedata.finishTime),1)])),_:1})])),_:1})])),_:1}),h(n,{class:"p20 detail"},{default:d((()=>[h(n,{class:"jianjie mb20"},{default:d((()=>[p("简介")])),_:1}),h(n,{class:"fs24 lh36",innerHTML:l.livedata.liveDesc},null,8,["innerHTML"])])),_:1}),h(n,{class:"p12 bgf bot-box"},{default:d((()=>[h(n,{class:"center",onClick:a.comelive},{default:d((()=>[p("进入直播")])),_:1},8,["onClick"])])),_:1}),h(k,{show:l.iskefu,onClose:a.close,onOpen:a.open,round:"20rpx",bgColor:"#fffee1"},{default:d((()=>[h(n,{class:"addchat p20"},{default:d((()=>[h(n,{class:"u-flex-row-reverse u-flex"},{default:d((()=>[h(w,{name:"close",size:"18",onClick:s[0]||(s[0]=s=>e.showadd=!e.showadd)})])),_:1}),h(n,{class:"column align-center"},{default:d((()=>[h(n,{class:"fs36",style:{color:"#ff5c03"}},{default:d((()=>[p("扫码添加助教老师")])),_:1}),h(n,{class:"fs28 color6"},{default:d((()=>[p("扫码添加助教老师")])),_:1}),h(n,{class:"p10 mt40",style:{border:"#ff5c03 solid 2rpx"}},{default:d((()=>[h(i,{src:e.codeimg,class:"wh180",onTouchstart:a.longPress,onTouchend:a.cancelLongPress},null,8,["src","onTouchstart","onTouchend"])])),_:1}),h(n,{class:"color6 mt20"},{default:d((()=>[p("长按识别二维码")])),_:1})])),_:1})])),_:1})])),_:1},8,["show","onClose","onOpen"])])),_:1})}],["__scopeId","data-v-0a72e3e7"]]);export{L as default};
|