PhraseModelChs.vue 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680
  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 = JSON.parse(
  1253. JSON.stringify({
  1254. list: wordlist,
  1255. detail: item,
  1256. top: top,
  1257. left: left
  1258. })
  1259. );
  1260. break;
  1261. }
  1262. }
  1263. }
  1264. this.oldHz = val;
  1265. },
  1266. getScreenHeight() {
  1267. this.screenHeight = window.innerHeight;
  1268. },
  1269. changeCurQue(answer) {
  1270. if (answer) {
  1271. let writeModel = this.curQue.Bookanswer.writeModel;
  1272. let hz = answer.hz;
  1273. if (writeModel.hasOwnProperty(hz)) {
  1274. writeModel[hz].push(answer);
  1275. } else {
  1276. writeModel[hz] = [answer];
  1277. }
  1278. console.log(this.curQue.Bookanswer);
  1279. }
  1280. },
  1281. viewNotes(e, noteNum) {
  1282. let _this = this;
  1283. _this.clickType = "note";
  1284. _this.activeWord = null;
  1285. let noteIndex = "";
  1286. if (_this.NumberList.indexOf(noteNum) > -1) {
  1287. for (let i = 0; i < _this.NumberList.length; i++) {
  1288. if (_this.NumberList[i] == noteNum) {
  1289. noteIndex = "" + i + "";
  1290. break;
  1291. }
  1292. }
  1293. this.showNoteDetail(e, noteIndex);
  1294. } else {
  1295. if (this.newWordList.indexOf(noteNum) > -1) {
  1296. if (_this.oldHz != noteNum) {
  1297. this.isShow = false;
  1298. _this.NNPENewWordList.forEach(item => {
  1299. item.forEach(items => {
  1300. if (items.new_word === noteNum) {
  1301. this.activeWord = items;
  1302. }
  1303. });
  1304. });
  1305. setTimeout(() => {
  1306. _this.hz = noteNum;
  1307. }, 50);
  1308. }
  1309. _this.clientY = e.clientY;
  1310. let left = e.clientX;
  1311. let width = 0;
  1312. if (noteNum.length == 1 || noteNum.length == 2) {
  1313. width = 304;
  1314. } else if (noteNum.length == 3 || noteNum.length == 4) {
  1315. width = 432;
  1316. } else if (noteNum.length > 3) {
  1317. width = 560;
  1318. }
  1319. if (left - this.bodyLeft > this.contentWidth / 2) {
  1320. _this.left = left - width + 10;
  1321. } else {
  1322. _this.left = left;
  1323. }
  1324. }
  1325. }
  1326. },
  1327. showNoteDetail(e, noteNum) {
  1328. let _this = this;
  1329. if (_this.oldNoteNum != noteNum) {
  1330. this.isNoteShow = false;
  1331. setTimeout(() => {
  1332. _this.noteNum = noteNum;
  1333. }, 50);
  1334. }
  1335. _this.clientY = e.clientY;
  1336. let left = e.clientX;
  1337. let width = 642;
  1338. if (left - this.bodyLeft > this.contentWidth / 2) {
  1339. _this.left = left - width + 10;
  1340. } else {
  1341. if (left - 200 > 500) {
  1342. _this.left = 500;
  1343. } else {
  1344. _this.left = left - 200;
  1345. }
  1346. }
  1347. },
  1348. // 处理注释数据
  1349. handleNote(val) {
  1350. let _this = this;
  1351. _this.isNoteShow = true;
  1352. _this.oldNoteNum = val;
  1353. let noteIndex = Number(val);
  1354. if (_this.NNPEAnnotationList && _this.NNPEAnnotationList.length > 0) {
  1355. _this.curNoteCon = _this.NNPEAnnotationList[noteIndex]
  1356. ? _this.NNPEAnnotationList[noteIndex]
  1357. : null;
  1358. }
  1359. },
  1360. changeCard(isShow) {
  1361. let _this = this;
  1362. _this.isNoteShow = isShow;
  1363. _this.oldNoteNum = "";
  1364. _this.noteNum = "";
  1365. }
  1366. },
  1367. //生命周期 - 创建完成(可以访问当前this实例)
  1368. created() {},
  1369. //生命周期 - 挂载完成(可以访问DOM元素)
  1370. mounted() {
  1371. if (this.NNPENewWordList && this.NNPENewWordList.length > 0) {
  1372. this.handleNewword();
  1373. }
  1374. if (this.curQue) {
  1375. this.handleData();
  1376. }
  1377. $(window).resize(() => {
  1378. this.getScreenHeight();
  1379. });
  1380. this.getScreenHeight();
  1381. },
  1382. beforeCreate() {}, //生命周期 - 创建之前
  1383. beforeMount() {}, //生命周期 - 挂载之前
  1384. beforeUpdate() {}, //生命周期 - 更新之前
  1385. updated() {}, //生命周期 - 更新之后
  1386. beforeDestroy() {}, //生命周期 - 销毁之前
  1387. destroyed() {}, //生命周期 - 销毁完成
  1388. activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
  1389. };
  1390. </script>
  1391. <style lang="scss" scoped>
  1392. //@import url(); 引入公共css类
  1393. .NNPE-ArticleView {
  1394. width: 100%;
  1395. .aduioLine-practice-npc {
  1396. display: flex;
  1397. justify-content: flex-start;
  1398. align-items: center;
  1399. .aduioLine-content {
  1400. flex: 1;
  1401. }
  1402. .aduioLine-right {
  1403. display: flex;
  1404. justify-content: space-between;
  1405. align-items: center;
  1406. width: 69px;
  1407. height: 40px;
  1408. box-sizing: border-box;
  1409. padding: 0 12px;
  1410. border-left: 1px solid rgba(0, 0, 0, 0.1);
  1411. > span {
  1412. width: 16px;
  1413. height: 16px;
  1414. cursor: pointer;
  1415. }
  1416. }
  1417. }
  1418. .NPC-sentences-list {
  1419. padding: 24px 0;
  1420. }
  1421. .NNPE-detail {
  1422. clear: both;
  1423. overflow: hidden;
  1424. color: rgba(0, 0, 0, 1);
  1425. .NNPE-words {
  1426. float: left;
  1427. &-box {
  1428. float: left;
  1429. > span {
  1430. display: block;
  1431. &.NNPE-pinyin {
  1432. font-family: "GB-PINYINOK-B";
  1433. font-weight: normal;
  1434. font-size: 14px;
  1435. line-height: 22px;
  1436. &.noFont {
  1437. font-family: initial;
  1438. }
  1439. height: 22px;
  1440. &.textLeft {
  1441. text-align: left;
  1442. }
  1443. }
  1444. &.NNPE-chs {
  1445. font-family: "FZJCGFKTK";
  1446. font-size: 20px;
  1447. line-height: 28px;
  1448. &.active {
  1449. color: #de4444;
  1450. }
  1451. }
  1452. &.padding {
  1453. padding: 0 3px;
  1454. }
  1455. }
  1456. }
  1457. &.textLeft {
  1458. text-align: left;
  1459. }
  1460. &.textCenter {
  1461. text-align: center;
  1462. }
  1463. &.textRight {
  1464. text-align: right;
  1465. }
  1466. > span {
  1467. display: block;
  1468. &.NNPE-pinyin {
  1469. font-family: "GB-PINYINOK-B";
  1470. font-weight: normal;
  1471. font-size: 14px;
  1472. line-height: 22px;
  1473. height: 22px;
  1474. &.noFont {
  1475. font-family: initial;
  1476. }
  1477. &.textLeft {
  1478. text-align: left;
  1479. }
  1480. }
  1481. &.NNPE-chs {
  1482. font-family: "FZJCGFKTK";
  1483. font-size: 20px;
  1484. line-height: 28px;
  1485. &.active {
  1486. color: #de4444;
  1487. }
  1488. }
  1489. &.padding {
  1490. padding: 0 3px;
  1491. }
  1492. }
  1493. }
  1494. &.NNPE-detail-title {
  1495. .wordsList-box {
  1496. > div {
  1497. display: flex;
  1498. justify-content: center;
  1499. width: 100%;
  1500. flex-flow: wrap;
  1501. }
  1502. }
  1503. }
  1504. .index {
  1505. width: 48px;
  1506. box-sizing: border-box;
  1507. padding: 8px;
  1508. text-align: right;
  1509. border-right: 1px solid rgba(0, 0, 0, 0.1);
  1510. b {
  1511. font-weight: 400;
  1512. color: #000000;
  1513. line-height: 1.5;
  1514. }
  1515. }
  1516. .wordsList-box {
  1517. width: 100%;
  1518. padding: 6px 24px 12px 24px;
  1519. display: flex;
  1520. &-left {
  1521. justify-content: flex-start;
  1522. }
  1523. &-center {
  1524. justify-content: center;
  1525. }
  1526. &-right {
  1527. justify-content: flex-end;
  1528. }
  1529. > div {
  1530. overflow: hidden;
  1531. clear: both;
  1532. }
  1533. > img {
  1534. max-width: 100%;
  1535. display: block;
  1536. margin: 0 auto;
  1537. }
  1538. }
  1539. }
  1540. .NNPE-wordDetail {
  1541. position: fixed;
  1542. z-index: 116;
  1543. top: 50%;
  1544. margin-top: -196px;
  1545. left: 50%;
  1546. max-width: 100%;
  1547. overflow: auto;
  1548. box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.15);
  1549. // width: 260px;
  1550. // height: 200px;
  1551. // background: #cc0;
  1552. }
  1553. .NNPE-detail-box {
  1554. width: 100%;
  1555. box-sizing: border-box;
  1556. margin-bottom: 8px;
  1557. box-sizing: border-box;
  1558. padding: 8px 24px 8px;
  1559. &.active {
  1560. background: rgba(222, 68, 68, 0.15);
  1561. }
  1562. }
  1563. .NNPE-details {
  1564. clear: both;
  1565. overflow: hidden;
  1566. .NNPE-words {
  1567. float: left;
  1568. &-box {
  1569. float: left;
  1570. > span {
  1571. display: block;
  1572. &.NNPE-pinyin {
  1573. font-family: "GB-PINYINOK-B";
  1574. font-weight: normal;
  1575. font-size: 14px;
  1576. line-height: 20px;
  1577. color: rgba(0, 0, 0, 0.65);
  1578. height: 20px;
  1579. &.noFont {
  1580. font-family: initial;
  1581. }
  1582. &.textLeft {
  1583. text-align: left;
  1584. }
  1585. &.wordBlank {
  1586. color: rgba(0, 0, 0, 0.65);
  1587. }
  1588. }
  1589. &.NNPE-chs {
  1590. font-family: "FZJCGFKTK";
  1591. font-size: 20px;
  1592. line-height: 28px;
  1593. color: rgba(0, 0, 0, 0.65);
  1594. &.active {
  1595. color: #de4444;
  1596. }
  1597. &.wordBlank {
  1598. color: rgba(0, 0, 0, 0.65);
  1599. }
  1600. }
  1601. // &.padding {
  1602. // padding-right: 6px;
  1603. // }
  1604. }
  1605. }
  1606. &.textLeft {
  1607. text-align: left;
  1608. }
  1609. &.textCenter {
  1610. text-align: center;
  1611. }
  1612. &.textRight {
  1613. text-align: right;
  1614. }
  1615. > span {
  1616. display: block;
  1617. &.NNPE-pinyin {
  1618. font-family: "GB-PINYINOK-B";
  1619. font-weight: normal;
  1620. font-size: 14px;
  1621. line-height: 20px;
  1622. color: rgba(0, 0, 0, 0.65);
  1623. height: 20px;
  1624. &.noFont {
  1625. font-family: initial;
  1626. }
  1627. &.textLeft {
  1628. text-align: left;
  1629. }
  1630. &.wordBlank {
  1631. color: rgba(0, 0, 0, 0.65);
  1632. }
  1633. }
  1634. &.NNPE-chs {
  1635. font-family: "FZJCGFKTK";
  1636. font-size: 20px;
  1637. line-height: 28px;
  1638. color: rgba(0, 0, 0, 0.65);
  1639. &.active {
  1640. color: #de4444;
  1641. }
  1642. &.wordBlank {
  1643. color: rgba(0, 0, 0, 0.65);
  1644. }
  1645. }
  1646. &.padding {
  1647. padding: 0 3px;
  1648. }
  1649. }
  1650. }
  1651. }
  1652. .enwords {
  1653. font-family: Helvetica;
  1654. font-weight: normal;
  1655. font-size: 14px;
  1656. line-height: 22px;
  1657. color: rgba(0, 0, 0, 0.65);
  1658. padding-left: 3px;
  1659. word-break: break-word;
  1660. &.wordBlank {
  1661. color: rgba(0, 0, 0, 0.65);
  1662. }
  1663. }
  1664. }
  1665. </style>