|
@@ -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;
|
|
|
}
|