This commit is contained in:
Gdpao 2020-09-01 20:35:48 +08:00
commit 3ecaac3190
4 changed files with 62 additions and 43 deletions

View File

@ -73,7 +73,7 @@
<u-popup v-model="publishstate" mode="bottom">
<view class="publish">
<view class="list">
<view @click="navto('release/tosign')" v-if="0">
<view @click="navto('release/tosign')">
<image src="../../static/image/index/live.png"></image>
<text>直播</text>
</view>

View File

@ -91,6 +91,10 @@
<text style="color:#fff;font-size:30rpx">RMB {{jieshu.sales_amount}}</text>
<text style="color:#fff;font-size:30rpx;margin-top:10rpx">直播销量</text>
</view>
<view class="jieshuboxitem" v-if="list.length != 0">
<text style="color:#fff;font-size:30rpx">{{jieshu.buy_num}}</text>
<text style="color:#fff;font-size:30rpx;margin-top:10rpx">购买人数</text>
</view>
</div>
</div>
<!-- <button class="btn" @click="start">开始推流1</button>
@ -336,11 +340,13 @@
position: fixed;
left: 30rpx;
bottom: 118rpx;
width: 690rpx;
}
.danmuitem{
font-size: 26rpx;
color: #fff;
flex-direction: column-reverse;
word-wrap:anywhere;
}
.livePusher{
width: 750rpx;

View File

@ -11,6 +11,10 @@
</view>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="navtos()">
<text>活动消息</text>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="toOthersPage('fans')">
<text>我的粉丝</text>
<image src="/static/image/user/1.png"></image>
@ -77,49 +81,54 @@ export default {
this.imService.connectIM()
},
methods: {
//
getCache() {
let _this = this;
// #ifdef APP-PLUS
plus.cache.calculate(function(size) {
console.log(size);
let sizeCache = size;
if (sizeCache == 0) {
_this.fileSizeString = "0B";
} else if (sizeCache < 1024) {
_this.fileSizeString = sizeCache + "B";
} else if (sizeCache < 1048576) {
_this.fileSizeString = (sizeCache / 1024).toFixed(2) + "KB";
} else if (sizeCache < 1073741824) {
_this.fileSizeString = (sizeCache / 1048576).toFixed(2) + "MB";
} else {
_this.fileSizeString = (sizeCache / 1073741824).toFixed(2) + "GB";
}
});
// #endif
},
//
clearCache() {
// #ifdef APP-PLUS
uni.showModal({
title: "确定要清理缓存吗?",
cancelColor: "#999",
confirmColor: "#f00",
success: (res) => {
// console.log(res);
if (res.confirm) {
plus.cache.clear(function(e) {
console.log(e);
})
}
this.getCache();
}
})
// #endif
},
// 退
//
getCache() {
let _this = this;
// #ifdef APP-PLUS
plus.cache.calculate(function(size) {
console.log(size);
let sizeCache = size;
if (sizeCache == 0) {
_this.fileSizeString = "0B";
} else if (sizeCache < 1024) {
_this.fileSizeString = sizeCache + "B";
} else if (sizeCache < 1048576) {
_this.fileSizeString = (sizeCache / 1024).toFixed(2) + "KB";
} else if (sizeCache < 1073741824) {
_this.fileSizeString = (sizeCache / 1048576).toFixed(2) + "MB";
} else {
_this.fileSizeString = (sizeCache / 1073741824).toFixed(2) + "GB";
}
});
// #endif
},
//
clearCache() {
// #ifdef APP-PLUS
uni.showModal({
title: "确定要清理缓存吗?",
cancelColor: "#999",
confirmColor: "#f00",
success: (res) => {
// console.log(res);
if (res.confirm) {
plus.cache.clear(function(e) {
console.log(e);
})
}
this.getCache();
}
})
// #endif
},
navtos(){
this.$u.route({
url:"/pages/messages/list"
})
},
// 退
loginOut(){
this.imService.disconnect();
this.imService.disconnect()
uni.clearStorage();
this.$refs.uToast.show({
title: "退出登陆成功!",

View File

@ -784,6 +784,10 @@ IMService.prototype.initialWhenOnlineUserChange = function (whenOnlineUserChange
IMService.prototype.listenerNewMessage = function () {
this.im.on(GoEasyIM.EVENT.GROUP_MESSAGE_RECEIVED, (message) => {
console.log(message)
if(message.senderId == 0){
return ;
}
var content = JSON.parse(message.payload.text);
this.addNewMessage(message);
this.whenNewMessage(content);