修正完了error

This commit is contained in:
2020-10-22 11:04:04 +08:00
parent 854ce7191c
commit ff85285fb4
22 changed files with 303 additions and 295 deletions

View File

@@ -190,6 +190,11 @@ export default defineComponent({
onMounted(async () => {
livelist.value = await getlivelist();
});
async function tab(){
input.value = '';
livelist.value = await getlivelist({ status: tabindex.value});
}
function tabchange(e: number): void {
tabindex.value = e;
livelist.value = {data:[], code: 0, msg: "",total: 0};
@@ -199,11 +204,7 @@ export default defineComponent({
console.log(input.value);
livelist.value = await getlivelist({title: input.value});
}
async function tab(){
input.value = '';
livelist.value = await getlivelist({ status: tabindex.value});
}
return {
page,
tabindex,

View File

@@ -45,7 +45,7 @@ export default defineComponent({
setup() {
console.log(useRoute().query.id);
const id = useRoute().query.id;
let liveinfo = ref<any>({})
const liveinfo = ref<any>({})
if (typeof id == "string") {
getliveinfo(parseInt(id)).then((res) => {
liveinfo.value = res;

View File

@@ -204,52 +204,7 @@ export default defineComponent({
let localStream: any;
let statie = true;
let userSing = '';
onMounted(async ()=>{
userSing = await usersig(10);
init(pingmu, userSing);
})
function fenxiang(){
console.log(localStream)
// client.unpublish(localStream).then(() => {
// // 关闭屏幕分享流
// console.log("关闭")
// client.leave().then(() => {
// // leaving room success
// console.log("关闭成功")
// }).catch((error: string) => {
// console.error('leaving room failed: ' + error);
// });
// });
init(statie ? shexiang : pingmu, userSing);
statie = !statie;
}
function init(fun: any, userSig: string){
console.log(userSig)
const el = document.querySelector("#local_stream");
if(el){
el.innerHTML = ""
}
client = TRTC.createClient({
mode: 'rtc',
sdkAppId: '1400400340',
userId: 10,
userSig: userSig
});
client
.join({ roomId: 11 })
.catch((error: string) => {
console.error('进房失败 ' + error);
})
.then(() => {
console.log('进房成功');
fun()
});
}
function pingmu(){
function pingmu(){
localStream = TRTC.createStream({ userid: 10, audio: true, screen: true });
localStream
@@ -290,6 +245,53 @@ export default defineComponent({
});
});
}
function init(fun: any, userSig: string){
console.log(userSig)
const el = document.querySelector("#local_stream");
if(el){
el.innerHTML = ""
}
client = TRTC.createClient({
mode: 'rtc',
sdkAppId: '1400400340',
userId: 10,
userSig: userSig
});
client
.join({ roomId: 11 })
.catch((error: string) => {
console.error('进房失败 ' + error);
})
.then(() => {
console.log('进房成功');
fun()
});
}
function fenxiang(){
console.log(localStream)
// client.unpublish(localStream).then(() => {
// // 关闭屏幕分享流
// console.log("关闭")
// client.leave().then(() => {
// // leaving room success
// console.log("关闭成功")
// }).catch((error: string) => {
// console.error('leaving room failed: ' + error);
// });
// });
init(statie ? shexiang : pingmu, userSing);
statie = !statie;
}
onMounted(async ()=>{
userSing = await usersig(10);
init(pingmu, userSing);
})
return{
fenxiang
}

View File

@@ -182,7 +182,7 @@ export default defineComponent({
onMounted(async () => {
teacherlikedlist.value=await getteacherliked()
});
async function search(e:any){
async function search(e: any){
teacherlikedlist.value=await getteacherliked(e)
}
async function pagechange(){

View File

@@ -202,30 +202,17 @@ export default defineComponent({
console.log(date)
const month: any = ref(date);
const yue = ref(0);
function xia(){
yue.value = yue.value + 1;
month.value = getdate(yue.value)
getdates(userid.value)
}
const userid = computed(() => {
return store.state.userinfo.memberid;
})
watch(userid, ()=> {
getdates(userid.value);
})
function shang(){
yue.value = yue.value - 1;
month.value = getdate(yue.value)
getdates(userid.value)
}
async function getdates(userid: number){
getdatelist(month.value.start, month.value.end, userid).then((res: any)=>{
console.log(res)
for(let i in res){
for(const i in res){
const day = getDay(res[i].dateline)
for(let j in month.value.date){
for(let k in month.value.date[j]){
for(const j in month.value.date){
for(const k in month.value.date[j]){
if(month.value.date[j][k].day == day){
if(month.value.date[j][k].list == undefined){
month.value.date[j][k].list = [];
@@ -239,6 +226,21 @@ export default defineComponent({
console.log(month.value.date)
})
}
function xia(){
yue.value = yue.value + 1;
month.value = getdate(yue.value)
getdates(userid.value)
}
watch(userid, ()=> {
getdates(userid.value);
})
function shang(){
yue.value = yue.value - 1;
month.value = getdate(yue.value)
getdates(userid.value)
}
function navto(){
router.push("/regime/week")
}

View File

@@ -219,14 +219,13 @@ export default defineComponent({
const week = ref<any>(getweek());
const userid = store.state.userinfo.memberid;
console.log(week.value);
getdates(userid);
function getdates(userid: number){
getdatelist(week.value.start, week.value.end, userid).then((res: any)=>{
console.log(res)
for(let i in res){
for(const i in res){
const day = getDay(res[i].dateline)
console.log(day)
for(let j in week.value.date){
for(const j in week.value.date){
console.log(getDay(week.value.date[j].day))
if(day == getDay(week.value.date[j].day)){
console.log("fuzhi")
@@ -240,6 +239,9 @@ export default defineComponent({
console.log(week.value)
})
}
getdates(userid);
watch(zhou, (value) => {
week.value = getweek(value);
console.log(week.value);