Voicefullscreen.vue 48 KB

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