Browse Source

登录查看留言记录

yangc 7 years ago
parent
commit
03d3551dbf
1 changed files with 9 additions and 3 deletions
  1. 9 3
      components/default/MessageBoard.vue

+ 9 - 3
components/default/MessageBoard.vue

@@ -138,7 +138,6 @@
         },
         showHistory: true,
         isOpen: true,
-        isLogin: false,
         txtVal: 0,
         isMobileValid: true,
         isEmail: true,
@@ -160,6 +159,9 @@
       user () {
         return this.$store.state.option.user.data
       },
+      isLogin () {
+        return this.$store.state.option.user.logged
+      },
       messageBoardCurrent () {
         return this.$store.state.messageBoardInformation.information.data
       }
@@ -185,8 +187,12 @@
         this.$emit('openBoardEvent', false)
       },
       isOpenHistory () {
-        this.$store.dispatch('getMessageBoardInformation', {page: 1, count: 3})
-        this.showHistory = !this.showHistory
+        if (!this.isLogin) {
+          this.login()
+        } else {
+          this.$store.dispatch('getMessageBoardInformation', {page: 1, count: 3})
+          this.showHistory = !this.showHistory
+        }
       },
       isHideHistory () {
         this.showHistory = !this.showHistory