xz_angren/pages/broadcastList/broadcastList.js
dong_bo0602 805ad24d28 video
2020-09-15 16:03:51 +08:00

108 lines
2.0 KiB
JavaScript

// pages/broadcastList/broadcastList.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
liveRecordContentUrl: app.newsContentUrl,
liveUrl: app.liveUrl,
liveRecordUrl: app.liveRecordUrl,
livePlanId: null,
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
})
}
console.log(self.data.liveRecordList)
}
)
},
playVideo: function (e) {
this.setData({
videoPath: e.currentTarget.dataset.url
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
livePlanId: options.livePlanId
})
this.getLivePlanRecordList();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.setData({
page: this.data.page + 1
})
this.getLivePlanRecordList()
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.setData({
page: this.data.page + 1
})
this.getLivePlanRecordList()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})