提交 97e5ed62 authored 作者: lihuihui's avatar lihuihui

update

上级 43b5bfd4
......@@ -4,7 +4,9 @@
<top-title :title="detailData.name"></top-title>
</div>
<ul class="img-scroll">
<li><img :src="detailData.poster_url" alt=""></li>
<template v-for="(item, index) in JSON.parse(detailData.poster_url)">
<li :key="index"><img :src="item.file_url" alt=""></li>
</template>
</ul>
<div class="content">
<div class="live-state">
......@@ -73,26 +75,33 @@ export default {
methods: {
joinActivity(status) {
if (parseInt(status) === 2) {
let url = this.liveData.code.viewUrl
action.Login.getUserInfo().then((res) => {
if (res.code === 0) {
const user = res.data
url += `&autoLogin=true&viewername=${user.username}&viewertoken=${this.liveData.play_pass}`
window.location.href = url
}
})
console.log(this.liveData)
window.location.href = this.liveData.view_url
// let url = this.liveData.code.viewUrl
// action.Login.getUserInfo().then((res) => {
// if (res.code === 0) {
// const user = res.data
// url += `&autoLogin=true&viewername=${user.username}&viewertoken=${this.liveData.play_pass}`
// window.location.href = url
// }
// })
}
},
getDetail() {
action.List.getLiveDetail(this.$route.query.id).then((res) => {
const id = this.$route.query.id || this.$route.query.activity_id
action.List.getLiveDetail(id).then((res) => {
if (res.code === 0) {
this.detailData = res.data.activity_info
this.liveData = res.data.cc_room_info
this.liveData = res.data.live_info
} else {
this.$router.push({
path: '/index'
})
}
})
},
getDate(timestamp) {
const time = new Date(parseInt(timestamp))
const time = new Date(parseInt(timestamp * 1000))
const year = time.getFullYear()
const month = (time.getMonth() + 1).toString().padStart(2, '0')
const date = (time.getDate()).toString().padStart(2, '0')
......
......@@ -6,7 +6,7 @@
<ul>
<template v-for="(item, index) in listData">
<li :key="index" @click="goDetail(item.id)">
<img :src="item.poster_url" alt="">
<img :src="getImg(item.poster_url)" alt="">
<div class="info">
<div class="card-tit">{{ item.name }}</div>
<div class="state">
......@@ -75,7 +75,7 @@ export default {
})
},
getDate(timestamp) {
const time = new Date(parseInt(timestamp))
const time = new Date(parseInt(timestamp * 1000))
const year = time.getFullYear()
const month = (time.getMonth() + 1).toString().padStart(2, '0')
const date = (time.getDate()).toString().padStart(2, '0')
......@@ -91,6 +91,10 @@ export default {
id: id
}
})
},
getImg(data) {
const img = JSON.parse(data)[0].file_url
return img
}
}
}
......
......@@ -99,20 +99,38 @@ export default {
return false
}
}
const urlParam = {}
if (this.$route.query.activity_id) {
urlParam.activity_id = this.$route.query.activity_id
urlParam.source = this.$route.query.source
this.form.accountLogin2.activity_id = this.$route.query.activity_id
this.form.accountLogin2.source = this.$route.query.source
this.form.accountLogin1.activity_id = this.$route.query.activity_id
this.form.accountLogin1.source = this.$route.query.source
}
console.log(this.$route.query.activity_id)
action.Login.login(this.loginType ? this.form.accountLogin2 : this.form.accountLogin1).then((res) => {
if (res.code === 0) {
this.$router.push({
path: '/index'
path: '/details',
query: urlParam
})
}
Toast(res.msg)
})
},
isLogin() {
action.Login.login({ action: 3 }).then((res) => {
const param = {
action: 3
}
if (this.$route.query.activity_id) {
param.activity_id = this.$route.query.activity_id
param.source = this.$route.query.source
}
action.Login.login(param).then((res) => {
if (res.code === 5004) {
this.$router.push({
path: '/index'
path: '/details'
})
// 跳转
}
......
......@@ -4,7 +4,8 @@ export default [
/* 如果所有页面都没找到 - 指向 */
{ path: '*', component: () => import('@/components/errorPages/404.vue') },
/* 登录页面 */
{ path: '/login',
{
path: '/login',
name: 'login',
component: () => import('../pages/login/index.vue')
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论