修复了部分问题

This commit is contained in:
luyuan 2020-11-27 14:53:43 +08:00
parent a35253b4b9
commit ae1ba85e2c
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
4 changed files with 7 additions and 4 deletions

View File

@ -33,7 +33,7 @@ function join() {
$('#header-roomId').html('房间号: ' + $('#roomId').val());
$('#member-me')
.find('.member-id')
.html($('#userId').val() + '(我)');
.html(window.uname + '(我)');
}
function leave() {

View File

@ -82,6 +82,7 @@ function formatDateTime (inputTime) {
});
tim.on(TIM.EVENT.GROUP_LIST_UPDATED, function(event) {
console.log(event.data)
// 收到群组列表更新通知,可通过遍历 event.data 获取群组列表数据并渲染到页面
// event.name - TIM.EVENT.GROUP_LIST_UPDATED
// event.data - 存储 Group 对象的数组 - [Group]
@ -142,7 +143,7 @@ function formatDateTime (inputTime) {
})
tim.on(TIM.EVENT.SDK_READY, function (){
tim.updateMyProfile({
nick: '我的昵称'
nick: window.uname
});
const promise = tim.createGroup({
type: TIM.TYPES.GRP_AVCHATROOM,
@ -207,7 +208,7 @@ function formatDateTime (inputTime) {
const list = $("#liaotianliebiao")
const html = ` <div>
<p>${formatDateTime(imResponse.data.message.time)}</p>
<p><span>${imResponse.data.message.nick}:</span>${imResponse.data.message.payload.text}</p>
<p><span>${window.uname}:</span>${imResponse.data.message.payload.text}</p>
</div>`
console.log(html)
list.append(html)

View File

@ -411,6 +411,7 @@
const urldata = GetRequest('roomid')
window.roomid = urldata.roomid
window.mid = urldata.memberid
window.uname = urldata.name
</script>

View File

@ -6,6 +6,7 @@
</style>
<script lang="ts">
import { getliveinfo } from '@/api';
import store from '@/store';
import { defineComponent, ref } from 'vue';
import { useRoute } from 'vue-router';
@ -16,7 +17,7 @@ export default defineComponent({
const url = ref<string>()
if(id && typeof id == 'string'){
getliveinfo(parseInt(id)).then((res: any)=>{
url.value = `/zhibo.html?roomid=${res.roomid}&memberid=${res.memberid}`
url.value = `/zhibo.html?roomid=${res.roomid}&memberid=${res.memberid}&name=${escape(store.state.userinfo.name)}`
})
}