PhraseModelChs.vue 53 KB

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