XiaBx 3 lat temu
rodzic
commit
e2c66cb9ac
6 zmienionych plików z 40 dodań i 21 usunięć
  1. 1 1
      config/index.js
  2. 1 1
      src/App.vue
  3. 1 1
      src/main.js
  4. 3 1
      src/view/book-catalog.vue
  5. 32 16
      src/view/reader.vue
  6. 2 1
      src/view/yun.vue

+ 1 - 1
config/index.js

@@ -28,7 +28,7 @@ module.exports = {
     },
 
     // Various Dev Server settings
-    host: "10.20.52.203", // can be overwritten by process.env.HOST
+    host: "0.0.0.0", // can be overwritten by process.env.HOST
     port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,

+ 1 - 1
src/App.vue

@@ -59,7 +59,7 @@ export default {
     /* const showBanner = sessionStorage.getItem("showBanner");
     const showList = [
       "Reader",
-      "BookCatalog",
+      "BookCatalog", 
       "BookCity",
       "BookDetail",
       "BookRecent",

+ 1 - 1
src/main.js

@@ -17,7 +17,7 @@ fundebug.apikey =
 // import vconsole from 'vconsole'
 Vue.config.productionTip = false;
 
-if (process.env.NODE_ENV === "production") {
+if (process.env.NODE_ENV === "production") {  
   // fundebug.silentVideo = false
   // 事件过滤 过滤掉一些不必要的错误
   fundebug.filters = window.errOptions;

+ 3 - 1
src/view/book-catalog.vue

@@ -214,7 +214,9 @@ export default {
           query: {
             bid,
             cid,
-            uuids:this.uuids
+            uuids:this.uuids,
+            sendid:this.$route.query.sendid || localStorage.getItem('sendid'),
+            yun: this.$route.query.yun
           },
         });
       }

+ 32 - 16
src/view/reader.vue

@@ -197,7 +197,8 @@ import {
   recordAdClickStatus,
   getReaderAdBanner,
   getRecentReader,
-  getUserInfo
+  getUserInfo,
+  setUserMode
 } from "../api";
 import {
   clearStorageChapter,
@@ -271,6 +272,7 @@ export default {
       copyVal: "",
       uuids: "",
       addDesktop: false,
+      yun: 0,
       isStandalone:
         Number(localStorage.getItem("userMode")) || window.navigator.standalone
     };
@@ -336,7 +338,8 @@ export default {
           this.$router.push({
             name: BookStock.route,
             query: {
-              uuids: this.uuids
+              uuids: this.uuids,
+              sendid: this.$route.query.sendid
             }
           });
           break;
@@ -361,9 +364,16 @@ export default {
               ? {
                   id: this.text.bid,
                   sequence: this.text.sequence,
-                  uuids: this.uuids
+                  uuids: this.uuids,
+                  sendid: this.$route.query.sendid,
+                  yun: this.yun
+                }
+              : {
+                  id: this.$route.query.bid,
+                  uuids: this.uuids,
+                  sendid: this.$route.query.sendid,
+                  yun: this.yun
                 }
-              : { id: this.$route.query.bid, uuids: this.uuids }
           });
           break;
       }
@@ -386,7 +396,9 @@ export default {
               bid: this.text.bid,
               cid: this.text.next_cid,
               uuids: this.uuids,
-              sendid: this.$route.query.sendid
+              sendid:
+                this.$route.query.sendid || localStorage.getItem("sendid"),
+              yun: this.yun
             }
           });
         } else if (this.text.next_cid === 0) {
@@ -407,7 +419,8 @@ export default {
             bid: this.text.bid,
             cid: this.text.prev_cid,
             uuids: this.uuids,
-            sendid: this.$route.query.sendid
+            sendid: this.$route.query.sendid || localStorage.getItem("sendid"),
+            yun: this.yun
           },
           params: {
             jump: -1
@@ -553,7 +566,7 @@ export default {
               });
               break;
             case 10022:
-              location.replace(data.url);
+              location.replace(data.url + "&yun=" + this.yun);
               break;
             case 10023:
               location.assign(data.url);
@@ -691,7 +704,8 @@ export default {
           query: {
             bid: router.query.bid.split(",")[0],
             cid: router.query.cid,
-            uuids: this.uuids
+            uuids: this.uuids,
+            yun: this.yun
           }
         });
         return false;
@@ -722,25 +736,27 @@ export default {
     }
   },
   async created() {
-    localStorage.setItem("sendid", this.$route.query.sendid);
     let uuid = localStorage.getItem("uuids");
-    let { yun, bid, cid, uuids } = this.$route.query;
+    let { yun, bid, cid, uuids, sendid = 0 } = this.$route.query;
+    if (sendid) localStorage.setItem("sendid", this.$route.query.sendid);
     this.uuids = uuids || uuid;
+    if (yun) this.yun = yun;
 
     let data = await getUserInfo();
     if (!data.bind_phone) {
       goLogin();
     }
 
-    if (
-      yun == "1" &&
-      window.firstName == this.$route.name &&
-      window.navigator.standalone
-    ) {
+    const token = localStorage.getItem("token");
+    if (token) {
+      setUserMode(Number(window.navigator.standalone) || 0).then(res => {});
+    }
+    if (window.firstName == this.$route.name && window.navigator.standalone) {
       let sare = await getRecentReader();
+
       if (sare.bid && sare.cid != cid) {
         this.$router.replace(
-          `/reader?bid=${sare.bid}&cid=${sare.cid}&yun=${yun}&uuids=${this.uuids}`
+          `/reader?bid=${sare.bid}&cid=${sare.cid}&yun=${yun}&uuids=${this.uuids}&sendid=${sendid}`
         );
         return;
       }

+ 2 - 1
src/view/yun.vue

@@ -12,8 +12,9 @@ export default {
   },
   created() {
     if (this.$route.params.id) {
+      localStorage.setItem("sendid", this.$route.params.id);
       this.getYun();
-      localStorage.setItem("send_order_id", this.$route.params.id);
+      
     } else {
       this.$router.replace("/");
     }