|
|
@@ -27,62 +27,56 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
- //获取直播详情
|
|
|
+ //获取直播账号
|
|
|
+ this.getLiveInfo()
|
|
|
+ },
|
|
|
+ /* 获取直播账号详情 */
|
|
|
+ getLiveInfo() {
|
|
|
+ const method = (this.data.tabsIndex == 0) ? 'getSYLiveInfo' : 'getLiveInfo';
|
|
|
_Http.basic({
|
|
|
"accesstoken": wx.getStorageSync('userData').token,
|
|
|
"classname": "customer.live.live",
|
|
|
- "method": "getSYLiveInfo",
|
|
|
+ "method": method,
|
|
|
"content": {}
|
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
this.setData({
|
|
|
- accountStatus: res.code
|
|
|
+ accountStatus: res.code,
|
|
|
+ accountMsg: res.data[0]
|
|
|
})
|
|
|
- switch (res.code) {
|
|
|
- case 1:
|
|
|
- this.setData({
|
|
|
- accountMsg: res.data[0]
|
|
|
- })
|
|
|
- /* 直播数据统计 */
|
|
|
- _Http.basic({
|
|
|
- "accesstoken": wx.getStorageSync('userData').token,
|
|
|
- "classname": "customer.live.live",
|
|
|
- "method": "getSYLiveDataCount",
|
|
|
- "content": {
|
|
|
- "channelid": res.data[0].channelid
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- this.setData({
|
|
|
- liveDataCount: res.data
|
|
|
- })
|
|
|
- })
|
|
|
- /* 私域直播场次列表查询 */
|
|
|
- this.getSYLiveSessionList()
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- console.log(2)
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- console.log(3)
|
|
|
- break;
|
|
|
- default:
|
|
|
- wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
+ /* 直播数据统计 */
|
|
|
+ this.getLiveDataCount()
|
|
|
+ /* 直播场次列表查询 */
|
|
|
+ this.getLiveSessionList()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 直播数据统计 */
|
|
|
+ getLiveDataCount() {
|
|
|
+ //判断私域还是展会
|
|
|
+ const method = (this.data.tabsIndex == 0) ? 'getSYLiveDataCount' : 'getLiveDataCount'
|
|
|
+ _Http.basic({
|
|
|
+ "accesstoken": wx.getStorageSync('userData').token,
|
|
|
+ "classname": "customer.live.live",
|
|
|
+ "method": method,
|
|
|
+ "content": {
|
|
|
+ "channelid": this.data.accountMsg.channelid
|
|
|
}
|
|
|
+ }).then(res => {
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ liveDataCount: res.data
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
- /* 私域直播场次列表查询 */
|
|
|
- getSYLiveSessionList() {
|
|
|
+ /* 直播场次列表查询 */
|
|
|
+ getLiveSessionList() {
|
|
|
+ const method = (this.data.tabsIndex == 0) ? "getSYLiveSessionList" : "getLiveSessionList"
|
|
|
_Http.basic({
|
|
|
"accesstoken": wx.getStorageSync('userData').token,
|
|
|
"classname": "customer.live.live",
|
|
|
- "method": "getSYLiveSessionList",
|
|
|
+ "method": method,
|
|
|
"content": {
|
|
|
"getdatafromdbanyway": true,
|
|
|
"pageNumber": this.data.pageNumber,
|
|
|
@@ -105,18 +99,7 @@ Page({
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- /* 场次列表选中 */
|
|
|
- optionItemIndex(e) {
|
|
|
- const {
|
|
|
- index
|
|
|
- } = e.currentTarget.dataset;
|
|
|
- if (index == this.data.optionRow) return this.setData({
|
|
|
- optionRow: -1
|
|
|
- });
|
|
|
- this.setData({
|
|
|
- optionRow: index
|
|
|
- })
|
|
|
- },
|
|
|
+
|
|
|
/* 查看场次详情 */
|
|
|
viewDetails(e) {
|
|
|
const {
|
|
|
@@ -150,13 +133,15 @@ Page({
|
|
|
dataTypes: 1
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
/* 观看用户列表 */
|
|
|
LiveUserList() {
|
|
|
/* 用户观看列表 */
|
|
|
+ const method = (this.data.tabsIndex == 0) ? "getSYLiveUserList" : "getLiveUserList";
|
|
|
_Http.basic({
|
|
|
"accesstoken": wx.getStorageSync('userData').token,
|
|
|
"classname": "customer.live.live",
|
|
|
- "method": "getSYLiveUserList",
|
|
|
+ "method": method,
|
|
|
"content": {
|
|
|
"getdatafromdbanyway": true,
|
|
|
"pageNumber": this.data.userPageNumber,
|
|
|
@@ -188,6 +173,18 @@ Page({
|
|
|
userPageTotal: 1
|
|
|
})
|
|
|
},
|
|
|
+ /* 场次列表选中 */
|
|
|
+ optionItemIndex(e) {
|
|
|
+ const {
|
|
|
+ index
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
+ if (index == this.data.optionRow) return this.setData({
|
|
|
+ optionRow: -1
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ optionRow: index
|
|
|
+ })
|
|
|
+ },
|
|
|
/* 下一页 */
|
|
|
buttonRightClick() {
|
|
|
if (this.data.dataTypes == 0) {
|
|
|
@@ -232,57 +229,18 @@ Page({
|
|
|
this.LiveUserList()
|
|
|
}
|
|
|
},
|
|
|
- /* 申请直播账号 */
|
|
|
- applyForLive() {
|
|
|
- _Http.basic({
|
|
|
- "accesstoken": wx.getStorageSync('userData').token,
|
|
|
- "classname": "customer.live.live",
|
|
|
- "method": "applySYLive",
|
|
|
- "content": {}
|
|
|
- }).then(res => {
|
|
|
- console.log(res)
|
|
|
- if (res.code == 1) {
|
|
|
- wx.showToast({
|
|
|
- title: res.msg,
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- this.setData({
|
|
|
- accountStatus: 2
|
|
|
- })
|
|
|
- } else {
|
|
|
- if (res.data == '私域直播已申请') return wx.showModal({
|
|
|
- title: "提示",
|
|
|
- content: "您的私域直播账号正在申请中"
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
/* tabs回调 */
|
|
|
setIndex({
|
|
|
detail
|
|
|
}) {
|
|
|
this.setData({
|
|
|
- tabsIndex: detail
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- /* 复制地址 */
|
|
|
- copyTheAddress(e) {
|
|
|
- console.log(e)
|
|
|
- const {
|
|
|
- url
|
|
|
- } = e.target.dataset
|
|
|
- wx.setClipboardData({
|
|
|
- data: url,
|
|
|
- success(res) {
|
|
|
- wx.getClipboardData({
|
|
|
- success(res) {
|
|
|
- console.log('内容已复制') // data
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ tabsIndex: detail,
|
|
|
+ pageNumber: 1,
|
|
|
+ pageTotal: 1,
|
|
|
+ userPageNumber: 1,
|
|
|
+ userPageTotal: 1
|
|
|
})
|
|
|
+ this.getLiveInfo();
|
|
|
},
|
|
|
|
|
|
/**
|