123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- module.exports = {
- data() {
- return {
-
- }
- },
- onLoad() {
-
- this.updateCustomBarInfo()
- },
- methods: {
-
- goBack() {
-
- const pages = getCurrentPages()
- if (pages && pages.length > 0) {
- const firstPage = pages[0]
- if (pages.length == 1 && (!firstPage.route || firstPage.route != 'pages/index')) {
- uni.reLaunch({
- url: '/pages/index'
- })
- } else {
- uni.navigateBack({
- delta: 1
- })
- }
- } else {
- uni.reLaunch({
- url: '/pages/index'
- })
- }
- },
-
- async updateCustomBarInfo() {
-
- let customBarHeight = this.vuex_custom_bar_height
- let statusBarHeight = this.vuex_status_bar_height
-
- if (!customBarHeight) {
- try {
- const navBarInfo = await this.$t.updateCustomBar()
- customBarHeight = navBarInfo.customBarHeight
- statusBarHeight = navBarInfo.statusBarHeight
- } catch(e) {
- setTimeout(() => {
- this.updateCustomBarInfo()
- }, 10)
- return
- }
- }
-
-
- this.$t.vuex('vuex_status_bar_height', statusBarHeight)
- this.$t.vuex('vuex_custom_bar_height', customBarHeight)
- }
- }
- }
|