123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074 |
- <!-- -->
- <template>
- <div class="NNPE-ArticleView" v-if="curQue">
- <a class="ArticleView-full" @click="fullScreen">全屏模式</a>
- <div class="aduioLine-box aduioLine-practice">
- <div class="aduioLine-content">
- <template
- v-if="
- curQue.mp3_list &&
- curQue.mp3_list.length > 0 &&
- curQue.mp3_list[0].id
- "
- >
- <AudioLine
- audioId="diaPraAudio"
- :mp3="curQue.mp3_list[0].id"
- :getCurTime="getCurTime"
- ref="audioLine"
- :stopAudio="stopAudio"
- :width="555"
- :isRepeat="isRepeat"
- :mp3Source="curQue.mp3_list[0].source"
- :ed="ed"
- type="audioLine"
- @handleChangeStopAudio="handleChangeStopAudio"
- @emptyEd="emptyEd"
- />
- </template>
- </div>
- <div class="aduioLine-right">
- <span
- :class="['Repeat-16', isRepeat ? '' : 'disabled']"
- @click="changeRepeat"
- ></span>
- <span
- :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
- @click="changePinyin"
- ></span>
- <span
- :class="['EN-16', config.isShowEN ? '' : 'disabled']"
- @click="changeEN"
- ></span>
- </div>
- </div>
- <template v-if="resObj">
- <p class="notice" v-if="curQue.notice" style="padding-top: 24px">
- {{ curQue.notice }}
- </p>
- <div class="NPC-sentences-list">
- <div
- :class="['NNPE-detail-box', sentIndex == index ? 'active' : '']"
- v-for="(item, index) in resObj.sentList"
- :key="'detail' + index"
- >
- <div
- class="NNPE-detail"
- @click="
- handleChangeTime(
- curQue.wordTime &&
- curQue.wordTime[index] &&
- curQue.wordTime[index].bg,
- index,
- curQue.wordTime &&
- curQue.wordTime[index] &&
- curQue.wordTime[index].ed
- )
- "
- >
- <template v-if="item.sentArr[0].sentIndex == 0">
- <RoleChs
- :curRole="item.roleDetail"
- :color="
- (curQue.wordTime &&
- curQue.wordTime[index] &&
- curTime >= curQue.wordTime[index].bg &&
- curTime <= curQue.wordTime[index].ed) ||
- sentIndex == index
- ? 'rgba(0,0,0,0.85)'
- : 'rgba(0,0,0,0.45)'
- "
- :type="1"
- />
- </template>
- <div v-else style="width: 36px; height: 36px"></div>
- <div class="sentence-box">
- <template v-if="item.sentArr[0].sentIndex == 0">
- <div
- class="roleDetail"
- v-if="item.roleDetail.detail.wordsList.length > 0"
- >
- <span
- :class="[
- 'pinyin',
- (curQue.wordTime &&
- curQue.wordTime[index] &&
- curTime >= curQue.wordTime[index].bg &&
- curTime <= curQue.wordTime[index].ed) ||
- sentIndex == index
- ? 'color85'
- : 'color45',
- ]"
- >{{ item.roleDetail.detail.wordsList | handlePinyin }}</span
- >
- <span
- :class="[
- 'chs',
- (curQue.wordTime &&
- curQue.wordTime[index] &&
- curTime >= curQue.wordTime[index].bg &&
- curTime <= curQue.wordTime[index].ed) ||
- sentIndex == index
- ? 'color85'
- : 'color45',
- ]"
- >{{ item.roleDetail.detail.wordsList | handleChs }}</span
- >
- </div>
- </template>
- <div
- class="sentence-box-inner"
- :style="{ background: item.roleDetail.color.bg }"
- >
- <div class="NNPE-words-box">
- <div
- class="NNPE-words"
- v-for="(pItem, pIndex) in item.sentArr"
- :key="'wordsList' + pIndex"
- :class="[pItem.wordIndex == 0 ? 'textLeft' : 'textCenter']"
- >
- <template v-if="!pItem.width">
- <template v-if="pItem.isShow">
- <template
- v-if="
- item.sentArr[pIndex + 1] &&
- item.sentArr[pIndex + 1].chs &&
- chsFhList.indexOf(item.sentArr[pIndex + 1].chs) > -1
- "
- >
- <span class="NNPE-words-box">
- <template v-if="curQue.pyPosition == 'top'">
- <span
- v-if="config.isShowPY"
- class="NNPE-pinyin"
- :class="[
- pItem.className ? pItem.className : '',
- sentIndex == index ? 'wordBlank' : '',
- noFont.indexOf(pItem.pinyin) > -1
- ? 'noFont'
- : '',
- ]"
- >{{ pItem.pinyin }}</span
- >
- </template>
- <span
- class="NNPE-chs"
- :class="[
- pItem.padding && config.isShowPY
- ? 'padding'
- : '',
- sentIndex == index ? 'wordBlank' : '',
- ]"
- >
- <template>
- <span
- v-for="(wItem, wIndex) in pItem.leg"
- :key="'ci' + wIndex + pIndex + index"
- :class="[
- isPlaying &&
- pItem.timeList &&
- pItem.timeList[wIndex] &&
- curTime >= pItem.timeList[wIndex].wordBg &&
- curQue.wordTime &&
- curQue.wordTime[index] &&
- curTime <= curQue.wordTime[index].ed
- ? 'active'
- : '',
- sentIndex == index ? 'wordBlank' : '',
- ]"
- >{{ pItem.chs[wIndex] }}</span
- >
- </template>
- </span>
- <template v-if="curQue.pyPosition == 'bottom'">
- <span
- v-if="config.isShowPY"
- class="NNPE-pinyin"
- :class="[
- pItem.className ? pItem.className : '',
- sentIndex == index ? 'wordBlank' : '',
- noFont.indexOf(pItem.pinyin) > -1
- ? 'noFont'
- : '',
- ]"
- >{{ pItem.pinyin }}</span
- >
- </template>
- </span>
- <span class="NNPE-words-box">
- <template v-if="curQue.pyPosition == 'top'">
- <span
- v-if="config.isShowPY"
- :class="[
- 'NNPE-pinyin',
- sentIndex == index ? 'wordBlank' : '',
- noFont.indexOf(
- item.sentArr[pIndex + 1].pinyin
- ) > -1
- ? 'noFont'
- : '',
- ]"
- style="text-align: left"
- >{{ item.sentArr[pIndex + 1].pinyin }}</span
- >
- </template>
- <span class="NNPE-chs" style="text-align: left">
- <span
- :class="[
- isPlaying &&
- pItem.timeList[pItem.leg - 1] &&
- curTime >=
- pItem.timeList[pItem.leg - 1].wordBg &&
- curQue.wordTime &&
- curQue.wordTime[index] &&
- curTime <= curQue.wordTime[index].ed
- ? 'active'
- : '',
- sentIndex == index ? 'wordBlank' : '',
- ]"
- >
- {{ item.sentArr[pIndex + 1].chs }}</span
- >
- </span>
- <template v-if="curQue.pyPosition == 'bottom'">
- <span
- v-if="config.isShowPY"
- :class="[
- 'NNPE-pinyin',
- sentIndex == index ? 'wordBlank' : '',
- noFont.indexOf(
- item.sentArr[pIndex + 1].pinyin
- ) > -1
- ? 'noFont'
- : '',
- ]"
- style="text-align: left"
- >{{ item.sentArr[pIndex + 1].pinyin }}</span
- >
- </template>
- </span>
- </template>
- <template v-else>
- <template v-if="curQue.pyPosition == 'top'">
- <template
- v-if="NumberList.indexOf(pItem.pinyin) < 0"
- >
- <span
- v-if="config.isShowPY"
- class="NNPE-pinyin"
- :class="[
- pItem.padding ? 'padding' : '',
- pItem.className ? pItem.className : '',
- sentIndex == index ? 'wordBlank' : '',
- noFont.indexOf(item.pinyin) > -1
- ? 'noFont'
- : '',
- ]"
- >{{ pItem.pinyin }}</span
- >
- </template>
- </template>
- <span
- v-if="pItem.chs != '#'"
- class="NNPE-chs"
- :class="[
- pItem.padding && config.isShowPY ? 'padding' : '',
- sentIndex == index ? 'wordBlank' : '',
- ]"
- >
- <template>
- <span
- v-for="(wItem, wIndex) in pItem.leg"
- :key="'ci' + wIndex + pIndex + index"
- :class="[
- isPlaying &&
- pItem.timeList &&
- pItem.timeList[wIndex] &&
- curTime >= pItem.timeList[wIndex].wordBg &&
- curQue.wordTime &&
- curQue.wordTime[index] &&
- curTime <= curQue.wordTime[index].ed
- ? 'active'
- : '',
- ]"
- >{{ pItem.chs[wIndex] }}</span
- >
- </template>
- </span>
- <template v-if="curQue.pyPosition == 'bottom'">
- <template
- v-if="NumberList.indexOf(pItem.pinyin) < 0"
- >
- <span
- v-if="config.isShowPY"
- class="NNPE-pinyin"
- :class="[
- pItem.padding ? 'padding' : '',
- pItem.className ? pItem.className : '',
- sentIndex == index ? 'wordBlank' : '',
- ]"
- >{{ pItem.pinyin }}</span
- >
- </template>
- </template>
- </template>
- </template>
- </template>
- <template v-else>
- <span
- :style="{
- height: pItem.height + 'px',
- width: pItem.width + 'px',
- }"
- ></span>
- </template>
- </div>
- </div>
- <div style="clear: both; overflow: hidden"></div>
- <div
- v-if="item.enwords && config.isShowEN"
- :class="['enwords', sentIndex == index ? 'wordBlank' : '']"
- >
- {{ item.enwords }}
- </div>
- </div>
- </div>
- </div>
- <div v-show="sentIndex == index" class="Soundrecord-content">
- <div class="Soundrecord-content-inner">
- <Soundrecord
- type="promax"
- class="luyin-box"
- @getWavblob="getWavblob"
- @handleParentPlay="handleParentPlay"
- @sentPause="sentPause"
- :TaskModel="TaskModel"
- :answerRecordList="
- curQue.Bookanswer.practiceModel[index] &&
- curQue.Bookanswer.practiceModel[index].recordList
- "
- :tmIndex="index"
- @handleWav="handleWav"
- v-if="refresh"
- />
- <div
- class="compare-box"
- v-if="curQue.mp3_list && curQue.mp3_list.length > 0"
- >
- <Audio-compare
- :themeColor="themeColor"
- :index="index"
- :sentIndex="sentIndex"
- :url="curQue.mp3_list[0].id"
- :bg="curQue.wordTime[index].bg"
- :ed="curQue.wordTime[index].ed"
- :wavblob="wavblob"
- :getCurTime="getCurTime"
- :sentPause="sentPause"
- :isRecord="isRecord"
- :handleChangeStopAudio="handleChangeStopAudio"
- :getPlayStatus="getPlayStatus"
- />
- </div>
- </div>
- <span class="full-screen-icon" @click="fullScreen"> </span>
- </div>
- </div>
- </div>
- </template>
- <div class="voice-full-screen" :id="'screen-' + mathNum">
- <Voicefullscreen
- v-if="isFull && resObj"
- :themeColor="themeColor"
- :curQue="curQue"
- :sentList="resObj.sentList"
- :sentIndex="sentIndex"
- :mp3="curQue.mp3_list[0].id"
- :noFont="noFont"
- :NNPENewWordList="NNPENewWordList"
- :currentTreeID="currentTreeID"
- :isFull="isFull"
- :config="config"
- :TaskModel="TaskModel"
- @handleWav="handleWav"
- @changePinyin="changePinyin"
- @changeEN="changeEN"
- @exitFullscreen="exitFullscreen"
- @changeIsFull="changeIsFull"
- />
- </div>
- </div>
- </template>
- <script>
- import { timeStrToSen } from "../../../../utils/index";
- import AudioLine from "../AudioLine.vue";
- import Soundrecord from "../../preview/Soundrecord.vue"; // 录音模板
- import RoleChs from "./RoleChs.vue";
- import AudioCompare from "../AudioCompare.vue";
- import Voicefullscreen from "../Voicefullscreen.vue";
- export default {
- name: "ArticleView",
- props: [
- "curQue",
- "colorBox",
- "noFont",
- "themeColor",
- "config",
- "NNPENewWordList",
- "currentTreeID",
- "TaskModel",
- ],
- components: {
- AudioLine,
- Soundrecord,
- RoleChs,
- AudioCompare,
- Voicefullscreen,
- },
- filters: {
- handlePinyin(wordsList) {
- let str = "";
- wordsList.forEach((item, index) => {
- if (index < wordsList.length - 1) {
- str += item.pinyin + " ";
- } else {
- str += item.pinyin;
- }
- });
- return str;
- },
- handleChs(wordsList) {
- let str = "";
- wordsList.forEach((item, index) => {
- if (index < wordsList.length - 1) {
- str += item.chs + " ";
- } else {
- str += item.chs;
- }
- });
- return str;
- },
- },
- data() {
- return {
- wavblob: null,
- resObj: null,
- curTime: 0, //单位s
- chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
- enFhList: [",", ".", ";", "?", "!", ":", ">", "<"],
- NumberList: [
- "①",
- "②",
- "③",
- "④",
- "⑤",
- "⑥",
- "⑦",
- "⑧",
- "⑨",
- "⑩",
- "⑪",
- "⑫",
- "⑬",
- "⑭",
- "⑮",
- "⑯",
- "⑰",
- "⑱",
- "⑲",
- "⑳",
- ],
- stopAudio: false,
- sentIndex: 0,
- isRepeat: false,
- currSent: null, //当前句子的时间
- isRecord: false,
- isFull: false,
- mathNum: Math.random().toString(36).substr(2),
- ed: undefined,
- refresh: true,
- };
- },
- computed: {
- isPlaying: function () {
- let playing = false;
- if (this.$refs.audioLine) {
- playing = this.$refs.audioLine.audio.isPlaying;
- }
- return playing;
- },
- },
- watch: {
- sentIndex: {
- handler: function (newVal, oldVal) {
- if (newVal != oldVal) {
- this.wavblob = "";
- }
- },
- deep: true,
- },
- isFull: {
- handler: function (newVal, oldVal) {
- let _this = this;
- _this.refresh = false;
- if (!newVal) {
- _this.$nextTick(() => {
- // 重新渲染组件
- _this.refresh = true;
- });
- }
- },
- deep: true,
- },
- },
- //方法集合
- methods: {
- getPlayStatus(val) {
- //this.isPlaying = val;
- },
- pauseAudio() {
- let audio = document.getElementsByTagName("audio");
- audio.forEach((item) => {
- item.pause();
- });
- },
- pauseVideo() {
- let video = document.getElementsByTagName("video");
- video.forEach((item) => {
- item.pause();
- });
- },
- //语音全屏
- fullScreen(type) {
- this.pauseAudio();
- this.pauseVideo();
- this.isFull = true;
- this.goFullscreen();
- },
- goFullscreen() {
- let id = "screen-" + this.mathNum;
- var element = document.getElementById(id);
- if (element.requestFullscreen) {
- element.requestFullscreen();
- } else if (element.msRequestFullscreen) {
- element.msRequestFullscreen();
- } else if (element.mozRequestFullScreen) {
- element.mozRequestFullScreen();
- } else if (element.webkitRequestFullscreen) {
- element.webkitRequestFullscreen();
- }
- },
- exitFullscreen() {
- this.isFull = false;
- if (document.exitFullscreen) {
- document.exitFullscreen();
- } else if (document.msExitFullscreen) {
- document.msExitFullscreen();
- } else if (document.mozCancelFullScreen) {
- document.mozCancelFullScreen();
- } else if (document.webkitExitFullscreen) {
- document.webkitExitFullscreen();
- }
- },
- changeIsFull() {
- this.isFull = false;
- },
- getWavblob(wavblob) {
- this.wavblob = wavblob;
- },
- sentPause(isRecord) {
- this.isRecord = isRecord;
- },
- getCurTime(curTime) {
- let _this = this;
- if (_this.isRepeat) {
- let time = curTime * 1000;
- console.log(time, _this.currSent.ed);
- if (time > _this.currSent.ed || time < _this.currSent.bg) {
- _this.curTime = _this.currSent.bg;
- this.$refs.audioLine.onTimeupdateTime(_this.currSent.bg / 1000);
- } else {
- _this.curTime = curTime * 1000;
- }
- } else {
- _this.curTime = curTime * 1000;
- _this.getSentIndex(_this.curTime);
- }
- },
- getSentIndex(curTime) {
- for (let i = 0; i < this.curQue.wordTime.length; i++) {
- let bg = this.curQue.wordTime[i].bg;
- let ed = this.curQue.wordTime[i].ed;
- if (curTime >= bg && curTime <= ed) {
- this.sentIndex = i;
- break;
- }
- }
- },
- handleData() {
- let resArr = [],
- timeArr = [],
- sentArrTotal = [],
- enList = [];
- let curQue = JSON.parse(JSON.stringify(this.curQue));
- let wordTimeList = curQue.wordTime;
- curQue.detail.forEach((dItem, dIndex) => {
- let roleDetail = this.getRole(dItem);
- dItem.wordsList.forEach((sItem, sIndex) => {
- let sentArr = [];
- sItem.forEach((wItem, wIndex) => {
- let startIndex =
- wIndex == 0
- ? 0
- : sentArr[wIndex - 1].startIndex +
- sentArr[wIndex - 1].chs.length;
- let endIndex =
- wIndex == 0
- ? wItem.chs.length
- : sentArr[wIndex - 1].endIndex + wItem.chs.length;
- // this.judgePad(sItem, wItem, wIndex);
- this.mergeWordSymbol(wItem);
- let obj = {
- paraIndex: dIndex, //段落索引
- sentIndex: sIndex, //在段落中句子索引
- wordIndex: wIndex, //单词的索引
- pinyin: wItem.pinyin,
- chs: wItem.chs,
- padding: true,
- className: wItem.className,
- isShow: wItem.isShow,
- startIndex: startIndex,
- endIndex: endIndex,
- leg: wItem.chs.length,
- timeList: [],
- };
- sentArr.push(obj);
- });
- let obj = {
- roleDetail: roleDetail,
- sentArr: sentArr,
- enwords: dItem.sentencesEn && dItem.sentencesEn[sIndex],
- };
- sentArrTotal.push(sentArr);
- resArr.push(obj);
- });
- });
- if (wordTimeList && wordTimeList.length > 0) {
- this.mergeWordTime(sentArrTotal, wordTimeList);
- }
- this.resObj = { sentList: resArr };
- console.log("语音练习");
- console.log(this.resObj);
- },
- //获取角色
- getRole(dItem) {
- let roleIndex = dItem.roleIndex;
- let resObj = null;
- let roleList = JSON.parse(JSON.stringify(this.curQue.roleList));
- for (let i = 0; i < roleList.length; i++) {
- let item = roleList[i];
- if (item.id == roleIndex) {
- resObj = item;
- resObj.color = this.colorBox[i];
- break;
- }
- }
- return resObj;
- },
- mergeWordTime(resArr, wordTimeList) {
- resArr.forEach((item, index) => {
- let wordsResultList = wordTimeList[index].wordsResultList;
- item.forEach((wItem) => {
- let startIndex = wItem.startIndex;
- let endIndex = wItem.endIndex;
- wItem.timeList = wordsResultList.slice(startIndex, endIndex);
- });
- });
- },
- //词和标点合一起
- mergeWordSymbol(wItem) {
- if (this.chsFhList.indexOf(wItem.chs) > -1) {
- wItem.isShow = false;
- } else {
- wItem.isShow = true;
- }
- },
- //判断是否有padding
- judgePad(sItem, wItem, curIndex) {
- let leg = sItem.length;
- if (curIndex < leg - 1) {
- let nextIndex = curIndex + 1;
- let chs = sItem[nextIndex].chs;
- if (
- this.chsFhList.indexOf(chs) > -1 ||
- this.chsFhList.indexOf(wItem.chs) > -1
- ) {
- wItem.padding = false;
- } else {
- wItem.padding = true;
- }
- if (this.enFhList.indexOf(wItem.pinyin) > -1) {
- wItem.className = "textLeft";
- }
- }
- },
- //转化时间
- handleTimeList(list) {
- let listRes = [];
- list.forEach((item) => {
- let res = timeStrToSen(item);
- listRes.push(res);
- });
- return listRes;
- },
- //计算总时间
- countWordTime(sentArr) {
- let total = 0;
- sentArr.forEach((item) => {
- total += item.endTime;
- });
- return total;
- },
- //点击播放某个句子
- handleChangeTime(time, index, ed) {
- let _this = this;
- if (_this.isRepeat) {
- _this.currSent = _this.curQue.wordTime[index];
- }
- _this.sentIndex = index;
- _this.ed = ed;
- if (time) {
- _this.curTime = time;
- _this.$refs.audioLine.onTimeupdateTime(time / 1000, true);
- }
- },
- emptyEd() {
- this.ed = undefined;
- },
- handleWav(list, tmIndex) {
- tmIndex = tmIndex ? tmIndex : 0;
- this.curQue.Bookanswer.practiceModel[tmIndex] = {
- recordList: [],
- };
- this.$set(
- this.curQue.Bookanswer.practiceModel[tmIndex],
- "recordList",
- list
- );
- },
- // 录音时暂停音频播放
- handleParentPlay() {
- this.stopAudio = true;
- },
- // 音频播放时改变布尔值
- handleChangeStopAudio() {
- this.stopAudio = false;
- },
- //拼音的显示和隐藏
- changePinyin() {
- if (this.config.isHasPY) {
- this.$emit("changeConfig", "isShowPY");
- }
- },
- // 英文的显示和隐藏
- changeEN() {
- if (this.config.isHasEN) {
- this.$emit("changeConfig", "isShowEN");
- }
- },
- // 单句是否重复播放
- changeRepeat() {
- let _this = this;
- _this.isRepeat = !_this.isRepeat;
- this.currSent = _this.curQue.wordTime[_this.sentIndex];
- },
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {},
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- if (this.curQue) {
- this.handleData();
- }
- },
- beforeCreate() {}, //生命周期 - 创建之前
- beforeMount() {}, //生命周期 - 挂载之前
- beforeUpdate() {}, //生命周期 - 更新之前
- updated() {}, //生命周期 - 更新之后
- beforeDestroy() {}, //生命周期 - 销毁之前
- destroyed() {}, //生命周期 - 销毁完成
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
- };
- </script>
- <style lang='scss' scoped>
- //@import url(); 引入公共css类
- .NNPE-ArticleView {
- width: 100%;
- position: relative;
- .ArticleView-full {
- position: absolute;
- top: -33px;
- background: url("../../../../assets/NPC/full-screen-red.png") left center
- no-repeat;
- background-size: 16px 16px;
- padding-left: 24px;
- color: #000000;
- font-size: 14px;
- line-height: 24px;
- font-weight: bold;
- left: 0;
- z-index: 99999;
- }
- .NPC-sentences-list {
- padding: 0px 0 24px 0;
- }
- .aduioLine-content {
- flex: 1;
- }
- .aduioLine-practice {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .aduioLine-right {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 92px;
- height: 40px;
- box-sizing: border-box;
- padding: 0 12px;
- border-left: 1px solid rgba(0, 0, 0, 0.1);
- > span {
- width: 16px;
- height: 16px;
- cursor: pointer;
- }
- }
- }
- .NNPE-detail-box {
- &.active {
- background: rgba(0, 0, 0, 0.06);
- }
- }
- .enwords {
- font-family: "robot";
- font-weight: normal;
- font-size: 14px;
- line-height: 22px;
- color: rgba(0, 0, 0, 0.45);
- padding-left: 3px;
- &.wordBlank {
- color: rgba(0, 0, 0, 0.85);
- }
- }
- .NNPE-detail {
- display: flex;
- justify-content: flex-start;
- align-items: flex-start;
- clear: both;
- overflow: hidden;
- width: 100%;
- box-sizing: border-box;
- padding: 8px 24px 8px;
- color: rgba(0, 0, 0, 0.45);
- .sentence-box {
- padding-left: 8px;
- clear: both;
- overflow: hidden;
- &-inner {
- padding: 8px 12px;
- box-sizing: border-box;
- border-radius: 8px;
- border: 1px solid rgba(0, 0, 0, 0.1);
- float: left;
- }
- .roleDetail {
- height: 36px;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .pinyin {
- font-family: "GB-PINYINOK-B";
- font-size: 14px;
- line-height: 22px;
- color: rgba(0, 0, 0, 0.85);
- margin-right: 4px;
- &.noFont {
- font-family: initial;
- }
- }
- .chs {
- font-family: "FZJCGFKTK";
- font-size: 16px;
- line-height: 24px;
- color: rgba(0, 0, 0, 0.85);
- }
- .color85 {
- color: rgba(0, 0, 0, 0.85);
- }
- .color45 {
- color: rgba(0, 0, 0, 0.45);
- }
- }
- }
- .NNPE-words {
- float: left;
- &-box {
- float: left;
- > span {
- display: block;
- &.NNPE-pinyin {
- font-family: "GB-PINYINOK-B";
- font-weight: normal;
- font-size: 14px;
- line-height: 20px;
- height: 20px;
- &.noFont {
- font-family: initial;
- }
- &.textLeft {
- text-align: left;
- }
- &.wordBlank {
- color: rgba(0, 0, 0, 0.85);
- }
- }
- &.NNPE-chs {
- font-family: "FZJCGFKTK";
- font-size: 20px;
- line-height: 28px;
- .active {
- color: #de4444;
- }
- &.wordBlank {
- color: rgba(0, 0, 0, 0.85);
- }
- }
- // &.padding {
- // padding-right: 6px;
- // }
- }
- }
- &.textLeft {
- text-align: left;
- }
- &.textCenter {
- text-align: center;
- }
- > span {
- display: block;
- &.NNPE-pinyin {
- font-family: "GB-PINYINOK-B";
- font-weight: normal;
- font-size: 14px;
- line-height: 20px;
- height: 20px;
- &.noFont {
- font-family: initial;
- }
- &.textLeft {
- text-align: left;
- }
- &.wordBlank {
- color: rgba(0, 0, 0, 0.85);
- }
- }
- &.NNPE-chs {
- font-family: "FZJCGFKTK";
- font-size: 20px;
- line-height: 28px;
- .active {
- color: #de4444;
- }
- &.wordBlank {
- color: rgba(0, 0, 0, 0.85);
- }
- }
- &.padding {
- padding: 0 3px;
- }
- }
- }
- }
- .Soundrecord-content {
- padding: 0px 10px 8px 68px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- &-inner {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- width: 304px;
- border-radius: 8px;
- background: #ffffff;
- padding: 4px 12px;
- border: 1px solid rgba(0, 0, 0, 0.1);
- .luyin-box {
- width: 280px;
- }
- .compare-box {
- height: 32px;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- }
- .full-screen-icon {
- width: 16px;
- height: 16px;
- background: url("../../../../assets/NPC/full-screen-red.png") no-repeat
- left top;
- background-size: 100% 100%;
- cursor: pointer;
- }
- }
- .voice-full-screen {
- // position: fixed;
- // top: 0;
- // left: 0;
- // z-index: 9999;
- }
- }
- </style>
- <style lang="scss">
- .NPC-Big-Book-preview-green {
- .NNPE-ArticleView {
- .ArticleView-full {
- background: url("../../../../assets/NPC/full-screen-green.png") left
- center no-repeat;
- background-size: 16px 16px;
- }
- .Soundrecord-content {
- .full-screen-icon {
- background: url("../../../../assets/NPC/full-screen-green.png") left
- center no-repeat;
- background-size: 16px 16px;
- }
- }
- }
- }
- .NPC-Big-Book-preview-brown {
- .Soundrecord-content {
- .ArticleView-full {
- background: url("../../../../assets/NPC/full-screen-brown.png") left
- center no-repeat;
- background-size: 16px 16px;
- }
- .full-screen-icon {
- background: url("../../../../assets/NPC/full-screen-brown.png") left
- center no-repeat;
- background-size: 16px 16px;
- }
- }
- }
- </style>
|