PhraseModelChs.vue 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673
  1. <!-- -->
  2. <template>
  3. <div class="NNPE-ArticleView" v-if="curQue">
  4. <div
  5. class="aduioLine-box aduioLine-practice-npc"
  6. v-if="
  7. (curQue.mp3_list &&
  8. curQue.mp3_list.length > 0 &&
  9. curQue.mp3_list[0].id) ||
  10. config.isHasPY ||
  11. config.isHasEN
  12. "
  13. >
  14. <div class="aduioLine-content">
  15. <template
  16. v-if="
  17. curQue.mp3_list &&
  18. curQue.mp3_list.length > 0 &&
  19. curQue.mp3_list[0].id
  20. "
  21. >
  22. <AudioLine
  23. audioId="artPhraseAudio"
  24. :mp3="curQue.mp3_list[0].id"
  25. :getCurTime="getCurTime"
  26. :mp3Source="curQue.mp3_list[0].source"
  27. :width="colLength == 2 ? 200 : 590"
  28. ref="audioLine"
  29. />
  30. </template>
  31. </div>
  32. <div class="aduioLine-right">
  33. <span
  34. :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
  35. @click="changePinyin"
  36. v-if="config.isHasPY"
  37. ></span>
  38. <span
  39. :class="['EN-16', config.isShowEN ? '' : 'disabled']"
  40. @click="changeEN"
  41. v-if="config.isHasEN"
  42. ></span>
  43. </div>
  44. </div>
  45. <template v-if="!config.isHasEN || (config.isHasEN && !config.isShowEN)">
  46. <template v-if="resArr.length > 0">
  47. <div class="NPC-sentences-list">
  48. <div
  49. :class="['NNPE-detail', item.isTitle ? 'NNPE-detail-title' : '']"
  50. v-for="(item, index) in resArr"
  51. :key="'detail' + index"
  52. >
  53. <div
  54. class="wordsList-box"
  55. :class="[
  56. curQue.detail[index].paragraphAttr
  57. ? 'wordsList-box-' +
  58. curQue.detail[index].paragraphAttr.paragraphAlign
  59. : ''
  60. ]"
  61. >
  62. <img
  63. :src="articleImg[index]"
  64. v-if="articleImg[0] && index == 0"
  65. />
  66. <div>
  67. <div
  68. class="NNPE-words"
  69. v-for="(pItem, pIndex) in item.wordsList"
  70. :key="'wordsList' + pIndex"
  71. :class="[
  72. pItem.chs != '“' && pItem.wordIndex == 0
  73. ? 'textLeft'
  74. : 'textCenter',
  75. pItem.chs == '“' ? 'textRight' : ''
  76. ]"
  77. @click="showWordDetail($event, pItem.chs, pItem.words)"
  78. >
  79. <template v-if="!pItem.width">
  80. <template v-if="pItem.isShow">
  81. <template
  82. v-if="
  83. item.wordsList[pIndex + 1] &&
  84. item.wordsList[pIndex + 1].chs &&
  85. (chsFhList.indexOf(item.wordsList[pIndex + 1].chs) >
  86. -1 ||
  87. NumberList.indexOf(
  88. item.wordsList[pIndex + 1].chs
  89. ) > -1)
  90. "
  91. >
  92. <span class="NNPE-words-box">
  93. <span
  94. v-if="
  95. curQue.pyPosition == 'top' &&
  96. config.isShowPY &&
  97. item.dhaspinyin
  98. "
  99. :class="[
  100. 'NNPE-pinyin',
  101. pItem.className ? pItem.className : '',
  102. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : ''
  103. ]"
  104. @click.stop="viewNotes($event, pItem.pinyin)"
  105. >{{ pItem.pinyin }}</span
  106. >
  107. <span
  108. :class="[
  109. 'NNPE-chs',
  110. newWordList.indexOf(pItem.chs) > -1
  111. ? 'active'
  112. : '',
  113. pItem.words ? 'active' : ''
  114. ]"
  115. @click.stop="
  116. viewNotes(
  117. $event,
  118. pItem.words ? pItem.words : pItem.chs
  119. )
  120. "
  121. :style="{
  122. fontFamily: pItem.config.fontFamily,
  123. height: '28px',
  124. display: 'inline-block'
  125. }"
  126. >{{
  127. NumberList.indexOf(pItem.pinyin) == -1
  128. ? pItem.chs
  129. : ""
  130. }}</span
  131. >
  132. <span
  133. v-if="
  134. curQue.pyPosition == 'bottom' &&
  135. config.isShowPY &&
  136. item.dhaspinyin
  137. "
  138. :class="[
  139. 'NNPE-pinyin',
  140. pItem.className ? pItem.className : '',
  141. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : ''
  142. ]"
  143. @click.stop="viewNotes($event, pItem.pinyin)"
  144. >{{ pItem.pinyin }}</span
  145. >
  146. </span>
  147. <span class="NNPE-words-box">
  148. <span
  149. v-if="
  150. curQue.pyPosition == 'top' &&
  151. config.isShowPY &&
  152. item.dhaspinyin
  153. "
  154. :class="[
  155. 'NNPE-pinyin',
  156. noFont.indexOf(
  157. item.wordsList[pIndex + 1].pinyin
  158. ) > -1
  159. ? 'noFont'
  160. : ''
  161. ]"
  162. style="text-align: left"
  163. @click.stop="
  164. viewNotes(
  165. $event,
  166. item.wordsList[pIndex + 1].pinyin
  167. )
  168. "
  169. >{{ item.wordsList[pIndex + 1].pinyin }}</span
  170. >
  171. <span
  172. class="NNPE-chs"
  173. style="text-align: left"
  174. @click.stop="
  175. viewNotes(
  176. $event,
  177. item.wordsList[pIndex + 1].words
  178. ? item.wordsList[pIndex + 1].words
  179. : item.wordsList[pIndex + 1].chs
  180. )
  181. "
  182. :style="{
  183. fontFamily:
  184. item.wordsList[pIndex + 1].config.fontFamily,
  185. height: '28px',
  186. display: 'inline-block'
  187. }"
  188. >{{
  189. NumberList.indexOf(
  190. item.wordsList[pIndex + 1].pinyin
  191. ) == -1
  192. ? item.wordsList[pIndex + 1].chs
  193. : ""
  194. }}</span
  195. >
  196. <span
  197. v-if="
  198. curQue.pyPosition == 'bottom' &&
  199. config.isShowPY &&
  200. item.dhaspinyin
  201. "
  202. :class="[
  203. 'NNPE-pinyin',
  204. noFont.indexOf(
  205. item.wordsList[pIndex + 1].pinyin
  206. ) > -1
  207. ? 'noFont'
  208. : ''
  209. ]"
  210. style="text-align: left"
  211. @click.stop="
  212. viewNotes(
  213. $event,
  214. item.wordsList[pIndex + 1].pinyin
  215. )
  216. "
  217. >{{ item.wordsList[pIndex + 1].pinyin }}</span
  218. >
  219. </span>
  220. <span
  221. class="NNPE-words-box"
  222. v-if="
  223. item.wordsList[pIndex + 2] &&
  224. item.wordsList[pIndex + 2].chs &&
  225. (chsFhList.indexOf(
  226. item.wordsList[pIndex + 2].chs
  227. ) > -1 ||
  228. NumberList.indexOf(
  229. item.wordsList[pIndex + 2].chs
  230. ) > -1)
  231. "
  232. >
  233. <span
  234. v-if="
  235. curQue.pyPosition == 'top' &&
  236. config.isShowPY &&
  237. item.dhaspinyin
  238. "
  239. :class="[
  240. 'NNPE-pinyin',
  241. noFont.indexOf(
  242. item.wordsList[pIndex + 1].pinyin
  243. ) > -1
  244. ? 'noFont'
  245. : ''
  246. ]"
  247. style="text-align: left"
  248. @click.stop="
  249. viewNotes(
  250. $event,
  251. item.wordsList[pIndex + 2].pinyin
  252. )
  253. "
  254. >{{ item.wordsList[pIndex + 2].pinyin }}</span
  255. >
  256. <span
  257. class="NNPE-chs"
  258. style="text-align: left"
  259. @click.stop="
  260. viewNotes(
  261. $event,
  262. item.wordsList[pIndex + 2].words
  263. ? item.wordsList[pIndex + 2].words
  264. : item.wordsList[pIndex + 2].chs
  265. )
  266. "
  267. :style="{
  268. fontFamily:
  269. item.wordsList[pIndex + 2].config.fontFamily,
  270. height: '28px',
  271. display: 'inline-block'
  272. }"
  273. >{{
  274. NumberList.indexOf(
  275. item.wordsList[pIndex + 2].pinyin
  276. ) == -1
  277. ? item.wordsList[pIndex + 2].chs
  278. : ""
  279. }}</span
  280. >
  281. <span
  282. v-if="
  283. curQue.pyPosition == 'bottom' &&
  284. config.isShowPY &&
  285. item.dhaspinyin
  286. "
  287. :class="[
  288. 'NNPE-pinyin',
  289. noFont.indexOf(
  290. item.wordsList[pIndex + 2].pinyin
  291. ) > -1
  292. ? 'noFont'
  293. : ''
  294. ]"
  295. style="text-align: left"
  296. @click.stop="
  297. viewNotes(
  298. $event,
  299. item.wordsList[pIndex + 2].pinyin
  300. )
  301. "
  302. >{{ item.wordsList[pIndex + 2].pinyin }}</span
  303. >
  304. </span>
  305. </template>
  306. <template v-else>
  307. <span
  308. v-if="
  309. curQue.pyPosition == 'top' &&
  310. config.isShowPY &&
  311. item.dhaspinyin
  312. "
  313. class="NNPE-pinyin"
  314. :class="[
  315. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  316. pItem.className ? pItem.className : '',
  317. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : ''
  318. ]"
  319. @click.stop="viewNotes($event, pItem.pinyin)"
  320. >{{ pItem.pinyin }}</span
  321. >
  322. <span
  323. class="NNPE-chs"
  324. :class="[
  325. pItem.chs != '“' && pItem.padding && config.isShowPY
  326. ? 'padding'
  327. : '',
  328. newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
  329. pItem.words ? 'active' : ''
  330. ]"
  331. @click.stop="
  332. viewNotes(
  333. $event,
  334. pItem.words ? pItem.words : pItem.chs
  335. )
  336. "
  337. :style="{
  338. fontFamily: pItem.config.fontFamily,
  339. height: '28px',
  340. display: 'inline-block'
  341. }"
  342. >{{
  343. NumberList.indexOf(pItem.pinyin) == -1
  344. ? pItem.chs
  345. : ""
  346. }}</span
  347. >
  348. <span
  349. v-if="
  350. curQue.pyPosition == 'bottom' &&
  351. config.isShowPY &&
  352. item.dhaspinyin
  353. "
  354. class="NNPE-pinyin"
  355. :class="[
  356. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  357. pItem.className ? pItem.className : '',
  358. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : ''
  359. ]"
  360. @click.stop="viewNotes($event, pItem.pinyin)"
  361. >{{ pItem.pinyin }}</span
  362. >
  363. </template>
  364. </template>
  365. </template>
  366. <template v-else>
  367. <span
  368. :style="{
  369. height: pItem.height + 'px',
  370. width: pItem.width + 'px'
  371. }"
  372. ></span>
  373. </template>
  374. </div>
  375. </div>
  376. <img :src="articleImg[index + 1]" v-if="articleImg[index + 1]" />
  377. </div>
  378. </div>
  379. </div>
  380. </template>
  381. </template>
  382. <template v-else>
  383. <template v-if="resObj">
  384. <!-- -->
  385. <div class="NPC-sentences-list">
  386. <div
  387. :class="['NNPE-detail-box']"
  388. v-for="(item, index) in resObj.sentList"
  389. :key="'detail' + index"
  390. >
  391. <div :class="['NNPE-details']">
  392. <div
  393. v-if="
  394. item.enwords &&
  395. config.isShowEN &&
  396. curQue.enPosition &&
  397. curQue.enPosition == 'top'
  398. "
  399. :class="['enwords', sentIndex == index ? 'wordBlank' : '']"
  400. >
  401. {{ item.enwords }}
  402. </div>
  403. <div style="clear: both; overflow: hidden"></div>
  404. <div
  405. class="NNPE-words"
  406. v-for="(pItem, pIndex) in item.sentArr"
  407. :key="'wordsList' + pIndex"
  408. :class="[
  409. pItem.chs != '“' && pItem.wordIndex == 0
  410. ? 'textLeft'
  411. : 'textCenter',
  412. pItem.chs == '“' ? 'textRight' : ''
  413. ]"
  414. @click="showWordDetail($event, pItem.chs, pItem.words)"
  415. >
  416. <template v-if="!pItem.width">
  417. <template v-if="pItem.isShow">
  418. <template
  419. v-if="
  420. item.sentArr[pIndex + 1] &&
  421. item.sentArr[pIndex + 1].chs &&
  422. (chsFhList.indexOf(item.sentArr[pIndex + 1].chs) >
  423. -1 ||
  424. NumberList.indexOf(item.sentArr[pIndex + 1].chs) >
  425. -1)
  426. "
  427. >
  428. <span class="NNPE-words-box">
  429. <template v-if="curQue.pyPosition == 'top'">
  430. <span
  431. v-if="config.isShowPY"
  432. class="NNPE-pinyin"
  433. :class="[
  434. pItem.className ? pItem.className : '',
  435. sentIndex == index ? 'wordBlank' : '',
  436. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : ''
  437. ]"
  438. @click.stop="viewNotes($event, pItem.pinyin)"
  439. >{{ pItem.pinyin }}</span
  440. >
  441. </template>
  442. <span
  443. class="NNPE-chs"
  444. :class="[
  445. pItem.padding && config.isShowPY ? 'padding' : '',
  446. sentIndex == index ? 'wordBlank' : '',
  447. newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
  448. pItem.words ? 'active' : ''
  449. ]"
  450. >
  451. <template>
  452. <span
  453. v-for="(wItem, wIndex) in pItem.leg"
  454. :key="'ci' + wIndex + pIndex + index"
  455. :class="[]"
  456. @click.stop="
  457. viewNotes(
  458. $event,
  459. pItem.words ? pItem.words : pItem.chs
  460. )
  461. "
  462. :style="{
  463. fontFamily: pItem.config.fontFamily,
  464. height: '28px',
  465. display: 'inline-block'
  466. }"
  467. >{{
  468. NumberList.indexOf(pItem.pinyin) == -1
  469. ? pItem.chs[wIndex]
  470. : ""
  471. }}</span
  472. >
  473. </template>
  474. </span>
  475. <template v-if="curQue.pyPosition == 'bottom'">
  476. <span
  477. v-if="config.isShowPY"
  478. class="NNPE-pinyin"
  479. :class="[
  480. pItem.className ? pItem.className : '',
  481. sentIndex == index ? 'wordBlank' : '',
  482. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : ''
  483. ]"
  484. @click.stop="viewNotes($event, pItem.pinyin)"
  485. >{{ pItem.pinyin }}</span
  486. >
  487. </template>
  488. </span>
  489. <span class="NNPE-words-box">
  490. <template v-if="curQue.pyPosition == 'top'">
  491. <span
  492. v-if="config.isShowPY"
  493. :class="[
  494. 'NNPE-pinyin',
  495. sentIndex == index ? 'wordBlank' : '',
  496. noFont.indexOf(item.sentArr[pIndex + 1].pinyin) >
  497. -1
  498. ? 'noFont'
  499. : ''
  500. ]"
  501. style="text-align: left"
  502. @click.stop="
  503. viewNotes($event, item.sentArr[pIndex + 1].pinyin)
  504. "
  505. >{{ item.sentArr[pIndex + 1].pinyin }}</span
  506. >
  507. </template>
  508. <span class="NNPE-chs" style="text-align: left">
  509. <span
  510. :class="[]"
  511. @click.stop="
  512. viewNotes(
  513. $event,
  514. item.sentArr[pIndex + 1].words
  515. ? item.sentArr[pIndex + 1].words
  516. : item.sentArr[pIndex + 1].chs
  517. )
  518. "
  519. :style="{
  520. fontFamily:
  521. item.sentArr[pIndex + 1].config.fontFamily,
  522. height: '28px',
  523. display: 'inline-block'
  524. }"
  525. >
  526. {{
  527. NumberList.indexOf(
  528. item.sentArr[pIndex + 1].pinyin
  529. ) == -1
  530. ? item.sentArr[pIndex + 1].chs
  531. : ""
  532. }}</span
  533. >
  534. </span>
  535. <template v-if="curQue.pyPosition == 'bottom'">
  536. <span
  537. v-if="config.isShowPY"
  538. :class="[
  539. 'NNPE-pinyin',
  540. sentIndex == index ? 'wordBlank' : '',
  541. noFont.indexOf(item.sentArr[pIndex + 1].pinyin) >
  542. -1
  543. ? 'noFont'
  544. : ''
  545. ]"
  546. style="text-align: left"
  547. @click.stop="
  548. viewNotes($event, item.sentArr[pIndex + 1].pinyin)
  549. "
  550. >{{ item.sentArr[pIndex + 1].pinyin }}</span
  551. >
  552. </template>
  553. </span>
  554. <span
  555. class="NNPE-words-box"
  556. v-if="
  557. item.sentArr[pIndex + 2] &&
  558. item.sentArr[pIndex + 2].chs &&
  559. chsFhList.indexOf(item.sentArr[pIndex + 2].chs) > -1
  560. "
  561. >
  562. <template v-if="curQue.pyPosition == 'top'">
  563. <span
  564. v-if="config.isShowPY"
  565. :class="[
  566. 'NNPE-pinyin',
  567. sentIndex == index ? 'wordBlank' : '',
  568. noFont.indexOf(item.sentArr[pIndex + 2].pinyin) >
  569. -1
  570. ? 'noFont'
  571. : ''
  572. ]"
  573. style="text-align: left"
  574. @click.stop="
  575. viewNotes($event, item.sentArr[pIndex + 2].pinyin)
  576. "
  577. >{{ item.sentArr[pIndex + 2].pinyin }}</span
  578. >
  579. </template>
  580. <span class="NNPE-chs" style="text-align: left">
  581. <span
  582. :class="[]"
  583. @click.stop="
  584. viewNotes(
  585. $event,
  586. item.sentArr[pIndex + 2].words
  587. ? item.sentArr[pIndex + 2].words
  588. : item.sentArr[pIndex + 2].chs
  589. )
  590. "
  591. :style="{
  592. fontFamily:
  593. item.sentArr[pIndex + 2].config.fontFamily,
  594. height: '28px',
  595. display: 'inline-block'
  596. }"
  597. >
  598. {{
  599. NumberList.indexOf(
  600. item.sentArr[pIndex + 2].pinyin
  601. ) == -1
  602. ? item.sentArr[pIndex + 2].chs
  603. : ""
  604. }}</span
  605. >
  606. </span>
  607. <template v-if="curQue.pyPosition == 'bottom'">
  608. <span
  609. v-if="config.isShowPY"
  610. :class="[
  611. 'NNPE-pinyin',
  612. sentIndex == index ? 'wordBlank' : '',
  613. noFont.indexOf(item.sentArr[pIndex + 2].pinyin) >
  614. -1
  615. ? 'noFont'
  616. : ''
  617. ]"
  618. style="text-align: left"
  619. @click.stop="
  620. viewNotes($event, item.sentArr[pIndex + 1].pinyin)
  621. "
  622. >{{ item.sentArr[pIndex + 2].pinyin }}</span
  623. >
  624. </template>
  625. </span>
  626. </template>
  627. <template v-else>
  628. <template v-if="curQue.pyPosition == 'top'">
  629. <span
  630. v-if="config.isShowPY"
  631. class="NNPE-pinyin"
  632. :class="[
  633. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  634. pItem.className ? pItem.className : '',
  635. sentIndex == index ? 'wordBlank' : '',
  636. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : ''
  637. ]"
  638. @click.stop="viewNotes($event, pItem.pinyin)"
  639. >{{ pItem.pinyin }}</span
  640. >
  641. </template>
  642. <span
  643. class="NNPE-chs"
  644. :class="[
  645. pItem.chs != '“' && pItem.padding && config.isShowPY
  646. ? 'padding'
  647. : '',
  648. sentIndex == index ? 'wordBlank' : '',
  649. newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
  650. pItem.words ? 'active' : ''
  651. ]"
  652. >
  653. <template>
  654. <span
  655. v-for="(wItem, wIndex) in pItem.leg"
  656. :key="'ci' + wIndex + pIndex + index"
  657. :class="[]"
  658. @click.stop="
  659. viewNotes(
  660. $event,
  661. pItem.words ? pItem.words : pItem.chs
  662. )
  663. "
  664. :style="{
  665. fontFamily: pItem.config.fontFamily,
  666. height: '28px',
  667. display: 'inline-block'
  668. }"
  669. >{{
  670. NumberList.indexOf(pItem.pinyin) == -1
  671. ? pItem.chs[wIndex]
  672. : ""
  673. }}</span
  674. >
  675. </template>
  676. </span>
  677. <template v-if="curQue.pyPosition == 'bottom'">
  678. <span
  679. v-if="config.isShowPY"
  680. class="NNPE-pinyin"
  681. :class="[
  682. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  683. pItem.className ? pItem.className : '',
  684. sentIndex == index ? 'wordBlank' : '',
  685. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : ''
  686. ]"
  687. @click.stop="viewNotes($event, pItem.pinyin)"
  688. >{{ pItem.pinyin }}</span
  689. >
  690. </template>
  691. </template>
  692. </template>
  693. </template>
  694. <template v-else>
  695. <span
  696. :style="{
  697. height: pItem.height + 'px',
  698. width: pItem.width + 'px'
  699. }"
  700. ></span>
  701. </template>
  702. </div>
  703. <div style="clear: both; overflow: hidden"></div>
  704. <div
  705. v-if="
  706. item.enwords &&
  707. config.isShowEN &&
  708. (!curQue.enPosition ||
  709. (curQue.enPosition && curQue.enPosition == 'bottom'))
  710. "
  711. :class="['enwords', sentIndex == index ? 'wordBlank' : '']"
  712. >
  713. {{ item.enwords }}
  714. </div>
  715. </div>
  716. </div>
  717. </div>
  718. </template>
  719. </template>
  720. <template v-if="isShow">
  721. <div
  722. ref="wordcard"
  723. class="NNPE-wordDetail"
  724. :style="{
  725. marginLeft:
  726. word.detail.new_word.length === 1
  727. ? '-152px'
  728. : windowWidth > word.detail.new_word.length * 126 + 48
  729. ? '-' + (word.detail.new_word.length * 63 + 24) + 'px'
  730. : '0px',
  731. left:
  732. windowWidth > word.detail.new_word.length * 126 + 48 ? '' : '0px'
  733. }"
  734. >
  735. <Wordcard
  736. :word="word"
  737. :changeWordCard="changeWordCard"
  738. :themeColor="themeColor"
  739. :currentTreeID="currentTreeID"
  740. :TaskModel="TaskModel"
  741. :writeList="curQue.Bookanswer.writeModel"
  742. @changeCurQue="changeCurQue"
  743. :mp3Url="activeWord ? activeWord.newWordMp3 : ''"
  744. :bg="activeWord ? activeWord.bg : null"
  745. :ed="activeWord ? activeWord.ed : null"
  746. />
  747. </div>
  748. </template>
  749. <template v-if="isNoteShow">
  750. <div
  751. ref="notecard"
  752. class="NNPE-wordDetail"
  753. :style="{
  754. marginLeft: windowWidth > 642 ? '-321px' : '0px',
  755. left: windowWidth > 642 ? '' : '0px'
  756. }"
  757. >
  758. <Notecard :item="curNoteCon" :changeCard="changeCard" />
  759. </div>
  760. </template>
  761. </div>
  762. </template>
  763. <script>
  764. import { timeStrToSen } from "../../../../utils/index";
  765. import AudioLine from "../AudioLine.vue";
  766. import Wordcard from "../components/Wordcard.vue"; // 卡片
  767. import Notecard from "../components/Notecard.vue"; // 注释
  768. export default {
  769. name: "PhraseModelChs",
  770. props: [
  771. "curQue",
  772. "bodyLeft",
  773. "NNPENewWordList",
  774. "themeColor",
  775. "noFont",
  776. "currentTreeID",
  777. "config",
  778. "TaskModel",
  779. "NNPEAnnotationList",
  780. "colLength"
  781. ],
  782. components: {
  783. AudioLine,
  784. Wordcard,
  785. Notecard
  786. },
  787. data() {
  788. return {
  789. resArr: [],
  790. resObj: null,
  791. curTime: 0, //单位s
  792. chsFhList: [",", "。", "”", ":", "》", "?", "!", ";", "#", "、"],
  793. enFhList: [",", ".", ";", "?", "!", ":", ">", "<"],
  794. NumberList: [
  795. "①",
  796. "②",
  797. "③",
  798. "④",
  799. "⑤",
  800. "⑥",
  801. "⑦",
  802. "⑧",
  803. "⑨",
  804. "⑩",
  805. "⑪",
  806. "⑫",
  807. "⑬",
  808. "⑭",
  809. "⑮",
  810. "⑯",
  811. "⑰",
  812. "⑱",
  813. "⑲",
  814. "⑳"
  815. ],
  816. newWords: ["鱼", "辩礼义"],
  817. oldHz: "",
  818. hz: "",
  819. clientY: 0,
  820. top: 0,
  821. left: 0,
  822. articleImg: {}, // 文章图片
  823. newWordList: [],
  824. word: null,
  825. isShow: false,
  826. screenHeight: 0,
  827. cardHeight: 0,
  828. contentWidth: 732,
  829. noteNum: "",
  830. curNoteCon: null,
  831. isNoteShow: false,
  832. oldNoteNum: "",
  833. clientY: 0,
  834. clickType: "",
  835. sentIndex: -1,
  836. highWords: null,
  837. highWordsArr: [],
  838. highIndex: 0,
  839. activeWord: null,
  840. windowWidth: window.innerWidth
  841. };
  842. },
  843. computed: {},
  844. watch: {
  845. hz: {
  846. handler: function(val, oldVal) {
  847. let _this = this;
  848. if (val) {
  849. _this.handleNewWords(val);
  850. }
  851. },
  852. // 深度观察监听
  853. deep: true
  854. },
  855. isShow: {
  856. handler: function(val, oldVal) {
  857. let _this = this;
  858. if (val) {
  859. setTimeout(() => {
  860. _this.cardHeight = _this.$refs.wordcard.offsetHeight;
  861. if (_this.screenHeight - _this.clientY > _this.cardHeight) {
  862. _this.top = _this.clientY + 20;
  863. } else {
  864. _this.top = _this.clientY - _this.cardHeight - 30;
  865. }
  866. }, 0);
  867. }
  868. },
  869. // 深度观察监听
  870. deep: true
  871. },
  872. noteNum: {
  873. handler: function(val, oldVal) {
  874. let _this = this;
  875. if (val) {
  876. _this.handleNote(val);
  877. }
  878. },
  879. // 深度观察监听
  880. deep: true
  881. },
  882. isNoteShow: {
  883. handler: function(val, oldVal) {
  884. let _this = this;
  885. if (val) {
  886. setTimeout(() => {
  887. _this.cardHeight = _this.$refs.notecard.offsetHeight;
  888. if (_this.screenHeight - _this.clientY > _this.cardHeight) {
  889. _this.top = _this.clientY + 20;
  890. } else {
  891. _this.top = _this.clientY - _this.cardHeight - 30;
  892. }
  893. }, 50);
  894. }
  895. },
  896. // 深度观察监听
  897. deep: true
  898. }
  899. },
  900. //方法集合
  901. methods: {
  902. //拼音的显示和隐藏
  903. changePinyin() {
  904. if (this.config.isHasPY) {
  905. this.$emit("changeConfig", "isShowPY");
  906. }
  907. },
  908. // 英文的显示和隐藏
  909. changeEN() {
  910. if (this.config.isHasEN) {
  911. this.$emit("changeConfig", "isShowEN");
  912. }
  913. },
  914. getCurTime(curTime) {
  915. this.curTime = curTime;
  916. },
  917. handleData() {
  918. let resArr = [];
  919. let leg = this.curQue.detail.length;
  920. let curQue = JSON.parse(JSON.stringify(this.curQue));
  921. let dhaspinyin = false; // 每段是否有拼音
  922. curQue.detail.forEach((dItem, dIndex) => {
  923. dhaspinyin = false;
  924. let paraArr = [];
  925. if (!dItem.isTitle) {
  926. paraArr = [
  927. {
  928. pinyin: "",
  929. chs: "",
  930. width: 20,
  931. height: 20
  932. },
  933. {
  934. width: 20,
  935. height: 20,
  936. pinyin: "",
  937. chs: ""
  938. }
  939. ];
  940. }
  941. dItem.wordsList.forEach((sItem, sIndex) => {
  942. sItem.forEach((wItem, wIndex) => {
  943. let sentence = dItem.sentences[sIndex];
  944. //this.judgePad(sItem, wItem, wIndex);
  945. this.mergeWordSymbol(sItem, wItem, wIndex);
  946. let words = "";
  947. if (this.newWordList.length > 0) {
  948. if (!this.highWords) {
  949. this.findLightWord(wItem, wIndex, sentence, sItem);
  950. words = this.highWords ? this.highWords.words : "";
  951. } else {
  952. if (wIndex > this.highWords.endIndex - 1) {
  953. this.highWords = null;
  954. this.findLightWord(wItem, wIndex, sentence, sItem);
  955. words = this.highWords ? this.highWords.words : "";
  956. } else {
  957. words = this.highWords ? this.highWords.words : "";
  958. }
  959. }
  960. }
  961. let obj = {
  962. paraIndex: dIndex, //段落索引
  963. sentIndex: sIndex, //在段落中句子索引
  964. wordIndex: wIndex, //单词的索引
  965. pinyin: wItem.pinyin,
  966. chs: wItem.chs,
  967. padding: true, //wItem.padding,
  968. className: wItem.className,
  969. isShow: wItem.isShow,
  970. isNewWord: this.newWords.indexOf(wItem.chs) > -1 ? true : false,
  971. words: words,
  972. config: {
  973. fontFamily: wItem.fontFamily
  974. }
  975. };
  976. paraArr.push(obj);
  977. if (wItem.pinyin) dhaspinyin = true;
  978. });
  979. });
  980. let paraObj = {
  981. wordsList: paraArr,
  982. dhaspinyin: dhaspinyin,
  983. isTitle: dItem.isTitle
  984. };
  985. resArr.push(paraObj);
  986. });
  987. this.resArr = resArr;
  988. // 循环文章图片
  989. if (curQue.img_list) {
  990. curQue.img_list.forEach(item => {
  991. this.articleImg[item.imgNumber] = item.id;
  992. });
  993. }
  994. let resArrs = [],
  995. sentArrTotal = [],
  996. timeArr = [];
  997. let wordTimeList = curQue.wordTime;
  998. curQue.detail.forEach((dItem, dIndex) => {
  999. dItem.wordsList.forEach((sItem, sIndex) => {
  1000. let sentArr = [];
  1001. sItem.forEach((wItem, wIndex) => {
  1002. let startIndex =
  1003. wIndex == 0
  1004. ? 0
  1005. : sentArr[wIndex - 1].startIndex +
  1006. sentArr[wIndex - 1].chs.length;
  1007. let endIndex =
  1008. wIndex == 0
  1009. ? wItem.chs.length
  1010. : sentArr[wIndex - 1].endIndex + wItem.chs.length;
  1011. // this.judgePad(sItem, wItem, wIndex);
  1012. this.mergeWordSymbols(wItem);
  1013. let obj = {
  1014. paraIndex: dIndex, //段落索引
  1015. sentIndex: sIndex, //在段落中句子索引
  1016. wordIndex: wIndex, //单词的索引
  1017. pinyin: wItem.pinyin,
  1018. chs: wItem.chs,
  1019. padding: true,
  1020. className: wItem.className,
  1021. isShow: wItem.isShow,
  1022. startIndex: startIndex,
  1023. endIndex: endIndex,
  1024. leg: wItem.chs.length,
  1025. timeList: [],
  1026. config: {
  1027. fontFamily: wItem.fontFamily
  1028. }
  1029. };
  1030. sentArr.push(obj);
  1031. });
  1032. let objs = {
  1033. sentArr: sentArr,
  1034. enwords:
  1035. dItem.sentencesEn &&
  1036. dItem.sentencesEn[sIndex] &&
  1037. dItem.sentencesEn[sIndex].replace(/\'/g, "’")
  1038. };
  1039. sentArrTotal.push(sentArr);
  1040. resArrs.push(objs);
  1041. });
  1042. timeArr.push(dItem.timeList);
  1043. });
  1044. if (wordTimeList && wordTimeList.length > 0) {
  1045. this.mergeWordTime(sentArrTotal, wordTimeList);
  1046. }
  1047. let timeList = [];
  1048. timeArr.forEach(item => {
  1049. item.forEach(aItem => {
  1050. if (timeList.indexOf(aItem) < 0) {
  1051. timeList.push(aItem);
  1052. }
  1053. });
  1054. });
  1055. this.resObj = { sentList: resArrs, timeList: timeList };
  1056. },
  1057. findLightWord(wItem, startIndex, sentence, sItem) {
  1058. let words = "",
  1059. endIndex = 0;
  1060. this.newWordList.forEach(item => {
  1061. if (item.length == 1) {
  1062. if (item == wItem.chs && !wItem.banLight) {
  1063. words = wItem.chs;
  1064. endIndex = startIndex + 1;
  1065. }
  1066. } else {
  1067. if (item[0] == wItem.chs && sentence.indexOf(item) > -1) {
  1068. let index = null;
  1069. let chsStr = "";
  1070. for (let i = startIndex; i < sItem.length + 1; i++) {
  1071. index = i;
  1072. if (chsStr.length == item.length) {
  1073. break;
  1074. } else {
  1075. chsStr += sItem[i] ? sItem[i].chs : "";
  1076. }
  1077. }
  1078. if (chsStr == item && !wItem.banLight) {
  1079. words = item;
  1080. endIndex = index;
  1081. }
  1082. } else if (
  1083. wItem.new_word &&
  1084. wItem.new_word == item &&
  1085. !wItem.banLight
  1086. ) {
  1087. words = item;
  1088. endIndex = startIndex + 1;
  1089. }
  1090. }
  1091. });
  1092. if (words) {
  1093. this.highWords = { words: words, endIndex: endIndex };
  1094. } else {
  1095. this.highWords = null;
  1096. }
  1097. },
  1098. //词和标点合一起
  1099. mergeWordSymbol(sItem, wItem, curIndex) {
  1100. let leg = sItem.length;
  1101. if (wItem && wItem.chs) {
  1102. // let nextIndex = curIndex + 1;
  1103. // let chs = sItem[nextIndex].chs;
  1104. // let pinyin = sItem[nextIndex].pinyin;
  1105. // if (this.chsFhList.indexOf(chs) > -1) {
  1106. // wItem.chs = "<a>" + wItem.chs + "</a><a>" + chs + "</a>";
  1107. // wItem.pinyin = "<a>" + wItem.pinyin + "</a><a>" + pinyin + "</a>";
  1108. // }
  1109. if (
  1110. this.chsFhList.indexOf(wItem.chs) > -1 ||
  1111. this.NumberList.indexOf(wItem.chs) > -1
  1112. ) {
  1113. wItem.isShow = false;
  1114. } else {
  1115. wItem.isShow = true;
  1116. }
  1117. }
  1118. // if (this.enFhList.indexOf(wItem.pinyin) > -1) {
  1119. // wItem.className = "textLeft";
  1120. // }
  1121. },
  1122. mergeWordSymbols(wItem) {
  1123. if (
  1124. this.chsFhList.indexOf(wItem.chs) > -1 ||
  1125. this.NumberList.indexOf(wItem.chs) > -1
  1126. ) {
  1127. wItem.isShow = false;
  1128. } else {
  1129. wItem.isShow = true;
  1130. }
  1131. },
  1132. mergeWordTime(resArr, wordTimeList) {
  1133. resArr.forEach((item, index) => {
  1134. let wordsResultList = wordTimeList[index].wordsResultList;
  1135. item.forEach(wItem => {
  1136. let startIndex = wItem.startIndex;
  1137. let endIndex = wItem.endIndex;
  1138. wItem.timeList = wordsResultList.slice(startIndex, endIndex);
  1139. });
  1140. });
  1141. },
  1142. //判断是否有padding
  1143. judgePad(sItem, wItem, curIndex) {
  1144. let leg = sItem.length;
  1145. if (curIndex < leg - 1) {
  1146. let nextIndex = curIndex + 1;
  1147. let chs = sItem[nextIndex].chs;
  1148. if (
  1149. this.chsFhList.indexOf(chs) > -1 ||
  1150. this.chsFhList.indexOf(wItem.chs) > -1
  1151. ) {
  1152. wItem.padding = false;
  1153. } else {
  1154. wItem.padding = true;
  1155. }
  1156. if (this.enFhList.indexOf(wItem.pinyin) > -1) {
  1157. wItem.className = "textLeft";
  1158. }
  1159. }
  1160. },
  1161. //转化时间
  1162. handleTimeList(list) {
  1163. let listRes = [];
  1164. list.forEach(item => {
  1165. let res = timeStrToSen(item);
  1166. listRes.push(res);
  1167. });
  1168. return listRes;
  1169. },
  1170. //点击播放某个句子
  1171. handleChangeTime(time) {
  1172. this.curTime = time;
  1173. this.$refs.audioLine.onTimeupdateTime(time);
  1174. },
  1175. handleNewword() {
  1176. let NewWordList = [];
  1177. this.NNPENewWordList.forEach(item => {
  1178. item.forEach(wItem => {
  1179. if (wItem.new_word) {
  1180. NewWordList.push(wItem.new_word);
  1181. } else if (wItem.detail && wItem.detail.sentence) {
  1182. NewWordList.push(wItem.detail.sentence);
  1183. }
  1184. });
  1185. });
  1186. this.newWordList = JSON.parse(JSON.stringify(NewWordList));
  1187. },
  1188. showWordDetail(e, word, words) {
  1189. let _this = this;
  1190. _this.highIndex = 0;
  1191. _this.highWordsArr = [];
  1192. if (word && this.newWordList.indexOf(word) > -1) {
  1193. this.highWordsArr.push(word);
  1194. }
  1195. if (words && word != words && this.newWordList.indexOf(words) > -1) {
  1196. this.highWordsArr.push(words);
  1197. }
  1198. if (
  1199. this.newWordList.indexOf(word) > -1 ||
  1200. this.newWordList.indexOf(words) > -1
  1201. ) {
  1202. if (word && this.newWordList.indexOf(word) > -1) {
  1203. if (_this.oldHz != word) {
  1204. this.isShow = false;
  1205. setTimeout(() => {
  1206. _this.hz = word;
  1207. }, 50);
  1208. }
  1209. } else if (words && this.newWordList.indexOf(words) > -1) {
  1210. if (_this.oldHz != words) {
  1211. this.isShow = false;
  1212. setTimeout(() => {
  1213. _this.hz = words;
  1214. }, 50);
  1215. }
  1216. }
  1217. _this.clientY = e.clientY;
  1218. let left = e.clientX;
  1219. let width = 0;
  1220. if (word.length == 1 || word.length == 2) {
  1221. width = 304;
  1222. } else if (word.length == 3 || word.length == 4) {
  1223. width = 432;
  1224. } else if (word.length > 3) {
  1225. width = 560;
  1226. }
  1227. if (left - this.bodyLeft > this.contentWidth / 2) {
  1228. _this.left = left - width + 10;
  1229. } else {
  1230. _this.left = left;
  1231. }
  1232. }
  1233. },
  1234. hideWordDetail() {
  1235. this.isShow = false;
  1236. },
  1237. changeWordCard(isShow) {
  1238. this.isShow = isShow;
  1239. this.oldHz = "";
  1240. this.hz = "";
  1241. },
  1242. // 处理分词数据
  1243. handleNewWords(val, top, left) {
  1244. this.isShow = true;
  1245. this.word = null;
  1246. for (let i = 0; i < this.NNPENewWordList.length; i++) {
  1247. let pItem = this.NNPENewWordList[i];
  1248. for (let j = 0; j < pItem.length; j++) {
  1249. let item = pItem[j];
  1250. if (item.new_word.trim() == val.trim()) {
  1251. let wordlist = val.split("");
  1252. this.word = { list: wordlist, detail: item, top: top, left: left };
  1253. break;
  1254. }
  1255. }
  1256. }
  1257. this.oldHz = val;
  1258. },
  1259. getScreenHeight() {
  1260. this.screenHeight = window.innerHeight;
  1261. },
  1262. changeCurQue(answer) {
  1263. if (answer) {
  1264. let writeModel = this.curQue.Bookanswer.writeModel;
  1265. let hz = answer.hz;
  1266. if (writeModel.hasOwnProperty(hz)) {
  1267. writeModel[hz].push(answer);
  1268. } else {
  1269. writeModel[hz] = [answer];
  1270. }
  1271. console.log(this.curQue.Bookanswer);
  1272. }
  1273. },
  1274. viewNotes(e, noteNum) {
  1275. let _this = this;
  1276. _this.clickType = "note";
  1277. _this.activeWord = null;
  1278. let noteIndex = "";
  1279. if (_this.NumberList.indexOf(noteNum) > -1) {
  1280. for (let i = 0; i < _this.NumberList.length; i++) {
  1281. if (_this.NumberList[i] == noteNum) {
  1282. noteIndex = "" + i + "";
  1283. break;
  1284. }
  1285. }
  1286. this.showNoteDetail(e, noteIndex);
  1287. } else {
  1288. if (this.newWordList.indexOf(noteNum) > -1) {
  1289. if (_this.oldHz != noteNum) {
  1290. this.isShow = false;
  1291. _this.NNPENewWordList.forEach(item => {
  1292. item.forEach(items => {
  1293. if (items.new_word === noteNum) {
  1294. this.activeWord = items;
  1295. }
  1296. });
  1297. });
  1298. setTimeout(() => {
  1299. _this.hz = noteNum;
  1300. }, 50);
  1301. }
  1302. _this.clientY = e.clientY;
  1303. let left = e.clientX;
  1304. let width = 0;
  1305. if (noteNum.length == 1 || noteNum.length == 2) {
  1306. width = 304;
  1307. } else if (noteNum.length == 3 || noteNum.length == 4) {
  1308. width = 432;
  1309. } else if (noteNum.length > 3) {
  1310. width = 560;
  1311. }
  1312. if (left - this.bodyLeft > this.contentWidth / 2) {
  1313. _this.left = left - width + 10;
  1314. } else {
  1315. _this.left = left;
  1316. }
  1317. }
  1318. }
  1319. },
  1320. showNoteDetail(e, noteNum) {
  1321. let _this = this;
  1322. if (_this.oldNoteNum != noteNum) {
  1323. this.isNoteShow = false;
  1324. setTimeout(() => {
  1325. _this.noteNum = noteNum;
  1326. }, 50);
  1327. }
  1328. _this.clientY = e.clientY;
  1329. let left = e.clientX;
  1330. let width = 642;
  1331. if (left - this.bodyLeft > this.contentWidth / 2) {
  1332. _this.left = left - width + 10;
  1333. } else {
  1334. if (left - 200 > 500) {
  1335. _this.left = 500;
  1336. } else {
  1337. _this.left = left - 200;
  1338. }
  1339. }
  1340. },
  1341. // 处理注释数据
  1342. handleNote(val) {
  1343. let _this = this;
  1344. _this.isNoteShow = true;
  1345. _this.oldNoteNum = val;
  1346. let noteIndex = Number(val);
  1347. if (_this.NNPEAnnotationList && _this.NNPEAnnotationList.length > 0) {
  1348. _this.curNoteCon = _this.NNPEAnnotationList[noteIndex]
  1349. ? _this.NNPEAnnotationList[noteIndex]
  1350. : null;
  1351. }
  1352. },
  1353. changeCard(isShow) {
  1354. let _this = this;
  1355. _this.isNoteShow = isShow;
  1356. _this.oldNoteNum = "";
  1357. _this.noteNum = "";
  1358. }
  1359. },
  1360. //生命周期 - 创建完成(可以访问当前this实例)
  1361. created() {},
  1362. //生命周期 - 挂载完成(可以访问DOM元素)
  1363. mounted() {
  1364. if (this.NNPENewWordList && this.NNPENewWordList.length > 0) {
  1365. this.handleNewword();
  1366. }
  1367. if (this.curQue) {
  1368. this.handleData();
  1369. }
  1370. $(window).resize(() => {
  1371. this.getScreenHeight();
  1372. });
  1373. this.getScreenHeight();
  1374. },
  1375. beforeCreate() {}, //生命周期 - 创建之前
  1376. beforeMount() {}, //生命周期 - 挂载之前
  1377. beforeUpdate() {}, //生命周期 - 更新之前
  1378. updated() {}, //生命周期 - 更新之后
  1379. beforeDestroy() {}, //生命周期 - 销毁之前
  1380. destroyed() {}, //生命周期 - 销毁完成
  1381. activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
  1382. };
  1383. </script>
  1384. <style lang="scss" scoped>
  1385. //@import url(); 引入公共css类
  1386. .NNPE-ArticleView {
  1387. width: 100%;
  1388. .aduioLine-practice-npc {
  1389. display: flex;
  1390. justify-content: flex-start;
  1391. align-items: center;
  1392. .aduioLine-content {
  1393. flex: 1;
  1394. }
  1395. .aduioLine-right {
  1396. display: flex;
  1397. justify-content: space-between;
  1398. align-items: center;
  1399. width: 69px;
  1400. height: 40px;
  1401. box-sizing: border-box;
  1402. padding: 0 12px;
  1403. border-left: 1px solid rgba(0, 0, 0, 0.1);
  1404. > span {
  1405. width: 16px;
  1406. height: 16px;
  1407. cursor: pointer;
  1408. }
  1409. }
  1410. }
  1411. .NPC-sentences-list {
  1412. padding: 24px 0;
  1413. }
  1414. .NNPE-detail {
  1415. clear: both;
  1416. overflow: hidden;
  1417. color: rgba(0, 0, 0, 1);
  1418. .NNPE-words {
  1419. float: left;
  1420. &-box {
  1421. float: left;
  1422. > span {
  1423. display: block;
  1424. &.NNPE-pinyin {
  1425. font-family: "GB-PINYINOK-B";
  1426. font-weight: normal;
  1427. font-size: 14px;
  1428. line-height: 22px;
  1429. &.noFont {
  1430. font-family: initial;
  1431. }
  1432. height: 22px;
  1433. &.textLeft {
  1434. text-align: left;
  1435. }
  1436. }
  1437. &.NNPE-chs {
  1438. font-family: "FZJCGFKTK";
  1439. font-size: 20px;
  1440. line-height: 28px;
  1441. &.active {
  1442. color: #de4444;
  1443. }
  1444. }
  1445. &.padding {
  1446. padding: 0 3px;
  1447. }
  1448. }
  1449. }
  1450. &.textLeft {
  1451. text-align: left;
  1452. }
  1453. &.textCenter {
  1454. text-align: center;
  1455. }
  1456. &.textRight {
  1457. text-align: right;
  1458. }
  1459. > span {
  1460. display: block;
  1461. &.NNPE-pinyin {
  1462. font-family: "GB-PINYINOK-B";
  1463. font-weight: normal;
  1464. font-size: 14px;
  1465. line-height: 22px;
  1466. height: 22px;
  1467. &.noFont {
  1468. font-family: initial;
  1469. }
  1470. &.textLeft {
  1471. text-align: left;
  1472. }
  1473. }
  1474. &.NNPE-chs {
  1475. font-family: "FZJCGFKTK";
  1476. font-size: 20px;
  1477. line-height: 28px;
  1478. &.active {
  1479. color: #de4444;
  1480. }
  1481. }
  1482. &.padding {
  1483. padding: 0 3px;
  1484. }
  1485. }
  1486. }
  1487. &.NNPE-detail-title {
  1488. .wordsList-box {
  1489. > div {
  1490. display: flex;
  1491. justify-content: center;
  1492. width: 100%;
  1493. flex-flow: wrap;
  1494. }
  1495. }
  1496. }
  1497. .index {
  1498. width: 48px;
  1499. box-sizing: border-box;
  1500. padding: 8px;
  1501. text-align: right;
  1502. border-right: 1px solid rgba(0, 0, 0, 0.1);
  1503. b {
  1504. font-weight: 400;
  1505. color: #000000;
  1506. line-height: 1.5;
  1507. }
  1508. }
  1509. .wordsList-box {
  1510. width: 100%;
  1511. padding: 6px 24px 12px 24px;
  1512. display: flex;
  1513. &-left {
  1514. justify-content: flex-start;
  1515. }
  1516. &-center {
  1517. justify-content: center;
  1518. }
  1519. &-right {
  1520. justify-content: flex-end;
  1521. }
  1522. > div {
  1523. overflow: hidden;
  1524. clear: both;
  1525. }
  1526. > img {
  1527. max-width: 100%;
  1528. display: block;
  1529. margin: 0 auto;
  1530. }
  1531. }
  1532. }
  1533. .NNPE-wordDetail {
  1534. position: fixed;
  1535. z-index: 116;
  1536. top: 50%;
  1537. margin-top: -196px;
  1538. left: 50%;
  1539. max-width: 100%;
  1540. overflow: auto;
  1541. // width: 260px;
  1542. // height: 200px;
  1543. // background: #cc0;
  1544. }
  1545. .NNPE-detail-box {
  1546. width: 100%;
  1547. box-sizing: border-box;
  1548. margin-bottom: 8px;
  1549. box-sizing: border-box;
  1550. padding: 8px 24px 8px;
  1551. &.active {
  1552. background: rgba(222, 68, 68, 0.15);
  1553. }
  1554. }
  1555. .NNPE-details {
  1556. clear: both;
  1557. overflow: hidden;
  1558. .NNPE-words {
  1559. float: left;
  1560. &-box {
  1561. float: left;
  1562. > span {
  1563. display: block;
  1564. &.NNPE-pinyin {
  1565. font-family: "GB-PINYINOK-B";
  1566. font-weight: normal;
  1567. font-size: 14px;
  1568. line-height: 20px;
  1569. color: rgba(0, 0, 0, 0.65);
  1570. height: 20px;
  1571. &.noFont {
  1572. font-family: initial;
  1573. }
  1574. &.textLeft {
  1575. text-align: left;
  1576. }
  1577. &.wordBlank {
  1578. color: rgba(0, 0, 0, 0.65);
  1579. }
  1580. }
  1581. &.NNPE-chs {
  1582. font-family: "FZJCGFKTK";
  1583. font-size: 20px;
  1584. line-height: 28px;
  1585. color: rgba(0, 0, 0, 0.65);
  1586. &.active {
  1587. color: #de4444;
  1588. }
  1589. &.wordBlank {
  1590. color: rgba(0, 0, 0, 0.65);
  1591. }
  1592. }
  1593. // &.padding {
  1594. // padding-right: 6px;
  1595. // }
  1596. }
  1597. }
  1598. &.textLeft {
  1599. text-align: left;
  1600. }
  1601. &.textCenter {
  1602. text-align: center;
  1603. }
  1604. &.textRight {
  1605. text-align: right;
  1606. }
  1607. > span {
  1608. display: block;
  1609. &.NNPE-pinyin {
  1610. font-family: "GB-PINYINOK-B";
  1611. font-weight: normal;
  1612. font-size: 14px;
  1613. line-height: 20px;
  1614. color: rgba(0, 0, 0, 0.65);
  1615. height: 20px;
  1616. &.noFont {
  1617. font-family: initial;
  1618. }
  1619. &.textLeft {
  1620. text-align: left;
  1621. }
  1622. &.wordBlank {
  1623. color: rgba(0, 0, 0, 0.65);
  1624. }
  1625. }
  1626. &.NNPE-chs {
  1627. font-family: "FZJCGFKTK";
  1628. font-size: 20px;
  1629. line-height: 28px;
  1630. color: rgba(0, 0, 0, 0.65);
  1631. &.active {
  1632. color: #de4444;
  1633. }
  1634. &.wordBlank {
  1635. color: rgba(0, 0, 0, 0.65);
  1636. }
  1637. }
  1638. &.padding {
  1639. padding: 0 3px;
  1640. }
  1641. }
  1642. }
  1643. }
  1644. .enwords {
  1645. font-family: Helvetica;
  1646. font-weight: normal;
  1647. font-size: 14px;
  1648. line-height: 22px;
  1649. color: rgba(0, 0, 0, 0.65);
  1650. padding-left: 3px;
  1651. word-break: break-word;
  1652. &.wordBlank {
  1653. color: rgba(0, 0, 0, 0.65);
  1654. }
  1655. }
  1656. }
  1657. </style>