diff --git a/pages/bookshelf/bookshelf/bookshelfListBody.vue b/pages/bookshelf/bookshelf/bookshelfListBody.vue
index 9439be2..9a7348b 100644
--- a/pages/bookshelf/bookshelf/bookshelfListBody.vue
+++ b/pages/bookshelf/bookshelf/bookshelfListBody.vue
@@ -176,12 +176,20 @@
// 长安删除多个
swipeActionLongpress(row) {
if (!this.swipeActionBatch) {
- const swipeActionList = [...this.swipeActionList];
- if (swipeActionList.indexOf(row.id) != -1) {
- this.swipeActionList = swipeActionList.filter((m) => m != row.id);;
- } else {
- this.swipeActionList = [...swipeActionList, row.id];
- }
+ // setTimeout(() => {
+ // uni.hideTabBar({
+ // animation: true
+ // })
+ // this.swipeActionBatch = true;
+ // this.swipeActionList = [];
+ // this.$emit('bookshelfContentBodyZindexFn', 999);
+ // }, 1000)
+ // const swipeActionList = [...this.swipeActionList];
+ // if (swipeActionList.indexOf(row.id) != -1) {
+ // this.swipeActionList = swipeActionList.filter((m) => m != row.id);;
+ // } else {
+ // this.swipeActionList = [...swipeActionList, row.id];
+ // }
}
},
diff --git a/pages/classification/classification/index.vue b/pages/classification/classification/index.vue
index fd1d597..a016b78 100644
--- a/pages/classification/classification/index.vue
+++ b/pages/classification/classification/index.vue
@@ -2,11 +2,11 @@
-
+
{{m.title}}
+ v-for="m in oneTitleList" :key="m.id" :data-id="m.id" @tap="handelOneTitle">{{m.name}}
@@ -33,6 +33,12 @@
import {
baseUrlImage
} from '@/utils/utils';
+
+ const inactiveStyle = {
+ color: '#222222',
+ fontSize:'32rpx'
+ }
+
export default {
components: {
CommNavBar,
@@ -47,7 +53,8 @@
navBarActive: '1',
searchBooksList: [],
oneTitleActive: 0,
- oneTitleList: []
+ oneTitleList: [],
+ inactiveStyle: inactiveStyle
}
},
onShow() {
@@ -58,11 +65,16 @@
const data = {}
uni.$u.http.post('/getCategory', data).then((res) => {
uni.hideLoading();
- if (res.status == 1) {
- const list = res.data.list;
+ if (res.status == 1 && Array.isArray(res.data.list)) {
+ const list = res.data.list.map((m) => {
+ return {
+ ...m,
+ name: m.title,
+ }
+ });
this.oneTitleList = [{
id: '0',
- title: '全部'
+ name: '全部',
}, ...list];
}
this.getBooks(0, 0);
@@ -137,8 +149,6 @@
position: relative;
z-index: 2;
-
-
.classification_body_btn_list {
width: 100%;
padding: 0 32rpx 32rpx;
@@ -190,7 +200,6 @@
.scroll_y_item {
-
._book_list_box {
width: 100%;
// display: flex;
diff --git a/pages/novelReading/novelReading - 副本 (5).vue b/pages/novelReading/novelReading - 副本 (5).vue
new file mode 100644
index 0000000..031fe39
--- /dev/null
+++ b/pages/novelReading/novelReading - 副本 (5).vue
@@ -0,0 +1,1014 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 书币余额不足
+
+ 付费章节,需要购买。
+ {{readChapterInfoObj.price}}
+ 书币
+
+
+
+ 付费章节,需要全本购买。
+ {{readChapterInfoObj.allprice}}
+ 书币
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/novelReading/novelReading.vue b/pages/novelReading/novelReading.vue
index b949fd2..28ebcc1 100644
--- a/pages/novelReading/novelReading.vue
+++ b/pages/novelReading/novelReading.vue
@@ -10,12 +10,12 @@
:line-height="defaultCharactersLineHeight" :color="novelContentColor" :bg-color="bodyReadingBg"
:slide="20" :enablePreload="false" @loadmore="loadmoreContent" @clickTo="handelShowStepUp"
:clickOption="{width:200,height: 400,left:'auto',top:'auto'}" :topGap="0" :bottomGap="20"
- @change="currentChange">
+ @change="currentChange" :readChapterFlag="readChapterFlag">
+ :nodes="readChapterInfoObj.isContent">
@@ -49,8 +49,7 @@
@@ -122,6 +121,16 @@
@tap="handelCharactersSize">
默认
+
@@ -211,14 +220,15 @@
// 小说信息
novelReadingContentText: [],
charactersPageType: 'real',
- defaultCharactersSize: 28,
- newCharactersSize: 28,
+ defaultCharactersSize: 26,
+ newCharactersSize: 26,
defaultCharactersLineHeight: 20,
readDirectoryActive: '',
readChapterid: '',
readChapterInfoObj: {},
readChapterLastid: '',
readChapterNextid: '',
+ readChapterFlag: false,
};
},
onLoad(options) {
@@ -252,16 +262,17 @@
const booksDirectorySid = this.booksDirectorySid;
const booksDirectoryPage = this.booksDirectoryPage;
const readChapterid = this.readChapterid ? this.readChapterid : '';
- const newReadChapterInfoObj = await this.isGetBookInfo(readChapterid);
- this.novelReadingContentText = [newReadChapterInfoObj];
- this.readDirectoryActive = newReadChapterInfoObj.chapterorder;
- this.readChapterLastid = newReadChapterInfoObj.lastid;
- this.readChapterNextid = newReadChapterInfoObj.nextid;
- this.$refs.yingbingReadPage.init({
- contents: [newReadChapterInfoObj],
- start: 0,
- currentChapter: newReadChapterInfoObj.chapterorder
- })
+ this.isGetReadChapter(readChapterid);
+ // const newReadChapterInfoObj = await this.isGetBookInfo(readChapterid);
+ // this.novelReadingContentText = [newReadChapterInfoObj];
+ // this.readDirectoryActive = newReadChapterInfoObj.chapterorder;
+ // this.readChapterLastid = newReadChapterInfoObj.lastid;
+ // this.readChapterNextid = newReadChapterInfoObj.nextid;
+ // this.$refs.yingbingReadPage.init({
+ // contents: [newReadChapterInfoObj],
+ // start: 0,
+ // currentChapter: newReadChapterInfoObj.chapterorder
+ // })
},
isGetBookInfo(chapterId) {
return new Promise((resolve) => {
@@ -280,10 +291,12 @@
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>/g, '\n');
+ const isContent = is_novel_content.replace(/
/g, '');
const readChapterInfoObj = {
...resData,
- content: is_novel_content.replace(/
/g, ''),
+ content: isContent,
+ isContent: isContent,
isStart: resData.lastid == '' ? true : false,
isEnd: resData.nextid == '' ? true : false,
chapter: resData.chapterorder,
@@ -291,7 +304,7 @@
isTitle: resData.title
// richTextNodes: `
${res.data.chaptername}
${res.data.novel_content}`
};
- this.readChapterInfoObj = readChapterInfoObj;
+ // this.readChapterInfoObj = readChapterInfoObj;
resolve(readChapterInfoObj);
}
}).catch((err) => {
@@ -302,128 +315,153 @@
},
async loadmoreContent(chapter, callback) {
+ console.log(chapter, "loadmoreContent")
+ const newNovelReadingContentText = this.novelReadingContentText;
const newReadDirectoryActive = this.readDirectoryActive;
const newReadChapterLastid = this.readChapterLastid;
- const newNovelReadingContentText = this.novelReadingContentText;
const newReadChapterNextid = this.readChapterNextid;
+ const newReadChapterInfoObj = this.readChapterInfoObj;
+ console.log(newReadChapterInfoObj, "loadmoreContent________________")
+ let chapterId = '';
if (chapter < newReadDirectoryActive) {
- const readChapterInfoObj = await this.isGetBookInfo(newReadChapterLastid);
- this.novelReadingContentText = [...newNovelReadingContentText, readChapterInfoObj];
- if (readChapterInfoObj.chackpay == 1) {
- callback('success', readChapterInfoObj);
+ chapterId = newReadChapterLastid;
+ } else if (chapter > newReadDirectoryActive) {
+ chapterId = newReadChapterNextid
+ }
+ const readChapterInfoObj = await this.isGetBookInfo(chapterId);
+ let newReadInfoObj = {};
+ if (readChapterInfoObj.chackpay == 1) {
+ newReadInfoObj = {
+ ...readChapterInfoObj
}
- if (readChapterInfoObj.chackpay == 2 || readChapterInfoObj.chackpay == 3) {
- const custom = [`slot:test`];
- const obj = {
- ...readChapterInfoObj,
- custom,
- content: '',
- }
- callback('success', obj);
- }
- }
- if (chapter > newReadDirectoryActive) {
- const readChapterInfoObj = await this.isGetBookInfo(newReadChapterNextid);
- this.novelReadingContentText = [readChapterInfoObj, ...newNovelReadingContentText];
- if (readChapterInfoObj.chackpay == 1) {
- callback('success', readChapterInfoObj);
- }
- if (readChapterInfoObj.chackpay == 2 || readChapterInfoObj.chackpay == 3) {
- const custom = [`slot:test`];
- const obj = {
- ...readChapterInfoObj,
- custom,
- content: '',
- }
- callback('success', obj);
+ callback('success', newReadInfoObj);
+ }
+ if (readChapterInfoObj.chackpay == 2 || readChapterInfoObj.chackpay == 3) {
+ const custom = [`slot:test`];
+ newReadInfoObj = {
+ ...readChapterInfoObj,
+ custom,
+ content: '',
+ }
+ callback('success', newReadInfoObj);
+ }
+ const flag = newNovelReadingContentText.some((m) => m.id == readChapterInfoObj.id);
+ let listContents = newNovelReadingContentText;
+ if (!flag) {
+ if (chapter < newReadDirectoryActive) {
+ listContents = [newReadInfoObj, ...newNovelReadingContentText];
+ } else if (chapter > newReadDirectoryActive) {
+ listContents = [...newNovelReadingContentText, newReadInfoObj];
}
}
+ this.novelReadingContentText = listContents;
},
currentChange(pageInfo) {
const novelReadingContentText = this.novelReadingContentText;
const chapter = pageInfo.chapter;
- const itemTemp = novelReadingContentText.filter((m) => m.chapter == chapter);
- this.readChapterLastid = itemTemp[0].lastid;
- this.readChapterNextid = itemTemp[0].nextid;
- this.readingPopupshow = false;
- this.navbarPopupShow = false;
+ console.log(pageInfo, chapter, pageInfo.nextid, "currentChange")
this.readDirectoryActive = chapter;
- this.readChapterInfoObj = itemTemp[0];
+ 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;
+ }
+ }
+ })
},
- async previousChapter() {
- const newReadDirectoryActive = this.readDirectoryActive;
+ upperNextChapter(type) {
+ // const newNovelReadingContentText = this.novelReadingContentText;
+ // const newReadDirectoryActive = this.readDirectoryActive;
+ // const newReadChapterInfoObj = this.readChapterInfoObj;
const newReadChapterLastid = this.readChapterLastid;
- const newNovelReadingContentText = this.novelReadingContentText;
- if (!newReadChapterLastid) {
- uni.showToast({
- icon: 'none',
- title: "已经是第一章了",
- })
- return
+ const newReadChapterNextid = this.readChapterNextid;
+ // console.log(newReadDirectoryActive, "=========")
+ let chapterId = '';
+ if (type == 'upper') {
+ chapterId = newReadChapterLastid;
+ } else if (type == 'next') {
+ // if (newReadChapterInfoObj.isvip == 1) {
+ // uni.showToast({
+ // icon: 'none',
+ // title: '当前章节未解锁,暂不支持跳章节观看',
+ // })
+ // return;
+ // }
+ chapterId = newReadChapterNextid;
}
- const readChapterInfoObj = await this.isGetBookInfo(newReadChapterLastid);
- this.novelReadingContentText = [readChapterInfoObj];
- if (readChapterInfoObj.chackpay == 1) {
- this.$refs.yingbingReadPage.init({
- contents: [readChapterInfoObj],
- start: 0,
- currentChapter: newReadDirectoryActive - 1,
- })
- }
- if (readChapterInfoObj.chackpay == 2 || readChapterInfoObj.chackpay == 3) {
- const custom = [`slot:test`];
- const obj = {
- ...readChapterInfoObj,
- custom,
- content: ''
- }
- this.$refs.yingbingReadPage.init({
- contents: [obj],
- start: 0,
- currentChapter: newReadDirectoryActive - 1,
- })
- }
- this.readDirectoryActive = newReadDirectoryActive - 1;
+ this.isGetReadChapter(chapterId);
},
- async nextChapter() {
- const newReadDirectoryActive = this.readDirectoryActive;
- const readChapterNextid = this.readChapterNextid;
- const newNovelReadingContentText = this.novelReadingContentText;
- if (!readChapterNextid) {
- uni.showToast({
- icon: 'none',
- title: "已经是最后一章了~"
- })
- return
- }
- const readChapterInfoObj = await this.isGetBookInfo(readChapterNextid);
- this.novelReadingContentText = [readChapterInfoObj];
- if (readChapterInfoObj.chackpay == 1) {
- this.$refs.yingbingReadPage.init({
- contents: [readChapterInfoObj],
- start: 0,
- currentChapter: newReadDirectoryActive + 1
- })
- }
- if (readChapterInfoObj.chackpay == 2 || readChapterInfoObj.chackpay == 3) {
- const custom = [`slot:test`];
- const obj = {
- ...readChapterInfoObj,
- custom,
- content: ''
+ isBooksObj(booksObj) {
+ let newBooksObj = {}
+ if (booksObj.chackpay == 1) {
+ newBooksObj = {
+ ...booksObj
}
- this.$refs.yingbingReadPage.init({
- contents: [obj],
- start: 0,
- currentChapter: newReadDirectoryActive + 1
- });
}
- this.readDirectoryActive = newReadDirectoryActive + 1;
+ if (booksObj.chackpay == 2 || booksObj.chackpay == 3) {
+ const custom = [`slot:test`];
+ newBooksObj = {
+ ...booksObj,
+ custom,
+ content: '',
+ }
+ }
+ return newBooksObj;
+ },
+ async isGetReadChapter(chapterId, type) {
+ let lastObj = {};
+ let nextObj = {};
+ let newReadInfoObj = {};
+ const newNovelReadingContentText = this.novelReadingContentText;
+ const resTemp = await this.isGetBookInfo(chapterId);
+ if (resTemp.lastid) {
+ const lastIdx = newNovelReadingContentText.findIndex((m) => m.lastid = resTemp.lastid);
+ if (lastIdx != -1) {
+ newReadInfoObj = newNovelReadingContentText[lastIdx];
+ } else {
+ const resLastObj = await this.isGetBookInfo(resTemp.lastid);
+ lastObj = this.isBooksObj(resLastObj);
+ }
+ }
+ if (resTemp.nextid) {
+ const lastIdx = newNovelReadingContentText.findIndex((m) => m.nextid = resTemp.nextid);
+ if (lastIdx != -1) {
+ nextObj = newNovelReadingContentText[lastIdx];
+ } else {
+ const resNextObj = await this.isGetBookInfo(resTemp.nextid);
+ nextObj = this.isBooksObj(resNextObj);
+ }
+ }
+ newReadInfoObj = this.isBooksObj(resTemp);
+ const flag = newNovelReadingContentText.some((m) => m.id == newReadInfoObj.id);
+ let listContents = newNovelReadingContentText;
+ if (!flag) {
+ if (type == 'upper') {
+ listContents = [newReadInfoObj, ...newNovelReadingContentText, ];
+ } else if (type == 'next') {
+ listContents = [...newNovelReadingContentText, newReadInfoObj];
+ }
+ }else {
+ listContents = [lastObj, newReadInfoObj, nextObj]
+ }
+ this.novelReadingContentText = listContents;
+ this.readChapterInfoObj = newReadInfoObj;
+ this.$refs.yingbingReadPage.init({
+ contents: [lastObj, newReadInfoObj, nextObj],
+ start: 0,
+ currentChapter: newReadInfoObj.chapter,
+ })
+ this.readDirectoryActive = newReadInfoObj.chapterorder;
+ this.readChapterLastid = newReadInfoObj.lastid;
+ this.readChapterNextid = newReadInfoObj.nextid;
},
handelDirectoryItem(row) {},
handelShowStepUp() {
this.readingPopupshow = !this.readingPopupshow;
- this.navbarPopupShow = !this.navbarPopupShow;
+ // this.navbarPopupShow = !this.navbarPopupShow;
this.stepUpPopupShow = false;
},
handelDirectoryPopup() {
@@ -487,22 +525,22 @@
// 字体减小
reduceCharactersSize() {
const newCharactersSize = this.newCharactersSize;
- this.newCharactersSize = newCharactersSize - 2;
+ this.newCharactersSize = newCharactersSize - 1;
const novelMainObj = myGetStorage('novelMainObj') || '{}';
const obj = {
...JSON.parse(novelMainObj),
- charactersSize: newCharactersSize - 2,
+ charactersSize: newCharactersSize - 1,
}
mySetStorage('novelMainObj', JSON.stringify(obj));
},
// 字体加大
addCharactersSize() {
const newCharactersSize = this.newCharactersSize;
- this.newCharactersSize = newCharactersSize + 2;
+ this.newCharactersSize = newCharactersSize + 1;
const novelMainObj = myGetStorage('novelMainObj') || '{}';
const obj = {
...JSON.parse(novelMainObj),
- charactersSize: newCharactersSize + 2,
+ charactersSize: newCharactersSize + 1,
}
mySetStorage('novelMainObj', JSON.stringify(obj));
},
@@ -516,6 +554,10 @@
charactersSize: defaultCharactersSize,
}
mySetStorage('novelMainObj', JSON.stringify(obj));
+ this.$refs.yingbingReadPage.refresh();
+ },
+ handelPageType(type) {
+ this.charactersPageType = type;
},
// // 目录划到了最上边
// directoryPopupUpper() {
@@ -602,7 +644,7 @@
} = isGetSystemInfo();
// this.myData = myData;
this.novelMainTypeColor = novelMainTypeColor;
- this.newCharactersSize = JSON.parse(novelMainObj).charactersSize || 28;
+ this.newCharactersSize = JSON.parse(novelMainObj).charactersSize || 26;
this.setUpColorAll = setUpReadingColorAll;
this.barPopupIcon = {
'F3EFE9': {
diff --git a/uni_modules/yingbing-ReadPage/components/yingbing-ReadPage/yingbing-ReadPage.vue b/uni_modules/yingbing-ReadPage/components/yingbing-ReadPage/yingbing-ReadPage.vue
index fd072b7..da388f7 100644
--- a/uni_modules/yingbing-ReadPage/components/yingbing-ReadPage/yingbing-ReadPage.vue
+++ b/uni_modules/yingbing-ReadPage/components/yingbing-ReadPage/yingbing-ReadPage.vue
@@ -27,7 +27,7 @@
}">
+ @change="handleFlipChangeRender" :readChapterFlag="readChapterFlag">
@@ -39,7 +39,7 @@
'padding-right': slide + 'px',
'padding-top':`calc(var(--status-bar-height) + ${topGap}px)`,
'padding-bottom': bottomGap + 'px'
- }">
+ }">