This commit is contained in:
haomingming
2023-03-06 17:57:39 +08:00
parent 3794faceae
commit 1066e37c96
4230 changed files with 193453 additions and 0 deletions
@@ -0,0 +1,34 @@
Page({
TUICallKit: null,
data: {
config: {
},
},
async onLoad(option) {
const config = JSON.parse(option.configData);
this.setData(
{
config: { ...this.data.config, ...config },
},
async () => {
this.TUICallKit = this.selectComponent('#TUICallKit-component');
try {
await this.TUICallKit.init(config);
const event = JSON.parse(option.data);
wx.$TUICallEngine.TRTCCallingDelegate.onInvited(event.data);
} catch (error) {
console.error(error);
}
},
);
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
this.TUICallKit.destroyed();
},
onShow() {},
});
@@ -0,0 +1,8 @@
{
"usingComponents": {
"TUICallKit": "../../TUICallKit"
},
"navigationStyle": "custom",
"disableScroll": true
}
@@ -0,0 +1,5 @@
<view class="">
<TUICallKit
id="TUICallKit-component"
></TUICallKit>
</view>
@@ -0,0 +1,25 @@
<template>
<tuicallkit ref="TUICallKit"></tuicallkit>
</template>
<script>
export default {
onLoad(option) {
const config = JSON.parse(option.configData);
this.$nextTick(async () => {
await this.$refs.TUICallKit.init(config);
const event = JSON.parse(option.data);
wx.$TUICallEngine.TRTCCallingDelegate.onInvited(event.data);
})
},
created() {
},
onUnload() {
this.$refs.TUICallKit.destroyed();
},
}
</script>
<style>
</style>