123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <template>
- <div class="ad-main">
- <stack>
- <div class="weclome">
- </div>
- <div class="ad-page" style="{{ styleObj }}" if="{{hasBanner}}" @click="goActivity">
- <div class="top-timer">
- <text class="number" @click="skep">跳过{{time}}</text>
- </div>
- <div class="bottom-line">
- <image src="../../assets/imgs/logo.png"></image>
- <div class="desc">
- <text class="title"> 追书云</text>
- <text class="more"> 给你极致的阅读体验</text>
- </div>
- </div>
- </div>
- </stack>
- </div>
- </template>
- <script>
- import storage from "@system.storage";
- import router from '@system.router';
- import { userOptions } from '../../api/index.js';
- export default {
- protected: {
- name: null,
- icon: null
- },
- private: {
- time: 6,
- timer: null,
- hasBanner: false,
- open_alert: null,
- styleObj: {
- backgroundImage: ""
- }
- },
- onInit() {
- this.timer = setInterval(() => {
- if (this.time > 0) {
- this.time = this.time - 1;
- } else {
- router.back();
- }
- }, 1000);
- setTimeout(async () => {
- let option = this.$app.getAppData('options');
- let position;
- if (!option) {
- let data = await userOptions();
- this.$app.setAppData('options', data);
- position = data.position;
- if (position.open_alert) {
- this.open_alert = position.open_alert[0];
- this.styleObj.backgroundImage = this.open_alert.img;
- this.hasBanner = true;
- } else {
- setTimeout(() => {
- router.back();
- }, 1500)
- }
- } else {
- position = option['position'];
- if (position && position.open_alert && position.open_alert.length > 0) {
- this.open_alert = position.open_alert[0];
- this.styleObj.backgroundImage = this.open_alert.img;
- this.hasBanner = true;
- } else {
- setTimeout(() => {
- router.back();
- }, 1500)
- }
- }
- }, 500)
- },
- onDestroy() {
- clearInterval(this.timer);
- },
- skep() {
- clearInterval(this.timer);
- router.back();
- },
- goActivity() {
- router.replace({
- uri: '/views/Activity',
- params: this.open_alert.params
- })
- }
- }
- </script>
- <style lang="less">
- .weclome {
- background-image: url("https://cdn-novel.91duke.com/quickapp/static/20201224165231.jpg");
- background-size: cover;
- width: 100%;
- height: 100%;
- }
- .ad-page {
- background-size: cover;
- width: 100%;
- height: 100%;
- flex-direction: column;
- position: relative;
- justify-content: space-between;
- .top-timer {
- display: flex;
- justify-content: flex-end;
- padding-top: 30px;
- padding-right: 30px;
- .number {
- width: 120px;
- height: 60px;
- line-height: 60px;
- background-color: rgba(0, 0, 0, 0.5);
- color: #fff;
- font-size: 25px;
- text-align: center;
- border-radius: 30px;
- }
- }
- .bottom-line {
- width: 100%;
- height: 200px;
- background-color: #fff;
- align-items: center;
- justify-content: center;
- image {
- width: 110px;
- height: 110px;
- margin-right: 15px;
- }
- .desc {
- flex-direction: column;
- .title {
- font-size: 36px;
- font-weight: bold;
- line-height: 200%;
- }
- }
- }
- }
- </style>
|