Preview.vue 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256
  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" :class="[preClick?'':'btn-prev-disabled']" @click="handleNNPEprev" />
  100. <a class="btn-next" :class="[nextClick?'':'btn-next-disabled']" @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
  119. v-for="(item, index) in cur.cur_fn_data"
  120. :key="index"
  121. class="title-box-preview"
  122. >
  123. <div
  124. class="title-big"
  125. v-if="item.number || item.z_title || item.f_title"
  126. >
  127. <b v-if="item.number">{{ item.number }}</b>
  128. <div
  129. class="title-box-right"
  130. :class="[item.is_textIndex ? 'title-box-right-index' : '']"
  131. >
  132. <h2 v-if="item.z_title" v-html="item.z_title"></h2>
  133. <h3
  134. v-if="item.f_title"
  135. v-html="item.f_title"
  136. :style="{ marginTop: item.z_title ? '8px' : '0' }"
  137. ></h3>
  138. </div>
  139. </div>
  140. <div
  141. class="title-little"
  142. :class="[
  143. item.little_title_number || item.little_title ? 'marginTop' : '',
  144. ]"
  145. >
  146. <b v-html="item.little_title_number"></b>
  147. <p v-html="item.little_title"></p>
  148. </div>
  149. <div
  150. :class="['NNPE-tableList', item.is_bg ? 'NNPE-tableList-hasBg' : '']"
  151. >
  152. <div
  153. v-for="(items, indexs) in item.table_list"
  154. :key="indexs"
  155. class="NNPE-tableList-tr"
  156. :class="[
  157. indexs === item.table_list.length - 1
  158. ? 'NNPE-tableList-tr-last'
  159. : '',
  160. ]"
  161. >
  162. <div
  163. v-for="(itemss, indexss) in items"
  164. :key="indexss"
  165. :class="[
  166. 'NNPE-tableList-item',
  167. items.length == 1
  168. ? 'NNPE-tableList-item-noMargin'
  169. : 'NNPE-tableList-item' + items.length,
  170. ]"
  171. >
  172. <template v-if="itemss.data">
  173. <template v-if="itemss.type == 'ligature_chs'">
  174. <Ligature
  175. :cur-que="itemss.data"
  176. :theme-color="themeColor"
  177. :TaskModel="TaskModel"
  178. />
  179. </template>
  180. <template v-if="itemss.data.type == 'image'">
  181. <Picture
  182. :cur-que="itemss.data"
  183. :child-type="itemss.type"
  184. :theme-color="themeColor"
  185. :TaskModel="TaskModel"
  186. v-if="refresh"
  187. />
  188. </template>
  189. <template v-if="itemss.type == 'phrase_chs'">
  190. <WordPhrase
  191. :cur-que="itemss.data"
  192. :theme-color="themeColor"
  193. :TaskModel="TaskModel"
  194. v-if="refresh"
  195. />
  196. </template>
  197. <template v-if="itemss.type == 'NewWord_chs'">
  198. <WordPhrase
  199. :cur-que="itemss.data"
  200. :theme-color="themeColor"
  201. :currentTreeID="currentTreeID"
  202. :indexs="indexs"
  203. :indexss="indexss"
  204. :TaskModel="TaskModel"
  205. v-if="refresh"
  206. />
  207. </template>
  208. <template v-if="itemss.type == 'annotation_chs'">
  209. <WordPhrase
  210. :cur-que="itemss.data"
  211. :theme-color="themeColor"
  212. :TaskModel="TaskModel"
  213. v-if="refresh"
  214. />
  215. </template>
  216. <template v-if="itemss.type == 'notes_chs'">
  217. <Notes
  218. :cur-que="itemss.data"
  219. :theme-color="themeColor"
  220. :TaskModel="TaskModel"
  221. v-if="refresh"
  222. />
  223. </template>
  224. <template v-if="itemss.type == 'article_chs'">
  225. <ArticleTemChs
  226. :cur-que="itemss.data"
  227. :n-n-p-e-new-word-list="NNPENewWordList"
  228. :n-n-p-e-new-phrase-list="NNPENewPhraseList"
  229. :n-n-p-e-annotation-list="NNPEAnnotationList"
  230. :theme-color="themeColor"
  231. :currentTreeID="currentTreeID"
  232. :TaskModel="TaskModel"
  233. v-if="refresh"
  234. />
  235. </template>
  236. <!-- <template v-if="itemss.type == 'sentence_segword_chs'">
  237. <SentenceSegWordViewChs
  238. :cur-que="itemss.data"
  239. :theme-color="themeColor"
  240. v-if="refresh"
  241. />
  242. </template> -->
  243. <template v-if="itemss.type == 'dialogue_article_chs'">
  244. <DialogueArticleViewChs
  245. :cur-que="itemss.data"
  246. :n-n-p-e-new-word-list="NNPENewWordList"
  247. :n-n-p-e-new-phrase-list="NNPENewPhraseList"
  248. :n-n-p-e-annotation-list="NNPEAnnotationList"
  249. :color-box="colorBox"
  250. :theme-color="themeColor"
  251. :currentTreeID="currentTreeID"
  252. :TaskModel="TaskModel"
  253. v-if="refresh"
  254. />
  255. </template>
  256. <template v-if="itemss.type == 'dialogue_answer_chs'">
  257. <DialogueAnswerViewChs
  258. :cur-que="itemss.data"
  259. :color-box="colorBox"
  260. :theme-color="themeColor"
  261. :TaskModel="TaskModel"
  262. v-if="refresh"
  263. />
  264. </template>
  265. <template v-if="itemss.type == 'input_record_chs'">
  266. <InputHasRecord
  267. :cur-que="itemss.data"
  268. :theme-color="themeColor"
  269. :TaskModel="TaskModel"
  270. v-if="refresh"
  271. />
  272. </template>
  273. <template v-if="itemss.type == 'recordHZ_inputPY_chs'">
  274. <TextInputRecord
  275. :cur-que="itemss.data"
  276. :theme-color="themeColor"
  277. :TaskModel="TaskModel"
  278. v-if="refresh"
  279. />
  280. </template>
  281. <template
  282. v-if="
  283. itemss.type == 'inputItem_chs' ||
  284. itemss.type == 'sentence_input_chs' ||
  285. itemss.type == 'sentence_judge_chs' ||
  286. itemss.type == 'sentence_record_chs' ||
  287. itemss.type == 'sentence_input_record_chs'
  288. "
  289. >
  290. <SentenceInput
  291. :cur-que="itemss.data"
  292. :theme-color="themeColor"
  293. :TaskModel="TaskModel"
  294. v-if="refresh"
  295. />
  296. </template>
  297. <template v-if="itemss.type == 'NumberCombination_chs'">
  298. <NumberSelectHasRecord
  299. :cur-que="itemss.data"
  300. :theme-color="themeColor"
  301. :TaskModel="TaskModel"
  302. v-if="refresh"
  303. />
  304. </template>
  305. <template v-if="itemss.type === 'voice_matrix'">
  306. <voice-matrix
  307. :cur-que="itemss.data"
  308. :theme-color="themeColor"
  309. :TaskModel="TaskModel"
  310. v-if="refresh"
  311. />
  312. </template>
  313. <template v-if="itemss.type == 'toneSelect_chs'">
  314. <SelectTone
  315. :cur-que="itemss.data"
  316. :theme-color="themeColor"
  317. :TaskModel="TaskModel"
  318. v-if="refresh"
  319. />
  320. </template>
  321. <template v-if="itemss.type == 'sudoku_chs'">
  322. <Soduko
  323. :cur-que="itemss.data"
  324. :theme-color="themeColor"
  325. :TaskModel="TaskModel"
  326. v-if="refresh"
  327. />
  328. </template>
  329. <template v-if="itemss.type == 'single_chs'">
  330. <Single
  331. :cur-que="itemss.data"
  332. :theme-color="themeColor"
  333. :TaskModel="TaskModel"
  334. v-if="refresh"
  335. />
  336. </template>
  337. <template v-if="itemss.type == 'text_problem_chs'">
  338. <TextProblem
  339. :cur-que="itemss.data"
  340. :theme-color="themeColor"
  341. :TaskModel="TaskModel"
  342. v-if="refresh"
  343. />
  344. </template>
  345. <template v-if="itemss.type == 'newWord_preview_chs'">
  346. <NewWordShow
  347. :cur-que="itemss.data"
  348. :theme-color="themeColor"
  349. :indexStr="index + '_' + indexs + '_' + indexss"
  350. :TaskModel="TaskModel"
  351. v-if="refresh"
  352. />
  353. </template>
  354. <template
  355. v-if="itemss.type == 'listen_record_single_syllable_chs'"
  356. >
  357. <SelectYinjie
  358. :cur-que="itemss.data"
  359. :theme-color="themeColor"
  360. :TaskModel="TaskModel"
  361. v-if="refresh"
  362. />
  363. </template>
  364. <template v-if="itemss.type == 'sentence_listen_read_chs'">
  365. <SentenceListenRead
  366. :cur-que="itemss.data"
  367. :theme-color="themeColor"
  368. :TaskModel="TaskModel"
  369. v-if="refresh"
  370. />
  371. </template>
  372. <template v-if="itemss.type == 'sort_chs'">
  373. <SentenceSortQP
  374. :cur-que="itemss.data"
  375. :theme-color="themeColor"
  376. :TaskModel="TaskModel"
  377. v-if="refresh"
  378. />
  379. </template>
  380. <template v-if="itemss.type == 'checkbox_self_assessment_chs'">
  381. <Checkbox
  382. :cur-que="itemss.data"
  383. :theme-color="themeColor"
  384. :TaskModel="TaskModel"
  385. v-if="refresh"
  386. />
  387. </template>
  388. <template
  389. v-if="
  390. itemss.type == 'record_control_mini' ||
  391. itemss.type == 'record_control_normal' ||
  392. itemss.type == 'record_control_pro' ||
  393. itemss.type == 'record_control_promax'
  394. "
  395. >
  396. <RecordModule
  397. :cur-que="itemss.data"
  398. :theme-color="themeColor"
  399. :TaskModel="TaskModel"
  400. v-if="refresh"
  401. />
  402. </template>
  403. <template
  404. v-if="
  405. itemss.type == 'upload_control_chs' ||
  406. itemss.type == 'upload_control_preview_chs'
  407. "
  408. >
  409. <UploadControlView
  410. :cur-que="itemss.data"
  411. :type="itemss.type"
  412. :theme-color="themeColor"
  413. :TaskModel="TaskModel"
  414. v-if="refresh"
  415. />
  416. </template>
  417. <template v-if="itemss.type == 'CourseStart_chs'">
  418. <CourseStart
  419. :cur-que="itemss.data"
  420. :handle-n-n-p-enext="handleNNPEnext"
  421. :theme-color="themeColor"
  422. :TaskModel="TaskModel"
  423. v-if="refresh"
  424. />
  425. </template>
  426. <template v-if="itemss.type == 'tinydemo_chs'">
  427. <Tinydemo
  428. :cur-que="itemss.data"
  429. :theme-color="themeColor"
  430. :TaskModel="TaskModel"
  431. v-if="refresh"
  432. />
  433. </template>
  434. <template v-if="itemss.type == 'video_chs'">
  435. <VideoControl
  436. :cur-que="itemss.data"
  437. :type="itemss.type"
  438. :theme-color="themeColor"
  439. :indexStr="
  440. index + '_' + indexs + '_' + indexss + '_' + currentTreeID
  441. "
  442. :TaskModel="TaskModel"
  443. v-if="refresh"
  444. />
  445. </template>
  446. <template v-if="itemss.type == 'table_chs'">
  447. <TableView
  448. :cur-que="itemss.data"
  449. :type="itemss.type"
  450. :theme-color="themeColor"
  451. :TaskModel="TaskModel"
  452. v-if="refresh"
  453. />
  454. </template>
  455. <template v-if="itemss.type == 'play_record_chs'">
  456. <PlayRecordView
  457. :cur-que="itemss.data"
  458. :type="itemss.type"
  459. :theme-color="themeColor"
  460. :TaskModel="TaskModel"
  461. v-if="refresh"
  462. />
  463. </template>
  464. <template v-if="itemss.type == 'upload_pdf_chs'">
  465. <PdfView
  466. :cur-que="itemss.data"
  467. :type="itemss.type"
  468. :theme-color="themeColor"
  469. :TaskModel="TaskModel"
  470. v-if="refresh"
  471. />
  472. </template>
  473. </template>
  474. </div>
  475. </div>
  476. </div>
  477. </div>
  478. </div>
  479. <div class="NNPE-title NNPE-title-gray" v-if="isShowSave||isShowTitle">
  480. <!-- 页眉 -->
  481. <a class="submitAnswer" v-if="isShowSave" @click="submitUserAnswerNPC">提交</a>
  482. <div class="NNPE-operate" v-if="isShowTitle">
  483. <a class="btn-prev" :class="[preClick?'':'btn-prev-disabled']" @click="handleNNPEprev" />
  484. <a class="btn-next" :class="[nextClick?'':'btn-next-disabled']" @click="handleNNPEnext" />
  485. </div>
  486. </div>
  487. </div>
  488. </template>
  489. <script>
  490. import Picture from "./preview/Picture.vue"; // 图片模板
  491. import Record from "./preview/Record.vue"; // 音频播放
  492. import Soundrecord from "./preview/Soundrecord.vue"; // 录音模板
  493. import ArticleTemChs from "./preview/ArticleViewChs/index.vue"; // 文章模板
  494. import DialogueArticleViewChs from "./preview/DialogueArticleViewChs/index.vue"; // 文章模板
  495. import SentenceSegWordViewChs from "./preview/SentenceSegWordViewChs.vue"; // 句子分词
  496. import WordPhrase from "./preview/WordPhrase.vue"; // 生词短语
  497. import Notes from "./preview/Notes.vue"; // 注释
  498. import Ligature from "./preview/Ligature.vue";
  499. import InputHasRecord from "./preview/InputHasRecord.vue"; // 输入加录音
  500. import TextInputRecord from "./preview/TextInputRecord.vue"; // 文本+输入+录音
  501. import SentenceInput from "./preview/SentenceInput.vue"; // 输入选项
  502. import NumberSelectHasRecord from "./preview/NumberSelectHasRecord.vue"; // 数字组合
  503. import SelectTone from "./preview/SelectTone.vue"; // 选择声调
  504. import Soduko from "./preview/Soduko.vue"; // 数独
  505. import Single from "./preview/Single.vue"; // 单选
  506. import TextProblem from "./preview/TextProblem.vue"; // 课文上方的问题
  507. import NewWordShow from "./preview/NewWordShow.vue"; // 生字展示
  508. import SelectYinjie from "./preview/SelectYinjie.vue"; // 选择音节
  509. import SentenceListenRead from "./preview/SentenceListenRead.vue"; // 听并朗读
  510. import SentenceSortQP from "./preview/SentenceSortQP.vue"; // 句子拖拽排序
  511. import Checkbox from "./preview/CheckBoxModule.vue"; // 问卷调查-多选题
  512. import VoiceMatrix from "./preview/VoiceMatrix.vue"; // 语音矩阵
  513. import RecordModule from "./preview/RecordModule.vue"; // 录音组件
  514. import UploadControlView from "./preview/UploadControlView.vue"; // 预览控件
  515. import DialogueAnswerViewChs from "./preview/DialogueArticleViewChs/DialogueAnswerViewChs.vue"; // 文章模板
  516. import CourseStart from "./preview/CourseStart.vue"; // 封面
  517. import Tinydemo from "./preview/TinyModule.vue"; // 富文本
  518. import VideoControl from "./preview/VideoControl.vue"; // 视频控件
  519. import TableView from "./preview/TableView.vue"; // 视频控件
  520. import PdfView from "./preview/PdfView.vue"; // 视频控件
  521. import PlayRecordView from "@/components/Adult/preview/PlayRecordView.vue";
  522. export default {
  523. name: "Preview",
  524. components: {
  525. Picture,
  526. Record,
  527. Soundrecord,
  528. ArticleTemChs,
  529. DialogueArticleViewChs,
  530. SentenceSegWordViewChs,
  531. WordPhrase,
  532. Notes,
  533. Ligature,
  534. InputHasRecord,
  535. TextInputRecord,
  536. SentenceInput,
  537. NumberSelectHasRecord,
  538. SelectTone,
  539. Soduko,
  540. Single,
  541. TextProblem,
  542. NewWordShow,
  543. SelectYinjie,
  544. SentenceListenRead,
  545. SentenceSortQP,
  546. Checkbox,
  547. VoiceMatrix,
  548. RecordModule,
  549. UploadControlView,
  550. DialogueAnswerViewChs,
  551. CourseStart,
  552. Tinydemo,
  553. VideoControl,
  554. TableView,
  555. PdfView,
  556. PlayRecordView,
  557. },
  558. props: [
  559. "context",
  560. "fatherName",
  561. "currentTreeID",
  562. "FatherTreeData",
  563. "changeId",
  564. "themeColor",
  565. "isShowTitle",
  566. "bookAnswerContent",
  567. "TaskModel",
  568. "isShowSave"
  569. ],
  570. data() {
  571. return {
  572. contextData: null,
  573. answerData: [], //获取的答案数据
  574. queIndex: -1, // 题目的索引
  575. cur: null, // 当前的题目
  576. watchIndex: -1, // 监听的值
  577. queList: [],
  578. queTotal: 0, // 题目总数
  579. NNPENewWordList: [], // 存放文章的生词
  580. NNPENewPhraseList: [], // 存放文章的短语
  581. NNPEAnnotationList: [], // 存放文章注释
  582. height: "", // 总体的高度
  583. colorBox: [
  584. {
  585. touxiang: "#72B51D",
  586. bg: "#E9F0DF",
  587. },
  588. {
  589. touxiang: "#DE4444",
  590. bg: "rgba(222, 68, 68, 0.1)",
  591. },
  592. {
  593. touxiang: "#A7A7A7",
  594. bg: "#ffffff",
  595. },
  596. {
  597. touxiang: "#4D91F6",
  598. bg: "#F1F7FF",
  599. },
  600. {
  601. touxiang: "#FF8A00",
  602. bg: "rgba(255, 138, 0, 0.1)",
  603. },
  604. ],
  605. chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
  606. noFont: ["~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")"], // 对应不要拼音字体
  607. idArr: [], //当前的pid
  608. oldCurrentTreeID: "",
  609. refresh: true,
  610. preClick: false, // 上一页是否可点
  611. nextClick: false, // 下一页是否可点
  612. };
  613. },
  614. computed: {},
  615. watch: {
  616. context: {
  617. handler(val, oldVal) {
  618. const _this = this;
  619. _this.refresh = false;
  620. if (val) {
  621. _this.initContextData();
  622. if (_this.FatherTreeData) {
  623. _this.idArr = [];
  624. _this.FatherTreeData.forEach((item, itemIndex) => {
  625. this.seekCurrentTree(item);
  626. });
  627. }
  628. _this.handleTitleData();
  629. if (_this.queIndex == _this.queTotal - 1) {
  630. this.idArr.forEach((item, i) => {
  631. if (item == _this.currentTreeID) {
  632. if(i==0){
  633. _this.preClick = false
  634. _this.nextClick = true
  635. }else if (i == this.idArr.length - 1) {
  636. _this.nextClick = false
  637. _this.preClick = true
  638. } else {
  639. _this.nextClick = true
  640. _this.preClick = true
  641. }
  642. }
  643. });
  644. }
  645. _this.$nextTick(() => {
  646. // 重新渲染组件
  647. _this.refresh = true;
  648. });
  649. }
  650. },
  651. // 深度观察监听
  652. deep: true,
  653. },
  654. },
  655. // 生命周期 - 创建完成(可以访问当前this实例)
  656. created() {},
  657. // 生命周期 - 挂载完成(可以访问DOM元素)
  658. mounted() {
  659. const _this = this;
  660. if (_this.context) {
  661. _this.initContextData();
  662. _this.handleTitleData();
  663. }
  664. if (_this.FatherTreeData) {
  665. _this.idArr = [];
  666. _this.FatherTreeData.forEach((item, itemIndex) => {
  667. this.seekCurrentTree(item);
  668. });
  669. if (_this.queIndex == _this.queTotal - 1) {
  670. this.idArr.forEach((item, i) => {
  671. if (item == _this.currentTreeID) {
  672. if(i==0){
  673. _this.preClick = false
  674. _this.nextClick = true
  675. }else if (i == this.idArr.length - 1) {
  676. _this.nextClick = false
  677. _this.preClick = true
  678. } else {
  679. _this.nextClick = true
  680. _this.preClick = true
  681. }
  682. }
  683. });
  684. }
  685. }
  686. },
  687. beforeCreate() {}, // 生命周期 - 创建之前
  688. beforeMount() {}, // 生命周期 - 挂载之前
  689. beforeUpdate() {}, // 生命周期 - 更新之前
  690. updated() {}, // 生命周期 - 更新之后
  691. beforeDestroy() {}, // 生命周期 - 销毁之前
  692. destroyed() {}, // 生命周期 - 销毁完成
  693. activated() {},
  694. // 方法集合
  695. methods: {
  696. // 处理数据
  697. handleTitleData() {
  698. let _this = this;
  699. let curQue = JSON.parse(JSON.stringify(this.cur));
  700. curQue.detailList.forEach((dItem, dIndex) => {
  701. let paraArr = [];
  702. if (dItem.detail) {
  703. dItem.detail.wordsList.forEach((sItem, sIndex) => {
  704. let obj = {
  705. pinyin: sItem.pinyin,
  706. chs: sItem.chs,
  707. isShow: true,
  708. };
  709. paraArr.push(obj);
  710. });
  711. this.$set(_this.cur.detailList[dIndex].detail, "resArr", paraArr);
  712. }
  713. });
  714. },
  715. initContextData() {
  716. const _this = this;
  717. //_this.$root.isRecording = false;
  718. _this.contextData = JSON.parse(JSON.stringify(_this.context));
  719. _this.queIndex = 0;
  720. _this.NNPENewWordList = [];
  721. _this.NNPENewPhraseList = [];
  722. _this.NNPEAnnotationList = [];
  723. _this.watchIndex = _this.queIndex + new Date().getTime();
  724. if (_this.contextData) {
  725. // const list = _this.contextData;
  726. // if (list && list.length > 0) {
  727. // _this.queList = list;
  728. // _this.cur = list[_this.queIndex];
  729. _this.queTotal = 1;
  730. // _this.cur.cur_fn_data.forEach((item) => {
  731. // item.table_list.forEach((items) => {
  732. // items.forEach((itemss) => {
  733. // if (itemss.data && itemss.data.type == "NewWord_chs") {
  734. // _this.NNPENewWordList = _this.NNPENewWordList.concat(
  735. // itemss.data.option
  736. // );
  737. // } else if (itemss.data && itemss.data.type == "notes_chs") {
  738. // _this.NNPEAnnotationList = _this.NNPEAnnotationList.concat(
  739. // itemss.data.option
  740. // );
  741. // }
  742. // });
  743. // });
  744. // });
  745. // }
  746. _this.cur = _this.contextData;
  747. _this.cur.cur_fn_data.forEach((item, index) => {
  748. item.table_list.forEach((items, indexs) => {
  749. items.forEach((itemss, indexss) => {
  750. if (itemss.data && itemss.data.type == "NewWord_chs") {
  751. _this.NNPENewWordList = _this.NNPENewWordList.concat(
  752. itemss.data.option
  753. );
  754. } else if (itemss.data && itemss.data.type == "notes_chs") {
  755. _this.NNPEAnnotationList = _this.NNPEAnnotationList.concat(
  756. itemss.data.option
  757. );
  758. }
  759. // let Bookanswer = localStorage.getItem("Bookanswer");
  760. let Bookanswer = this.bookAnswerContent
  761. //if (_this.TaskModel == "lookAnswer" && _this.bookAnswerContent) {
  762. if (Bookanswer) {
  763. // let answerData = JSON.parse(_this.bookAnswerContent);
  764. let answerData = JSON.parse(Bookanswer);
  765. if (answerData && itemss.data) {
  766. itemss.data.Bookanswer =
  767. answerData.length > 0 &&
  768. answerData[index].table_list &&
  769. answerData[index].table_list.length > 0 &&
  770. answerData[index].table_list[indexs].length > 0 &&
  771. answerData[index].table_list[indexs][indexss].data
  772. ? answerData[index].table_list[indexs][indexss].data
  773. .Bookanswer
  774. : [];
  775. }
  776. }
  777. });
  778. });
  779. });
  780. }
  781. this.$forceUpdate();
  782. },
  783. // 上一页
  784. handleNNPEprev() {
  785. let _this = this;
  786. _this.puaseAudio();
  787. if (_this.queIndex == 0) {
  788. this.idArr.forEach((item, i) => {
  789. if (item == _this.currentTreeID) {
  790. if (i == 0) {
  791. _this.preClick = false
  792. _this.nextClick = true
  793. } else {
  794. _this.changeId(this.idArr[i - 1]);
  795. _this.preClick = true
  796. _this.nextClick = true
  797. }
  798. }
  799. });
  800. } else {
  801. _this.queIndex -= 1;
  802. _this.watchIndex = _this.queIndex + new Date().getTime();
  803. _this.cur = _this.queList[_this.queIndex];
  804. }
  805. },
  806. // 递归寻找相同的目录并保存目录的pid
  807. seekCurrentTree(item) {
  808. if (item.is_courseware == "true") {
  809. this.idArr.push(item.id);
  810. }
  811. if (item.children) {
  812. item.children.forEach((it, index) => {
  813. if (it.is_courseware == "true") {
  814. this.idArr.push(it.id);
  815. }
  816. if (it.children) {
  817. this.seekCurrentTree(it);
  818. }
  819. });
  820. }
  821. },
  822. puaseAudio() {
  823. let audio = document.getElementsByTagName("audio");
  824. audio.forEach((item) => {
  825. item.pause();
  826. });
  827. let video = document.getElementsByTagName("video");
  828. video.forEach((item) => {
  829. item.pause();
  830. });
  831. },
  832. // 下一页
  833. handleNNPEnext() {
  834. const _this = this;
  835. _this.puaseAudio();
  836. if (_this.queIndex == _this.queTotal - 1) {
  837. this.idArr.forEach((item, i) => {
  838. if (item == _this.currentTreeID) {
  839. if (i == this.idArr.length - 1) {
  840. _this.nextClick = false
  841. _this.preClick = true
  842. } else {
  843. _this.changeId(this.idArr[i + 1]);
  844. _this.nextClick = true
  845. _this.preClick = true
  846. }
  847. }
  848. });
  849. } else {
  850. _this.queIndex += 1;
  851. _this.watchIndex = _this.queIndex + new Date().getTime();
  852. _this.cur = _this.queList[_this.queIndex];
  853. }
  854. },
  855. submitUserAnswerNPC() {
  856. let contextData = JSON.parse(JSON.stringify(this.contextData));
  857. let result = [];
  858. contextData.cur_fn_data.forEach((item, index) => {
  859. result[index] = {
  860. table_list: [],
  861. };
  862. item.table_list.forEach((items, indexs) => {
  863. result[index].table_list[indexs] = [];
  864. items.forEach((itemss, indexss) => {
  865. if (itemss.data) {
  866. let Bookanswer = itemss.data.Bookanswer;
  867. let obj = {
  868. data: {
  869. Bookanswer: Bookanswer,
  870. },
  871. };
  872. result[index].table_list[indexs][indexss] = obj;
  873. } else {
  874. result[index].table_list[indexs][indexss] = {
  875. data: null,
  876. };
  877. }
  878. });
  879. });
  880. });
  881. this.$emit("finishTaskMaterial", JSON.stringify(result));
  882. },
  883. }, // 如果页面有keep-alive缓存功能,这个函数会触发
  884. };
  885. </script>
  886. <style lang='scss' scoped>
  887. //@import url(); 引入公共css类
  888. .NPC-Big-Book-preview {
  889. width: 860px;
  890. margin: 0 auto;
  891. position: relative;
  892. padding-bottom: 120px;
  893. .NNPE-title {
  894. background: #e35454;
  895. border-radius: 0px 0px 16px 16px;
  896. padding: 7px 24px;
  897. position: relative;
  898. height: 64px;
  899. display: flex;
  900. align-items: center;
  901. &.NNPE-title-gray{
  902. background: #EEEEEE;
  903. border-radius: 0;
  904. margin-top: 24px;
  905. .NNPE-operate {
  906. position: absolute;
  907. top: 10px;
  908. right: 20px;
  909. a {
  910. background: #fff url("../../assets/newImage/common/btn-pre-black.png")
  911. center no-repeat;
  912. background-size: 24px;
  913. &.btn-next {
  914. background: #fff url("../../assets/newImage/common/btn-next-black.png")
  915. center no-repeat;
  916. background-size: 24px;
  917. }
  918. &:hover {
  919. background-color: #fff;
  920. }
  921. &:active {
  922. background-color: #fff;
  923. }
  924. &.btn-prev-disabled,&.btn-next-disabled{
  925. background-color: rgba(0, 0, 0, 0.25);
  926. }
  927. }
  928. }
  929. }
  930. h1 {
  931. color: #ffffff;
  932. font-weight: bold;
  933. font-size: 16px;
  934. line-height: 150%;
  935. margin: 0;
  936. }
  937. .NNPE-title-left {
  938. display: flex;
  939. color: #ffffff;
  940. font-size: 18px;
  941. line-height: 18px;
  942. align-items: center;
  943. .NNPE-title-item {
  944. margin-right: 12px;
  945. }
  946. .content-con {
  947. margin: 4px 0;
  948. font-family: "robot";
  949. &.hasCn,
  950. &.hanzi {
  951. font-family: "FZJCGFKTK";
  952. }
  953. }
  954. .content-en {
  955. font-weight: normal;
  956. line-height: 18px;
  957. font-family: "robot";
  958. }
  959. .NNPE-title-item-en {
  960. font-weight: normal;
  961. line-height: 12px;
  962. font-family: "robot";
  963. font-size: 12px;
  964. margin: 0;
  965. }
  966. .con-box {
  967. display: flex;
  968. flex-flow: wrap;
  969. justify-content: center;
  970. .con-item {
  971. text-align: center;
  972. padding: 0 1px;
  973. }
  974. span {
  975. display: block;
  976. }
  977. .pinyin {
  978. font-family: "GB-PINYINOK-B";
  979. font-size: 12px;
  980. line-height: 12px;
  981. height: 12px;
  982. &.noFont {
  983. font-family: initial;
  984. }
  985. }
  986. .synthesis-box {
  987. display: flex;
  988. }
  989. }
  990. }
  991. .NNPE-operate {
  992. position: absolute;
  993. top: 10px;
  994. right: 20px;
  995. a {
  996. background: #e35454 url("../../assets/newImage/common/btn-pre.png")
  997. center no-repeat;
  998. background-size: 24px;
  999. border-radius: 4px;
  1000. width: 44px;
  1001. height: 44px;
  1002. display: inline-block;
  1003. margin: 0 4px;
  1004. &.btn-next {
  1005. background: #e35454 url("../../assets/newImage/common/btn-next.png")
  1006. center no-repeat;
  1007. background-size: 24px;
  1008. }
  1009. &:hover {
  1010. background-color: #f76565;
  1011. }
  1012. &:active {
  1013. background-color: #d24444;
  1014. }
  1015. &.btn-prev-disabled,&.btn-next-disabled{
  1016. background-color: rgba(0, 0, 0, 0.25);
  1017. cursor: not-allowed;
  1018. }
  1019. }
  1020. }
  1021. }
  1022. .classTopic-box {
  1023. background: #e35454;
  1024. border-radius: 8px;
  1025. width: 780px;
  1026. margin: 24px auto 0 auto;
  1027. text-align: center;
  1028. padding: 8px 24px;
  1029. span {
  1030. font-size: 16px;
  1031. line-height: 150%;
  1032. color: #ffffff;
  1033. padding: 0 1px;
  1034. &.cn {
  1035. font-family: "FZJCGFKTK";
  1036. }
  1037. &.en {
  1038. font-family: "robot";
  1039. }
  1040. &.pinyin {
  1041. font-family: "GB-PINYINOK-B";
  1042. }
  1043. }
  1044. }
  1045. .NNPE-Book-content-inner {
  1046. padding: 0 40px;
  1047. > div.title-box-preview {
  1048. padding-top: 32px;
  1049. .title-big {
  1050. display: flex;
  1051. b {
  1052. min-width: 39px;
  1053. height: 24px;
  1054. background: #e35454;
  1055. border-radius: 8px;
  1056. color: #ffffff;
  1057. font-family: "robot";
  1058. display: inline-block;
  1059. text-align: center;
  1060. font-size: 16px;
  1061. line-height: 150%;
  1062. margin-right: 12px;
  1063. padding: 0 4px;
  1064. }
  1065. h2 {
  1066. color: #e35454;
  1067. font-size: 16px;
  1068. line-height: 150%;
  1069. font-weight: bold;
  1070. margin: 0;
  1071. }
  1072. h3 {
  1073. color: #000000;
  1074. font-size: 16px;
  1075. line-height: 150%;
  1076. font-weight: normal;
  1077. margin: 0;
  1078. white-space: pre-wrap;
  1079. word-break: break-word;
  1080. }
  1081. .title-box-right-index {
  1082. padding-left: 51px;
  1083. }
  1084. }
  1085. .title-little {
  1086. display: flex;
  1087. margin-bottom: 24px;
  1088. &.marginTop {
  1089. margin-top: 24px;
  1090. }
  1091. b,
  1092. p {
  1093. color: #000000;
  1094. font-size: 16px;
  1095. line-height: 150%;
  1096. font-weight: normal;
  1097. margin: 0;
  1098. white-space: pre-wrap;
  1099. word-break: break-word;
  1100. padding-right: 3px;
  1101. }
  1102. }
  1103. }
  1104. .NNPE-tableList {
  1105. background: #fff;
  1106. border-radius: 8px;
  1107. // padding: 12px 8px;
  1108. &.NNPE-tableList-hasBg {
  1109. background: #f7f7f7;
  1110. border: 1px solid rgba(0, 0, 0, 0.1);
  1111. box-sizing: border-box;
  1112. border-radius: 8px;
  1113. }
  1114. .NNPE-tableList-tr {
  1115. display: flex;
  1116. justify-content: space-between;
  1117. // flex-flow: wrap;
  1118. .NNPE-tableList-item {
  1119. width: 100%;
  1120. // margin: 12px 16px;
  1121. // padding: 16px;
  1122. // background: #FFFFFF;
  1123. // border-radius: 4px;
  1124. display: flex;
  1125. flex-flow: wrap;
  1126. justify-content: center;
  1127. &.NNPE-tableList-item-noMargin {
  1128. margin: 0;
  1129. }
  1130. &.NNPE-tableList-item2 {
  1131. width: 378px;
  1132. }
  1133. &.NNPE-tableList-item3 {
  1134. width: 244px;
  1135. }
  1136. }
  1137. }
  1138. }
  1139. }
  1140. .submitAnswer{
  1141. width: 160px;
  1142. height: 44px;
  1143. border-radius: 4px;
  1144. font-size: 16px;
  1145. line-height: 44px;
  1146. text-align: center;
  1147. font-family: robot;
  1148. background: #e35454;
  1149. color: #fff;
  1150. margin-left: 16px;
  1151. &:hover {
  1152. background-color: #f76565;
  1153. }
  1154. &:active {
  1155. background-color: #d24444;
  1156. }
  1157. }
  1158. }
  1159. .NPC-Big-Book-preview-green {
  1160. .NNPE-title {
  1161. background: #24b99e;
  1162. .NNPE-operate {
  1163. a {
  1164. background: #24b99e url("../../assets/newImage/common/btn-pre.png")
  1165. center no-repeat;
  1166. background-size: 24px;
  1167. &.btn-next {
  1168. background: #24b99e url("../../assets/newImage/common/btn-next.png")
  1169. center no-repeat;
  1170. background-size: 24px;
  1171. }
  1172. &:hover {
  1173. background-color: #3dd4b8;
  1174. }
  1175. &:active {
  1176. background-color: #1fa189;
  1177. }
  1178. }
  1179. }
  1180. }
  1181. .submitAnswer{
  1182. background: #24b99e;
  1183. &:hover {
  1184. background-color: #3dd4b8;
  1185. }
  1186. &:active {
  1187. background-color: #1fa189;
  1188. }
  1189. }
  1190. .classTopic-box {
  1191. background: #24b99e;
  1192. }
  1193. .NNPE-Book-content-inner {
  1194. > div.title-box-preview {
  1195. .title-big {
  1196. b {
  1197. background: #24b99e;
  1198. }
  1199. h2 {
  1200. color: #24b99e;
  1201. }
  1202. }
  1203. }
  1204. }
  1205. }
  1206. .NPC-Big-Book-preview-brown {
  1207. .NNPE-title {
  1208. background: #bd8865;
  1209. .NNPE-operate {
  1210. a {
  1211. background: #bd8865 url("../../assets/newImage/common/btn-pre.png")
  1212. center no-repeat;
  1213. background-size: 24px;
  1214. &.btn-next {
  1215. background: #bd8865 url("../../assets/newImage/common/btn-next.png")
  1216. center no-repeat;
  1217. background-size: 24px;
  1218. }
  1219. &:hover {
  1220. background-color: #d6a687;
  1221. }
  1222. &:active {
  1223. background-color: #a37557;
  1224. }
  1225. }
  1226. }
  1227. }
  1228. .submitAnswer{
  1229. background: #bd8865;
  1230. &:hover {
  1231. background-color: #d6a687;
  1232. }
  1233. &:active {
  1234. background-color: #a37557;
  1235. }
  1236. }
  1237. .classTopic-box {
  1238. background: #bd8865;
  1239. }
  1240. .NNPE-Book-content-inner {
  1241. > div.title-box-preview {
  1242. .title-big {
  1243. b {
  1244. background: #bd8865;
  1245. }
  1246. h2 {
  1247. color: #bd8865;
  1248. }
  1249. }
  1250. }
  1251. }
  1252. }
  1253. </style>