فهرست منبع

后台显示添加判断

xiabx 5 سال پیش
والد
کامیت
4ff86eb2b2
4فایلهای تغییر یافته به همراه25 افزوده شده و 4 حذف شده
  1. 0 2
      src/api/fly.js
  2. 11 2
      src/helper/interface.js
  3. 7 0
      src/views/Index/index.ux
  4. 7 0
      src/views/Reader/index.ux

+ 0 - 2
src/api/fly.js

@@ -28,14 +28,12 @@ fly.interceptors.request.use(async config => {
     if (config.method === "POST") {
       config.body=qs.stringify(config.body);
     } 
-    console.log('请求开始!',config);
     return config;
   } else return config;
 });
 
 fly.interceptors.response.use(
   res => {
-    console.log('响应开始',res);
     if (!res.data.code) {
       return res.data.data;
     } else if (res.data.code === 10023) {

+ 11 - 2
src/helper/interface.js

@@ -14,7 +14,15 @@ const getDeviceInfo = () => {
     }
   })
 }
-
+//获取是否创建图标
+const getShortCut = (fn) =>{
+  shortcut.hasInstalled({
+    success: (ret) => {
+      if(!ret) fn();
+    }
+  })
+  
+}
 // 判断用户是否创建图标
 const hasCreateShortCut = (isPayPage = false) => {
   shortcut.hasInstalled({
@@ -71,5 +79,6 @@ export default {
   shortcut,
   getDeviceInfo,
   hasCreateShortCut,
-  showMenu
+  showMenu,
+  getShortCut
 }

+ 7 - 0
src/views/Index/index.ux

@@ -46,6 +46,7 @@
 <script>
 import clipboard from '@system.clipboard';
 import prompt from '@system.prompt';
+import it from "../../helper/interface.js";
 import { getCustomQrcode } from '../../api/index.js';
 import { downImg, getStore } from '../../api/utils.js';
 export default {
@@ -95,6 +96,12 @@ export default {
     }
     this.getCoustom();
   },
+  onShow(){
+    it.getShortCut(()=>{
+      this.showShortPop = true;
+
+    })
+  },
   onBackPress() {
     // 退出逻辑
     if (this.$app.$def.data.backClickCount === 0) {

+ 7 - 0
src/views/Reader/index.ux

@@ -24,6 +24,7 @@
 
 <script>
 import router from "@system.router";
+import it from "../../helper/interface.js";
 import { getChapters, getIsonshelf, postUserShelfBooks, chapterOrders } from "../../api";
 
 export default {
@@ -43,6 +44,12 @@ export default {
       this.showShortPop = true;
     }
   },
+   onShow(){
+    it.getShortCut(()=>{
+      this.showShortPop = true;
+
+    })
+  },
   addShelf() {
     console.log("add shelf");
     getIsonshelf({ bid: this.bid }).then(r => {