Preview.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943
  1. <!-- -->
  2. <template>
  3. <div
  4. class="NPC-Big-Book-preview adult-book-preview-sty"
  5. :class="['NPC-Big-Book-preview-' + themeColor]"
  6. v-if="cur"
  7. >
  8. <div class="NNPE-title">
  9. <!-- 页眉 -->
  10. <div class="NNPE-title-left">
  11. <div
  12. v-for="(item, index) in cur.detailList"
  13. :key="index"
  14. class="NNPE-title-item"
  15. >
  16. <template v-if="item.wordsList.length == 0">
  17. <p
  18. v-if="item.sentence"
  19. :class="[
  20. 'content-con',
  21. /^[\u4e00-\u9fa5]/.test(item.sentence) ? 'hasCn' : '',
  22. ]"
  23. >
  24. {{ item.sentence }}
  25. </p>
  26. </template>
  27. <template v-else>
  28. <div class="con-box">
  29. <div
  30. v-for="(itemCon, indexCon) in item.resArr"
  31. v-show="itemCon.isShow"
  32. :key="indexCon"
  33. :class="['con-item', indexCon === 0 ? 'con-item-0' : '']"
  34. >
  35. <template
  36. v-if="
  37. item.wordsList[indexCon + 1] &&
  38. item.wordsList[indexCon + 1].chs &&
  39. chsFhList.indexOf(item.wordsList[indexCon + 1].chs) > -1
  40. "
  41. >
  42. <div class="synthesis-box">
  43. <div>
  44. <span
  45. class="pinyin"
  46. :class="[
  47. noFont.indexOf(itemCon.pinyin) > -1 ? 'noFont' : '',
  48. ]"
  49. >{{ itemCon.pinyin }}</span
  50. >
  51. <span class="hanzi content-con">{{ itemCon.chs }}</span>
  52. </div>
  53. <div style="text-align: left">
  54. <span
  55. class="pinyin"
  56. :class="[
  57. noFont.indexOf(
  58. items.detail.wordsList[indexCon + 1].pinyin
  59. ) > -1
  60. ? 'noFont'
  61. : '',
  62. ]"
  63. >{{ item.wordsList[indexCon + 1].pinyin }}</span
  64. >
  65. <span class="hanzi content-con">{{
  66. item.wordsList[indexCon + 1].chs
  67. }}</span>
  68. </div>
  69. </div>
  70. </template>
  71. <template v-else>
  72. <span
  73. class="pinyin"
  74. :class="[
  75. noFont.indexOf(itemCon.pinyin) > -1 ? 'noFont' : '',
  76. ]"
  77. >{{ itemCon.pinyin }}</span
  78. >
  79. <span class="hanzi content-con">{{ itemCon.chs }}</span>
  80. </template>
  81. </div>
  82. </div>
  83. </template>
  84. </div>
  85. </div>
  86. <div class="NNPE-operate" v-if="isShowTitle">
  87. <a class="btn-prev" @click="handleNNPEprev" />
  88. <a class="btn-next" @click="handleNNPEnext" />
  89. </div>
  90. </div>
  91. <div
  92. v-if="
  93. cur.classTopic && cur.classTopic.length > 0 && cur.classTopic[0].con
  94. "
  95. class="classTopic-box"
  96. >
  97. <span
  98. v-for="(item, index) in cur.classTopic"
  99. :key="index"
  100. :class="item.font"
  101. >
  102. {{ item.con }}
  103. </span>
  104. </div>
  105. <div v-if="cur" class="NNPE-Book-content-inner">
  106. <div v-for="(item, index) in cur.cur_fn_data" :key="index">
  107. <h2 v-if="item.z_title || item.number">
  108. <b v-if="item.number">{{ item.number }}</b
  109. >{{ item.z_title }}
  110. </h2>
  111. <h3 v-if="item.f_title" v-html="item.f_title"></h3>
  112. <div
  113. :class="['NNPE-tableList', item.is_bg ? 'NNPE-tableList-hasBg' : '']"
  114. >
  115. <div
  116. v-for="(items, indexs) in item.table_list"
  117. :key="indexs"
  118. class="NNPE-tableList-tr"
  119. :class="[
  120. indexs === item.table_list.length - 1
  121. ? 'NNPE-tableList-tr-last'
  122. : '',
  123. ]"
  124. >
  125. <div
  126. v-for="(itemss, indexss) in items"
  127. :key="indexss"
  128. :class="[
  129. 'NNPE-tableList-item',
  130. items.length == 1
  131. ? 'NNPE-tableList-item-noMargin'
  132. : 'NNPE-tableList-item' + items.length,
  133. ]"
  134. >
  135. <template v-if="itemss.data">
  136. <template v-if="itemss.type == 'ligature_chs'">
  137. <Ligature :cur-que="itemss.data" :theme-color="themeColor" />
  138. </template>
  139. <template v-if="itemss.data.type == 'image'">
  140. <Picture
  141. :cur-que="itemss.data"
  142. :child-type="itemss.type"
  143. :theme-color="themeColor"
  144. v-if="refresh"
  145. />
  146. </template>
  147. <template v-if="itemss.type == 'record_chs'">
  148. <Record :cur-que="itemss.data" :theme-color="themeColor" />
  149. </template>
  150. <template v-if="itemss.type == 'phrase_chs'">
  151. <WordPhrase
  152. :cur-que="itemss.data"
  153. :theme-color="themeColor"
  154. v-if="refresh"
  155. />
  156. </template>
  157. <template v-if="itemss.type == 'NewWord_chs'">
  158. <WordPhrase
  159. :cur-que="itemss.data"
  160. :theme-color="themeColor"
  161. :currentTreeID="currentTreeID"
  162. :indexs="indexs"
  163. :indexss="indexss"
  164. v-if="refresh"
  165. />
  166. </template>
  167. <template v-if="itemss.type == 'annotation_chs'">
  168. <WordPhrase
  169. :cur-que="itemss.data"
  170. :theme-color="themeColor"
  171. v-if="refresh"
  172. />
  173. </template>
  174. <template v-if="itemss.type == 'notes_chs'">
  175. <Notes
  176. :cur-que="itemss.data"
  177. :theme-color="themeColor"
  178. v-if="refresh"
  179. />
  180. </template>
  181. <template v-if="itemss.type == 'article_chs'">
  182. <ArticleTemChs
  183. :cur-que="itemss.data"
  184. :n-n-p-e-new-word-list="NNPENewWordList"
  185. :n-n-p-e-new-phrase-list="NNPENewPhraseList"
  186. :n-n-p-e-annotation-list="NNPEAnnotationList"
  187. :theme-color="themeColor"
  188. :currentTreeID="currentTreeID"
  189. v-if="refresh"
  190. />
  191. </template>
  192. <template v-if="itemss.type == 'sentence_segword_chs'">
  193. <SentenceSegWordViewChs
  194. :cur-que="itemss.data"
  195. :theme-color="themeColor"
  196. v-if="refresh"
  197. />
  198. </template>
  199. <template v-if="itemss.type == 'dialogue_article_chs'">
  200. <DialogueArticleViewChs
  201. :cur-que="itemss.data"
  202. :n-n-p-e-new-word-list="NNPENewWordList"
  203. :n-n-p-e-new-phrase-list="NNPENewPhraseList"
  204. :n-n-p-e-annotation-list="NNPEAnnotationList"
  205. :color-box="colorBox"
  206. :theme-color="themeColor"
  207. v-if="refresh"
  208. />
  209. </template>
  210. <template v-if="itemss.type == 'dialogue_answer_chs'">
  211. <DialogueAnswerViewChs
  212. :cur-que="itemss.data"
  213. :color-box="colorBox"
  214. :theme-color="themeColor"
  215. v-if="refresh"
  216. />
  217. </template>
  218. <template v-if="itemss.type == 'input_record_chs'">
  219. <InputHasRecord
  220. :cur-que="itemss.data"
  221. :theme-color="themeColor"
  222. v-if="refresh"
  223. />
  224. </template>
  225. <template v-if="itemss.type == 'recordHZ_inputPY_chs'">
  226. <TextInputRecord
  227. :cur-que="itemss.data"
  228. :theme-color="themeColor"
  229. v-if="refresh"
  230. />
  231. </template>
  232. <template
  233. v-if="
  234. itemss.type == 'inputItem_chs' ||
  235. itemss.type == 'sentence_input_chs' ||
  236. itemss.type == 'sentence_judge_chs' ||
  237. itemss.type == 'sentence_record_chs' ||
  238. itemss.type == 'sentence_input_record_chs'
  239. "
  240. >
  241. <SentenceInput
  242. :cur-que="itemss.data"
  243. :theme-color="themeColor"
  244. v-if="refresh"
  245. />
  246. </template>
  247. <template v-if="itemss.type == 'NumberCombination_chs'">
  248. <NumberSelectHasRecord
  249. :cur-que="itemss.data"
  250. :theme-color="themeColor"
  251. v-if="refresh"
  252. />
  253. </template>
  254. <template v-if="itemss.type === 'voice_matrix'">
  255. <voice-matrix
  256. :cur-que="itemss.data"
  257. :theme-color="themeColor"
  258. v-if="refresh"
  259. />
  260. </template>
  261. <template v-if="itemss.type == 'toneSelect_chs'">
  262. <SelectTone
  263. :cur-que="itemss.data"
  264. :theme-color="themeColor"
  265. v-if="refresh"
  266. />
  267. </template>
  268. <template v-if="itemss.type == 'sudoku_chs'">
  269. <Soduko
  270. :cur-que="itemss.data"
  271. :theme-color="themeColor"
  272. v-if="refresh"
  273. />
  274. </template>
  275. <template v-if="itemss.type == 'single_chs'">
  276. <Single
  277. :cur-que="itemss.data"
  278. :theme-color="themeColor"
  279. v-if="refresh"
  280. />
  281. </template>
  282. <template v-if="itemss.type == 'text_problem_chs'">
  283. <TextProblem
  284. :cur-que="itemss.data"
  285. :theme-color="themeColor"
  286. v-if="refresh"
  287. />
  288. </template>
  289. <template v-if="itemss.type == 'newWord_preview_chs'">
  290. <NewWordShow
  291. :cur-que="itemss.data"
  292. :theme-color="themeColor"
  293. v-if="refresh"
  294. />
  295. </template>
  296. <template
  297. v-if="itemss.type == 'listen_record_single_syllable_chs'"
  298. >
  299. <SelectYinjie
  300. :cur-que="itemss.data"
  301. :theme-color="themeColor"
  302. v-if="refresh"
  303. />
  304. </template>
  305. <template v-if="itemss.type == 'sentence_listen_read_chs'">
  306. <SentenceListenRead
  307. :cur-que="itemss.data"
  308. :theme-color="themeColor"
  309. v-if="refresh"
  310. />
  311. </template>
  312. <template v-if="itemss.type == 'sort_chs'">
  313. <SentenceSortQP
  314. :cur-que="itemss.data"
  315. :theme-color="themeColor"
  316. v-if="refresh"
  317. />
  318. </template>
  319. <template v-if="itemss.type == 'checkbox_self_assessment_chs'">
  320. <Checkbox
  321. :cur-que="itemss.data"
  322. :theme-color="themeColor"
  323. v-if="refresh"
  324. />
  325. </template>
  326. <template
  327. v-if="
  328. itemss.type == 'record_control_mini' ||
  329. itemss.type == 'record_control_normal' ||
  330. itemss.type == 'record_control_pro' ||
  331. itemss.type == 'record_control_promax'
  332. "
  333. >
  334. <RecordModule
  335. :cur-que="itemss.data"
  336. :theme-color="themeColor"
  337. v-if="refresh"
  338. />
  339. </template>
  340. <template
  341. v-if="
  342. itemss.type == 'upload_control_chs' ||
  343. itemss.type == 'upload_control_preview_chs'
  344. "
  345. >
  346. <UploadControlView
  347. :cur-que="itemss.data"
  348. :type="itemss.type"
  349. :theme-color="themeColor"
  350. v-if="refresh"
  351. />
  352. </template>
  353. <template v-if="itemss.type == 'CourseStart_chs'">
  354. <CourseStart
  355. :cur-que="itemss.data"
  356. :handle-n-n-p-enext="handleNNPEnext"
  357. :theme-color="themeColor"
  358. v-if="refresh"
  359. />
  360. </template>
  361. <template v-if="itemss.type == 'tinydemo_chs'">
  362. <Tinydemo
  363. :cur-que="itemss.data"
  364. :theme-color="themeColor"
  365. v-if="refresh"
  366. />
  367. </template>
  368. <template v-if="itemss.type == 'video_chs'">
  369. <VideoControl
  370. :cur-que="itemss.data"
  371. :type="itemss.type"
  372. :theme-color="themeColor"
  373. v-if="refresh"
  374. />
  375. </template>
  376. <template v-if="itemss.type == 'table_chs'">
  377. <TableView
  378. :cur-que="itemss.data"
  379. :type="itemss.type"
  380. :theme-color="themeColor"
  381. v-if="refresh"
  382. />
  383. </template>
  384. </template>
  385. </div>
  386. </div>
  387. </div>
  388. </div>
  389. </div>
  390. </div>
  391. </template>
  392. <script>
  393. import Picture from "./preview/Picture.vue"; // 图片模板
  394. import Record from "./preview/Record.vue"; // 音频播放
  395. import Soundrecord from "./preview/Soundrecord.vue"; // 录音模板
  396. import ArticleTemChs from "./preview/ArticleViewChs/index.vue"; // 文章模板
  397. import DialogueArticleViewChs from "./preview/DialogueArticleViewChs/index.vue"; // 文章模板
  398. import SentenceSegWordViewChs from "./preview/SentenceSegWordViewChs.vue"; // 句子分词
  399. import WordPhrase from "./preview/WordPhrase.vue"; // 生词短语
  400. import Notes from "./preview/Notes.vue"; // 注释
  401. import Ligature from "./preview/Ligature.vue";
  402. import InputHasRecord from "./preview/InputHasRecord.vue"; // 输入加录音
  403. import TextInputRecord from "./preview/TextInputRecord.vue"; // 文本+输入+录音
  404. import SentenceInput from "./preview/SentenceInput.vue"; // 输入选项
  405. import NumberSelectHasRecord from "./preview/NumberSelectHasRecord.vue"; // 数字组合
  406. import SelectTone from "./preview/SelectTone.vue"; // 选择声调
  407. import Soduko from "./preview/Soduko.vue"; // 数独
  408. import Single from "./preview/Single.vue"; // 单选
  409. import TextProblem from "./preview/TextProblem.vue"; // 课文上方的问题
  410. import NewWordShow from "./preview/NewWordShow.vue"; // 生字展示
  411. import SelectYinjie from "./preview/SelectYinjie.vue"; // 选择音节
  412. import SentenceListenRead from "./preview/SentenceListenRead.vue"; // 听并朗读
  413. import SentenceSortQP from "./preview/SentenceSortQP.vue"; // 句子拖拽排序
  414. import Checkbox from "./preview/CheckBoxModule.vue"; // 问卷调查-多选题
  415. import VoiceMatrix from "./preview/VoiceMatrix.vue"; // 语音矩阵
  416. import RecordModule from "./preview/RecordModule.vue"; // 录音组件
  417. import UploadControlView from "./preview/UploadControlView.vue"; // 预览控件
  418. import DialogueAnswerViewChs from "./preview/DialogueArticleViewChs/DialogueAnswerViewChs.vue"; // 文章模板
  419. import CourseStart from "./preview/CourseStart.vue"; // 封面
  420. import Tinydemo from "./preview/TinyModule.vue"; // 富文本
  421. import VideoControl from "./preview/VideoControl.vue"; // 视频控件
  422. import TableView from "./preview/TableView.vue"; // 视频控件
  423. export default {
  424. name: "Preview",
  425. components: {
  426. Picture,
  427. Record,
  428. Soundrecord,
  429. ArticleTemChs,
  430. DialogueArticleViewChs,
  431. SentenceSegWordViewChs,
  432. WordPhrase,
  433. Notes,
  434. Ligature,
  435. InputHasRecord,
  436. TextInputRecord,
  437. SentenceInput,
  438. NumberSelectHasRecord,
  439. SelectTone,
  440. Soduko,
  441. Single,
  442. TextProblem,
  443. NewWordShow,
  444. SelectYinjie,
  445. SentenceListenRead,
  446. SentenceSortQP,
  447. Checkbox,
  448. VoiceMatrix,
  449. RecordModule,
  450. UploadControlView,
  451. DialogueAnswerViewChs,
  452. CourseStart,
  453. Tinydemo,
  454. VideoControl,
  455. TableView,
  456. },
  457. props: [
  458. "context",
  459. "fatherName",
  460. "currentTreeID",
  461. "FatherTreeData",
  462. "changeId",
  463. "themeColor",
  464. "isShowTitle",
  465. ],
  466. data() {
  467. return {
  468. contextData: null,
  469. queIndex: -1, // 题目的索引
  470. cur: null, // 当前的题目
  471. watchIndex: -1, // 监听的值
  472. queList: [],
  473. queTotal: 0, // 题目总数
  474. NNPENewWordList: [], // 存放文章的生词
  475. NNPENewPhraseList: [], // 存放文章的短语
  476. NNPEAnnotationList: [], // 存放文章注释
  477. height: "", // 总体的高度
  478. colorBox: [
  479. {
  480. touxiang: "#72B51D",
  481. bg: "#E9F0DF",
  482. },
  483. {
  484. touxiang: "#DE4444",
  485. bg: "rgba(222, 68, 68, 0.1)",
  486. },
  487. {
  488. touxiang: "#A7A7A7",
  489. bg: "#ffffff",
  490. },
  491. {
  492. touxiang: "#4D91F6",
  493. bg: "#F1F7FF",
  494. },
  495. {
  496. touxiang: "#FF8A00",
  497. bg: "rgba(255, 138, 0, 0.1)",
  498. },
  499. ],
  500. chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
  501. noFont: ["~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")"], // 对应不要拼音字体
  502. idArr: [], //当前的pid
  503. oldCurrentTreeID: "",
  504. refresh: true,
  505. };
  506. },
  507. computed: {},
  508. watch: {
  509. context: {
  510. handler(val, oldVal) {
  511. const _this = this;
  512. _this.refresh = false;
  513. if (val) {
  514. _this.initContextData();
  515. _this.handleTitleData();
  516. _this.$nextTick(() => {
  517. // 重新渲染组件
  518. _this.refresh = true;
  519. });
  520. }
  521. },
  522. // 深度观察监听
  523. deep: true,
  524. },
  525. },
  526. // 生命周期 - 创建完成(可以访问当前this实例)
  527. created() {},
  528. // 生命周期 - 挂载完成(可以访问DOM元素)
  529. mounted() {
  530. const _this = this;
  531. if (_this.context) {
  532. _this.initContextData();
  533. _this.handleTitleData();
  534. }
  535. },
  536. beforeCreate() {}, // 生命周期 - 创建之前
  537. beforeMount() {}, // 生命周期 - 挂载之前
  538. beforeUpdate() {}, // 生命周期 - 更新之前
  539. updated() {}, // 生命周期 - 更新之后
  540. beforeDestroy() {}, // 生命周期 - 销毁之前
  541. destroyed() {}, // 生命周期 - 销毁完成
  542. activated() {},
  543. // 方法集合
  544. methods: {
  545. // 处理数据
  546. handleTitleData() {
  547. let _this = this;
  548. let curQue = JSON.parse(JSON.stringify(this.cur));
  549. curQue.detailList.forEach((dItem, dIndex) => {
  550. let paraArr = [];
  551. dItem.wordsList.forEach((sItem, sIndex) => {
  552. let obj = {
  553. pinyin: sItem.pinyin,
  554. chs: sItem.chs,
  555. isShow: true,
  556. };
  557. paraArr.push(obj);
  558. });
  559. this.$set(_this.cur.detailList[dIndex], "resArr", paraArr);
  560. });
  561. },
  562. initContextData() {
  563. const _this = this;
  564. _this.contextData = JSON.parse(JSON.stringify(_this.context));
  565. _this.queIndex = 0;
  566. _this.NNPENewWordList = [];
  567. _this.NNPENewPhraseList = [];
  568. _this.watchIndex = _this.queIndex + new Date().getTime();
  569. if (_this.contextData) {
  570. // const list = _this.contextData;
  571. // if (list && list.length > 0) {
  572. // _this.queList = list;
  573. // _this.cur = list[_this.queIndex];
  574. _this.queTotal = 1;
  575. // _this.cur.cur_fn_data.forEach((item) => {
  576. // item.table_list.forEach((items) => {
  577. // items.forEach((itemss) => {
  578. // if (itemss.data && itemss.data.type == "NewWord_chs") {
  579. // _this.NNPENewWordList = _this.NNPENewWordList.concat(
  580. // itemss.data.option
  581. // );
  582. // } else if (itemss.data && itemss.data.type == "notes_chs") {
  583. // _this.NNPEAnnotationList = _this.NNPEAnnotationList.concat(
  584. // itemss.data.option
  585. // );
  586. // }
  587. // });
  588. // });
  589. // });
  590. // }
  591. _this.cur = _this.contextData;
  592. _this.cur.cur_fn_data.forEach((item) => {
  593. item.table_list.forEach((items) => {
  594. items.forEach((itemss) => {
  595. if (itemss.data && itemss.data.type == "NewWord_chs") {
  596. _this.NNPENewWordList = _this.NNPENewWordList.concat(
  597. itemss.data.option
  598. );
  599. } else if (itemss.data && itemss.data.type == "notes_chs") {
  600. _this.NNPEAnnotationList = _this.NNPEAnnotationList.concat(
  601. itemss.data.option
  602. );
  603. }
  604. });
  605. });
  606. });
  607. }
  608. this.$forceUpdate();
  609. },
  610. // 上一页
  611. handleNNPEprev() {
  612. let _this = this;
  613. if (_this.queIndex == 0) {
  614. _this.FatherTreeData.forEach((item, itemIndex) => {
  615. this.seekCurrentTree(item);
  616. });
  617. this.idArr.forEach((item, i) => {
  618. if (item == _this.currentTreeID) {
  619. if (i == 0) {
  620. this.$message({
  621. message: "已经是第一题",
  622. type: "success",
  623. });
  624. } else {
  625. _this.changeId(this.idArr[i - 1]);
  626. }
  627. }
  628. });
  629. } else {
  630. _this.queIndex -= 1;
  631. _this.watchIndex = _this.queIndex + new Date().getTime();
  632. _this.cur = _this.queList[_this.queIndex];
  633. }
  634. },
  635. // 递归寻找相同的目录并保存目录的pid
  636. seekCurrentTree(item) {
  637. if (item.is_courseware == "true") {
  638. this.idArr.push(item.id);
  639. }
  640. if (item.children) {
  641. item.children.forEach((it, index) => {
  642. if (it.is_courseware == "true") {
  643. this.idArr.push(it.id);
  644. }
  645. if (it.children) {
  646. this.seekCurrentTree(it);
  647. }
  648. });
  649. }
  650. },
  651. // 下一页
  652. handleNNPEnext() {
  653. const _this = this;
  654. if (_this.queIndex == _this.queTotal - 1) {
  655. _this.FatherTreeData.forEach((item, itemIndex) => {
  656. this.seekCurrentTree(item);
  657. });
  658. this.idArr.forEach((item, i) => {
  659. if (item == _this.currentTreeID) {
  660. if (i == this.idArr.length - 1) {
  661. this.$message({
  662. message: "已经是最后一题",
  663. type: "success",
  664. });
  665. } else {
  666. _this.changeId(this.idArr[i + 1]);
  667. }
  668. }
  669. });
  670. } else {
  671. _this.queIndex += 1;
  672. _this.watchIndex = _this.queIndex + new Date().getTime();
  673. _this.cur = _this.queList[_this.queIndex];
  674. }
  675. },
  676. }, // 如果页面有keep-alive缓存功能,这个函数会触发
  677. };
  678. </script>
  679. <style lang='scss' scoped>
  680. //@import url(); 引入公共css类
  681. .NPC-Big-Book-preview {
  682. width: 860px;
  683. margin: 0 auto;
  684. position: relative;
  685. .NNPE-title {
  686. background: #e35454;
  687. border-radius: 0px 0px 16px 16px;
  688. padding: 7px 24px;
  689. position: relative;
  690. height: 64px;
  691. display: flex;
  692. align-items: center;
  693. h1 {
  694. color: #ffffff;
  695. font-weight: bold;
  696. font-size: 16px;
  697. line-height: 150%;
  698. margin: 0;
  699. }
  700. .NNPE-title-left {
  701. display: flex;
  702. color: #ffffff;
  703. font-size: 20px;
  704. line-height: 28px;
  705. align-items: flex-end;
  706. .NNPE-title-item {
  707. margin-right: 12px;
  708. }
  709. .content-con {
  710. margin: 0;
  711. font-family: "robot";
  712. &.hasCn,
  713. &.hanzi {
  714. font-family: "FZJCGFKTK";
  715. }
  716. }
  717. .content-en {
  718. font-weight: normal;
  719. line-height: 28px;
  720. font-family: "robot";
  721. }
  722. .con-box {
  723. display: flex;
  724. flex-flow: wrap;
  725. justify-content: center;
  726. .con-item {
  727. text-align: center;
  728. padding: 0 1px;
  729. }
  730. span {
  731. display: block;
  732. }
  733. .pinyin {
  734. font-family: "GB-PINYINOK-B";
  735. font-size: 14px;
  736. line-height: 22px;
  737. height: 22px;
  738. &.noFont {
  739. font-family: initial;
  740. }
  741. }
  742. .synthesis-box {
  743. display: flex;
  744. }
  745. }
  746. }
  747. .NNPE-operate {
  748. position: absolute;
  749. top: 10px;
  750. right: 20px;
  751. a {
  752. background: #e35454 url("../../assets/newImage/common/btn-pre.png")
  753. center no-repeat;
  754. background-size: 24px;
  755. border-radius: 4px;
  756. width: 44px;
  757. height: 44px;
  758. display: inline-block;
  759. margin: 0 4px;
  760. &.btn-next {
  761. background: #e35454 url("../../assets/newImage/common/btn-next.png")
  762. center no-repeat;
  763. background-size: 24px;
  764. }
  765. &:hover {
  766. background-color: #f76565;
  767. }
  768. &:active {
  769. background-color: #d24444;
  770. }
  771. }
  772. }
  773. }
  774. .classTopic-box {
  775. background: #e35454;
  776. border-radius: 8px;
  777. width: 780px;
  778. margin: 24px auto 0 auto;
  779. text-align: center;
  780. padding: 8px 24px;
  781. span {
  782. font-size: 16px;
  783. line-height: 150%;
  784. color: #ffffff;
  785. padding: 0 1px;
  786. &.cn {
  787. font-family: "FZJCGFKTK";
  788. }
  789. &.en {
  790. font-family: "robot";
  791. }
  792. &.pinyin {
  793. font-family: "GB-PINYINOK-B";
  794. }
  795. }
  796. }
  797. .NNPE-Book-content-inner {
  798. padding: 0 40px;
  799. > div {
  800. padding-top: 24px;
  801. > h2 {
  802. color: #e35454;
  803. font-size: 16px;
  804. line-height: 150%;
  805. font-weight: bold;
  806. margin: 0;
  807. b {
  808. min-width: 48px;
  809. height: 24px;
  810. background: #e35454;
  811. border-radius: 8px;
  812. color: #ffffff;
  813. font-family: "robot";
  814. display: inline-block;
  815. text-align: center;
  816. font-size: 16px;
  817. margin-right: 14px;
  818. padding: 0 4px;
  819. }
  820. }
  821. > h3 {
  822. color: #000000;
  823. font-size: 16px;
  824. line-height: 150%;
  825. font-weight: normal;
  826. margin: 8px 0 0 0;
  827. white-space: pre-wrap;
  828. word-break: break-word;
  829. }
  830. }
  831. .NNPE-tableList {
  832. background: #fff;
  833. border-radius: 8px;
  834. margin-top: 16px;
  835. // padding: 12px 8px;
  836. &.NNPE-tableList-hasBg {
  837. background: #f7f7f7;
  838. border: 1px solid rgba(0, 0, 0, 0.1);
  839. box-sizing: border-box;
  840. border-radius: 8px;
  841. }
  842. .NNPE-tableList-tr {
  843. display: flex;
  844. justify-content: space-between;
  845. // flex-flow: wrap;
  846. .NNPE-tableList-item {
  847. width: 100%;
  848. // margin: 12px 16px;
  849. // padding: 16px;
  850. // background: #FFFFFF;
  851. // border-radius: 4px;
  852. display: flex;
  853. flex-flow: wrap;
  854. justify-content: center;
  855. &.NNPE-tableList-item-noMargin {
  856. margin: 0;
  857. }
  858. &.NNPE-tableList-item2 {
  859. width: 378px;
  860. }
  861. &.NNPE-tableList-item3 {
  862. width: 244px;
  863. }
  864. }
  865. }
  866. }
  867. }
  868. }
  869. .NPC-Big-Book-preview-green {
  870. .NNPE-title {
  871. background: #24b99e;
  872. .NNPE-operate {
  873. a {
  874. background: #24b99e url("../../assets/newImage/common/btn-pre.png")
  875. center no-repeat;
  876. background-size: 24px;
  877. &.btn-next {
  878. background: #24b99e url("../../assets/newImage/common/btn-next.png")
  879. center no-repeat;
  880. background-size: 24px;
  881. }
  882. &:hover {
  883. background-color: #3dd4b8;
  884. }
  885. &:active {
  886. background-color: #1fa189;
  887. }
  888. }
  889. }
  890. }
  891. .classTopic-box {
  892. background: #24b99e;
  893. }
  894. .NNPE-Book-content-inner {
  895. > div {
  896. > h2 {
  897. color: #24b99e;
  898. b {
  899. background: #24b99e;
  900. }
  901. }
  902. }
  903. }
  904. }
  905. .NPC-Big-Book-preview-brown {
  906. .NNPE-title {
  907. background: #bd8865;
  908. .NNPE-operate {
  909. a {
  910. background: #bd8865 url("../../assets/newImage/common/btn-pre.png")
  911. center no-repeat;
  912. background-size: 24px;
  913. &.btn-next {
  914. background: #bd8865 url("../../assets/newImage/common/btn-next.png")
  915. center no-repeat;
  916. background-size: 24px;
  917. }
  918. &:hover {
  919. background-color: #d6a687;
  920. }
  921. &:active {
  922. background-color: #a37557;
  923. }
  924. }
  925. }
  926. }
  927. .classTopic-box {
  928. background: #bd8865;
  929. }
  930. .NNPE-Book-content-inner {
  931. > div {
  932. > h2 {
  933. color: #bd8865;
  934. b {
  935. background: #bd8865;
  936. }
  937. }
  938. }
  939. }
  940. }
  941. </style>