|
@@ -2,7 +2,7 @@
|
|
|
<template>
|
|
|
<div
|
|
|
class="NNPE-Big-Book-preview adult-book-preview-sty preview-red"
|
|
|
- :class="['NNPE-Big-Book-preview-'+themeColor]"
|
|
|
+ :class="['NNPE-Big-Book-preview-' + themeColor]"
|
|
|
v-if="cur"
|
|
|
>
|
|
|
<div
|
|
@@ -91,7 +91,10 @@
|
|
|
</div>
|
|
|
<div v-if="cur" class="NNPE-Book-content-inner">
|
|
|
<div v-for="(item, index) in cur.cur_fn_data" :key="index">
|
|
|
- <h2 v-if="item.z_title||item.number"><b v-if="item.number">{{item.number}}</b>{{ item.z_title }}</h2>
|
|
|
+ <h2 v-if="item.z_title || item.number">
|
|
|
+ <b v-if="item.number">{{ item.number }}</b
|
|
|
+ >{{ item.z_title }}
|
|
|
+ </h2>
|
|
|
<h3 v-if="item.f_title">{{ item.f_title }}</h3>
|
|
|
<div
|
|
|
:class="['NNPE-tableList', item.is_bg ? 'NNPE-tableList-hasBg' : '']"
|
|
@@ -366,6 +369,7 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
|
|
|
+ idArr: [], //当前的pid
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -467,171 +471,64 @@ export default {
|
|
|
},
|
|
|
// 上一页
|
|
|
handleNNPEprev() {
|
|
|
- const _this = this;
|
|
|
+ let _this = this;
|
|
|
if (_this.queIndex == 0) {
|
|
|
- let data = {};
|
|
|
- let flg = false;
|
|
|
- let xiangdeng = false;
|
|
|
_this.FatherTreeData.forEach((item, itemIndex) => {
|
|
|
- if (item.children) {
|
|
|
- item.children.forEach((it, childrenIndex) => {
|
|
|
- if (it.id == _this.currentTreeID) {
|
|
|
- if (itemIndex == 0 && childrenIndex == 0) {
|
|
|
- this.$message({
|
|
|
- message: "已经是最后一题",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- flg = true;
|
|
|
- } else if (childrenIndex == 0) {
|
|
|
- // 当前子节点的第一个
|
|
|
- if (_this.FatherTreeData[itemIndex - 1].children) {
|
|
|
- data.fatherName =
|
|
|
- _this.FatherTreeData[
|
|
|
- itemIndex - 1
|
|
|
- ].children[0].fatherName;
|
|
|
- data.id =
|
|
|
- _this.FatherTreeData[itemIndex - 1].children[0].id;
|
|
|
- data.name =
|
|
|
- _this.FatherTreeData[itemIndex - 1].children[0].name;
|
|
|
- } else {
|
|
|
- data.fatherName =
|
|
|
- _this.FatherTreeData[itemIndex - 1].fatherName;
|
|
|
- data.id = _this.FatherTreeData[itemIndex - 1].id;
|
|
|
- data.name = _this.FatherTreeData[itemIndex - 1].name;
|
|
|
- }
|
|
|
- } else {
|
|
|
- data.fatherName = item.children[childrenIndex - 1].fatherName;
|
|
|
- data.id = item.children[childrenIndex - 1].id;
|
|
|
- data.name = item.children[childrenIndex - 1].name;
|
|
|
- }
|
|
|
- xiangdeng = true;
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- if (!xiangdeng) {
|
|
|
- if (item.id == _this.currentTreeID) {
|
|
|
- if (itemIndex == 0) {
|
|
|
- this.$message({
|
|
|
- message: "已经是第一题",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- flg = true;
|
|
|
- } else {
|
|
|
- if (_this.FatherTreeData[itemIndex - 1].children) {
|
|
|
- data.fatherName =
|
|
|
- _this.FatherTreeData[itemIndex - 1].children[
|
|
|
- _this.FatherTreeData[itemIndex - 1].children.length - 1
|
|
|
- ].fatherName;
|
|
|
- data.id =
|
|
|
- _this.FatherTreeData[itemIndex - 1].children[
|
|
|
- _this.FatherTreeData[itemIndex - 1].children.length - 1
|
|
|
- ].id;
|
|
|
- data.name =
|
|
|
- _this.FatherTreeData[itemIndex - 1].children[
|
|
|
- _this.FatherTreeData[itemIndex - 1].children.length - 1
|
|
|
- ].name;
|
|
|
- } else {
|
|
|
- data.fatherName =
|
|
|
- _this.FatherTreeData[itemIndex - 1].fatherName;
|
|
|
- data.id = _this.FatherTreeData[itemIndex - 1].id;
|
|
|
- data.name = _this.FatherTreeData[itemIndex - 1].name;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ this.seekCurrentTree(item);
|
|
|
+ });
|
|
|
+ this.idArr.forEach((item, i) => {
|
|
|
+ if (item == _this.currentTreeID) {
|
|
|
+ if (i == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: "已经是第一题",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ _this.changeId(this.idArr[i - 1]);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- if (flg) {
|
|
|
- return;
|
|
|
- }
|
|
|
- _this.queIndex = 0;
|
|
|
- _this.changeId(data.id, data.name, data.fatherName, "Preview");
|
|
|
} else {
|
|
|
_this.queIndex -= 1;
|
|
|
_this.watchIndex = _this.queIndex + new Date().getTime();
|
|
|
_this.cur = _this.queList[_this.queIndex];
|
|
|
}
|
|
|
},
|
|
|
+ // 递归寻找相同的目录并保存目录的pid
|
|
|
+ seekCurrentTree(item) {
|
|
|
+ if (item.is_courseware == "true") {
|
|
|
+ this.idArr.push(item.id);
|
|
|
+ }
|
|
|
+ if (item.children) {
|
|
|
+ item.children.forEach((it, index) => {
|
|
|
+ if (it.is_courseware == "true") {
|
|
|
+ this.idArr.push(it.id);
|
|
|
+ }
|
|
|
+ if (it.children) {
|
|
|
+ this.seekCurrentTree(it);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
// 下一页
|
|
|
handleNNPEnext() {
|
|
|
const _this = this;
|
|
|
if (_this.queIndex == _this.queTotal - 1) {
|
|
|
- let data = {};
|
|
|
- let flg = false;
|
|
|
- let xiangdeng = false;
|
|
|
_this.FatherTreeData.forEach((item, itemIndex) => {
|
|
|
- if (item.children) {
|
|
|
- item.children.forEach((it, childrenIndex) => {
|
|
|
- if (it.id == _this.currentTreeID) {
|
|
|
- if (
|
|
|
- itemIndex == _this.FatherTreeData.length - 1 &&
|
|
|
- childrenIndex == item.children.length - 1
|
|
|
- ) {
|
|
|
- this.$message({
|
|
|
- message: "已经是最后一题",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- flg = true;
|
|
|
- } else if (childrenIndex == item.children.length - 1) {
|
|
|
- // 当前子节点的最后一个
|
|
|
- if (_this.FatherTreeData[itemIndex + 1].children) {
|
|
|
- data.fatherName =
|
|
|
- _this.FatherTreeData[
|
|
|
- itemIndex + 1
|
|
|
- ].children[0].fatherName;
|
|
|
- data.id =
|
|
|
- _this.FatherTreeData[itemIndex + 1].children[0].id;
|
|
|
- data.name =
|
|
|
- _this.FatherTreeData[itemIndex + 1].children[0].name;
|
|
|
- } else {
|
|
|
- data.fatherName =
|
|
|
- _this.FatherTreeData[itemIndex + 1].fatherName;
|
|
|
- data.id = _this.FatherTreeData[itemIndex + 1].id;
|
|
|
- data.name = _this.FatherTreeData[itemIndex + 1].name;
|
|
|
- }
|
|
|
- } else {
|
|
|
- data.fatherName = item.children[childrenIndex + 1].fatherName;
|
|
|
- data.id = item.children[childrenIndex + 1].id;
|
|
|
- data.name = item.children[childrenIndex + 1].name;
|
|
|
- }
|
|
|
- xiangdeng = true;
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- if (!xiangdeng) {
|
|
|
- if (item.id == _this.currentTreeID) {
|
|
|
- if (itemIndex == _this.FatherTreeData.length - 1) {
|
|
|
- this.$message({
|
|
|
- message: "已经是最后一题",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- flg = true;
|
|
|
- } else {
|
|
|
- if (_this.FatherTreeData[itemIndex + 1].children) {
|
|
|
- data.fatherName =
|
|
|
- _this.FatherTreeData[
|
|
|
- itemIndex + 1
|
|
|
- ].children[0].fatherName;
|
|
|
- data.name =
|
|
|
- _this.FatherTreeData[itemIndex + 1].children[0].name;
|
|
|
- data.id =
|
|
|
- _this.FatherTreeData[itemIndex + 1].children[0].id;
|
|
|
- } else {
|
|
|
- data.fatherName =
|
|
|
- _this.FatherTreeData[itemIndex + 1].fatherName;
|
|
|
- data.id = _this.FatherTreeData[itemIndex + 1].id;
|
|
|
- data.name = _this.FatherTreeData[itemIndex + 1].name;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ this.seekCurrentTree(item);
|
|
|
+ });
|
|
|
+ this.idArr.forEach((item, i) => {
|
|
|
+ if (item == _this.currentTreeID) {
|
|
|
+ if (i == this.idArr.length - 1) {
|
|
|
+ this.$message({
|
|
|
+ message: "已经是最后一题",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ _this.changeId(this.idArr[i + 1]);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- if (flg) {
|
|
|
- return;
|
|
|
- }
|
|
|
- _this.changeId(data.id, data.name, data.fatherName, "Preview");
|
|
|
- xiangdeng = false;
|
|
|
} else {
|
|
|
_this.queIndex += 1;
|
|
|
_this.watchIndex = _this.queIndex + new Date().getTime();
|
|
@@ -761,22 +658,22 @@ export default {
|
|
|
> div {
|
|
|
padding-top: 24px;
|
|
|
> h2 {
|
|
|
- color: #E35454;
|
|
|
+ color: #e35454;
|
|
|
font-size: 16px;
|
|
|
line-height: 150%;
|
|
|
font-weight: bold;
|
|
|
margin: 0;
|
|
|
- b{
|
|
|
- width: 48px;
|
|
|
- height: 24px;
|
|
|
- background: #E35454;
|
|
|
- border-radius: 8px;
|
|
|
- color: #FFFFFF;
|
|
|
- font-family: 'robot';
|
|
|
- display: inline-block;
|
|
|
- text-align: center;
|
|
|
- font-size: 16px;
|
|
|
- margin-right: 14px;
|
|
|
+ b {
|
|
|
+ width: 48px;
|
|
|
+ height: 24px;
|
|
|
+ background: #e35454;
|
|
|
+ border-radius: 8px;
|
|
|
+ color: #ffffff;
|
|
|
+ font-family: "robot";
|
|
|
+ display: inline-block;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 16px;
|
|
|
+ margin-right: 14px;
|
|
|
}
|
|
|
}
|
|
|
> h3 {
|