App.vue 3.69 KB
<template>
  <div id="app">
    <!-- <div id="nav">
      <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link>
    </div>-->
    <router-view />

    <biz-model v-model="shareModel"></biz-model>
  </div>
</template>


<script>
let urls = {
  share: "/jiajiaCHApi/app/works/share"
};

import BizModel from "@/components/biz-model/biz-model";
import { httpPost } from "@/api/fetch-api";

export default {
  data() {
    return {
      shareModel: {
        show: false,
        title: "",
        content: "",
        index: "default",
        btnShow: false,
        btnText: "",
        confirmHandler: null,
        labelBtnShow: false,
        labelBtnText: "",
        labelBtnHandler: null
      }
    };
  },
  methods: {
    init() {
      // alert("init");
      // as.appSuccess = this.shareSuccessHandler;
      // as.success = this.shareSuccessHandler;
    },
    shareSuccessHandler() {
      httpPost({ url: urls.share, data: { worksCode: "" } }).then(res => {
        if (res == 1) {
          let that = this;
          this.shareModel.show = true;
          this.shareModel.title = "分享成功";
          this.shareModel.content = "您已获得一次抽奖机会";
          this.shareModel.btnShow = true;
          this.shareModel.btnText = "前往抽奖";
          this.shareModel.confirmHandler = function() {
            that.$router.push("/draw");
          };
          this.shareModel.labelBtnShow = false;
        }
      });
    }
  },
  created() {
    this.init();
  },
  components: {
    BizModel
  }
};
</script>

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

#app {
  /* font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px; */
  border: 0;
  margin: 0;
  padding: 0;
}

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

body {
  background-color: #74cb35;
}

.app__width {
  width: 750px;
}

.app__width {
  width: 750px;
}

.app__inner {
  margin: 20px;
}

.app__title {
  font-size: $fontSize;
  line-height: $fontSize + 4px;
  font-weight: bold;
  padding-bottom: 10px;
  margin-bottom: 20px;
  border-bottom: 0.5px solid #eeeeee;
}

.app__desc {
  font-size: $fontSizeSmaller;
  line-height: $fontSizeSmaller + 2px;
  margin-bottom: 20px;
  color: $colorGray;
}

.app__bgc {
  position: fixed;
  background-color: #ffffff;
  width: 100%;
  height: 100%;
}

.app__bg {
  position: absolute;
  width: 100%;
  height: 100%;
}

.app__top-shadow {
  position: fixed;
  width: 750px;
  height: 1px;
  box-shadow: 0px 4px 0.9px 0.1px rgba(6, 0, 1, 0.07);
  background-color: #ffffff;
}

.app__content {
  position: relative;
}

.sys-btn {
  width: 430px;
  height: 128px;
  background: url(./assets/imgs/btn.png) no-repeat;
  background-size: 100%;
  text-align: center;
  line-height: 118px;
  color: #fff;
  font-size: 50px;
  font-weight: 600;
  margin: auto;
}

.sys-btn-02 {
  width: 342px;
  height: 110px;
  background: url(./assets/imgs/btn2.png) no-repeat;
  background-size: 100%;
  text-align: center;
  line-height: 100px;
  color: #fff;
  font-size: 40px;
  font-weight: 600;
  margin: auto;
}

.sys-container-panel {
  margin: auto;
  width: 692px;
  background-color: #fff;
  border-radius: 50px;
  box-shadow: 5px 5px 15px #8bc263;
  position: relative;
  .container-title {
    width: 505px;
    height: 84px;
    line-height: 104px;
    background: url(./assets/imgs/title-bg.png) no-repeat;
    background-size: 100%;
    position: absolute;
    left: 93.5px;
    top: -42px;
    font-size: 38px;
    font-weight: 600;
    color: #e8e8e8;
  }
}

.home {
  position: relative;
  text-align: center;
  background-color: #74cb35;
}
</style>