xia 4 yıl önce
ebeveyn
işleme
1b38f06adf
5 değiştirilmiş dosya ile 176 ekleme ve 3 silme
  1. 2 1
      src/api/config.js
  2. 7 1
      src/app.ux
  3. 9 0
      src/manifest.json
  4. 157 0
      src/views/Ad/index.ux
  5. 1 1
      src/views/Reader/index.ux

+ 2 - 1
src/api/config.js

@@ -7,9 +7,10 @@
  */
 const apiConfig = {
     baseURL: "https://quickapp.leyuee.com/api",
+    //baseURL:"https://quickapptestnew.leyuee.com/api",
     //baseURL: "https://quickapptest.leyuee.com/api",
     package:'com.beidao.kuaiying.zsy'
 };
 
 export default apiConfig;
- 
+    

+ 7 - 1
src/app.ux

@@ -12,6 +12,8 @@
 import "./helper/regenerator.js";
 import it from "./helper/interface.js";
 import storage from "@system.storage";
+import router from '@system.router';
+
 
 export default {
   async onCreate() {
@@ -31,8 +33,12 @@ export default {
      it.getPushRedId(regId=>{
        storage.set({ key: "regId", value: regId });
     })
+    
+     router.push({
+      uri: "/views/Ad",
+     })  
 
-  },
+  }, 
   getAppData(key) {
     return this.dataCache[key]
   },

+ 9 - 0
src/manifest.json

@@ -77,6 +77,9 @@
       "views/Category": {
         "component": "index"
       },
+      "views/Ad": {
+        "component": "index"
+      },
       "views/Continue": {
         "component": "index"
       },
@@ -155,6 +158,12 @@
         "titleBarText": "限时免费",
         "menu": false
       },
+      "views/Ad": {
+        "titleBarText": "开屏广告",
+        "menu": false,
+        "fullScreen": true,
+        "titleBar": false
+      },
       "views/Activity": {
         "titleBarText": "活动中心",
         "menu": false

+ 157 - 0
src/views/Ad/index.ux

@@ -0,0 +1,157 @@
+<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 () => {
+      console.log('woshinia ')
+      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>

+ 1 - 1
src/views/Reader/index.ux

@@ -6,7 +6,7 @@
       <div class="reader-wrap" id='list' style="background-color:{{currentColor.color}}">
         <div class="reader-title">
           <text class="title" style="color:{{isNight=='night'?'#666':'#333'}}">{{bookinfo.chapter_name}}</text>
-          <!-- <text class="add-shelf" @click="addShelf">加入书架</text> -->
+          <!-- <text class="add-shelf" @click="addShelf">加入书架1</text> -->
         </div>
         <div class="reader-content">
           <div class="readContent" @click="showMore"><text class="chapter-text" for='content' style="color:{{currentColor.fontColor}};font-size:{{`${readFontSize}px`}}">{{$item}}</text></div>