Preview.vue 32 KB

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