WordPhrase.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951
  1. <template>
  2. <div class="NPC-zhedie" v-if="curQue">
  3. <div :class="curQue.titleBg == 'white' ? 'topTitleWhite' : 'topTitle'">
  4. <div class="NPC-top-left">
  5. <span class="NPC-topTitle-text">{{ curQue.title }}</span>
  6. <!-- <span
  7. :class="['NPC-play-all', playClass]"
  8. @click.stop="playNewwords"
  9. ></span> -->
  10. </div>
  11. <div class="NPC-top-right" @click="handleChangeTab">
  12. <span class="NPC-top-right-text">{{ wordShow ? "收起" : "展开" }}</span>
  13. <template v-if="curQue.titleBg == 'white'">
  14. <img
  15. v-if="wordShow"
  16. src="../../../assets/NPC/down-black.png"
  17. alt=""
  18. />
  19. <img v-else src="../../../assets/NPC/up-black.png" alt="" />
  20. </template>
  21. <template v-else>
  22. <img v-if="wordShow" src="../../../assets/NPC/down.png" alt="" />
  23. <img v-else src="../../../assets/NPC/up.png" alt="" />
  24. </template>
  25. </div>
  26. </div>
  27. <el-collapse-transition>
  28. <div
  29. class="NPC-word-list"
  30. v-if="curQue.option && curQue.option.length > 0"
  31. v-show="wordShow"
  32. >
  33. <div
  34. class="aduioLine-box"
  35. v-if="
  36. curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url
  37. "
  38. >
  39. <AudioLine
  40. audioId="SelectYinjieAudio"
  41. :mp3="curQue.mp3_list[0].url"
  42. :getCurTime="getCurTime"
  43. :themeColor="themeColor"
  44. :ed="ed"
  45. type="audioLine"
  46. ref="audioLine"
  47. @handleListenRead="handleListenRead"
  48. />
  49. </div>
  50. <ul class="NPC-word-table" cellspacing="0" border="0" cellpadding="0">
  51. <li
  52. class="NPC-word-tr"
  53. v-for="(item, index) in curQue.option"
  54. :key="'curQue.option' + index"
  55. >
  56. <div
  57. :class="[
  58. 'NPC-word-row',
  59. playClass && mp3_index == sItem.sIndex ? 'active' : '',
  60. curTime >= sItem.bg &&
  61. curTime < sItem.ed &&
  62. stopAudioS
  63. ? 'active'
  64. : '',
  65. ]"
  66. v-for="(sItem, sIndex) in item"
  67. :key="'curQue.option.child' + sIndex"
  68. >
  69. <template
  70. v-if="
  71. sItem.mp3_list &&
  72. sItem.mp3_list.length > 0 &&
  73. sItem.mp3_list[0].id
  74. "
  75. >
  76. <span
  77. :class="[
  78. themeColor == 'green'
  79. ? 'NPC-play-btn-green'
  80. : themeColor == 'red'
  81. ? 'NPC-play-btn-red'
  82. : 'NPC-play-btn-brown',
  83. playClass && mp3_index == sItem.sIndex ? 'active' : '',
  84. ]"
  85. @click="palyAudio(sItem.sIndex)"
  86. ></span>
  87. <audio
  88. :id="'word' + indexs + indexss + sItem.sIndex"
  89. :src="sItem.mp3_list[0].id"
  90. ></audio>
  91. </template>
  92. <template v-else-if="sItem.bg||sItem.ed">
  93. <a
  94. :class="[
  95. 'play-btn',
  96. curTime >= sItem.bg &&
  97. curTime < sItem.ed &&
  98. stopAudioS
  99. ? 'active'
  100. : '',
  101. ]"
  102. @click="handleChangeTime(sItem.bg,sItem.ed)"
  103. ></a>
  104. </template>
  105. <template v-else>
  106. <span style="width: 16px; height: 16px"></span>
  107. </template>
  108. <template v-if="sItem.mIndex == 0">
  109. <b class="tabNum">{{ index + 1 }}</b>
  110. </template>
  111. <div
  112. v-else
  113. style="width: 16px; height: 16px; margin-left: 8px"
  114. ></div>
  115. <template
  116. v-if="
  117. sItem.pinyin_site &&
  118. (sItem.pinyin_site == 'top' || sItem.pinyin_site == 'bottom')
  119. "
  120. >
  121. <div class="NPC-word-tab-box">
  122. <span
  123. class="NPC-word-tab-common NPC-word-tab-pinyin"
  124. :class="[
  125. sItem.motif_color
  126. ? 'NPC-word-tab-pinyin-' + themeColor
  127. : '',
  128. ]"
  129. v-if="sItem.pinyin_site == 'top'"
  130. >
  131. {{ sItem.pinyin }}
  132. </span>
  133. <span
  134. class="NPC-word-tab-common NPC-word-tab-word"
  135. :class="[
  136. sItem.motif_color
  137. ? 'NPC-word-tab-word-' + themeColor
  138. : '',
  139. ]"
  140. >
  141. {{ sItem.new_word }}
  142. </span>
  143. <span
  144. class="NPC-word-tab-common NPC-word-tab-pinyin"
  145. :class="[
  146. sItem.motif_color
  147. ? 'NPC-word-tab-pinyin-' + themeColor
  148. : '',
  149. ]"
  150. v-if="sItem.pinyin_site == 'bottom'"
  151. >
  152. {{ sItem.pinyin }}
  153. </span>
  154. </div>
  155. <span
  156. class="NPC-word-tab-common NPC-word-tab-cixing"
  157. v-html="sItem.cixing"
  158. ></span>
  159. <span
  160. class="NPC-word-tab-common NPC-word-tab-def"
  161. v-html="sItem.def_str"
  162. ></span>
  163. </template>
  164. <template v-else>
  165. <span
  166. class="NPC-word-tab-common NPC-word-tab-pinyin"
  167. :class="[
  168. sItem.motif_color
  169. ? 'NPC-word-tab-pinyin-' + themeColor
  170. : '',
  171. ]"
  172. v-if="!sItem.pinyin_site || sItem.pinyin_site == 'first'"
  173. >
  174. {{ sItem.pinyin }}
  175. </span>
  176. <span
  177. class="NPC-word-tab-common NPC-word-tab-word"
  178. :class="[
  179. sItem.motif_color ? 'NPC-word-tab-word-' + themeColor : '',
  180. ]"
  181. >
  182. {{ sItem.new_word }}
  183. </span>
  184. <span
  185. class="NPC-word-tab-common NPC-word-tab-pinyin"
  186. :class="[
  187. sItem.motif_color
  188. ? 'NPC-word-tab-pinyin-' + themeColor
  189. : '',
  190. ]"
  191. v-if="sItem.pinyin_site == 'last'"
  192. >
  193. {{ sItem.pinyin }}
  194. </span>
  195. <span
  196. class="NPC-word-tab-common NPC-word-tab-cixing"
  197. v-html="sItem.cixing"
  198. ></span>
  199. <span
  200. class="NPC-word-tab-common NPC-word-tab-def"
  201. v-html="sItem.def_str"
  202. ></span>
  203. </template>
  204. <span v-if="curQue.isInfor">
  205. <img
  206. src="../../../assets/NPC/detail-icon.png"
  207. class="detail-icon"
  208. @click="showDetail(sItem)"
  209. />
  210. </span>
  211. </div>
  212. </li>
  213. </ul>
  214. </div>
  215. </el-collapse-transition>
  216. <div class="practiceBox" v-if="detailShow">
  217. <WordPhraseDetail
  218. :data="data"
  219. :changeDetailIndex="changeDetailIndex"
  220. :closeWord="closeWordShow"
  221. :detailIndex="detailIndex"
  222. :optionRes="optionRes"
  223. :themeColor="themeColor"
  224. :currentTreeID="currentTreeID"
  225. type="newWordDetail"
  226. />
  227. </div>
  228. <audio ref="newwordAudio" />
  229. </div>
  230. </template>
  231. <script>
  232. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  233. //例如:import 《组件名称》from ‘《组件路径》';
  234. import WordPhraseDetail from "./components/WordPhraseDetail.vue";
  235. import AudioLine from "../preview/AudioLine.vue";
  236. export default {
  237. //import引入的组件需要注入到对象中才能使用
  238. components: {
  239. WordPhraseDetail,
  240. AudioLine,
  241. },
  242. props: ["curQue", "themeColor", "currentTreeID", "indexs", "indexss"],
  243. data() {
  244. //这里存放数据
  245. return {
  246. wordShow: true,
  247. data: null,
  248. detailShow: false,
  249. detailIndex: 0,
  250. audio: new Audio(),
  251. playClass: "",
  252. mp3_index: -1,
  253. playWord: null,
  254. optionRes: [],
  255. mp3List: [],
  256. isSuccess: false,
  257. loading: false,
  258. mp3: "",
  259. curTime: 0,
  260. stopAudioS: false,
  261. ed:null,
  262. };
  263. },
  264. //计算属性 类似于data概念
  265. computed: {},
  266. //监控data中数据变化
  267. watch: {
  268. currentTreeID: {
  269. handler: function () {
  270. this.mp3_index = -1; // 全文预览
  271. this.optionRes = []; // 显示单词和短语
  272. this.mp3List = []; // 语音练习
  273. this.initData();
  274. },
  275. deep: true,
  276. },
  277. },
  278. //方法集合
  279. methods: {
  280. handleChange(val) {},
  281. palyAudio(sIndex) {
  282. let _this = this;
  283. _this.stopAudio();
  284. let node = document.getElementById(
  285. "word" + _this.indexs + _this.indexss + sIndex
  286. );
  287. let mp3 = node.src;
  288. let audio = document.getElementsByTagName("audio");
  289. audio.forEach((item) => {
  290. if (item.src != mp3) {
  291. item.pause();
  292. }
  293. });
  294. _this.playWord = node;
  295. if (node) {
  296. this.mp3_index = sIndex;
  297. node.play();
  298. }
  299. this.handleListenPlay(sIndex);
  300. },
  301. handleListenPlay(sIndex) {
  302. let _this = this;
  303. if (_this.playWord) {
  304. let _this = this;
  305. _this.playWord.addEventListener("play", function () {
  306. _this.playClass = "nn";
  307. });
  308. _this.playWord.addEventListener("pause", function () {
  309. _this.mp3_index = -1;
  310. _this.playClass = "";
  311. });
  312. _this.playWord.addEventListener("ended", function () {
  313. _this.mp3_index = -1;
  314. _this.playClass = "";
  315. });
  316. }
  317. },
  318. // 打开单词详情
  319. showDetail(item) {
  320. this.data = null;
  321. this.data = item;
  322. this.detailShow = true;
  323. this.detailIndex = item.sIndex;
  324. },
  325. // 关闭单词详情
  326. closeWordShow(val) {
  327. this.detailShow = val;
  328. },
  329. changeDetailIndex(val) {
  330. let _this = this;
  331. if (val == "last") {
  332. _this.detailIndex--;
  333. } else {
  334. _this.detailIndex++;
  335. }
  336. _this.data = null;
  337. _this.data = _this.optionRes[_this.detailIndex];
  338. //_this.getWordLiju(_this.data.new_word);
  339. },
  340. playNewwords() {
  341. let _this = this;
  342. if (_this.playWord) {
  343. _this.playWord.pause();
  344. }
  345. if (_this.playClass) {
  346. _this.$refs.newwordAudio.pause();
  347. // _this.mp3_index = -1;
  348. _this.playClass = "";
  349. } else {
  350. let mp3_index = _this.mp3_index == -1 ? 0 : _this.mp3_index;
  351. let leg = _this.mp3List.length;
  352. let mp3 = _this.mp3List[mp3_index].mp3_list[0].id;
  353. _this.mp3_index = _this.mp3List[mp3_index].sIndex;
  354. _this.handlePlayVoice(mp3);
  355. _this.$refs.newwordAudio.addEventListener("ended", function () {
  356. setTimeout(() => {
  357. if (_this.playClass != "nn") {
  358. if (mp3_index < leg - 1) {
  359. if (_this.playClass) {
  360. mp3_index = mp3_index + 1;
  361. _this.mp3_index = _this.mp3List[mp3_index].sIndex;
  362. mp3 =
  363. _this.mp3List[mp3_index].mp3_list.length > 0 &&
  364. _this.mp3List[mp3_index].mp3_list[0].id;
  365. if (mp3) {
  366. _this.handlePlayVoice(mp3);
  367. }
  368. }
  369. } else {
  370. _this.mp3_index = -1;
  371. _this.playClass = "";
  372. }
  373. }
  374. }, 1000);
  375. });
  376. }
  377. },
  378. handlePlayVoice3(mp3) {
  379. let _this = this;
  380. let audio = document.getElementsByTagName("audio");
  381. audio.forEach((item) => {
  382. if (item.src != mp3) {
  383. item.pause();
  384. }
  385. });
  386. if (!mp3) {
  387. return;
  388. }
  389. if (!_this.audio.paused) {
  390. _this.audio.pause();
  391. } else {
  392. _this.audio.pause();
  393. _this.audio.load();
  394. _this.audio.src = mp3;
  395. _this.audio.loop = false;
  396. _this.audio.play();
  397. }
  398. },
  399. handlePlayVoice(mp3) {
  400. let _this = this;
  401. let audio = document.getElementsByTagName("audio");
  402. audio.forEach((item) => {
  403. if (item.src != mp3) {
  404. item.pause();
  405. }
  406. });
  407. if (!mp3) {
  408. return;
  409. }
  410. // setTimeout(() => {
  411. //_this.$refs.newwordAudio.pause();
  412. _this.$refs.newwordAudio.src = mp3;
  413. //_this.$refs.newwordAudio.load();
  414. _this.$refs.newwordAudio.play();
  415. // }, 1000);
  416. },
  417. stopAudio() {
  418. this.$refs.newwordAudio.pause();
  419. },
  420. initData() {
  421. let _this = this
  422. if (this.curQue.type == "NewWord_chs") {
  423. let resIndex = 0;
  424. let optionRes = [];
  425. let mp3List = [];
  426. let itemNumber = 0;
  427. this.curQue.option.forEach((item, index) => {
  428. optionRes = optionRes.concat(item);
  429. item.forEach((sItem, sIndex) => {
  430. sItem.mIndex = sIndex;
  431. sItem.sIndex = resIndex;
  432. resIndex++;
  433. sItem.def_str =
  434. sItem.definition_list.length > 0
  435. ? sItem.definition_list.join(" ")
  436. : "";
  437. if (sItem.mp3_list[0]) {
  438. mp3List.push(sItem);
  439. }
  440. if(_this.curQue.wordTime&&_this.curQue.wordTime[itemNumber]){
  441. sItem.bg = _this.curQue.wordTime[itemNumber].bg
  442. sItem.ed = _this.curQue.wordTime[itemNumber].ed
  443. }
  444. itemNumber++;
  445. });
  446. });
  447. this.optionRes = JSON.parse(JSON.stringify(optionRes));
  448. this.mp3List = mp3List;
  449. }
  450. },
  451. handleChangeTab() {
  452. this.wordShow = !this.wordShow;
  453. },
  454. getCurTime(curTime) {
  455. this.curTime = curTime * 1000;
  456. },
  457. //点击播放某个句子
  458. handleChangeTime(time,edTime) {
  459. let _this = this;
  460. _this.curTime = time;
  461. _this.stopAudioS = true
  462. _this.$refs.audioLine.onTimeupdateTime(time / 1000, true);
  463. _this.ed = edTime
  464. },
  465. handleListenRead(playFlag) {
  466. this.stopAudioS = playFlag;
  467. },
  468. emptyEd(){
  469. this.ed = null;
  470. }
  471. },
  472. //生命周期 - 创建完成(可以访问当前this实例)
  473. created() {
  474. this.initData();
  475. },
  476. //生命周期 - 挂载完成(可以访问DOM元素)
  477. mounted() {
  478. let _this = this;
  479. _this.$refs.newwordAudio.addEventListener("play", function () {
  480. _this.playClass = "active";
  481. });
  482. _this.$refs.newwordAudio.addEventListener("pause", function () {
  483. //_this.playClass = "";
  484. });
  485. },
  486. //生命周期-创建之前
  487. beforeCreated() {},
  488. //生命周期-挂载之前
  489. beforeMount() {},
  490. //生命周期-更新之前
  491. beforUpdate() {},
  492. //生命周期-更新之后
  493. updated() {},
  494. //生命周期-销毁之前
  495. beforeDestory() {},
  496. //生命周期-销毁完成
  497. destoryed() {},
  498. //如果页面有keep-alive缓存功能,这个函数会触发
  499. activated() {},
  500. };
  501. </script>
  502. <style lang="scss" scoped>
  503. /* @import url(); 引入css类 */
  504. .NPC-zhedie {
  505. width: 780px;
  506. margin-bottom: 24px;
  507. .aduioLine-box{
  508. margin-bottom: 8px;
  509. }
  510. .practiceBox {
  511. position: fixed;
  512. left: 0;
  513. top: 0;
  514. z-index: 999;
  515. width: 100%;
  516. height: 100vh;
  517. background: rgba(0, 0, 0, 0.19);
  518. box-sizing: border-box;
  519. overflow: hidden;
  520. overflow-y: auto;
  521. }
  522. .NPC-word-list {
  523. background: #f7f7f7;
  524. }
  525. .NPC-word-table {
  526. width: 100%;
  527. > .NPC-word-tr {
  528. background: #fff;
  529. border-radius: 8px;
  530. margin-bottom: 8px;
  531. .NPC-word-row {
  532. cursor: pointer;
  533. display: flex;
  534. justify-content: flex-start;
  535. padding: 8px 13px 8px 12px;
  536. border-radius: 8px;
  537. &.active {
  538. background: linear-gradient(
  539. 0deg,
  540. rgba(0, 0, 0, 0.08),
  541. rgba(0, 0, 0, 0.08)
  542. ),
  543. #ffffff;
  544. }
  545. > span {
  546. font-size: 16px;
  547. line-height: 150%;
  548. color: #000000;
  549. }
  550. }
  551. .tabNum {
  552. background: #de4444;
  553. text-align: center;
  554. width: 16px;
  555. height: 16px;
  556. color: #ffffff;
  557. border-radius: 50%;
  558. font-size: 12px;
  559. font-family: "robot";
  560. line-height: 16px;
  561. margin-top: 4px;
  562. margin-left: 8px;
  563. }
  564. .NPC-word-tab-box {
  565. width: 240px;
  566. span {
  567. display: block;
  568. width: 100%;
  569. color: #000000;
  570. margin: 2px 0;
  571. }
  572. }
  573. .NPC-word-tab-common {
  574. padding-left: 8px;
  575. width: 120px;
  576. box-sizing: border-box;
  577. }
  578. .NPC-word-tab-pinyin {
  579. font-family: "GB-PINYINOK-B";
  580. white-space: nowrap;
  581. font-size: 12px;
  582. &.NPC-word-tab-pinyin-red {
  583. color: #e35454;
  584. }
  585. &.NPC-word-tab-pinyin-green {
  586. color: #24b99e;
  587. }
  588. &.NPC-word-tab-pinyin-brown {
  589. color: #bd8865;
  590. }
  591. }
  592. .NPC-word-tab-word {
  593. font-family: "FZJCGFKTK";
  594. white-space: nowrap;
  595. font-size: 16px;
  596. &.NPC-word-tab-word-red {
  597. color: #e35454;
  598. }
  599. &.NPC-word-tab-word-green {
  600. color: #24b99e;
  601. }
  602. &.NPC-word-tab-word-brown {
  603. color: #bd8865;
  604. }
  605. }
  606. .NPC-word-tab-cixing {
  607. font-family: "robot";
  608. width: 48px;
  609. box-sizing: border-box;
  610. text-align: left;
  611. font-style: italic;
  612. }
  613. .NPC-word-tab-def {
  614. flex: 1;
  615. font-family: "robot";
  616. word-break: break-word;
  617. box-sizing: border-box;
  618. white-space: pre-wrap;
  619. }
  620. }
  621. }
  622. .NPC-play-btn-brown {
  623. margin-top: 4px;
  624. width: 16px;
  625. height: 16px;
  626. display: block;
  627. background: url("../../../assets/NPC/play-brown.png") no-repeat left top;
  628. background-size: 100% 100%;
  629. &.active {
  630. background: url("../../../assets/NPC/icon-voice-play-brown.png") no-repeat
  631. left top;
  632. background-size: 100% 100%;
  633. }
  634. }
  635. .NPC-play-btn-green {
  636. margin-top: 4px;
  637. width: 16px;
  638. height: 16px;
  639. display: block;
  640. background: url("../../../assets/NPC/play-green.png") no-repeat left top;
  641. background-size: 100% 100%;
  642. &.active {
  643. background: url("../../../assets/NPC/icon-voice-play-green.png") no-repeat
  644. left top;
  645. background-size: 100% 100%;
  646. }
  647. }
  648. .NPC-play-btn-red {
  649. margin-top: 4px;
  650. width: 16px;
  651. height: 16px;
  652. display: block;
  653. background: url("../../../assets/NPC/play-red.png") no-repeat left top;
  654. background-size: 100% 100%;
  655. &.active {
  656. background: url("../../../assets/NPC/icon-voice-play-red.png") no-repeat
  657. left top;
  658. background-size: 100% 100%;
  659. }
  660. }
  661. .NPC-word-list {
  662. padding: 20px 24px;
  663. border: 1px solid rgba(0, 0, 0, 0.1);
  664. border-top: none;
  665. border-radius: 0 0 8px 8px;
  666. }
  667. .detail-icon {
  668. width: 56px;
  669. height: 24px;
  670. display: block;
  671. cursor: pointer;
  672. }
  673. .play-btn {
  674. margin-top: 4px;
  675. width: 16px;
  676. height: 16px;
  677. background: url("../../../assets/NPC/play-red.png") center no-repeat;
  678. background-size: cover;
  679. &.active {
  680. background-image: url("../../../assets/NPC/icon-voice-play-red.png");
  681. background-size: cover;
  682. }
  683. }
  684. }
  685. .NPC-Big-Book-preview-green {
  686. .NPC-zhedie {
  687. .play-btn {
  688. background: url("../../../assets/NPC/play-green.png") center no-repeat;
  689. background-size: cover;
  690. &.active {
  691. background-image: url("../../../assets/NPC/icon-voice-play-green.png");
  692. background-size: cover;
  693. }
  694. }
  695. }
  696. }
  697. .NPC-Big-Book-preview-brown {
  698. .NPC-zhedie {
  699. .play-btn {
  700. background: url("../../../assets/NPC/play-brown.png") center no-repeat;
  701. background-size: cover;
  702. &.active {
  703. background-image: url("../../../assets/NPC/icon-voice-play-brown.png");
  704. background-size: cover;
  705. }
  706. }
  707. }
  708. }
  709. @keyframes firstrotate {
  710. 0% {
  711. transform: rotateZ(0deg);
  712. }
  713. 100% {
  714. transform: rotateZ(180deg);
  715. }
  716. }
  717. @keyframes huifuRotate {
  718. 0% {
  719. transform: rotateZ(180deg);
  720. }
  721. 100% {
  722. transform: rotateZ(0deg);
  723. }
  724. }
  725. </style>
  726. <style lang="scss">
  727. .NPC-zhedie {
  728. .topTitle {
  729. width: 100%;
  730. display: flex;
  731. justify-content: space-between;
  732. padding-left: 24px;
  733. padding-right: 16px;
  734. height: 48px;
  735. background: #e35454;
  736. border: 1px solid rgba(0, 0, 0, 0.1);
  737. overflow: hidden;
  738. border-radius: 8px 8px 0 0;
  739. .NPC-top-left {
  740. display: flex;
  741. justify-content: flex-start;
  742. align-items: center;
  743. .NPC-topTitle-text {
  744. font-family: "sourceR";
  745. font-size: 16px;
  746. color: #fff;
  747. font-weight: bold;
  748. margin-right: 8px;
  749. white-space: pre;
  750. }
  751. .NPC-play-all {
  752. width: 16px;
  753. height: 16px;
  754. background: url("../../../assets/NPC/play-white.png") no-repeat left top;
  755. background-size: 100% 100%;
  756. cursor: pointer;
  757. &.active {
  758. width: 16px;
  759. height: 16px;
  760. background: url("../../../assets/NPC/icon-voice-play-white.png")
  761. no-repeat left top;
  762. background-size: 100% 100%;
  763. }
  764. }
  765. }
  766. .NPC-top-right {
  767. display: flex;
  768. justify-content: flex-start;
  769. align-items: center;
  770. cursor: pointer;
  771. &-text {
  772. font-weight: normal;
  773. font-size: 14px;
  774. line-height: 16px;
  775. color: #ffffff;
  776. }
  777. img {
  778. width: 16px;
  779. height: 16px;
  780. margin-left: 4px;
  781. }
  782. }
  783. img {
  784. width: 24px;
  785. height: 24px;
  786. }
  787. .rotate {
  788. animation-name: firstrotate;
  789. animation-direction: 2s;
  790. animation-fill-mode: both;
  791. animation-timing-function: linear;
  792. }
  793. }
  794. .topTitleWhite {
  795. width: 100%;
  796. display: flex;
  797. justify-content: space-between;
  798. padding-left: 24px;
  799. padding-right: 16px;
  800. height: 48px;
  801. background: #fff;
  802. border: 1px solid rgba(0, 0, 0, 0.1);
  803. overflow: hidden;
  804. border-radius: 8px 8px 0 0;
  805. .NPC-top-left {
  806. display: flex;
  807. justify-content: flex-start;
  808. align-items: center;
  809. .NPC-topTitle-text {
  810. font-family: "sourceR";
  811. font-size: 16px;
  812. color: #000;
  813. font-weight: bold;
  814. margin-right: 8px;
  815. }
  816. .NPC-play-all {
  817. width: 16px;
  818. height: 16px;
  819. background: url("../../../assets/NPC/play-red.png") no-repeat left top;
  820. background-size: 100% 100%;
  821. cursor: pointer;
  822. &.active {
  823. width: 16px;
  824. height: 16px;
  825. background: url("../../../assets/NPC/icon-voice-play-red.png")
  826. no-repeat left top;
  827. background-size: 100% 100%;
  828. }
  829. }
  830. }
  831. .NPC-top-right {
  832. display: flex;
  833. justify-content: flex-start;
  834. align-items: center;
  835. cursor: pointer;
  836. &-text {
  837. font-weight: normal;
  838. font-size: 14px;
  839. line-height: 16px;
  840. color: #000;
  841. }
  842. img {
  843. width: 16px;
  844. height: 16px;
  845. margin-left: 4px;
  846. }
  847. }
  848. img {
  849. width: 24px;
  850. height: 24px;
  851. }
  852. .rotate {
  853. animation-name: firstrotate;
  854. animation-direction: 2s;
  855. animation-fill-mode: both;
  856. animation-timing-function: linear;
  857. }
  858. }
  859. .el-collapse-item__content {
  860. padding-bottom: 0;
  861. }
  862. .el-slider__button {
  863. width: 8px;
  864. height: 8px;
  865. }
  866. .el-slider__runway {
  867. margin: 0;
  868. padding: 0;
  869. }
  870. .el-slider {
  871. position: relative;
  872. // top: -3px;
  873. }
  874. .el-collapse {
  875. background: #f7f7f7;
  876. box-sizing: border-box;
  877. border-radius: 8px;
  878. }
  879. .el-collapse-item__wrap {
  880. border: 1px solid rgba(0, 0, 0, 0.1);
  881. border-top: 0;
  882. background: #f7f7f7;
  883. border-radius: 0px 0px 8px 8px;
  884. }
  885. .el-collapse-item__arrow {
  886. display: none;
  887. }
  888. .el-table__row {
  889. padding: 4px 0;
  890. }
  891. }
  892. .NPC-Big-Book-preview-green {
  893. .NPC-zhedie {
  894. .topTitle {
  895. background: #24b99e !important;
  896. }
  897. .tabNum {
  898. background: #24b99e !important;
  899. }
  900. .topTitleWhite {
  901. .NPC-top-left {
  902. .NPC-play-all {
  903. background: url("../../../assets/NPC/play-green.png") no-repeat left
  904. top;
  905. background-size: 100% 100%;
  906. &.active {
  907. background: url("../../../assets/NPC/play-green.png") no-repeat left
  908. top;
  909. background-size: 100% 100%;
  910. }
  911. }
  912. }
  913. }
  914. }
  915. }
  916. .NPC-Big-Book-preview-brown {
  917. .NPC-zhedie {
  918. .topTitle {
  919. background: #bd8865 !important;
  920. }
  921. .tabNum {
  922. background: #bd8865 !important;
  923. }
  924. .topTitleWhite {
  925. .NPC-top-left {
  926. .NPC-play-all {
  927. background: url("../../../assets/NPC/play-brown.png") no-repeat left
  928. top;
  929. background-size: 100% 100%;
  930. &.active {
  931. background: url("../../../assets/NPC/play-brown.png") no-repeat left
  932. top;
  933. background-size: 100% 100%;
  934. }
  935. }
  936. }
  937. }
  938. }
  939. }
  940. </style>