소스 검색

静态页面

xcx 4 년 전
부모
커밋
f04edf18e8
3개의 변경된 파일51개의 추가작업 그리고 0개의 파일을 삭제
  1. 17
    0
      src/pages/KaiJiangZhanShi/SubIndex/index.vue
  2. 17
    0
      src/pages/WoDe/UserCenter/index.vue
  3. 17
    0
      src/pages/index/ShouYe/index.vue

+ 17
- 0
src/pages/KaiJiangZhanShi/SubIndex/index.vue 파일 보기

66
   name: '',
66
   name: '',
67
   data () {
67
   data () {
68
     return {
68
     return {
69
+      ExitAppStatus: false
69
     }
70
     }
70
   },
71
   },
71
   computed: {
72
   computed: {
81
     this.Init()
82
     this.Init()
82
   },
83
   },
83
   mounted () {
84
   mounted () {
85
+    if (window.history && window.history.pushState) {
86
+      this.ExitAppStatus = false
87
+      window.history.pushState(null, null, document.URL)
88
+      window.addEventListener('popstate', this.RouterBack, false)
89
+    }
84
     this.$nextTick(() => {
90
     this.$nextTick(() => {
85
     })
91
     })
86
   },
92
   },
93
+  destroyed () {
94
+    window.removeEventListener('popstate', this.RouterBack, false)
95
+  },
87
   methods: {
96
   methods: {
88
     ...mapIndexActions([
97
     ...mapIndexActions([
89
       'GetNewstSportsRes',
98
       'GetNewstSportsRes',
90
       'GetNewstLotteryRes'
99
       'GetNewstLotteryRes'
91
     ]),
100
     ]),
101
+    RouterBack () {
102
+      if (this.ExitAppStatus) {
103
+
104
+      } else {
105
+        this.Toast('再按一次退出应用')
106
+        this.ExitAppStatus = true
107
+      }
108
+    },
92
     Init (done = () => { }) {
109
     Init (done = () => { }) {
93
       this.GetNewstSportsRes().then(() => {
110
       this.GetNewstSportsRes().then(() => {
94
         done()
111
         done()

+ 17
- 0
src/pages/WoDe/UserCenter/index.vue 파일 보기

44
   name: '',
44
   name: '',
45
   data () {
45
   data () {
46
     return {
46
     return {
47
+      ExitAppStatus: false,
47
       UserTabList: [
48
       UserTabList: [
48
         { name: '我的彩票', desc: '查看购买彩票详情', img: require('../../../assets/img/icon1.png'), router: 'WoDeCaiPiao' },
49
         { name: '我的彩票', desc: '查看购买彩票详情', img: require('../../../assets/img/icon1.png'), router: 'WoDeCaiPiao' },
49
         { name: '账户明细', desc: '流水明细', img: require('../../../assets/img/icon10.png'), router: 'ZhangHaoMingXi' },
50
         { name: '账户明细', desc: '流水明细', img: require('../../../assets/img/icon10.png'), router: 'ZhangHaoMingXi' },
69
   created () {
70
   created () {
70
   },
71
   },
71
   mounted () {
72
   mounted () {
73
+    if (window.history && window.history.pushState) {
74
+      this.ExitAppStatus = false
75
+      window.history.pushState(null, null, document.URL)
76
+      window.addEventListener('popstate', this.RouterBack, false)
77
+    }
72
     this.$nextTick(() => {
78
     this.$nextTick(() => {
73
     })
79
     })
74
   },
80
   },
81
+  destroyed () {
82
+    window.removeEventListener('popstate', this.RouterBack, false)
83
+  },
75
   methods: {
84
   methods: {
76
     ...mapUserActions([
85
     ...mapUserActions([
77
       'GetCurrentUserInfo'
86
       'GetCurrentUserInfo'
78
     ]),
87
     ]),
88
+    RouterBack () {
89
+      if (this.ExitAppStatus) {
90
+
91
+      } else {
92
+        this.Toast('再按一次退出应用')
93
+        this.ExitAppStatus = true
94
+      }
95
+    },
79
     UserInfoChange () {
96
     UserInfoChange () {
80
     }
97
     }
81
   }
98
   }

+ 17
- 0
src/pages/index/ShouYe/index.vue 파일 보기

73
   name: 'index',
73
   name: 'index',
74
   data () {
74
   data () {
75
     return {
75
     return {
76
+      ExitAppStatus: false,
76
       bannerList: [
77
       bannerList: [
77
         {
78
         {
78
           image: 'https://niucai.oss-cn-beijing.aliyuncs.com/app/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20201101151720.png',
79
           image: 'https://niucai.oss-cn-beijing.aliyuncs.com/app/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20201101151720.png',
101
     this.Init()
102
     this.Init()
102
   },
103
   },
103
   mounted () {
104
   mounted () {
105
+    if (window.history && window.history.pushState) {
106
+      this.ExitAppStatus = false
107
+      window.history.pushState(null, null, document.URL)
108
+      window.addEventListener('popstate', this.RouterBack, false)
109
+    }
104
     this.$nextTick(() => {
110
     this.$nextTick(() => {
105
     })
111
     })
106
   },
112
   },
113
+  destroyed () {
114
+    window.removeEventListener('popstate', this.RouterBack, false)
115
+  },
107
   methods: {
116
   methods: {
108
     ...mapActions([
117
     ...mapActions([
109
       'GetAllLotteryType'
118
       'GetAllLotteryType'
116
     ...mapIndexMutations([
125
     ...mapIndexMutations([
117
       'EmptyBanner'
126
       'EmptyBanner'
118
     ]),
127
     ]),
128
+    RouterBack () {
129
+      if (this.ExitAppStatus) {
130
+
131
+      } else {
132
+        this.Toast('再按一次退出应用')
133
+        this.ExitAppStatus = true
134
+      }
135
+    },
119
     Init (done = () => { }) { // 初始化
136
     Init (done = () => { }) { // 初始化
120
       this.EmptyBanner()
137
       this.EmptyBanner()
121
       this.GetBanner({ queryData: { pageNum: 1, pageSize: 10, status: 1, adType: 'app-index-banner' } }).then(() => { // 获取banner
138
       this.GetBanner({ queryData: { pageNum: 1, pageSize: 10, status: 1, adType: 'app-index-banner' } }).then(() => { // 获取banner