| | |
| | | <template> |
| | | <div id="app"> |
| | | <div id="google_translate_element" |
| | | :style="$store.state.haslogin ? 'top: 18px;right: 273px;' : 'top: 18px;right: 184px;'" |
| | | style="position:absolute;z-index:2000;"></div> |
| | | <router-view /> |
| | | <!-- <login></login> --> |
| | | </div> |
| | | <div id="app"> |
| | | <myHead></myHead> |
| | | |
| | | <keep-alive> |
| | | <router-view v-if="$route.meta.keepAlive"></router-view> |
| | | </keep-alive> |
| | | |
| | | <router-view v-if="!$route.meta.keepAlive"></router-view> |
| | | |
| | | <div class="kf" @click="aRouter1"> |
| | | <img src="@/assets/images/kf.png" alt="" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | // import Login from "./components/Login"; |
| | | import myHead from "@/components/myHead.vue"; |
| | | import * as api from "@/axios/api.js"; |
| | | export default { |
| | | name: "App", |
| | | data() { |
| | | return { |
| | | myTitle: "标题", |
| | | keyWords: "keyWords", |
| | | description: "description", |
| | | }; |
| | | }, |
| | | // components: { |
| | | // Login, |
| | | // }, |
| | | |
| | | // metaInfo () { |
| | | // return { |
| | | // title: this.myTitle, |
| | | // meta: [ |
| | | // { vmid: 'keywords', name: 'keywords', content: this.keyWords }, |
| | | // { vmid: 'description', name: 'description', content: this.description } |
| | | // ] |
| | | // } |
| | | // }, |
| | | // watch: { |
| | | // $route(to, from) { |
| | | // if (to.path != '/login') { |
| | | // if (process.env.NODE_ENV != 'development') { |
| | | // require('electron').ipcRenderer.send("resize") |
| | | // } |
| | | // } |
| | | // } |
| | | // }, |
| | | created() { |
| | | var styleName = localStorage.getItem('styleName') |
| | | this.$store.commit('setSystemColor', styleName) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // var that = this |
| | | // 获取seo内容 |
| | | // this.$http.get('http://www.slhtc.com/seo/getSeo.action').then(res => { |
| | | // console.log(res) |
| | | // // 清楚选中数据 |
| | | // that.myTitle = res.data.data[0].title |
| | | // that.keyWords = res.data.data[0].keyword |
| | | // that.description = res.data.data[0].keyword |
| | | // }).catch(error => { |
| | | // console.log(error) |
| | | // }) |
| | | }, |
| | | mounted() { |
| | | // setInterval(()=>{ |
| | | |
| | | |
| | | // },500) |
| | | // this.isEn() |
| | | // var temp = setInterval(()=>{ |
| | | // var code = this.getCookie('googtrans') |
| | | // var dom = document.querySelector('.goog-te-menu-value > span') |
| | | // if(code == '/auto/en'){ |
| | | // dom.innerText = '中' |
| | | // }else if(code == '/auto/zh-CN'){ |
| | | // dom.innerText = 'En' |
| | | // }else{ |
| | | // dom.innerText = 'En' |
| | | // } |
| | | // },500) |
| | | |
| | | |
| | | |
| | | // setTimeout(()=>{ |
| | | // var script = document.createElement('script') |
| | | // script.src = 'https://translate.google.cn/translate_a/element.js?cb=googleTranslateElementInit' |
| | | // document.body.appendChild(script) |
| | | // console.log(script) |
| | | // },500) |
| | | }, |
| | | methods: { |
| | | delCookie(name) { |
| | | var exp = new Date(); |
| | | exp.setTime(exp.getTime() - 1); |
| | | var cval = this.getCookie(name); |
| | | if (cval != null) |
| | | document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString(); |
| | | }, |
| | | setCookie(name, value) { |
| | | var domain = document.domain; |
| | | var Days = 30; |
| | | var exp = new Date(); |
| | | exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000); |
| | | document.cookie = name + "=" + escape(value) + ";expires=Session" + ';path=/;domain=' + '' + domain; |
| | | }, |
| | | getCookie(name) { |
| | | var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); |
| | | if (arr = document.cookie.match(reg)) |
| | | return unescape(arr[2]); |
| | | else |
| | | return null; |
| | | }, |
| | | isEn() { |
| | | // var googFrameDom = document.querySelector('.goog-te-menu-frame') |
| | | // googFrameDom.style.display = googFrameDom.style.display === 'block' ? 'none' :'block' |
| | | // var code = this.getCookie('googtrans') |
| | | // console.log(code) |
| | | // this.delCookie('googtrans'); |
| | | // var newCode = code == '/auto/en' ? '/auto/zh-CN':'/auto/en' |
| | | // location.reload(); |
| | | // this.setCookie('googtrans',newCode) |
| | | } |
| | | } |
| | | name: "App", |
| | | components: { |
| | | myHead, |
| | | }, |
| | | data() { |
| | | return { |
| | | onlineService: "", |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getInfoSite(); |
| | | }, |
| | | methods: { |
| | | // 跳转客服页面 |
| | | aRouter1() { |
| | | window.open(this.onlineService); |
| | | // this.$message({ |
| | | // message: this.$t("kf1"), |
| | | // type: "warning", |
| | | // }); |
| | | }, |
| | | // 获取客服地址 |
| | | async getInfoSite() { |
| | | let data = await api.getInfoSite(); |
| | | if (data.status === 0) { |
| | | this.onlineService = data.data.onlineService; |
| | | } |
| | | // else { |
| | | // this.$store.commit("elAlertShow", { |
| | | // elAlertShow: true, |
| | | // elAlertText: data.msg |
| | | // }); |
| | | // } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | /* |
| | | @import url("./style/shallowtheme.css"); */ |
| | | @import url("./style/deeptheme.css"); |
| | | @import url("./style/shallowtheme.css"); |
| | | @import "https://at.alicdn.com/t/font_2023533_ngjjonxzq9m.css"; |
| | | @import url("./style/deep.css"); |
| | | @import url("./style/shallow.css"); |
| | | <style lang="scss"> |
| | | @import "./assets/style/reset.scss"; |
| | | /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/ |
| | | ::-webkit-scrollbar { |
| | | width: 8px; /*滚动条宽度*/ |
| | | height: 8px; /*滚动条高度*/ |
| | | } |
| | | |
| | | /*定义滚动条轨道 内阴影+圆角*/ |
| | | ::-webkit-scrollbar-track { |
| | | // -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); |
| | | border-radius: 10px; /*滚动条的背景区域的圆角*/ |
| | | background-color: rgba($color: #fff, $alpha: 0); /*滚动条的背景颜色*/ |
| | | } |
| | | |
| | | /*定义滑块 内阴影+圆角*/ |
| | | ::-webkit-scrollbar-thumb { |
| | | border-radius: 10px; /*滚动条的圆角*/ |
| | | // -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); |
| | | background-color: rgba($color: #ccc, $alpha: 0.5); /*滚动条的背景颜色*/ |
| | | } |
| | | |
| | | #app { |
| | | font-family: "Microsoft Yahei", "Avenir", Helvetica, Arial, sans-serif; |
| | | -webkit-font-smoothing: antialiased; |
| | | -moz-osx-font-smoothing: grayscale; |
| | | color: #000; |
| | | -moz-user-select: none; |
| | | -webkit-user-select: none; |
| | | -ms-user-select: none; |
| | | user-select: none; |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: 100%; |
| | | } |
| | | |
| | | .kf { |
| | | width: 48px; |
| | | height: 48px; |
| | | position: fixed; |
| | | bottom: 16px; |
| | | right: 16px; |
| | | cursor: pointer; |
| | | |
| | | img { |
| | | width: 100%; |
| | | height: 100%; |
| | | border-radius: 50%; |
| | | } |
| | | } |
| | | </style> |