|
|
@@ -3,7 +3,6 @@ import {
|
|
|
} from "../../utils/api";
|
|
|
const _Http = new ApiModel;
|
|
|
Page({
|
|
|
-
|
|
|
/**
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
@@ -11,7 +10,7 @@ Page({
|
|
|
dataTypes: 0, //0-全部数据 1-单独数据
|
|
|
tabsList: ["私域直播", "展会直播"], //tabs列表
|
|
|
tabsIndex: 0, //tabs下标
|
|
|
- accountStatus: null, //直播账号状态 1-账号正常 2-账号审核中 3-没有账号
|
|
|
+ accountStatus: -1, //直播账号状态 1-账号正常 2-账号审核中 3-没有账号
|
|
|
liveDataCount: {}, //实时数据统计
|
|
|
liveDataCountForSession: {}, //单场次数据统计
|
|
|
liveSessionList: [], //直播场次列表
|
|
|
@@ -21,6 +20,8 @@ Page({
|
|
|
userPageNumber: 1, //用户当前页码
|
|
|
userPageTotal: 1, //用户总列表
|
|
|
optionRow: -1, //列表选中项
|
|
|
+ isSy: true, //是否为私域直播
|
|
|
+ myShowModel: false, //自定义model
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -30,6 +31,57 @@ Page({
|
|
|
//获取直播账号
|
|
|
this.getLiveInfo()
|
|
|
},
|
|
|
+ /* 自定义model回调 */
|
|
|
+ showModelCallBack({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ if (detail == 'true') this.copyTheAddress(this.data.accountMsg.fliveurl_web);
|
|
|
+ },
|
|
|
+ /* 显示自定义model */
|
|
|
+ showMyModel() {
|
|
|
+ this.setData({
|
|
|
+ myShowModel: true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 申请直播账号 */
|
|
|
+ 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: "您的私域直播账号正在申请中"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 复制地址 */
|
|
|
+ copyTheAddress(e) {
|
|
|
+ const url = (typeof e == "string" || typeof e == String) ? e : e.target.dataset.url;
|
|
|
+ wx.setClipboardData({
|
|
|
+ data: url,
|
|
|
+ success(res) {
|
|
|
+ wx.getClipboardData({
|
|
|
+ success(res) {
|
|
|
+ console.log('内容已复制') // data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
/* 获取直播账号详情 */
|
|
|
getLiveInfo() {
|
|
|
const method = (this.data.tabsIndex == 0) ? 'getSYLiveInfo' : 'getLiveInfo';
|
|
|
@@ -39,9 +91,12 @@ Page({
|
|
|
"method": method,
|
|
|
"content": {}
|
|
|
}).then(res => {
|
|
|
+ console.log("直播账号信息", res)
|
|
|
+ const isSy = (method == "getSYLiveInfo") ? true : false;
|
|
|
this.setData({
|
|
|
accountStatus: res.code,
|
|
|
- accountMsg: res.data[0]
|
|
|
+ accountMsg: res.data[0],
|
|
|
+ isSy
|
|
|
})
|
|
|
/* 直播数据统计 */
|
|
|
this.getLiveDataCount()
|
|
|
@@ -61,6 +116,7 @@ Page({
|
|
|
"channelid": this.data.accountMsg.channelid
|
|
|
}
|
|
|
}).then(res => {
|
|
|
+ console.log("直播数据统计", res)
|
|
|
if (res.msg != '成功') return wx.showToast({
|
|
|
title: res.data,
|
|
|
icon: "none"
|
|
|
@@ -84,7 +140,7 @@ Page({
|
|
|
"channelid": this.data.accountMsg.channelid
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
+ console.log("直播场次查询", res)
|
|
|
if (res.msg != '成功') return wx.showToast({
|
|
|
title: res.data,
|
|
|
icon: "none"
|
|
|
@@ -99,7 +155,6 @@ Page({
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
/* 查看场次详情 */
|
|
|
viewDetails(e) {
|
|
|
const {
|
|
|
@@ -119,7 +174,7 @@ Page({
|
|
|
"sessionid": sessionid
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
+ console.log("场次详情统计", res)
|
|
|
if (res.msg != '成功') wx.showToast({
|
|
|
title: '数据统计获取失败,请稍后再试',
|
|
|
icon: "none"
|
|
|
@@ -133,7 +188,6 @@ Page({
|
|
|
dataTypes: 1
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
/* 观看用户列表 */
|
|
|
LiveUserList() {
|
|
|
/* 用户观看列表 */
|
|
|
@@ -150,7 +204,7 @@ Page({
|
|
|
"channelid": this.data.accountMsg.channelid
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
+ console.log("观看用户列表", res)
|
|
|
if (res.msg != '成功') wx.showToast({
|
|
|
title: '观看列表获取失败,请稍后再试',
|
|
|
icon: "none"
|
|
|
@@ -242,7 +296,6 @@ Page({
|
|
|
})
|
|
|
this.getLiveInfo();
|
|
|
},
|
|
|
-
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|