new_app/pages/login/download.vue

145 lines
3.2 KiB
Vue

<template>
<view class="containers">
<div class="bg" style="background: url('/static/download/appeq_bg.png') no-repeat center bottom / cover;"></div>
<view class="content">
<image class="logo" src="/static/download/appLogo.png"></image>
<view style="font-size: 40rpx;margin-top: 22rpx;color: #FFFFFF;font-weight: bold;">斯耀短剧APP</view>
<view style="font-size: 28rpx;margin-top: 16rpx;color: #FFFFFF;font-weight: bold;">海量电子榨菜 免费又过瘾</view>
<button class="confirm-btn" @click="download">{{data.confirmBtn}}</button>
</view>
<!-- #ifdef H5 -->
<div v-if="data.isWeixin" style="width: 100%;height: 100%;position: absolute;top: 0;background: url('/static/download/open_guide.png') no-repeat center bottom / cover;"></div>
<!-- #endif -->
</view>
</template>
<script setup>
import { reactive } from 'vue';
import { onLoad} from '@dcloudio/uni-app'
import { commonType } from '@/api/init.js';
let data = reactive({
openShare: false,
openShares: false,
confirmBtn: '斯耀短剧APP',
isWeixin: false,
})
onLoad(() => {
// #ifdef H5
let u = window.navigator.userAgent;
if ( uni.getSystemInfoSync().platform == 'ios') {
data.confirmBtn = "跳转网页版首页"
}
if ( u.toLowerCase().indexOf('micromessenger') !== -1) {
data.isWeixin = true
}
// #endif
})
function download() {
console.log(uni.getSystemInfoSync().platform == 'android')
if (uni.getSystemInfoSync().platform == 'android') {
commonType(49).then(res => {
console.log(res)
if (res && res.value) {
// #ifndef H5
plus.runtime.openURL(res.value, function(res) {
});
// #endif
// #ifdef H5
uni.setClipboardData({
data: res.value,
success: r => {
// this.$queue.showToast('邀请码复制成功');
uni.showToast({
title: '邀请码复制成功',
icon: 'none',
});
}
});
window.location.href = res.value;
// #endif
}
});
} else {
commonType(50).then(res => {
if (res && res.value) {
// #ifndef H5
plus.runtime.openURL(res.value, function(res) {
});
// #endif
// #ifdef H5
uni.setClipboardData({
data: res.value,
success: r => {
uni.showToast({
title: '邀请码复制成功',
icon: 'none',
});
}
});
uni.switchTab({
url: '/pages/index/index'
})
// window.location.href = res.data.value;
// #endif
}
});
}
}
</script>
<style lang="scss" scoped>
uni-page-body{
width: 100%;
height: 100%;
}
.containers {
width: 100%;
height: 100%;
.bg{
width: 100%;
height: 85%;
position: absolute;
}
.content{
position: relative;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.logo{
width: 124rpx;
height: 124rpx;
margin-top: -920rpx;
border-radius: 20rpx;
}
}
}
.confirm-btn {
width: 416rpx;
height: 90rpx;
line-height: 90rpx;
background: #FD5775;
color: #fff;
font-size: 32rpx;
font-weight: bold;
font-size: 32rpx;
color: #FFFFFF;
position: absolute;
left: 0;
right: 0;
bottom: 70rpx;
margin: auto;
}
</style>