1 Star 2 Fork 1

野火IM/uni-chat-uts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
App.vue 3.16 KB
一键复制 编辑 原始数据 按行查看 历史
armXyz 提交于 2024-10-30 15:15 . tmp commit: 鸿蒙会话页面滑动问题
<script>
import store from "./store";
import {getItem} from "./pages/util/storageHelper";
import wfc from "./wfc/client/wfc";
import avengineKit from "./wfc/av/engine/avengineKit";
import conferenceManager from "./pages/voip/conference/conferenceManager";
import ConferenceInviteMessageContent from "./wfc/av/messages/conferenceInviteMessageContent";
import Message from "./wfc/messages/message";
import ForwardType from "./pages/conversation/message/forward/ForwardType";
export default {
data() {
return {
wfc: null,
avengineKit: null,
store: null,
conferenceManager: null,
}
},
onLaunch: function () {
console.log("App Launch");
this.wfc = wfc;
this.avengineKit = avengineKit;
this.store = store;
this.conferenceManager = conferenceManager;
// #ifdef APP-PLUS
plus.push.getClientInfoAsync((info) => {
let cid = info["clientid"];
if (cid) {
console.log('push clientId', cid);
wfc.setDeviceToken(7, cid);
}
});
// #endif
},
onShow: function () {
console.log("App Show");
store.state.misc.isAppHidden = false;
// #ifdef H5
let userId = getItem('userId');
let token = getItem('token')
if (token) {
wfc.connect(userId, token);
this.go2ConversationList();
} else {
uni.redirectTo({
url: '/pages/login/LoginPage',
})
}
// #endif
},
onHide: function () {
console.log("App Hide");
store.state.misc.isAppHidden = true;
},
methods: {
go2ConversationList() {
uni.switchTab({
url: '/pages/conversationList/ConversationListPage',
success: () => {
console.log('to conversation list success');
},
fail: e => {
console.log('to conversation list error', e);
},
complete: () => {
console.log('switch tab complete')
}
});
},
forwardConferenceInviteMessage(callId, host, title, desc, startTime, audioOnly, defaultAudience, advance, pin) {
let inviteMessageContent = new ConferenceInviteMessageContent(callId, host, title, desc, startTime, audioOnly, defaultAudience, advance, pin);
console.log('invite', inviteMessageContent);
let message = new Message(null, inviteMessageContent);
this.$forward({
forwardType: ForwardType.NORMAL,
messages: [message]
});
},
}
}
</script>
<style lang="css">
/*每个页面公共css */
@import './global.css';
@import './wfc.css';
/* #ifndef APP-NVUE */
@import './static/iconfonts/customicons.css';
@import './static/iconfonts/icomoon/style.css';
/* #endif */
:root {
--uni-tabbar-height: 50px;
/*app-plus header 和 tabbar 是原生的*/
--uni-page-header-height: 0;
--page-full-height-without-header-and-tabbar: 100vh;
--page-full-height-without-header: 100vh;
}
</style>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wfchat/uni-chat-uts.git
git@gitee.com:wfchat/uni-chat-uts.git
wfchat
uni-chat-uts
uni-chat-uts
main

搜索帮助