PhraseModelChs.vue 54 KB

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