Browse Source

更新会话列表页面,右上角加号菜单,显示隐藏逻辑

imndx 2 years ago
parent
commit
18f8996634

+ 13 - 4
components/main-action-menu/main-action-menu.vue

@@ -92,9 +92,9 @@ export default {
                 success: function (res) {
                     console.log('条码类型:' + res.scanType);
                     console.log('条码内容:' + res.result);
-                    if (res.result){
+                    if (res.result) {
                         // TODO
-                       // wildfirechat://pcsession/xxxx
+                        // wildfirechat://pcsession/xxxx
                         uni.showToast({
                             title: '扫码成功: ' + res.result,
                             icon: 'none',
@@ -114,6 +114,13 @@ export default {
         moveHandle(e) {
             this.hide()
         },
+        toggle() {
+            if (this.isActive){
+                this.hide();
+            } else {
+                this.show();
+            }
+        },
         show() {
             this.isActive = true
             setTimeout(() => {
@@ -121,8 +128,10 @@ export default {
             }, 30)
         },
         hide() {
-            this.isActive = false
-            this.hideAnimation()
+            if (this.isActive){
+                this.isActive = false
+                this.hideAnimation()
+            }
         },
         getstatusBarHeight() {
             let SystemInfo = uni.getSystemInfoSync();

+ 7 - 1
pages/contact/ContactListPage.vue

@@ -58,13 +58,19 @@ export default {
         }
     },
 
+    onHide(){
+        console.log('contactList onHide');
+        this.$refs.mainActionMenu.hide();
+    },
+
     onNavigationBarButtonTap(e) {
         console.log('onNavigationBarButtonTap')
         switch (e.index) {
             case 0:
-                this.$refs.mainActionMenu.show();
+                this.$refs.mainActionMenu.toggle();
                 break;
             case 1:
+                this.$refs.mainActionMenu.hide();
                 uni.navigateTo({
                     url: '/pages/search/SearchPortalPage'
                 });

+ 7 - 1
pages/conversationList/ConversationListPage.vue

@@ -42,13 +42,19 @@ export default {
         console.log('conversationList onShow', this.sharedConversationState.conversationInfoList.length)
     },
 
+    onHide(){
+        console.log('conversationList onHide');
+        this.$refs.mainActionMenu.hide();
+    },
+
     onNavigationBarButtonTap(e) {
         console.log('onNavigationBarButtonTap')
         switch (e.index) {
             case 0:
-                this.$refs.mainActionMenu.show();
+                this.$refs.mainActionMenu.toggle();
                 break;
             case 1:
+                this.$refs.mainActionMenu.hide();
                 uni.navigateTo({
                     url: '/pages/search/SearchPortalPage'
                 });