Voicefullscreen.vue 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994
  1. <!-- -->
  2. <template>
  3. <div v-if="sentList" :class="['voicefull', bgIndex == 0 ? 'bg1' : 'bg2']">
  4. <div class="voicefull-top" @mouseover="setTopShow(true)" @mouseleave="setTopShow(false)">
  5. <div :class="[isTopShow ? 'voicefull-top-show' : 'voicefull-top-hidden']">
  6. <div class="top-left">
  7. <div :class="['select-bg', bgIndex == 1 ? 'select-bg-blue' : '']">
  8. <div :class="['bg-green-box', bgIndex == 1 ? 'active' : '']">
  9. <span :class="['bg-green', bgIndex == 1 ? 'active' : '']" @click="changeBg(1)"></span>
  10. </div>
  11. <div :class="['bg-white-box', bgIndex == 0 ? 'active' : '']">
  12. <span :class="['bg-white', bgIndex == 0 ? 'active' : '']" @click="changeBg(0)"></span>
  13. </div>
  14. </div>
  15. <div :class="['set-fontSize', bgIndex == 1 ? 'set-fontSize-green' : '']">
  16. <template v-if="hzSize >= 34">
  17. <span
  18. :class="['font-jian-black', bgIndex == 1 ? 'font-jian-yellow' : '']"
  19. @click="setFontSize('-')"
  20. ></span>
  21. </template>
  22. <template v-else>
  23. <span
  24. :class="['font-jian-black', bgIndex == 1 ? 'font-jian-yellow-disabled' : 'font-jian-white-disabled']"
  25. ></span>
  26. </template>
  27. <span :class="['font-img-black', bgIndex == 1 ? 'font-img-yellow' : '']"></span>
  28. <template v-if="hzSize <= 76">
  29. <span :class="['font-jia-black', bgIndex == 1 ? 'font-jia-yellow' : '']" @click="setFontSize('+')"></span>
  30. </template>
  31. <template v-else>
  32. <span
  33. :class="['font-jia-black', bgIndex == 1 ? 'font-jia-yellow-disabled' : 'font-jia-white-disabled']"
  34. ></span>
  35. </template>
  36. </div>
  37. <div
  38. :class="['op-btn', bgIndex == 1 ? 'op-btn-green' : '']"
  39. title="键盘控制开启后,可用方向键控制翻页,空格键播放暂停,回车键录音"
  40. @click="changeStatus('isKeyboard')"
  41. >
  42. <span
  43. :class="[
  44. 'keyboard-icon',
  45. !isKeyboard ? 'disabled' : '',
  46. isKeyboard && bgIndex == 1 ? 'keyboard-icon-yellow' : '',
  47. ]"
  48. ></span>
  49. </div>
  50. </div>
  51. <div class="top-middle">
  52. <template v-if="mp3">
  53. <AudioLineSentence
  54. :key="'sent' + curSentIndex"
  55. ref="audioLineSent"
  56. :mp3="mp3"
  57. :get-cur-time="getCurTime"
  58. :audio-id="'artPraAudioId' + curSentIndex"
  59. :stop-audio="stopAudio"
  60. :width="120"
  61. :hide-slider="true"
  62. :bg="bg"
  63. :ed="ed"
  64. :cur-time="curTime"
  65. :max-time="maxTime"
  66. :bg-index="bgIndex"
  67. :is-repeat="isRepeat"
  68. :is-auto="isAuto"
  69. @playChange="playChange"
  70. @rollSentence="rollSentence"
  71. />
  72. </template>
  73. <div :class="['op-btn', bgIndex == 1 ? 'op-btn-green' : '']" @click="setStatus">
  74. <span
  75. :class="[
  76. 'repeat-icon',
  77. !isRepeat && !isAuto ? 'disabled' : '',
  78. !isRepeat && isAuto ? 'auto-icon' : '',
  79. isRepeat && bgIndex == 1 ? 'repeat-icon-yellow' : '',
  80. !isRepeat && isAuto && bgIndex == 1 ? 'auto-icon-yellow' : '',
  81. ]"
  82. ></span>
  83. </div>
  84. <div :class="['op-btn', bgIndex == 1 ? 'op-btn-green' : '']" @click="changePinyin">
  85. <span
  86. :class="[
  87. 'pinyin-icon',
  88. !config.isShowPY ? 'disabled' : '',
  89. config.isShowPY && bgIndex == 1 ? 'pinyin-icon-yellow' : '',
  90. ]"
  91. ></span>
  92. </div>
  93. <div :class="['op-btn', bgIndex == 1 ? 'op-btn-green' : '']" @click="changeEN">
  94. <span
  95. :class="[
  96. 'en-icon',
  97. !enwords ? 'disabled' : '',
  98. !config.isShowEN ? 'disabled' : '',
  99. config.isShowEN && bgIndex == 1 ? 'en-icon-yellow' : '',
  100. ]"
  101. ></span>
  102. </div>
  103. <div
  104. :class="['op-btn', bgIndex == 1 ? 'op-btn-green' : '']"
  105. title="点击收藏后可在“个人中心”-“我的收藏”查看"
  106. @click="handleColl"
  107. >
  108. <span
  109. :class="[
  110. 'coll-icon',
  111. !isCollArr[curSentIndex] ? 'disabled' : '',
  112. isCollArr[curSentIndex] && bgIndex == 1 ? 'coll-icon-yellow' : '',
  113. ]"
  114. ></span>
  115. </div>
  116. </div>
  117. <div :class="['op-btn', bgIndex == 1 ? 'op-btn-green' : '']" @click="exitFullScreen">
  118. <span :class="['close-icon', bgIndex == 1 ? 'close-icon-white' : '']"></span>
  119. </div>
  120. </div>
  121. </div>
  122. <div v-if="item" class="voicefull-content">
  123. <div class="vc-box" @mousemove="showPrevNext(true, 'isShowLeft')" @mouseleave="showPrevNext(false, 'isShowLeft')">
  124. <div
  125. :class="[
  126. 'vc-left vc-left-grey',
  127. isShowLeft && bgIndex == 0 ? 'vc-left-black' : '',
  128. isShowLeft && bgIndex == 1 ? 'vc-left-white' : '',
  129. curSentIndex == 0 ? 'hidden' : '',
  130. ]"
  131. @click="prevSentence"
  132. ></div>
  133. </div>
  134. <div class="vc-main">
  135. <div class="NNPE-words-box">
  136. <div style="overflow: hidden; clear: both"></div>
  137. <div
  138. v-if="enwords && config.isShowEN && curQue.enPosition && curQue.enPosition == 'top'"
  139. :class="['enwords', bgIndex == 1 ? 'enwords-green' : '']"
  140. :style="{ fontSize: enSize + 'px' }"
  141. >
  142. {{ enwords }}
  143. </div>
  144. <div
  145. v-for="(pItem, pIndex) in item"
  146. :key="'wordsList' + pIndex"
  147. class="NNPE-words"
  148. :class="[
  149. pItem.chs != '“' && pItem.wordIndex == 0 ? 'textLeft' : 'textCenter',
  150. pItem.chs == '“' ? 'textRight' : '',
  151. ]"
  152. @dblclick="showWordDetail($event, pItem)"
  153. @click="playWord(pItem)"
  154. >
  155. <template v-if="NumberList.indexOf(pItem.chs) == -1">
  156. <template v-if="!pItem.width">
  157. <template v-if="pItem.isShow">
  158. <template
  159. v-if="item[pIndex + 1] && item[pIndex + 1].chs && chsFhList.indexOf(item[pIndex + 1].chs) > -1"
  160. >
  161. <span class="NNPE-words-box">
  162. <template v-if="curQue.property.pinyin_position == 'top'">
  163. <span
  164. v-if="config.isShowPY"
  165. class="NNPE-pinyin"
  166. :class="[
  167. pItem.className ? pItem.className : '',
  168. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  169. bgIndex == 1 ? 'font-white' : '',
  170. ]"
  171. :style="{
  172. fontSize: pySize + 'px',
  173. height: pySize * 1.25 + 'px',
  174. }"
  175. >{{ pItem.pinyin }}</span
  176. >
  177. </template>
  178. <span
  179. class="NNPE-chs"
  180. :class="[
  181. pItem.padding && config.isShowPY ? 'padding' : '',
  182. curQue.property.pinyin_position == 'top' ? 'bottom' : '',
  183. ]"
  184. :style="{
  185. height: hzSize * 1.17 + 'px',
  186. }"
  187. >
  188. <template>
  189. <span
  190. v-for="(wItem, wIndex) in pItem.leg"
  191. :key="'ci' + wIndex + pIndex"
  192. :class="[
  193. pItem.timeList &&
  194. pItem.timeList[wIndex] &&
  195. curTime >= pItem.timeList[wIndex].wordBg &&
  196. curQue.wordTime &&
  197. curQue.wordTime[curSentIndex] &&
  198. curTime <= curQue.wordTime[curSentIndex].ed
  199. ? bgIndex == 0
  200. ? 'active'
  201. : 'active-yellow'
  202. : '',
  203. bgIndex == 1 ? 'font-white' : '',
  204. bgIndex == 0 && wordIndex == pItem.wordIndex ? 'wordActive' : '',
  205. bgIndex == 1 && wordIndex == pItem.wordIndex ? 'wordActive-blue' : '',
  206. newWordList.indexOf(pItem.chs) > -1 && !isPlaying ? 'newActive' : '',
  207. pItem.words && !isPlaying ? 'newActive' : '',
  208. ]"
  209. :style="{
  210. fontSize: hzSize + 'px',
  211. fontFamily: pItem.config && pItem.config.fontFamily ? pItem.config.fontFamily : '',
  212. height: hzSize * 1.17 + 'px',
  213. display: 'inline-block',
  214. width: pItem.chs[wIndex].trim() === '' ? '10px' : '',
  215. }"
  216. >{{ pItem.chs[wIndex] }}</span
  217. >
  218. </template>
  219. </span>
  220. <template v-if="curQue.property.pinyin_position == 'bottom'">
  221. <span
  222. v-if="config.isShowPY"
  223. class="NNPE-pinyin bottom"
  224. :class="[
  225. pItem.className ? pItem.className : '',
  226. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  227. bgIndex == 1 ? 'font-white' : '',
  228. ]"
  229. :style="{
  230. fontSize: pySize + 'px',
  231. height: pySize * 1.25 + 'px',
  232. }"
  233. >{{ pItem.pinyin }}</span
  234. >
  235. </template>
  236. </span>
  237. <span class="NNPE-words-box">
  238. <template v-if="curQue.property.pinyin_position == 'top'">
  239. <span
  240. v-if="config.isShowPY"
  241. :class="[
  242. 'NNPE-pinyin',
  243. noFont.indexOf(item[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  244. bgIndex == 1 ? 'font-white' : '',
  245. ]"
  246. :style="{
  247. fontSize: pySize + 'px',
  248. textAlign: left,
  249. height: pySize * 1.25 + 'px',
  250. }"
  251. >{{ item[pIndex + 1].pinyin }}</span
  252. >
  253. </template>
  254. <span
  255. :class="['NNPE-chs', curQue.property.pinyin_position == 'top' ? 'bottom' : '']"
  256. :style="{
  257. fontSize: hzSize + 'px',
  258. textAlign: left,
  259. height: hzSize * 1.17 + 'px',
  260. }"
  261. >
  262. <span
  263. :class="[
  264. pItem.timeList[pItem.leg - 1] &&
  265. curTime >= pItem.timeList[pItem.leg - 1].wordBg &&
  266. curQue.wordTime &&
  267. curQue.wordTime[curSentIndex] &&
  268. curTime <= curQue.wordTime[curSentIndex].ed
  269. ? bgIndex == 0
  270. ? 'active'
  271. : 'active-yellow'
  272. : '',
  273. bgIndex == 1 ? 'font-white' : '',
  274. newWordList.indexOf(item[pIndex + 1].chs) > -1 && !isPlaying ? 'newActive' : '',
  275. item[pIndex + 1].words && !isPlaying ? 'newActive' : '',
  276. ]"
  277. :style="{
  278. fontSize: hzSize + 'px',
  279. fontFamily:
  280. item[pIndex + 1].config && item[pIndex + 1].config.fontFamily
  281. ? item[pIndex + 1].config.fontFamily
  282. : '',
  283. height: hzSize * 1.17 + 'px',
  284. display: 'inline-block',
  285. width: item[pIndex + 1].chs.trim() === '' ? '10px' : '',
  286. }"
  287. >{{ item[pIndex + 1].chs }}</span
  288. >
  289. </span>
  290. <template v-if="curQue.property.pinyin_position == 'bottom'">
  291. <span
  292. v-if="config.isShowPY"
  293. :class="[
  294. 'NNPE-pinyin',
  295. noFont.indexOf(item[pIndex + 1].pinyin) > -1 ? 'noFont' : '',
  296. bgIndex == 1 ? 'font-white' : '',
  297. 'bottom',
  298. ]"
  299. :style="{
  300. fontSize: pySize + 'px',
  301. textAlign: left,
  302. height: pySize * 1.25 + 'px',
  303. }"
  304. >{{ item[pIndex + 1].pinyin }}</span
  305. >
  306. </template>
  307. </span>
  308. <span
  309. v-if="item[pIndex + 2] && item[pIndex + 2].chs && chsFhList.indexOf(item[pIndex + 2].chs) > -1"
  310. class="NNPE-words-box"
  311. >
  312. <template v-if="curQue.property.pinyin_position == 'top'">
  313. <span
  314. v-if="config.isShowPY"
  315. :class="[
  316. 'NNPE-pinyin',
  317. noFont.indexOf(item[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
  318. bgIndex == 1 ? 'font-white' : '',
  319. ]"
  320. :style="{
  321. fontSize: pySize + 'px',
  322. textAlign: left,
  323. height: pySize * 1.25 + 'px',
  324. }"
  325. >{{ item[pIndex + 2].pinyin }}</span
  326. >
  327. </template>
  328. <span
  329. :class="['NNPE-chs', curQue.property.pinyin_position == 'top' ? 'bottom' : '']"
  330. :style="{
  331. fontSize: hzSize + 'px',
  332. textAlign: left,
  333. height: hzSize * 1.17 + 'px',
  334. }"
  335. >
  336. <span
  337. :class="[
  338. pItem.timeList[pItem.leg - 1] &&
  339. curTime >= pItem.timeList[pItem.leg - 1].wordBg &&
  340. curQue.wordTime &&
  341. curQue.wordTime[curSentIndex] &&
  342. curTime <= curQue.wordTime[curSentIndex].ed
  343. ? bgIndex == 0
  344. ? 'active'
  345. : 'active-yellow'
  346. : '',
  347. bgIndex == 1 ? 'font-white' : '',
  348. newWordList.indexOf(item[pIndex + 2].chs) > -1 && !isPlaying ? 'newActive' : '',
  349. item[pIndex + 2].words && !isPlaying ? 'newActive' : '',
  350. ]"
  351. :style="{
  352. fontSize: hzSize + 'px',
  353. fontFamily:
  354. item[pIndex + 2].config && item[pIndex + 2].config.fontFamily
  355. ? item[pIndex + 2].config.fontFamily
  356. : '',
  357. height: hzSize * 1.17 + 'px',
  358. display: 'inline-block',
  359. width: item[pIndex + 2].chs.trim() === '' ? '10px' : '',
  360. }"
  361. >{{ item[pIndex + 2].chs }}</span
  362. >
  363. </span>
  364. <template v-if="curQue.property.pinyin_position == 'bottom'">
  365. <span
  366. v-if="config.isShowPY"
  367. :class="[
  368. 'NNPE-pinyin',
  369. noFont.indexOf(item[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
  370. bgIndex == 1 ? 'font-white' : '',
  371. 'bottom',
  372. ]"
  373. :style="{
  374. fontSize: pySize + 'px',
  375. textAlign: left,
  376. height: pySize * 1.25 + 'px',
  377. }"
  378. >{{ item[pIndex + 2].pinyin }}</span
  379. >
  380. </template>
  381. </span>
  382. </template>
  383. <template v-else>
  384. <template v-if="curQue.property.pinyin_position == 'top'">
  385. <template v-if="NumberList.indexOf(pItem.pinyin) < 0">
  386. <span
  387. v-if="config.isShowPY"
  388. class="NNPE-pinyin"
  389. :class="[
  390. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  391. pItem.className ? pItem.className : '',
  392. noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
  393. bgIndex == 1 ? 'font-white' : '',
  394. ]"
  395. :style="{
  396. fontSize: pySize + 'px',
  397. height: pySize * 1.25 + 'px',
  398. }"
  399. >{{ pItem.pinyin }}</span
  400. >
  401. </template>
  402. </template>
  403. <span
  404. v-if="pItem.chs != '#'"
  405. class="NNPE-chs"
  406. :class="[
  407. pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
  408. curQue.property.pinyin_position == 'top' ? 'bottom' : '',
  409. ]"
  410. :style="{
  411. height: hzSize * 1.17 + 'px',
  412. }"
  413. >
  414. <template>
  415. <span
  416. v-for="(wItem, wIndex) in pItem.leg"
  417. :key="'ci' + wIndex + pIndex + curSentIndex"
  418. :class="[
  419. pItem.timeList &&
  420. pItem.timeList[wIndex] &&
  421. curTime >= pItem.timeList[wIndex].wordBg &&
  422. curQue.wordTime &&
  423. curQue.wordTime[curSentIndex] &&
  424. curTime <= curQue.wordTime[curSentIndex].ed
  425. ? bgIndex == 0
  426. ? 'active'
  427. : 'active-yellow'
  428. : '',
  429. bgIndex == 1 ? 'font-white' : '',
  430. bgIndex == 0 && wordIndex == pItem.wordIndex ? 'wordActive' : '',
  431. bgIndex == 1 && wordIndex == pItem.wordIndex ? 'wordActive-blue' : '',
  432. newWordList.indexOf(pItem.chs) > -1 && !isPlaying ? 'newActive' : '',
  433. pItem.words && !isPlaying ? 'newActive' : '',
  434. ]"
  435. :style="{
  436. fontSize: hzSize + 'px',
  437. fontFamily: pItem.config && pItem.config.fontFamily ? pItem.config.fontFamily : '',
  438. height: hzSize * 1.17 + 'px',
  439. display: 'inline-block',
  440. width: pItem.chs[wIndex].trim() === '' ? '10px' : '',
  441. }"
  442. >{{ pItem.chs[wIndex] }}</span
  443. >
  444. </template>
  445. </span>
  446. <template v-if="curQue.property.pinyin_position == 'bottom'">
  447. <template v-if="NumberList.indexOf(pItem.pinyin) < 0">
  448. <span
  449. v-if="config.isShowPY"
  450. class="NNPE-pinyin bottom"
  451. :class="[
  452. pItem.chs != '“' && pItem.padding ? 'padding' : '',
  453. pItem.className ? pItem.className : '',
  454. bgIndex == 1 ? 'font-white' : '',
  455. ]"
  456. :style="{
  457. fontSize: pySize + 'px',
  458. height: pySize * 1.25 + 'px',
  459. }"
  460. >{{ pItem.pinyin }}</span
  461. >
  462. </template>
  463. </template>
  464. </template>
  465. </template>
  466. </template>
  467. <template v-else>
  468. <span
  469. :style="{
  470. height: pItem.height + 'px',
  471. width: pItem.width + 'px',
  472. }"
  473. ></span>
  474. </template>
  475. </template>
  476. </div>
  477. </div>
  478. <div style="overflow: hidden; clear: both"></div>
  479. <div
  480. v-if="
  481. enwords && config.isShowEN && (!curQue.enPosition || (curQue.enPosition && curQue.enPosition == 'bottom'))
  482. "
  483. :class="['enwords', bgIndex == 1 ? 'enwords-green' : '']"
  484. :style="{ fontSize: enSize + 'px' }"
  485. >
  486. {{ enwords }}
  487. </div>
  488. </div>
  489. <div
  490. class="vc-box-right"
  491. @mousemove="showPrevNext(true, 'isShowRight')"
  492. @mouseleave="showPrevNext(false, 'isShowRight')"
  493. >
  494. <div
  495. :class="[
  496. 'vc-left vc-right-grey',
  497. isShowRight && bgIndex == 0 ? 'vc-right-black' : '',
  498. isShowRight && bgIndex == 1 ? 'vc-right-white' : '',
  499. curSentIndex == sentList.length - 1 ? 'hidden' : '',
  500. ]"
  501. @click="nextSentence"
  502. ></div>
  503. </div>
  504. </div>
  505. <div class="voicefull-bottom" @mouseover="setBottomShow(true)" @mouseleave="setBottomShow(false)">
  506. <div :class="[isBottomShow ? 'voicefull-bottom-show' : 'voicefull-bottom-hidden']">
  507. <div :class="['bottom-left', TaskModel == 'ANSWER' ? 'bottom-left-margin' : '']">
  508. <Soundrecorddiff
  509. ref="Soundrecorddiff"
  510. :bg-index="bgIndex"
  511. :TaskModel="TaskModel"
  512. :answer-record-list="
  513. curQue.Bookanswer.practiceModel[curSentIndex] && curQue.Bookanswer.practiceModel[curSentIndex].recordList
  514. "
  515. :tm-index="curSentIndex"
  516. @handleWav="handleWav"
  517. :key="'Soundrecorddiff' + curSentIndex"
  518. @getWavblob="getWavblob"
  519. @handleParentPlay="handleParentPlay"
  520. @sentPause="sentPause"
  521. @getRerordStatus="getRerordStatus"
  522. @getMicrophoneStatus="getMicrophoneStatus"
  523. @getPlayStatus="getPlayStatus"
  524. />
  525. <div v-if="isShowCompare" :class="['compare-box', bgIndex == 1 ? 'compare-box-white' : '']">
  526. <Audio-compare
  527. :bg-index="bgIndex"
  528. type="full"
  529. :theme-color="themeColor"
  530. :index="curSentIndex"
  531. :sent-index="curSentIndex"
  532. :key="'mp3Compare' + curSentIndex"
  533. :url="curQue.mp3_list[0].id"
  534. :bg="bg"
  535. :ed="ed"
  536. :wavblob="wavblob"
  537. :get-cur-time="getCurCompareTime"
  538. :sent-pause="sentPause"
  539. :is-record="isRecord"
  540. :handle-change-stop-audio="handleChangeStopAudio"
  541. :get-play-status="getPlayStatus"
  542. />
  543. </div>
  544. </div>
  545. <div :class="['page-count', bgIndex == 0 ? 'page-count-white' : 'page-count-green']">
  546. {{ curSentIndex + 1 }}/{{ sentList.length }}
  547. </div>
  548. </div>
  549. </div>
  550. <template v-if="isShow">
  551. <div ref="wordcard" class="NNPE-wordDetail" :style="{ left: left + 'px' }">
  552. <Wordcard
  553. :word="word"
  554. :change-word-card="changeWordCard"
  555. :theme-color="themeColor"
  556. :current-tree-i-d="currentTreeID"
  557. :mp3-url="wordPlayMp3"
  558. :bg="wordbgs"
  559. :ed="wordeds"
  560. />
  561. </div>
  562. </template>
  563. <div v-if="isWordPlay || isNewWordPlay" class="word-play-audio">
  564. <AudioLineSentence
  565. ref="audioLineWord"
  566. :mp3="isWordPlay ? NpcNewWordMp3 : isNewWordPlay ? wordPlayMp3 : ''"
  567. :get-cur-time="getCurWordTime"
  568. :audio-id="'artPraAudioId' + curSentIndex + wordIndex"
  569. :stop-audio="stopAudio"
  570. :width="120"
  571. :hide-slider="false"
  572. :bg="wordbg"
  573. :ed="worded"
  574. :max-time="wordMaxTime"
  575. :bg-index="bgIndex"
  576. :is-repeat="isRepeat"
  577. :word-play="true"
  578. @changePlayStatus="changePlayStatus"
  579. />
  580. </div>
  581. </div>
  582. </template>
  583. <script>
  584. import AudioLineSentence from './components/AudioLineSentence.vue';
  585. import Soundrecorddiff from './components/Soundrecorddiff.vue';
  586. import AudioCompare from './components/AudioCompare.vue';
  587. import Wordcard from './components/Wordcard.vue';
  588. import { LearnWebSI } from '@/api/app';
  589. import $ from 'jquery';
  590. export default {
  591. name: 'VoiceFullScreen',
  592. components: {
  593. AudioLineSentence,
  594. Soundrecorddiff,
  595. AudioCompare,
  596. Wordcard,
  597. },
  598. props: [
  599. 'sentList',
  600. 'sentIndex',
  601. 'mp3',
  602. 'wordTimeList',
  603. 'curQue',
  604. 'noFont',
  605. 'themeColor',
  606. 'NNPENewWordList',
  607. 'currentTreeID',
  608. 'config',
  609. 'TaskModel',
  610. 'NpcNewWordMp3',
  611. ],
  612. data() {
  613. return {
  614. pySize: 32,
  615. hzSize: 48,
  616. enSize: 24,
  617. bgIndex: 1,
  618. maxTime: 0,
  619. item: null,
  620. bg: 0,
  621. ed: 0,
  622. isRepeat: false,
  623. NumberList: ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳'],
  624. chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '、'],
  625. enFhList: [',', '.', ';', '?', '!', ':', '>', '<'],
  626. curTime: 0,
  627. wavblob: null,
  628. stopAudio: false,
  629. isRecord: false,
  630. isShowCompare: false,
  631. isShowRight: false,
  632. isShowLeft: false,
  633. curSentIndex: 0,
  634. oldHz: '',
  635. hz: '',
  636. clientY: 0,
  637. top: 0,
  638. left: 0,
  639. newWordList: [],
  640. pinyin: '',
  641. wordIndex: -1,
  642. isShow: false,
  643. wordbg: 0,
  644. worded: 0,
  645. wordbgs: 0,
  646. wordeds: 0,
  647. wordMaxTime: 0,
  648. isWordPlay: false,
  649. isNewWordPlay: false,
  650. curWordTime: 0,
  651. isPlaying: false,
  652. isAuto: false,
  653. key: 'isRepeat',
  654. isKeyboard: true,
  655. isTopShow: false,
  656. isBottomShow: false,
  657. isRecording: false,
  658. recordPlaying: false,
  659. isCollArr: [],
  660. enwords: '',
  661. screenHeight: 0,
  662. wordPlayMp3: '',
  663. };
  664. },
  665. computed: {
  666. // isPlaying: function () {
  667. // let playing = false;
  668. // if (this.$refs.audioLineSent) {
  669. // playing = this.$refs.audioLineSent.audio.isPlaying;
  670. // }
  671. // console.log(playing);
  672. // return playing;
  673. // },
  674. },
  675. watch: {
  676. isRecording: {
  677. handler(newVal, oldVal) {
  678. if (newVal) {
  679. this.isBottomShow = newVal;
  680. }
  681. },
  682. deep: true,
  683. },
  684. recordPlaying: {
  685. handler(newVal, oldVal) {
  686. if (newVal) {
  687. this.isBottomShow = newVal;
  688. }
  689. },
  690. deep: true,
  691. },
  692. sentIndex: {
  693. handler(newVal, oldVal) {
  694. this.curSentIndex = newVal;
  695. this.getSentence();
  696. },
  697. deep: true,
  698. },
  699. hz: {
  700. handler(val, oldVal) {
  701. let _this = this;
  702. if (val) {
  703. _this.handleNewWords(val);
  704. }
  705. },
  706. // 深度观察监听
  707. deep: true,
  708. },
  709. isShow: {
  710. handler(val, oldVal) {
  711. let _this = this;
  712. if (val) {
  713. setTimeout(() => {
  714. _this.cardHeight = _this.$refs.wordcard.offsetHeight;
  715. if (_this.screenHeight - _this.clientY > _this.cardHeight) {
  716. _this.top = _this.clientY + 20;
  717. } else {
  718. _this.top = _this.clientY - _this.cardHeight - 30;
  719. }
  720. }, 50);
  721. }
  722. },
  723. // 深度观察监听
  724. deep: true,
  725. },
  726. },
  727. // 生命周期 - 创建完成(可以访问当前this实例)
  728. created() {},
  729. // 生命周期 - 挂载完成(可以访问DOM元素)
  730. mounted() {
  731. let _this = this;
  732. window.addEventListener('resize', this.getScreenHeight);
  733. _this.getScreenHeight();
  734. document.addEventListener('keyup', function (e) {
  735. if (_this.isKeyboard) {
  736. if (e.keyCode == 32) {
  737. // 空格
  738. _this.$nextTick(() => {
  739. if (_this.$refs.audioLineSent) {
  740. _this.$refs.audioLineSent.PlayAudio();
  741. }
  742. });
  743. } else if (e.keyCode == 38) {
  744. _this.prevSentence();
  745. } else if (e.keyCode == 40) {
  746. _this.nextSentence();
  747. } else if (e.keyCode == 13) {
  748. _this.$nextTick(() => {
  749. _this.$refs.Soundrecorddiff.microphone();
  750. });
  751. }
  752. }
  753. });
  754. if (_this.NNPENewWordList) {
  755. _this.handleNewword();
  756. }
  757. _this.curSentIndex = _this.sentIndex;
  758. _this.getSentence();
  759. document.addEventListener('fullscreenchange', () => {
  760. let isFullscreen =
  761. document.fullscreenElement ||
  762. document.mozFullScreenElement ||
  763. document.webkitFullscreenElement ||
  764. document.fullScreen ||
  765. document.mozFullScreen ||
  766. document.webkitIsFullScreen;
  767. if (!isFullscreen) {
  768. _this.changeFullScreen();
  769. }
  770. });
  771. document.addEventListener('mozfullscreenchange', () => {
  772. let isFullscreen =
  773. document.fullscreenElement ||
  774. document.mozFullScreenElement ||
  775. document.webkitFullscreenElement ||
  776. document.fullScreen ||
  777. document.mozFullScreen ||
  778. document.webkitIsFullScreen;
  779. if (!isFullscreen) {
  780. _this.changeFullScreen();
  781. }
  782. });
  783. document.addEventListener('webkitfullscreenchange', () => {
  784. let isFullscreen =
  785. document.fullscreenElement ||
  786. document.mozFullScreenElement ||
  787. document.webkitFullscreenElement ||
  788. document.fullScreen ||
  789. document.mozFullScreen ||
  790. document.webkitIsFullScreen;
  791. if (!isFullscreen) {
  792. _this.changeFullScreen();
  793. }
  794. });
  795. document.addEventListener('msfullscreenchange', () => {
  796. let isFullscreen =
  797. document.fullscreenElement ||
  798. document.mozFullScreenElement ||
  799. document.webkitFullscreenElement ||
  800. document.fullScreen ||
  801. document.mozFullScreen ||
  802. document.webkitIsFullScreen;
  803. if (!isFullscreen) {
  804. _this.changeFullScreen();
  805. }
  806. });
  807. },
  808. beforeCreate() {}, // 生命周期 - 创建之前
  809. beforeMount() {}, // 生命周期 - 挂载之前
  810. beforeUpdate() {}, // 生命周期 - 更新之前
  811. updated() {}, // 生命周期 - 更新之后
  812. beforeDestroy() {
  813. window.removeEventListener('resize', this.getScreenHeight);
  814. }, // 生命周期 - 销毁之前
  815. destroyed() {}, // 生命周期 - 销毁完成
  816. activated() {},
  817. // 方法集合
  818. methods: {
  819. setTopShow(bool) {
  820. this.isTopShow = bool;
  821. },
  822. setBottomShow(bool) {
  823. if (!this.recordPlaying && !this.isRecording) {
  824. this.isBottomShow = bool;
  825. }
  826. },
  827. getPlayStatus(bool) {
  828. this.recordPlaying = bool;
  829. },
  830. setFontSize(type) {
  831. let _this = this;
  832. if (type == '-') {
  833. if (_this.hzSize >= 34) {
  834. this.hzSize -= 4;
  835. }
  836. }
  837. if (type == '+') {
  838. if (_this.hzSize <= 76) {
  839. this.hzSize += 4;
  840. }
  841. }
  842. _this.pySize = parseInt(_this.hzSize / 1.5);
  843. _this.enSize = parseInt(_this.hzSize / 2);
  844. },
  845. playChange(bool) {
  846. this.isPlaying = bool;
  847. },
  848. handleColl() {
  849. let _this = this;
  850. if (_this.isCollArr[_this.curSentIndex]) {
  851. _this.cancleColl();
  852. } else {
  853. _this.addColl();
  854. }
  855. },
  856. // 添加收藏
  857. addColl() {
  858. let Bookdetail = sessionStorage.getItem('Bookdetail');
  859. if (Bookdetail) {
  860. Bookdetail = JSON.parse(Bookdetail);
  861. let MethodName = 'order-collection_manager-AddMyCollection';
  862. let text = '';
  863. this.item.forEach((item) => {
  864. if (item.chs != '#') {
  865. text += item.chs;
  866. }
  867. });
  868. let sentence_json = {
  869. item: JSON.stringify(this.item),
  870. bg: this.bg,
  871. ed: this.ed,
  872. mp3: this.mp3,
  873. pyPosition: this.curQue.property.pinyin_position,
  874. };
  875. let data = {
  876. goods_id: this.currentTreeID,
  877. goods_type: 502,
  878. goods_name: Bookdetail.name,
  879. goods_person_name_desc: Bookdetail.author ? Bookdetail.author : '',
  880. goods_picture_id: Bookdetail.picture_id ? Bookdetail.picture_id : '',
  881. goods_price: Bookdetail.price,
  882. sentence: {
  883. sentence_text: text,
  884. sentence_json: JSON.stringify(sentence_json),
  885. },
  886. };
  887. LearnWebSI(MethodName, data).then((res) => {
  888. this.$set(this.isCollArr, this.curSentIndex, true);
  889. this.$message.success('收藏成功!');
  890. });
  891. } else {
  892. this.$message.warning('权限不足!');
  893. }
  894. },
  895. // 取消收藏
  896. cancleColl() {
  897. let text = '';
  898. this.item.forEach((item) => {
  899. if (item.chs != '#') {
  900. text += item.chs;
  901. }
  902. });
  903. let MethodName = 'order-collection_manager-CancelMyGoodsCollection_WS';
  904. let data = {
  905. goods_type: 502,
  906. goods_list: [
  907. {
  908. goods_id: this.currentTreeID, // 课件的id
  909. sentence_text: text,
  910. },
  911. ],
  912. };
  913. LearnWebSI(MethodName, data).then((res) => {
  914. this.$set(this.isCollArr, this.curSentIndex, false);
  915. this.$message.success('取消成功!');
  916. });
  917. },
  918. // 检查收藏状态
  919. checkCollStatus() {
  920. let text = '';
  921. this.item.forEach((item) => {
  922. if (item.chs != '#') {
  923. text += item.chs;
  924. }
  925. });
  926. let MethodName = 'order-collection_manager-CheckMyGoodsCollectionStatus';
  927. let data = {
  928. goods_type: 502,
  929. goods_id: this.currentTreeID, // 课件的id
  930. sentence_text: text,
  931. };
  932. LearnWebSI(MethodName, data).then((res) => {
  933. let collFlag = res.is_collection == 'true';
  934. this.$set(this.isCollArr, this.curSentIndex, collFlag);
  935. });
  936. },
  937. showPrevNext(bool, key) {
  938. this[key] = bool;
  939. },
  940. prevSentence() {
  941. let _this = this;
  942. if (_this.curSentIndex == 0) {
  943. // _this.$message.warning("已经是第一个句子了");
  944. return;
  945. }
  946. _this.curSentIndex -= 1;
  947. _this.getSentence();
  948. if (_this.isAuto) {
  949. _this.curTime = _this.bg;
  950. _this.$refs.audioLineSent.onTimeupdateTime(_this.bg / 1000);
  951. }
  952. },
  953. nextSentence() {
  954. if (this.curSentIndex == this.sentList.length - 1) {
  955. // this.$message.warning("已经是最后一个句子了");
  956. return;
  957. }
  958. this.curSentIndex += 1;
  959. this.getSentence();
  960. },
  961. rollSentence() {
  962. if (this.curSentIndex == this.sentList.length - 1) {
  963. this.curSentIndex = 0;
  964. } else {
  965. this.curSentIndex += 1;
  966. }
  967. this.getSentence();
  968. },
  969. changeStatus(key) {
  970. if (key == 'config.isShowEN') {
  971. if (this.enwords) {
  972. this[key] = !this[key];
  973. }
  974. } else {
  975. this[key] = !this[key];
  976. }
  977. },
  978. changePinyin() {
  979. this.$emit('changePinyin');
  980. },
  981. changeEN() {
  982. this.$emit('changeEN');
  983. },
  984. setStatus() {
  985. let _this = this;
  986. if (_this.key == 'isRepeat') {
  987. if (_this.isRepeat) {
  988. _this.isRepeat = false;
  989. _this.isAuto = true;
  990. _this.key = 'isAuto';
  991. } else {
  992. _this.isRepeat = true;
  993. _this.key = 'isRepeat';
  994. }
  995. } else if (_this.key == 'isAuto') {
  996. if (_this.isAuto) {
  997. _this.isRepeat = false;
  998. _this.isAuto = false;
  999. _this.key = 'isRepeat';
  1000. }
  1001. }
  1002. },
  1003. getRerordStatus(bool) {
  1004. this.isShowCompare = bool;
  1005. },
  1006. getMicrophoneStatus(bool) {
  1007. this.isRecording = bool;
  1008. },
  1009. getWavblob(wavblob) {
  1010. this.wavblob = wavblob;
  1011. },
  1012. sentPause(isRecord) {
  1013. this.isRecord = isRecord;
  1014. },
  1015. getCurTime(curTime) {
  1016. let _this = this;
  1017. if (_this.isRepeat) {
  1018. let time = curTime * 1000;
  1019. if (time > _this.ed || time < _this.bg) {
  1020. _this.curTime = _this.bg;
  1021. this.$refs.audioLineSent.onTimeupdateTime(_this.bg / 1000);
  1022. } else {
  1023. _this.curTime = curTime * 1000;
  1024. }
  1025. } else if (_this.isAuto) {
  1026. let time = curTime * 1000;
  1027. if (time > _this.ed) {
  1028. _this.rollSentence();
  1029. _this.curTime = _this.bg;
  1030. _this.$refs.audioLineSent.onTimeupdateTime(_this.bg / 1000);
  1031. } else {
  1032. _this.curTime = curTime * 1000;
  1033. }
  1034. } else {
  1035. _this.curTime = curTime * 1000;
  1036. }
  1037. },
  1038. getCurCompareTime(curTime) {
  1039. let _this = this;
  1040. _this.curTime = curTime * 1000;
  1041. },
  1042. getCurWordTime(curTime) {
  1043. let _this = this;
  1044. _this.curWordTime = curTime * 1000;
  1045. },
  1046. changeBg(bgIndex) {
  1047. this.bgIndex = bgIndex;
  1048. },
  1049. getSentence() {
  1050. let _this = this;
  1051. _this.isShowCompare =
  1052. _this.curQue.Bookanswer.practiceModel[_this.curSentIndex] &&
  1053. _this.curQue.Bookanswer.practiceModel[_this.curSentIndex].recordList &&
  1054. _this.curQue.Bookanswer.practiceModel[_this.curSentIndex].recordList.length > 0;
  1055. _this.pauseAudio();
  1056. _this.isPlaying = false;
  1057. let item = JSON.parse(JSON.stringify(_this.sentList[_this.curSentIndex]));
  1058. if (item.sentArr) {
  1059. _this.item = item.sentArr;
  1060. _this.enwords = item.enwords;
  1061. } else {
  1062. _this.item = item;
  1063. }
  1064. _this.sentList.forEach((item) => {
  1065. this.isCollArr.push(false);
  1066. });
  1067. _this.bg =
  1068. _this.curQue.wordTime && _this.curQue.wordTime[_this.curSentIndex]
  1069. ? _this.curQue.wordTime[_this.curSentIndex].bg
  1070. : 0;
  1071. _this.ed =
  1072. _this.curQue.wordTime && _this.curQue.wordTime[_this.curSentIndex]
  1073. ? _this.curQue.wordTime[_this.curSentIndex].ed
  1074. : 0;
  1075. let maxTime = (_this.ed - _this.bg) / 1000;
  1076. if (maxTime < 1) {
  1077. _this.maxTime = 1;
  1078. } else {
  1079. _this.maxTime = maxTime;
  1080. }
  1081. _this.checkCollStatus();
  1082. },
  1083. pauseAudio() {
  1084. let audio = document.getElementsByTagName('audio');
  1085. if (audio && audio.length > 0 && window.location.href.indexOf('GCLS-Learn') == -1 && audio.forEach) {
  1086. audio.forEach((item) => {
  1087. item.pause();
  1088. });
  1089. }
  1090. },
  1091. exitFullScreen() {
  1092. this.pauseAudio();
  1093. this.$emit('exitFullscreen');
  1094. },
  1095. changeFullScreen() {
  1096. this.pauseAudio();
  1097. this.$emit('changeIsFull');
  1098. },
  1099. handleWav(list, tmIndex) {
  1100. tmIndex = tmIndex || 0;
  1101. this.$emit('handleWav', list, tmIndex);
  1102. },
  1103. // 录音时暂停音频播放
  1104. handleParentPlay() {
  1105. this.stopAudio = true;
  1106. },
  1107. // 音频播放时改变布尔值
  1108. handleChangeStopAudio() {
  1109. this.stopAudio = false;
  1110. },
  1111. // 播放音频
  1112. // playWord(item) {
  1113. // let _this = this;
  1114. // if (this.newWordList.indexOf(item.chs) > -1 || item.words) {
  1115. // _this.pauseAudio();
  1116. // _this.isWordPlay = false;
  1117. // _this.wordIndex = item.wordIndex;
  1118. // setTimeout(() => {
  1119. // let leg = item.timeList.length;
  1120. // _this.wordbg = item.timeList[0].wordBg;
  1121. // _this.worded = item.timeList[leg - 1].wordEd;
  1122. // let wordMaxTime = (_this.worded - _this.wordbg) / 1000;
  1123. // if (wordMaxTime < 1) {
  1124. // _this.wordMaxTime = 1;
  1125. // } else {
  1126. // _this.wordMaxTime = wordMaxTime;
  1127. // }
  1128. // _this.isWordPlay = true;
  1129. // }, 50);
  1130. // }
  1131. // },
  1132. playWord(item) {
  1133. let _this = this;
  1134. if (this.newWordList.indexOf(item.chs) > -1 || item.words) {
  1135. _this.pauseAudio();
  1136. _this.isNewWordPlay = false;
  1137. let new_word = item.words ? item.words : item.chs;
  1138. _this.NNPENewWordList.forEach((items) => {
  1139. items.forEach((itemn) => {
  1140. if (itemn.new_word === new_word) {
  1141. _this.wordbg = itemn.bg;
  1142. _this.worded = itemn.ed;
  1143. _this.wordPlayMp3 = itemn.newWordMp3;
  1144. }
  1145. });
  1146. });
  1147. setTimeout(() => {
  1148. _this.isNewWordPlay = true;
  1149. }, 50);
  1150. }
  1151. },
  1152. changePlayStatus() {
  1153. this.isWordPlay = false;
  1154. this.isNewWordPlay = false;
  1155. this.wordIndex = -1;
  1156. },
  1157. showWordDetail(e, item) {
  1158. let _this = this;
  1159. if (_this.TaskModel == 'ANSWER') {
  1160. return;
  1161. }
  1162. if (_this.chsFhList.indexOf(item.chs) > -1 || /^[a-zA-Z0-9]/.test(item.chs)) {
  1163. return;
  1164. }
  1165. if (_this.oldHz != item.chs) {
  1166. this.isShow = false;
  1167. setTimeout(() => {
  1168. _this.hz = item.words ? item.words : item.chs;
  1169. _this.pinyin = item.pinyin;
  1170. _this.wordIndex = item.wordIndex;
  1171. }, 50);
  1172. }
  1173. _this.clientY = e.clientY;
  1174. let new_word = item.words ? item.words : item.chs;
  1175. _this.wordPlayMp3 = '';
  1176. _this.NNPENewWordList.forEach((items) => {
  1177. items.forEach((itemn) => {
  1178. if (itemn.new_word === new_word) {
  1179. _this.wordbgs = itemn.bg;
  1180. _this.wordeds = itemn.ed;
  1181. _this.wordPlayMp3 = itemn.newWordMp3;
  1182. }
  1183. });
  1184. });
  1185. let left = e.clientX;
  1186. let width = 0;
  1187. if (item.chs.length == 1 || item.chs.length == 2) {
  1188. width = 304;
  1189. } else if (item.chs.length == 3 || item.chs.length == 4) {
  1190. width = 432;
  1191. } else if (item.chs.length > 3) {
  1192. width = 560;
  1193. }
  1194. // if (left - this.bodyLeft > this.contentWidth / 2) {
  1195. // _this.left = left - width + 10;
  1196. // } else {
  1197. _this.left = left - width / 2;
  1198. // }
  1199. },
  1200. changeWordCard(isShow) {
  1201. let _this = this;
  1202. _this.isShow = isShow;
  1203. _this.oldHz = '';
  1204. _this.hz = '';
  1205. _this.wordIndex = -1;
  1206. },
  1207. // 处理分词数据
  1208. handleNewWords(val) {
  1209. let _this = this;
  1210. _this.isShow = true;
  1211. _this.word = null;
  1212. if (_this.newWordList.indexOf(val) > -1) {
  1213. for (let i = 0; i < this.NNPENewWordList.length; i++) {
  1214. let pItem = this.NNPENewWordList[i];
  1215. for (let j = 0; j < pItem.length; j++) {
  1216. let item = pItem[j];
  1217. if (item.new_word.trim() == val.trim()) {
  1218. let wordlist = val.split('');
  1219. this.word = { list: wordlist, detail: item };
  1220. break;
  1221. }
  1222. }
  1223. }
  1224. } else {
  1225. let wordlist = val.split('');
  1226. let option = {
  1227. definition_list: [],
  1228. mp3_list: [],
  1229. new_word: val,
  1230. pinyin: _this.pinyin,
  1231. };
  1232. _this.word = { list: wordlist, detail: option };
  1233. }
  1234. _this.oldHz = val;
  1235. },
  1236. handleNewword() {
  1237. let NewWordList = [];
  1238. this.NNPENewWordList.forEach((item) => {
  1239. item.forEach((wItem) => {
  1240. NewWordList.push(wItem.new_word);
  1241. });
  1242. });
  1243. this.newWordList = JSON.parse(JSON.stringify(NewWordList));
  1244. },
  1245. getScreenHeight() {
  1246. this.screenHeight = window.innerHeight;
  1247. },
  1248. }, // 如果页面有keep-alive缓存功能,这个函数会触发
  1249. };
  1250. </script>
  1251. <style lang="scss" scoped>
  1252. //@import url(); 引入公共css类
  1253. .voicefull {
  1254. display: flex;
  1255. flex-direction: column;
  1256. width: 100%;
  1257. height: 100vh;
  1258. overflow: hidden;
  1259. .NNPE-wordDetail {
  1260. position: fixed;
  1261. top: 50%;
  1262. z-index: 9999;
  1263. margin-top: -196px;
  1264. }
  1265. &.bg1 {
  1266. background: #fff;
  1267. }
  1268. &.bg2 {
  1269. background: linear-gradient(180deg, #274533 0%, #385f45 100%);
  1270. .newActive {
  1271. color: #ffc600 !important;
  1272. }
  1273. }
  1274. &-top {
  1275. box-sizing: border-box;
  1276. width: 100%;
  1277. height: 136px;
  1278. padding: 0 40px;
  1279. .voicefull-top-hidden {
  1280. display: flex;
  1281. align-items: center;
  1282. justify-content: space-between;
  1283. width: 100%;
  1284. height: 136px;
  1285. visibility: hidden;
  1286. }
  1287. .voicefull-top-show {
  1288. display: flex;
  1289. align-items: center;
  1290. justify-content: space-between;
  1291. width: 100%;
  1292. height: 136px;
  1293. visibility: visible;
  1294. }
  1295. .top-left {
  1296. display: flex;
  1297. align-items: center;
  1298. justify-content: flex-start;
  1299. }
  1300. .select-bg {
  1301. box-sizing: border-box;
  1302. display: flex;
  1303. align-items: center;
  1304. justify-content: space-between;
  1305. justify-content: center;
  1306. width: 96px;
  1307. height: 56px;
  1308. margin-right: 32px;
  1309. border: 1px solid rgba(0, 0, 0, 10%);
  1310. border-radius: 40px;
  1311. &.select-bg-blue {
  1312. background: rgba(255, 255, 255, 10%);
  1313. border: 1px solid rgba(0, 0, 0, 10%);
  1314. }
  1315. > div {
  1316. display: flex;
  1317. align-items: center;
  1318. justify-content: center;
  1319. width: 36px;
  1320. height: 36px;
  1321. border-radius: 100%;
  1322. &.bg-white-box {
  1323. margin-right: 4px;
  1324. background: 0 0;
  1325. &.active {
  1326. background: #de4444;
  1327. }
  1328. }
  1329. &.bg-green-box {
  1330. background: #fff;
  1331. &.active {
  1332. background: #ffc600;
  1333. }
  1334. }
  1335. > span {
  1336. box-sizing: border-box;
  1337. width: 24px;
  1338. height: 24px;
  1339. cursor: pointer;
  1340. border-radius: 100%;
  1341. &.bg-white {
  1342. background: #fff;
  1343. }
  1344. &.bg-green {
  1345. background: linear-gradient(180deg, #274533 0%, #385f45 100%);
  1346. }
  1347. }
  1348. }
  1349. }
  1350. .set-fontSize {
  1351. display: flex;
  1352. align-items: center;
  1353. justify-content: center;
  1354. height: 56px;
  1355. padding: 0 20px;
  1356. background: #fff;
  1357. border: 1px solid rgba(0, 0, 0, 10%);
  1358. border-radius: 40px;
  1359. &-green {
  1360. background: rgba(255, 255, 255, 10%);
  1361. border: 1px solid rgba(0, 0, 0, 10%);
  1362. }
  1363. > span {
  1364. width: 24px;
  1365. height: 24px;
  1366. margin: 0 4px;
  1367. &.font-jian {
  1368. &-black {
  1369. cursor: pointer;
  1370. background: url('@/assets/jian-black.png') no-repeat left top;
  1371. background-size: 100% 100%;
  1372. }
  1373. &-yellow {
  1374. cursor: pointer;
  1375. background: url('@/assets/jian-white.png') no-repeat left top;
  1376. background-size: 100% 100%;
  1377. }
  1378. &-white-disabled {
  1379. cursor: pointer;
  1380. background: url('@/assets/jian-white-disabled.png') no-repeat left top;
  1381. background-size: 100% 100%;
  1382. }
  1383. &-yellow-disabled {
  1384. cursor: pointer;
  1385. background: url('@/assets/jian-yellow-disabled.png') no-repeat left top;
  1386. background-size: 100% 100%;
  1387. }
  1388. }
  1389. &.font-img {
  1390. &-black {
  1391. background: url('@/assets/fontSize-black.png') no-repeat left top;
  1392. background-size: 100% 100%;
  1393. }
  1394. &-yellow {
  1395. background: url('@/assets/fontSize-white.png') no-repeat left top;
  1396. background-size: 100% 100%;
  1397. }
  1398. }
  1399. &.font-jia {
  1400. &-black {
  1401. cursor: pointer;
  1402. background: url('@/assets/jia-black.png') no-repeat left top;
  1403. background-size: 100% 100%;
  1404. }
  1405. &-yellow {
  1406. cursor: pointer;
  1407. background: url('@/assets/jia-white.png') no-repeat left top;
  1408. background-size: 100% 100%;
  1409. }
  1410. &-white-disabled {
  1411. cursor: pointer;
  1412. background: url('@/assets/jia-white-disabled.png') no-repeat left top;
  1413. background-size: 100% 100%;
  1414. }
  1415. &-yellow-disabled {
  1416. cursor: pointer;
  1417. background: url('@/assets/jia-yellow-disabled.png') no-repeat left top;
  1418. background-size: 100% 100%;
  1419. }
  1420. }
  1421. }
  1422. }
  1423. .top-middle {
  1424. display: flex;
  1425. align-items: center;
  1426. justify-content: center;
  1427. .audio-box {
  1428. display: flex;
  1429. align-items: center;
  1430. justify-content: center;
  1431. width: 56px;
  1432. height: 56px;
  1433. background: #fff;
  1434. border: 1px solid rgba(0, 0, 0, 10%);
  1435. border-radius: 40px;
  1436. &-green {
  1437. background: rgba(255, 255, 255, 10%);
  1438. border: 1px solid rgba(0, 0, 0, 10%);
  1439. }
  1440. }
  1441. }
  1442. }
  1443. .op-btn {
  1444. box-sizing: border-box;
  1445. display: flex;
  1446. align-items: center;
  1447. justify-content: center;
  1448. width: 56px;
  1449. height: 56px;
  1450. margin-left: 32px;
  1451. cursor: pointer;
  1452. background: #fff;
  1453. border: 1px solid rgba(0, 0, 0, 10%);
  1454. border-radius: 100%;
  1455. &-green {
  1456. background: rgba(255, 255, 255, 10%);
  1457. border: 1px solid rgba(0, 0, 0, 10%);
  1458. }
  1459. &.close-btn {
  1460. background: #274533;
  1461. border: 1px solid rgba(0, 0, 0, 10%);
  1462. }
  1463. > span {
  1464. width: 24px;
  1465. height: 24px;
  1466. &.close-icon {
  1467. background: url('@/assets/icon/cross-24-normal-black.png') no-repeat left top;
  1468. background-size: 100% 100%;
  1469. &-white {
  1470. background: url('@/assets/icon/cross-24-normal-white.png') no-repeat left top;
  1471. background-size: 100% 100%;
  1472. }
  1473. }
  1474. }
  1475. }
  1476. .repeat-icon {
  1477. background: url('@/assets/icon/Repeat-24-normal-red.png') no-repeat left top;
  1478. background-size: 100% 100%;
  1479. &.disabled {
  1480. background: url('@/assets/icon/Repeat-24-disable-Black.png') no-repeat left top;
  1481. background-size: 100% 100%;
  1482. }
  1483. &-yellow {
  1484. background: url('@/assets/icon/Repeat-24-normal-yellow.png') no-repeat left top;
  1485. background-size: 100% 100%;
  1486. }
  1487. &.auto-icon {
  1488. background: url('@/assets/icon/Auto-24-next-red.png') no-repeat left top;
  1489. background-size: 100% 100%;
  1490. &-yellow {
  1491. background: url('@/assets/icon/Auto-24-next-yellow.png') no-repeat left top;
  1492. background-size: 100% 100%;
  1493. }
  1494. }
  1495. }
  1496. .pinyin-icon {
  1497. background: url('@/assets/icon/pinyin-24-normal-red.png') no-repeat left top;
  1498. background-size: 100% 100%;
  1499. &.disabled {
  1500. background: url('@/assets/icon/pinyin-24-disable-Black.png') no-repeat left top;
  1501. background-size: 100% 100%;
  1502. }
  1503. &-yellow {
  1504. background: url('@/assets/icon/pinyin-24-normal-yellow.png') no-repeat left top;
  1505. background-size: 100% 100%;
  1506. }
  1507. }
  1508. .en-icon {
  1509. background: url('@/assets/icon/EN-24-normal-Red.png') no-repeat left top;
  1510. background-size: 100% 100%;
  1511. &.disabled {
  1512. background: url('@/assets/icon/EN-24-disable-Black.png') no-repeat left top;
  1513. background-size: 100% 100%;
  1514. }
  1515. &-yellow {
  1516. background: url('@/assets/icon/EN-24-normal-yellow.png') no-repeat left top;
  1517. background-size: 100% 100%;
  1518. }
  1519. }
  1520. .coll-icon {
  1521. background: url('@/assets/icon/bookmarkfill-24-normal-red.png') no-repeat left top;
  1522. background-size: 100% 100%;
  1523. &.disabled {
  1524. background: url('@/assets/icon/bookmarkfill-24-disable-Black.png') no-repeat left top;
  1525. background-size: 100% 100%;
  1526. }
  1527. &-yellow {
  1528. background: url('@/assets/icon/bookmarkfill-24-normal-yellow.png') no-repeat left top;
  1529. background-size: 100% 100%;
  1530. }
  1531. }
  1532. .keyboard-icon {
  1533. background: url('@/assets/icon/enter-24-keyboard-red.png') no-repeat left top;
  1534. background-size: 100% 100%;
  1535. &.disabled {
  1536. background: url('@/assets/icon/enter-24-keyboard-disable-Black.png') no-repeat left top;
  1537. background-size: 100% 100%;
  1538. }
  1539. &-yellow {
  1540. background: url('@/assets/icon/enter-24-keyboard-yellow.png') no-repeat left top;
  1541. background-size: 100% 100%;
  1542. }
  1543. }
  1544. &-content {
  1545. box-sizing: border-box;
  1546. display: flex;
  1547. flex: 1;
  1548. align-items: center;
  1549. width: 100%;
  1550. .vc-box {
  1551. padding: 0 8px 0 36px;
  1552. &-right {
  1553. padding: 0 36px 0 8px;
  1554. }
  1555. }
  1556. .vc-left {
  1557. width: 64px;
  1558. height: 64px;
  1559. cursor: pointer;
  1560. &-grey {
  1561. background: url('@/assets/left-grey.png') no-repeat left top;
  1562. background-size: 100% 100%;
  1563. }
  1564. &-black {
  1565. background: url('@/assets/left-black.png') no-repeat left top;
  1566. background-size: 100% 100%;
  1567. }
  1568. &-white {
  1569. background: url('@/assets/left-white.png') no-repeat left top;
  1570. background-size: 100% 100%;
  1571. }
  1572. &.hidden {
  1573. visibility: hidden;
  1574. }
  1575. }
  1576. .vc-right {
  1577. width: 64px;
  1578. height: 64px;
  1579. cursor: pointer;
  1580. &-grey {
  1581. background: url('@/assets/right-grey.png') no-repeat left top;
  1582. background-size: 100% 100%;
  1583. }
  1584. &-black {
  1585. background: url('@/assets/right-black.png') no-repeat left top;
  1586. background-size: 100% 100%;
  1587. }
  1588. &-white {
  1589. background: url('@/assets/right-white.png') no-repeat left top;
  1590. background-size: 100% 100%;
  1591. }
  1592. }
  1593. .vc-main {
  1594. width: fit-content;
  1595. padding: 0 67px;
  1596. margin: 0 auto;
  1597. .enwords {
  1598. padding: 0 3px;
  1599. margin-top: 24px;
  1600. font-family: 'Helvetica';
  1601. font-size: 24px;
  1602. line-height: 32px;
  1603. color: rgba(0, 0, 0, 45%);
  1604. word-break: break-word;
  1605. &-green {
  1606. color: rgba(255, 255, 255, 65%);
  1607. }
  1608. }
  1609. }
  1610. .NNPE-words {
  1611. float: left;
  1612. user-select: none;
  1613. &-box {
  1614. float: left;
  1615. > span {
  1616. display: block;
  1617. &.NNPE-pinyin {
  1618. box-sizing: border-box;
  1619. font-family: 'GB-PINYINOK-B';
  1620. font-size: 32px;
  1621. font-weight: normal;
  1622. line-height: 1.25;
  1623. color: rgba(0, 0, 0, 85%);
  1624. &.bottom {
  1625. padding-bottom: 16px;
  1626. }
  1627. &.noFont {
  1628. font-family: initial;
  1629. }
  1630. &.textLeft {
  1631. text-align: left;
  1632. }
  1633. &.font-white {
  1634. color: #fff;
  1635. }
  1636. &.wordBlank {
  1637. color: rgba(0, 0, 0, 85%);
  1638. }
  1639. }
  1640. &.NNPE-chs {
  1641. display: flex;
  1642. flex-flow: wrap; // 兼容不是汉字的内容
  1643. font-family: '楷体';
  1644. font-size: 48px;
  1645. line-height: 1.17;
  1646. color: rgba(0, 0, 0, 85%);
  1647. &.bottom {
  1648. padding-bottom: 16px;
  1649. }
  1650. .font-white {
  1651. color: #fff;
  1652. }
  1653. .active {
  1654. color: #de4444;
  1655. &-yellow {
  1656. color: #ffc600;
  1657. }
  1658. }
  1659. .wordActive {
  1660. color: #de4444;
  1661. }
  1662. .wordActive-blue {
  1663. color: #ffc600;
  1664. }
  1665. .newActive {
  1666. color: #de4444;
  1667. }
  1668. }
  1669. // &.padding {
  1670. // padding-right: 6px;
  1671. // }
  1672. }
  1673. }
  1674. &.textLeft {
  1675. text-align: left;
  1676. }
  1677. &.textCenter {
  1678. text-align: center;
  1679. }
  1680. &.textRight {
  1681. text-align: right;
  1682. }
  1683. > span {
  1684. display: block;
  1685. &.NNPE-pinyin {
  1686. box-sizing: border-box;
  1687. font-family: 'GB-PINYINOK-B';
  1688. font-size: 32px;
  1689. font-weight: normal;
  1690. line-height: 1.25;
  1691. color: rgba(0, 0, 0, 85%);
  1692. &.bottom {
  1693. padding-bottom: 16px;
  1694. }
  1695. &.font-white {
  1696. color: #fff;
  1697. }
  1698. &.noFont {
  1699. font-family: initial;
  1700. }
  1701. &.textLeft {
  1702. text-align: left;
  1703. }
  1704. &.wordBlank {
  1705. color: rgba(0, 0, 0, 85%);
  1706. }
  1707. }
  1708. &.NNPE-chs {
  1709. display: flex;
  1710. flex-flow: wrap; // 兼容不是汉字的内容
  1711. font-family: '楷体';
  1712. font-size: 48px;
  1713. line-height: 1.17;
  1714. color: rgba(0, 0, 0, 85%);
  1715. &.bottom {
  1716. padding-bottom: 16px;
  1717. }
  1718. .font-white {
  1719. color: #fff;
  1720. }
  1721. .active {
  1722. color: #de4444;
  1723. &-yellow {
  1724. color: #ffc600;
  1725. }
  1726. }
  1727. .wordActive {
  1728. color: #de4444;
  1729. }
  1730. .wordActive-blue {
  1731. color: #ffc600;
  1732. }
  1733. .newActive {
  1734. color: #de4444;
  1735. }
  1736. }
  1737. &.padding {
  1738. padding-right: 3px;
  1739. padding-left: 3px;
  1740. }
  1741. }
  1742. }
  1743. }
  1744. &-bottom {
  1745. box-sizing: border-box;
  1746. display: flex;
  1747. align-items: center;
  1748. justify-content: space-between;
  1749. width: 100%;
  1750. height: 136px;
  1751. padding-right: 40px;
  1752. .voicefull-bottom-show {
  1753. display: flex;
  1754. align-items: center;
  1755. justify-content: space-between;
  1756. width: 100%;
  1757. height: 136px;
  1758. visibility: visible;
  1759. }
  1760. .voicefull-bottom-hidden {
  1761. display: flex;
  1762. align-items: center;
  1763. justify-content: space-between;
  1764. width: 100%;
  1765. height: 136px;
  1766. visibility: hidden;
  1767. }
  1768. .bottom-left {
  1769. display: flex;
  1770. align-items: center;
  1771. justify-content: flex-start;
  1772. &-margin {
  1773. margin-left: 40px;
  1774. }
  1775. .compare-box {
  1776. box-sizing: border-box;
  1777. height: 56px;
  1778. padding: 16px;
  1779. border: 1px solid rgba(0, 0, 0, 10%);
  1780. border-left: 0 solid rgba(0, 0, 0, 10%);
  1781. border-radius: 0 40px 40px 0;
  1782. &-white {
  1783. background: rgba(255, 255, 255, 10%);
  1784. border: 1px solid rgba(0, 0, 0, 10%);
  1785. border-left: 0;
  1786. }
  1787. &-answer {
  1788. border-radius: 40px;
  1789. }
  1790. }
  1791. }
  1792. .page-count {
  1793. box-sizing: border-box;
  1794. min-width: 60px;
  1795. padding: 8px;
  1796. font-family: 'robot';
  1797. font-size: 16px;
  1798. line-height: 24px;
  1799. color: #000;
  1800. text-align: center;
  1801. background: #fff;
  1802. border-radius: 8px;
  1803. &-green {
  1804. color: #fff;
  1805. background: rgba(255, 255, 255, 20%);
  1806. }
  1807. }
  1808. }
  1809. }
  1810. .word-play-audio {
  1811. position: absolute;
  1812. left: -1000px;
  1813. }
  1814. </style>
  1815. <style lang="scss">
  1816. .NPC-Big-Book-preview-green {
  1817. .bg1 {
  1818. .repeat-icon {
  1819. background: url('@/assets/icon/Repeat-24-normal-Green.png') no-repeat left top;
  1820. background-size: 100% 100%;
  1821. }
  1822. .pinyin-icon {
  1823. background: url('@/assets/icon/pinyin-24-normal-green.png') no-repeat left top;
  1824. background-size: 100% 100%;
  1825. }
  1826. .en-icon {
  1827. background: url('@/assets/icon/EN-24-normal-Green.png') no-repeat left top;
  1828. background-size: 100% 100%;
  1829. }
  1830. .coll-icon {
  1831. background: url('@/assets/icon/bookmarkfill-24-normal-green.png') no-repeat left top;
  1832. background-size: 100% 100%;
  1833. }
  1834. }
  1835. }
  1836. .NPC-Big-Book-preview-brown {
  1837. .bg1 {
  1838. .repeat-icon {
  1839. background: url('@/assets/icon/Repeat-24-normal-Brown.png') no-repeat left top;
  1840. background-size: 100% 100%;
  1841. }
  1842. .pinyin-icon {
  1843. background: url('@/assets/icon/pinyin-24-normal-brown.png') no-repeat left top;
  1844. background-size: 100% 100%;
  1845. }
  1846. .en-icon {
  1847. background: url('@/assets/icon/EN-24-normal-Brown.png') no-repeat left top;
  1848. background-size: 100% 100%;
  1849. }
  1850. .coll-icon {
  1851. background: url('@/assets/icon/bookmarkfill-24-normal-brown.png') no-repeat left top;
  1852. background-size: 100% 100%;
  1853. }
  1854. }
  1855. }
  1856. </style>