jhzh
2024-03-23 0d29d9a2bf0d893a67f1263bb9525131a50a2128
src/App.vue
@@ -1,6 +1,6 @@
<template>
  <div id="app" :class="`${$state.theme === 'red' ? 'red-theme' : 'black-theme'}`">
    <div :class="`header-box`" v-if="hasHeader && title !== '用户登录'">
    <div :class="`header-box`" v-if="hasHeader && title !== $t('hj248')">
      <mt-header :title="title">
        <mt-button icon="back" slot="left" @click="$router.go(-1)"></mt-button>
        
@@ -29,12 +29,12 @@
</template>
<script>
import elalert from "@/components/elalert.vue";
import foot from "@/components/foot.vue";
import loginPopup from "@/components/loginDialog.vue";
import elalert from '@/components/elalert.vue'
import foot from '@/components/foot.vue'
import loginPopup from '@/components/loginDialog.vue'
//引入css
import "@/assets/iconfont/iconfont.css";
import "@/assets/iconfont/iconfont.ttf";
import '@/assets/iconfont/iconfont.css'
import '@/assets/iconfont/iconfont.ttf'
export default {
  components: {
@@ -42,76 +42,83 @@
    elalert,
    loginPopup
    },
  name: "App",
  name: 'App',
  created() {
     this.$state.theme="red";
     console.log(this.$state.theme,"asdasdasd")
    let title = this.$route.meta.title || "首页";
    this.title = title;
    this.$state.theme = 'red'
    console.log(this.$state.theme, 'asdasdasd')
    let title = this.$route.meta.title || this.$t('hj224')
    this.title = title
    if(this.$route.meta.is_Show){
      this.is_Show = this.$route.meta.is_Show;
      this.is_Show = this.$route.meta.is_Show
    }else{
      this.is_Show = true;
      this.is_Show = true
    }
    if (this.$route.meta.hasHeader) {
      this.hasHeader = true;
      this.hasHeader = true
    } else {
      this.hasHeader = false;
      this.hasHeader = false
    }
    if (this.$route.meta.iconRight) {
      this.iconRight = this.$route.meta.iconRight;
      this.iconRight = this.$route.meta.iconRight
    } else {
      this.iconRight = "default";
      this.iconRight = 'default'
    }
    // this.$store.state.className = window.localStorage.getItem('styleName')?window.localStorage.getItem('styleName'):'red'
  },
  watch: {
    $route(to, from) {
      let title = to.meta.title || "首页";
      this.title = title;
      let title = to.meta.title || this.$t('hj224')
      this.title = title
      if (to.meta.iconRight) {
        this.iconRight = to.meta.iconRight;
        this.iconRight = to.meta.iconRight
      } else {
        this.iconRight = "default";
        this.iconRight = 'default'
      }
      if (to.meta.hasHeader) {
        this.hasHeader = true;
        this.hasHeader = true
      } else {
        this.hasHeader = false;
        this.hasHeader = false
      }
      if (to.meta.index > from.meta.index) {
        console.log("slide-left");
        console.log('slide-left')
        //设置动画名称
        this.transitionName = "slide-left";
        this.transitionName = 'slide-left'
      } else {
        console.log("slide-right");
        this.transitionName = "slide-right";
        console.log('slide-right')
        this.transitionName = 'slide-right'
      }
    }
  },
  data() {
    return {
      title: "首页",
      title: '首页',
      hasHeader: false,
      iconRight: "default",
      iconRight: 'default',
      transitionName: '',
      is_Show:true,
      is_foot:true,
    };
      is_foot: true
    }
  },
  methods: {
    footColse(){
      this.$store.commit('dialogVisible',true);
      this.$store.commit('dialogVisible', true)
    },
    dialogClose(){
      this.$store.commit('dialogVisible',false);
      this.$store.commit('dialogVisible', false)
    }
  }
};
}
</script>
<style lang="less" scoped>
/deep/ .van-list__finished-text{
  line-height: 1.925926rem !important;
}
/deep/ .van-list__error-text{
  line-height: 1.925926rem !important;
}
#app {
  width: 100vw;
  height: 100vh;