12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <script>
- export default {
- mounted() {
-
-
- this.tim.on(this.$TIM.EVENT.SDK_READY, this.onReadyStateUpdate, this);
-
- this.tim.on(this.$TIM.EVENT.MESSAGE_RECEIVED, this.onReceiveMessage);
-
- this.tim.on(this.$TIM.EVENT.CONVERSATION_LIST_UPDATED, event => {
- this.$store.commit("updateConversationList", event.data);
- });
- },
- methods: {
- onReadyStateUpdate({
- name
- }) {
- const isSDKReady = name === this.$TIM.EVENT.SDK_READY ? true : false;
-
- this.$store.commit("toggleIsSDKReady", isSDKReady);
-
- },
- onReceiveMessage({
- data: messageList
- }) {
-
- this.$store.commit("pushCurrentMessageList", messageList);
- }
- },
- onLaunch: function() {
- console.log('App Launch')
- },
- onShow: function() {
- console.log('App Show')
- },
- onHide: function() {
- console.log('App Hide')
- }
- }
- </script>
- <style lang="scss">
-
- @import "uview-ui/index.scss";
- </style>
|