Voicefullscreen.vue 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997
  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. 'attrib',
  612. ],
  613. data() {
  614. return {
  615. pySize: 32,
  616. hzSize: 48,
  617. enSize: 24,
  618. bgIndex: 1,
  619. maxTime: 0,
  620. item: null,
  621. bg: 0,
  622. ed: 0,
  623. isRepeat: false,
  624. NumberList: ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳'],
  625. chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '、'],
  626. enFhList: [',', '.', ';', '?', '!', ':', '>', '<'],
  627. curTime: 0,
  628. wavblob: null,
  629. stopAudio: false,
  630. isRecord: false,
  631. isShowCompare: false,
  632. isShowRight: false,
  633. isShowLeft: false,
  634. curSentIndex: 0,
  635. oldHz: '',
  636. hz: '',
  637. clientY: 0,
  638. top: 0,
  639. left: 0,
  640. newWordList: [],
  641. pinyin: '',
  642. wordIndex: -1,
  643. isShow: false,
  644. wordbg: 0,
  645. worded: 0,
  646. wordbgs: 0,
  647. wordeds: 0,
  648. wordMaxTime: 0,
  649. isWordPlay: false,
  650. isNewWordPlay: false,
  651. curWordTime: 0,
  652. isPlaying: false,
  653. isAuto: false,
  654. key: 'isRepeat',
  655. isKeyboard: true,
  656. isTopShow: false,
  657. isBottomShow: false,
  658. isRecording: false,
  659. recordPlaying: false,
  660. isCollArr: [],
  661. enwords: '',
  662. screenHeight: 0,
  663. wordPlayMp3: '',
  664. };
  665. },
  666. computed: {
  667. // isPlaying: function () {
  668. // let playing = false;
  669. // if (this.$refs.audioLineSent) {
  670. // playing = this.$refs.audioLineSent.audio.isPlaying;
  671. // }
  672. // console.log(playing);
  673. // return playing;
  674. // },
  675. },
  676. watch: {
  677. isRecording: {
  678. handler(newVal, oldVal) {
  679. if (newVal) {
  680. this.isBottomShow = newVal;
  681. }
  682. },
  683. deep: true,
  684. },
  685. recordPlaying: {
  686. handler(newVal, oldVal) {
  687. if (newVal) {
  688. this.isBottomShow = newVal;
  689. }
  690. },
  691. deep: true,
  692. },
  693. sentIndex: {
  694. handler(newVal, oldVal) {
  695. this.curSentIndex = newVal;
  696. this.getSentence();
  697. },
  698. deep: true,
  699. },
  700. hz: {
  701. handler(val, oldVal) {
  702. let _this = this;
  703. if (val) {
  704. _this.handleNewWords(val);
  705. }
  706. },
  707. // 深度观察监听
  708. deep: true,
  709. },
  710. isShow: {
  711. handler(val, oldVal) {
  712. let _this = this;
  713. if (val) {
  714. setTimeout(() => {
  715. _this.cardHeight = _this.$refs.wordcard.offsetHeight;
  716. if (_this.screenHeight - _this.clientY > _this.cardHeight) {
  717. _this.top = _this.clientY + 20;
  718. } else {
  719. _this.top = _this.clientY - _this.cardHeight - 30;
  720. }
  721. }, 50);
  722. }
  723. },
  724. // 深度观察监听
  725. deep: true,
  726. },
  727. },
  728. // 生命周期 - 创建完成(可以访问当前this实例)
  729. created() {},
  730. // 生命周期 - 挂载完成(可以访问DOM元素)
  731. mounted() {
  732. let _this = this;
  733. window.addEventListener('resize', this.getScreenHeight);
  734. _this.getScreenHeight();
  735. document.addEventListener('keyup', function (e) {
  736. if (_this.isKeyboard) {
  737. if (e.keyCode == 32) {
  738. // 空格
  739. _this.$nextTick(() => {
  740. if (_this.$refs.audioLineSent) {
  741. _this.$refs.audioLineSent.PlayAudio();
  742. }
  743. });
  744. } else if (e.keyCode == 38) {
  745. _this.prevSentence();
  746. } else if (e.keyCode == 40) {
  747. _this.nextSentence();
  748. } else if (e.keyCode == 13) {
  749. _this.$nextTick(() => {
  750. _this.$refs.Soundrecorddiff.microphone();
  751. });
  752. }
  753. }
  754. });
  755. if (_this.NNPENewWordList) {
  756. _this.handleNewword();
  757. }
  758. _this.curSentIndex = _this.sentIndex;
  759. _this.getSentence();
  760. document.addEventListener('fullscreenchange', () => {
  761. let isFullscreen =
  762. document.fullscreenElement ||
  763. document.mozFullScreenElement ||
  764. document.webkitFullscreenElement ||
  765. document.fullScreen ||
  766. document.mozFullScreen ||
  767. document.webkitIsFullScreen;
  768. if (!isFullscreen) {
  769. _this.changeFullScreen();
  770. }
  771. });
  772. document.addEventListener('mozfullscreenchange', () => {
  773. let isFullscreen =
  774. document.fullscreenElement ||
  775. document.mozFullScreenElement ||
  776. document.webkitFullscreenElement ||
  777. document.fullScreen ||
  778. document.mozFullScreen ||
  779. document.webkitIsFullScreen;
  780. if (!isFullscreen) {
  781. _this.changeFullScreen();
  782. }
  783. });
  784. document.addEventListener('webkitfullscreenchange', () => {
  785. let isFullscreen =
  786. document.fullscreenElement ||
  787. document.mozFullScreenElement ||
  788. document.webkitFullscreenElement ||
  789. document.fullScreen ||
  790. document.mozFullScreen ||
  791. document.webkitIsFullScreen;
  792. if (!isFullscreen) {
  793. _this.changeFullScreen();
  794. }
  795. });
  796. document.addEventListener('msfullscreenchange', () => {
  797. let isFullscreen =
  798. document.fullscreenElement ||
  799. document.mozFullScreenElement ||
  800. document.webkitFullscreenElement ||
  801. document.fullScreen ||
  802. document.mozFullScreen ||
  803. document.webkitIsFullScreen;
  804. if (!isFullscreen) {
  805. _this.changeFullScreen();
  806. }
  807. });
  808. },
  809. beforeCreate() {}, // 生命周期 - 创建之前
  810. beforeMount() {}, // 生命周期 - 挂载之前
  811. beforeUpdate() {}, // 生命周期 - 更新之前
  812. updated() {}, // 生命周期 - 更新之后
  813. beforeDestroy() {
  814. window.removeEventListener('resize', this.getScreenHeight);
  815. }, // 生命周期 - 销毁之前
  816. destroyed() {}, // 生命周期 - 销毁完成
  817. activated() {},
  818. // 方法集合
  819. methods: {
  820. setTopShow(bool) {
  821. this.isTopShow = bool;
  822. },
  823. setBottomShow(bool) {
  824. if (!this.recordPlaying && !this.isRecording) {
  825. this.isBottomShow = bool;
  826. }
  827. },
  828. getPlayStatus(bool) {
  829. this.recordPlaying = bool;
  830. },
  831. setFontSize(type) {
  832. let _this = this;
  833. if (type == '-') {
  834. if (_this.hzSize >= 34) {
  835. this.hzSize -= 4;
  836. }
  837. }
  838. if (type == '+') {
  839. if (_this.hzSize <= 76) {
  840. this.hzSize += 4;
  841. }
  842. }
  843. _this.pySize = parseInt(_this.hzSize / 1.5);
  844. _this.enSize = parseInt(_this.hzSize / 2);
  845. },
  846. playChange(bool) {
  847. this.isPlaying = bool;
  848. },
  849. handleColl() {
  850. let _this = this;
  851. if (_this.isCollArr[_this.curSentIndex]) {
  852. _this.cancleColl();
  853. } else {
  854. _this.addColl();
  855. }
  856. },
  857. // 添加收藏
  858. addColl() {
  859. let Bookdetail = sessionStorage.getItem('Bookdetail');
  860. // if (Bookdetail) {
  861. Bookdetail = JSON.parse(Bookdetail);
  862. let MethodName = 'order-collection_manager-AddMyCollection';
  863. let text = '';
  864. this.item.forEach((item) => {
  865. if (item.chs != '#') {
  866. text += item.chs;
  867. }
  868. });
  869. let sentence_json = {
  870. item: JSON.stringify(this.item),
  871. bg: this.bg,
  872. ed: this.ed,
  873. mp3: this.mp3,
  874. pyPosition: this.curQue.property.pinyin_position,
  875. };
  876. let data = {
  877. goods_id: this.currentTreeID,
  878. goods_type: 502,
  879. goods_name: Bookdetail.name,
  880. goods_person_name_desc: Bookdetail.author ? Bookdetail.author : '',
  881. goods_picture_id: Bookdetail.picture_id ? Bookdetail.picture_id : '',
  882. goods_price: Bookdetail.price,
  883. sentence: {
  884. sentence_text: text,
  885. sentence_json: JSON.stringify(sentence_json),
  886. },
  887. };
  888. LearnWebSI(MethodName, data).then((res) => {
  889. this.$set(this.isCollArr, this.curSentIndex, true);
  890. this.$message.success('收藏成功!');
  891. });
  892. // } else {
  893. // this.$message.warning('权限不足!');
  894. // }
  895. },
  896. // 取消收藏
  897. cancleColl() {
  898. let text = '';
  899. this.item.forEach((item) => {
  900. if (item.chs != '#') {
  901. text += item.chs;
  902. }
  903. });
  904. let MethodName = 'order-collection_manager-CancelMyGoodsCollection_WS';
  905. let data = {
  906. goods_type: 502,
  907. goods_list: [
  908. {
  909. goods_id: this.currentTreeID, // 课件的id
  910. sentence_text: text,
  911. },
  912. ],
  913. };
  914. LearnWebSI(MethodName, data).then((res) => {
  915. this.$set(this.isCollArr, this.curSentIndex, false);
  916. this.$message.success('取消成功!');
  917. });
  918. },
  919. // 检查收藏状态
  920. checkCollStatus() {
  921. let text = '';
  922. this.item.forEach((item) => {
  923. if (item.chs != '#') {
  924. text += item.chs;
  925. }
  926. });
  927. let MethodName = 'order-collection_manager-CheckMyGoodsCollectionStatus';
  928. let data = {
  929. goods_type: 502,
  930. goods_id: this.currentTreeID, // 课件的id
  931. sentence_text: text,
  932. };
  933. LearnWebSI(MethodName, data).then((res) => {
  934. let collFlag = res.is_collection == 'true';
  935. this.$set(this.isCollArr, this.curSentIndex, collFlag);
  936. });
  937. },
  938. showPrevNext(bool, key) {
  939. this[key] = bool;
  940. },
  941. prevSentence() {
  942. let _this = this;
  943. if (_this.curSentIndex == 0) {
  944. // _this.$message.warning("已经是第一个句子了");
  945. return;
  946. }
  947. _this.curSentIndex -= 1;
  948. _this.getSentence();
  949. if (_this.isAuto) {
  950. _this.curTime = _this.bg;
  951. _this.$refs.audioLineSent.onTimeupdateTime(_this.bg / 1000);
  952. }
  953. },
  954. nextSentence() {
  955. if (this.curSentIndex == this.sentList.length - 1) {
  956. // this.$message.warning("已经是最后一个句子了");
  957. return;
  958. }
  959. this.curSentIndex += 1;
  960. this.getSentence();
  961. },
  962. rollSentence() {
  963. if (this.curSentIndex == this.sentList.length - 1) {
  964. this.curSentIndex = 0;
  965. } else {
  966. this.curSentIndex += 1;
  967. }
  968. this.getSentence();
  969. },
  970. changeStatus(key) {
  971. if (key == 'config.isShowEN') {
  972. if (this.enwords) {
  973. this[key] = !this[key];
  974. }
  975. } else {
  976. this[key] = !this[key];
  977. }
  978. },
  979. changePinyin() {
  980. this.$emit('changePinyin');
  981. },
  982. changeEN() {
  983. this.$emit('changeEN');
  984. },
  985. setStatus() {
  986. let _this = this;
  987. if (_this.key == 'isRepeat') {
  988. if (_this.isRepeat) {
  989. _this.isRepeat = false;
  990. _this.isAuto = true;
  991. _this.key = 'isAuto';
  992. } else {
  993. _this.isRepeat = true;
  994. _this.key = 'isRepeat';
  995. }
  996. } else if (_this.key == 'isAuto') {
  997. if (_this.isAuto) {
  998. _this.isRepeat = false;
  999. _this.isAuto = false;
  1000. _this.key = 'isRepeat';
  1001. }
  1002. }
  1003. },
  1004. getRerordStatus(bool) {
  1005. this.isShowCompare = bool;
  1006. },
  1007. getMicrophoneStatus(bool) {
  1008. this.isRecording = bool;
  1009. },
  1010. getWavblob(wavblob) {
  1011. this.wavblob = wavblob;
  1012. },
  1013. sentPause(isRecord) {
  1014. this.isRecord = isRecord;
  1015. },
  1016. getCurTime(curTime) {
  1017. let _this = this;
  1018. if (_this.isRepeat) {
  1019. let time = curTime * 1000;
  1020. if (time > _this.ed || time < _this.bg) {
  1021. _this.curTime = _this.bg;
  1022. this.$refs.audioLineSent.onTimeupdateTime(_this.bg / 1000);
  1023. } else {
  1024. _this.curTime = curTime * 1000;
  1025. }
  1026. } else if (_this.isAuto) {
  1027. let time = curTime * 1000;
  1028. if (time > _this.ed) {
  1029. _this.rollSentence();
  1030. _this.curTime = _this.bg;
  1031. _this.$refs.audioLineSent.onTimeupdateTime(_this.bg / 1000);
  1032. } else {
  1033. _this.curTime = curTime * 1000;
  1034. }
  1035. } else {
  1036. _this.curTime = curTime * 1000;
  1037. }
  1038. },
  1039. getCurCompareTime(curTime) {
  1040. let _this = this;
  1041. _this.curTime = curTime * 1000;
  1042. },
  1043. getCurWordTime(curTime) {
  1044. let _this = this;
  1045. _this.curWordTime = curTime * 1000;
  1046. },
  1047. changeBg(bgIndex) {
  1048. this.bgIndex = bgIndex;
  1049. },
  1050. getSentence() {
  1051. let _this = this;
  1052. _this.isShowCompare =
  1053. _this.curQue.Bookanswer.practiceModel[_this.curSentIndex] &&
  1054. _this.curQue.Bookanswer.practiceModel[_this.curSentIndex].recordList &&
  1055. _this.curQue.Bookanswer.practiceModel[_this.curSentIndex].recordList.length > 0;
  1056. _this.pauseAudio();
  1057. _this.isPlaying = false;
  1058. let item = JSON.parse(JSON.stringify(_this.sentList[_this.curSentIndex]));
  1059. if (item.sentArr) {
  1060. _this.item = item.sentArr;
  1061. _this.enwords = item.enwords;
  1062. } else {
  1063. _this.item = item;
  1064. }
  1065. _this.sentList.forEach((item) => {
  1066. this.isCollArr.push(false);
  1067. });
  1068. _this.bg =
  1069. _this.curQue.wordTime && _this.curQue.wordTime[_this.curSentIndex]
  1070. ? _this.curQue.wordTime[_this.curSentIndex].bg
  1071. : 0;
  1072. _this.ed =
  1073. _this.curQue.wordTime && _this.curQue.wordTime[_this.curSentIndex]
  1074. ? _this.curQue.wordTime[_this.curSentIndex].ed
  1075. : 0;
  1076. let maxTime = (_this.ed - _this.bg) / 1000;
  1077. if (maxTime < 1) {
  1078. _this.maxTime = 1;
  1079. } else {
  1080. _this.maxTime = maxTime;
  1081. }
  1082. // _this.checkCollStatus();
  1083. },
  1084. pauseAudio() {
  1085. let audio = document.getElementsByTagName('audio');
  1086. if (audio && audio.length > 0 && window.location.href.indexOf('GCLS-Learn') == -1 && audio.forEach) {
  1087. audio.forEach((item) => {
  1088. item.pause();
  1089. });
  1090. }
  1091. },
  1092. exitFullScreen() {
  1093. this.pauseAudio();
  1094. this.$emit('exitFullscreen');
  1095. },
  1096. changeFullScreen() {
  1097. this.pauseAudio();
  1098. this.$emit('changeIsFull');
  1099. },
  1100. handleWav(list, tmIndex) {
  1101. tmIndex = tmIndex || 0;
  1102. this.$emit('handleWav', list, tmIndex);
  1103. },
  1104. // 录音时暂停音频播放
  1105. handleParentPlay() {
  1106. this.stopAudio = true;
  1107. },
  1108. // 音频播放时改变布尔值
  1109. handleChangeStopAudio() {
  1110. this.stopAudio = false;
  1111. },
  1112. // 播放音频
  1113. // playWord(item) {
  1114. // let _this = this;
  1115. // if (this.newWordList.indexOf(item.chs) > -1 || item.words) {
  1116. // _this.pauseAudio();
  1117. // _this.isWordPlay = false;
  1118. // _this.wordIndex = item.wordIndex;
  1119. // setTimeout(() => {
  1120. // let leg = item.timeList.length;
  1121. // _this.wordbg = item.timeList[0].wordBg;
  1122. // _this.worded = item.timeList[leg - 1].wordEd;
  1123. // let wordMaxTime = (_this.worded - _this.wordbg) / 1000;
  1124. // if (wordMaxTime < 1) {
  1125. // _this.wordMaxTime = 1;
  1126. // } else {
  1127. // _this.wordMaxTime = wordMaxTime;
  1128. // }
  1129. // _this.isWordPlay = true;
  1130. // }, 50);
  1131. // }
  1132. // },
  1133. playWord(item) {
  1134. let _this = this;
  1135. if (this.newWordList.indexOf(item.chs) > -1 || item.words) {
  1136. _this.pauseAudio();
  1137. _this.isNewWordPlay = false;
  1138. let new_word = item.words ? item.words : item.chs;
  1139. _this.NNPENewWordList.forEach((itemn) => {
  1140. // items.forEach((itemn) => {
  1141. if (itemn.new_word === new_word) {
  1142. _this.wordbg = itemn.bg;
  1143. _this.worded = itemn.ed;
  1144. _this.wordPlayMp3 = itemn.newWordMp3;
  1145. }
  1146. // });
  1147. });
  1148. setTimeout(() => {
  1149. _this.isNewWordPlay = true;
  1150. }, 50);
  1151. }
  1152. },
  1153. changePlayStatus() {
  1154. this.isWordPlay = false;
  1155. this.isNewWordPlay = false;
  1156. this.wordIndex = -1;
  1157. },
  1158. showWordDetail(e, item) {
  1159. let _this = this;
  1160. if (_this.TaskModel == 'ANSWER') {
  1161. return;
  1162. }
  1163. if (_this.chsFhList.indexOf(item.chs) > -1 || /^[a-zA-Z0-9]/.test(item.chs)) {
  1164. return;
  1165. }
  1166. if (_this.oldHz != item.chs) {
  1167. this.isShow = false;
  1168. setTimeout(() => {
  1169. _this.hz = item.words ? item.words : item.chs;
  1170. _this.pinyin = item.pinyin;
  1171. _this.wordIndex = item.wordIndex;
  1172. }, 50);
  1173. }
  1174. _this.clientY = e.clientY;
  1175. let new_word = item.words ? item.words : item.chs;
  1176. _this.wordPlayMp3 = '';
  1177. _this.NNPENewWordList.forEach((itemn) => {
  1178. // items.forEach((itemn) => {
  1179. if (itemn.new_word === new_word) {
  1180. _this.wordbgs = itemn.bg;
  1181. _this.wordeds = itemn.ed;
  1182. _this.wordPlayMp3 = itemn.newWordMp3;
  1183. }
  1184. // });
  1185. });
  1186. let left = e.clientX;
  1187. let width = 0;
  1188. if (item.chs.length == 1 || item.chs.length == 2) {
  1189. width = 304;
  1190. } else if (item.chs.length == 3 || item.chs.length == 4) {
  1191. width = 432;
  1192. } else if (item.chs.length > 3) {
  1193. width = 560;
  1194. }
  1195. // if (left - this.bodyLeft > this.contentWidth / 2) {
  1196. // _this.left = left - width + 10;
  1197. // } else {
  1198. _this.left = left - width / 2;
  1199. // }
  1200. },
  1201. changeWordCard(isShow) {
  1202. let _this = this;
  1203. _this.isShow = isShow;
  1204. _this.oldHz = '';
  1205. _this.hz = '';
  1206. _this.wordIndex = -1;
  1207. },
  1208. // 处理分词数据
  1209. handleNewWords(val) {
  1210. let _this = this;
  1211. _this.isShow = true;
  1212. _this.word = null;
  1213. if (_this.newWordList.indexOf(val) > -1) {
  1214. for (let i = 0; i < this.NNPENewWordList.length; i++) {
  1215. let pItem = this.NNPENewWordList[i];
  1216. for (let j = 0; j < pItem.length; j++) {
  1217. let item = pItem[j];
  1218. if (item.new_word.trim() == val.trim()) {
  1219. let wordlist = val.split('');
  1220. this.word = { list: wordlist, detail: item };
  1221. break;
  1222. }
  1223. }
  1224. }
  1225. } else {
  1226. let wordlist = val.split('');
  1227. let option = {
  1228. definition_list: [],
  1229. mp3_list: [],
  1230. new_word: val,
  1231. pinyin: _this.pinyin,
  1232. };
  1233. _this.word = { list: wordlist, detail: option };
  1234. }
  1235. _this.oldHz = val;
  1236. },
  1237. handleNewword() {
  1238. let NewWordList = [];
  1239. this.NNPENewWordList.forEach((wItem) => {
  1240. // item.forEach((wItem) => {
  1241. NewWordList.push(wItem.new_word);
  1242. // });
  1243. });
  1244. this.newWordList = JSON.parse(JSON.stringify(NewWordList));
  1245. },
  1246. getScreenHeight() {
  1247. this.screenHeight = window.innerHeight;
  1248. },
  1249. }, // 如果页面有keep-alive缓存功能,这个函数会触发
  1250. };
  1251. </script>
  1252. <style lang="scss" scoped>
  1253. //@import url(); 引入公共css类
  1254. .voicefull {
  1255. display: flex;
  1256. flex-direction: column;
  1257. width: 100%;
  1258. height: 100vh;
  1259. overflow: hidden;
  1260. .NNPE-wordDetail {
  1261. position: fixed;
  1262. top: 50%;
  1263. z-index: 9999;
  1264. margin-top: -196px;
  1265. // box-shadow: 0 4px 16px rgba(0, 0, 0, 15%);
  1266. }
  1267. &.bg1 {
  1268. background: #fff;
  1269. }
  1270. &.bg2 {
  1271. background: linear-gradient(180deg, #274533 0%, #385f45 100%);
  1272. .newActive {
  1273. color: #ffc600 !important;
  1274. }
  1275. }
  1276. &-top {
  1277. box-sizing: border-box;
  1278. width: 100%;
  1279. height: 136px;
  1280. padding: 0 40px;
  1281. .voicefull-top-hidden {
  1282. display: flex;
  1283. align-items: center;
  1284. justify-content: space-between;
  1285. width: 100%;
  1286. height: 136px;
  1287. visibility: hidden;
  1288. }
  1289. .voicefull-top-show {
  1290. display: flex;
  1291. align-items: center;
  1292. justify-content: space-between;
  1293. width: 100%;
  1294. height: 136px;
  1295. visibility: visible;
  1296. }
  1297. .top-left {
  1298. display: flex;
  1299. align-items: center;
  1300. justify-content: flex-start;
  1301. }
  1302. .select-bg {
  1303. box-sizing: border-box;
  1304. display: flex;
  1305. align-items: center;
  1306. justify-content: space-between;
  1307. justify-content: center;
  1308. width: 96px;
  1309. height: 56px;
  1310. margin-right: 32px;
  1311. border: 1px solid rgba(0, 0, 0, 10%);
  1312. border-radius: 40px;
  1313. &.select-bg-blue {
  1314. background: rgba(255, 255, 255, 10%);
  1315. border: 1px solid rgba(0, 0, 0, 10%);
  1316. }
  1317. > div {
  1318. display: flex;
  1319. align-items: center;
  1320. justify-content: center;
  1321. width: 36px;
  1322. height: 36px;
  1323. border-radius: 100%;
  1324. &.bg-white-box {
  1325. margin-right: 4px;
  1326. background: 0 0;
  1327. &.active {
  1328. background: #de4444;
  1329. }
  1330. }
  1331. &.bg-green-box {
  1332. background: #fff;
  1333. &.active {
  1334. background: #ffc600;
  1335. }
  1336. }
  1337. > span {
  1338. box-sizing: border-box;
  1339. width: 24px;
  1340. height: 24px;
  1341. cursor: pointer;
  1342. border-radius: 100%;
  1343. &.bg-white {
  1344. background: #fff;
  1345. }
  1346. &.bg-green {
  1347. background: linear-gradient(180deg, #274533 0%, #385f45 100%);
  1348. }
  1349. }
  1350. }
  1351. }
  1352. .set-fontSize {
  1353. display: flex;
  1354. align-items: center;
  1355. justify-content: center;
  1356. height: 56px;
  1357. padding: 0 20px;
  1358. background: #fff;
  1359. border: 1px solid rgba(0, 0, 0, 10%);
  1360. border-radius: 40px;
  1361. &-green {
  1362. background: rgba(255, 255, 255, 10%);
  1363. border: 1px solid rgba(0, 0, 0, 10%);
  1364. }
  1365. > span {
  1366. width: 24px;
  1367. height: 24px;
  1368. margin: 0 4px;
  1369. &.font-jian {
  1370. &-black {
  1371. cursor: pointer;
  1372. background: url('@/assets/jian-black.png') no-repeat left top;
  1373. background-size: 100% 100%;
  1374. }
  1375. &-yellow {
  1376. cursor: pointer;
  1377. background: url('@/assets/jian-white.png') no-repeat left top;
  1378. background-size: 100% 100%;
  1379. }
  1380. &-white-disabled {
  1381. cursor: pointer;
  1382. background: url('@/assets/jian-white-disabled.png') no-repeat left top;
  1383. background-size: 100% 100%;
  1384. }
  1385. &-yellow-disabled {
  1386. cursor: pointer;
  1387. background: url('@/assets/jian-yellow-disabled.png') no-repeat left top;
  1388. background-size: 100% 100%;
  1389. }
  1390. }
  1391. &.font-img {
  1392. &-black {
  1393. background: url('@/assets/fontSize-black.png') no-repeat left top;
  1394. background-size: 100% 100%;
  1395. }
  1396. &-yellow {
  1397. background: url('@/assets/fontSize-white.png') no-repeat left top;
  1398. background-size: 100% 100%;
  1399. }
  1400. }
  1401. &.font-jia {
  1402. &-black {
  1403. cursor: pointer;
  1404. background: url('@/assets/jia-black.png') no-repeat left top;
  1405. background-size: 100% 100%;
  1406. }
  1407. &-yellow {
  1408. cursor: pointer;
  1409. background: url('@/assets/jia-white.png') no-repeat left top;
  1410. background-size: 100% 100%;
  1411. }
  1412. &-white-disabled {
  1413. cursor: pointer;
  1414. background: url('@/assets/jia-white-disabled.png') no-repeat left top;
  1415. background-size: 100% 100%;
  1416. }
  1417. &-yellow-disabled {
  1418. cursor: pointer;
  1419. background: url('@/assets/jia-yellow-disabled.png') no-repeat left top;
  1420. background-size: 100% 100%;
  1421. }
  1422. }
  1423. }
  1424. }
  1425. .top-middle {
  1426. display: flex;
  1427. align-items: center;
  1428. justify-content: center;
  1429. .audio-box {
  1430. display: flex;
  1431. align-items: center;
  1432. justify-content: center;
  1433. width: 56px;
  1434. height: 56px;
  1435. background: #fff;
  1436. border: 1px solid rgba(0, 0, 0, 10%);
  1437. border-radius: 40px;
  1438. &-green {
  1439. background: rgba(255, 255, 255, 10%);
  1440. border: 1px solid rgba(0, 0, 0, 10%);
  1441. }
  1442. }
  1443. }
  1444. }
  1445. .op-btn {
  1446. box-sizing: border-box;
  1447. display: flex;
  1448. align-items: center;
  1449. justify-content: center;
  1450. width: 56px;
  1451. height: 56px;
  1452. margin-left: 32px;
  1453. cursor: pointer;
  1454. background: #fff;
  1455. border: 1px solid rgba(0, 0, 0, 10%);
  1456. border-radius: 100%;
  1457. &-green {
  1458. background: rgba(255, 255, 255, 10%);
  1459. border: 1px solid rgba(0, 0, 0, 10%);
  1460. }
  1461. &.close-btn {
  1462. background: #274533;
  1463. border: 1px solid rgba(0, 0, 0, 10%);
  1464. }
  1465. > span {
  1466. width: 24px;
  1467. height: 24px;
  1468. &.close-icon {
  1469. background: url('@/assets/icon/cross-24-normal-black.png') no-repeat left top;
  1470. background-size: 100% 100%;
  1471. &-white {
  1472. background: url('@/assets/icon/cross-24-normal-white.png') no-repeat left top;
  1473. background-size: 100% 100%;
  1474. }
  1475. }
  1476. }
  1477. }
  1478. .repeat-icon {
  1479. background: url('@/assets/icon/Repeat-24-normal-red.png') no-repeat left top;
  1480. background-size: 100% 100%;
  1481. &.disabled {
  1482. background: url('@/assets/icon/Repeat-24-disable-Black.png') no-repeat left top;
  1483. background-size: 100% 100%;
  1484. }
  1485. &-yellow {
  1486. background: url('@/assets/icon/Repeat-24-normal-yellow.png') no-repeat left top;
  1487. background-size: 100% 100%;
  1488. }
  1489. &.auto-icon {
  1490. background: url('@/assets/icon/Auto-24-next-red.png') no-repeat left top;
  1491. background-size: 100% 100%;
  1492. &-yellow {
  1493. background: url('@/assets/icon/Auto-24-next-yellow.png') no-repeat left top;
  1494. background-size: 100% 100%;
  1495. }
  1496. }
  1497. }
  1498. .pinyin-icon {
  1499. background: url('@/assets/icon/pinyin-24-normal-red.png') no-repeat left top;
  1500. background-size: 100% 100%;
  1501. &.disabled {
  1502. background: url('@/assets/icon/pinyin-24-disable-Black.png') no-repeat left top;
  1503. background-size: 100% 100%;
  1504. }
  1505. &-yellow {
  1506. background: url('@/assets/icon/pinyin-24-normal-yellow.png') no-repeat left top;
  1507. background-size: 100% 100%;
  1508. }
  1509. }
  1510. .en-icon {
  1511. background: url('@/assets/icon/EN-24-normal-Red.png') no-repeat left top;
  1512. background-size: 100% 100%;
  1513. &.disabled {
  1514. background: url('@/assets/icon/EN-24-disable-Black.png') no-repeat left top;
  1515. background-size: 100% 100%;
  1516. }
  1517. &-yellow {
  1518. background: url('@/assets/icon/EN-24-normal-yellow.png') no-repeat left top;
  1519. background-size: 100% 100%;
  1520. }
  1521. }
  1522. .coll-icon {
  1523. background: url('@/assets/icon/bookmarkfill-24-normal-red.png') no-repeat left top;
  1524. background-size: 100% 100%;
  1525. &.disabled {
  1526. background: url('@/assets/icon/bookmarkfill-24-disable-Black.png') no-repeat left top;
  1527. background-size: 100% 100%;
  1528. }
  1529. &-yellow {
  1530. background: url('@/assets/icon/bookmarkfill-24-normal-yellow.png') no-repeat left top;
  1531. background-size: 100% 100%;
  1532. }
  1533. }
  1534. .keyboard-icon {
  1535. background: url('@/assets/icon/enter-24-keyboard-red.png') no-repeat left top;
  1536. background-size: 100% 100%;
  1537. &.disabled {
  1538. background: url('@/assets/icon/enter-24-keyboard-disable-Black.png') no-repeat left top;
  1539. background-size: 100% 100%;
  1540. }
  1541. &-yellow {
  1542. background: url('@/assets/icon/enter-24-keyboard-yellow.png') no-repeat left top;
  1543. background-size: 100% 100%;
  1544. }
  1545. }
  1546. &-content {
  1547. box-sizing: border-box;
  1548. display: flex;
  1549. flex: 1;
  1550. align-items: center;
  1551. width: 100%;
  1552. .vc-box {
  1553. padding: 0 8px 0 36px;
  1554. &-right {
  1555. padding: 0 36px 0 8px;
  1556. }
  1557. }
  1558. .vc-left {
  1559. width: 64px;
  1560. height: 64px;
  1561. cursor: pointer;
  1562. &-grey {
  1563. background: url('@/assets/left-grey.png') no-repeat left top;
  1564. background-size: 100% 100%;
  1565. }
  1566. &-black {
  1567. background: url('@/assets/left-black.png') no-repeat left top;
  1568. background-size: 100% 100%;
  1569. }
  1570. &-white {
  1571. background: url('@/assets/left-white.png') no-repeat left top;
  1572. background-size: 100% 100%;
  1573. }
  1574. &.hidden {
  1575. visibility: hidden;
  1576. }
  1577. }
  1578. .vc-right {
  1579. width: 64px;
  1580. height: 64px;
  1581. cursor: pointer;
  1582. &-grey {
  1583. background: url('@/assets/right-grey.png') no-repeat left top;
  1584. background-size: 100% 100%;
  1585. }
  1586. &-black {
  1587. background: url('@/assets/right-black.png') no-repeat left top;
  1588. background-size: 100% 100%;
  1589. }
  1590. &-white {
  1591. background: url('@/assets/right-white.png') no-repeat left top;
  1592. background-size: 100% 100%;
  1593. }
  1594. }
  1595. .vc-main {
  1596. width: fit-content;
  1597. padding: 0 67px;
  1598. margin: 0 auto;
  1599. .enwords {
  1600. padding: 0 3px;
  1601. margin-top: 24px;
  1602. font-family: 'Helvetica';
  1603. font-size: 24px;
  1604. line-height: 32px;
  1605. color: rgba(0, 0, 0, 45%);
  1606. word-break: break-word;
  1607. &-green {
  1608. color: rgba(255, 255, 255, 65%);
  1609. }
  1610. }
  1611. }
  1612. .NNPE-words {
  1613. float: left;
  1614. user-select: none;
  1615. &-box {
  1616. float: left;
  1617. > span {
  1618. display: block;
  1619. &.NNPE-pinyin {
  1620. box-sizing: border-box;
  1621. font-family: 'League';
  1622. font-size: 32px;
  1623. font-weight: normal;
  1624. line-height: 1.25;
  1625. color: rgba(0, 0, 0, 85%);
  1626. &.bottom {
  1627. padding-bottom: 16px;
  1628. }
  1629. &.noFont {
  1630. font-family: initial;
  1631. }
  1632. &.textLeft {
  1633. text-align: left;
  1634. }
  1635. &.font-white {
  1636. color: #fff;
  1637. }
  1638. &.wordBlank {
  1639. color: rgba(0, 0, 0, 85%);
  1640. }
  1641. }
  1642. &.NNPE-chs {
  1643. display: flex;
  1644. flex-flow: wrap; // 兼容不是汉字的内容
  1645. font-family: '楷体';
  1646. font-size: 48px;
  1647. line-height: 1.17;
  1648. color: rgba(0, 0, 0, 85%);
  1649. &.bottom {
  1650. padding-bottom: 16px;
  1651. }
  1652. .font-white {
  1653. color: #fff;
  1654. }
  1655. .active {
  1656. color: #de4444;
  1657. &-yellow {
  1658. color: #ffc600;
  1659. }
  1660. }
  1661. .wordActive {
  1662. color: #de4444;
  1663. }
  1664. .wordActive-blue {
  1665. color: #ffc600;
  1666. }
  1667. .newActive {
  1668. color: #de4444;
  1669. }
  1670. }
  1671. // &.padding {
  1672. // padding-right: 6px;
  1673. // }
  1674. }
  1675. }
  1676. &.textLeft {
  1677. text-align: left;
  1678. }
  1679. &.textCenter {
  1680. text-align: center;
  1681. }
  1682. &.textRight {
  1683. text-align: right;
  1684. }
  1685. > span {
  1686. display: block;
  1687. &.NNPE-pinyin {
  1688. box-sizing: border-box;
  1689. font-family: 'League';
  1690. font-size: 32px;
  1691. font-weight: normal;
  1692. line-height: 1.25;
  1693. color: rgba(0, 0, 0, 85%);
  1694. &.bottom {
  1695. padding-bottom: 16px;
  1696. }
  1697. &.font-white {
  1698. color: #fff;
  1699. }
  1700. &.noFont {
  1701. font-family: initial;
  1702. }
  1703. &.textLeft {
  1704. text-align: left;
  1705. }
  1706. &.wordBlank {
  1707. color: rgba(0, 0, 0, 85%);
  1708. }
  1709. }
  1710. &.NNPE-chs {
  1711. display: flex;
  1712. flex-flow: wrap; // 兼容不是汉字的内容
  1713. font-family: '楷体';
  1714. font-size: 48px;
  1715. line-height: 1.17;
  1716. color: rgba(0, 0, 0, 85%);
  1717. &.bottom {
  1718. padding-bottom: 16px;
  1719. }
  1720. .font-white {
  1721. color: #fff;
  1722. }
  1723. .active {
  1724. color: #de4444;
  1725. &-yellow {
  1726. color: #ffc600;
  1727. }
  1728. }
  1729. .wordActive {
  1730. color: #de4444;
  1731. }
  1732. .wordActive-blue {
  1733. color: #ffc600;
  1734. }
  1735. .newActive {
  1736. color: #de4444;
  1737. }
  1738. }
  1739. &.padding {
  1740. padding-right: 3px;
  1741. padding-left: 3px;
  1742. }
  1743. }
  1744. }
  1745. }
  1746. &-bottom {
  1747. box-sizing: border-box;
  1748. display: flex;
  1749. align-items: center;
  1750. justify-content: space-between;
  1751. width: 100%;
  1752. height: 136px;
  1753. padding-right: 40px;
  1754. .voicefull-bottom-show {
  1755. display: flex;
  1756. align-items: center;
  1757. justify-content: space-between;
  1758. width: 100%;
  1759. height: 136px;
  1760. visibility: visible;
  1761. }
  1762. .voicefull-bottom-hidden {
  1763. display: flex;
  1764. align-items: center;
  1765. justify-content: space-between;
  1766. width: 100%;
  1767. height: 136px;
  1768. visibility: hidden;
  1769. }
  1770. .bottom-left {
  1771. display: flex;
  1772. align-items: center;
  1773. justify-content: flex-start;
  1774. &-margin {
  1775. margin-left: 40px;
  1776. }
  1777. .compare-box {
  1778. box-sizing: border-box;
  1779. height: 56px;
  1780. padding: 16px;
  1781. border: 1px solid rgba(0, 0, 0, 10%);
  1782. border-left: 0 solid rgba(0, 0, 0, 10%);
  1783. border-radius: 0 40px 40px 0;
  1784. &-white {
  1785. background: rgba(255, 255, 255, 10%);
  1786. border: 1px solid rgba(0, 0, 0, 10%);
  1787. border-left: 0;
  1788. }
  1789. &-answer {
  1790. border-radius: 40px;
  1791. }
  1792. }
  1793. }
  1794. .page-count {
  1795. box-sizing: border-box;
  1796. min-width: 60px;
  1797. padding: 8px;
  1798. font-family: 'robot';
  1799. font-size: 16px;
  1800. line-height: 24px;
  1801. color: #000;
  1802. text-align: center;
  1803. background: #fff;
  1804. border-radius: 8px;
  1805. &-green {
  1806. color: #fff;
  1807. background: rgba(255, 255, 255, 20%);
  1808. }
  1809. }
  1810. }
  1811. }
  1812. .word-play-audio {
  1813. position: absolute;
  1814. left: -1000px;
  1815. }
  1816. </style>
  1817. <style lang="scss">
  1818. .NPC-Big-Book-preview-green {
  1819. .bg1 {
  1820. .repeat-icon {
  1821. background: url('@/assets/icon/Repeat-24-normal-Green.png') no-repeat left top;
  1822. background-size: 100% 100%;
  1823. }
  1824. .pinyin-icon {
  1825. background: url('@/assets/icon/pinyin-24-normal-green.png') no-repeat left top;
  1826. background-size: 100% 100%;
  1827. }
  1828. .en-icon {
  1829. background: url('@/assets/icon/EN-24-normal-Green.png') no-repeat left top;
  1830. background-size: 100% 100%;
  1831. }
  1832. .coll-icon {
  1833. background: url('@/assets/icon/bookmarkfill-24-normal-green.png') no-repeat left top;
  1834. background-size: 100% 100%;
  1835. }
  1836. }
  1837. }
  1838. .NPC-Big-Book-preview-brown {
  1839. .bg1 {
  1840. .repeat-icon {
  1841. background: url('@/assets/icon/Repeat-24-normal-Brown.png') no-repeat left top;
  1842. background-size: 100% 100%;
  1843. }
  1844. .pinyin-icon {
  1845. background: url('@/assets/icon/pinyin-24-normal-brown.png') no-repeat left top;
  1846. background-size: 100% 100%;
  1847. }
  1848. .en-icon {
  1849. background: url('@/assets/icon/EN-24-normal-Brown.png') no-repeat left top;
  1850. background-size: 100% 100%;
  1851. }
  1852. .coll-icon {
  1853. background: url('@/assets/icon/bookmarkfill-24-normal-brown.png') no-repeat left top;
  1854. background-size: 100% 100%;
  1855. }
  1856. }
  1857. }
  1858. </style>