视频 聊天

This commit is contained in:
Mr.jiang 2024-08-01 09:24:07 +08:00
parent 5c9cbb4cc2
commit 6dd041e762
2 changed files with 7 additions and 11 deletions

View File

@ -280,11 +280,11 @@
that.connecting = false
that.connected = false
uni.hideLoading()
console.log('onError', err);
uni.showModal({
content: '网络较差,请稍后再试',
showCancel: false
})
console.log('onError', err);
});
uni.onSocketMessage(function (res) {
console.log('收到服务器内容:' + JSON.stringify(res));
@ -345,10 +345,10 @@
this.$queue.showToast('请输入聊天内容');
return;
}
if (this.chatId == '' || this.chatId == undefined) {
this.$queue.showToast('网络较差,请稍后再试');
return;
}
// if (this.chatId == '' || this.chatId == undefined) {
// this.$queue.showToast('');
// return;
// }
let userId = this.$queue.getData('userId');
let avatar = this.$queue.getData('avatar');
let phone = this.$queue.getData('phone');

View File

@ -244,14 +244,13 @@
}
},200)
} else {
console.log(88)
audo.pause()
this.dataList[k].state = 'pause'
uni.createVideoContext(this.dataList[k].id+''+k,this).seek(0)
uni.createVideoContext(this.dataList[k].id+''+k,this).pause()
}
var p = k+1;
console.log('预加载第' + (p + 1) + '个视频:' + this.dataList[p].id+''+p)
// var p = k+1;
// console.log('' + (k) + '' + this.dataList[k].id+''+p)
}
},
onLoad() {
@ -270,17 +269,14 @@
},
onShow(){
console.log('回到前台');
if(this.dataList.length !== 0){
if(this.isClick){
this.dataList[this.k].state = 'pause';
uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).pause()
audo.pause()
// this.dataList[this.k].state = 'play';
// uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).play()
// audo.play()
}
}
},
onHide(){
if(this.isClick){