| | |
| | | <template> |
| | | <div id="app" :class="`${$state.theme === 'red' ? 'red-theme' : 'black-theme'}`"> |
| | | <div :class="`header-box`" v-if="hasHeader && title !== '用户登录'"> |
| | | <div |
| | | id="app" |
| | | :class="`${$state.theme === 'red' ? 'red-theme' : 'black-theme'}`" |
| | | > |
| | | <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> |
| | | |
| | | |
| | | <div v-if="!is_Show"> |
| | | <template v-if="iconRight == 'search'"> |
| | | <img slot="right" class="search-right" src="./assets/ico/fangdajing.png" alt /> |
| | | </template> |
| | | <template v-else> |
| | | <mt-button icon="more" slot="right"></mt-button> |
| | | </template> |
| | | <img |
| | | slot="right" |
| | | class="search-right" |
| | | src="./assets/ico/fangdajing.png" |
| | | alt |
| | | /> |
| | | </template> |
| | | <template v-else> |
| | | <mt-button icon="more" slot="right"></mt-button> |
| | | </template> |
| | | </div> |
| | | |
| | | </mt-header> |
| | | </div> |
| | | <div class="body-box"> |
| | | <transition |
| | | :name="transitionName" |
| | | > |
| | | <transition :name="transitionName"> |
| | | <router-view></router-view> |
| | | </transition> |
| | | </div> |
| | | <foot v-if="$route.meta.show !== true" @close="footColse"></foot> |
| | | <elalert></elalert> |
| | | <loginPopup @close="dialogClose"/> |
| | | <loginPopup @close="dialogClose" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import elalert from "@/components/elalert.vue"; |
| | | import foot from "@/components/foot.vue"; |
| | | import loginPopup from "@/components/loginDialog.vue"; |
| | | //引入css |
| | | // 引入css |
| | | import "@/assets/iconfont/iconfont.css"; |
| | | import "@/assets/iconfont/iconfont.ttf"; |
| | | import { getUserInfodata } from "./axios/api"; |
| | | |
| | | export default { |
| | | components: { |
| | | foot, |
| | | elalert, |
| | | loginPopup |
| | | }, |
| | | loginPopup, |
| | | }, |
| | | name: "App", |
| | | created() { |
| | | this.$state.theme="red"; |
| | | console.log(this.$state.theme,"asdasdasd") |
| | | let title = this.$route.meta.title || "首页"; |
| | | this.getUserInfo(); |
| | | 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){ |
| | | if (this.$route.meta.is_Show) { |
| | | this.is_Show = this.$route.meta.is_Show; |
| | | }else{ |
| | | } else { |
| | | this.is_Show = true; |
| | | } |
| | | if (this.$route.meta.hasHeader) { |
| | |
| | | }, |
| | | watch: { |
| | | $route(to, from) { |
| | | let title = to.meta.title || "首页"; |
| | | let title = to.meta.title || this.$t("hj224"); |
| | | this.title = title; |
| | | if (to.meta.iconRight) { |
| | | this.iconRight = to.meta.iconRight; |
| | |
| | | |
| | | if (to.meta.index > from.meta.index) { |
| | | console.log("slide-left"); |
| | | //设置动画名称 |
| | | // 设置动画名称 |
| | | this.transitionName = "slide-left"; |
| | | } else { |
| | | console.log("slide-right"); |
| | | this.transitionName = "slide-right"; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | title: "首页", |
| | | hasHeader: false, |
| | | iconRight: "default", |
| | | transitionName: '', |
| | | is_Show:true, |
| | | is_foot:true, |
| | | transitionName: "", |
| | | is_Show: true, |
| | | is_foot: true, |
| | | }; |
| | | }, |
| | | methods: { |
| | | footColse(){ |
| | | this.$store.commit('dialogVisible',true); |
| | | async getUserInfo() { |
| | | // 获取用户信息 |
| | | // let showcookie = this.getCookie('USER_TOKEN'); |
| | | let data = await getUserInfodata(); |
| | | if (data.status === 0) { |
| | | // this.getProductSetting() |
| | | this.$store.state.userInfo = data.data; |
| | | } else { |
| | | this.$store.commit("elAlertShow", { |
| | | elAlertShow: true, |
| | | elAlertText: data.msg, |
| | | }); |
| | | } |
| | | this.$store.state.user = this.user; |
| | | }, |
| | | dialogClose(){ |
| | | this.$store.commit('dialogVisible',false); |
| | | } |
| | | } |
| | | footColse() { |
| | | this.$store.commit("dialogVisible", true); |
| | | }, |
| | | dialogClose() { |
| | | 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; |
| | |
| | | overflow-y: auto; |
| | | } |
| | | &.red-theme { |
| | | background: rgb(241,242,246); |
| | | color:#000; |
| | | background: rgb(241, 242, 246); |
| | | color: #000; |
| | | /deep/.mint-header { |
| | | background: none; |
| | | .mint-header-title { |
| | |
| | | color: #212121; |
| | | } |
| | | } |
| | | /deep/.van-swipe-item { |
| | | color: #000; |
| | | } |
| | | /deep/.navs_content { |
| | | background: #fff!important; |
| | | } |
| | | /deep/.fo_content { |
| | | background: #fff; |
| | | } |
| | | /deep/.news-tab{ |
| | | background: #fff; |
| | | } |
| | | /deep/.mint-tab-item-label { |
| | | color: #000; |
| | | font-size: .26rem; |
| | | |
| | | } |
| | | /deep/.top_title{ |
| | | color: #000; |
| | | } |
| | | /deep/.titContent{ |
| | | color:#000; |
| | | } |
| | | /deep/.mint-navbar { |
| | | background: #fff; |
| | | } |
| | | /deep/.mint-tab-item { |
| | | background: #fff; |
| | | border: none; |
| | | } |
| | | /deep/.footCss{ |
| | | background: #fff; |
| | | } |
| | | /deep/.newDetail-tits{ |
| | | color: #aaa; |
| | | } |
| | | /deep/.van-skeleton__row, .van-skeleton__title{ |
| | | background-color: #fff!important; |
| | | } |
| | | /deep/.van-swipe-item { |
| | | color: #000; |
| | | } |
| | | /deep/.navs_content { |
| | | background: #fff !important; |
| | | } |
| | | /deep/.fo_content { |
| | | background: #fff; |
| | | } |
| | | /deep/.news-tab { |
| | | background: #fff; |
| | | } |
| | | /deep/.mint-tab-item-label { |
| | | color: #000; |
| | | font-size: 0.26rem; |
| | | } |
| | | /deep/.top_title { |
| | | color: #000; |
| | | } |
| | | /deep/.titContent { |
| | | color: #000; |
| | | } |
| | | /deep/.mint-navbar { |
| | | background: #fff; |
| | | } |
| | | /deep/.mint-tab-item { |
| | | background: #fff; |
| | | border: none; |
| | | } |
| | | /deep/.footCss { |
| | | background: #fff; |
| | | } |
| | | /deep/.newDetail-tits { |
| | | color: #aaa; |
| | | } |
| | | /deep/.van-skeleton__row, |
| | | .van-skeleton__title { |
| | | background-color: #fff !important; |
| | | } |
| | | } |
| | | &.black-theme { |
| | | // background: #16171d; |
| | | // background: rgb(14, 14, 15); |
| | | background: rgb(33, 33, 43); |
| | | |
| | | /deep/.navs_content { |
| | | background: #272733; |
| | | } |
| | | /deep/.fo_content { |
| | | background: #272733; |
| | | } |
| | | /deep/.news-tab{ |
| | | background: #272733; |
| | | } |
| | | /deep/.mint-navbar { |
| | | background: #272733; |
| | | } |
| | | /deep/.mint-tab-item-label { |
| | | color: #fff; |
| | | font-size: .26rem; |
| | | |
| | | } |
| | | /deep/.titContent{ |
| | | color:#000; |
| | | } |
| | | /deep/.mint-tab-container {} |
| | | |
| | | /deep/.mint-tab-item { |
| | | background: #272733; |
| | | } |
| | | /deep/.van-swipe-item { |
| | | color: #000; |
| | | } |
| | | /deep/.footCss{ |
| | | background: rgb(33, 33, 43); |
| | | } |
| | | /deep/.newDetail-tits{ |
| | | color: #999; |
| | | } |
| | | |
| | | /deep/.navs_content { |
| | | background: #272733; |
| | | } |
| | | /deep/.fo_content { |
| | | background: #272733; |
| | | } |
| | | /deep/.news-tab { |
| | | background: #272733; |
| | | } |
| | | /deep/.mint-navbar { |
| | | background: #272733; |
| | | } |
| | | /deep/.mint-tab-item-label { |
| | | color: #fff; |
| | | font-size: 0.26rem; |
| | | } |
| | | /deep/.titContent { |
| | | color: #000; |
| | | } |
| | | /deep/.mint-tab-container { |
| | | } |
| | | |
| | | /deep/.mint-tab-item { |
| | | background: #272733; |
| | | } |
| | | /deep/.van-swipe-item { |
| | | color: #000; |
| | | } |
| | | /deep/.footCss { |
| | | background: rgb(33, 33, 43); |
| | | } |
| | | /deep/.newDetail-tits { |
| | | color: #999; |
| | | } |
| | | } |
| | | } |
| | | .search-right { |
| | |
| | | .mint-search-list { |
| | | position: relative !important; |
| | | } |
| | | .topLeft{ |
| | | |
| | | .topLeft { |
| | | } |
| | | |
| | | /deep/.el-alert{ |
| | | width: 75%!important; |
| | | height: 1.1rem!important; |
| | | position: absolute!important; |
| | | top: 0!important; |
| | | bottom: 0!important; |
| | | left: 0!important; |
| | | right: 0!important; |
| | | margin: auto!important; |
| | | font-size: 0.36rem!important; |
| | | /deep/.el-alert { |
| | | width: 75% !important; |
| | | height: 1.1rem !important; |
| | | position: absolute !important; |
| | | top: 0 !important; |
| | | bottom: 0 !important; |
| | | left: 0 !important; |
| | | right: 0 !important; |
| | | margin: auto !important; |
| | | font-size: 0.36rem !important; |
| | | } |
| | | /deep/.el-alert__title{ |
| | | font-size: 0.36rem!important; |
| | | /deep/.el-alert__title { |
| | | font-size: 0.36rem !important; |
| | | } |
| | | /deep/.el-icon-close::before{ |
| | | display: none; |
| | | /deep/.el-icon-close::before { |
| | | display: none; |
| | | } |
| | | /deep/.icon-icon_A::before{ |
| | | font-size: 0.6rem!important; |
| | | /deep/.icon-icon_A::before { |
| | | font-size: 0.6rem !important; |
| | | } |
| | | </style> |