first
This commit is contained in:
64
pages/adStart/adStart.vue
Normal file
64
pages/adStart/adStart.vue
Normal file
@@ -0,0 +1,64 @@
|
||||
<template>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<StartPage :flag="!!vdata.list.length" />
|
||||
<!-- #endif -->
|
||||
<JeepayAdStart ref="refAdStart" :list="vdata.list" :time="6" :url="vdata.url" @openInt="openInt" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { $adList } from '@/http/apiManager.js';
|
||||
import storageManage from '@/commons/utils/storageManage.js';
|
||||
import { reactive } from 'vue';
|
||||
import appConfig from '@/config/appConfig.js';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import StartPage from './components/StartPage';
|
||||
onShow(() => {
|
||||
if (vdata.list.length > 0 && timeStartFlag && opneInterval) {
|
||||
opneInterval();
|
||||
}
|
||||
});
|
||||
|
||||
let opneInterval = undefined;
|
||||
const vdata = reactive({
|
||||
list: [],
|
||||
url: ''
|
||||
});
|
||||
let timeStartFlag = false;
|
||||
const params = {
|
||||
appPlace: 1
|
||||
};
|
||||
const isLogin = (flag) => {
|
||||
// vdata.url = storageManage.token() ? '/pages/index/index' : '/pages/index/indexCopy'
|
||||
vdata.url = storageManage.token() ? '/pages/index/index' : '/pages/login/index';
|
||||
if (flag) {
|
||||
console.log(vdata.url);
|
||||
if (vdata.url == '/pages/index/index')
|
||||
return uni.switchTab({
|
||||
url: vdata.url
|
||||
});
|
||||
uni.redirectTo({
|
||||
url: vdata.url
|
||||
});
|
||||
}
|
||||
};
|
||||
isLogin();
|
||||
$adList(params)
|
||||
.then(({ bizData }) => {
|
||||
const adDate = bizData.map((v) => JSON.parse(v.appContent));
|
||||
vdata.list = [...adDate.flat()];
|
||||
if (!vdata.list.length) {
|
||||
isLogin(true);
|
||||
} else {
|
||||
opneInterval();
|
||||
timeStartFlag = true;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
opneInterval();
|
||||
});
|
||||
const openInt = (fun) => {
|
||||
opneInterval = fun;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
58
pages/adStart/components/StartPage.vue
Normal file
58
pages/adStart/components/StartPage.vue
Normal file
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<view class="start-wrapper" :class="{ 'start-wrapper-hiddren': flag }">
|
||||
<view class="iamge-box">
|
||||
<!-- <image class="start-logo" src="/static/logo.svg" mode="scaleToFill" /> -->
|
||||
<image class="mch-name" src="/static/startImg/mch-name.svg" mode="scaleToFill" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue"
|
||||
const props = defineProps({
|
||||
flag: { type: Boolean, default: false }
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.start-wrapper {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 9999999999;
|
||||
min-height: 100vh;
|
||||
background: url("/static/startImg/start-bg.svg") no-repeat top;
|
||||
background-size: 100%;
|
||||
// background: #fff;
|
||||
|
||||
.iamge-box {
|
||||
transform: translateY(300rpx);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.start-logo {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.mch-name {
|
||||
margin-top: 80rpx;
|
||||
width: 300rpx;
|
||||
height: 150rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.start-wrapper-hiddren {
|
||||
transition: 1s cubic-bezier(0.785, 0.135, 0.15, 0.86);
|
||||
bottom: auto;
|
||||
top: -100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user