源文件
This commit is contained in:
74
jeepay-ui-uapp-agent/pages/adStart/adStart.vue
Normal file
74
jeepay-ui-uapp-agent/pages/adStart/adStart.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<StartPage :flag="!!vdata.list.length" />
|
||||
<!-- #endif -->
|
||||
<JeepayAdStart ref="refAdStart" :list="vdata.list" :time="10" :url="vdata.url" @openInt="openInt" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { $adList } from '@/http/apiManager.js'
|
||||
import storageManage from '@/util/storageManage.js'
|
||||
import { reactive, nextTick } from 'vue'
|
||||
import { onShow, onLoad } from '@dcloudio/uni-app'
|
||||
import StartPage from './components/StartPage.vue'
|
||||
onShow(() => {
|
||||
nextTick(() => {
|
||||
if (vdata.list.length > 0 && timeStartFlag && opneInterval) {
|
||||
opneInterval()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
let opneInterval = undefined
|
||||
const userInfo = storageManage.userInfo()
|
||||
const vdata = reactive({
|
||||
list: [],
|
||||
url: '',
|
||||
})
|
||||
let timeStartFlag = false
|
||||
const params = {
|
||||
appPlace: 1,
|
||||
}
|
||||
const isLogin = (flag) => {
|
||||
// vdata.url = storageManage.token()
|
||||
// ? (userInfo && userInfo.isEpUuser) ? ' ' : '/pages/workbench/workbench'
|
||||
// : '/pages/login/login'
|
||||
vdata.url = storageManage.token()
|
||||
? (userInfo && userInfo.isEpUuser) ? ' ' : '/pages/workbench/workbench'
|
||||
: '/pages/workbench/workbenchCopy'
|
||||
|
||||
if (flag) {
|
||||
if (vdata.url == '/pages/workbench/workbench')
|
||||
return uni.switchTab({
|
||||
url: vdata.url,
|
||||
})
|
||||
uni.redirectTo({
|
||||
url: vdata.url,
|
||||
fail: (info) => {
|
||||
console.log(info)
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
isLogin()
|
||||
const getList = async () => {
|
||||
$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()
|
||||
}
|
||||
}).catch(err => {
|
||||
opneInterval()
|
||||
})
|
||||
}
|
||||
getList()
|
||||
const openInt = (fun) => {
|
||||
opneInterval = fun
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
56
jeepay-ui-uapp-agent/pages/adStart/components/StartPage.vue
Normal file
56
jeepay-ui-uapp-agent/pages/adStart/components/StartPage.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<view class="start-wrapper" :class="{ 'start-wrapper-hiddren': flag }">
|
||||
<view class="iamge-box">
|
||||
<!-- <image class="start-logo" src="/static/logo.png" mode="scaleToFill" /> -->
|
||||
<image class="mch-name" src="/static/startImg/agent-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