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

update

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