-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathApp.vue
77 lines (74 loc) · 1.66 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<script>
import store from "store/index.js";
export default {
data() {
return {
flag: false,
dbDir: "",
};
},
methods: {
fileInfo() {
let _this = this;
plus.io.requestFileSystem(plus.io.PRIVATE_DOC, function (fs) {
fs.root.getDirectory(
"user",
{
create: true,
},
(entry) => {
_this.initAsync(entry.fullPath);
},
(error) => {
console.log(error);
}
);
});
},
initAsync(dbDir) {
const obj = {
platform: 1,
ipApi: "https://open-im.rentsoft.cn",
ipWs: "wss://open-im.rentsoft.cn/wss",
dbDir,
};
this.flag = this.$openSdk.initSDK(JSON.stringify(obj));
},
initFriendListener() {
this.$openSdk.setFriendListener();
},
setFriendListener() {
this.$globalEvent.addEventListener("onBlackListAdd", (params) => {
console.log(params);
});
this.$globalEvent.addEventListener("onBlackListDeleted", (params) => {
console.log(params);
});
this.$globalEvent.addEventListener(
"onFriendApplicationListDeleted",
(params) => {
console.log(params);
}
);
},
},
onLaunch: function () {
this.$openSdk.setConversationListener();
this.$openSdk.addAdvancedMsgListener();
this.$openSdk.setGroupListener()
this.fileInfo();
this.initFriendListener();
this.setFriendListener();
},
};
</script>
<style lang="scss">
@import "uview-ui/index.scss";
page {
height: 100% !important;
}
.uni-navbar,
.u-navbar{
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.15);
}
</style>