ソースを参照

优化用户行为记录

zhengjinyi 1 年間 前
コミット
e746c66bcb
1 ファイル変更28 行追加16 行削除
  1. 28 16
      src/views/user/record/list.vue

+ 28 - 16
src/views/user/record/list.vue

@@ -297,21 +297,8 @@ export default {
     }
   },
   created() {
-    console.log('query', this.$route.query)
-    if (this.$route.query.type === 'second') {
-      this.activeName = 'second'
-      this.tabsCurrent = this.listQuery.todayType = 1
-      this.listQuery.clubId = this.$route.query.clubId
-      this.listQuery.corporateName = this.$route.query.corporateName
-      this.time.push(this.$route.query.startTime)
-      this.time.push(this.$route.query.endTime)
-    } else {
-      this.activeName = 'first'
-      this.tabsCurrent = this.listQuery.todayType = 0
-      this.listQuery.clubId = this.$route.query.clubId
-      this.listQuery.corporateName = this.$route.query.corporateName
-    }
     this.getHeigth()
+    this.handleInfo()
     this.getList()
     this.getKeyword()
     this.getPageType()
@@ -337,15 +324,40 @@ export default {
       }
       console.log('tabheight', this.tableheight)
     },
+    handleInfo() {
+      // 初始化
+      console.log('query', this.$route.query)
+      if (this.$route.query.type === 'second') {
+        this.activeName = 'second'
+        this.tabsCurrent = this.listQuery.todayType = 1
+        this.listQuery.clubId = this.$route.query.clubId
+        this.listQuery.corporateName = this.$route.query.corporateName
+        this.time.push(this.$route.query.startTime)
+        this.time.push(this.$route.query.endTime)
+      } else {
+        this.activeName = 'first'
+        this.tabsCurrent = this.listQuery.todayType = 0
+        this.listQuery.clubId = this.$route.query.clubId
+        this.listQuery.corporateName = this.$route.query.corporateName
+      }
+    },
     // tab切换
     handleClick(tab, event) {
       if (tab.name === 'first') {
-        this.listQuery = Object.assign({}, defaultListQuery)
         this.tabsCurrent = this.listQuery.todayType = 0
+        if (this.$route.query.type) {
+          this.handleInfo()
+        } else {
+          this.listQuery = Object.assign({}, defaultListQuery)
+        }
         this.getList()
       } else if (tab.name === 'second') {
-        this.listQuery = Object.assign({}, defaultListQuery)
         this.tabsCurrent = this.listQuery.todayType = 1
+        if (this.$route.query.type) {
+          this.handleInfo()
+        } else {
+          this.listQuery = Object.assign({}, defaultListQuery)
+        }
         this.getList()
       }
     },