add file
This commit is contained in:
Generated
Vendored
+34
@@ -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() {},
|
||||
});
|
||||
Generated
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"TUICallKit": "../../TUICallKit"
|
||||
},
|
||||
"navigationStyle": "custom",
|
||||
"disableScroll": true
|
||||
}
|
||||
|
||||
Generated
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
<view class="">
|
||||
<TUICallKit
|
||||
id="TUICallKit-component"
|
||||
></TUICallKit>
|
||||
</view>
|
||||
Generated
Vendored
Generated
Vendored
+25
@@ -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>
|
||||
Reference in New Issue
Block a user