WordPhrase.vue 25 KB

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