App.vue 5.15 KB
<template>
  <div id="app">
    <v-header></v-header>
    <main ref="container" class="main-container">
      <router-view />
    </main>
    <v-footer></v-footer>
  </div>
</template>


<script>
import { mapGetters, mapActions, mapState } from "vuex";
import { getCookie } from "@utils/utils.js";
import VHeader from "@components/home/header/header.vue";
import VFooter from "@components/home/footer/footer.vue";
var UA = require("ua-device");

export default {
  name: "app",
  components: {
    VHeader,
    VFooter
  },
  computed: {
    ...mapState({
      isMobile: state => state.isMobile
    })
  },
  methods: {
    ...mapActions(["pcorphone"])
  },
  created() {
    let _this = this;
    // 设置UA
    let output = new UA(navigator.userAgent);
    let deviceType = output.device.type;
    let isMobile = deviceType == "mobile";
    this.$store.commit("IS_MOBILE", isMobile);

    //
    let userInfoStr = decodeURIComponent(getCookie("_user_profile"));
    if (userInfoStr) {
      try {
        let userInfo = JSON.parse(decodeURIComponent(userInfoStr));
        this.$store.commit("SET_USER_INFO", userInfo);
      } catch (e) {}
    }
  }
};
</script>

<style lang="scss">
@import "@/styles/_support";

html {
  font-family: "Microsoft YaHei", "Arial";
  font-size: 12px;
  word-spacing: 1px;
  word-break: break-word;
  text-rendering: optimizeLegibility;
	// color: #333;
	color: $cFontGray;
  background-color: #ffffff;
  // -ms-text-size-adjust: 100%;
  // -webkit-text-size-adjust: 100%;
  // -moz-osx-font-smoothing: grayscale;
  // -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

body{
	// font-size: 14px;
}

html,
body {
  -webkit-text-size-adjust: none;
}

body,
div {
  border: 0;
  margin: 0;
  padding: 0;
}

*,
*:before,
*:after {
  box-sizing: border-box;
  margin: 0;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
p,
blockquote,
dl,
dt,
dd,
ul,
ol,
li,
pre,
form,
fieldset,
legend,
button,
input,
textarea,
th,
td,
iframe {
  margin: 0;
  padding: 0;
}

img,
article,
aside,
details,
figcaption,
figure,
footer,
header,
menu,
nav,
section,
summary,
time,
mark,
audio,
video {
  display: block;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: 100%;
}

fieldset,
img {
  border: 0;
}

address,
caption,
cite,
dfn,
em,
th,
var,
i,
em {
  font-style: normal;
  font-weight: normal;
}

ol,
ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
  &:hover {
    text-decoration: none;
  }
}

a,
label,
button,
input,
select {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

input,
select,
button {
  // font: 100% tahoma, "\5b8b\4f53", arial;
  vertical-align: baseline;
  border-radius: 0;
  background-color: transparent;
}

select {
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
select::-ms-expand {
  display: none;
}

input {
  background: none;
  outline: none;
  border: none;
}

button::-moz-focus-inner,
input,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner {
  border: none;
}

input[type="checkbox"],
input[type="radio"] {
  vertical-align: middle;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  margin: 0;
}

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px white inset;
}

input[type="search"],
input[type="tel"],
input[type="text"],
input {
  -webkit-appearance: none; /*去除系统默认的样式*/
  -webkit-box-sizing: content-box;
  // font-family: inherit;
  font-size: 100%;
  box-sizing: border-box;
}
input::-webkit-search-decoration,
input::-webkit-search-cancel-button {
  display: none;
}

// input::-webkit-input-placeholder {
//   color: $cGray !important;
// }

::-webkit-input-placeholder {
  color: $cGray;
  opacity: 1;
}
:-moz-placeholder {
  color: $cGray;
  opacity: 1;
}
::-moz-placeholder {
  color: $cGray;
  opacity: 1;
}
:-ms-input-placeholder {
  color: $cGray;
  opacity: 1;
}

select,
input,
option {
  color: $cLightBlack;
}

textarea {
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  overflow: auto;
  resize: none;
  // font: 100% tahoma, "\5b8b\4f53", arial;
  color: $cLightBlack;
}

.cOrange {
  color: $cOrange;
}
.cGreen {
  color: $cGreen;
}
.cGray {
  color: $cGray;
}
.cDark {
  color: $cDark;
}

#app {
  border: 0;
  margin: 0;
  padding: 0;
}

.main-container {
  position: relative;
  margin: 0 auto;
  width: 100%;
  // max-width: 1024px; // 设计稿宽度
  // min-height: 40rem;

  &::after {
    display: table;
    content: "";
    clear: both;
  }
}

.content {
  max-width: 1024px;
  width: 100%;
  margin: 0 auto;
}

.box-w {
  // max-width: 1024px;
  max-width: 950px;
  width: 100%;
  margin: 0 auto;
}

.box {
  max-width: 950px;
  width: 100%;
  margin: 0 auto;
}

.focus{
  border: 1px solid $cOrange ;
}


.swiper-pagination-bullet {
  width: 1rem !important;
  height: 1rem !important;
}

.swiper-pagination-bullet-active {
  background: $cOrange !important;
}


.ipt:focus {
  border-color: $cOrange !important;
}

.ipt.err {
  border-color: $cOrange !important;
}

</style>