| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792 |
- <!-- -->
- <template>
- <div v-if="curQue" class="NNPE-ArticleView">
- <div
- v-if="
- ((curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url) ||
- config.isHasPY ||
- config.isHasEN) &&
- curQue.property.mp3_position === 'top'
- "
- class="aduioLine-box aduioLine-practice-npc"
- >
- <div class="aduioLine-content">
- <template v-if="curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url">
- <AudioLine
- ref="audioLine"
- audio-id="artPhraseAudio"
- :mp3="curQue.mp3_list[0].url"
- :get-cur-time="getCurTime"
- :mp3-source="curQue.mp3_list[0].source"
- :width="colLength == 2 ? 200 : 700"
- :attrib="attrib"
- />
- </template>
- </div>
- <div class="aduioLine-right">
- <!-- <span
- :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
- @click="changePinyin"
- v-if="config.isHasPY"
- ></span>
- <span :class="['EN-16', config.isShowEN ? '' : 'disabled']" @click="changeEN" v-if="config.isHasEN"></span> -->
- <SvgIcon
- v-if="config.isHasPY"
- icon-class="pin-btn"
- size="16"
- :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
- :style="{ color: config.isShowPY ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
- @click="changePinyin"
- />
- <SvgIcon
- v-if="config.isHasEN"
- icon-class="en-btn"
- size="16"
- :class="['EN-16', config.isShowEN ? '' : 'disabled']"
- :style="{ color: config.isShowEN ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
- @click="changeEN"
- />
- </div>
- </div>
- <template v-if="!config.isHasEN || (config.isHasEN && !config.isShowEN)">
- <template v-if="resArr.length > 0">
- <div
- class="NPC-sentences-list"
- :style="{
- height: curQue.property.content_height ? curQue.property.content_height + 'px' : '',
- }"
- >
- <div
- v-for="(item, index) in resArr"
- :key="'detail' + index"
- :class="['NNPE-detail', item.isTitle ? 'NNPE-detail-title' : '']"
- >
- <div
- class="wordsList-box"
- :class="[
- curQue.detail[index].paragraphAttr
- ? 'wordsList-box-' + curQue.detail[index].paragraphAttr.paragraphAlign
- : '',
- ]"
- >
- <template v-if="item.sourceList.length > 0 && item.sourcePosition === 'before'">
- <img
- v-if="item.sourceList[0] && item.sourceList[0].type === 'image'"
- :src="item.sourceList[0].file_url_open"
- :style="{
- width: item.widthNumber + 'px',
- height: item.heightNumber + 'px',
- }"
- />
- <video
- :src="item.sourceList[0].file_url_open"
- width="100%"
- height="400"
- controls
- controlsList="nodownload"
- v-else
- ></video>
- </template>
- <div :class="['para-' + item.paraAlign]">
- <div
- v-for="(pItem, pIndex) in item.wordsList"
- :key="'wordsList' + pIndex"
- class="NNPE-words"
- :class="[
- pItem.chs != '“' && pItem.wordIndex == 0 ? 'textLeft' : 'textCenter',
- pItem.chs == '“' ? 'textRight' : '',
- ]"
- >
- <template v-if="!pItem.width">
- <template v-if="pItem.isShow">
- <template
- v-if="
- item.wordsList[pIndex + 1] &&
- item.wordsList[pIndex + 1].chs &&
- chsFhList.indexOf(item.wordsList[pIndex + 1].chs) > -1
- "
- >
- <span class="NNPE-words-box" @click="showWordDetail($event, pItem)">
- <span
- v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
- class="NNPE-pinyin"
- :class="[pItem.className ? pItem.className : '']"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
- >
- <span
- class="NNPE-chs"
- :class="[
- item.timeList &&
- item.timeList[pItem.sentIndex] &&
- curTime >= item.timeList[pItem.sentIndex].bg &&
- curTime <= item.timeList[pItem.sentIndex].ed &&
- curTime
- ? 'active'
- : '',
- paraIndex == pItem.paraIndex &&
- sentIndex == pItem.sentIndex &&
- wordIndex == pItem.wordIndex
- ? 'wordActive'
- : '',
- ]"
- :style="{
- fontFamily: pItem.config.fontFamily,
- textDecoration: pItem.config.textDecoration,
- borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: pItem.config.fontWeight,
- color: pItem.config.color,
- height:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- backgroundColor:
- item.timeList &&
- item.timeList[pItem.sentIndex] &&
- curTime >= item.timeList[pItem.sentIndex].bg &&
- curTime <= item.timeList[pItem.sentIndex].ed &&
- curTime &&
- attrib
- ? attrib.assist_color
- : '',
- }"
- >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs : ''
- }}<img
- v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
- :src="pItem.img[0].file_url"
- :style="{
- height: attrib && attrib.font_size ? attrib.font_size : '20px',
- }"
- /></span>
- <span
- v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
- class="NNPE-pinyin"
- :class="[pItem.className ? pItem.className : '']"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
- >
- </span>
- <span class="NNPE-words-box" @click="showWordDetail($event, item.wordsList[pIndex + 1])">
- <span
- v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
- class="NNPE-pinyin"
- style="text-align: left"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- >{{
- NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) == -1
- ? item.wordsList[pIndex + 1].pinyin
- : ''
- }}</span
- >
- <span
- class="NNPE-chs"
- style="text-align: left"
- :class="[
- item.timeList &&
- item.timeList[pItem.sentIndex] &&
- curTime >= item.timeList[pItem.sentIndex].bg &&
- curTime <= item.timeList[pItem.sentIndex].ed &&
- curTime
- ? 'active'
- : '',
- ]"
- :style="{
- fontFamily: item.wordsList[pIndex + 1].config.fontFamily,
- textDecoration: item.wordsList[pIndex + 1].config.textDecoration,
- borderBottom: item.wordsList[pIndex + 1].config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: item.wordsList[pIndex + 1].config.fontWeight,
- color: item.wordsList[pIndex + 1].config.color,
- height:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- backgroundColor:
- item.timeList &&
- item.timeList[pItem.sentIndex] &&
- curTime >= item.timeList[pItem.sentIndex].bg &&
- curTime <= item.timeList[pItem.sentIndex].ed &&
- curTime &&
- attrib
- ? attrib.assist_color
- : '',
- }"
- >{{
- NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) == -1
- ? item.wordsList[pIndex + 1].chs
- : ''
- }}<img
- v-if="
- item.wordsList[pIndex + 1].img &&
- item.wordsList[pIndex + 1].img.length > 0 &&
- item.wordsList[pIndex + 1].imgPosition === 'after'
- "
- :src="item.wordsList[pIndex + 1].img[0].file_url"
- :style="{
- height: attrib && attrib.font_size ? attrib.font_size : '20px',
- }"
- /></span>
- <span
- v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
- class="NNPE-pinyin"
- style="text-align: left"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- >{{
- NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) == -1
- ? item.wordsList[pIndex + 1].pinyin
- : ''
- }}</span
- >
- </span>
- <span
- v-if="
- item.wordsList[pIndex + 2] &&
- item.wordsList[pIndex + 2].chs &&
- chsFhList.indexOf(item.wordsList[pIndex + 2].chs) > -1
- "
- class="NNPE-words-box"
- @click="showWordDetail($event, item.wordsList[pIndex + 2])"
- >
- <span
- v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
- :class="[
- 'NNPE-pinyin',
- noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
- ]"
- style="text-align: left"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- >{{
- NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) == -1
- ? item.wordsList[pIndex + 2].pinyin
- : ''
- }}</span
- >
- <span
- class="NNPE-chs"
- style="text-align: left"
- :class="[
- item.timeList &&
- item.timeList[pItem.sentIndex] &&
- curTime >= item.timeList[pItem.sentIndex].bg &&
- curTime <= item.timeList[pItem.sentIndex].ed &&
- curTime
- ? 'active'
- : '',
- pItem.paraIndex == paraIndex && pItem.sentIndex == sentIndex ? 'overActive' : '',
- pItem.chstimeList &&
- pItem.chstimeList[pItem.leg - 1] &&
- curTime >= pItem.chstimeList[pItem.leg - 1].wordBg &&
- curQue.wordTime &&
- curTime <= item.timeList[pItem.sentIndex].ed
- ? 'wordActive'
- : '',
- ]"
- :style="{
- fontFamily: item.wordsList[pIndex + 2].config.fontFamily,
- textDecoration: item.wordsList[pIndex + 2].config.textDecoration,
- borderBottom: item.wordsList[pIndex + 2].config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: item.wordsList[pIndex + 2].config.fontWeight,
- color: item.wordsList[pIndex + 2].config.color,
- height:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- backgroundColor:
- item.timeList &&
- item.timeList[pItem.sentIndex] &&
- curTime >= item.timeList[pItem.sentIndex].bg &&
- curTime <= item.timeList[pItem.sentIndex].ed &&
- curTime &&
- attrib
- ? attrib.assist_color
- : '',
- }"
- >{{
- NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) == -1
- ? item.wordsList[pIndex + 2].chs
- : ''
- }}<img
- v-if="
- item.wordsList[pIndex + 2].img &&
- item.wordsList[pIndex + 2].img.length > 0 &&
- item.wordsList[pIndex + 2].imgPosition === 'after'
- "
- :src="item.wordsList[pIndex + 2].img[0].file_url"
- :style="{
- height: attrib && attrib.font_size ? attrib.font_size : '20px',
- }"
- /></span>
- <span
- v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
- :class="[
- 'NNPE-pinyin',
- noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
- ]"
- style="text-align: left"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- >{{
- NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) == -1
- ? item.wordsList[pIndex + 2].pinyin
- : ''
- }}</span
- >
- </span>
- </template>
- <template v-else>
- <span
- v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
- class="NNPE-pinyin"
- :class="[
- pItem.chs != '“' && pItem.padding ? 'padding' : '',
- pItem.className ? pItem.className : '',
- ]"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt' : '22px',
- }"
- >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
- >
- <span
- class="NNPE-chs"
- :class="[
- item.timeList &&
- item.timeList[pItem.sentIndex] &&
- curTime >= item.timeList[pItem.sentIndex].bg &&
- curTime <= item.timeList[pItem.sentIndex].ed &&
- curTime
- ? 'active'
- : '',
- pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
- ]"
- :style="{
- fontFamily: pItem.config.fontFamily,
- textDecoration: pItem.config.textDecoration,
- borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: pItem.config.fontWeight,
- color: pItem.config.color,
- height:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- backgroundColor:
- item.timeList &&
- item.timeList[pItem.sentIndex] &&
- curTime >= item.timeList[pItem.sentIndex].bg &&
- curTime <= item.timeList[pItem.sentIndex].ed &&
- curTime &&
- attrib
- ? attrib.assist_color
- : '',
- }"
- @click="showWordDetail($event, pItem)"
- >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs : ''
- }}<img
- v-if="pItem.img && pItem.img.length > 0 && pItem.imgPosition === 'after'"
- :src="pItem.img[0].file_url"
- :style="{
- height: attrib && attrib.font_size ? attrib.font_size : '20px',
- }"
- /></span>
- <span
- v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
- class="NNPE-pinyin"
- :class="[
- pItem.chs != '“' && pItem.padding ? 'padding' : '',
- pItem.className ? pItem.className : '',
- ]"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt' : '22px',
- }"
- >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.pinyin : '' }}</span
- >
- </template>
- </template>
- </template>
- <template v-else>
- <span
- :style="{
- height: pItem.height + 'px',
- width: pItem.width + 'px',
- }"
- ></span>
- </template>
- </div>
- </div>
- <div
- v-if="curQue.property.multilingual_position === 'para'"
- class="multilingual-para"
- :class="[item.isTitle ? 'multilingual-para-center' : '', 'multilingual-' + item.paraAlign]"
- >
- {{
- curQue.detail[index].multilingualTextList && curQue.detail[index].multilingualTextList[multilingual]
- ? curQue.detail[index].multilingualTextList[multilingual].join(' ')
- : ''
- }}
- </div>
- <template v-if="item.sourceList.length > 0 && item.sourcePosition === 'after'">
- <img
- v-if="item.sourceList[0] && item.sourceList[0].type === 'image'"
- :src="item.sourceList[0].file_url_open"
- :style="{
- width: item.widthNumber + 'px',
- height: item.heightNumber + 'px',
- }"
- />
- <video
- :src="item.sourceList[0].file_url_open"
- width="100%"
- height="400"
- controls
- controlsList="nodownload"
- v-else
- ></video>
- </template>
- </div>
- </div>
- <!-- <div class="multilingual" v-for="(items, indexs) in multilingualTextList" :key="indexs">
- {{ items }}
- </div> -->
- </div>
- </template>
- </template>
- <template v-else>
- <template v-if="resObj">
- <!-- -->
- <div
- class="NPC-sentences-list"
- :style="{
- height: curQue.property.content_height ? curQue.property.content_height + 'px' : '',
- }"
- >
- <div
- v-for="(item, index) in resObj.sentList"
- :key="'detail' + index"
- :class="['NNPE-detail-box', sentIndex == index ? 'active' : '']"
- >
- <div :class="['NNPE-details']">
- <div
- v-if="item.enwords && config.isShowEN && curQue.enPosition && curQue.enPosition == 'top'"
- :class="['enwords', sentIndex == index ? 'wordBlank' : '']"
- >
- {{ item.enwords }}
- </div>
- <div style="overflow: hidden; clear: both"></div>
- <div
- v-for="(pItem, pIndex) in item.sentArr"
- :key="'wordsList' + pIndex"
- class="NNPE-words"
- :class="[
- pItem.chs != '“' && pItem.wordIndex == 0 ? 'textLeft' : 'textCenter',
- pItem.chs == '“' ? 'textRight' : '',
- ]"
- >
- <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" @click="showWordDetail($event, pItem)">
- <template v-if="curQue.property.pinyin_position == 'top'">
- <span
- v-if="config.isShowPY"
- class="NNPE-pinyin"
- :class="[
- pItem.className ? pItem.className : '',
- sentIndex == index ? 'wordBlank' : '',
- noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
- ]"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- >{{ pItem.pinyin }}</span
- >
- </template>
- <span
- class="NNPE-chs"
- :class="[
- pItem.padding && config.isShowPY ? 'padding' : '',
- sentIndex == index ? 'wordBlank' : '',
- ]"
- >
- <template v-for="(wItem, wIndex) in pItem.leg">
- <span
- :key="'ci' + wIndex + pIndex + index"
- :class="[]"
- :style="{
- fontFamily: pItem.config.fontFamily,
- textDecoration: pItem.config.textDecoration,
- borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: pItem.config.fontWeight,
- color: pItem.config.color,
- height:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- }"
- >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs[wIndex] : '' }}</span
- >
- </template>
- </span>
- <template v-if="curQue.property.pinyin_position == 'bottom'">
- <span
- v-if="config.isShowPY"
- class="NNPE-pinyin"
- :class="[
- pItem.className ? pItem.className : '',
- sentIndex == index ? 'wordBlank' : '',
- noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
- ]"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- >{{ pItem.pinyin }}</span
- >
- </template>
- </span>
- <span class="NNPE-words-box" @click="showWordDetail($event, item.sentArr[pIndex + 1])">
- <template v-if="curQue.property.pinyin_position == '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"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- >{{ item.sentArr[pIndex + 1].pinyin }}</span
- >
- </template>
- <span class="NNPE-chs" style="text-align: left">
- <span
- :class="[]"
- :style="{
- fontFamily: item.sentArr[pIndex + 1].config.fontFamily,
- textDecoration: item.sentArr[pIndex + 1].config.textDecoration,
- borderBottom: item.sentArr[pIndex + 1].config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: item.sentArr[pIndex + 1].config.fontWeight,
- color: item.sentArr[pIndex + 1].config.color,
- height:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- }"
- >
- {{
- NumberList.indexOf(item.sentArr[pIndex + 1].pinyin) == -1
- ? item.sentArr[pIndex + 1].chs
- : ''
- }}</span
- >
- </span>
- <template v-if="curQue.property.pinyin_position == '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"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- >{{ item.sentArr[pIndex + 1].pinyin }}</span
- >
- </template>
- </span>
- <span
- v-if="
- item.sentArr[pIndex + 2] &&
- item.sentArr[pIndex + 2].chs &&
- chsFhList.indexOf(item.sentArr[pIndex + 2].chs) > -1
- "
- class="NNPE-words-box"
- @click="showWordDetail($event, item.sentArr[pIndex + 2])"
- >
- <template v-if="curQue.property.pinyin_position == 'top'">
- <span
- v-if="config.isShowPY"
- :class="[
- 'NNPE-pinyin',
- sentIndex == index ? 'wordBlank' : '',
- noFont.indexOf(item.sentArr[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
- ]"
- style="text-align: left"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- >{{ item.sentArr[pIndex + 2].pinyin }}</span
- >
- </template>
- <span class="NNPE-chs" style="text-align: left">
- <span
- :class="[]"
- :style="{
- fontFamily: item.sentArr[pIndex + 2].config.fontFamily,
- textDecoration: item.sentArr[pIndex + 2].config.textDecoration,
- borderBottom: item.sentArr[pIndex + 2].config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: item.sentArr[pIndex + 2].config.fontWeight,
- color: item.sentArr[pIndex + 2].config.color,
- height:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- }"
- >
- {{
- NumberList.indexOf(item.sentArr[pIndex + 2].pinyin) == -1
- ? item.sentArr[pIndex + 2].chs
- : ''
- }}</span
- >
- </span>
- <template v-if="curQue.property.pinyin_position == 'bottom'">
- <span
- v-if="config.isShowPY"
- :class="[
- 'NNPE-pinyin',
- sentIndex == index ? 'wordBlank' : '',
- noFont.indexOf(item.sentArr[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
- ]"
- style="text-align: left"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size
- ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt'
- : '22px',
- }"
- >{{ item.sentArr[pIndex + 2].pinyin }}</span
- >
- </template>
- </span>
- </template>
- <template v-else>
- <template v-if="curQue.property.pinyin_position == 'top'">
- <span
- v-if="config.isShowPY"
- class="NNPE-pinyin"
- :class="[
- pItem.chs != '“' && pItem.padding ? 'padding' : '',
- pItem.className ? pItem.className : '',
- sentIndex == index ? 'wordBlank' : '',
- noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
- ]"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt' : '22px',
- }"
- >{{ pItem.pinyin }}</span
- >
- </template>
- <span
- class="NNPE-chs"
- :class="[
- pItem.chs != '“' && pItem.padding && config.isShowPY ? 'padding' : '',
- sentIndex == index ? 'wordBlank' : '',
- ]"
- >
- <template v-for="(wItem, wIndex) in pItem.leg">
- <span
- :key="'ci' + wIndex + pIndex + index"
- :class="[]"
- :style="{
- fontFamily: pItem.config.fontFamily,
- textDecoration: pItem.config.textDecoration,
- borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
- fontWeight: pItem.config.fontWeight,
- color: pItem.config.color,
- height:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
- lineHeight:
- attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
- }"
- >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs[wIndex] : '' }}</span
- >
- </template>
- </span>
- <template v-if="curQue.property.pinyin_position == 'bottom'">
- <span
- v-if="config.isShowPY"
- class="NNPE-pinyin"
- :class="[
- pItem.chs != '“' && pItem.padding ? 'padding' : '',
- pItem.className ? pItem.className : '',
- sentIndex == index ? 'wordBlank' : '',
- noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
- ]"
- :style="{
- fontSize: attrib && attrib.pinyin_size ? attrib.pinyin_size : '14px',
- height:
- attrib && attrib.pinyin_size ? attrib.pinyin_size.replace('pt', '') * 1.5 + 'pt' : '22px',
- }"
- >{{ pItem.pinyin }}</span
- >
- </template>
- </template>
- </template>
- </template>
- <template v-else>
- <span
- :style="{
- height: pItem.height + 'px',
- width: pItem.width + 'px',
- }"
- ></span>
- </template>
- </div>
- <div style="overflow: hidden; clear: both"></div>
- <div
- v-if="
- item.enwords &&
- config.isShowEN &&
- (!curQue.enPosition || (curQue.enPosition && curQue.enPosition == 'bottom'))
- "
- :class="['enwords', sentIndex == index ? 'wordBlank' : '']"
- >
- {{ item.enwords }}
- </div>
- <div
- v-if="curQue.property.multilingual_position === 'para'"
- class="multilingual-para"
- :class="[item.isTitle ? 'multilingual-para-center' : '', 'multilingual-' + item.paraAlign]"
- >
- {{
- curQue.detail[index].multilingualTextList[multilingual]
- ? curQue.detail[index].multilingualTextList[multilingual].join(' ')
- : ''
- }}
- </div>
- </div>
- </div>
- <!-- <div class="multilingual" v-for="(items, indexs) in multilingualTextList" :key="indexs">
- {{ items }}
- </div> -->
- </div>
- </template>
- </template>
- <template v-for="(items, indexs) in curQue.detail">
- <div
- v-if="
- curQue.property.multilingual_position === 'all' &&
- items.multilingualTextList &&
- items.multilingualTextList[multilingual] &&
- items.multilingualTextList[multilingual].length > 0
- "
- :key="indexs"
- class="multilingual"
- >
- <div
- class="multilingual-para"
- :class="[items.isTitle ? 'multilingual-para-center' : '', 'multilingual-' + items.paraAlign]"
- >
- {{
- items.multilingualTextList && items.multilingualTextList[multilingual]
- ? items.multilingualTextList[multilingual].join(' ')
- : ''
- }}
- </div>
- </div>
- </template>
- <div
- v-if="
- ((curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url) ||
- config.isHasPY ||
- config.isHasEN) &&
- curQue.property.mp3_position === 'bottom'
- "
- class="aduioLine-box aduioLine-practice-npc aduioLine-box-bottom"
- >
- <div class="aduioLine-content">
- <template v-if="curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url">
- <AudioLine
- ref="audioLine"
- audio-id="artPhraseAudio"
- :mp3="curQue.mp3_list[0].url"
- :get-cur-time="getCurTime"
- :mp3-source="curQue.mp3_list[0].source"
- :width="colLength == 2 ? 200 : 700"
- :attrib="attrib"
- />
- </template>
- </div>
- <div class="aduioLine-right">
- <!-- <span
- :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
- @click="changePinyin"
- v-if="config.isHasPY"
- ></span>
- <span :class="['EN-16', config.isShowEN ? '' : 'disabled']" @click="changeEN" v-if="config.isHasEN"></span> -->
- <SvgIcon
- v-if="config.isHasPY"
- icon-class="pin-btn"
- size="16"
- :class="['pinyin-16', config.isShowPY ? '' : 'disabled']"
- :style="{ color: config.isShowPY ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
- @click="changePinyin"
- />
- <SvgIcon
- v-if="config.isHasEN"
- icon-class="en-btn"
- size="16"
- :class="['EN-16', config.isShowEN ? '' : 'disabled']"
- :style="{ color: config.isShowEN ? (attrib ? attrib.topic_color : '') : '#DCDFE6' }"
- @click="changeEN"
- />
- </div>
- </div>
- <template v-if="isShow">
- <div
- ref="wordcard"
- class="NNPE-wordDetail"
- :style="{
- marginLeft:
- word.detail.new_word.length === 1
- ? '-152px'
- : windowWidth > word.detail.new_word.length * 126 + 48
- ? '-' + (word.detail.new_word.length * 63 + 24) + 'px'
- : '0px',
- left: windowWidth > word.detail.new_word.length * 126 + 48 ? '' : '0px',
- }"
- >
- <Wordcard
- :word="word"
- :change-word-card="changeWordCard"
- :theme-color="themeColor"
- :current-tree-i-d="currentTreeID"
- :TaskModel="TaskModel"
- :write-list="curQue.Bookanswer.writeModel"
- :attrib="attrib"
- :is-mobile="isMobile"
- @changeCurQue="changeCurQue"
- />
- </div>
- </template>
- </div>
- </template>
- <script>
- import AudioLine from '../voice_matrix/components/AudioLine.vue';
- import Wordcard from './components/Wordcard.vue'; // 卡片
- export default {
- name: 'WordModelChs',
- components: {
- AudioLine,
- Wordcard,
- },
- props: [
- 'curQue',
- 'bodyLeft',
- 'NNPENewWordList',
- 'themeColor',
- 'currentTreeID',
- 'config',
- 'TaskModel',
- 'colLength',
- 'noFont',
- 'multilingual',
- 'attrib',
- 'isMobile',
- ],
- data() {
- return {
- resArr: [],
- resObj: null,
- curTime: 0, // 单位s
- chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '、', '……'],
- enFhList: [',', '.', ';', '?', '!', ':', '>', '<'],
- NumberList: ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳'],
- newWords: ['鱼', '辩礼义'],
- isShow: false,
- hz: '',
- oldHz: '',
- pinyin: '',
- word: null,
- clientY: 0,
- top: 0,
- left: 0,
- contentWidth: 732,
- articleImg: {}, // 文章图片
- paraIndex: -1,
- sentIndex: -1,
- wordIndex: -1,
- screenHeight: 0,
- cardHeight: 0,
- windowWidth: window.innerWidth,
- };
- },
- computed: {},
- watch: {
- hz: {
- handler(val, oldVal) {
- let _this = this;
- if (val) {
- if (_this.NumberList.indexOf(val) > -1) {
- return;
- }
- _this.handleNewWords(val, _this.top, _this.left);
- }
- },
- // 深度观察监听
- deep: true,
- },
- isShow: {
- handler(val, oldVal) {
- let _this = this;
- if (val) {
- setTimeout(() => {
- _this.cardHeight = _this.$refs.wordcard.offsetHeight;
- // if (_this.screenHeight - _this.clientY > _this.cardHeight) {
- // _this.top = _this.clientY + 20;
- // } else {
- // _this.top = _this.clientY - _this.cardHeight - 30;
- // }
- }, 0);
- }
- },
- // 深度观察监听
- deep: true,
- },
- },
- // 生命周期 - 创建完成(可以访问当前this实例)
- created() {},
- // 生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- if (this.curQue) {
- this.handleData();
- }
- window.addEventListener('resize', this.getScreenHeight);
- this.getScreenHeight();
- },
- beforeCreate() {}, // 生命周期 - 创建之前
- beforeMount() {}, // 生命周期 - 挂载之前
- beforeUpdate() {}, // 生命周期 - 更新之前
- updated() {}, // 生命周期 - 更新之后
- beforeDestroy() {
- this.isShow = false;
- window.removeEventListener('resize', this.getScreenHeight);
- }, // 生命周期 - 销毁之前
- destroyed() {}, // 生命周期 - 销毁完成
- activated() {},
- // 方法集合
- methods: {
- // 拼音的显示和隐藏
- changePinyin() {
- if (this.config.isHasPY) {
- this.$emit('changeConfig', 'isShowPY');
- }
- },
- // 英文的显示和隐藏
- changeEN() {
- if (this.config.isHasEN) {
- this.$emit('changeConfig', 'isShowEN');
- }
- },
- getCurTime(curTime) {
- 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 = [];
- let leg = this.curQue.detail.length;
- let curQue = JSON.parse(JSON.stringify(this.curQue));
- let dhaspinyin = false; // 每段是否有拼音
- curQue.detail.forEach((dItem, dIndex) => {
- dhaspinyin = false;
- let paraArr = [];
- if (dItem.paraAlign !== 'center') {
- paraArr = [
- {
- pinyin: '',
- chs: '',
- width: 20,
- height: 20,
- },
- {
- width: 20,
- height: 20,
- pinyin: '',
- chs: '',
- },
- ];
- }
- dItem.wordsList.forEach((sItem, sIndex) => {
- sItem.forEach((wItem, wIndex) => {
- // this.judgePad(sItem, wItem, wIndex);
- this.mergeWordSymbol(sItem, wItem, wIndex);
- let obj = {
- paraIndex: dIndex, // 段落索引
- sentIndex: sIndex, // 在段落中句子索引
- wordIndex: wIndex, // 单词的索引
- pinyin:
- curQue.pinyin_type === 'pinyin'
- ? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
- ? wItem.pinyin_up
- : wItem.pinyin
- : wItem.pinyin_tone,
- chs: wItem.chs,
- padding: true,
- className: wItem.className,
- isShow: wItem.isShow,
- isNewWord: this.newWords.indexOf(wItem.chs) > -1,
- config: {
- fontFamily: wItem.fontFamily,
- color: wItem.color,
- textDecoration: wItem.textDecoration,
- border: wItem.border,
- fontWeight: wItem.fontWeight,
- },
- matchWords: wItem.matchWords,
- matchNotes: wItem.matchNotes,
- img: wItem.img,
- imgPosition: wItem.imgPosition,
- };
- paraArr.push(obj);
- if (wItem.pinyin) dhaspinyin = true;
- });
- });
- let curSentencesLeg = dItem.sentences.length;
- let startLeg = dIndex === 0 ? 0 : curQue.detail[dIndex - 1].endLeg;
- let endLeg = startLeg + curSentencesLeg;
- dItem.endLeg = endLeg;
- let timeList = curQue.wordTime.slice(startLeg, endLeg);
- let paraObj = {
- wordsList: paraArr,
- timeList,
- dhaspinyin,
- isTitle: dItem.isTitle,
- paraAlign: dItem.paraAlign,
- sourceList: dItem.sourceList ? dItem.sourceList : [],
- sourcePosition: dItem.sourcePosition,
- widthNumber: dItem.widthNumber,
- heightNumber: dItem.heightNumber,
- };
- resArr.push(paraObj);
- });
- this.resArr = resArr;
- // 循环文章图片
- if (curQue.img_list) {
- curQue.img_list.forEach((item) => {
- this.articleImg[item.imgNumber] = item.id;
- });
- }
- let resArrs = [];
- let sentArrTotal = [];
- let timeArr = [];
- let wordTimeList = curQue.wordTime;
- curQue.detail.forEach((dItem, dIndex) => {
- 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:
- curQue.pinyin_type === 'pinyin'
- ? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
- ? wItem.pinyin_up
- : wItem.pinyin
- : wItem.pinyin_tone,
- chs: wItem.chs,
- padding: true,
- className: wItem.className,
- isShow: wItem.isShow,
- startIndex,
- endIndex,
- leg: wItem.chs.length,
- timeList: [],
- };
- sentArr.push(obj);
- });
- let objs = {
- sentArr,
- enwords: dItem.sentencesEn && dItem.sentencesEn[sIndex] && dItem.sentencesEn[sIndex].replace(/'/g, '’'),
- paraAlign: dItem.paraAlign,
- sourceList: dItem.sourceList ? dItem.sourceList : [],
- sourcePosition: dItem.sourcePosition,
- widthNumber: dItem.widthNumber,
- heightNumber: dItem.heightNumber,
- };
- sentArrTotal.push(sentArr);
- resArrs.push(objs);
- });
- timeArr.push(dItem.timeList);
- });
- if (wordTimeList && wordTimeList.length > 0) {
- this.mergeWordTime(sentArrTotal, wordTimeList);
- }
- let timeList = [];
- timeArr.forEach((item) => {
- item.forEach((aItem) => {
- if (timeList.indexOf(aItem) < 0) {
- timeList.push(aItem);
- }
- });
- });
- this.resObj = { sentList: resArrs, timeList };
- },
- 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(sItem, wItem, curIndex) {
- let leg = sItem.length;
- if (wItem && wItem.chs) {
- if (this.chsFhList.indexOf(wItem.chs) > -1) {
- wItem.isShow = false;
- } else {
- wItem.isShow = true;
- }
- }
- },
- mergeWordSymbols(wItem) {
- if (this.chsFhList.indexOf(wItem.chs) > -1 || this.NumberList.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 = this.timeStrToSen(item);
- listRes.push(res);
- });
- return listRes;
- },
- // 分:秒转秒
- timeStrToSen(time) {
- if (!time) {
- return -1;
- }
- let pos = time.indexOf(':');
- let min = 0;
- let sec = 0;
- if (pos > 0) {
- min = parseInt(time.substring(0, pos));
- sec = parseFloat(time.substring(pos + 1));
- }
- return min * 60 + sec;
- },
- // 点击播放某个句子
- handleChangeTime(time) {
- this.curTime = time;
- this.$refs.audioLine.onTimeupdateTime(time / 1000);
- },
- showWordDetail(e, item) {
- let _this = this;
- if (
- this.chsFhList.indexOf(item.chs) > -1 ||
- item.chs === '“' ||
- item.chs === '(' ||
- /^[a-zA-Z0-9]/.test(item.chs)
- ) {
- return false;
- }
- if (_this.oldHz !== item.chs) {
- this.isShow = false;
- setTimeout(() => {
- _this.hz = item.chs;
- _this.pinyin = item.pinyin;
- _this.paraIndex = item.paraIndex;
- _this.sentIndex = item.sentIndex;
- _this.wordIndex = item.wordIndex;
- }, 50);
- }
- _this.clientY = e.clientY;
- let left = e.clientX;
- let width = 0;
- if (item.chs.length === 1 || item.chs.length === 2) {
- width = 304;
- } else if (item.chs.length === 3 || item.chs.length === 4) {
- width = 432;
- } else if (item.chs.length > 3) {
- width = 560;
- }
- if (left - this.bodyLeft > this.contentWidth / 2) {
- _this.left = left - width + 30;
- } else {
- _this.left = left - 30;
- }
- },
- changeWordCard(isShow) {
- let _this = this;
- _this.isShow = isShow;
- _this.oldHz = '';
- _this.hz = '';
- _this.paraIndex = -1;
- _this.sentIndex = -1;
- _this.wordIndex = -1;
- },
- // 处理分词数据
- handleNewWords(val) {
- this.isShow = true;
- this.word = null;
- let wordlist = val.split('');
- let option = {
- definition_list: [],
- mp3_list: [],
- new_word: val,
- pinyin: this.pinyin,
- };
- this.word = { list: wordlist, detail: option };
- this.oldHz = val;
- },
- getScreenHeight() {
- this.screenHeight = window.innerHeight;
- },
- changeCurQue(answer) {
- if (answer) {
- let writeModel = this.curQue.Bookanswer.writeModel;
- let hz = answer.hz;
- if (writeModel.hasOwnProperty(hz)) {
- writeModel[hz].push(answer);
- } else {
- writeModel[hz] = [answer];
- }
- }
- },
- }, // 如果页面有keep-alive缓存功能,这个函数会触发
- };
- </script>
- <style lang="scss" scoped>
- //@import url(); 引入公共css类
- .NNPE-ArticleView {
- width: 100%;
- .aduioLine-practice-npc {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .aduioLine-content {
- flex: 1;
- }
- .aduioLine-right {
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 69px;
- height: 40px;
- padding: 0 12px;
- border-left: 1px solid rgba(0, 0, 0, 10%);
- > span {
- width: 16px;
- height: 16px;
- cursor: pointer;
- }
- }
- }
- .NPC-sentences-list {
- padding: 24px 0;
- overflow: auto;
- }
- .multilingual {
- padding: 6px 24px 12px;
- word-break: break-word;
- }
- .NNPE-detail {
- overflow: hidden;
- clear: both;
- color: rgba(0, 0, 0, 85%);
- .para-center {
- display: flex;
- flex-flow: wrap;
- justify-content: center;
- width: 100%;
- }
- .para-right {
- display: flex;
- flex-flow: wrap;
- justify-content: end;
- width: 100%;
- }
- .NNPE-words {
- float: left;
- padding-bottom: 5px;
- &-box {
- float: left;
- > span {
- display: block;
- &.NNPE-pinyin {
- height: 22px;
- font-family: 'League';
- font-size: 14px;
- font-weight: normal;
- line-height: 1.5;
- &.noFont {
- font-family: initial;
- }
- &.textLeft {
- text-align: left;
- }
- }
- &.NNPE-chs {
- display: flex;
- flex-flow: wrap;
- align-items: center;
- font-family: '楷体';
- font-size: 20px;
- line-height: 1.4;
- &.active {
- background: rgba(36, 185, 158, 15%);
- }
- // &.wordActive {
- // color: #de4444;
- // }
- }
- &.padding {
- padding: 0 3px;
- }
- }
- }
- &.textLeft {
- text-align: left;
- }
- &.textCenter {
- text-align: center;
- .NNPE-chs {
- justify-content: center;
- }
- }
- &.textRight {
- text-align: right;
- }
- > span {
- display: block;
- &.NNPE-pinyin {
- height: 22px;
- font-family: 'League';
- font-size: 14px;
- font-weight: normal;
- line-height: 1.5;
- &.noFont {
- font-family: initial;
- }
- &.textLeft {
- text-align: left;
- }
- }
- &.NNPE-chs {
- display: flex;
- flex-flow: wrap;
- align-items: center;
- font-family: '楷体';
- font-size: 20px;
- line-height: 1.4;
- &.active {
- background: rgba(36, 185, 158, 15%);
- }
- // &.wordActive {
- // color: #de4444;
- // }
- }
- &.padding {
- padding: 0 3px;
- }
- }
- }
- &.NNPE-detail-title {
- .wordsList-box {
- > div {
- display: flex;
- flex-flow: wrap;
- justify-content: center;
- width: 100%;
- }
- }
- }
- .index {
- box-sizing: border-box;
- width: 48px;
- padding: 8px;
- text-align: right;
- border-right: 1px solid rgba(0, 0, 0, 10%);
- b {
- font-weight: 400;
- line-height: 1.5;
- color: #000;
- }
- }
- .wordsList-box {
- // display: flex;
- width: 100%;
- padding: 6px 24px 12px;
- &-left {
- justify-content: flex-start;
- }
- &-center {
- justify-content: center;
- }
- &-right {
- justify-content: flex-end;
- }
- > div {
- overflow: hidden;
- clear: both;
- }
- > img {
- display: block;
- max-width: 100%;
- margin: 0 auto;
- }
- }
- }
- }
- .NNPE-wordDetail {
- position: fixed;
- top: 50%;
- left: 50%;
- z-index: 116;
- max-width: 100%;
- margin-top: -196px;
- overflow: auto;
- // box-shadow: 0 4px 16px rgba(0, 0, 0, 15%);
- // width: 260px;
- // height: 200px;
- // background: #cc0;
- }
- .NNPE-detail-box {
- box-sizing: border-box;
- width: 100%;
- padding: 8px 24px;
- margin-bottom: 8px;
- &.active {
- background: rgba(222, 68, 68, 15%);
- }
- }
- .NNPE-details {
- overflow: hidden;
- clear: both;
- .NNPE-words {
- float: left;
- &-box {
- float: left;
- > span {
- display: block;
- &.NNPE-pinyin {
- height: 20px;
- font-family: 'League';
- font-size: 14px;
- font-weight: normal;
- line-height: 20px;
- color: rgba(0, 0, 0, 85%);
- &.noFont {
- font-family: initial;
- }
- &.textLeft {
- text-align: left;
- }
- &.wordBlank {
- color: rgba(0, 0, 0, 85%);
- }
- }
- &.NNPE-chs {
- display: flex;
- flex-flow: wrap;
- align-items: center;
- font-family: '楷体';
- font-size: 20px;
- line-height: 28px;
- color: rgba(0, 0, 0, 85%);
- .active {
- color: #de4444;
- }
- &.wordBlank {
- color: rgba(0, 0, 0, 85%);
- }
- }
- // &.padding {
- // padding-right: 6px;
- // }
- }
- }
- &.textLeft {
- text-align: left;
- }
- &.textCenter {
- text-align: center;
- .NNPE-chs {
- justify-content: center;
- }
- }
- &.textRight {
- text-align: right;
- }
- > span {
- display: block;
- &.NNPE-pinyin {
- height: 20px;
- font-family: 'League';
- font-size: 14px;
- font-weight: normal;
- line-height: 20px;
- color: rgba(0, 0, 0, 85%);
- &.noFont {
- font-family: initial;
- }
- &.textLeft {
- text-align: left;
- }
- &.wordBlank {
- color: rgba(0, 0, 0, 85%);
- }
- }
- &.NNPE-chs {
- display: flex;
- flex-flow: wrap;
- align-items: center;
- font-family: '楷体';
- font-size: 20px;
- line-height: 28px;
- color: rgba(0, 0, 0, 85%);
- .active {
- color: #de4444;
- }
- &.wordBlank {
- color: rgba(0, 0, 0, 85%);
- }
- }
- &.padding {
- padding: 0 3px;
- }
- }
- }
- }
- .enwords {
- padding-left: 3px;
- font-family: 'Helvetica';
- font-size: 14px;
- font-weight: normal;
- line-height: 22px;
- color: rgba(0, 0, 0, 85%);
- word-break: break-word;
- &.wordBlank {
- color: rgba(0, 0, 0, 85%);
- }
- }
- .multilingual-para {
- text-indent: 40px;
- word-break: break-word;
- &-center,
- &.multilingual-center {
- text-align: center;
- text-indent: 0;
- }
- &.multilingual-right {
- text-align: right;
- }
- }
- .NPC-Big-Book-preview-green {
- .NNPE-ArticleView {
- .NNPE-detail-box {
- &.active {
- background: rgba(36, 185, 158, 15%);
- }
- }
- }
- }
- .NPC-Big-Book-preview-brown {
- .NNPE-ArticleView {
- .NNPE-detail-box {
- &.active {
- background: rgba(189, 136, 101, 15%);
- }
- }
- }
- }
- </style>
|