|
@@ -1,35 +1,15 @@
|
|
|
<template>
|
|
|
- <div
|
|
|
- ref="reader-wrap"
|
|
|
- :class="[
|
|
|
+ <div ref="reader-wrap" :class="[
|
|
|
'reader',
|
|
|
{ 'reader-fixed': five_template && !five_template_clicked }
|
|
|
- ]"
|
|
|
- >
|
|
|
- <x-reader
|
|
|
- ref="reader"
|
|
|
- :class="{
|
|
|
+ ]">
|
|
|
+ <ad-popup popup_position="reading"></ad-popup>
|
|
|
+ <x-reader ref="reader" :class="{
|
|
|
'x-reader--subscribe': weakSubscribe,
|
|
|
'x-reader--subscribe__qrcode':
|
|
|
(subscribeQRcode && !subscribeQRcodeHorizontal) || active
|
|
|
- }"
|
|
|
- :text="text"
|
|
|
- :ad="showAdStatus"
|
|
|
- :adframe="showAdIframe"
|
|
|
- :gift="true"
|
|
|
- :shelf="is_on"
|
|
|
- :showFans="showFans"
|
|
|
- @route="go"
|
|
|
- @addShelf="addShelf"
|
|
|
- @next="next"
|
|
|
- @prev="prev"
|
|
|
- @direction="direction"
|
|
|
- @horizontal-mounted="horizontalMounted"
|
|
|
- @closeBanner="closeBanner"
|
|
|
- @vertical-mounted="verticalMounted"
|
|
|
- @show-gift="showGiftPopup"
|
|
|
- @share="share"
|
|
|
- >
|
|
|
+ }" :text="text" :ad="showAdStatus" :adframe="showAdIframe" :gift="true" :shelf="is_on" :showFans="showFans" @route="go" @addShelf="addShelf" @next="next" @prev="prev" @direction="direction" @horizontal-mounted="horizontalMounted"
|
|
|
+ @closeBanner="closeBanner" @vertical-mounted="verticalMounted" @show-gift="showGiftPopup" @share="share">
|
|
|
<!-- <template v-if="showGift">
|
|
|
<v-touch class="send-gift">
|
|
|
<v-touch class="send-gift__btn"
|
|
@@ -44,53 +24,24 @@
|
|
|
</div>
|
|
|
</template> -->
|
|
|
<!-- 5元充值入口 -->
|
|
|
- <div
|
|
|
- slot="top"
|
|
|
- class="five_template_entry"
|
|
|
- ref="five_template"
|
|
|
- v-if="five_template && !five_template_clicked"
|
|
|
- >
|
|
|
+ <div slot="top" class="five_template_entry" ref="five_template" v-if="five_template && !five_template_clicked">
|
|
|
<v-touch @tap="tapFiveTemplate">
|
|
|
<img :src="five_template.banner" alt="" />
|
|
|
</v-touch>
|
|
|
- <v-touch
|
|
|
- tag="span"
|
|
|
- class="close-area"
|
|
|
- @tap="closeFiveTemplate"
|
|
|
- ></v-touch>
|
|
|
- <v-touch
|
|
|
- tag="span"
|
|
|
- class="close-text-area"
|
|
|
- @tap="closeFiveTemplate"
|
|
|
- ></v-touch>
|
|
|
+ <v-touch tag="span" class="close-area" @tap="closeFiveTemplate"></v-touch>
|
|
|
+ <v-touch tag="span" class="close-text-area" @tap="closeFiveTemplate"></v-touch>
|
|
|
</div>
|
|
|
<!-- 弱关添加 -->
|
|
|
<template v-if="weakSubscribe">
|
|
|
<!-- 横版 -->
|
|
|
- <v-touch
|
|
|
- v-if="weakSubscribeHorizontal"
|
|
|
- v-show="!loading"
|
|
|
- key="weakSubscribeHorizontal"
|
|
|
- class="weak-subscribe-wrap--horizontal"
|
|
|
- :style="weakSubscribeStyle"
|
|
|
- @tap="weakSubscribeEv"
|
|
|
- >
|
|
|
- <p
|
|
|
- v-for="i in weakSubscribeHorizontalNum"
|
|
|
- class="weak-subscribe--horizontal weak-subscribe"
|
|
|
- :key="'weakSubscribeHorizontalText-' + i"
|
|
|
- >
|
|
|
+ <v-touch v-if="weakSubscribeHorizontal" v-show="!loading" key="weakSubscribeHorizontal" class="weak-subscribe-wrap--horizontal" :style="weakSubscribeStyle" @tap="weakSubscribeEv">
|
|
|
+ <p v-for="i in weakSubscribeHorizontalNum" class="weak-subscribe--horizontal weak-subscribe" :key="'weakSubscribeHorizontalText-' + i">
|
|
|
{{ weakSubscribeText[i % weakSubscribeText.length] }}
|
|
|
</p>
|
|
|
</v-touch>
|
|
|
|
|
|
<!-- 竖版 -->
|
|
|
- <v-touch
|
|
|
- v-else
|
|
|
- v-show="!loading"
|
|
|
- key="weakSubscribeVertical"
|
|
|
- @tap="weakSubscribeEv"
|
|
|
- >
|
|
|
+ <v-touch v-else v-show="!loading" key="weakSubscribeVertical" @tap="weakSubscribeEv">
|
|
|
<p class="weak-subscribe--vertical weak-subscribe">
|
|
|
{{ weakSubscribeTextRandom() }}
|
|
|
</p>
|
|
@@ -99,11 +50,7 @@
|
|
|
|
|
|
<template v-if="guidepersonalaccount && !crm_guide_pool">
|
|
|
<!-- 微点需求 -->
|
|
|
- <v-touch
|
|
|
- v-show="!loading"
|
|
|
- key="weakSubscribeVertical"
|
|
|
- @tap="wdQrcodeEv('text')"
|
|
|
- >
|
|
|
+ <v-touch v-show="!loading" key="weakSubscribeVertical" @tap="wdQrcodeEv('text')">
|
|
|
<p class="weak-subscribe--vertical weak-subscribe">
|
|
|
{{ guidepersonalaccount.title }}
|
|
|
</p>
|
|
@@ -112,11 +59,7 @@
|
|
|
|
|
|
<!-- crm_guide_pool -->
|
|
|
<template v-if="crm_guide_pool">
|
|
|
- <v-touch
|
|
|
- v-show="!loading"
|
|
|
- key="weakSubscribeVertical"
|
|
|
- @tap="wdQrcodeEv('text')"
|
|
|
- >
|
|
|
+ <v-touch v-show="!loading" key="weakSubscribeVertical" @tap="wdQrcodeEv('text')">
|
|
|
<p class="weak-subscribe--vertical weak-subscribe">
|
|
|
{{ crm_guide_pool.title }}
|
|
|
</p>
|
|
@@ -126,22 +69,11 @@
|
|
|
<!-- 关注二维码 -->
|
|
|
<template v-if="subscribeQRcode && isChannel123">
|
|
|
<!-- 横版 -->
|
|
|
- <v-touch
|
|
|
- class="subscribe-qrcode"
|
|
|
- v-if="subscribeQRcodeHorizontal"
|
|
|
- v-show="!loading"
|
|
|
- @tap="toSubscribe"
|
|
|
- >
|
|
|
+ <v-touch class="subscribe-qrcode" v-if="subscribeQRcodeHorizontal" v-show="!loading" @tap="toSubscribe">
|
|
|
<img :src="subscribeQrcodeImg" alt />
|
|
|
</v-touch>
|
|
|
<!-- 竖版 -->
|
|
|
- <v-touch
|
|
|
- class="subscribe-qrcode"
|
|
|
- slot="ufooter"
|
|
|
- v-show="!loading"
|
|
|
- @tap="toSubscribe"
|
|
|
- v-else
|
|
|
- >
|
|
|
+ <v-touch class="subscribe-qrcode" slot="ufooter" v-show="!loading" @tap="toSubscribe" v-else>
|
|
|
<img :src="subscribeQrcodeImg" alt />
|
|
|
</v-touch>
|
|
|
</template>
|
|
@@ -150,12 +82,7 @@
|
|
|
<v-touch slot="ufooter" class="title_list">
|
|
|
<div class="title">猜你喜欢</div>
|
|
|
<div class="title-list-box">
|
|
|
- <v-touch
|
|
|
- class="title-item"
|
|
|
- v-for="(t, i) in text.push_title"
|
|
|
- :key="i"
|
|
|
- @tap="jumpNovel(t.link)"
|
|
|
- >
|
|
|
+ <v-touch class="title-item" v-for="(t, i) in text.push_title" :key="i" @tap="jumpNovel(t.link)">
|
|
|
<p>{{ t.title }}</p>
|
|
|
<img :src="t.img" :alt="t.title" />
|
|
|
</v-touch>
|
|
@@ -164,11 +91,7 @@
|
|
|
</template>
|
|
|
<!-- 优先级最高 轮播显示 -->
|
|
|
<template v-if="showPriorityAd && pddAdArr.length">
|
|
|
- <mt-swipe
|
|
|
- slot="ufooter"
|
|
|
- v-show="!loading"
|
|
|
- class="reader-footer__banners"
|
|
|
- >
|
|
|
+ <mt-swipe slot="ufooter" v-show="!loading" class="reader-footer__banners">
|
|
|
<mt-swipe-item v-for="(ad, index) in pddAdArr" :key="index">
|
|
|
<v-touch @tap="pddActivity(index)">
|
|
|
<img v-lazy="ad['pic-url']" alt="" />
|
|
@@ -178,11 +101,7 @@
|
|
|
</template>
|
|
|
<!-- 活动添加 -->
|
|
|
<template v-if="banners.length">
|
|
|
- <mt-swipe
|
|
|
- slot="ufooter"
|
|
|
- v-show="!loading"
|
|
|
- class="reader-footer__banners"
|
|
|
- >
|
|
|
+ <mt-swipe slot="ufooter" v-show="!loading" class="reader-footer__banners">
|
|
|
<mt-swipe-item v-for="(b, index) in banners" :key="index">
|
|
|
<v-touch @tap="activeEv(index)">
|
|
|
<img v-lazy="b.img" alt="" />
|
|
@@ -210,18 +129,10 @@
|
|
|
<!-- 底部评价功能 -->
|
|
|
<template v-if="showComment">
|
|
|
<div class="click-box">
|
|
|
- <v-touch
|
|
|
- class="click-box__item"
|
|
|
- :class="[chooseTap === 'dislike' ? 'cur' : '']"
|
|
|
- @tap="uploadTap('dislike')"
|
|
|
- >
|
|
|
+ <v-touch class="click-box__item" :class="[chooseTap === 'dislike' ? 'cur' : '']" @tap="uploadTap('dislike')">
|
|
|
<span class="tap-icon"></span>差评
|
|
|
</v-touch>
|
|
|
- <v-touch
|
|
|
- class="click-box__item"
|
|
|
- :class="[chooseTap === 'favor' ? 'cur' : '']"
|
|
|
- @tap="uploadTap('favor')"
|
|
|
- >
|
|
|
+ <v-touch class="click-box__item" :class="[chooseTap === 'favor' ? 'cur' : '']" @tap="uploadTap('favor')">
|
|
|
<span class="zan-icon"></span>好看
|
|
|
</v-touch>
|
|
|
</div>
|
|
@@ -229,9 +140,7 @@
|
|
|
|
|
|
<!-- 引导收藏 -->
|
|
|
<template>
|
|
|
- <v-touch class="click-toCollection" @tap="showCollectionWrap = true"
|
|
|
- >>>点击此处,收藏本书<<</v-touch
|
|
|
- >
|
|
|
+ <v-touch class="click-toCollection" @tap="showCollectionWrap = true">>>点击此处,收藏本书<<</v-touch>
|
|
|
</template>
|
|
|
|
|
|
<!-- 引导文字链 -->
|
|
@@ -254,41 +163,23 @@
|
|
|
</template>
|
|
|
<!-- 引导活动banner -->
|
|
|
<template v-if="guidepersonalaccount.banner && !crm_guide_pool">
|
|
|
- <v-touch
|
|
|
- slot="ufooter"
|
|
|
- class="active_img"
|
|
|
- @tap="wdQrcodeEv('banner')"
|
|
|
- style="padding-bottom: .2rem"
|
|
|
- >
|
|
|
+ <v-touch slot="ufooter" class="active_img" @tap="wdQrcodeEv('banner')" style="padding-bottom: .2rem">
|
|
|
<img :src="guidepersonalaccount.banner" />
|
|
|
</v-touch>
|
|
|
</template>
|
|
|
<!-- crm_guide_pool banner -->
|
|
|
<template v-if="crm_guide_pool">
|
|
|
- <v-touch
|
|
|
- slot="ufooter"
|
|
|
- class="active_img"
|
|
|
- @tap="wdQrcodeEv('banner')"
|
|
|
- style="padding-bottom: .2rem"
|
|
|
- >
|
|
|
+ <v-touch slot="ufooter" class="active_img" @tap="wdQrcodeEv('banner')" style="padding-bottom: .2rem">
|
|
|
<img :src="crm_guide_pool.banner" />
|
|
|
</v-touch>
|
|
|
</template>
|
|
|
</x-reader>
|
|
|
<div class="reader-loading" v-show="loading">
|
|
|
- <mt-spinner
|
|
|
- class="reader-loading-icon"
|
|
|
- type="fading-circle"
|
|
|
- color="#32a1ff"
|
|
|
- ></mt-spinner>
|
|
|
+ <mt-spinner class="reader-loading-icon" type="fading-circle" color="#32a1ff"></mt-spinner>
|
|
|
</div>
|
|
|
<div class="reader-guide" v-if="new_reader && !hideGuide">
|
|
|
<transition name="fade" @after-leave="new_reader_guide2 = true">
|
|
|
- <div
|
|
|
- class="reader-guide-1"
|
|
|
- v-if="new_reader_guide1"
|
|
|
- @click="new_reader_guide1 = false"
|
|
|
- >
|
|
|
+ <div class="reader-guide-1" v-if="new_reader_guide1" @click="new_reader_guide1 = false">
|
|
|
<div class="reader-guide-1-1"></div>
|
|
|
<div class="reader-guide-1-2"></div>
|
|
|
<div class="reader-guide-1-3"></div>
|
|
@@ -296,9 +187,7 @@
|
|
|
<img src="https://cdn-novel.bookkks.com/static/img/uppage.png" />
|
|
|
</div>
|
|
|
<div class="reader-guide-1-5">
|
|
|
- <img
|
|
|
- src="https://cdn-novel.bookkks.com/static/img/readermiddel.png"
|
|
|
- />
|
|
|
+ <img src="https://cdn-novel.bookkks.com/static/img/readermiddel.png" />
|
|
|
</div>
|
|
|
<div class="reader-guide-1-6">
|
|
|
<img src="https://cdn-novel.bookkks.com/static/img/downpage.png" />
|
|
@@ -309,35 +198,18 @@
|
|
|
</div>
|
|
|
</transition>
|
|
|
<transition name="fade" @after-leave="new_reader = false">
|
|
|
- <div
|
|
|
- v-if="new_reader_guide2"
|
|
|
- @click="new_reader_guide2 = false"
|
|
|
- class="reader-guide-2"
|
|
|
- >
|
|
|
+ <div v-if="new_reader_guide2" @click="new_reader_guide2 = false" class="reader-guide-2">
|
|
|
<img src="https://cdn-novel.bookkks.com/static/img/readremind.png" />
|
|
|
</div>
|
|
|
</transition>
|
|
|
</div>
|
|
|
- <div
|
|
|
- class="share"
|
|
|
- @touchmove.prevent
|
|
|
- v-show="isshowshare"
|
|
|
- @click="isshowshare = !isshowshare"
|
|
|
- >
|
|
|
+ <div class="share" @touchmove.prevent v-show="isshowshare" @click="isshowshare = !isshowshare">
|
|
|
<img src="../assets/分享.png" />
|
|
|
</div>
|
|
|
- <div
|
|
|
- :class="['ad-status', { 'with-no-activity': !active }]"
|
|
|
- v-if="showAdImg"
|
|
|
- @click="toggleAdType($event)"
|
|
|
- >
|
|
|
+ <div :class="['ad-status', { 'with-no-activity': !active }]" v-if="showAdImg" @click="toggleAdType($event)">
|
|
|
<img :src="adStatusImg" />
|
|
|
</div>
|
|
|
- <div
|
|
|
- class="coupon-entry__wrap"
|
|
|
- v-if="showCouponEntry && guidepersonalaccount"
|
|
|
- @click="wdQrcodeEv('reader_float')"
|
|
|
- >
|
|
|
+ <div class="coupon-entry__wrap" v-if="showCouponEntry && guidepersonalaccount" @click="wdQrcodeEv('reader_float')">
|
|
|
<img src="../assets/coupon-entry.png" alt="" />
|
|
|
</div>
|
|
|
<!-- 签到提示入口 -->
|
|
@@ -349,11 +221,7 @@
|
|
|
</template> -->
|
|
|
<!-- 收藏引导入口 -->
|
|
|
<template v-if="showCollectionWrap">
|
|
|
- <div
|
|
|
- class="sign-notice__wrap"
|
|
|
- @click="showCollectionWrap = false"
|
|
|
- @touchmove.prevent
|
|
|
- >
|
|
|
+ <div class="sign-notice__wrap" @click="showCollectionWrap = false" @touchmove.prevent>
|
|
|
<img :src="isAndroid ? collectAndroidBg : collectIOSBg" alt="" />
|
|
|
</div>
|
|
|
</template>
|
|
@@ -420,7 +288,7 @@ import useWxConfig from "../util/share";
|
|
|
// import chapter from "../components/reader/chapter.js";
|
|
|
|
|
|
// 异步加载广告sdk
|
|
|
-function loadAdJs() {
|
|
|
+function loadAdJs () {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
var script = document.createElement("script");
|
|
|
script.type = "text/javascript";
|
|
@@ -443,7 +311,7 @@ export default {
|
|
|
components: {
|
|
|
"x-reader": XReader
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
showFans: false,
|
|
|
readerOptions: bus.preset,
|
|
@@ -506,30 +374,30 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- chapterText() {
|
|
|
+ chapterText () {
|
|
|
return this.text.content;
|
|
|
},
|
|
|
- adStatusImg() {
|
|
|
+ adStatusImg () {
|
|
|
return this.adType === "1" ? this.isOrder : this.isFree;
|
|
|
},
|
|
|
- showAdImg() {
|
|
|
+ showAdImg () {
|
|
|
return (
|
|
|
window.options.adTargetId &&
|
|
|
this.bookdetail.charge_type === "CHAPTER" &&
|
|
|
this.text.is_show_ad
|
|
|
);
|
|
|
},
|
|
|
- adBannerUrl() {
|
|
|
+ adBannerUrl () {
|
|
|
let randomIndex = window.options.pdd_ad[this.randomBannerIndex];
|
|
|
if (randomIndex) {
|
|
|
return AD_BANNER_URL + randomIndex + ".jpg";
|
|
|
} else return "";
|
|
|
},
|
|
|
- isAndroid() {
|
|
|
+ isAndroid () {
|
|
|
let u = navigator.userAgent;
|
|
|
return u.indexOf("iPhone") === -1;
|
|
|
},
|
|
|
- showCouponEntry() {
|
|
|
+ showCouponEntry () {
|
|
|
return (
|
|
|
this.text.sequence >= 7 &&
|
|
|
window.options.distribution_channel_id === 6687
|
|
@@ -537,7 +405,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- text(newt, oldt) {
|
|
|
+ text (newt, oldt) {
|
|
|
// if (newt.is_show_share_button === 1) {
|
|
|
// let href = window.location.href;
|
|
|
// if (this.isIphone()) {
|
|
@@ -577,7 +445,7 @@ export default {
|
|
|
useWxConfig(wx, configuration);
|
|
|
}
|
|
|
},
|
|
|
- disableAdMode(val) {
|
|
|
+ disableAdMode (val) {
|
|
|
if (val) {
|
|
|
console.log("ad disabled");
|
|
|
this.showAdStatus = false;
|
|
@@ -585,14 +453,14 @@ export default {
|
|
|
this.initPayType();
|
|
|
}
|
|
|
},
|
|
|
- adType(v) {
|
|
|
+ adType (v) {
|
|
|
if (v === "1") {
|
|
|
this.justShowAds(this.text.is_visiable_ad);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- closeBanner() {
|
|
|
+ closeBanner () {
|
|
|
let readQuery = localStorage.getItem("readQuery");
|
|
|
if (readQuery) {
|
|
|
readQuery = JSON.parse(readQuery);
|
|
@@ -601,7 +469,7 @@ export default {
|
|
|
}
|
|
|
this.showFans = false;
|
|
|
},
|
|
|
- share() {
|
|
|
+ share () {
|
|
|
this.isshowshare = !this.isshowshare;
|
|
|
getRecordShare(this.$route.query.bid, this.$route.query.cid).then(r => {
|
|
|
// this.$router.push({
|
|
@@ -615,31 +483,29 @@ export default {
|
|
|
// })
|
|
|
});
|
|
|
},
|
|
|
- toShare() {
|
|
|
+ toShare () {
|
|
|
let { share_domain, uid, distribution_channel_id } = window.options;
|
|
|
let { bid, cid } = this.$route.query;
|
|
|
location.href = `${share_domain}?bid=${bid}&cid=${cid}&uid=${uid}&distribution_channel_id=${distribution_channel_id}`;
|
|
|
},
|
|
|
- activeEv(index) {
|
|
|
- window.location.href = `${
|
|
|
- this.banners[index].jump_url
|
|
|
- }&redirect_url=${encodeURIComponent(window.location.href)}`;
|
|
|
+ activeEv (index) {
|
|
|
+ window.location.href = `${this.banners[index].jump_url
|
|
|
+ }&redirect_url=${encodeURIComponent(window.location.href)}`;
|
|
|
},
|
|
|
- bannerSubEv() {
|
|
|
- window.location.href = `${
|
|
|
- this.bannerSubText.jump_url
|
|
|
- }&redirect_url=${encodeURIComponent(window.location.href)}`;
|
|
|
+ bannerSubEv () {
|
|
|
+ window.location.href = `${this.bannerSubText.jump_url
|
|
|
+ }&redirect_url=${encodeURIComponent(window.location.href)}`;
|
|
|
},
|
|
|
- pddActivity(i) {
|
|
|
+ pddActivity (i) {
|
|
|
let token = this.pddAdArr[i].token;
|
|
|
const { uid } = window.options;
|
|
|
window.location.href = `${PDD_AD_REDIRECT}?token=${token}&uid=${uid}`;
|
|
|
},
|
|
|
- toAppAdPage() {
|
|
|
+ toAppAdPage () {
|
|
|
window.location.href = `${window.location.origin +
|
|
|
window.options.appad_url}`;
|
|
|
},
|
|
|
- getUuid() {
|
|
|
+ getUuid () {
|
|
|
var s = [];
|
|
|
var hexDigits = "0123456789abcdef";
|
|
|
for (var i = 0; i < 36; i++) {
|
|
@@ -652,7 +518,7 @@ export default {
|
|
|
var uuid = s.join("");
|
|
|
return uuid;
|
|
|
},
|
|
|
- go(name) {
|
|
|
+ go (name) {
|
|
|
switch (name) {
|
|
|
case "back":
|
|
|
history.back(-1);
|
|
@@ -677,21 +543,21 @@ export default {
|
|
|
name: BookCatalog.name,
|
|
|
query: this.text.bid
|
|
|
? {
|
|
|
- id: this.text.bid,
|
|
|
- sequence: this.text.sequence
|
|
|
- }
|
|
|
+ id: this.text.bid,
|
|
|
+ sequence: this.text.sequence
|
|
|
+ }
|
|
|
: { id: this.$route.query.bid }
|
|
|
});
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
- addShelf() {
|
|
|
+ addShelf () {
|
|
|
addShelf(this.text.bid).then(r => {
|
|
|
this.is_on = true;
|
|
|
this.$Toast("加入书架成功");
|
|
|
});
|
|
|
},
|
|
|
- next() {
|
|
|
+ next () {
|
|
|
// 静默复制
|
|
|
this.doCopy();
|
|
|
// 显示广告的时候 不允许下一章阅读
|
|
@@ -708,7 +574,7 @@ export default {
|
|
|
} else {
|
|
|
if (this.text.next_cid) {
|
|
|
this.$router.replace({
|
|
|
- path:`/reader/${this.getUuid()}`,
|
|
|
+ path: `/reader/${this.getUuid()}`,
|
|
|
query: {
|
|
|
bid: this.text.bid,
|
|
|
cid: this.text.next_cid
|
|
@@ -724,7 +590,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- prev() {
|
|
|
+ prev () {
|
|
|
if (this.text.prev_cid) {
|
|
|
this.$router.replace({
|
|
|
name: Reader.name,
|
|
@@ -740,7 +606,7 @@ export default {
|
|
|
this.$Toast("第一章!");
|
|
|
}
|
|
|
},
|
|
|
- direction(val) {
|
|
|
+ direction (val) {
|
|
|
if (val === "horizontal" && !localStorage.getItem("old_reader")) {
|
|
|
this.bus.$emit("menu");
|
|
|
localStorage.setItem("old_reader", "true");
|
|
@@ -751,7 +617,7 @@ export default {
|
|
|
}
|
|
|
this.weakSubscribeStyle = {};
|
|
|
},
|
|
|
- subscribe({ bid, chapter_id: cid }) {
|
|
|
+ subscribe ({ bid, chapter_id: cid }) {
|
|
|
if (this.$route.query.bid == bid && this.$route.query.cid == cid) {
|
|
|
this.getContent(this.$route.query.bid, this.$route.query.cid)
|
|
|
.then(r => {
|
|
@@ -770,7 +636,7 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- getContent(bid, cid, next, from, code) {
|
|
|
+ getContent (bid, cid, next, from, code) {
|
|
|
//由于beforeRouteUpdate钩子函数会调用getContent,所以路由或者页面跳转不应该在在此函数,不然会造beforeRouteUpdate钩子函数的next不被调用
|
|
|
/*
|
|
|
错误处理
|
|
@@ -1003,19 +869,19 @@ export default {
|
|
|
return r;
|
|
|
});
|
|
|
},
|
|
|
- weakSubscribeTextRandom() {
|
|
|
+ weakSubscribeTextRandom () {
|
|
|
return this.weakSubscribeText[Math.floor(Math.random() * 3)];
|
|
|
},
|
|
|
- weakSubscribeEv() {
|
|
|
+ weakSubscribeEv () {
|
|
|
WeakSubscribe();
|
|
|
},
|
|
|
- wdQrcodeEv(from) {
|
|
|
+ wdQrcodeEv (from) {
|
|
|
location.href = this.guidepersonalaccount.link + "&p_src=" + from;
|
|
|
},
|
|
|
- crmEvent() {
|
|
|
+ crmEvent () {
|
|
|
location.href = this.guidepersonalaccount.link;
|
|
|
},
|
|
|
- horizontalMounted(page) {
|
|
|
+ horizontalMounted (page) {
|
|
|
if (this.weakSubscribe) {
|
|
|
this.weakSubscribeHorizontal = true;
|
|
|
this.weakSubscribeStyle = {
|
|
@@ -1026,12 +892,12 @@ export default {
|
|
|
if (this.subscribeQRcode) this.subscribeQRcodeHorizontal = true;
|
|
|
if (this.active) this.active_horizontal = true;
|
|
|
},
|
|
|
- verticalMounted() {
|
|
|
+ verticalMounted () {
|
|
|
this.weakSubscribeHorizontal = false;
|
|
|
this.subscribeQRcodeHorizontal = false;
|
|
|
this.active_horizontal = false;
|
|
|
},
|
|
|
- toSubscribe() {
|
|
|
+ toSubscribe () {
|
|
|
getweakSubscribeQR().then(r => {
|
|
|
this.$router.push({
|
|
|
name: Subscribe.name,
|
|
@@ -1039,10 +905,10 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- getChapterComment(bid, cid) {
|
|
|
+ getChapterComment (bid, cid) {
|
|
|
return getChapterComment(bid, cid);
|
|
|
},
|
|
|
- uploadTap(type) {
|
|
|
+ uploadTap (type) {
|
|
|
// TODOS 需要选择评论类型并上传到服务器
|
|
|
if (this.canTap) return;
|
|
|
let { bid, cid } = this.$route.query;
|
|
@@ -1052,15 +918,15 @@ export default {
|
|
|
localStorage.setItem(cid, this.chooseTap);
|
|
|
});
|
|
|
},
|
|
|
- resetChooseTap() {
|
|
|
+ resetChooseTap () {
|
|
|
this.chooseTap = "";
|
|
|
},
|
|
|
- showGiftPopup() {
|
|
|
+ showGiftPopup () {
|
|
|
popupGift({ bid: this.text.bid }).catch(e => {
|
|
|
this.$router.push({ name: Pay.name });
|
|
|
});
|
|
|
},
|
|
|
- jumpNovel(url) {
|
|
|
+ jumpNovel (url) {
|
|
|
let options = {
|
|
|
bg: this.readerOptions.bg,
|
|
|
font: this.readerOptions.font.default,
|
|
@@ -1068,7 +934,7 @@ export default {
|
|
|
};
|
|
|
location.href = `${url}&bg=${options.bg}&font=${options.font}&night=${options.night}`;
|
|
|
},
|
|
|
- justifyRouter(router) {
|
|
|
+ justifyRouter (router) {
|
|
|
if (!router.query.bid) {
|
|
|
this.$router.replace("/");
|
|
|
return false;
|
|
@@ -1094,12 +960,12 @@ export default {
|
|
|
}
|
|
|
return true;
|
|
|
},
|
|
|
- isIphone() {
|
|
|
+ isIphone () {
|
|
|
const u = navigator.userAgent;
|
|
|
// return u.indexOf("iPhone") !== -1;
|
|
|
return true;
|
|
|
},
|
|
|
- jssdkinit(config, share_url, share_info) {
|
|
|
+ jssdkinit (config, share_url, share_info) {
|
|
|
wx.config({
|
|
|
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
|
appId: config.appId, // 必填,公众号的唯一标识
|
|
@@ -1114,16 +980,16 @@ export default {
|
|
|
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
|
|
|
});
|
|
|
var that = this;
|
|
|
- wx.ready(function() {
|
|
|
+ wx.ready(function () {
|
|
|
wx.onMenuShareTimeline({
|
|
|
title: share_info.book_name + ":" + that.bookdetail.book_summary,
|
|
|
desc: "我正在阅读《" + share_info.book_name + "》,超好看!",
|
|
|
link: share_url, // 分享链接
|
|
|
imgUrl: share_info.cover_url,
|
|
|
- success: function() {
|
|
|
+ success: function () {
|
|
|
// this.$Toast("分享成功");
|
|
|
},
|
|
|
- cancel: function() {
|
|
|
+ cancel: function () {
|
|
|
// this.$Toast("取消分享");
|
|
|
}
|
|
|
});
|
|
@@ -1132,10 +998,10 @@ export default {
|
|
|
desc: that.bookdetail.book_summary,
|
|
|
link: share_url, // 分享链接
|
|
|
imgUrl: share_info.cover_url,
|
|
|
- success: function() {
|
|
|
+ success: function () {
|
|
|
// this.$Toast("分享成功");
|
|
|
},
|
|
|
- cancel: function() {
|
|
|
+ cancel: function () {
|
|
|
// this.$Toast("取消分享");
|
|
|
}
|
|
|
});
|
|
@@ -1144,10 +1010,10 @@ export default {
|
|
|
desc: that.bookdetail.book_summary,
|
|
|
link: share_url, // 分享链接
|
|
|
imgUrl: share_info.cover_url,
|
|
|
- success: function() {
|
|
|
+ success: function () {
|
|
|
// this.$Toast("分享成功");
|
|
|
},
|
|
|
- cancel: function() {
|
|
|
+ cancel: function () {
|
|
|
// this.$Toast("取消分享");
|
|
|
}
|
|
|
});
|
|
@@ -1156,19 +1022,19 @@ export default {
|
|
|
desc: that.bookdetail.book_summary,
|
|
|
link: share_url, // 分享链接
|
|
|
imgUrl: share_info.cover_url,
|
|
|
- success: function() {
|
|
|
+ success: function () {
|
|
|
// this.$Toast("分享成功");
|
|
|
},
|
|
|
- cancel: function() {
|
|
|
+ cancel: function () {
|
|
|
// this.$Toast("取消分享");
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- wx.error(function(res) {
|
|
|
+ wx.error(function (res) {
|
|
|
console.log(res);
|
|
|
});
|
|
|
},
|
|
|
- observerAd(book) {
|
|
|
+ observerAd (book) {
|
|
|
if (window.adcombo) {
|
|
|
console.log(book);
|
|
|
// 配置sdk
|
|
@@ -1211,7 +1077,7 @@ export default {
|
|
|
adcombo.run();
|
|
|
}
|
|
|
},
|
|
|
- showAdObserve(showAdCondition) {
|
|
|
+ showAdObserve (showAdCondition) {
|
|
|
if (showAdCondition) {
|
|
|
console.log("show monitor");
|
|
|
// 显示监听器 并开启看广告任务
|
|
@@ -1220,7 +1086,7 @@ export default {
|
|
|
// adcombo.monitor.show();
|
|
|
}
|
|
|
},
|
|
|
- initAd() {
|
|
|
+ initAd () {
|
|
|
if (window.adcombo && this.showAdStatus) {
|
|
|
setTimeout(() => {
|
|
|
// window.adcombo.scanAdSlot();
|
|
@@ -1232,7 +1098,7 @@ export default {
|
|
|
}, 50);
|
|
|
}
|
|
|
},
|
|
|
- hitAdTarget() {
|
|
|
+ hitAdTarget () {
|
|
|
if (this.adType === "2") return false;
|
|
|
if (
|
|
|
this.bookdetail.charge_type === "CHAPTER" &&
|
|
@@ -1242,7 +1108,7 @@ export default {
|
|
|
}
|
|
|
return false;
|
|
|
},
|
|
|
- toggleAdType(e) {
|
|
|
+ toggleAdType (e) {
|
|
|
if (this.adLimit) {
|
|
|
this.$Toast("今日次数已用完,明日可继续免费阅读");
|
|
|
return;
|
|
@@ -1260,7 +1126,7 @@ export default {
|
|
|
}
|
|
|
localStorage.setItem("adType", this.adType);
|
|
|
},
|
|
|
- initFreeType() {
|
|
|
+ initFreeType () {
|
|
|
this.adType = "1";
|
|
|
this.showAdStatus = !!this.text.is_show_ad;
|
|
|
this.$set(this, "showAdIframe", !!this.text.is_show_ad);
|
|
@@ -1270,7 +1136,7 @@ export default {
|
|
|
if (this.hitAdTarget()) this.initAd();
|
|
|
console.log("init free version --- see ads");
|
|
|
},
|
|
|
- initPayType() {
|
|
|
+ initPayType () {
|
|
|
this.adType = "2";
|
|
|
this.showAdStatus = false;
|
|
|
this.$set(this, "showAdIframe", false);
|
|
@@ -1282,7 +1148,7 @@ export default {
|
|
|
}
|
|
|
console.log("init pay version -- pay coins");
|
|
|
},
|
|
|
- limitAdTimes() {
|
|
|
+ limitAdTimes () {
|
|
|
// 每日广告次数限制
|
|
|
let times = parseInt(localStorage.getItem("ad_times") || 0);
|
|
|
let ad_today = new Date().toLocaleDateString();
|
|
@@ -1305,7 +1171,7 @@ export default {
|
|
|
}
|
|
|
localStorage.setItem("adType", this.adType);
|
|
|
},
|
|
|
- initLimitAdTimes() {
|
|
|
+ initLimitAdTimes () {
|
|
|
let times = parseInt(localStorage.getItem("ad_times") || 0);
|
|
|
let ad_today = new Date().toLocaleDateString();
|
|
|
let ad_days = localStorage.getItem("ad_days") || ad_today;
|
|
@@ -1327,18 +1193,18 @@ export default {
|
|
|
localStorage.setItem("ad_days", ad_today);
|
|
|
localStorage.setItem("adType", this.adType);
|
|
|
},
|
|
|
- recordReadChapter() {
|
|
|
+ recordReadChapter () {
|
|
|
localStorage.setItem("rc", this.$route.query.cid);
|
|
|
},
|
|
|
- clearReadChapter() {
|
|
|
+ clearReadChapter () {
|
|
|
localStorage.removeItem("rc");
|
|
|
},
|
|
|
- reportStart(chapterId) {
|
|
|
+ reportStart (chapterId) {
|
|
|
if (window.adcombo) {
|
|
|
window.adcombo.reportReadStart(chapterId);
|
|
|
}
|
|
|
},
|
|
|
- reportEnd(chapterId, isShowAd) {
|
|
|
+ reportEnd (chapterId, isShowAd) {
|
|
|
console.log(chapterId, isShowAd);
|
|
|
if (window.adcombo && window.options.adTargetId) {
|
|
|
window.adcombo
|
|
@@ -1369,12 +1235,12 @@ export default {
|
|
|
.catch(e => console.log(e));
|
|
|
}
|
|
|
},
|
|
|
- getAdTimes() {
|
|
|
+ getAdTimes () {
|
|
|
let times = localStorage.getItem("ad_times");
|
|
|
if (times && parseInt(times) >= AD_MAX_LIMIT_TIMES) return false;
|
|
|
return true;
|
|
|
},
|
|
|
- justShowAds(status) {
|
|
|
+ justShowAds (status) {
|
|
|
this.showAdIframe = !!status;
|
|
|
if (this.showAdIframe && window.adcombo) {
|
|
|
console.log("scan ads");
|
|
@@ -1387,14 +1253,14 @@ export default {
|
|
|
}, 80);
|
|
|
}
|
|
|
},
|
|
|
- getRandomBannerIndex() {
|
|
|
+ getRandomBannerIndex () {
|
|
|
let banner_len = window.options.pdd_ad.length;
|
|
|
if (banner_len) {
|
|
|
let random = Math.ceil(Math.random() * banner_len);
|
|
|
this.randomBannerIndex = random - 1;
|
|
|
} else return banner_len;
|
|
|
},
|
|
|
- getReaderAdBanner() {
|
|
|
+ getReaderAdBanner () {
|
|
|
let uid = window.options.uid;
|
|
|
getReaderAdBanner()
|
|
|
.then(r => {
|
|
@@ -1410,7 +1276,7 @@ export default {
|
|
|
this.pddAdArr = [];
|
|
|
});
|
|
|
},
|
|
|
- mergeBanner() {
|
|
|
+ mergeBanner () {
|
|
|
getMergeBanner()
|
|
|
.then(r => {
|
|
|
if (r.img) {
|
|
@@ -1420,14 +1286,14 @@ export default {
|
|
|
})
|
|
|
.catch(e => console.log(e));
|
|
|
},
|
|
|
- replaceURLAfterChange(cid, newCid) {
|
|
|
+ replaceURLAfterChange (cid, newCid) {
|
|
|
console.log("cid", cid);
|
|
|
console.log("newCid", newCid);
|
|
|
let url = window.location.href.replace(`cid=${cid}`, `cid=${newCid}`);
|
|
|
console.log("replace url", url);
|
|
|
window.history.replaceState({}, "", url);
|
|
|
},
|
|
|
- fiveTemplateLogic(five_obj) {
|
|
|
+ fiveTemplateLogic (five_obj) {
|
|
|
if (!five_obj) return;
|
|
|
let five_template_prev_clicked = localStorage.getItem("5_template_day");
|
|
|
if (five_template_prev_clicked) {
|
|
@@ -1437,11 +1303,11 @@ export default {
|
|
|
else this.five_template_clicked = false;
|
|
|
} else this.five_template_clicked = false;
|
|
|
},
|
|
|
- tapFiveTemplate() {
|
|
|
+ tapFiveTemplate () {
|
|
|
localStorage.setItem("5_template_day", new Date().toDateString());
|
|
|
location.href = this.five_template.url;
|
|
|
},
|
|
|
- closeFiveTemplate() {
|
|
|
+ closeFiveTemplate () {
|
|
|
if (this.inTaping) return;
|
|
|
this.inTaping = true;
|
|
|
this.$refs.five_template.style.height = "0";
|
|
@@ -1453,12 +1319,12 @@ export default {
|
|
|
this.inTaping = false;
|
|
|
}, 300);
|
|
|
},
|
|
|
- setCopyVal() {
|
|
|
+ setCopyVal () {
|
|
|
// 如果本身已经有了 则不需要重复获取
|
|
|
if (this.copyVal) return;
|
|
|
this.copyVal = getRandomCode();
|
|
|
},
|
|
|
- doCopy() {
|
|
|
+ doCopy () {
|
|
|
// 复制
|
|
|
let is_need_copy = needToCopy();
|
|
|
if (is_need_copy)
|
|
@@ -1467,7 +1333,7 @@ export default {
|
|
|
else this.copyVal = "";
|
|
|
}
|
|
|
},
|
|
|
- async created() {
|
|
|
+ async created () {
|
|
|
if (!this.justifyRouter(this.$route)) return;
|
|
|
this.href = window.location.href;
|
|
|
// 获取书籍详情
|
|
@@ -1564,7 +1430,7 @@ export default {
|
|
|
});
|
|
|
window.options.self_pa_ad_switch && this.getReaderAdBanner();
|
|
|
},
|
|
|
- async beforeRouteEnter(to, from, next) {
|
|
|
+ async beforeRouteEnter (to, from, next) {
|
|
|
// * 初次进入加载iframe
|
|
|
loadIframeAsync();
|
|
|
let detail = null;
|
|
@@ -1596,7 +1462,7 @@ export default {
|
|
|
}
|
|
|
next();
|
|
|
},
|
|
|
- beforeRouteUpdate(to, from, next) {
|
|
|
+ beforeRouteUpdate (to, from, next) {
|
|
|
// * 移除iframe
|
|
|
removeIframe();
|
|
|
|
|
@@ -1647,7 +1513,7 @@ export default {
|
|
|
});
|
|
|
window.options.self_pa_ad_switch && this.getReaderAdBanner();
|
|
|
},
|
|
|
- beforeRouteLeave(to, from, next) {
|
|
|
+ beforeRouteLeave (to, from, next) {
|
|
|
if (to.name !== BookCatalog.name && to.name !== Subscribe.name) {
|
|
|
// 清除所有和章节相关的缓存
|
|
|
clearStorageChapter();
|
|
@@ -1666,7 +1532,7 @@ export default {
|
|
|
removeIframe();
|
|
|
next();
|
|
|
},
|
|
|
- beforeMount() {
|
|
|
+ beforeMount () {
|
|
|
// 重置lazyload设置
|
|
|
this.$Lazyload.config({
|
|
|
preLoad: 1.3,
|
|
@@ -1674,11 +1540,11 @@ export default {
|
|
|
error: ""
|
|
|
});
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ mounted () {
|
|
|
this.bus = this.$refs.reader.getBus();
|
|
|
this.mergeBanner();
|
|
|
},
|
|
|
- destroyed() {
|
|
|
+ destroyed () {
|
|
|
document.title = window.options.title;
|
|
|
}
|
|
|
};
|
|
@@ -1776,21 +1642,21 @@ export default {
|
|
|
}
|
|
|
|
|
|
.tap-icon {
|
|
|
- background: url("~@/assets/tap.png") center / contain no-repeat;
|
|
|
+ background: url('~@/assets/tap.png') center / contain no-repeat;
|
|
|
}
|
|
|
|
|
|
.zan-icon {
|
|
|
- background: url("~@/assets/zan.png") center / contain no-repeat;
|
|
|
+ background: url('~@/assets/zan.png') center / contain no-repeat;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.click-box__item.cur {
|
|
|
.tap-icon {
|
|
|
- background: url("~@/assets/tap-check.png") center / contain no-repeat;
|
|
|
+ background: url('~@/assets/tap-check.png') center / contain no-repeat;
|
|
|
}
|
|
|
|
|
|
.zan-icon {
|
|
|
- background: url("~@/assets/zan-check.png") center / contain no-repeat;
|
|
|
+ background: url('~@/assets/zan-check.png') center / contain no-repeat;
|
|
|
}
|
|
|
}
|
|
|
}
|