guide.vue 3.65 KB
Newer Older
李晓兵's avatar
李晓兵 committed
1 2
<template>
  <div class="public-style navigateHrms">
李晓兵's avatar
李晓兵 committed
3
    <div ref="content" class="content">
李晓兵's avatar
李晓兵 committed
4 5 6
      <button class="skip-button" @click="goToMain">
        跳过
      </button>
李晓兵's avatar
李晓兵 committed
7 8 9
      <swipe
        ref="swipe" :auto="false" :loop="false" :show-indicators="false"
        class="swiper-container">
李晓兵's avatar
李晓兵 committed
10 11
        <swipe-item class="swiper-slide">
          <img :src="guide[0]">
李晓兵's avatar
李晓兵 committed
12
          <div v-show="isIosX" class="slider-button" @click="move">
李晓兵's avatar
李晓兵 committed
13 14 15 16 17
            <img src="./next@2x.png">
          </div>
        </swipe-item>
        <swipe-item class="swiper-slide">
          <img :src="guide[1]">
李晓兵's avatar
李晓兵 committed
18
          <div v-show="isIosX" class="slider-button" @click="move">
李晓兵's avatar
李晓兵 committed
19 20 21 22 23 24
            <img src="./next@2x.png">
          </div>
        </swipe-item>
        <swipe-item class="swiper-slide">
          <img :src="guide[2]">
          <div class="slider-button" @click="goToMain" >
李晓兵's avatar
李晓兵 committed
25
            <img v-show="isIosX" src="./login@2x.png">
李晓兵's avatar
李晓兵 committed
26 27 28 29 30 31 32 33
          </div>
        </swipe-item>
      </swipe>
    </div>
  </div>
</template>

<script>
李晓兵's avatar
李晓兵 committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
export default {
  data () {
    return {
      isIosX: false,
    }
  },
  computed: {
    guide () {
      const guide = []
      let height = window.innerHeight
      let width = window.innerWidth
      if (width >= 749 && height >= 1620) {
        guide.push(require('./guide1@3x.png'))
        guide.push(require('./guide2@3x.png'))
        guide.push(require('./guide3@3x.png'))
        this.isIosX = true
      } else {
        guide.push(require('./1@3x.png'))
        guide.push(require('./2@3x.png'))
        guide.push(require('./3@3x.png'))
李晓兵's avatar
李晓兵 committed
54
      }
李晓兵's avatar
李晓兵 committed
55 56

      return guide
李晓兵's avatar
李晓兵 committed
57
    },
李晓兵's avatar
李晓兵 committed
58 59 60 61 62 63 64
  },
  created: function () {
    window.localStorage.needGuid = 'false'
  },
  methods: {
    goToMain: function () {
      this.$router.push({name: 'Login'})
李晓兵's avatar
李晓兵 committed
65
    },
李晓兵's avatar
李晓兵 committed
66 67
    move () {
      this.$refs.swipe.move(1)
李晓兵's avatar
李晓兵 committed
68
    },
李晓兵's avatar
李晓兵 committed
69 70
  },
}
李晓兵's avatar
李晓兵 committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
</script>

<style lang="less" rel="stylesheet">

  .navigateHrms {

    height: 100%;
    width: 100%;
    background-color: rgba(233, 238, 240, 1);
    .content {
      padding-top: 0;
      height: 100%;
      width: 100%;
    }
    .hls-swipe-item {
      display: flex;
      align-items: center;
      img {
        width: 100%;
      }
    }
    .skip-button {
      margin: 0;
      padding: 0;
      position: absolute;
      top: 50px;
      right: 30px;
李晓兵's avatar
李晓兵 committed
98 99
      height: 40px;
      line-height: 40px;
李晓兵's avatar
李晓兵 committed
100
      text-align: center;
李晓兵's avatar
李晓兵 committed
101 102
      width: 40px;
      border-radius: 20px;
李晓兵's avatar
李晓兵 committed
103
      border: none;
李晓兵's avatar
李晓兵 committed
104
      font-size: 12px;
李晓兵's avatar
李晓兵 committed
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
      background: rgba(000, 000, 000, 0.4);
      color: white;
      z-index: 100;
      &.activated {
        opacity: 0.9;
        -webkit-transform: scale(0.95);
        transform: scale(0.95)
      }
    }
    .hls-swipe-indicators {
      bottom: 40px !important;
    }

    .slider-button {
      position: absolute;
      left: 25%;
      width: 50%;
      height: 200px;
      bottom: 78px;
      background: none;
      border: none;
      display: flex;
      display: -webkit-flex;
      align-items: center;
      -webkit-align-items: center;
      justify-content: center;
      -webkit-justify-content: center;
      img {
        width: 150px;
        height: 150px;
      }
    }
  }

  .platform-ios {
    .navigateHrms .skip-button {
      top: 70px;
    }
  }

  // iPhoneX适配
  @media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
    .platform-ios.platform-cordova:not(.fullscreen) {
      .navigateHrms .skip-button {
        top: 90px;
      }
    }
  }
  // iPhoneX Max适配
  @media (device-width: 414px) and (device-height: 896px) and (-webkit-min-device-pixel-ratio: 3) {
    .platform-ios.platform-cordova:not(.fullscreen) {
      .navigateHrms .skip-button {
        top: 90px;
      }
    }
  }

</style>