Quellcode durchsuchen

解决加桌遮挡问题

wangzq vor 2 Jahren
Ursprung
Commit
83879e9586

+ 6 - 5
src/assets/less/reader.less

@@ -1,3 +1,4 @@
+
 .reader-wrap {
   flex-direction: column;
   background-color: #e6e6e6;
@@ -119,12 +120,12 @@
       }
     }
     .chapter-text {
-      font-size: 19px;
+      font-size: 45px;
       color: #1a1a1a;
       text-indent: 2em;
       font-size: 38px;
-      margin-bottom: 30px;
-      line-height: 60px;
+      // margin-bottom: 30px;
+      line-height: 90px;
     }
   }
 }
@@ -186,10 +187,10 @@
 }
 .reader-bottom {
   flex-direction: column;
-  margin-bottom: 220px;
+  // margin-bottom: 220px;
   align-items: center;
   .reader-operator-next {
-    margin-bottom: 30px;
+    margin-bottom: 26px;
     display: flex;
     width: 640px;
     height: 80px;

+ 127 - 82
src/components/short/index.ux

@@ -1,94 +1,139 @@
 <template>
-  <div class="short-wrap">
-    <div class="short-content" @click="createShortcut">
-      <image src="../../assets/imgs/sign_banner.png"></image>
+  <div class="short-box" @click="createShortcut" style="{{getStyle()}}">
+    <div class="short-container">
+      <image class="add-short-image" src="../../assets/imgs/sign_banner.png"></image>
     </div>
   </div>
 </template>
 <script>
-import shortcut from '@system.shortcut'
-import prompt from '@system.prompt'
-import { userAddDsktop } from '../../api/index.js'
+import shortcut from '@system.shortcut';
+import prompt from '@system.prompt';
+import { userAddDsktop } from '../../api/index.js';
+import it from "../../helper/interface.js";
 export default {
-  data: {},
-  onInit() {},
-  createShortcut() {
-    // 创建快捷方式
-    shortcut.hasInstalled({
-      success: ret => {
-        if (!ret) {
-          shortcut.install({
-            message: '添加【阅乐】到桌面,方便下次阅读',
-            success: () => {
-              this.$emit('addshort', { installed: true })
-              if (this.$app.$def.data.backClickCount === 0) {
-                this.$app.$def.data.backClickCount++
-                return true
-              }
-              userAddDsktop(1)
-                .then(res => {
-                  //TODO 加桌后统计上报
-                })
-                .catch(r => {
-                  //TODO 失败后统计上报
-                })
-            },
-            fail: code => {
-              console.log(code)
-              this.$emit('addshort', { installed: false, msg: code })
-            }
-          })
-        }
-      }
-    })
-  }
+	data: {
+		display: false,
+		icon: "",
+		app_name: "",
+		title: "添加桌面免费领取100书币",
+		desc: "海量优质好书等你读",
+		bottom:0,
+	},props: ["bottom"],
+	onInit() {
+		let info = it.getAppInfo();
+		this.icon = info.icon;
+		this.app_name = info.name;
+	},
+	createShortcut() {
+		// 创建快捷方式
+    let msg = ` 添加【${this.app_name}】到桌面,方便下次阅读`;
+		shortcut.hasInstalled({
+			success: (ret) => {
+				if (!ret) {
+					shortcut.install({
+						message: msg,
+						success: () => {
+							this.$emit("addshort", { installed: true });
+							if (this.$app.$def.data.backClickCount === 0) {
+								this.$app.$def.data.backClickCount++;
+								return true;
+							}
+							userAddDsktop(1).then(res => {
+								//TODO 加桌后统计上报
+							}).catch(r => {
+								//TODO 失败后统计上报
+							});
+						},
+						fail: (code) => {
+							console.log(code);
+							this.$emit("addshort", { installed: false, msg: code });
+						}
+					})
+				}
+			}
+		})
+	},getStyle(){
+		if(this.bottom){
+			return "bottom:"+this.bottom+"px;";
+		}
+		return "";
+	}
 }
 </script>
 
+
 <style lang="less" scoped>
-.short {
-  &-wrap {
-    position: fixed;
-    bottom: 190px;
-    height: 148px;
-    z-index: 60;
-    justify-content: center;
-    width: 100%;
-    opacity: 0.95;
-  }
-  &-content {
-    width: 678px;
-    height: 152px;
-    align-items: center;
-    justify-content: center;
-    opacity: 0.95;
-    image {
-      width: 678px;
-      height: 152px;
-    }
-  }
-  &-left {
-    color: #fff;
-    font-size: 28px;
-    font-weight: bold;
-    text-align: center;
-    background-color: #ff453c;
-    width: 444px;
-    height: 80px;
-    border-top-left-radius: 40px;
-    border-bottom-left-radius: 40px;
-    opacity: 0.95;
-  }
-  &-right {
-    text-align: center;
-    font-weight: bold;
-    font-size: 28px;
-    background-color: #ffb540;
-    width: 206px;
-    height: 80px;
-    border-top-right-radius: 40px;
-    border-bottom-right-radius: 40px;
-    opacity: 0.95;
-  }
+.short-box {
+  width: 100%;
+  bottom: 150px;
+  z-index: 1;
+  position: fixed;
+  justify-content: center;
+}
+.short-container {
+  flex-direction: row;
+  border-radius: 10px;
+  padding:  0px 22px;
+  justify-content: space-between;
+}
+.add-short-image{
+  width: 690px;
+  height: 136px;
+  object-fit: fill;
+}
+.icon-box {
+  width: 87px;
+  height: 87px;
+  margin: 20px;
+  border-radius: 6px;
+}
+.icon-image{
+   width: 87px;
+  height: 87px;
+  border-radius: 6px;
+  object-fit: fill;
+}
+.info-box {
+  width: 332px;
+  justify-content: flex-start;
+  flex-direction: column;
+  margin-right: 90px;
+  border-radius: 10px;
 }
+.info-title {
+  margin-top: 20px;
+  width: 332px;
+  height: 45px;
+  font-size: 28px;
+  font-family: PingFangSC-Semibold, PingFang SC;
+  font-weight: 600;
+  color: #ffffff;
+  line-height: 40px;
+}
+.info-desc {
+  height: 33px;
+  font-size: 24px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #ffffff;
+  line-height: 33px;
+  margin: 5px 0px 27px 0px;
+}
+.btn-txt {
+  font-size: 24px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #ffffff;
+  line-height: 33px;
+  text-align: center;
+}
+.btn-box {
+	margin: 38px 20px 0px 20px;
+  width: 136px;
+  height: 46px;
+  background-color: #3AACFF;
+  border-radius: 30px;
+  justify-content: center;
+}
+
 </style>

+ 1 - 0
src/views/Category/index.ux

@@ -91,6 +91,7 @@
           </x-book>
         </list-item>
       </block>
+      <list-item style="height:120px;"></list-item>
     </list>
   </div>
 </template>

+ 1 - 0
src/views/Home/index.ux

@@ -112,6 +112,7 @@
           </div>
         </list-item>
       </block>
+      <list-item style="height:120px;"></list-item>
     </list>
   </div>
 </template>

+ 42 - 13
src/views/Reader/index.ux

@@ -49,7 +49,7 @@
             </swiper>
           </div>
         </div>
-        <short-page if="{{showShortPop}}" @addshort="shortEnd"></short-page>
+        <short-page if="{{showShortPop}}" @addshort="shortEnd" bottom="40"></short-page>
         <!-- <wechat-page></wechat-page> -->
         <div class='toast' if="{{showtoast}}">
           <text>正在加载中...</text>
@@ -89,6 +89,7 @@ export default {
   // },
   public: {
     bid: '',
+    tx_bid:"",
     chapter_id: '',
     send_order_id: "",
     push_id: "",
@@ -99,6 +100,9 @@ export default {
     back_pkg: '',
     platform: '',
     isShowBackBtn: false,
+    recom_list:[],
+    isShowBackRecom:false,
+    last_recom_bid:"",
   },
   private: {
 
@@ -108,6 +112,7 @@ export default {
     showShortPop: false,
     readFontSize: 38,
     isNight: 'sun',
+    back_nums:0,
     hasShort: false,
     showSetting: false,
     force_add_desk_type: 0,
@@ -139,10 +144,26 @@ export default {
   async onInit() {
 
     if (this.platform) {
+      await storage.set({ key: "currue_tx_bid", value: this.bid });
+      this.tx_bid = this.bid;
       await storage.set({ key: "platform", value: this.platform });
     } else {
       let platform = (await storage.get({ key: "platform" })).data;
       if (platform) this.platform = platform;
+      let tx_bid = (await storage.get({ key: "currue_tx_bid" })).data;
+      if(tx_bid){
+        this.tx_bid = tx_bid;
+      }else{
+        this.tx_bid = "";
+      }
+    }
+    if(!this.last_recom_bid || this.last_recom_bid == ""){
+      let last_recom_bid = (await storage.get({ key: "last_recom_bid" })).data;
+       if(last_recom_bid ){
+        this.last_recom_bid  = last_recom_bid ;
+      }else{
+        this.last_recom_bid  = "";
+      }
     }
     if (this.back_name) {
       await storage.set({ key: "back_name", value: this.back_name });
@@ -162,9 +183,19 @@ export default {
       let back_pkg = (await storage.get({ key: "back_pkg" })).data;
       if (back_pkg) this.back_pkg = back_pkg;
     }
+    if (this.send_order_id) {
+      await storage.set({ key: "send_order_id", value: this.send_order_id });
+    } else {
+      let send_order_id = (await storage.get({ key: "send_order_id" })).data;
+      if (send_order_id) this.send_order_id = send_order_id;
+    }
+    if (this.push_id) {
+      await storage.set({ key: "push_id", value: this.push_id });
+    }
     this.back_name = decodeURI(this.back_name)
-    if (this.platform && this.platform == 'tx_adq') {
+    if (this.platform && (this.platform == 'tx_adq' || this.platform == 'tx_adq_new')) {
       if (this.back_url) {
+        // console.log('book_info',book_info);
         pkg.hasInstalled({
           package: this.back_pkg,
           success: data => {
@@ -172,7 +203,7 @@ export default {
               this.isShowBackBtn = false
             }
             if (data.result) {
-              this.isShowBackBtn = true
+              this.isShowBackBtn = true;
             }
           },
           fail: function (data, code) {
@@ -182,19 +213,17 @@ export default {
 
           }
         })
+      }else{
+        if(this.tx_bid == this.bid){
+          let realBook = await noAdvBookInfo(this.send_order_id > 0 ? this.send_order_id :-1);
+          if(realBook && realBook.bid && realBook.bid && realBook.cid){
+            this.bid = realBook.bid;
+            this.chapter_id = realBook.cid;
+          }
+        }
       }
 
     }
-
-    if (this.send_order_id) {
-      await storage.set({ key: "send_order_id", value: this.send_order_id });
-    } else {
-      let send_order_id = (await storage.get({ key: "send_order_id" })).data;
-      if (send_order_id) this.send_order_id = send_order_id;
-    }
-    if (this.push_id) {
-      await storage.set({ key: "push_id", value: this.push_id });
-    }
     /* let s = (await storage.get({ key: "send_order_id" })).data;
     console.log("save send_order_id in storage");
     console.log("send_order_id", this.send_order_id);

+ 1 - 0
src/views/Shelf/index.ux

@@ -106,6 +106,7 @@
                 </div>
               </div>
             </list-item>
+            <list-item style="height:120px;"></list-item>
           </list>
         </block>
       </div>