2020-06-28 20:16:24 +08:00
|
|
|
// pages/broadcastList/broadcastList.js
|
|
|
|
var app = getApp();
|
|
|
|
Page({
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面的初始数据
|
|
|
|
*/
|
|
|
|
data: {
|
2020-07-02 13:03:55 +08:00
|
|
|
liveRecordContentUrl: app.newsContentUrl,
|
2020-06-28 20:16:24 +08:00
|
|
|
liveUrl: app.liveUrl,
|
|
|
|
liveRecordUrl: app.liveRecordUrl,
|
2020-07-02 13:03:55 +08:00
|
|
|
livePlanId: null,
|
2020-09-15 16:03:51 +08:00
|
|
|
page: 1,
|
|
|
|
rows: 20,
|
|
|
|
liveRecordList: [],
|
|
|
|
videoPath: ''
|
|
|
|
},
|
|
|
|
getLivePlanRecordList: function () {
|
|
|
|
var self = this
|
|
|
|
app.restAjax.get(app.restAjax.path('{liveUrl}/app/liverecord/listpageliverecordrelease/' + self.data.livePlanId, [app.liveUrl]), {
|
|
|
|
page: self.data.page,
|
|
|
|
rows: self.data.rows
|
|
|
|
}, null,
|
|
|
|
function (code, data) {
|
|
|
|
if (data.rows.length > 0) {
|
|
|
|
self.setData({
|
|
|
|
liveRecordList: data.rows
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
wx.showToast({
|
|
|
|
title: '暂无更多',
|
|
|
|
icon: "none",
|
|
|
|
duration: 1500
|
|
|
|
})
|
|
|
|
}
|
2020-09-29 17:05:43 +08:00
|
|
|
if (self.data.page == 1) {
|
|
|
|
self.setData({
|
|
|
|
videoPath: data.rows[0].recordFilePath
|
|
|
|
})
|
|
|
|
}
|
2020-09-15 16:03:51 +08:00
|
|
|
}
|
|
|
|
)
|
|
|
|
},
|
|
|
|
playVideo: function (e) {
|
|
|
|
this.setData({
|
|
|
|
videoPath: e.currentTarget.dataset.url
|
|
|
|
})
|
2020-06-28 20:16:24 +08:00
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
onLoad: function (options) {
|
|
|
|
this.setData({
|
|
|
|
livePlanId: options.livePlanId
|
|
|
|
})
|
2020-09-15 16:03:51 +08:00
|
|
|
this.getLivePlanRecordList();
|
2020-06-28 20:16:24 +08:00
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
|
*/
|
|
|
|
onReady: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
*/
|
|
|
|
onShow: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
|
*/
|
|
|
|
onHide: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
|
*/
|
|
|
|
onUnload: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
|
*/
|
|
|
|
onPullDownRefresh: function () {
|
2020-09-15 16:03:51 +08:00
|
|
|
this.setData({
|
|
|
|
page: this.data.page + 1
|
|
|
|
})
|
|
|
|
this.getLivePlanRecordList()
|
2020-06-28 20:16:24 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
|
*/
|
|
|
|
onReachBottom: function () {
|
2020-09-15 16:03:51 +08:00
|
|
|
this.setData({
|
|
|
|
page: this.data.page + 1
|
|
|
|
})
|
|
|
|
this.getLivePlanRecordList()
|
2020-06-28 20:16:24 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 用户点击右上角分享
|
|
|
|
*/
|
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|