<template>
  <div class="guidelines">
    asdfas
    <div class="zhiying" v-if="micromessenger == 0">
      <img :src="zhiying" alt="">
    </div>
    <div class="zhifubao-tu" v-if="micromessenger != 0 && micromessenger != 1">
      <img :src="zhufubao" alt="">
    </div>
  </div>
</template>

<script>
  import common   from '../../util/common'
  import zhiying  from "../../assets/punchTheClock/zhiying.png"
  import zhufubao from "../../assets/punchTheClock/zhifubaotup.png"

  export default {
    name: "guidelines",
    data() {
      return {
        micromessenger: 0,  // 判断在微信里还是在浏览器里
        zhiying: zhiying,   // 图片
        zhufubao: zhufubao
      }
    },
    mounted() {
      // 0 -> 微信 1 -> 支付宝
      this.micromessenger = common.isWeixinBrowser()
      // 到浏览器里支付宝支付
      if (this.micromessenger == 1) {
        location.href = this.$route.query.pay_url
      }

      if(this.micromessenger != 0 && this.micromessenger != 1) {
        alert(999999)
      }
    }
  }
</script>

<style scoped lang="less">
  @import "../../util/public";

  .guidelines {
    width: 100%;
    height: 100%;
    padding-top: 3 * @toVw;
    background: #F3F2F7;
    text-align: center;

    .zhiying {
      width: 244 * @toVw;
      height: 361 * @toVw;
      margin-left: 112 * @toVw;
      box-sizing: border-box;
      img {
        width: 100%;
        height: 100%;
      }
    }

    .zhifubao-tu {
      width: 196 * @toVw;
      height: 166 * @toVw;
      position: absolute;
      top: 20%;
      left: 0;
      right: 0;
      margin: auto;
      img {
        width: 100%;
        height: 100%;
      }
    }
  }

</style>