xbx #119
@ -25,8 +25,11 @@ export default defineComponent({
|
||||
store.commit("login", true)
|
||||
store.dispatch("setUserInfo");
|
||||
}else{
|
||||
|
||||
console.log('ip')
|
||||
store.dispatch("getip");
|
||||
store.commit('setWlan')
|
||||
len.locale.value = !getValue("Lanvuage") ? 'zh' : getValue("Lanvuage");
|
||||
router.push("/")
|
||||
}
|
||||
const zh = zhCN
|
||||
|
@ -1,7 +1,7 @@
|
||||
import router from '@/router';
|
||||
import store from '@/store';
|
||||
import { LiveList, LivelistInfo, LoginData, UserInfo } from '@/types';
|
||||
import { saveValue } from '@/utils/common';
|
||||
import { getValue, saveValue } from '@/utils/common';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { del, get, post, put, setToken } from './base'
|
||||
|
||||
@ -32,7 +32,8 @@ export async function loginpass(phone: string, password: string,type?: number,sm
|
||||
setToken();
|
||||
store.commit("login", true);
|
||||
store.dispatch("setUserInfo");
|
||||
router.push("/mine/archives")
|
||||
await router.push("/mine/archives")
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -44,7 +45,9 @@ export async function userinfo(){
|
||||
const user = await get<UserInfo>('personalInfo');
|
||||
// console.log(user.data.img)
|
||||
if(user.code == 1001){
|
||||
saveValue("token","")
|
||||
router.push("/")
|
||||
|
||||
return '未登录';
|
||||
}
|
||||
return user.data;
|
||||
@ -636,9 +639,9 @@ export async function editsystemsetting(e?: any): Promise<boolean> {
|
||||
const res = await put(`member/${store.state.userinfo.memberid}`,newdata);
|
||||
console.log(res)
|
||||
if(res.code == 0){
|
||||
location.reload();
|
||||
message.success("修改成功")
|
||||
store.dispatch("setUserInfo");
|
||||
location.reload();
|
||||
return true;
|
||||
}else{
|
||||
message.error(res.msg);
|
||||
@ -792,6 +795,7 @@ interface LiveInfo {
|
||||
deleted_at: null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
livestatus: number;
|
||||
}
|
||||
|
||||
interface StudentList {
|
||||
@ -943,12 +947,14 @@ export async function liveinfo(id: number): Promise<any>{
|
||||
dateline: liveinfo.dateline,
|
||||
livetime: liveinfo.livetime,
|
||||
livenumber: liveinfo.livenumber,
|
||||
desc: liveinfo.desc
|
||||
desc: liveinfo.desc,
|
||||
status: liveinfo.status
|
||||
}
|
||||
}
|
||||
|
||||
export async function setlive(data: any){
|
||||
data.status = data.livestatus;
|
||||
// data.status = data.livestatus;
|
||||
console.log(data)
|
||||
const info = await put("live/" + data.id, data)
|
||||
console.log(info.data)
|
||||
if(info.code==0){
|
||||
@ -1008,11 +1014,21 @@ export async function luzhi(roomid: string){
|
||||
export async function getaddr() {
|
||||
const res = await get<any>('ip');
|
||||
const gj = res.data.address.split("|")[0];
|
||||
if(gj == "CN"){
|
||||
return ["zh", "中文", '人民币¥'];
|
||||
}else {
|
||||
return ['en', 'English', '美元$']
|
||||
const lan = getValue("Lanvuage");
|
||||
if(lan != null && lan){
|
||||
if(gj == "CN"){
|
||||
return ['人民币¥'];
|
||||
}else {
|
||||
return [ '美元$']
|
||||
}
|
||||
}else{
|
||||
if(gj == "CN"){
|
||||
return ["zh", "中文", '人民币¥'];
|
||||
}else {
|
||||
return ['en', 'English', '美元$']
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// export async function StopMCUMixTranscode(roomid: number) {
|
||||
|
@ -209,6 +209,7 @@ import { useRoute } from 'vue-router';
|
||||
import axios from 'axios'
|
||||
import { useI18n } from '@/utils/i18n';
|
||||
import { setLanvuage } from '@/api/base';
|
||||
import { saveValue } from '@/utils/common';
|
||||
|
||||
export default defineComponent({
|
||||
props:{
|
||||
@ -306,7 +307,7 @@ export default defineComponent({
|
||||
languagelist.value=await getlanguages()
|
||||
console.log(routes.path)
|
||||
nowroute.value=routes.path
|
||||
lan.locale.value = userinfo.value.languageValue
|
||||
// lan.locale.value = userinfo.value.languageValue
|
||||
})
|
||||
|
||||
function zonechange(e?: any){
|
||||
@ -322,7 +323,9 @@ export default defineComponent({
|
||||
if(store.state.islogin){
|
||||
editsystemsetting({language:e})
|
||||
}else {
|
||||
setLanvuage(e)
|
||||
saveValue("Lanvuage", e)
|
||||
location.reload();
|
||||
// setLanvuage(e)
|
||||
}
|
||||
lan.locale.value = e
|
||||
|
||||
|
@ -23,14 +23,20 @@
|
||||
<span>{{lan.$t('zhuangtai')}}</span>
|
||||
<span class="status">{{lan.$t('shenheing')}}</span>
|
||||
</div>
|
||||
<!-- <div class="item item1" v-if="status==1">
|
||||
<span>{{lan.$t('zhuangtai')}}</span>
|
||||
<span class="status1">{{lan.$t('shenheing')}}</span>
|
||||
|
||||
</div> -->
|
||||
<div class="item item1" v-if="status==2">
|
||||
<span>{{lan.$t('zhuangtai')}}</span>
|
||||
<span class="status1">{{lan.$t('shenheweitongguo')}}</span>
|
||||
<span class="status1" style="color: #D12C2E">{{lan.$t('shenheweitongguo')}}</span>
|
||||
</div>
|
||||
<div class="item item1" v-if="status==1">
|
||||
<span style="flex-shrink:0">{{lan.$t('yuanyin')}}</span>
|
||||
<span class="status"> {{lan.$t('yuanyintext')}} </span>
|
||||
</div>
|
||||
<div class="item item1" v-if="status==2">
|
||||
<span style="flex-shrink:0">{{lan.$t('yuanyin')}}</span>
|
||||
<span> {{lan.$t('yuanyintext')}} </span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="button">
|
||||
<div class="modify" @click="update(videoid)">{{lan.$t('xiugaishipin')}}</div>
|
||||
|
@ -2,6 +2,7 @@ import { getValue } from '@/utils/common';
|
||||
import axios from 'axios'
|
||||
axios.defaults.baseURL = 'https://case.sy-my.net/beelink/public/home/';
|
||||
axios.defaults.headers.common['Authorization'] = "Bearer " + getValue("token");
|
||||
axios.defaults.headers.common['Language'] = !getValue("Lanvuage") ? 'zh' : getValue("Lanvuage");
|
||||
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||
|
||||
export default axios
|
@ -10,10 +10,10 @@ getset().then((res: any)=>{
|
||||
en.shichangtishi = `Minimum ${res.lowerLimit} person, maximum ${res.numberCeiling} people`
|
||||
zh.tixianzhu = `注:每笔提现收取${res.sxf}服务费,最低${ res.symbol + res.minmoney }`
|
||||
en.tixianzhu = `Note: ${res.sxf} service fee will be charged for each withdrawal, with a minimum of ${ res.symbol + res.minmoney }`
|
||||
const i18n = geti18n();
|
||||
const loc = i18n.locale.value;
|
||||
i18n.locale.value = '';
|
||||
i18n.locale.value = loc;
|
||||
// const i18n = geti18n();
|
||||
// const loc = i18n.locale.value;
|
||||
// i18n.locale.value = '';
|
||||
// i18n.locale.value = loc;
|
||||
console.log('i18n')
|
||||
|
||||
})
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { getaddr, userinfo } from '@/api';
|
||||
import { setLanvuage } from '@/api/base';
|
||||
import { getValue, saveValue } from '@/utils/common';
|
||||
import { isProxy } from 'vue';
|
||||
import { createStore } from 'vuex'
|
||||
|
||||
@ -63,10 +65,32 @@ export default createStore({
|
||||
setLanguage(state, data){
|
||||
const split = new Date().toString().split(" ");
|
||||
const timeZoneFormatted = split[split.length - 2] + " " + split[split.length - 1];
|
||||
state.userinfo.language = data[1] // English 中文
|
||||
state.userinfo.languageValue = data[0] // 'en' 'zh'
|
||||
state.userinfo.zoneStr = timeZoneFormatted;
|
||||
state.userinfo.currency = data[2];
|
||||
const lan = getValue("Lanvuage");
|
||||
if(lan != null && lan){
|
||||
// state.userinfo.language = data[1] // English 中文
|
||||
// state.userinfo.languageValue = data[0] // 'en' 'zh'
|
||||
state.userinfo.zoneStr = timeZoneFormatted;
|
||||
state.userinfo.currency = data[0];
|
||||
}else{
|
||||
console.log(data, 111)
|
||||
state.userinfo.language = data[1] // English 中文
|
||||
state.userinfo.languageValue = data[0] // 'en' 'zh'
|
||||
state.userinfo.zoneStr = timeZoneFormatted;
|
||||
state.userinfo.currency = data[2];
|
||||
saveValue("Lanvuage", data[0]);
|
||||
if( data[0] != 'zh'){
|
||||
location.reload()
|
||||
}
|
||||
// setLanvuage(data[0]);
|
||||
}
|
||||
|
||||
},
|
||||
setWlan(state){
|
||||
const lan = getValue("Lanvuage");
|
||||
if(lan != null && lan){
|
||||
state.userinfo.languageValue = !getValue("Lanvuage") ? 'zh' : getValue("Lanvuage");
|
||||
state.userinfo.language = (!getValue("Lanvuage") ? 'zh' : getValue("Lanvuage")) == 'zh' ? '中文' : 'English';
|
||||
}
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
@ -224,12 +224,13 @@ export default defineComponent({
|
||||
|
||||
function sublogin(){
|
||||
console.log(11)
|
||||
// else if(!(/^1[3-9]\d{9}$/.test(phone.value))){
|
||||
// message.error(lan.$t('shoujihaoyouwu'));
|
||||
// return
|
||||
// }
|
||||
if(phone.value==''){
|
||||
message.error(lan.$t('shoujihaoweikong'))
|
||||
return
|
||||
}else if(!(/^1[3-9]\d{9}$/.test(phone.value))){
|
||||
message.error(lan.$t('shoujihaoyouwu'));
|
||||
return
|
||||
} else if(code.value==""){
|
||||
// console.log(phone.value)
|
||||
console.log((/^1[3-9]\d{9}$/.test(phone.value)))
|
||||
|
@ -551,9 +551,7 @@ export default defineComponent({
|
||||
watch(userinfo, () => {
|
||||
formData.value = toRaw(userinfo.value);
|
||||
// console.log(lan.$s(), formData.value.languageValue)
|
||||
if(lan.$s() != formData.value.languageValue){
|
||||
location.reload();
|
||||
}
|
||||
|
||||
console.log(userinfo.value.currencyValue, "listsssss");
|
||||
currencyindex.value = userinfo.value.currency;
|
||||
console.log(currencyindex.value, "listsssss");
|
||||
@ -885,7 +883,10 @@ export default defineComponent({
|
||||
// console.log(zonelist.value[i].city + zonelist.value[i].gmt, uesrinfo.zoneStr)
|
||||
}
|
||||
if (reg.test(userinfo.value.email)) {
|
||||
putmember(uesrinfo);
|
||||
await putmember(uesrinfo);
|
||||
if(lan.$s() != uesrinfo.languageValue){
|
||||
location.reload();
|
||||
}
|
||||
} else {
|
||||
message.error(lan.$t('youxiangcuowu'));
|
||||
}
|
||||
|
@ -13,27 +13,19 @@
|
||||
<div class="LivePlaying">
|
||||
<LivePlaying></LivePlaying>
|
||||
<div class="comment">
|
||||
<div class="commentitem">
|
||||
<span>13:32:30</span>
|
||||
<span class="name"> Andy : </span>
|
||||
<span> 老师,这个部分可以讲的慢一些吗? </span>
|
||||
</div>
|
||||
<div class="commentitem">
|
||||
<span>13:32:30</span>
|
||||
<span class="name"> Andy : </span>
|
||||
<span> 老师,这个部分可以讲的慢一些吗? </span>
|
||||
</div>
|
||||
<div class="commentitem">
|
||||
<span>13:32:30</span>
|
||||
<span class="name"> Andy : </span>
|
||||
<span> 老师,这个部分可以讲的慢一些吗? </span>
|
||||
</div>
|
||||
<div class="commentitem" v-for="(item,index) in imlist" :key="index">
|
||||
<span>{{item.time}}</span>
|
||||
<span class="name"> {{item.name}} : </span>
|
||||
<span> {{item.text}} </span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="others">
|
||||
<div :id="'s-' + item.memberid" class="othersitem" v-for="(item, index) in roominfo.studentlist" :key="index">
|
||||
<div class="othersitem" v-for="(item, index) in roominfo.studentlist" :key="index">
|
||||
<div class="watcher"></div>
|
||||
<div class="name">{{item.name}}</div>
|
||||
<div class="sbox" :id="'s-' + item.memberid"></div>
|
||||
<!-- <img src="" alt="" /> -->
|
||||
</div>
|
||||
<!-- <div class="othersitem">
|
||||
@ -104,7 +96,7 @@
|
||||
margin-top: 29px;
|
||||
padding: 30px;
|
||||
font-size: 12px;
|
||||
|
||||
overflow-y: auto;
|
||||
color: #121212;
|
||||
|
||||
.commentitem {
|
||||
@ -185,6 +177,10 @@
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
}
|
||||
.sbox{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -200,6 +196,7 @@ import store from '@/store';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { useI18n } from '@/utils/i18n';
|
||||
import TIM from 'tim-js-sdk';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@ -310,7 +307,7 @@ export default defineComponent({
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const imlist = ref<any>([])
|
||||
async function init(fun: any, userSig: string): Promise<void>{
|
||||
console.log(userSig)
|
||||
const el = document.querySelector("#local_stream");
|
||||
@ -329,18 +326,47 @@ export default defineComponent({
|
||||
userId: store.state.userinfo.memberid,
|
||||
userSig: userSig
|
||||
});
|
||||
// 监听远端开启推流
|
||||
client.on('stream-added', (event: { stream: any }) => {
|
||||
const remoteStream = event.stream;
|
||||
console.log('远端流增加: ' + remoteStream.getId());
|
||||
//订阅远端流
|
||||
client.subscribe(remoteStream);
|
||||
});
|
||||
// 远端流初始化成功 本地播放
|
||||
client.on('stream-subscribed', (event: { stream: any }) => {
|
||||
const remoteStream = event.stream;
|
||||
console.log(remoteStream);
|
||||
// 播放远端流
|
||||
const el = document.querySelector('#s-' + remoteStream.userId_);
|
||||
if(el){
|
||||
el.innerHTML = ""
|
||||
}
|
||||
remoteStream.play('s-' + remoteStream.userId_);
|
||||
});
|
||||
// 远端关闭麦克风
|
||||
client.on('mute-audio', (event: any) => {
|
||||
const userId = event.userId;
|
||||
console.log(userId, '远端关闭麦克风')
|
||||
});
|
||||
// 远端关闭摄像头
|
||||
client.on('mute-video', (event: any) => {
|
||||
const userId = event.userId;
|
||||
console.log(userId, '远端关闭摄像头')
|
||||
|
||||
});
|
||||
// 远端打开麦克风
|
||||
client.on('unmute-audio', (event: any) => {
|
||||
const userId = event.userId;
|
||||
console.log(userId, '远端打开麦克风')
|
||||
|
||||
});
|
||||
// 远端打开摄像头
|
||||
client.on('unmute-video', (event: any) => {
|
||||
const userId = event.userId;
|
||||
console.log(userId, '远端打开摄像头')
|
||||
|
||||
});
|
||||
client
|
||||
.join({ roomId: roominfo.value.roomid})
|
||||
.catch((error: string) => {
|
||||
@ -356,7 +382,7 @@ export default defineComponent({
|
||||
|
||||
// im 初始化
|
||||
tim = TIM.create({
|
||||
SDKAppID: 1400400340
|
||||
SDKAppID: 1400435767
|
||||
}); // SDK 实例通常用 tim 表示
|
||||
tim.setLogLevel(0);
|
||||
tim.on(TIM.EVENT.MESSAGE_RECEIVED, function(event: any) {
|
||||
@ -365,6 +391,19 @@ export default defineComponent({
|
||||
// event.data - 存储 Message 对象的数组 - [Message]
|
||||
for(const i in event.data){
|
||||
console.log(event.data[i])
|
||||
const now = dayjs(event.data[i].time)
|
||||
if(!event.data[i].payload.text){
|
||||
break;
|
||||
}
|
||||
imlist.value.push({
|
||||
name: event.data[i].nick,
|
||||
text: event.data[i].payload.text,
|
||||
time: `${now.hour()}:${now.minute()}:${now.second()}`
|
||||
})
|
||||
const div = document.querySelector(".comment")
|
||||
if(div){
|
||||
div.scrollTop = div.scrollHeight
|
||||
}
|
||||
}
|
||||
});
|
||||
tim.on(TIM.EVENT.GROUP_LIST_UPDATED, function(event: any) {
|
||||
@ -529,7 +568,8 @@ export default defineComponent({
|
||||
guanbi,
|
||||
visible,
|
||||
lan,
|
||||
sendtext
|
||||
sendtext,
|
||||
imlist
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -49,7 +49,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="!teacherlikedlist.total">
|
||||
<template v-if="!teacherlikedlist.length">
|
||||
<a-empty />
|
||||
</template>
|
||||
</div>
|
||||
|
@ -28,10 +28,10 @@
|
||||
<div class="row" v-for="(item,index) in month.date" :key="index">
|
||||
<div v-for="(i,j) in item" :key="j">
|
||||
<div class="day">
|
||||
<div :class="{ing: yue == 0 && month.day == i.day,old: (yue < 0 || (yue == 0 && month.day > i.day)) && i.list.length != 0 ,next: (yue > 0 || (yue == 0 && month.day < i.day)) && i.list.length != 0 }" @click="navto(i.time)">
|
||||
<div :class="{ing:i.s == 1, old: i.s == 2 ,next: i.s == 0 }" @click="navto(i.time)">
|
||||
{{i.day}}
|
||||
<div class="item" v-for="(i,j) in i.list" :key="j">
|
||||
<div></div><p>{{i}}</p>
|
||||
<div class="item" @click.stop="gotolive(i.id, i.statit)" v-for="(i,j) in i.list" :key="j">
|
||||
<div></div><p>{{i.title}}</p>
|
||||
</div>
|
||||
<!-- <span class="ing"></span> -->
|
||||
<!-- <span class="next"></span> -->
|
||||
@ -218,7 +218,12 @@ export default defineComponent({
|
||||
if(month.value.date[j][k].list == undefined){
|
||||
month.value.date[j][k].list = [];
|
||||
}
|
||||
month.value.date[j][k].list.push(res[i].title);
|
||||
if(!month.value.date[j][k].s){
|
||||
month.value.date[j][k].s = res[i].livestatus
|
||||
}else if(month.value.date[j][k].s != 1){
|
||||
res[i].livestatus == 0 && month.value.date[j][k].s == 2 ? month.value.date[j][k].s = 0 : month.value.date[j][k].s = 2
|
||||
}
|
||||
month.value.date[j][k].list.push({title: res[i].title, id: res[i].liveid, statit: res[i].livestatus});
|
||||
console.log(day)
|
||||
}
|
||||
}
|
||||
@ -245,13 +250,25 @@ export default defineComponent({
|
||||
function navto(date: string){
|
||||
router.push("/regime/week?time=" + (!date? '' : date) )
|
||||
}
|
||||
function gotolive(id: string, s: number){
|
||||
let url = '';
|
||||
switch (s) {
|
||||
case 1:
|
||||
url = '/regime/liveing';
|
||||
break;
|
||||
default:
|
||||
url = '/regime/livedetail';
|
||||
}
|
||||
router.push({path: url,query: { id: id }})
|
||||
}
|
||||
getdates(userid.value);
|
||||
return {
|
||||
month,
|
||||
xia,
|
||||
shang,
|
||||
yue,
|
||||
navto
|
||||
navto,
|
||||
gotolive
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user