fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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
98
99
100
101
102
103
104
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<template>
  <div class="invite-page">
    <div class="poster">
      <img class="bg_img" src="../../assets/images/blindBox/1.png" />
      <div class="time_item">
        <div class="time_text" v-if="promotion.promotionStartTime">
          活动时间:{{promotion.promotionStartTime || "无时间"}}-{{promotion.promotionEndTime || "无时间"}}
        </div>
      </div>
    </div>
    <div class="download-btn" @click="goApp('android')">下载APP</div>
    <!-- <div class="download-btn" @click="isShow = true">下载APP</div>
    <div v-show="isShow" class="overlay-style">
      <div class="overlay-con">
        <van-icon name="cross" class="close" @click="isShow = false" />
        <div class="tips-style">温馨提示</div>
        <div class="overlay-con-item">
          <div class="overlay-con-item1">
            <div class="overlay-i">
              <div class="overlay-i-line" @click="goApp('android')">
                <img src="../../assets/images/seckill/android.png" />
                <span style="margin-top: 10px">安卓</span>
              </div>
            </div>
            <div class="overlay-i">
              <div class="overlay-i-line" @click="goApp('ios')">
                <img src="../../assets/images/seckill/ios.png" />
                <span style="margin-top: 10px">IOS</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div> -->
    <guide-open :openStatus.sync="openStatus"></guide-open>
  </div>
</template>
 
<script>
import { getPromotionInfo } from '@/api/blindBox/index.js'
import guideOpen from '@/components/pop-up/guideOpen.vue'
export default {
  name: 'invite',
  components: {
    guideOpen
  },
  data() {
    return {
      promotion: {},
      isShow: false,
      openStatus: false
    }
  },
  created() {
    var params = {
      promotionId: this.$route.query.promotionId,
      bizId: 'B02'
    }
    getPromotionInfo({ params }).then(res => {
      if (res.code == 0) {
        this.promotion = res.data.promotion // 促销活动
      }
    })
  },
  methods: {
    // 下载app
    goApp() {
      let url;
      var isWeixin = this.is_weixin()
      // 判断是否在微信内置浏览器打开
      if (isWeixin) {
        this.openStatus = true
      } else {
        if (this.$root.isIos) {
          url = this.$store.getters.iosUrl
        } else {
          url = this.$store.getters.androidUrl
        }
        location.href = url
      }
    },
    is_weixin() {
      var ua = window.navigator.userAgent.toLowerCase()
      if (ua.match(/MicroMessenger/i) == 'micromessenger') {
        return true
      } else {
        return false
      }
    }
    // goApp (name) {
    //   if (name === 'ios') {
    //   } else if (name === 'android') {
    //     window.location.href = `https://wly-prod.oss-cn-chengdu.aliyuncs.com/ycloudfiles/01/100001/apkVersion/wlyxls.apk`
    //   }
    // }
  }
}
</script>
 
<style lang="scss" scoped>
.invite-page {
  .poster {
    position: relative;
    .bg_img {
      width: 100%;
    }
    .time_item {
      position: absolute;
      top: 860px;
      width: 100%;
      text-align: center;
      font-size: 24px;
      color: #994d00;
    }
  }
 
  .download-btn {
    position: fixed;
    top: 35px;
    right: 0;
    z-index: 101;
    background: #e49e14;
    color: #fff;
    padding: 12px 28px;
    font-size: 26px;
    border-top-left-radius: 28px;
    border-bottom-left-radius: 28px;
  }
 
  .tips-style {
    text-align: center;
    font-size: 32px;
    font-weight: 400;
    color: #333;
    height: 70px;
    line-height: 70px;
  }
 
  .overlay-style {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
 
    .overlay-con {
      background-color: #fff;
      width: 540px;
      height: 332px;
      border-radius: 10px;
      position: relative;
      font-size: 28px;
      color: #666;
 
      .close {
        position: absolute;
        right: 20px;
        top: 20px;
        font-size: 40px;
        cursor: pointer;
        z-index: 10000;
      }
 
      .overlay-con-item {
        height: calc(100% - 70px);
        display: flex;
        justify-content: center;
        align-items: center;
 
        .overlay-i {
          width: 168px;
          height: 52px;
          display: inline-block;
          margin-right: 15px;
          background: #e7e7e7;
 
          .overlay-i-line {
            text-align: center;
 
            > img {
              width: 40px;
              height: 40px;
              position: relative;
              top: 6px;
            }
 
            span {
              margin-left: 15px;
              font-size: 16px;
            }
          }
        }
      }
    }
  }
}
</style>