index.js
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Page({
onReady: function (res) {
},
bindInputBlur: function(e) {
this.inputValue = e.detail.value
},
bindButtonTap: function() {
var that = this
getApp().globalData.no_clear=1;
wx.chooseVideo({
sourceType: ['album', 'camera'],
maxDuration: 60,
camera: ['front','back'],
success: function(res) {
that.setData({
src: res.tempFilePath
})
}
})
},
bindSendDanmu: function () {
this.videoContext.sendDanmu({
text: this.inputValue,
color: getRandomColor()
})
},
onShow:function(){
var goods_list = this.selectComponent("#goods_list"); //组件的id
goods_list.init();
setTimeout(function() {
goods_list.get_list();
}, 300)
},
//---------分享配置--------
onShareAppMessage: function (e) {
getApp().globalData.no_clear=1
return {
title: "直播视频回放",
}
},
//调用视频接口
onLoad:function(e){
var r_id=e.id,th=this;
if(!r_id) r_id=1;
getApp().request.get("/api/wx/weappLiveReplaylist/get?id="+r_id,{
data:{stoid:getApp().globalData.setting.stoid},
success:function(res){
if(res.data.code==0){
th.setData({src:res.data.data.media_url})
}
}
})
},
//---加载更多是靠这个函数----
onReachBottom: function() {
var goods_list = this.selectComponent("#goods_list"); //组件的id
if (goods_list) goods_list.get_list();
},
})