|
@@ -123,9 +123,9 @@
|
|
</div>
|
|
</div>
|
|
</transition>
|
|
</transition>
|
|
</div>
|
|
</div>
|
|
- <div class="add_desk" @touchmove.prevent v-if="addDesktop && !isStandalone">
|
|
|
|
|
|
+ <div class="add_desk" @touchmove.prevent v-if="addDesktop && !isStandalone && !addDesktops">
|
|
<div class="addgif">
|
|
<div class="addgif">
|
|
- <template v-if="modes == 'B' ">
|
|
|
|
|
|
+ <template v-if="modes == 'B'">
|
|
<div class="addpng">
|
|
<div class="addpng">
|
|
<img src="../../src/assets/addtips.png" width="100%" />
|
|
<img src="../../src/assets/addtips.png" width="100%" />
|
|
</div>
|
|
</div>
|
|
@@ -148,7 +148,18 @@
|
|
>
|
|
>
|
|
<img src="../assets/分享.png" />
|
|
<img src="../assets/分享.png" />
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
|
|
+ <mt-popup v-model="loginPop" class="login-pop" position="bottom">
|
|
|
|
+ <Login
|
|
|
|
+ :needHeader="false"
|
|
|
|
+ :needEmit="true"
|
|
|
|
+ :isBind="isBind"
|
|
|
|
+ @loginSuccess="loginSuccess"
|
|
|
|
+ ></Login>
|
|
|
|
+ </mt-popup>
|
|
|
|
+ <!--空白页-->
|
|
|
|
+ <div class="blank_page" v-if="showBlank">
|
|
|
|
+ <p class="ting">系统维护中~~~~~~~~~~</p>
|
|
|
|
+ </div>
|
|
<!-- 签到提示入口 -->
|
|
<!-- 签到提示入口 -->
|
|
<!-- <template v-if="showSignNoticeWrap">
|
|
<!-- <template v-if="showSignNoticeWrap">
|
|
<div class="sign-notice__wrap" @click="showSignNoticeWrap = false" @touchmove.prevent>
|
|
<div class="sign-notice__wrap" @click="showSignNoticeWrap = false" @touchmove.prevent>
|
|
@@ -172,7 +183,7 @@ import {
|
|
BookShare,
|
|
BookShare,
|
|
BookRecent
|
|
BookRecent
|
|
} from "./namespace.js";
|
|
} from "./namespace.js";
|
|
-import Vue from 'vue';
|
|
|
|
|
|
+import Vue from "vue";
|
|
import {
|
|
import {
|
|
SingActive,
|
|
SingActive,
|
|
Book1,
|
|
Book1,
|
|
@@ -184,6 +195,7 @@ import {
|
|
WeakSubscribe,
|
|
WeakSubscribe,
|
|
Sign
|
|
Sign
|
|
} from "../components/prompt";
|
|
} from "../components/prompt";
|
|
|
|
+import Login from "../view/Login.vue";
|
|
import { popupGift } from "../components/popup";
|
|
import { popupGift } from "../components/popup";
|
|
import {
|
|
import {
|
|
getContent,
|
|
getContent,
|
|
@@ -205,7 +217,11 @@ import {
|
|
getRecentReader,
|
|
getRecentReader,
|
|
getUserInfo,
|
|
getUserInfo,
|
|
setUserMode,
|
|
setUserMode,
|
|
- changeAddMode
|
|
|
|
|
|
+ changeAddMode,
|
|
|
|
+ newLogin,
|
|
|
|
+ newRegister,
|
|
|
|
+ newRefreshToken,
|
|
|
|
+ newDestoryToken
|
|
} from "../api";
|
|
} from "../api";
|
|
import {
|
|
import {
|
|
clearStorageChapter,
|
|
clearStorageChapter,
|
|
@@ -220,10 +236,16 @@ import {
|
|
import XReader from "../components/reader";
|
|
import XReader from "../components/reader";
|
|
import bus from "../components/reader/bus.js";
|
|
import bus from "../components/reader/bus.js";
|
|
import goLogin from "../../src/components/gologin";
|
|
import goLogin from "../../src/components/gologin";
|
|
|
|
+import { setKeyByWay, getKeyByWay } from "../util/index";
|
|
|
|
+import getFingerPrintFunc from "../util/fingerprint";
|
|
|
|
+import { Popup } from "mint-ui";
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: Reader.name,
|
|
name: Reader.name,
|
|
components: {
|
|
components: {
|
|
- "x-reader": XReader
|
|
|
|
|
|
+ "x-reader": XReader,
|
|
|
|
+ mtPopup: Popup,
|
|
|
|
+ Login
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -235,10 +257,12 @@ export default {
|
|
new_reader: false,
|
|
new_reader: false,
|
|
new_reader_guide1: false,
|
|
new_reader_guide1: false,
|
|
new_reader_guide2: false,
|
|
new_reader_guide2: false,
|
|
|
|
+ loginPop: false,
|
|
active: window.options.is_show_activity,
|
|
active: window.options.is_show_activity,
|
|
active_img: window.options.activity_img,
|
|
active_img: window.options.activity_img,
|
|
active_horizontal: false,
|
|
active_horizontal: false,
|
|
weakSubscribe: false,
|
|
weakSubscribe: false,
|
|
|
|
+ isBind: false,
|
|
weakSubscribeHorizontal: false,
|
|
weakSubscribeHorizontal: false,
|
|
weakSubscribeHorizontalNum: 0,
|
|
weakSubscribeHorizontalNum: 0,
|
|
weakSubscribeStyle: {},
|
|
weakSubscribeStyle: {},
|
|
@@ -269,6 +293,7 @@ export default {
|
|
randomBannerIndex: 0,
|
|
randomBannerIndex: 0,
|
|
guidepersonalaccount: window.options.guidepersonalaccount,
|
|
guidepersonalaccount: window.options.guidepersonalaccount,
|
|
banners: window.options.banners,
|
|
banners: window.options.banners,
|
|
|
|
+ showBlank: false,
|
|
showSignNoticeWrap: false,
|
|
showSignNoticeWrap: false,
|
|
collectAndroidBg:
|
|
collectAndroidBg:
|
|
"//zhuishuyun.oss-cn-hangzhou.aliyuncs.com/h5/android_collect.png",
|
|
"//zhuishuyun.oss-cn-hangzhou.aliyuncs.com/h5/android_collect.png",
|
|
@@ -278,11 +303,11 @@ export default {
|
|
five_template: "",
|
|
five_template: "",
|
|
five_template_clicked: true,
|
|
five_template_clicked: true,
|
|
copyVal: "",
|
|
copyVal: "",
|
|
- uuids: "",
|
|
|
|
|
|
+ hashuser: "",
|
|
addDesktop: false,
|
|
addDesktop: false,
|
|
|
|
+ addDestops: false,
|
|
yun: 0,
|
|
yun: 0,
|
|
- isStandalone:
|
|
|
|
- Number(localStorage.getItem("userMode")) || window.navigator.standalone
|
|
|
|
|
|
+ isStandalone: window.navigator.standalone
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -306,6 +331,13 @@ export default {
|
|
getRecordShare(this.$route.query.bid, this.$route.query.cid).then(r => {
|
|
getRecordShare(this.$route.query.bid, this.$route.query.cid).then(r => {
|
|
}); */
|
|
}); */
|
|
},
|
|
},
|
|
|
|
+ loginSuccess(e) {
|
|
|
|
+ if (e) {
|
|
|
|
+ this.loginPop = false;
|
|
|
|
+ goLogin.close();
|
|
|
|
+ this.getInfo();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
activeEv(index) {
|
|
activeEv(index) {
|
|
window.location.href = `${
|
|
window.location.href = `${
|
|
this.banners[index].jump_url
|
|
this.banners[index].jump_url
|
|
@@ -336,33 +368,23 @@ export default {
|
|
break;
|
|
break;
|
|
case "home":
|
|
case "home":
|
|
this.$router.push({
|
|
this.$router.push({
|
|
- name: BookCity.route,
|
|
|
|
- query: {
|
|
|
|
- uuids: this.uuids
|
|
|
|
- }
|
|
|
|
|
|
+ name: BookCity.route
|
|
});
|
|
});
|
|
break;
|
|
break;
|
|
case "category":
|
|
case "category":
|
|
this.$router.push({
|
|
this.$router.push({
|
|
- name: BookStock.route,
|
|
|
|
- query: {
|
|
|
|
- uuids: this.uuids,
|
|
|
|
- sendid: this.$route.query.sendid
|
|
|
|
- }
|
|
|
|
|
|
+ name: BookStock.route
|
|
});
|
|
});
|
|
break;
|
|
break;
|
|
case "rank":
|
|
case "rank":
|
|
this.$router.push({
|
|
this.$router.push({
|
|
- name: Rank.route,
|
|
|
|
- query: {
|
|
|
|
- uuids: this.uuids
|
|
|
|
- }
|
|
|
|
|
|
+ name: Rank.route
|
|
});
|
|
});
|
|
break;
|
|
break;
|
|
case "detail":
|
|
case "detail":
|
|
this.$router.push({
|
|
this.$router.push({
|
|
name: BookDetail.name,
|
|
name: BookDetail.name,
|
|
- query: { id: this.text.bid, uuids: this.uuids }
|
|
|
|
|
|
+ query: { id: this.text.bid }
|
|
});
|
|
});
|
|
break;
|
|
break;
|
|
case "catalog":
|
|
case "catalog":
|
|
@@ -372,20 +394,71 @@ export default {
|
|
? {
|
|
? {
|
|
id: this.text.bid,
|
|
id: this.text.bid,
|
|
sequence: this.text.sequence,
|
|
sequence: this.text.sequence,
|
|
- uuids: this.uuids,
|
|
|
|
- sendid: this.$route.query.sendid,
|
|
|
|
yun: this.yun
|
|
yun: this.yun
|
|
}
|
|
}
|
|
: {
|
|
: {
|
|
id: this.$route.query.bid,
|
|
id: this.$route.query.bid,
|
|
- uuids: this.uuids,
|
|
|
|
- sendid: this.$route.query.sendid,
|
|
|
|
yun: this.yun
|
|
yun: this.yun
|
|
}
|
|
}
|
|
});
|
|
});
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ async getInfo() {
|
|
|
|
+ //获取AB测试
|
|
|
|
+ let modes = await changeAddMode();
|
|
|
|
+ this.modes = modes.type;
|
|
|
|
+ let data = await getUserInfo();
|
|
|
|
+ //老逻辑 没有绑定手机弹窗绑定并且是加桌模式
|
|
|
|
+ if (!data.bind_phone && window.navigator.standalone) {
|
|
|
|
+ //付费用户直接强加桌非付费用户弱加桌
|
|
|
|
+ if (data.paymented && data.paymented >= 1) {
|
|
|
|
+ goLogin({ showCloseIcon: false }).then(res => {
|
|
|
|
+ this.loginPop = true;
|
|
|
|
+ this.isBind = true;
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ goLogin({ showCloseIcon: true }).then(res => {
|
|
|
|
+ this.loginPop = true;
|
|
|
|
+ this.isBind = true;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 获取书籍详情
|
|
|
|
+
|
|
|
|
+ getDetail(this.$route.query.bid).then(m => {
|
|
|
|
+ this.bookdetail = m;
|
|
|
|
+ this.is_on = !!m.is_on_user_shelf;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // 获取章节内容
|
|
|
|
+ let isFromCatalog = !!~window.prevPage.indexOf("/catalog");
|
|
|
|
+ let page_from = isFromCatalog ? "chapter_dir" : "";
|
|
|
|
+
|
|
|
|
+ this.getContent(
|
|
|
|
+ this.$route.query.bid,
|
|
|
|
+ this.$route.query.cid,
|
|
|
|
+ "",
|
|
|
|
+ page_from
|
|
|
|
+ )
|
|
|
|
+ .then(r => {
|
|
|
|
+ this.text = r;
|
|
|
|
+ this.isFromSubscribe = false;
|
|
|
|
+ if (this.text.force_add_desk_type) {
|
|
|
|
+ if (!this.addDesktop) this.addDesktop = true;
|
|
|
|
+ }
|
|
|
|
+ if (r.sign_status) {
|
|
|
|
+ this.showSignNoticeWrap = true;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(r => {
|
|
|
|
+ console.log("get content err", r);
|
|
|
|
+ this.text = {
|
|
|
|
+ content: r.msg
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ },
|
|
addShelf() {
|
|
addShelf() {
|
|
addShelf(this.text.bid).then(r => {
|
|
addShelf(this.text.bid).then(r => {
|
|
this.is_on = true;
|
|
this.is_on = true;
|
|
@@ -403,19 +476,16 @@ export default {
|
|
query: {
|
|
query: {
|
|
bid: this.text.bid,
|
|
bid: this.text.bid,
|
|
cid: this.text.next_cid,
|
|
cid: this.text.next_cid,
|
|
- uuids: this.uuids,
|
|
|
|
- sendid:
|
|
|
|
- this.$route.query.sendid || localStorage.getItem("sendid"),
|
|
|
|
yun: this.yun,
|
|
yun: this.yun,
|
|
last_bid: this.text.bid,
|
|
last_bid: this.text.bid,
|
|
last_cid: this.text.prev_cid,
|
|
last_cid: this.text.prev_cid,
|
|
- from_detail_catalog:3
|
|
|
|
|
|
+ from_detail_catalog: 3
|
|
}
|
|
}
|
|
});
|
|
});
|
|
} else if (this.text.next_cid === 0) {
|
|
} else if (this.text.next_cid === 0) {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
name: BookRecommend.name,
|
|
name: BookRecommend.name,
|
|
- query: { bid: this.$route.query.bid, uuids: this.uuids }
|
|
|
|
|
|
+ query: { bid: this.$route.query.bid }
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
this.$Toast("系统错误");
|
|
this.$Toast("系统错误");
|
|
@@ -429,10 +499,8 @@ export default {
|
|
query: {
|
|
query: {
|
|
bid: this.text.bid,
|
|
bid: this.text.bid,
|
|
cid: this.text.prev_cid,
|
|
cid: this.text.prev_cid,
|
|
- uuids: this.uuids,
|
|
|
|
- sendid: this.$route.query.sendid || localStorage.getItem("sendid"),
|
|
|
|
yun: this.yun,
|
|
yun: this.yun,
|
|
- from_detail_catalog:3
|
|
|
|
|
|
+ from_detail_catalog: 3
|
|
},
|
|
},
|
|
params: {
|
|
params: {
|
|
jump: -1
|
|
jump: -1
|
|
@@ -470,8 +538,7 @@ export default {
|
|
name: Reader.name,
|
|
name: Reader.name,
|
|
query: {
|
|
query: {
|
|
bid: bid,
|
|
bid: bid,
|
|
- cid: cid,
|
|
|
|
- uuids: this.uuids
|
|
|
|
|
|
+ cid: cid
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -498,12 +565,12 @@ export default {
|
|
.catch(r => {
|
|
.catch(r => {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
const data = r.data.data;
|
|
const data = r.data.data;
|
|
- const sequence = this.$route.query.sequence
|
|
|
|
- const last_bid = this.$route.query.bid
|
|
|
|
- const last_cid = this.$route.query.cid
|
|
|
|
- const from_detail_catalog = this.$route.query.from_detail_catalog
|
|
|
|
- const sendid = this.$route.query.sendid
|
|
|
|
- const yun = this.$route.query.yun
|
|
|
|
|
|
+ const sequence = this.$route.query.sequence;
|
|
|
|
+ const last_bid = this.$route.query.bid;
|
|
|
|
+ const last_cid = this.$route.query.cid;
|
|
|
|
+ const from_detail_catalog = this.$route.query.from_detail_catalog;
|
|
|
|
+ const send_order_id = this.$route.query.send_order_id;
|
|
|
|
+ const yun = this.$route.query.yun;
|
|
switch (r.data.code) {
|
|
switch (r.data.code) {
|
|
case 10012:
|
|
case 10012:
|
|
if (this.is_update) {
|
|
if (this.is_update) {
|
|
@@ -532,7 +599,16 @@ export default {
|
|
break;
|
|
break;
|
|
case 10015:
|
|
case 10015:
|
|
Chapter1(data).then(r => {
|
|
Chapter1(data).then(r => {
|
|
- this.$router.push({ name: Pay.name, query: data, sequence, last_bid, last_cid, sendid, yun, from_detail_catalog });
|
|
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: Pay.name,
|
|
|
|
+ query: data,
|
|
|
|
+ sequence,
|
|
|
|
+ last_bid,
|
|
|
|
+ last_cid,
|
|
|
|
+ send_order_id,
|
|
|
|
+ yun,
|
|
|
|
+ from_detail_catalog
|
|
|
|
+ });
|
|
});
|
|
});
|
|
break;
|
|
break;
|
|
case 10016:
|
|
case 10016:
|
|
@@ -565,7 +641,16 @@ export default {
|
|
case 10019:
|
|
case 10019:
|
|
Book3(r.data.data)
|
|
Book3(r.data.data)
|
|
.then(r => {
|
|
.then(r => {
|
|
- this.$router.push({ name: Pay.name, query: data, sequence, last_bid, last_cid, sendid, yun, from_detail_catalog });
|
|
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: Pay.name,
|
|
|
|
+ query: data,
|
|
|
|
+ sequence,
|
|
|
|
+ last_bid,
|
|
|
|
+ last_cid,
|
|
|
|
+ send_order_id,
|
|
|
|
+ yun,
|
|
|
|
+ from_detail_catalog
|
|
|
|
+ });
|
|
})
|
|
})
|
|
.catch(e => {
|
|
.catch(e => {
|
|
if (e === "close") {
|
|
if (e === "close") {
|
|
@@ -580,7 +665,16 @@ export default {
|
|
case 10021:
|
|
case 10021:
|
|
this.$router.push({
|
|
this.$router.push({
|
|
name: Pay.name,
|
|
name: Pay.name,
|
|
- query: { ...data, code: r.data.code, sequence, last_bid, last_cid, sendid, yun, from_detail_catalog }
|
|
|
|
|
|
+ query: {
|
|
|
|
+ ...data,
|
|
|
|
+ code: r.data.code,
|
|
|
|
+ sequence,
|
|
|
|
+ last_bid,
|
|
|
|
+ last_cid,
|
|
|
|
+ send_order_id,
|
|
|
|
+ yun,
|
|
|
|
+ from_detail_catalog
|
|
|
|
+ }
|
|
});
|
|
});
|
|
break;
|
|
break;
|
|
case 10022:
|
|
case 10022:
|
|
@@ -707,7 +801,7 @@ export default {
|
|
},
|
|
},
|
|
justifyRouter(router) {
|
|
justifyRouter(router) {
|
|
if (!router.query.bid) {
|
|
if (!router.query.bid) {
|
|
- this.$router.replace({ path: "/", query: { uuids: this.uuids } });
|
|
|
|
|
|
+ this.$router.replace({ path: "/" });
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
if (typeof router.query.bid !== "string") {
|
|
if (typeof router.query.bid !== "string") {
|
|
@@ -715,8 +809,7 @@ export default {
|
|
name: Reader.name,
|
|
name: Reader.name,
|
|
query: {
|
|
query: {
|
|
bid: router.query.bid[0],
|
|
bid: router.query.bid[0],
|
|
- cid: router.query.cid,
|
|
|
|
- uuids: this.uuids
|
|
|
|
|
|
+ cid: router.query.cid
|
|
}
|
|
}
|
|
});
|
|
});
|
|
return false;
|
|
return false;
|
|
@@ -726,7 +819,6 @@ export default {
|
|
query: {
|
|
query: {
|
|
bid: router.query.bid.split(",")[0],
|
|
bid: router.query.bid.split(",")[0],
|
|
cid: router.query.cid,
|
|
cid: router.query.cid,
|
|
- uuids: this.uuids,
|
|
|
|
yun: this.yun
|
|
yun: this.yun
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -758,78 +850,133 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
- let uuid = localStorage.getItem("uuids");
|
|
|
|
- let { yun, bid, cid, uuids, sendid = 0, isreplace = 0 } = this.$route.query;
|
|
|
|
- if (sendid){
|
|
|
|
- localStorage.setItem("sendid", this.$route.query.sendid);
|
|
|
|
- sessionStorage.setItem("sendid", this.$route.query.sendid);
|
|
|
|
- Vue.prototype.sendid = sendid;
|
|
|
|
- }
|
|
|
|
- this.uuids = uuids || uuid;
|
|
|
|
|
|
+ let {
|
|
|
|
+ yun,
|
|
|
|
+ bid,
|
|
|
|
+ cid,
|
|
|
|
+ send_order_id = 0,
|
|
|
|
+ hashuser: hashUser,
|
|
|
|
+ isreplace = 0,
|
|
|
|
+ token: urlToken
|
|
|
|
+ } = this.$route.query;
|
|
|
|
+ //存入派单id
|
|
|
|
+ if (send_order_id) setKeyByWay("send_order_id", send_order_id);
|
|
|
|
+ //获取
|
|
|
|
+ //是否从派单链接进来的标识
|
|
if (yun) this.yun = yun;
|
|
if (yun) this.yun = yun;
|
|
|
|
|
|
- let data = await getUserInfo();
|
|
|
|
- if (!data.bind_phone && window.navigator.standalone) {
|
|
|
|
- goLogin();
|
|
|
|
|
|
+ let addDestops = getKeyByWay("addDestop");
|
|
|
|
+ if (addDestops == "true" || addDestops == true) {
|
|
|
|
+ this.addDestops = true;
|
|
}
|
|
}
|
|
-
|
|
|
|
- const token = localStorage.getItem("token");
|
|
|
|
- if (token) {
|
|
|
|
|
|
+ //处理用户逻辑
|
|
|
|
+ const token = getKeyByWay("token");
|
|
|
|
+ if (token) {
|
|
|
|
+ //有token 上报加桌状态
|
|
setUserMode(
|
|
setUserMode(
|
|
Number(window.navigator.standalone) || 0,
|
|
Number(window.navigator.standalone) || 0,
|
|
- sendid
|
|
|
|
|
|
+ send_order_id
|
|
).then(res => {});
|
|
).then(res => {});
|
|
|
|
+
|
|
|
|
+ this.getInfo();
|
|
|
|
+ } else {
|
|
|
|
+ //如果不是加桌图标进入阅读器,无token直接空白
|
|
|
|
+ if (!window.navigator.standalone) {
|
|
|
|
+ if (urlToken) {
|
|
|
|
+ //先存本地
|
|
|
|
+ setKeyByWay("token", urlToken);
|
|
|
|
+ try {
|
|
|
|
+ const { token, hashuser } = await newRefreshToken({
|
|
|
|
+ hashuser: hashUser,
|
|
|
|
+ token: urlToken
|
|
|
|
+ });
|
|
|
|
+ setKeyByWay("token", token);
|
|
|
|
+ setKeyByWay("hashuser", hashuser);
|
|
|
|
+ this.getInfo();
|
|
|
|
+ } catch (e) {
|
|
|
|
+ this.$Toast(e.data.msg);
|
|
|
|
+ }
|
|
|
|
+ //拿到token 先作废旧token在保存新token;
|
|
|
|
+ try {
|
|
|
|
+ await newDestoryToken({ destroy_token: urlToken });
|
|
|
|
+ } catch (e) {
|
|
|
|
+ this.$Toast(e.data.msg);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.showBlank = true;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //加桌状态下分为url带token和url不带token,url带token用url token去进行登录,不带token 前端通过hashuser去登陆
|
|
|
|
+ if (urlToken) {
|
|
|
|
+ //先存本地
|
|
|
|
+ setKeyByWay("token", urlToken);
|
|
|
|
+ try {
|
|
|
|
+ const { token, hashuser } = await newRefreshToken({
|
|
|
|
+ hashuser: hashUser,
|
|
|
|
+ token: urlToken
|
|
|
|
+ });
|
|
|
|
+ setKeyByWay("token", token);
|
|
|
|
+ setKeyByWay("hashuser", hashuser);
|
|
|
|
+ this.getInfo();
|
|
|
|
+ } catch (e) {
|
|
|
|
+ this.$Toast(e.data.msg);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //拿到token 先作废旧token在保存新token;
|
|
|
|
+ try {
|
|
|
|
+ await newDestoryToken({ destroy_token: urlToken });
|
|
|
|
+ } catch (e) {
|
|
|
|
+ this.$Toast(e.data.msg);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //url没有token用本地的密钥尝试登录
|
|
|
|
+ let fingerprint = await getFingerPrintFunc();
|
|
|
|
+ const params = {
|
|
|
|
+ send_order_id: send_order_id,
|
|
|
|
+ fingerprint,
|
|
|
|
+ hashuser: hashUser
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ //登陆成功说明就是这个用户登录失败弹出手机号进一步校验
|
|
|
|
+ try {
|
|
|
|
+ const { token, hashuser } = await newLogin(params);
|
|
|
|
+ setKeyByWay("token", token);
|
|
|
|
+ setKeyByWay("hashuser", hashuser);
|
|
|
|
+ this.getInfo();
|
|
|
|
+ } catch (e) {
|
|
|
|
+ goLogin({ showCloseIcon: false }).then(res => {
|
|
|
|
+ this.loginPop = true;
|
|
|
|
+ this.isBind = false;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //加桌用户每次都打开同一个链接为了阅读体验 只有第一页面是阅读器 && 全屏模式下&& 有加桌标识(证明是派单链接强加桌加桌)&&是否替换标识(--避免版权跳转重新走逻辑回到上一章阅读记录死循环)才会加载用户阅读记录
|
|
if (
|
|
if (
|
|
yun == "1" &&
|
|
yun == "1" &&
|
|
window.firstName == this.$route.name &&
|
|
window.firstName == this.$route.name &&
|
|
window.navigator.standalone &&
|
|
window.navigator.standalone &&
|
|
isreplace != "1"
|
|
isreplace != "1"
|
|
) {
|
|
) {
|
|
|
|
+ //获取阅读记录并且跳转
|
|
let sare = await getRecentReader();
|
|
let sare = await getRecentReader();
|
|
|
|
|
|
if (sare.bid && sare.cid != cid) {
|
|
if (sare.bid && sare.cid != cid) {
|
|
this.$router.replace(
|
|
this.$router.replace(
|
|
- `/reader?bid=${sare.bid}&cid=${sare.cid}&yun=${yun}&uuids=${this.uuids}&sendid=${sendid}`
|
|
|
|
|
|
+ `/reader?bid=${sare.bid}&cid=${sare.cid}&yun=${yun}&hashuser=${this.hashuser}&send_order_id=${send_order_id}`
|
|
);
|
|
);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
if (!this.justifyRouter(this.$route)) return;
|
|
if (!this.justifyRouter(this.$route)) return;
|
|
this.href = window.location.href;
|
|
this.href = window.location.href;
|
|
- // 获取书籍详情
|
|
|
|
-
|
|
|
|
- //获取AB测试
|
|
|
|
- let modes = await changeAddMode();
|
|
|
|
- this.modes = modes.type;
|
|
|
|
-
|
|
|
|
- getDetail(this.$route.query.bid).then(m => {
|
|
|
|
- this.bookdetail = m;
|
|
|
|
- this.is_on = !!m.is_on_user_shelf;
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- // 获取章节内容
|
|
|
|
- let isFromCatalog = !!~window.prevPage.indexOf("/catalog");
|
|
|
|
- let page_from = isFromCatalog ? "chapter_dir" : "";
|
|
|
|
-
|
|
|
|
- this.getContent(this.$route.query.bid, this.$route.query.cid, "", page_from)
|
|
|
|
- .then(r => {
|
|
|
|
- this.text = r;
|
|
|
|
- this.isFromSubscribe = false;
|
|
|
|
- if (this.text.force_add_desk_type) {
|
|
|
|
- if (!this.addDesktop) this.addDesktop = true;
|
|
|
|
- }
|
|
|
|
- if (r.sign_status) {
|
|
|
|
- this.showSignNoticeWrap = true;
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- .catch(r => {
|
|
|
|
- console.log("get content err", r);
|
|
|
|
- this.text = {
|
|
|
|
- content: r.msg
|
|
|
|
- };
|
|
|
|
- });
|
|
|
|
|
|
+ },
|
|
|
|
+ //路由销毁时,直接关闭弹窗
|
|
|
|
+ beforeDestroy() {
|
|
|
|
+ goLogin.close();
|
|
},
|
|
},
|
|
async beforeRouteEnter(to, from, next) {
|
|
async beforeRouteEnter(to, from, next) {
|
|
if (from.name !== BookCatalog.name && from.name !== Subscribe.name) {
|
|
if (from.name !== BookCatalog.name && from.name !== Subscribe.name) {
|
|
@@ -913,6 +1060,27 @@ export default {
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
|
+.blank_page {
|
|
|
|
+ position: fixed;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ width: 100vw;
|
|
|
|
+ height: 100vh;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ z-index: 9999;
|
|
|
|
+ .ting {
|
|
|
|
+ position: absolute;
|
|
|
|
+ width: 300px;
|
|
|
|
+ height: 300px;
|
|
|
|
+ line-height: 300px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ margin: auto;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ right: 0;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ }
|
|
|
|
+}
|
|
.reader-active {
|
|
.reader-active {
|
|
font-size: 17px;
|
|
font-size: 17px;
|
|
color: #ff3b00;
|
|
color: #ff3b00;
|
|
@@ -1276,4 +1444,9 @@ export default {
|
|
width: 100%;
|
|
width: 100%;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+.login-pop {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|