This commit is contained in:
lipnggao 2023-09-26 08:52:03 +08:00
parent d55b3f8896
commit 59e6b233b6
11 changed files with 113 additions and 106 deletions

View File

@ -47,7 +47,8 @@
columnsLabel: '',
commFooterFlag: false,
barTitle: '',
chapterorder: ''
chapterorder: '',
directoryAll: {}
}
},
onLoad(options) {
@ -75,6 +76,28 @@
this.chapterShow = true;
},
handelDirectoryItem(row) {
const directoryAll = this.directoryAll;
let flag = true;
let chapterFlag = false;
Object.keys(directoryAll).forEach((m) => {
directoryAll[m].forEach((j) => {
if(flag) {
if (j.id != row.id && j.isvip == 1) {
chapterFlag = true;
}
if (j.id == row.id) {
flag = false
}
}
})
})
if(chapterFlag) {
uni.showToast({
icon: 'none',
title: '前面章节未解锁,暂不支持跳章节观看',
})
return;
}
uni.navigateTo({
url: `/pages/novelReading/novelReading?sid=${this.bookSid}&n=${this.barTitle}&id=${row.id}`
})
@ -98,7 +121,9 @@
const data = {
sid,
page,
startOrder,
}
if (startOrder) {
data.startOrder = startOrder;
}
uni.$u.http.post('/getDirectory', data).then((res) => {
uni.hideLoading();
@ -122,6 +147,10 @@
} else {
this.directory = [...this.directory, ...directory];
}
this.directoryAll = {
...this.directoryAll,
[columnsLabel]: directory
}
this.commFooterFlag = directory.length ? false : true;
this.columns = [columns];
this.directoryCount = directoryCount;

View File

@ -3,7 +3,7 @@
<view v-if="!searchFlag">
<view class="step_search_box">
<view class="search_box_con">
<u-search v-model="bookKeyword" placeholder="输入想看的小说" height="80rpx" :showAction="false"
<u-search v-model="bookKeyword" placeholder="输入想看的小说" height="80rpx" :showAction="false"
bgColor="#F3F4F6" @clear="clearBookKeyword" confirmType="search"></u-search>
<view class="search_button" @tap="handelSearch">
<text>搜索</text>
@ -98,7 +98,7 @@
getSearchBooks(keyword) {
if (!keyword) {
uni.showToast({
title: '请先输入书名',
title: '请先输入您想看的小说',
icon: 'none'
})
return;
@ -152,6 +152,7 @@
handelSearchRecord(event) {
const title = event.currentTarget.dataset.title;
this.bookKeyword = title;
this.getSearchBooks(title);
},
addBookshelf() {
this.bookcase = 1;

View File

@ -23,7 +23,7 @@
:line-height="defaultCharactersLineHeight" :color="novelContentColor" :bg-color="bodyReadingBg"
:slide="20" :enablePreload="false" @loadmore="loadmoreContent"
:clickOption="{width:200,height: 400,left:'auto',top:'auto'}" :topGap="0" :bottomGap="20"
@change="currentChange" :readChapterFlag="readChapterFlag">
@change="currentChange">
<template slot="test">
<view class="balance_con">
<rich-text class="balance_con_rich_text"
@ -241,7 +241,6 @@
readChapterInfoObj: {},
readChapterLastid: '',
readChapterNextid: '',
readChapterFlag: false,
theFirstTime: true,
mainReadTipsTop: 0,
mainReadTipsBottom: 0
@ -309,12 +308,14 @@
uni.hideLoading();
if (res.status == 1) {
const resData = res.data;
const is_novel_content = resData.novel_content.replace(/<\/p>/g, '\n');
const is_novel_content = resData.novel_content.replace(/<p><\/p>/g, '\n');
console.log(is_novel_content,"is_novel_contentis_novel_content")
const isContent = is_novel_content.replace(/<p>/g, '');
const isContent2 = isContent.replace(/<\/p>/g, '');
const readChapterInfoObj = {
...resData,
content: isContent,
isContent: isContent,
content: isContent2,
isContent: isContent2,
isStart: resData.lastid == '' ? true : false,
isEnd: resData.nextid == '' ? true : false,
chapter: resData.chapterorder,
@ -332,13 +333,11 @@
})
},
async loadmoreContent(chapter, callback) {
console.log(chapter, "loadmoreContent")
const newNovelReadingContentText = this.novelReadingContentText;
const newReadDirectoryActive = this.readDirectoryActive;
const newReadChapterLastid = this.readChapterLastid;
const newReadChapterNextid = this.readChapterNextid;
const newReadChapterInfoObj = this.readChapterInfoObj;
console.log(newReadChapterInfoObj, "loadmoreContent________________")
let chapterId = '';
if (chapter < newReadDirectoryActive) {
chapterId = newReadChapterLastid;
@ -361,23 +360,18 @@
// content: '',
// }
callback('success', newReadInfoObj);
// }
const sortArr = this.handelReadList([newReadInfoObj]);
this.novelReadingContentText = sortArr;
},
currentChange(pageInfo) {
const novelReadingContentText = this.novelReadingContentText;
const chapter = pageInfo.chapter;
console.log(pageInfo, chapter, pageInfo.nextid, "currentChange")
this.readDirectoryActive = chapter;
novelReadingContentText.forEach((m) => {
if (m.chapter == chapter) {
this.readChapterLastid = m.lastid;
this.readChapterNextid = m.nextid;
this.readChapterInfoObj = m;
if (m.isvip == 1) {
this.readChapterFlag = true;
}
}
})
},
@ -388,6 +382,9 @@
} else {
this.$refs.yingbingReadPage.pagePrev();
}
this.readingPopupshow = false;
this.navbarPopupShow = false;
this.stepUpPopupShow = false;
},
pageNextTurning() {
const newReadChapterInfoObj = this.readChapterInfoObj;
@ -403,7 +400,10 @@
return;
}
this.$refs.yingbingReadPage.pageNext();
}
};
this.readingPopupshow = false;
this.navbarPopupShow = false;
this.stepUpPopupShow = false;
},
upperNextChapter(type) {
const newReadChapterLastid = this.readChapterLastid;
@ -788,7 +788,7 @@
position: fixed;
bottom: 0;
left: 0;
width: 414px;
width: 100%;
height: 560rpx;
background: rgba(243, 239, 233, 0.7);
filter: blur(10px);

View File

@ -27,7 +27,7 @@
}">
<yingbing-flip ref="flip" class="yingbing-read-page-flip" :data="pages" :current="current"
:bgColor="bgColor" :duration="300" :unableClickPage="unableClickPage" :type="pageType"
@change="handleFlipChangeRender" :readChapterFlag="readChapterFlag">
@change="handleFlipChangeRender">
<!-- #ifdef MP -->
<template v-for="(item, index) in pages" :slot="index">
<!-- #endif -->
@ -44,7 +44,7 @@
<text class="flip-item-header-text" :style="{
color: color,
'font-family': fontFamily
}">{{item.title}}{{current}}</text>
}">{{item.title}}</text>
</view>
<template v-if="item.type == 'text'">
<view class="flip-item-text flip-item-content">
@ -301,11 +301,6 @@
type: Boolean,
default: false
},
//
readChapterFlag: {
type: Boolean,
default: false
},
//
pageType: {
type: String,
@ -402,7 +397,6 @@
options() {
return {
unableClickPage: this.unableClickPage,
readChapterFlag: this.readChapterFlag,
pageType: this.pageType,
color: this.color,
bgColor: this.bgColor,

View File

@ -72,7 +72,6 @@ function touchcancel(event, ins) {
function touchaction(event, ins, isFlipTo) {
var state = ins.getState();
console.log(state,"statestate")
clearInterval(ins)
if (state.isTouch && !state.disableTouch) {
var rect = ins.getBoundingClientRect()

View File

@ -149,11 +149,6 @@
type: Boolean,
default: false
},
//
readChapterFlag:{
type: Boolean,
default: false
},
//
pulldownable: {
type: Boolean,
@ -206,7 +201,6 @@
loadingState: this.loadingState,
duration: this.duration,
unableClickPage: this.unableClickPage,
readChapterFlag: this.readChapterFlag,
nextIndex: this.nextIndex,
prevIndex: this.prevIndex,
currentIndex: this.currentIndex,
@ -343,7 +337,6 @@
},
watch: {
current (newVal) {
console.log(newVal,"newValnewVal")
this.currentIndex = newVal
}
}

View File

@ -1,8 +1,8 @@
var isReady=false;var onReadyCallbacks=[];
var isServiceReady=false;var onServiceReadyCallbacks=[];
var __uniConfig = {"pages":["pages/initialization/initialization","pages/bookCity/bookCity/index","pages/bookshelf/bookshelf/index","pages/login/login","pages/loginMobile/loginMobile","pages/classification/classification/index","pages/myInfo/myInfo/index","pages/myInfo/aboutMy/index","pages/myInfo/mySetUp/index","pages/myInfo/problemList/index","pages/myInfo/problemDetail/index","pages/voucherCenter/index","pages/readingRecords/index","pages/signInBookCurrency/index","pages/booksListAll/index","pages/booksTheCharts/index","pages/voucherCenterDetail/index","pages/bookCoinDetail/bookCoinDetail","pages/giveCoinDetail/giveCoinDetail","pages/booksSearchList/booksSearchList","pages/novelReading/novelReading","pages/booksReadingDetail/booksReadingDetail","pages/bookRecommendList/bookRecommendList"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"tabBar":{"backgroundColor":"#FFFFFF","borderStyle":"#F5F5F5","selectedColor":"#FF5000","iconWidth":"24px","color":"#666666","fontSize":"10px","height":"68px","list":[{"pagePath":"pages/bookshelf/bookshelf/index","text":"书架","iconPath":"/static/images/tabbar/bookshelf.png","selectedIconPath":"/static/images/tabbar/bookshelfActive.png"},{"pagePath":"pages/bookCity/bookCity/index","text":"书城","iconPath":"/static/images/tabbar/bookCity.png","selectedIconPath":"/static/images/tabbar/bookCityActive.png"},{"pagePath":"pages/classification/classification/index","text":"分类","iconPath":"/static/images/tabbar/classification.png","selectedIconPath":"/static/images/tabbar/classificationActive.png"},{"pagePath":"pages/myInfo/myInfo/index","text":"我的","iconPath":"/static/images/tabbar/myInfo.png","selectedIconPath":"/static/images/tabbar/myInfoActive.png"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"古言小说","compilerVersion":"3.8.12","entryPagePath":"pages/initialization/initialization","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/initialization/initialization","meta":{"isQuit":true},"window":{"navigationBarTitleText":"","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/bookCity/bookCity/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"书城","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/bookshelf/bookshelf/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"书架","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/login/login","meta":{},"window":{"navigationBarTitleText":"","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/loginMobile/loginMobile","meta":{},"window":{"navigationBarTitleText":"","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/classification/classification/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"分类","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/myInfo/myInfo/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的","bounce":"none"}},{"path":"/pages/myInfo/aboutMy/index","meta":{},"window":{"navigationBarTitleText":"关于我们","bounce":"none"}},{"path":"/pages/myInfo/mySetUp/index","meta":{},"window":{"navigationBarTitleText":"设置","bounce":"none"}},{"path":"/pages/myInfo/problemList/index","meta":{},"window":{"navigationBarTitleText":"常见问题","bounce":"none"}},{"path":"/pages/myInfo/problemDetail/index","meta":{},"window":{"navigationBarTitleText":"常见问题","bounce":"none"}},{"path":"/pages/voucherCenter/index","meta":{},"window":{"navigationBarTitleText":"充值中心","bounce":"none"}},{"path":"/pages/readingRecords/index","meta":{},"window":{"navigationBarTitleText":"阅读记录","bounce":"none"}},{"path":"/pages/signInBookCurrency/index","meta":{},"window":{"navigationBarTitleText":"签到领取书币","navigationStyle":"custom","navigationBarTextStyle":"white","bounce":"none"}},{"path":"/pages/booksListAll/index","meta":{},"window":{"navigationBarTitleText":"","bounce":"none"}},{"path":"/pages/booksTheCharts/index","meta":{},"window":{"navigationBarTitleText":"","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/voucherCenterDetail/index","meta":{},"window":{"navigationBarTitleText":"充值记录","bounce":"none"}},{"path":"/pages/bookCoinDetail/bookCoinDetail","meta":{},"window":{"navigationBarTitleText":"书币明细","bounce":"none"}},{"path":"/pages/giveCoinDetail/giveCoinDetail","meta":{},"window":{"navigationBarTitleText":"赠币明细","bounce":"none"}},{"path":"/pages/booksSearchList/booksSearchList","meta":{},"window":{"navigationBarTitleText":"搜索","bounce":"none"}},{"path":"/pages/novelReading/novelReading","meta":{},"window":{"navigationBarTitleText":"","navigationStyle":"custom","enablePullDownRefresh":false,"bounce":"none"}},{"path":"/pages/booksReadingDetail/booksReadingDetail","meta":{},"window":{"navigationBarTitleText":"","bounce":"none"}},{"path":"/pages/bookRecommendList/bookRecommendList","meta":{},"window":{"navigationBarTitleText":"","bounce":"none"}}];
var __uniConfig = {"pages":["pages/initialization/initialization","pages/agreement/agreement","pages/bookCity/bookCity/index","pages/bookshelf/bookshelf/index","pages/login/login","pages/loginMobile/loginMobile","pages/classification/classification/index","pages/myInfo/myInfo/index","pages/myInfo/aboutMy/index","pages/myInfo/mySetUp/index","pages/myInfo/problemList/index","pages/myInfo/problemDetail/index","pages/voucherCenter/index","pages/readingRecords/index","pages/signInBookCurrency/index","pages/booksListAll/index","pages/booksTheCharts/index","pages/voucherCenterDetail/index","pages/bookCoinDetail/bookCoinDetail","pages/giveCoinDetail/giveCoinDetail","pages/booksSearchList/booksSearchList","pages/novelReading/novelReading","pages/booksReadingDetail/booksReadingDetail","pages/bookRecommendList/bookRecommendList"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"tabBar":{"backgroundColor":"#FFFFFF","borderStyle":"#F5F5F5","selectedColor":"#FF5000","iconWidth":"24px","color":"#666666","fontSize":"10px","height":"68px","list":[{"pagePath":"pages/bookshelf/bookshelf/index","text":"书架","iconPath":"/static/images/tabbar/bookshelf.png","selectedIconPath":"/static/images/tabbar/bookshelfActive.png"},{"pagePath":"pages/bookCity/bookCity/index","text":"书城","iconPath":"/static/images/tabbar/bookCity.png","selectedIconPath":"/static/images/tabbar/bookCityActive.png"},{"pagePath":"pages/classification/classification/index","text":"分类","iconPath":"/static/images/tabbar/classification.png","selectedIconPath":"/static/images/tabbar/classificationActive.png"},{"pagePath":"pages/myInfo/myInfo/index","text":"我的","iconPath":"/static/images/tabbar/myInfo.png","selectedIconPath":"/static/images/tabbar/myInfoActive.png"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"古言小说","compilerVersion":"3.8.12","entryPagePath":"pages/initialization/initialization","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/initialization/initialization","meta":{"isQuit":true},"window":{"navigationBarTitleText":"","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/agreement/agreement","meta":{},"window":{"navigationBarTitleText":"","bounce":"none","safearea":{"background":"#FFFFFF","bottom":{"offset":"auto"}}}},{"path":"/pages/bookCity/bookCity/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"书城","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/bookshelf/bookshelf/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"书架","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/login/login","meta":{},"window":{"navigationBarTitleText":"","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/loginMobile/loginMobile","meta":{},"window":{"navigationBarTitleText":"","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/classification/classification/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"分类","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/myInfo/myInfo/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的","bounce":"none"}},{"path":"/pages/myInfo/aboutMy/index","meta":{},"window":{"navigationBarTitleText":"关于我们","bounce":"none"}},{"path":"/pages/myInfo/mySetUp/index","meta":{},"window":{"navigationBarTitleText":"设置","bounce":"none"}},{"path":"/pages/myInfo/problemList/index","meta":{},"window":{"navigationBarTitleText":"常见问题","bounce":"none"}},{"path":"/pages/myInfo/problemDetail/index","meta":{},"window":{"navigationBarTitleText":"常见问题","bounce":"none"}},{"path":"/pages/voucherCenter/index","meta":{},"window":{"navigationBarTitleText":"充值中心","bounce":"none"}},{"path":"/pages/readingRecords/index","meta":{},"window":{"navigationBarTitleText":"阅读记录","bounce":"none"}},{"path":"/pages/signInBookCurrency/index","meta":{},"window":{"navigationBarTitleText":"签到领取书币","navigationStyle":"custom","navigationBarTextStyle":"white","bounce":"none"}},{"path":"/pages/booksListAll/index","meta":{},"window":{"navigationBarTitleText":"","bounce":"none"}},{"path":"/pages/booksTheCharts/index","meta":{},"window":{"navigationBarTitleText":"","navigationStyle":"custom","bounce":"none"}},{"path":"/pages/voucherCenterDetail/index","meta":{},"window":{"navigationBarTitleText":"充值记录","bounce":"none"}},{"path":"/pages/bookCoinDetail/bookCoinDetail","meta":{},"window":{"navigationBarTitleText":"书币明细","bounce":"none"}},{"path":"/pages/giveCoinDetail/giveCoinDetail","meta":{},"window":{"navigationBarTitleText":"赠币明细","bounce":"none"}},{"path":"/pages/booksSearchList/booksSearchList","meta":{},"window":{"navigationBarTitleText":"搜索","bounce":"none"}},{"path":"/pages/novelReading/novelReading","meta":{},"window":{"navigationBarTitleText":"","navigationStyle":"custom","enablePullDownRefresh":false,"bounce":"none"}},{"path":"/pages/booksReadingDetail/booksReadingDetail","meta":{},"window":{"navigationBarTitleText":"","bounce":"none"}},{"path":"/pages/bookRecommendList/bookRecommendList","meta":{},"window":{"navigationBarTitleText":"","bounce":"none"}}];
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long