Practicechs.vue 55 KB

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