Commit 9486a08b authored by mengqr's avatar mengqr

列表页面修改

parent 0920ef4f
......@@ -41,6 +41,9 @@ live: {
liveDetail:function(data){
return service.post('/app/live/liveDetail', data)
},
tourist:function(data){
return service.post('/auth/tourist', data)
},
videoList:function(data){
return service.post('/app/live/getLiveRepeatList', data)
},
......@@ -50,6 +53,9 @@ live: {
getLive:function(data){
return service.post('/app/live/liveList', data)
},
getLiveRecommendList:function(data){
return service.post('app/live/liveRecommendList', data)
},
payinfo:function(data){
return service.post('/oapi/v1/h5/pay/payInfo', data)
},
......
......@@ -63,9 +63,9 @@ service.interceptors.request.use(config => {
console.log("撒地方",token)
// 没有token跳转登录页
if (!token) {
Vue.prototype.router.push({
path: '/login'
});
// Vue.prototype.router.push({
// path: '/login'
// });
}
// 设置请求头token
config.headers['Authorization'] = "Bearer " + token;
......@@ -92,11 +92,11 @@ service.interceptors.response.use(
// type: 'error',
// message: res.data.message
// });
alert(res.data.message)
// alert(res.data.message)
// token有误跳转登录页
Vue.prototype.router.push({
path: '/login'
});
// Vue.prototype.router.push({
// path: '/login'
// });
return Promise.reject(res.data.message);
} else if (res.data.code == 501) { // token过期
console.log(res.data.message)
......
......@@ -80,63 +80,12 @@ const router = new Router({
component: fullScreen,
},
// {
// path: '/bullet',
// name: 'bullet',
// component: bullet,
// },
{
path: '/list',
name: 'list',
component: list,
// {
// path: '/login',
// name: 'login',
// component: login
// },
// //月报
// {
// path: '/douniu/statistical/MonthlyReport',
// name: 'monthlyReport',
// component: monthlyReport,
// meta: {
// requireAuth: true
// }
// },
// //人员管理
// {
// path: '/powerManage',
// name: 'personnelManagement',
// component: personnelManagement,
// meta: {
// requireAuth: true
// }
// },
// //用户提成
// {
// path: '/roleManage',
// name: 'commission',
// component: commission,
// meta: {
// requireAuth: true
// }
// },
// //用户提成详情
// {
// path: '/departmentManage',
// name: 'commissionDetail',
// component: commissionDetail,
// meta: {
// requireAuth: true
// }
// },
// //用户提成个人详情
// {
// path: '/program',
// name: 'commissionPersonalDetail',
// component: commissionPersonalDetail,
// meta: {
// requireAuth: true
// }
// },
},
]
})
......
<template>
<div>
直播列表页
<div class="head">
<span>斗牛财经</span>
<img v-if="ifLog==0" class="portait-not" src="../common/img/not-logged.png" alt="">
<img v-if="ifLog==1" class="portait-not" src="../common/img/title_logo.png" alt="">
<img v-if="ifLog==2" class="portait-not" :src="userImg" alt="">
</div>
<div class="tab">
<span :class="{free:ifFree,nonefree:!ifFree}" @click="clickFree()">免费</span>
<span :class="{member:!ifFree,nonemember:ifFree}" @click="clickVIP()">VIP</span>
</div>
<div class="content">
<div v-if="ifFree" v-for="i in freeList" :key="i.lvrId" class="moudle" >
<img class="recommed-img" v-if="i.ifrecom" src="../common/img/recommend.png" alt="">
<img class="head-img" src="../common/img/wechact.png" alt="">
<span class="head-name">{{i.udNickname}}</span>
<img class="count-img" src="https://customer-img.douniu8.com/1665380604617GPdvMCWnMN.jpg" alt="">
<img class="liv-img" v-if="i.lvrStatus==1" src="../common/img/living.png" alt="">
<span class="title-message">{{i.lvrName}}</span>
<img class="people-img" src="../common/img/people-num.png" alt="">
<span class="people-num">{{i.hotNum}}</span>
</div>
<div v-if="!ifFree" v-for="i in vipList" :key="i.lvrId" class="moudle">
<img class="recommed-img" v-if="i.ifrecom" src="../common/img/recommend.png" alt="">
<img class="head-img" src="../common/img/wechact.png" alt="">
<span class="head-name">{{i.udNickname}}</span>
<img class="count-img" src="https://customer-img.douniu8.com/1665380604617GPdvMCWnMN.jpg" alt="">
<!-- <img class="liv-img" v-if="ifFree" src="../common/img/living.png" alt=""> -->
<span class="title-message">{{i.lvrName}}</span>
<img class="people-img" src="../common/img/people-num.png" alt="">
<span class="people-num">{{i.hotNum}}</span>
<div v-if="!ifFree" class="vip-background">
</div>
<img v-if="!ifFree" class="vip-img" src="../common/img/VIP.png" alt="">
</div>
</div>
</div>
</template>
......@@ -10,20 +46,285 @@ export default {
data() {
return {
ifFree:true,
timestamp:Date.parse(new Date())/1000,
freeList:[],
ifLog:0,
userImg:'',
vipList:[]
};
},
mounted() {
this.getRecommendList()
this.getList()
this.getState()
},
methods: {
clickFree(){
this.ifFree=true
},
clickVIP(){
this.ifFree=false
},
getRecommendList(){
let temp=this.qs.stringify({
pmAppVersion:'884',
pmModel:'iPhone 12/13 (Pro)',
pmSystem:'iOS 10.0.1',
pmMac:1,
pmIp:1,
pmOperator:'无运营商',
applicationType:4,
})
this.server.live.getLiveRecommendList(temp).then(res=>{
let list=res.data.data.appSingleLiveResponseVOList
list.forEach(i => {
i.ifrecom=true
if(i.lvrIsFree==0){
this.freeList.push(i)
}else{
this.vipList.push(i)
}
});
console.log('列表信息',list)
console.log('vip列表',this.vipList)
console.log('免费列表',this.freeList)
})
},
getList(){
let temp=this.qs.stringify({
pmAppVersion:'884',
pmModel:'iPhone 12/13 (Pro)',
pmSystem:'iOS 10.0.1',
pmMac:1,
pmIp:1,
pmOperator:'无运营商',
applicationType:4,
})
this.server.live.getLive(temp).then(res=>{
// this.url=res.data.data.lvpPullUrl
if(res.data.data.businessCode==10){
let list=res.data.data.appSingleLiveResponseVOList
list.forEach(i => {
// i.ifrecom=true
if(i.lvrIsFree==0){
this.freeList.push(i)
}else{
this.vipList.push(i)
}
});
console.log('列表信息111',list)
console.log('vip列表111',this.vipList)
console.log('免费列表222',this.freeList)
// this.source=res.data.data.info
// if(i==1){
// this.url=res.data.data.info[0].lvrrVideo
// this.urlStor=res.data.data.info[0].lvrrVideo
// }
}
})
},
getState(){
let token=sessionStorage.getItem("token")
let img=sessionStorage.getItem("udPhotoFileid")
if(token){
if(img){
this.ifLog=2
this.userImg=img
}else{
this.ifLog=1
}
}else{
console.log("就阿婆啊v发")
this.ifLog=0
this.visitorLog()
}
},
//游客登录
visitorLog(){
let temp=this.qs.stringify({
pmAppVersion:'884',
pmModel:'iPhone 12/13 (Pro)',
pmSystem:'iOS 10.0.1',
pmMac:1,
pmIp:1,
pmOperator:'无运营商',
applicationType:4,
})
this.server.live.tourist(temp).then(res=>{
let thisToken= res.data.data.token
window.sessionStorage.setItem('token', thisToken);//token
})
}
},
};
</script>
<style scoped>
.head{
width: 100%;
height: 10vw;
text-align: center;
font-size: 4vw;
line-height: 10vw;
/* background: red; */
position: relative;
}
.portait-not{
height: 7vw;
width: 7vw;
border-radius: 50%;
position: absolute;
top: 1.5vw;
right: 4vw;
}
.tab{
width: 100%;
height: 10vw;
/* text-align: center; */
font-size: 4vw;
/* line-height: 10vw; */
/* background: yellow; */
position: relative;
}
.member{
position: absolute;
left: 53vw;
top: 2vw;
height: 7vw;
text-align: center;
display: block;
width: 11vw;
border-bottom: 1vw solid red;
}
.nonemember{
position: absolute;
left: 53vw;
top: 2vw;
height: 7vw;
text-align: center;
display: block;
color: #999999;
width: 11vw;
/* border-bottom: 1vw solid red; */
}
.free{
position: absolute;
text-align: center;
display: block;
height: 7vw;
width: 11vw;
border-bottom: 1vw solid red;
left: 35vw;
top: 2vw;
}
.nonefree{
position: absolute;
text-align: center;
display: block;
height: 7vw;
color: #999999;
width: 11vw;
/* border-bottom: 1vw solid red; */
left: 35vw;
top: 2vw;
}
.content{
width:100% ;
height: 70vw;
margin-top: 3vw;
/* background: greenyellow; */
}
.moudle{
position: relative;
width:100% ;
height: 70vw;
margin-top: 3vw;
}
.recommed-img{
height: 9vw;
width: 30vw;
position: absolute;
right: 0;
top: 0;
}
.head-img{
height: 8vw;
width: 8vw;
border-radius: 10vw;
position: absolute;
top: 5vw;
left: 5vw;
}
.head-name{
position: absolute;
top: 6vw;
left: 16vw;
font-size: 4vw;
}
.count-img{
position: absolute;
top: 15vw;
left: 5vw;
height: 40vw;
width: 91%;
border-radius: 2vw;
}
.liv-img{
position: absolute;
top: 47vw;
left: 8vw;
height: 6vw;
width: 20vw;
}
.title-message{
position: absolute;
/* background: rebeccapurple; */
display: block;
/* height: 7vw; */
width: 65vw;
left: 5vw;
font-size: 4.4vw;
top: 56vw;
}
.people-img{
position: absolute;
top: 56vw;
right: 15vw;
height: 6vw;
width: 6vw;
}
.people-num{
font-size: 3.5vw;
position: absolute;
top: 57vw;
right: 6vw;
color: #A2A2A2;
}
.vip-background{
position: absolute;
top: 15vw;
left: 5vw;
height: 40vw;
width: 91%;
background: black;
border-radius: 2vw;
opacity: 0.6;
}
.vip-img{
height: 10vw;
width: 40vw;
position: absolute;
top: 31vw;
left: 31vw;
}
</style>
\ No newline at end of file
......@@ -291,16 +291,24 @@ export default {
})
this.server.login.loginByPhone(temp).then(res=>{
let thisToken= res.data.data.token
let udPhotoFileid=res.data.data.udPhotoFileid
let name=res.data.data.udNickname
let ubId=res.data.data.ubId
sessionStorage.setItem("ubId", ubId);
window.sessionStorage.setItem('token', thisToken);
sessionStorage.setItem("name", name);
let isReg=res.data.data.isReg
let openId=res.data.data.openId
sessionStorage.setItem("ubId", ubId);//用户id
window.sessionStorage.setItem('token', thisToken);//token
window.sessionStorage.setItem('udPhotoFileid', udPhotoFileid);//头像
sessionStorage.setItem("name", name);//用户昵称
sessionStorage.setItem("isReg", isReg);//是否注册
sessionStorage.setItem("openId", openId);//opendid
store.commit("SET_TOKEN", thisToken);
// this.getLive()
this.$router.push(
{
path:'/live',
path:'/list',
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment