NormalModelChs.vue 93 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290
  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="artNormalAudio"
  18. :mp3="curQue.mp3_list[0].url"
  19. :get-cur-time="getCurTime"
  20. :duration="curQue.mp3_list[0].media_duration"
  21. :mp3-source="curQue.mp3_list[0].source"
  22. :width="colLength == 2 ? 200 : 700"
  23. :ed="ed"
  24. type="audioLine"
  25. :attrib="attrib"
  26. @emptyEd="emptyEd"
  27. />
  28. </template>
  29. </div>
  30. <div class="aduioLine-right">
  31. <SvgIcon
  32. v-if="config.isHasPY"
  33. icon-class="pin-btn"
  34. size="16"
  35. :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
  36. :style="{ color: config.isShowPY ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
  37. @click="changePinyin"
  38. />
  39. <SvgIcon
  40. v-if="config.isHasEN"
  41. icon-class="en-btn"
  42. size="16"
  43. :class="['EN-16', config.isShowEN ? '' : 'disabled']"
  44. :style="{ color: config.isShowEN ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
  45. @click="changeEN"
  46. />
  47. </div>
  48. </div>
  49. <div
  50. :style="{
  51. height: curQue.property.content_height ? curQue.property.content_height + 'px' : '',
  52. overflow: 'auto',
  53. }"
  54. >
  55. <template v-if="!config.isHasEN || (config.isHasEN && !config.isShowEN)">
  56. <template v-if="resArr.length > 0">
  57. <div class="NPC-sentences-list">
  58. <div class="NPC-article-empty">
  59. <div :class="['empty-left', isHasRemark ? 'hasRemark' : '']"></div>
  60. <div class="empty-right"></div>
  61. </div>
  62. <div
  63. v-for="(item, index) in resArr"
  64. :key="'detail' + index"
  65. :class="['NNPE-detail', item.isTitle ? 'NNPE-detail-title' : '']"
  66. >
  67. <div
  68. class="wordsList-box"
  69. :class="[
  70. curQue.detail[index].paragraphAttr
  71. ? 'wordsList-box-' + curQue.detail[index].paragraphAttr.paragraphAlign
  72. : '',
  73. 'article-content',
  74. isHasRemark ? 'hasRemark' : '',
  75. ]"
  76. >
  77. <template v-if="item.sourceList.length > 0 && item.sourcePosition === 'before'">
  78. <img
  79. v-if="item.sourceList[0] && item.sourceList[0].type === 'image'"
  80. :src="item.sourceList[0].file_url_open"
  81. :style="{
  82. width: item.widthNumber + 'px',
  83. height: item.heightNumber + 'px',
  84. }"
  85. />
  86. <video
  87. :src="item.sourceList[0].file_url_open"
  88. width="100%"
  89. height="400"
  90. controls
  91. controlsList="nodownload"
  92. v-else
  93. ></video>
  94. </template>
  95. <div :class="[item.isTitle ? 'NNPE-title' : '', 'para-' + item.paraAlign]">
  96. <div
  97. v-for="(pItem, pIndex) in item.wordsList"
  98. :key="'wordsList' + pIndex"
  99. class="NNPE-words"
  100. :class="[
  101. pItem.chs != '“' && pItem.wordIndex == 0 ? 'textLeft' : 'textCenter',
  102. pItem.chs == '“' ? 'textRight' : '',
  103. ]"
  104. @click="
  105. handleChangeTime(
  106. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  107. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  108. pItem.articleSentIndex,
  109. )
  110. "
  111. @mouseover="handleMouseover(pItem)"
  112. @mouseleave="handleMouseleave"
  113. >
  114. <template v-if="!pItem.width">
  115. <template v-if="pItem.isShow">
  116. <template
  117. v-if="
  118. item.wordsList[pIndex + 1] &&
  119. item.wordsList[pIndex + 1].chs &&
  120. (chsFhList.indexOf(item.wordsList[pIndex + 1].chs) > -1 ||
  121. NumberList.indexOf(item.wordsList[pIndex + 1].chs) > -1)
  122. "
  123. >
  124. <span v-if="pItem.leg > 0" class="NNPE-words-box">
  125. <span
  126. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  127. :class="[
  128. 'NNPE-pinyin',
  129. pItem.className ? pItem.className : '',
  130. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  131. ]"
  132. :style="{
  133. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  134. height:
  135. attrib && attrib.pinyin_size
  136. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  137. : '22px',
  138. }"
  139. @click.stop="
  140. viewNotes(
  141. $event,
  142. pItem.pinyin,
  143. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  144. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  145. pItem.articleSentIndex,
  146. pItem,
  147. )
  148. "
  149. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
  150. >
  151. <span
  152. class="NNPE-chs"
  153. :class="[
  154. item.timeList &&
  155. item.timeList[pItem.sentIndex] &&
  156. curTime >= item.timeList[pItem.sentIndex].bg &&
  157. curTime <= item.timeList[pItem.sentIndex].ed &&
  158. curTime
  159. ? 'active'
  160. : '',
  161. pItem.paraIndex == paraIndex && pItem.sentIndex == sentIndex ? 'overActive' : '',
  162. ]"
  163. :style="{
  164. fontFamily: pItem.config.fontFamily,
  165. textDecoration: pItem.config.textDecoration,
  166. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  167. fontWeight: pItem.config.fontWeight,
  168. height:
  169. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  170. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  171. lineHeight:
  172. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  173. backgroundColor:
  174. item.timeList &&
  175. item.timeList[pItem.sentIndex] &&
  176. curTime >= item.timeList[pItem.sentIndex].bg &&
  177. curTime <= item.timeList[pItem.sentIndex].ed &&
  178. curTime &&
  179. attrib
  180. ? attrib.assist_color
  181. : '',
  182. }"
  183. >
  184. <template>
  185. <span
  186. v-for="(wItem, wIndex) in pItem.leg"
  187. :key="'ci' + wIndex + pIndex + index"
  188. :class="[
  189. pItem.chstimeList &&
  190. pItem.chstimeList[wIndex] &&
  191. curTime >= pItem.chstimeList[wIndex].wordBg &&
  192. curTime < item.timeList[pItem.sentIndex].ed
  193. ? 'wordActive'
  194. : '',
  195. ]"
  196. :style="{
  197. color:
  198. pItem.chstimeList &&
  199. pItem.chstimeList[wIndex] &&
  200. curTime >= pItem.chstimeList[wIndex].wordBg &&
  201. curTime < item.timeList[pItem.sentIndex].ed &&
  202. attrib
  203. ? attrib.topic_color
  204. : pItem.notesColor
  205. ? pItem.notesColor
  206. : pItem.config.color,
  207. }"
  208. @click.stop="
  209. viewNotes(
  210. $event,
  211. pItem.chs[wIndex],
  212. item.timeList &&
  213. item.timeList[pItem.sentIndex] &&
  214. item.timeList[pItem.sentIndex].bg,
  215. item.timeList &&
  216. item.timeList[pItem.sentIndex] &&
  217. item.timeList[pItem.sentIndex].ed,
  218. pItem.articleSentIndex,
  219. pItem,
  220. )
  221. "
  222. >{{ convertText(pItem.chs[wIndex]) }}</span
  223. >
  224. <img
  225. v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
  226. :src="pItem.img[0].file_url"
  227. :style="{
  228. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  229. }"
  230. />
  231. </template>
  232. </span>
  233. <span
  234. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  235. :class="[
  236. 'NNPE-pinyin',
  237. pItem.className ? pItem.className : '',
  238. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  239. ]"
  240. :style="{
  241. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  242. height:
  243. attrib && attrib.pinyin_size
  244. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  245. : '22px',
  246. }"
  247. @click.stop="
  248. viewNotes(
  249. $event,
  250. pItem.pinyin,
  251. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  252. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  253. pItem.articleSentIndex,
  254. pItem,
  255. )
  256. "
  257. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
  258. >
  259. </span>
  260. <span class="NNPE-words-box">
  261. <span
  262. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  263. :class="[
  264. 'NNPE-pinyin',
  265. noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  266. ]"
  267. style="text-align: left"
  268. :style="{
  269. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  270. height:
  271. attrib && attrib.pinyin_size
  272. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  273. : '22px',
  274. }"
  275. @click.stop="
  276. viewNotes(
  277. $event,
  278. item.wordsList[pIndex + 1].pinyin,
  279. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  280. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  281. pItem.articleSentIndex,
  282. pItem,
  283. )
  284. "
  285. >{{
  286. NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) == -1
  287. ? item.wordsList[pIndex + 1].pinyin
  288. : ''
  289. }}</span
  290. >
  291. <span
  292. class="NNPE-chs"
  293. style="text-align: left"
  294. :class="[
  295. item.timeList &&
  296. item.timeList[pItem.sentIndex] &&
  297. curTime >= item.timeList[pItem.sentIndex].bg &&
  298. curTime <= item.timeList[pItem.sentIndex].ed &&
  299. curTime
  300. ? 'active'
  301. : '',
  302. pItem.paraIndex == paraIndex && pItem.sentIndex == sentIndex ? 'overActive' : '',
  303. pItem.chstimeList &&
  304. pItem.chstimeList[pItem.leg - 1] &&
  305. curTime >= pItem.chstimeList[pItem.leg - 1].wordBg &&
  306. curQue.wordTime &&
  307. curTime <= item.timeList[pItem.sentIndex].ed
  308. ? 'wordActive'
  309. : '',
  310. ]"
  311. :style="{
  312. fontFamily: item.wordsList[pIndex + 1].config.fontFamily,
  313. textDecoration: item.wordsList[pIndex + 1].config.textDecoration,
  314. borderBottom: item.wordsList[pIndex + 1].config.border === 'dotted' ? '1px dotted' : '',
  315. fontWeight: item.wordsList[pIndex + 1].config.fontWeight,
  316. height:
  317. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  318. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  319. lineHeight:
  320. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  321. width: item.wordsList[pIndex + 1].chs.trim() === '' ? '6px' : '',
  322. backgroundColor:
  323. item.timeList &&
  324. item.timeList[pItem.sentIndex] &&
  325. curTime >= item.timeList[pItem.sentIndex].bg &&
  326. curTime <= item.timeList[pItem.sentIndex].ed &&
  327. curTime &&
  328. attrib
  329. ? attrib.assist_color
  330. : '',
  331. color:
  332. pItem.chstimeList &&
  333. pItem.chstimeList[pItem.leg - 1] &&
  334. curTime >= pItem.chstimeList[pItem.leg - 1].wordBg &&
  335. curQue.wordTime &&
  336. curTime <= item.timeList[pItem.sentIndex].ed &&
  337. attrib
  338. ? attrib.topic_color
  339. : item.wordsList[pIndex + 1].notesColor
  340. ? item.wordsList[pIndex + 1].notesColor
  341. : item.wordsList[pIndex + 1].config.color,
  342. }"
  343. @click.stop="
  344. viewNotes(
  345. $event,
  346. item.wordsList[pIndex + 1].chs,
  347. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  348. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  349. pItem.articleSentIndex,
  350. pItem,
  351. )
  352. "
  353. ><span>{{ convertText(item.wordsList[pIndex + 1].chs) }}</span
  354. ><img
  355. v-if="
  356. item.wordsList[pIndex + 1].img &&
  357. item.wordsList[pIndex + 1].img.length > 0 &&
  358. item.wordsList[pIndex + 1].imgPosition === 'after'
  359. "
  360. :src="item.wordsList[pIndex + 1].img[0].file_url"
  361. :style="{
  362. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  363. }"
  364. /></span>
  365. <span
  366. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  367. :class="[
  368. 'NNPE-pinyin',
  369. noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  370. ]"
  371. style="text-align: left"
  372. :style="{
  373. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  374. height:
  375. attrib && attrib.pinyin_size
  376. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  377. : '22px',
  378. }"
  379. @click.stop="
  380. viewNotes(
  381. $event,
  382. item.wordsList[pIndex + 1].pinyin,
  383. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  384. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  385. pItem.articleSentIndex,
  386. pItem,
  387. )
  388. "
  389. >{{
  390. NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) == -1
  391. ? item.wordsList[pIndex + 1].pinyin
  392. : ''
  393. }}</span
  394. >
  395. </span>
  396. <span
  397. v-if="
  398. item.wordsList[pIndex + 2] &&
  399. item.wordsList[pIndex + 2].chs &&
  400. (chsFhList.indexOf(item.wordsList[pIndex + 2].chs) > -1 ||
  401. NumberList.indexOf(item.wordsList[pIndex + 2].chs) > -1)
  402. "
  403. class="NNPE-words-box"
  404. >
  405. <span
  406. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  407. :class="[
  408. 'NNPE-pinyin',
  409. noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
  410. ]"
  411. style="text-align: left"
  412. :style="{
  413. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  414. height:
  415. attrib && attrib.pinyin_size
  416. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  417. : '22px',
  418. }"
  419. @click.stop="
  420. viewNotes(
  421. $event,
  422. item.wordsList[pIndex + 2].pinyin,
  423. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  424. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  425. pItem.articleSentIndex,
  426. pItem,
  427. )
  428. "
  429. >{{
  430. NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) == -1
  431. ? item.wordsList[pIndex + 2].pinyin
  432. : ''
  433. }}</span
  434. >
  435. <span
  436. class="NNPE-chs"
  437. style="text-align: left"
  438. :class="[
  439. item.timeList &&
  440. item.timeList[pItem.sentIndex] &&
  441. curTime >= item.timeList[pItem.sentIndex].bg &&
  442. curTime <= item.timeList[pItem.sentIndex].ed &&
  443. curTime
  444. ? 'active'
  445. : '',
  446. pItem.paraIndex == paraIndex && pItem.sentIndex == sentIndex ? 'overActive' : '',
  447. pItem.chstimeList &&
  448. pItem.chstimeList[pItem.leg - 1] &&
  449. curTime >= pItem.chstimeList[pItem.leg - 1].wordBg &&
  450. curQue.wordTime &&
  451. curTime <= item.timeList[pItem.sentIndex].ed
  452. ? 'wordActive'
  453. : '',
  454. ]"
  455. :style="{
  456. fontFamily: item.wordsList[pIndex + 2].config.fontFamily,
  457. textDecoration: item.wordsList[pIndex + 2].config.textDecoration,
  458. borderBottom: item.wordsList[pIndex + 2].config.border === 'dotted' ? '1px dotted' : '',
  459. fontWeight: item.wordsList[pIndex + 2].config.fontWeight,
  460. height:
  461. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  462. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  463. lineHeight:
  464. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  465. width: item.wordsList[pIndex + 2].chs.trim() === '' ? '6px' : '',
  466. backgroundColor:
  467. item.timeList &&
  468. item.timeList[pItem.sentIndex] &&
  469. curTime >= item.timeList[pItem.sentIndex].bg &&
  470. curTime <= item.timeList[pItem.sentIndex].ed &&
  471. curTime &&
  472. attrib
  473. ? attrib.assist_color
  474. : '',
  475. color:
  476. pItem.chstimeList &&
  477. pItem.chstimeList[pItem.leg - 1] &&
  478. curTime >= pItem.chstimeList[pItem.leg - 1].wordBg &&
  479. curQue.wordTime &&
  480. curTime <= item.timeList[pItem.sentIndex].ed &&
  481. attrib
  482. ? attrib.topic_color
  483. : item.wordsList[pIndex + 2].notesColor
  484. ? item.wordsList[pIndex + 2].notesColor
  485. : item.wordsList[pIndex + 2].config.color,
  486. }"
  487. @click.stop="
  488. viewNotes(
  489. $event,
  490. item.wordsList[pIndex + 2].chs,
  491. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  492. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  493. pItem.articleSentIndex,
  494. pItem,
  495. )
  496. "
  497. ><span>{{ convertText(item.wordsList[pIndex + 2].chs) }}</span
  498. ><img
  499. v-if="
  500. item.wordsList[pIndex + 2].img &&
  501. item.wordsList[pIndex + 2].img.length > 0 &&
  502. item.wordsList[pIndex + 2].imgPosition === 'after'
  503. "
  504. :src="item.wordsList[pIndex + 2].img[0].file_url"
  505. :style="{
  506. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  507. }"
  508. /></span>
  509. <span
  510. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  511. :class="[
  512. 'NNPE-pinyin',
  513. noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
  514. ]"
  515. style="text-align: left"
  516. :style="{
  517. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  518. height:
  519. attrib && attrib.pinyin_size
  520. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  521. : '22px',
  522. }"
  523. @click.stop="
  524. viewNotes(
  525. $event,
  526. item.wordsList[pIndex + 2].pinyin,
  527. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  528. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  529. pItem.articleSentIndex,
  530. pItem,
  531. )
  532. "
  533. >{{
  534. NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) == -1
  535. ? item.wordsList[pIndex + 2].pinyin
  536. : ''
  537. }}</span
  538. >
  539. </span>
  540. </template>
  541. <template v-else>
  542. <span
  543. v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
  544. class="NNPE-pinyin"
  545. :class="[
  546. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  547. pItem.className ? pItem.className : '',
  548. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  549. ]"
  550. :style="{
  551. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  552. height:
  553. attrib && attrib.pinyin_size
  554. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  555. : '22px',
  556. }"
  557. @click.stop="
  558. viewNotes(
  559. $event,
  560. pItem.pinyin,
  561. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  562. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  563. pItem.articleSentIndex,
  564. pItem,
  565. )
  566. "
  567. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
  568. >
  569. <span
  570. class="NNPE-chs"
  571. :class="[
  572. item.timeList &&
  573. item.timeList[pItem.sentIndex] &&
  574. curTime >= item.timeList[pItem.sentIndex].bg &&
  575. curTime <= item.timeList[pItem.sentIndex].ed &&
  576. curTime
  577. ? 'active'
  578. : '',
  579. pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
  580. pItem.paraIndex == paraIndex && pItem.sentIndex == sentIndex ? 'overActive' : '',
  581. ]"
  582. :style="{
  583. backgroundColor:
  584. item.timeList &&
  585. item.timeList[pItem.sentIndex] &&
  586. curTime >= item.timeList[pItem.sentIndex].bg &&
  587. curTime <= item.timeList[pItem.sentIndex].ed &&
  588. curTime &&
  589. attrib
  590. ? attrib.assist_color
  591. : '',
  592. }"
  593. >
  594. <template v-for="(wItem, wIndex) in pItem.leg">
  595. <span
  596. :key="'ci' + wIndex + pIndex + index"
  597. :class="[
  598. pItem.chstimeList &&
  599. pItem.chstimeList[wIndex] &&
  600. curTime >= pItem.chstimeList[wIndex].wordBg &&
  601. curTime < item.timeList[pItem.sentIndex].ed
  602. ? 'wordActive'
  603. : '',
  604. ]"
  605. :style="{
  606. fontFamily: pItem.config.fontFamily,
  607. textDecoration: pItem.config.textDecoration,
  608. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  609. fontWeight: pItem.config.fontWeight,
  610. height:
  611. attrib && attrib.font_size
  612. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  613. : '28px',
  614. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  615. lineHeight:
  616. attrib && attrib.font_size
  617. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  618. : '28px',
  619. width: pItem.chs[wIndex].trim() === '' ? '6px' : '',
  620. color:
  621. pItem.chstimeList &&
  622. pItem.chstimeList[wIndex] &&
  623. curTime >= pItem.chstimeList[wIndex].wordBg &&
  624. curTime < item.timeList[pItem.sentIndex].ed &&
  625. attrib
  626. ? attrib.topic_color
  627. : pItem.notesColor
  628. ? pItem.notesColor
  629. : pItem.config.color,
  630. }"
  631. @click.stop="
  632. viewNotes(
  633. $event,
  634. pItem.chs[wIndex],
  635. item.timeList &&
  636. item.timeList[pItem.sentIndex] &&
  637. item.timeList[pItem.sentIndex].bg,
  638. item.timeList &&
  639. item.timeList[pItem.sentIndex] &&
  640. item.timeList[pItem.sentIndex].ed,
  641. pItem.articleSentIndex,
  642. pItem,
  643. )
  644. "
  645. >{{ convertText(pItem.chs[wIndex]) }}</span
  646. >
  647. </template>
  648. <img
  649. v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
  650. :src="pItem.img[0].file_url"
  651. :style="{
  652. height: attrib && attrib.font_size ? attrib.font_size : '20px',
  653. }"
  654. />
  655. </span>
  656. <span
  657. v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
  658. class="NNPE-pinyin"
  659. :class="[
  660. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  661. pItem.className ? pItem.className : '',
  662. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  663. ]"
  664. :style="{
  665. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  666. height:
  667. attrib && attrib.pinyin_size
  668. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  669. : '22px',
  670. }"
  671. @click.stop="
  672. viewNotes(
  673. $event,
  674. pItem.pinyin,
  675. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].bg,
  676. item.timeList && item.timeList[pItem.sentIndex] && item.timeList[pItem.sentIndex].ed,
  677. pItem.articleSentIndex,
  678. pItem,
  679. )
  680. "
  681. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
  682. >
  683. </template>
  684. </template>
  685. </template>
  686. <template v-else>
  687. <span
  688. :style="{
  689. height: pItem.height + 'px',
  690. width: pItem.width + 'px',
  691. }"
  692. ></span>
  693. </template>
  694. </div>
  695. </div>
  696. <div
  697. v-if="curQue.property.multilingual_position === 'para'"
  698. class="multilingual-para"
  699. :class="[item.isTitle ? 'multilingual-para-center' : '', 'multilingual-' + item.paraAlign]"
  700. >
  701. {{
  702. curQue.detail[index].multilingualTextList && curQue.detail[index].multilingualTextList[multilingual]
  703. ? curQue.detail[index].multilingualTextList[multilingual].join(' ')
  704. : ''
  705. }}
  706. </div>
  707. <template v-if="item.sourceList.length > 0 && item.sourcePosition === 'after'">
  708. <img
  709. v-if="item.sourceList[0] && item.sourceList[0].type === 'image'"
  710. :src="item.sourceList[0].file_url_open"
  711. :style="{
  712. width: item.widthNumber + 'px',
  713. height: item.heightNumber + 'px',
  714. }"
  715. />
  716. <video
  717. :src="item.sourceList[0].file_url_open"
  718. width="100%"
  719. height="400"
  720. controls
  721. controlsList="nodownload"
  722. v-else
  723. ></video>
  724. </template>
  725. </div>
  726. <div v-if="item.remarkDetail" :class="['remarkBox', 'remark-top-8']">
  727. <RemarkChs :remark-detail="item.remarkDetail" :margin-top="8" />
  728. </div>
  729. </div>
  730. </div>
  731. </template>
  732. </template>
  733. <template v-else>
  734. <template v-if="resObj">
  735. <!-- 段落对齐方式和备注在此模式里没有写,如果段落里添加了英文后需要在此添加段落对齐和备注、大小图片、生词样式 -->
  736. <div class="NPC-sentences-list">
  737. <div
  738. v-for="(item, index) in resObj.sentList"
  739. :key="'detail' + index"
  740. :class="['NNPE-detail-box', sentIndex == index ? 'active' : '']"
  741. >
  742. <div
  743. :class="['NNPE-details']"
  744. @click="
  745. handleChangeTime(
  746. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  747. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  748. index,
  749. )
  750. "
  751. >
  752. <div
  753. v-if="item.enwords && config.isShowEN && curQue.enPosition && curQue.enPosition == 'top'"
  754. :class="['enwords', sentIndex == index ? 'wordBlank' : '']"
  755. >
  756. {{ item.enwords }}
  757. </div>
  758. <div style="overflow: hidden; clear: both"></div>
  759. <div
  760. v-for="(pItem, pIndex) in item.sentArr"
  761. :key="'wordsList' + pIndex"
  762. class="NNPE-words"
  763. :class="[
  764. pItem.chs != '“' && pItem.wordIndex == 0 ? 'textLeft' : 'textCenter',
  765. pItem.chs == '“' ? 'textRight' : '',
  766. ]"
  767. >
  768. <template v-if="!pItem.width">
  769. <template v-if="pItem.isShow">
  770. <template
  771. v-if="
  772. item.sentArr[pIndex + 1] &&
  773. item.sentArr[pIndex + 1].chs &&
  774. (chsFhList.indexOf(item.sentArr[pIndex + 1].chs) > -1 ||
  775. NumberList.indexOf(item.sentArr[pIndex + 1].chs) > -1)
  776. "
  777. >
  778. <span class="NNPE-words-box">
  779. <template v-if="curQue.property.pinyin_position == 'top'">
  780. <span
  781. v-if="config.isShowPY"
  782. class="NNPE-pinyin"
  783. :class="[
  784. pItem.className ? pItem.className : '',
  785. sentIndex == index ? 'wordBlank' : '',
  786. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  787. ]"
  788. :style="{
  789. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  790. height:
  791. attrib && attrib.pinyin_size
  792. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  793. : '22px',
  794. }"
  795. @click.stop="
  796. viewNotes(
  797. $event,
  798. pItem.pinyin,
  799. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  800. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  801. index,
  802. pItem,
  803. )
  804. "
  805. >{{ pItem.pinyin }}</span
  806. >
  807. </template>
  808. <span
  809. class="NNPE-chs"
  810. :class="[
  811. pItem.padding && config.isShowPY ? 'padding' : '',
  812. sentIndex == index ? 'wordBlank' : '',
  813. ]"
  814. >
  815. <template v-for="(wItem, wIndex) in pItem.leg">
  816. <span
  817. :key="'ci' + wIndex + pIndex + index"
  818. :class="[
  819. pItem.timeList[wIndex] &&
  820. curTime >= pItem.timeList[wIndex].wordBg &&
  821. curTime <= curQue.wordTime[index].ed &&
  822. curTime
  823. ? 'active'
  824. : '',
  825. sentIndex == index ? 'wordBlank' : '',
  826. ]"
  827. :style="{
  828. fontFamily: pItem.config.fontFamily,
  829. color: pItem.config.color,
  830. textDecoration: pItem.config.textDecoration,
  831. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  832. fontWeight: pItem.config.fontWeight,
  833. height:
  834. attrib && attrib.font_size
  835. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  836. : '28px',
  837. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  838. lineHeight:
  839. attrib && attrib.font_size
  840. ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
  841. : '28px',
  842. width: pItem.chs[wIndex].trim() === '' ? '6px' : '',
  843. }"
  844. @click.stop="
  845. viewNotes(
  846. $event,
  847. pItem.chs[wIndex],
  848. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  849. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  850. index,
  851. pItem,
  852. )
  853. "
  854. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs[wIndex] : '' }}</span
  855. >
  856. </template>
  857. </span>
  858. <template v-if="curQue.property.pinyin_position == 'bottom'">
  859. <span
  860. v-if="config.isShowPY"
  861. class="NNPE-pinyin"
  862. :class="[
  863. pItem.className ? pItem.className : '',
  864. sentIndex == index ? 'wordBlank' : '',
  865. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  866. ]"
  867. :style="{
  868. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  869. height:
  870. attrib && attrib.pinyin_size
  871. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  872. : '22px',
  873. }"
  874. @click.stop="
  875. viewNotes(
  876. $event,
  877. pItem.pinyin,
  878. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  879. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  880. index,
  881. pItem,
  882. )
  883. "
  884. >{{ pItem.pinyin }}</span
  885. >
  886. </template>
  887. </span>
  888. <span class="NNPE-words-box">
  889. <template v-if="curQue.property.pinyin_position == 'top'">
  890. <span
  891. v-if="config.isShowPY"
  892. :class="[
  893. 'NNPE-pinyin',
  894. sentIndex == index ? 'wordBlank' : '',
  895. noFont.indexOf(item.sentArr[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  896. ]"
  897. style="text-align: left"
  898. :style="{
  899. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  900. height:
  901. attrib && attrib.pinyin_size
  902. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  903. : '22px',
  904. }"
  905. @click.stop="
  906. viewNotes(
  907. $event,
  908. item.sentArr[pIndex + 1].pinyin,
  909. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  910. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  911. index,
  912. item.sentArr[pIndex + 1],
  913. )
  914. "
  915. >{{ item.sentArr[pIndex + 1].pinyin }}</span
  916. >
  917. </template>
  918. <span
  919. class="NNPE-chs"
  920. style="text-align: left"
  921. :style="{
  922. height:
  923. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  924. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  925. lineHeight:
  926. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  927. }"
  928. >
  929. <span
  930. :class="[
  931. pItem.timeList[pItem.leg - 1] &&
  932. curQue.wordTime &&
  933. curTime >= pItem.timeList[pItem.leg - 1].wordBg &&
  934. curTime <= curQue.wordTime[index].ed &&
  935. curTime
  936. ? 'active'
  937. : '',
  938. sentIndex == index ? 'wordBlank' : '',
  939. ]"
  940. :style="{
  941. fontFamily: item.sentArr[pIndex + 1].config.fontFamily,
  942. color: item.sentArr[pIndex + 1].config.color,
  943. textDecoration: item.sentArr[pIndex + 1].config.textDecoration,
  944. borderBottom: item.sentArr[pIndex + 1].config.border === 'dotted' ? '1px dotted' : '',
  945. fontWeight: item.sentArr[pIndex + 1].config.fontWeight,
  946. height:
  947. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  948. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  949. lineHeight:
  950. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  951. width: item.sentArr[pIndex + 1].chs.trim() === '' ? '6px' : '',
  952. }"
  953. @click.stop="
  954. viewNotes(
  955. $event,
  956. item.sentArr[pIndex + 1].chs,
  957. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  958. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  959. index,
  960. item.sentArr[pIndex + 1],
  961. )
  962. "
  963. >
  964. {{
  965. NumberList.indexOf(item.sentArr[pIndex + 1].pinyin) == -1
  966. ? item.sentArr[pIndex + 1].chs
  967. : ''
  968. }}</span
  969. >
  970. </span>
  971. <template v-if="curQue.property.pinyin_position == 'bottom'">
  972. <span
  973. v-if="config.isShowPY"
  974. :class="[
  975. 'NNPE-pinyin',
  976. sentIndex == index ? 'wordBlank' : '',
  977. noFont.indexOf(item.sentArr[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  978. ]"
  979. style="text-align: left"
  980. :style="{
  981. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  982. height:
  983. attrib && attrib.pinyin_size
  984. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  985. : '22px',
  986. }"
  987. @click.stop="
  988. viewNotes(
  989. $event,
  990. item.sentArr[pIndex + 1].pinyin,
  991. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  992. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  993. index,
  994. item.sentArr[pIndex + 1],
  995. )
  996. "
  997. >{{ item.sentArr[pIndex + 1].pinyin }}</span
  998. >
  999. </template>
  1000. </span>
  1001. <span
  1002. v-if="
  1003. item.sentArr[pIndex + 2] &&
  1004. item.sentArr[pIndex + 2].chs &&
  1005. chsFhList.indexOf(item.sentArr[pIndex + 2].chs) > -1
  1006. "
  1007. class="NNPE-words-box"
  1008. >
  1009. <template v-if="curQue.property.pinyin_position == 'top'">
  1010. <span
  1011. v-if="config.isShowPY"
  1012. :class="[
  1013. 'NNPE-pinyin',
  1014. sentIndex == index ? 'wordBlank' : '',
  1015. noFont.indexOf(item.sentArr[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
  1016. ]"
  1017. style="text-align: left"
  1018. :style="{
  1019. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1020. height:
  1021. attrib && attrib.pinyin_size
  1022. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1023. : '22px',
  1024. }"
  1025. @click.stop="
  1026. viewNotes(
  1027. $event,
  1028. item.sentArr[pIndex + 2].pinyin,
  1029. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  1030. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  1031. index,
  1032. item.sentArr[pIndex + 2],
  1033. )
  1034. "
  1035. >{{ item.sentArr[pIndex + 2].pinyin }}</span
  1036. >
  1037. </template>
  1038. <span class="NNPE-chs" style="text-align: left">
  1039. <span
  1040. :class="[
  1041. pItem.timeList[pItem.leg - 1] &&
  1042. curQue.wordTime &&
  1043. curTime >= pItem.timeList[pItem.leg - 1].wordBg &&
  1044. curTime <= curQue.wordTime[index].ed &&
  1045. curTime
  1046. ? 'active'
  1047. : '',
  1048. sentIndex == index ? 'wordBlank' : '',
  1049. ]"
  1050. :style="{
  1051. fontFamily: item.sentArr[pIndex + 2].config.fontFamily,
  1052. color: item.sentArr[pIndex + 2].config.color,
  1053. textDecoration: item.sentArr[pIndex + 2].config.textDecoration,
  1054. borderBottom: item.sentArr[pIndex + 2].config.border === 'dotted' ? '1px dotted' : '',
  1055. fontWeight: item.sentArr[pIndex + 2].config.fontWeight,
  1056. height:
  1057. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1058. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  1059. lineHeight:
  1060. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1061. width: item.sentArr[pIndex + 2].chs.trim() === '' ? '6px' : '',
  1062. }"
  1063. @click.stop="
  1064. viewNotes(
  1065. $event,
  1066. item.sentArr[pIndex + 2].chs,
  1067. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  1068. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  1069. index,
  1070. item.sentArr[pIndex + 2],
  1071. )
  1072. "
  1073. >
  1074. {{
  1075. NumberList.indexOf(item.sentArr[pIndex + 2].pinyin) == -1
  1076. ? item.sentArr[pIndex + 2].chs
  1077. : ''
  1078. }}</span
  1079. >
  1080. </span>
  1081. <template v-if="curQue.property.pinyin_position == 'bottom'">
  1082. <span
  1083. v-if="config.isShowPY"
  1084. :class="[
  1085. 'NNPE-pinyin',
  1086. sentIndex == index ? 'wordBlank' : '',
  1087. noFont.indexOf(item.sentArr[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
  1088. ]"
  1089. style="text-align: left"
  1090. :style="{
  1091. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1092. height:
  1093. attrib && attrib.pinyin_size
  1094. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1095. : '22px',
  1096. }"
  1097. @click.stop="
  1098. viewNotes(
  1099. $event,
  1100. item.sentArr[pIndex + 2].pinyin,
  1101. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  1102. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  1103. index,
  1104. item.sentArr[pIndex + 2],
  1105. )
  1106. "
  1107. >{{ item.sentArr[pIndex + 2].pinyin }}</span
  1108. >
  1109. </template>
  1110. </span>
  1111. </template>
  1112. <template v-else>
  1113. <template v-if="curQue.property.pinyin_position == 'top'">
  1114. <span
  1115. v-if="config.isShowPY"
  1116. class="NNPE-pinyin"
  1117. :class="[
  1118. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  1119. pItem.className ? pItem.className : '',
  1120. sentIndex == index ? 'wordBlank' : '',
  1121. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  1122. ]"
  1123. :style="{
  1124. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1125. height:
  1126. attrib && attrib.pinyin_size
  1127. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1128. : '22px',
  1129. }"
  1130. @click.stop="
  1131. viewNotes(
  1132. $event,
  1133. pItem.pinyin,
  1134. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  1135. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  1136. index,
  1137. pItem,
  1138. )
  1139. "
  1140. >{{ pItem.pinyin }}</span
  1141. >
  1142. </template>
  1143. <span
  1144. class="NNPE-chs"
  1145. :class="[
  1146. pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
  1147. sentIndex == index ? 'wordBlank' : '',
  1148. ]"
  1149. :style="{
  1150. height:
  1151. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1152. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  1153. lineHeight:
  1154. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1155. }"
  1156. >
  1157. <template v-for="(wItem, wIndex) in pItem.leg">
  1158. <span
  1159. :key="'ci' + wIndex + pIndex + index"
  1160. :class="[
  1161. pItem.timeList[wIndex] &&
  1162. curQue.wordTime &&
  1163. curQue.wordTime[index] &&
  1164. curTime >= pItem.timeList[wIndex].wordBg &&
  1165. curTime <= curQue.wordTime[index].ed
  1166. ? 'active'
  1167. : '',
  1168. sentIndex == index ? 'wordBlank' : '',
  1169. ]"
  1170. :style="{
  1171. fontFamily: pItem.config.fontFamily,
  1172. color: pItem.config.color,
  1173. textDecoration: pItem.config.textDecoration,
  1174. borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
  1175. fontWeight: pItem.config.fontWeight,
  1176. height:
  1177. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1178. fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
  1179. lineHeight:
  1180. attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
  1181. width: pItem.chs[wIndex].trim() === '' ? '6px' : '',
  1182. }"
  1183. @click.stop="
  1184. viewNotes(
  1185. $event,
  1186. pItem.chs[wIndex],
  1187. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  1188. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  1189. index,
  1190. pItem,
  1191. )
  1192. "
  1193. >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs[wIndex] : '' }}</span
  1194. >
  1195. </template>
  1196. </span>
  1197. <template v-if="curQue.property.pinyin_position == 'bottom'">
  1198. <span
  1199. v-if="config.isShowPY"
  1200. class="NNPE-pinyin"
  1201. :class="[
  1202. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  1203. pItem.className ? pItem.className : '',
  1204. sentIndex == index ? 'wordBlank' : '',
  1205. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  1206. ]"
  1207. :style="{
  1208. fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
  1209. height:
  1210. attrib && attrib.pinyin_size
  1211. ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
  1212. : '22px',
  1213. }"
  1214. @click.stop="
  1215. viewNotes(
  1216. $event,
  1217. pItem.pinyin,
  1218. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].bg,
  1219. curQue.wordTime && curQue.wordTime[index] && curQue.wordTime[index].ed,
  1220. index,
  1221. pItem,
  1222. )
  1223. "
  1224. >{{ pItem.pinyin }}</span
  1225. >
  1226. </template>
  1227. </template>
  1228. </template>
  1229. </template>
  1230. <template v-else>
  1231. <span
  1232. :style="{
  1233. height: pItem.height + 'px',
  1234. width: pItem.width + 'px',
  1235. }"
  1236. ></span>
  1237. </template>
  1238. </div>
  1239. <div style="overflow: hidden; clear: both"></div>
  1240. <div
  1241. v-if="
  1242. item.enwords &&
  1243. config.isShowEN &&
  1244. (!curQue.enPosition || (curQue.enPosition && curQue.enPosition == 'bottom'))
  1245. "
  1246. :class="['enwords', sentIndex == index ? 'wordBlank' : '']"
  1247. >
  1248. {{ item.enwords }}
  1249. </div>
  1250. </div>
  1251. <div
  1252. v-if="curQue.property.multilingual_position === 'para'"
  1253. class="multilingual-para"
  1254. :class="[item.isTitle ? 'multilingual-para-center' : '', 'multilingual-' + item.paraAlign]"
  1255. >
  1256. {{ multilingualTextList[multilingual] ? multilingualTextList[multilingual].join(' ') : '' }}
  1257. </div>
  1258. </div>
  1259. </div>
  1260. </template>
  1261. </template>
  1262. <template v-for="(items, indexs) in curQue.detail">
  1263. <div
  1264. v-if="
  1265. curQue.property.multilingual_position === 'all' &&
  1266. items.multilingualTextList &&
  1267. items.multilingualTextList[multilingual] &&
  1268. items.multilingualTextList[multilingual].length > 0
  1269. "
  1270. :key="indexs"
  1271. class="multilingual"
  1272. >
  1273. <div
  1274. class="multilingual-para"
  1275. :class="[items.isTitle ? 'multilingual-para-center' : '', 'multilingual-' + items.paraAlign]"
  1276. >
  1277. {{
  1278. items.multilingualTextList && items.multilingualTextList[multilingual]
  1279. ? items.multilingualTextList[multilingual].join(' ')
  1280. : ''
  1281. }}
  1282. </div>
  1283. </div>
  1284. </template>
  1285. </div>
  1286. <div
  1287. v-if="
  1288. ((curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url) ||
  1289. config.isHasPY ||
  1290. config.isHasEN) &&
  1291. curQue.property.mp3_position === 'bottom'
  1292. "
  1293. class="aduioLine-box aduioLine-practice-npc aduioLine-box-bottom"
  1294. >
  1295. <div class="aduioLine-content">
  1296. <template v-if="curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url">
  1297. <AudioLine
  1298. ref="audioLine"
  1299. audio-id="artNormalAudio"
  1300. :mp3="curQue.mp3_list[0].url"
  1301. :get-cur-time="getCurTime"
  1302. :duration="curQue.mp3_list[0].media_duration"
  1303. :mp3-source="curQue.mp3_list[0].source"
  1304. :width="colLength == 2 ? 200 : 700"
  1305. :ed="ed"
  1306. type="audioLine"
  1307. :attrib="attrib"
  1308. @emptyEd="emptyEd"
  1309. />
  1310. </template>
  1311. </div>
  1312. <div class="aduioLine-right">
  1313. <SvgIcon
  1314. v-if="config.isHasPY"
  1315. icon-class="pin-btn"
  1316. size="16"
  1317. :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
  1318. :style="{ color: config.isShowPY ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
  1319. @click="changePinyin"
  1320. />
  1321. <SvgIcon
  1322. v-if="config.isHasEN"
  1323. icon-class="en-btn"
  1324. size="16"
  1325. :class="['EN-16', config.isShowEN ? '' : 'disabled']"
  1326. :style="{ color: config.isShowEN ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
  1327. @click="changeEN"
  1328. />
  1329. </div>
  1330. </div>
  1331. <template v-if="isNoteShow">
  1332. <div
  1333. ref="notecard"
  1334. class="NNPE-noteDetail"
  1335. :style="{
  1336. marginLeft: windowWidth > 642 ? '-321px' : '0px',
  1337. left: windowWidth > 642 ? '' : '0px',
  1338. width: isMobile ? '100%' : '',
  1339. }"
  1340. >
  1341. <Notecard :item="curNoteCon" :change-card="changeCard" :attrib="attrib" :is-mobile="isMobile" />
  1342. </div>
  1343. </template>
  1344. </div>
  1345. </template>
  1346. <script>
  1347. import AudioLine from '../voice_matrix/components/AudioLine.vue';
  1348. import Notecard from './components/Notecard.vue';
  1349. import RemarkChs from '../dialogue_article/RemarkChs.vue';
  1350. export default {
  1351. name: 'NormalModelChs',
  1352. components: {
  1353. AudioLine,
  1354. Notecard,
  1355. RemarkChs,
  1356. },
  1357. props: [
  1358. 'curQue',
  1359. 'noFont',
  1360. 'config',
  1361. 'NNPEAnnotationList',
  1362. 'colLength',
  1363. 'themeColor',
  1364. 'multilingual',
  1365. 'attrib',
  1366. 'isMobile',
  1367. ],
  1368. inject: ['convertText'],
  1369. data() {
  1370. return {
  1371. resArr: [],
  1372. resObj: null,
  1373. curTime: 0, // 单位s
  1374. chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '#', '、'],
  1375. enFhList: [',', '.', ';', '?', '!', ':', '>', '<'],
  1376. NumberList: ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳'],
  1377. newWords: ['鱼', '辩礼义'],
  1378. oldHz: '',
  1379. hz: '',
  1380. top: 0,
  1381. left: 0,
  1382. articleImg: {}, // 文章图片
  1383. paraIndex: -1, // 段落索引
  1384. sentIndex: -1, // 句子索引
  1385. ed: undefined,
  1386. noteNum: '',
  1387. curNoteCon: null,
  1388. isNoteShow: false,
  1389. oldNoteNum: '',
  1390. clientY: 0,
  1391. contentWidth: 732,
  1392. windowWidth: window.innerWidth,
  1393. isHasRemark: false,
  1394. };
  1395. },
  1396. computed: {
  1397. isPlaying() {
  1398. let playing = false;
  1399. if (this.$refs.audioLine) {
  1400. playing = this.$refs.audioLine.audio.isPlaying;
  1401. }
  1402. return playing;
  1403. },
  1404. },
  1405. watch: {
  1406. noteNum: {
  1407. handler(val) {
  1408. let _this = this;
  1409. if (val) {
  1410. _this.handleNote(val);
  1411. }
  1412. },
  1413. // 深度观察监听
  1414. deep: true,
  1415. },
  1416. isNoteShow: {
  1417. handler(val) {
  1418. let _this = this;
  1419. if (val) {
  1420. setTimeout(() => {
  1421. _this.cardHeight = _this.$refs.notecard.offsetHeight;
  1422. if (_this.screenHeight - _this.clientY > _this.cardHeight) {
  1423. _this.top = _this.clientY + 20;
  1424. } else {
  1425. _this.top = _this.clientY - _this.cardHeight - 30;
  1426. }
  1427. }, 50);
  1428. }
  1429. },
  1430. // 深度观察监听
  1431. deep: true,
  1432. },
  1433. curQue: {
  1434. handler(val) {
  1435. if (val) {
  1436. this.handleData();
  1437. }
  1438. },
  1439. // 深度观察监听
  1440. deep: true,
  1441. },
  1442. },
  1443. // 生命周期 - 创建完成(可以访问当前this实例)
  1444. created() {},
  1445. // 生命周期 - 挂载完成(可以访问DOM元素)
  1446. mounted() {
  1447. if (this.curQue) {
  1448. this.handleData();
  1449. }
  1450. },
  1451. beforeCreate() {}, // 生命周期 - 创建之前
  1452. beforeMount() {}, // 生命周期 - 挂载之前
  1453. beforeUpdate() {}, // 生命周期 - 更新之前
  1454. updated() {}, // 生命周期 - 更新之后
  1455. beforeDestroy() {}, // 生命周期 - 销毁之前
  1456. destroyed() {}, // 生命周期 - 销毁完成
  1457. activated() {},
  1458. // 方法集合
  1459. methods: {
  1460. // 拼音的显示和隐藏
  1461. changePinyin() {
  1462. if (this.config.isHasPY) {
  1463. this.$emit('changeConfig', 'isShowPY');
  1464. }
  1465. },
  1466. // 英文的显示和隐藏
  1467. changeEN() {
  1468. if (this.config.isHasEN) {
  1469. this.$emit('changeConfig', 'isShowEN');
  1470. }
  1471. },
  1472. getCurTime(curTime) {
  1473. this.curTime = curTime * 1000;
  1474. this.getSentIndex(this.curTime);
  1475. },
  1476. getSentIndex(curTime) {
  1477. if (this.curQue.wordTime) {
  1478. for (let i = 0; i < this.curQue.wordTime.length; i++) {
  1479. let bg = this.curQue.wordTime[i].bg;
  1480. let ed = this.curQue.wordTime[i].ed;
  1481. if (curTime >= bg && curTime <= ed) {
  1482. this.sentIndex = i;
  1483. break;
  1484. }
  1485. }
  1486. }
  1487. },
  1488. handleData() {
  1489. let resArr = [];
  1490. let curQue = JSON.parse(JSON.stringify(this.curQue));
  1491. let wordTimeList = curQue.wordTime;
  1492. let asIndex = 0;
  1493. let dhaspinyin = false; // 每段是否有拼音
  1494. this.isHasRemark = false;
  1495. curQue.detail.forEach((dItem, dIndex) => {
  1496. dhaspinyin = false;
  1497. let remarkDetail = dItem.remark;
  1498. if (
  1499. remarkDetail &&
  1500. (remarkDetail.chs || remarkDetail.en || (remarkDetail.img_list && remarkDetail.img_list.length > 0))
  1501. ) {
  1502. this.isHasRemark = true;
  1503. }
  1504. let paraArr = [];
  1505. if (dItem.paraAlign !== 'center') {
  1506. paraArr = [
  1507. {
  1508. pinyin: '',
  1509. chs: '',
  1510. width: 20,
  1511. height: 20,
  1512. },
  1513. {
  1514. width: 20,
  1515. height: 20,
  1516. pinyin: '',
  1517. chs: '',
  1518. },
  1519. ];
  1520. }
  1521. dItem.wordsList.forEach((sItem, sIndex) => {
  1522. let sentArr = [];
  1523. sItem.forEach((wItem, wIndex) => {
  1524. let startIndex = wIndex === 0 ? 0 : sentArr[wIndex - 1].startIndex + sentArr[wIndex - 1].chs.length;
  1525. let endIndex = wIndex === 0 ? wItem.chs.length : sentArr[wIndex - 1].endIndex + wItem.chs.length;
  1526. this.mergeWordSymbol(wItem);
  1527. let obj = {
  1528. paraIndex: dIndex, // 段落索引
  1529. sentIndex: sIndex, // 在段落中句子索引
  1530. articleSentIndex: asIndex, // 在文章中句子索引
  1531. wordIndex: wIndex, // 单词的索引
  1532. pinyin:
  1533. curQue.pinyin_type === 'pinyin'
  1534. ? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
  1535. ? wItem.pinyin_up
  1536. : wItem.pinyin
  1537. : wItem.pinyin_tone,
  1538. chs: wItem.chs,
  1539. padding: true, // wItem.padding,
  1540. className: wItem.className,
  1541. isShow: wItem.isShow,
  1542. isNewWord: this.newWords.indexOf(wItem.chs) > -1,
  1543. startIndex,
  1544. endIndex,
  1545. leg: wItem.chs.length,
  1546. config: {
  1547. fontFamily: wItem.fontFamily,
  1548. color: wItem.color,
  1549. textDecoration: wItem.textDecoration,
  1550. border: wItem.border,
  1551. fontWeight: wItem.fontWeight,
  1552. },
  1553. matchWords: wItem.matchWords,
  1554. matchNotes: wItem.matchNotes,
  1555. notesColor: wItem.notesColor,
  1556. img: wItem.img,
  1557. imgPosition: wItem.imgPosition,
  1558. };
  1559. if (wordTimeList && wordTimeList.length > 0) {
  1560. obj.chstimeList = wordTimeList[asIndex].wordsResultList.slice(startIndex, endIndex);
  1561. }
  1562. sentArr.push(obj);
  1563. paraArr.push(obj);
  1564. if (wIndex === sItem.length - 1) {
  1565. asIndex += 1;
  1566. }
  1567. if (wItem.pinyin) dhaspinyin = true;
  1568. });
  1569. });
  1570. let curSentencesLeg = dItem.sentences.length;
  1571. let startLeg = dIndex === 0 ? 0 : curQue.detail[dIndex - 1].endLeg;
  1572. let endLeg = startLeg + curSentencesLeg;
  1573. dItem.endLeg = endLeg;
  1574. let timeList = curQue.wordTime ? curQue.wordTime.slice(startLeg, endLeg) : [];
  1575. let paraObj = {
  1576. wordsList: paraArr,
  1577. timeList,
  1578. isTitle: dItem.isTitle,
  1579. dhaspinyin,
  1580. enwords: dItem.sentencesEn ? dItem.sentencesEn : [],
  1581. paraAlign: dItem.paraAlign,
  1582. remarkDetail,
  1583. sourceList: dItem.sourceList ? dItem.sourceList : [],
  1584. sourcePosition: dItem.sourcePosition,
  1585. widthNumber: dItem.widthNumber,
  1586. heightNumber: dItem.heightNumber,
  1587. };
  1588. resArr.push(paraObj);
  1589. });
  1590. this.resArr = resArr;
  1591. // 循环文章图片
  1592. if (curQue.img_list) {
  1593. curQue.img_list.forEach((item) => {
  1594. this.articleImg[item.imgNumber] = item.id;
  1595. });
  1596. }
  1597. let resArrs = [];
  1598. let sentArrTotal = [];
  1599. let timeArr = [];
  1600. curQue.detail.forEach((dItem, dIndex) => {
  1601. dItem.wordsList.forEach((sItem, sIndex) => {
  1602. let sentArr = [];
  1603. sItem.forEach((wItem, wIndex) => {
  1604. let startIndex = wIndex === 0 ? 0 : sentArr[wIndex - 1].startIndex + sentArr[wIndex - 1].chs.length;
  1605. let endIndex = wIndex === 0 ? wItem.chs.length : sentArr[wIndex - 1].endIndex + wItem.chs.length;
  1606. // this.judgePad(sItem, wItem, wIndex);
  1607. this.mergeWordSymbol(wItem);
  1608. let obj = {
  1609. paraIndex: dIndex, // 段落索引
  1610. sentIndex: sIndex, // 在段落中句子索引
  1611. wordIndex: wIndex, // 单词的索引
  1612. pinyin:
  1613. curQue.pinyin_type === 'pinyin'
  1614. ? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
  1615. ? wItem.pinyin_up
  1616. : wItem.pinyin
  1617. : wItem.pinyin_tone,
  1618. chs: wItem.chs,
  1619. padding: true,
  1620. className: wItem.className,
  1621. isShow: wItem.isShow,
  1622. startIndex,
  1623. endIndex,
  1624. leg: wItem.chs.length,
  1625. timeList: [],
  1626. };
  1627. sentArr.push(obj);
  1628. });
  1629. let objs = {
  1630. sentArr,
  1631. enwords: dItem.sentencesEn && dItem.sentencesEn[sIndex] && dItem.sentencesEn[sIndex].replace(/'/g, '’'),
  1632. paraAlign: dItem.paraAlign,
  1633. sourceList: dItem.sourceList ? dItem.sourceList : [],
  1634. sourcePosition: dItem.sourcePosition,
  1635. widthNumber: dItem.widthNumber,
  1636. heightNumber: dItem.heightNumber,
  1637. };
  1638. sentArrTotal.push(sentArr);
  1639. resArrs.push(objs);
  1640. });
  1641. timeArr.push(dItem.timeList);
  1642. });
  1643. if (wordTimeList && wordTimeList.length > 0) {
  1644. this.mergeWordTime(sentArrTotal, wordTimeList);
  1645. }
  1646. let timeList = [];
  1647. timeArr.forEach((item) => {
  1648. item.forEach((aItem) => {
  1649. if (timeList.indexOf(aItem) < 0) {
  1650. timeList.push(aItem);
  1651. }
  1652. });
  1653. });
  1654. this.resObj = { sentList: resArrs, timeList };
  1655. },
  1656. mergeWordTime(resArr, wordTimeList) {
  1657. resArr.forEach((item, index) => {
  1658. let wordsResultList = wordTimeList[index].wordsResultList;
  1659. item.forEach((wItem) => {
  1660. let startIndex = wItem.startIndex;
  1661. let endIndex = wItem.endIndex;
  1662. wItem.timeList = wordsResultList.slice(startIndex, endIndex);
  1663. });
  1664. });
  1665. },
  1666. // 词和标点合一起
  1667. mergeWordSymbol(wItem) {
  1668. if (this.chsFhList.indexOf(wItem.chs) > -1 || this.NumberList.indexOf(wItem.chs) > -1) {
  1669. wItem.isShow = false;
  1670. } else {
  1671. wItem.isShow = true;
  1672. }
  1673. },
  1674. // 判断是否有padding
  1675. judgePad(sItem, wItem, curIndex) {
  1676. let leg = sItem.length;
  1677. if (curIndex < leg - 1) {
  1678. let nextIndex = curIndex + 1;
  1679. let chs = sItem[nextIndex].chs;
  1680. if (this.chsFhList.indexOf(chs) > -1 || this.chsFhList.indexOf(wItem.chs) > -1) {
  1681. wItem.padding = false;
  1682. } else {
  1683. wItem.padding = true;
  1684. }
  1685. if (this.enFhList.indexOf(wItem.pinyin) > -1) {
  1686. wItem.className = 'textLeft';
  1687. }
  1688. }
  1689. },
  1690. // 点击播放某个句子
  1691. handleChangeTime(time, ed, index) {
  1692. this.sentIndex = index;
  1693. if (time) {
  1694. this.curTime = time;
  1695. this.$refs.audioLine.onTimeupdateTime(time / 1000, true);
  1696. this.ed = ed;
  1697. }
  1698. },
  1699. emptyEd() {
  1700. this.ed = undefined;
  1701. },
  1702. // 经过每个词,高亮句子
  1703. handleMouseover(pItem) {
  1704. this.paraIndex = pItem.paraIndex;
  1705. this.sentIndex = pItem.sentIndex;
  1706. },
  1707. handleMouseleave() {
  1708. this.paraIndex = -1;
  1709. this.sentIndex = -1;
  1710. },
  1711. viewNotes(e, noteNum, time, ed, index, words) {
  1712. let _this = this;
  1713. let noteIndex = '';
  1714. if (_this.NumberList.indexOf(noteNum) > -1) {
  1715. for (let i = 0; i < _this.NumberList.length; i++) {
  1716. if (_this.NumberList[i] === noteNum) {
  1717. noteIndex = `${String(i)}`;
  1718. break;
  1719. }
  1720. }
  1721. } else if (words.matchNotes) {
  1722. // 关联了注释
  1723. if (_this.NNPEAnnotationList && _this.NNPEAnnotationList.length > 0) {
  1724. _this.NNPEAnnotationList.forEach((item, indexs) => {
  1725. let textContent = item.con.replace(/<[^>]*>?/gm, '');
  1726. if (textContent === words.matchNotes.trim()) {
  1727. noteIndex = `${String(indexs)}`;
  1728. }
  1729. });
  1730. }
  1731. } else {
  1732. _this.handleChangeTime(time, ed, index);
  1733. }
  1734. if (noteIndex) {
  1735. this.showNoteDetail(e, noteIndex);
  1736. }
  1737. },
  1738. showNoteDetail(e, noteNum) {
  1739. let _this = this;
  1740. // if (_this.oldNoteNum != noteNum) {
  1741. this.isNoteShow = false;
  1742. setTimeout(() => {
  1743. _this.noteNum = noteNum;
  1744. }, 50);
  1745. // }
  1746. _this.clientY = e.clientY;
  1747. let left = e.clientX;
  1748. let width = 642;
  1749. if (left - this.bodyLeft > this.contentWidth / 2) {
  1750. _this.left = 500;
  1751. } else if (left - 200 > 500) {
  1752. _this.left = 500;
  1753. } else {
  1754. _this.left = left - 200;
  1755. }
  1756. if (_this.oldNoteNum === noteNum) {
  1757. _this.handleNote(noteNum);
  1758. }
  1759. },
  1760. // 处理分词数据
  1761. handleNote(val) {
  1762. let _this = this;
  1763. _this.isNoteShow = true;
  1764. _this.oldNoteNum = val;
  1765. let noteIndex = Number(val);
  1766. if (_this.NNPEAnnotationList && _this.NNPEAnnotationList.length > 0) {
  1767. _this.curNoteCon = _this.NNPEAnnotationList[noteIndex] ? _this.NNPEAnnotationList[noteIndex] : null;
  1768. }
  1769. },
  1770. changeCard(isShow) {
  1771. let _this = this;
  1772. _this.isNoteShow = isShow;
  1773. _this.oldNoteNum = '';
  1774. _this.noteNum = '';
  1775. },
  1776. }, // 如果页面有keep-alive缓存功能,这个函数会触发
  1777. };
  1778. </script>
  1779. <style lang="scss" scoped>
  1780. .NNPE-ArticleView {
  1781. width: 100%;
  1782. .aduioLine-practice-npc {
  1783. display: flex;
  1784. align-items: center;
  1785. justify-content: flex-start;
  1786. .aduioLine-content {
  1787. flex: 1;
  1788. }
  1789. .aduioLine-right {
  1790. box-sizing: border-box;
  1791. display: flex;
  1792. align-items: center;
  1793. justify-content: space-between;
  1794. width: 69px;
  1795. height: 40px;
  1796. padding: 0 12px;
  1797. border-left: 1px solid rgba(0, 0, 0, 10%);
  1798. .svg-icon {
  1799. width: 16px;
  1800. height: 16px;
  1801. cursor: pointer;
  1802. }
  1803. }
  1804. }
  1805. .NPC-sentences-list {
  1806. overflow: auto;
  1807. // padding: 24px 0;
  1808. color: rgba(0, 0, 0, 85%);
  1809. .NPC-article-empty {
  1810. display: flex;
  1811. align-items: flex-start;
  1812. justify-content: flex-start;
  1813. > div {
  1814. height: 24px;
  1815. &.empty-left {
  1816. box-sizing: border-box;
  1817. width: 100%;
  1818. &.hasRemark {
  1819. box-sizing: border-box;
  1820. width: 70%;
  1821. border-right: 1px rgba(0, 0, 0, 10%) solid;
  1822. }
  1823. }
  1824. &.empty-right {
  1825. flex: 1;
  1826. }
  1827. }
  1828. &-bottom {
  1829. > div {
  1830. height: 40px;
  1831. }
  1832. }
  1833. }
  1834. }
  1835. .NNPE-detail {
  1836. // overflow: hidden; // 为了不遮挡备注内容
  1837. display: flex;
  1838. align-items: flex-start;
  1839. justify-content: flex-start;
  1840. clear: both;
  1841. .para-center {
  1842. display: flex;
  1843. flex-flow: wrap;
  1844. justify-content: center;
  1845. width: 100%;
  1846. }
  1847. .para-right {
  1848. display: flex;
  1849. flex-flow: wrap;
  1850. justify-content: end;
  1851. width: 100%;
  1852. }
  1853. .NNPE-words {
  1854. float: left;
  1855. padding-bottom: 5px;
  1856. &-box {
  1857. float: left;
  1858. > span {
  1859. display: block;
  1860. &.NNPE-pinyin {
  1861. height: 22px;
  1862. font-family: 'League';
  1863. font-size: 14px;
  1864. font-weight: normal;
  1865. line-height: 1.5;
  1866. color: #000;
  1867. &.noFont {
  1868. font-family: initial;
  1869. }
  1870. &.textLeft {
  1871. text-align: left;
  1872. }
  1873. &.textRight {
  1874. text-align: right;
  1875. }
  1876. }
  1877. &.NNPE-chs {
  1878. display: flex;
  1879. flex-flow: wrap;
  1880. align-items: center;
  1881. font-family: '楷体';
  1882. font-size: 20px;
  1883. line-height: 1.4;
  1884. color: #000;
  1885. &.overActive {
  1886. background: rgba(0, 0, 0, 6%);
  1887. }
  1888. &.active {
  1889. background: rgba(222, 68, 68, 15%);
  1890. }
  1891. &.wordActive {
  1892. color: rgba(222, 68, 68, 100%);
  1893. }
  1894. .wordActive {
  1895. color: rgba(222, 68, 68, 100%);
  1896. }
  1897. }
  1898. &.padding {
  1899. padding: 0 3px;
  1900. }
  1901. }
  1902. }
  1903. &.textLeft {
  1904. text-align: left;
  1905. }
  1906. &.textCenter {
  1907. text-align: center;
  1908. .NNPE-chs {
  1909. justify-content: center;
  1910. }
  1911. }
  1912. &.textRight {
  1913. text-align: right;
  1914. }
  1915. > span {
  1916. display: block;
  1917. &.NNPE-pinyin {
  1918. height: 22px;
  1919. font-family: 'League';
  1920. font-size: 14px;
  1921. font-weight: normal;
  1922. line-height: 1.5;
  1923. color: #000;
  1924. &.noFont {
  1925. font-family: initial;
  1926. }
  1927. &.textLeft {
  1928. text-align: left;
  1929. }
  1930. &.textRight {
  1931. text-align: right;
  1932. }
  1933. }
  1934. &.NNPE-chs {
  1935. display: flex;
  1936. flex-flow: wrap;
  1937. align-items: center;
  1938. font-family: '楷体';
  1939. font-size: 20px;
  1940. line-height: 1.4;
  1941. color: #000;
  1942. &.overActive {
  1943. background: rgba(0, 0, 0, 6%);
  1944. }
  1945. &.active {
  1946. background: rgba(222, 68, 68, 15%);
  1947. }
  1948. &.wordActive {
  1949. color: rgba(222, 68, 68, 100%);
  1950. }
  1951. .wordActive {
  1952. color: rgba(222, 68, 68, 100%);
  1953. }
  1954. }
  1955. &.padding {
  1956. padding: 0 3px;
  1957. }
  1958. }
  1959. }
  1960. &.NNPE-detail-title {
  1961. .NNPE-title {
  1962. margin: 0 auto;
  1963. }
  1964. .wordsList-box {
  1965. > div {
  1966. display: flex;
  1967. flex-flow: wrap;
  1968. justify-content: center;
  1969. }
  1970. }
  1971. }
  1972. .index {
  1973. box-sizing: border-box;
  1974. width: 48px;
  1975. padding: 8px;
  1976. text-align: right;
  1977. border-right: 1px solid rgba(0, 0, 0, 10%);
  1978. b {
  1979. font-weight: 400;
  1980. line-height: 1.5;
  1981. color: #000;
  1982. }
  1983. }
  1984. .wordsList-box {
  1985. // display: flex;
  1986. width: 100%;
  1987. padding: 6px 24px 12px;
  1988. &-left {
  1989. justify-content: flex-start;
  1990. }
  1991. &-center {
  1992. justify-content: center;
  1993. }
  1994. &-right {
  1995. justify-content: flex-end;
  1996. }
  1997. > div {
  1998. overflow: hidden;
  1999. clear: both;
  2000. }
  2001. > img {
  2002. display: block;
  2003. max-width: 100%;
  2004. margin: 0 auto;
  2005. }
  2006. }
  2007. .article-content {
  2008. box-sizing: border-box;
  2009. // display: flex;
  2010. // align-items: flex-start;
  2011. // justify-content: flex-start;
  2012. width: 100%;
  2013. &.hasRemark {
  2014. width: 70%;
  2015. padding: 8px 0 8px 23px;
  2016. border-right: 1px rgba(0, 0, 0, 10%) solid;
  2017. }
  2018. &.paraLast {
  2019. padding-bottom: 24px;
  2020. }
  2021. }
  2022. }
  2023. .remarkBox {
  2024. position: relative;
  2025. display: flex;
  2026. flex: 1;
  2027. align-items: center;
  2028. justify-content: center;
  2029. &.remark72 {
  2030. padding-top: 72px;
  2031. }
  2032. &.remark-top {
  2033. padding-top: 44px;
  2034. }
  2035. &.remark-top-8 {
  2036. padding-top: 8px;
  2037. }
  2038. }
  2039. .NNPE-noteDetail {
  2040. position: fixed;
  2041. top: 50%;
  2042. left: 50%;
  2043. z-index: 9999;
  2044. max-width: 100%;
  2045. margin-top: -196px;
  2046. overflow: auto;
  2047. // box-shadow: 0 4px 16px rgba(0, 0, 0, 15%);
  2048. }
  2049. .NNPE-detail-box {
  2050. box-sizing: border-box;
  2051. width: 100%;
  2052. padding: 8px 24px;
  2053. margin-bottom: 8px;
  2054. &.active {
  2055. background: rgba(222, 68, 68, 15%);
  2056. }
  2057. }
  2058. .NNPE-details {
  2059. overflow: hidden;
  2060. clear: both;
  2061. .NNPE-words {
  2062. float: left;
  2063. &-box {
  2064. float: left;
  2065. > span {
  2066. display: block;
  2067. &.NNPE-pinyin {
  2068. height: 20px;
  2069. font-family: 'League';
  2070. font-size: 14px;
  2071. font-weight: normal;
  2072. line-height: 20px;
  2073. color: rgba(0, 0, 0, 100%);
  2074. &.noFont {
  2075. font-family: initial;
  2076. }
  2077. &.textLeft {
  2078. text-align: left;
  2079. }
  2080. &.wordBlank {
  2081. color: rgba(0, 0, 0, 100%);
  2082. }
  2083. }
  2084. &.NNPE-chs {
  2085. display: flex;
  2086. flex-flow: wrap;
  2087. align-items: center;
  2088. font-family: '楷体';
  2089. font-size: 20px;
  2090. line-height: 28px;
  2091. color: rgba(0, 0, 0, 100%);
  2092. .active {
  2093. color: #de4444;
  2094. }
  2095. &.wordBlank {
  2096. color: rgba(0, 0, 0, 100%);
  2097. }
  2098. }
  2099. // &.padding {
  2100. // padding-right: 6px;
  2101. // }
  2102. }
  2103. }
  2104. &.textLeft {
  2105. text-align: left;
  2106. }
  2107. &.textCenter {
  2108. text-align: center;
  2109. .NNPE-chs {
  2110. justify-content: center;
  2111. }
  2112. }
  2113. &.textRight {
  2114. text-align: right;
  2115. }
  2116. > span {
  2117. display: block;
  2118. &.NNPE-pinyin {
  2119. height: 20px;
  2120. font-family: 'League';
  2121. font-size: 14px;
  2122. font-weight: normal;
  2123. line-height: 20px;
  2124. color: rgba(0, 0, 0, 100%);
  2125. &.noFont {
  2126. font-family: initial;
  2127. }
  2128. &.textLeft {
  2129. text-align: left;
  2130. }
  2131. &.wordBlank {
  2132. color: rgba(0, 0, 0, 100%);
  2133. }
  2134. }
  2135. &.NNPE-chs {
  2136. display: flex;
  2137. flex-flow: wrap;
  2138. align-items: center;
  2139. font-family: '楷体';
  2140. font-size: 20px;
  2141. line-height: 28px;
  2142. color: rgba(0, 0, 0, 100%);
  2143. .active {
  2144. color: #de4444;
  2145. }
  2146. &.wordBlank {
  2147. color: rgba(0, 0, 0, 100%);
  2148. }
  2149. }
  2150. &.padding {
  2151. padding: 0 3px;
  2152. }
  2153. }
  2154. }
  2155. }
  2156. .enwords {
  2157. padding-left: 3px;
  2158. font-family: 'Helvetica';
  2159. font-size: 14px;
  2160. font-weight: normal;
  2161. line-height: 22px;
  2162. color: rgba(0, 0, 0, 100%);
  2163. word-break: break-word;
  2164. &.wordBlank {
  2165. color: rgba(0, 0, 0, 100%);
  2166. }
  2167. }
  2168. .multilingual {
  2169. padding: 6px 24px 12px;
  2170. word-break: break-word;
  2171. }
  2172. .multilingual-para {
  2173. text-indent: 40px;
  2174. word-break: break-word;
  2175. &-center,
  2176. &.multilingual-center {
  2177. text-align: center;
  2178. text-indent: 0;
  2179. }
  2180. &.multilingual-right {
  2181. text-align: right;
  2182. }
  2183. }
  2184. }
  2185. </style>