|
|
@@ -26,6 +26,7 @@ Page({
|
|
|
myShowModel2: false, // 真正申请中提示
|
|
|
listRowIndex: -1, //列表选中项
|
|
|
CheckTheType: '当前直播', //查看类型
|
|
|
+ onlineNumber: 0, //实时观看人数
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -40,6 +41,13 @@ Page({
|
|
|
detail
|
|
|
}) {
|
|
|
if (detail == this.data.CheckTheType) return;
|
|
|
+ if (detail == '历史直播') {
|
|
|
+ if (this.data.liveSessionList.length == 0) return wx.showToast({
|
|
|
+ title: '当前没有开播记录',
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
this.setData({
|
|
|
CheckTheType: detail
|
|
|
})
|
|
|
@@ -64,6 +72,7 @@ Page({
|
|
|
console.log("聊天", res)
|
|
|
})
|
|
|
}, 2000); */
|
|
|
+ //实时观看人数
|
|
|
_Http.basic({
|
|
|
"accesstoken": token,
|
|
|
"classname": "customer.live.live",
|
|
|
@@ -72,7 +81,10 @@ Page({
|
|
|
"channelid": channelid
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
+ if (res.msg != '成功') return;
|
|
|
+ this.setData({
|
|
|
+ onlineNumber: res.data.count
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
/* 获取当前用户列表 */
|
|
|
@@ -168,7 +180,7 @@ Page({
|
|
|
//获取实时数据
|
|
|
this.realTime()
|
|
|
//直播场次列表查询
|
|
|
- this.getLiveSessionList()
|
|
|
+ if (res.code == 1) this.getLiveSessionList();
|
|
|
})
|
|
|
},
|
|
|
/* 直播场次列表查询 */
|
|
|
@@ -202,7 +214,7 @@ Page({
|
|
|
pageTotal: res.pageTotal,
|
|
|
sessionList
|
|
|
});
|
|
|
- this.viewDetails(0)
|
|
|
+ if (res.data.length > 0) this.viewDetails(0);
|
|
|
})
|
|
|
},
|
|
|
/* 查看场次详情 */
|
|
|
@@ -210,6 +222,7 @@ Page({
|
|
|
this.viewDetails(e.detail.value);
|
|
|
},
|
|
|
viewDetails(index) {
|
|
|
+ console.log(index, this.data.liveSessionList[index])
|
|
|
const sessionid = this.data.liveSessionList[index].sessionid;
|
|
|
this.setData({
|
|
|
showStartTime: this.data.liveSessionList[index].starttime,
|
|
|
@@ -321,6 +334,7 @@ Page({
|
|
|
setIndex({
|
|
|
detail
|
|
|
}) {
|
|
|
+ if (this.data.tabsIndex == detail) return;
|
|
|
this.setData({
|
|
|
tabsIndex: detail,
|
|
|
pageNumber: 1,
|
|
|
@@ -328,7 +342,6 @@ Page({
|
|
|
userPageNumber: 1,
|
|
|
userPageTotal: 1
|
|
|
});
|
|
|
- if (detail == undefined) return;
|
|
|
this.getLiveInfo();
|
|
|
if (detail == 2) this.getCooperationAgentsLiveList();
|
|
|
},
|