直播
This commit is contained in:
@@ -49,6 +49,10 @@
|
||||
<image class="shoptapimg" @click="xianshi" src="../../static/image/shop.png"></image>
|
||||
<text style="font-size:26rpx;color:#fff;width:512rpx;position:fixed;left:30rpx;top:793rpx">德铭阳光在线绿色直播,请遵循相关法律法规,警察叔叔24小时巡查哦。为了保障直播系统稳定,现将全局开放防主播沉迷功能。主播积累直播16小时将自动下播休息2小时后方可继续开播。请大家注意休息/避免空播。
|
||||
</text>
|
||||
<div class="danmulist">
|
||||
<text class="danmuitem" v-for="(i,j) in danmulist" :key="j">{{i.senderNickname}}:{{i.content}}</text>
|
||||
|
||||
</div>
|
||||
<div class="bottom" :style="{'height':height + 'px'}" v-if="tool" @click="tool = false">
|
||||
<view class="menu" @click="zuzhi">
|
||||
<view class="menuback"></view>
|
||||
@@ -252,9 +256,19 @@
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
.danmulist{
|
||||
position: fixed;
|
||||
left: 30rpx;
|
||||
bottom: 118rpx;
|
||||
}
|
||||
.danmuitem{
|
||||
font-size: 26rpx;
|
||||
color: #fff;
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
const RongIMLib = require('../../static/rongyun.js');
|
||||
const ChatRoomService =require('../../static/chatservice');
|
||||
export default {
|
||||
data: {
|
||||
fil: true,
|
||||
@@ -268,7 +282,10 @@
|
||||
live_id:0,
|
||||
tool:false,
|
||||
meiyan:0,
|
||||
time:'00:00:00'
|
||||
time:'00:00:00',
|
||||
room:{},
|
||||
chatRoomService:{},
|
||||
danmulist:[]
|
||||
},
|
||||
onReady() {
|
||||
// 注意:需要在onReady中 或 onLoad 延时
|
||||
@@ -284,6 +301,7 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onLoad(a){
|
||||
this.url = a.url.replace("*","&")
|
||||
let that = this
|
||||
@@ -311,6 +329,26 @@
|
||||
success(res){
|
||||
console.log(res.data)
|
||||
that.info = res.data.data.memberInfo
|
||||
|
||||
console.log(uni.getStorageSync('userinfo'),123)
|
||||
//当前用户
|
||||
var currentUser = {
|
||||
id : res.data.data.memberInfo.member_id + "",
|
||||
nickname : res.data.data.memberInfo.member_nickname + "",
|
||||
avatar: res.data.data.memberInfo.member_avatar
|
||||
};
|
||||
|
||||
var room = {
|
||||
id : a.id + "",
|
||||
name : a.id + ""
|
||||
};
|
||||
console.log(room)
|
||||
//构造chatRoomService
|
||||
that.chatRoomService = new ChatRoomService(room, currentUser);
|
||||
that.chatRoomService.initialWhenNewMessage(that.whenNewMessage);
|
||||
that.chatRoomService.connectGoEasyIM();
|
||||
//获取当前聊天室数据
|
||||
that.room = that.chatRoomService.room;
|
||||
}
|
||||
})
|
||||
let shi = 0;
|
||||
@@ -321,7 +359,7 @@
|
||||
fen = parseInt(fen)
|
||||
miao = parseInt(miao)
|
||||
miao = miao + 1
|
||||
console.log(miao)
|
||||
// console.log(miao)
|
||||
if(miao == 60){
|
||||
miao = 0;
|
||||
fen +=1
|
||||
@@ -341,6 +379,11 @@
|
||||
}
|
||||
that.time = shi + ":" + fen + ":" + miao
|
||||
}, 1000);
|
||||
// var roomToken = JSON.parse(options.roomToken);
|
||||
|
||||
|
||||
// //获取当前聊天室数据
|
||||
// this.room = this.chatRoomService.room;
|
||||
// var config = {
|
||||
// appkey: 'mgb7ka1',
|
||||
// debug:true
|
||||
@@ -387,6 +430,19 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
whenNewMessage (message) {//新消息监听
|
||||
// if(message.type == this.room.MessageType.PROP){
|
||||
// this.propAnimation(parseInt(message.content))
|
||||
// }
|
||||
// setTimeout(() => {
|
||||
// this.contentPosition = 'message-box'+(this.room.messages.length-1);
|
||||
// }, 300)
|
||||
console.log(message)
|
||||
this.danmulist.push(message)
|
||||
if(this.danmulist.length > 7){
|
||||
this.danmulist = this.danmulist.slice(this.danmulist.length - 7)
|
||||
}
|
||||
},
|
||||
bindPickerChange(a){
|
||||
console.log(a.detail.value)
|
||||
this.meiyan = a.detail.value
|
||||
|
||||
Reference in New Issue
Block a user