ReadArticle.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. <template>
  2. <!-- 听录音 学生字 -->
  3. <div style="text-align:center;margin-top:48px;">
  4. <Audio :mp3="cur.stem[0].mp3_url"/>
  5. <div class="SelectCorrect" v-if="cur.stem[0].con||cur.stem[0].img_url">
  6. <div class="SelectCorrect-top">
  7. <img alt src="../../assets/qp/Ellipse 27.png">
  8. <img alt src="../../assets/qp/Ellipse 28.png">
  9. <img alt src="../../assets/qp/Ellipse 29.png">
  10. </div>
  11. <div class="SelectCorrect-main">
  12. <div class="dialog-maxHeight">
  13. <div class="left-box">
  14. <!-- <img
  15. :src="cur.stem[0].img_url"
  16. @click="handleChildSrcList(cur.stem[0].img_url)"
  17. class="article-img"
  18. v-if="cur.stem[0].img_url"
  19. > -->
  20. <el-image
  21. :src="cur.stem[0].img_url"
  22. class="article-img"
  23. fit="scale-down"
  24. :preview-src-list="[cur.stem[0].img_url]"
  25. v-if="cur.stem[0].img_url && cur.stem[0].img_url.indexOf('http') > -1"
  26. >
  27. <div slot="placeholder" class="image-slot">
  28. <img src="../../assets/common/icon-imgloading.png" />
  29. </div>
  30. </el-image>
  31. </div>
  32. <div class="right-box">
  33. <div class="inner" v-if="cur.stem[0].con||cur.stem[0].english">
  34. <template v-if="cur.stem[0].pinyin">
  35. <div
  36. :key="indexs"
  37. style="padding-bottom:5px;"
  38. v-for="(items,indexs) in cur.stem[0].con"
  39. >
  40. <p
  41. :class="bd.indexOf(cur.stem[0].pinyin.split(' ')[indexs]) != -1 ? 'pinyin_hidden' : 'spell'"
  42. >{{cur.stem[0].pinyin.split(" ")[indexs]}}</p>
  43. <p class="chinese">{{items}}</p>
  44. </div>
  45. <p class="english">{{cur.stem[0].english}}</p>
  46. </template>
  47. <template v-else>
  48. <div
  49. style="padding-bottom:5px;"
  50. >
  51. <p class="chinese" v-html="cur.stem[0].con"></p>
  52. </div>
  53. <p class="english" v-html="cur.stem[0].english"></p>
  54. </template>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <ul class="learn-box">
  61. <li :key="index" v-for="(item,index) in cur.annotationChinese">
  62. <div v-if="item.con!==''||item.english!==''">
  63. <!-- <span>
  64. <Audio :mp3="item.mp3_url"/>
  65. </span>
  66. <div class="inner">
  67. <div :key="indexs" v-for="(items,indexs) in item.con">
  68. <p class="spell">{{item.pinyin.split(" ")[indexs]}}</p>
  69. <p class="chinese">{{items}}</p>
  70. </div>
  71. </div>
  72. <b>{{item.english}}</b>
  73. <div @click="handlePrashow(item)" class="bg-box">
  74. <img class="practice-icon" src="../../assets/common/dict-icon.png">
  75. </div>-->
  76. <p>{{item.pinyin}}</p>
  77. <b>{{item.con}}</b>
  78. <span>{{item.english}}</span>
  79. <div class="operate-box">
  80. <a v-if="item.mp3_url">
  81. <AudioRed :mp3="item.mp3_url"/>
  82. </a>
  83. <a>
  84. <img src="../../assets/common/icon-collect-red.png">
  85. </a>
  86. <a @click="handlePrashow(item)">
  87. <img src="../../assets/common/icon-write-red.png">
  88. </a>
  89. </div>
  90. </div>
  91. </li>
  92. </ul>
  93. <div class="practiceBox" v-if="isPraShow">
  94. <Practice :changePraShow="changePraShow" :cur="practiceCon"/>
  95. </div>
  96. <div class="practiceBox" v-if="isPraShows">
  97. <Practicewords :changePraShow="changePraShow" :cur="practiceCon"/>
  98. </div>
  99. </div>
  100. </template>
  101. <script>
  102. import Practice from "../../components/common/Practice";
  103. import Practicewords from "../../components/common/Practicewords";
  104. import AudioRed from "../../components/common/AudioRed";
  105. import Audio from "../../components/common/Audio";
  106. import VoicePlay from "../../components/common/VoicePlay";
  107. export default {
  108. name: 'listenAndLearn',
  109. components: {
  110. Practice,
  111. Practicewords,
  112. AudioRed,
  113. VoicePlay,
  114. Audio
  115. },
  116. props: [
  117. "cur",
  118. "getAnswer",
  119. "queIndex",
  120. "answer",
  121. "uiType",
  122. "watchIndex",
  123. "handleChildSrcList"
  124. ],
  125. data () {
  126. return {
  127. isPraShow: false,
  128. isPraShows: false,
  129. option: [
  130. ], // 选项
  131. stemCn: [], // 题干 中文
  132. stemPy: [], // 题干 拼音
  133. languageArr: [
  134. '简单',
  135. '困难'
  136. ],
  137. lanactiveArr: [
  138. '简单'
  139. ],
  140. lanShow: false, // 语言分类按钮是否显示
  141. voiceSrc: require("../../assets/single/icon-voice.png"),
  142. voicePauseSrc: require("../../assets/single/icon-voice.png"),
  143. voicePlaySrc: require("../../assets/common/icon-voice-play.png"),
  144. practiceValue: null,
  145. practiceCon: null, // 练一练内容
  146. isShowCorrect: false, //上面对话内容是否显示
  147. bd: [
  148. ",",
  149. ",",
  150. "。",
  151. ".",
  152. "!",
  153. "?",
  154. ":",
  155. ";",
  156. "(",
  157. ")",
  158. "【",
  159. "】",
  160. "{",
  161. "}",
  162. "‘",
  163. "“",
  164. "’",
  165. "”",
  166. "、",
  167. "、",
  168. "《",
  169. "》",
  170. "…",
  171. "·",
  172. "—",
  173. "~"
  174. ],
  175. previewSrcList: []
  176. };
  177. },
  178. watch: {
  179. watchIndex: {
  180. handler: function (val, oldVal) {
  181. let _this = this;
  182. if (val) {
  183. _this.handleData()
  184. }
  185. },
  186. // 深度观察监听
  187. deep: true,
  188. },
  189. },
  190. mounted () {
  191. },
  192. methods: {
  193. handleData () {
  194. if (this.cur.stem[0].img_url) this.previewSrcList = [this.cur.stem[0].img_url]
  195. },
  196. // 切换语言
  197. changeLan (item, index) {
  198. this.lanactiveArr = item
  199. },
  200. changePraShow () {
  201. this.isPraShow = false;
  202. this.isPraShows = false;
  203. },
  204. handlePrashow (item) {
  205. let obj = {
  206. stem: [
  207. {
  208. mp3_url: item.mp3_url,
  209. pinyin: item.pinyin,
  210. con: item.con
  211. }
  212. ],
  213. playStorkes: true,
  214. learn_mode: '1'
  215. }
  216. this.practiceCon = obj
  217. if (item.con.length > 1) {
  218. this.isPraShows = true;
  219. } else {
  220. this.isPraShow = true;
  221. }
  222. },
  223. // 判断对错
  224. practiceJudge () {
  225. return true
  226. }
  227. },
  228. created () {
  229. this.handleData()
  230. },
  231. };
  232. </script>
  233. <style lang="scss" scoped>
  234. * {
  235. margin: 0;
  236. padding: 0;
  237. }
  238. .SelectCorrect {
  239. width: 1200px;
  240. margin: 0 auto;
  241. background: #fff;
  242. border-radius: 24px;
  243. .SelectCorrect-top {
  244. width: 100%;
  245. height: 60px;
  246. background: rgba(255, 214, 107, 0.3);
  247. border-top-left-radius: 24px;
  248. border-top-right-radius: 24px;
  249. display: flex;
  250. align-items: center;
  251. > img {
  252. margin-left: 20px;
  253. width: 24px;
  254. }
  255. }
  256. .SelectCorrect-main {
  257. background: #fff;
  258. height: 580px;
  259. border-bottom-left-radius: 24px;
  260. border-bottom-right-radius: 24px;
  261. &::after {
  262. content: '';
  263. display: block;
  264. height: 0;
  265. clear: both;
  266. visibility: hidden;
  267. }
  268. }
  269. .dialog-maxHeight {
  270. display: flex;
  271. justify-content: flex-start;
  272. max-height: 580px;
  273. .right-box {
  274. max-height: 560px;
  275. overflow: auto;
  276. }
  277. .inner {
  278. padding: 36px 48px;
  279. display: flex;
  280. align-items: center;
  281. flex-flow: wrap;
  282. }
  283. }
  284. .english {
  285. color: #2c2c2c;
  286. font-size: 24px;
  287. line-height: 24px;
  288. font-family: sourceR;
  289. margin-left: 5px;
  290. text-align: left;
  291. width: 100%;
  292. }
  293. .spell {
  294. font-family: 'GB-PINYINOK-B';
  295. font-style: normal;
  296. font-weight: normal;
  297. font-size: 18px;
  298. height: 24px;
  299. color: #000;
  300. }
  301. .chinese {
  302. font-family: 'FZJCGFKTK';
  303. font-style: normal;
  304. font-weight: normal;
  305. font-size: 36px;
  306. color: #000;
  307. }
  308. .pinyin_hidden {
  309. visibility: hidden;
  310. }
  311. }
  312. .learn-box {
  313. list-style: none;
  314. width: 1200px;
  315. max-height: 800px;
  316. overflow: auto;
  317. margin: 20px auto;
  318. display: flex;
  319. justify-content: flex-start;
  320. align-items: center;
  321. flex-flow: wrap;
  322. li {
  323. margin: 12px;
  324. > div {
  325. width: 360px;
  326. height: 360px;
  327. background: #ffffff;
  328. box-shadow: 0px 6px 0px rgba(239, 167, 28, 0.4);
  329. border-radius: 24px;
  330. color: #2c2c2c;
  331. padding-top: 12px;
  332. > p {
  333. height: 60px;
  334. width: 100%;
  335. text-align: center;
  336. padding: 12px 30px;
  337. font-size: 24px;
  338. line-height: 1.5;
  339. font-family: 'GB-PINYINOK-B';
  340. }
  341. b {
  342. height: 108px;
  343. background: #fff2d1;
  344. font-size: 48px;
  345. line-height: 100%;
  346. text-align: center;
  347. display: block;
  348. font-weight: normal;
  349. padding: 30px 0;
  350. font-family: FZJCGFKTK;
  351. }
  352. span {
  353. height: 102px;
  354. display: flex;
  355. flex-flow: wrap;
  356. justify-content: center;
  357. padding: 24px 30px 6px 30px;
  358. font-size: 24px;
  359. line-height: 150%;
  360. word-break: keep-all;
  361. }
  362. .operate-box {
  363. display: flex;
  364. align-items: center;
  365. padding: 0 18px;
  366. }
  367. a {
  368. width: 84px;
  369. height: 48px;
  370. background: rgba(255, 87, 87, 0.1);
  371. border-radius: 24px;
  372. display: flex;
  373. margin: 0 12px;
  374. align-items: center;
  375. justify-content: center;
  376. &:hover {
  377. background: rgba(255, 137, 133, 0.1);
  378. }
  379. &:active {
  380. background: rgba(255, 87, 87, 0.15);
  381. }
  382. img {
  383. width: 24px;
  384. }
  385. }
  386. }
  387. }
  388. }
  389. .practiceBox {
  390. position: absolute;
  391. left: 0;
  392. top: 0;
  393. z-index: 999;
  394. width: 100%;
  395. height: 100%;
  396. background: rgba(0, 0, 0, 0.19);
  397. padding-top: 32px;
  398. box-sizing: border-box;
  399. }
  400. .questionMiddle {
  401. .SelectCorrect {
  402. width: 800px;
  403. border-radius: 16px;
  404. .SelectCorrect-top {
  405. height: 40px;
  406. border-top-left-radius: 16px;
  407. border-top-right-radius: 16px;
  408. > img {
  409. margin-left: 13px;
  410. width: 16px;
  411. }
  412. }
  413. .SelectCorrect-main {
  414. height: 386px;
  415. border-bottom-left-radius: 16px;
  416. border-bottom-right-radius: 16px;
  417. }
  418. .dialog-maxHeight {
  419. max-height: 386px;
  420. .right-box {
  421. max-height: 373px;
  422. }
  423. .inner {
  424. padding: 24px 32px;
  425. }
  426. }
  427. .english {
  428. font-size: 16px;
  429. line-height: 16px;
  430. margin-left: 4px;
  431. }
  432. .spell {
  433. font-size: 12px;
  434. height: 16px;
  435. }
  436. .chinese {
  437. font-size: 24px;
  438. }
  439. .pinyin_hidden {
  440. visibility: hidden;
  441. }
  442. }
  443. .learn-box {
  444. list-style: none;
  445. width: 800px;
  446. max-height: 533px;
  447. margin: 13px auto;
  448. li {
  449. margin: 8px;
  450. > div {
  451. width: 240px;
  452. height: 240px;
  453. box-shadow: 0px 4px 0px rgba(239, 167, 28, 0.4);
  454. border-radius: 16px;
  455. padding-top: 8px;
  456. > p {
  457. height: 40px;
  458. padding: 8px 20px;
  459. font-size: 16px;
  460. }
  461. b {
  462. height: 72px;
  463. font-size: 32px;
  464. padding: 20px 0;
  465. }
  466. span {
  467. height: 68px;
  468. padding: 16px 20px 4px 20px;
  469. font-size: 16px;
  470. }
  471. .operate-box {
  472. padding: 0 12px;
  473. }
  474. a {
  475. width: 58px;
  476. height: 32px;
  477. background: rgba(255, 87, 87, 0.1);
  478. border-radius: 16px;
  479. margin: 0 8px;
  480. &:hover {
  481. background: rgba(255, 137, 133, 0.1);
  482. }
  483. &:active {
  484. background: rgba(255, 87, 87, 0.15);
  485. }
  486. img {
  487. width: 16px;
  488. }
  489. }
  490. }
  491. }
  492. }
  493. }
  494. .questionSmall {
  495. .SelectCorrect {
  496. width: 600px;
  497. border-radius: 12px;
  498. .SelectCorrect-top {
  499. height: 30px;
  500. border-top-left-radius: 12px;
  501. border-top-right-radius: 12px;
  502. > img {
  503. margin-left: 10px;
  504. width: 12px;
  505. }
  506. }
  507. .SelectCorrect-main {
  508. height: 290px;
  509. border-bottom-left-radius: 12px;
  510. border-bottom-right-radius: 12px;
  511. }
  512. .dialog-maxHeight {
  513. max-height: 290px;
  514. .right-box {
  515. max-height: 280px;
  516. }
  517. .inner {
  518. padding: 18px 24px;
  519. }
  520. }
  521. .english {
  522. font-size: 12px;
  523. line-height: 12px;
  524. margin-left: 2px;
  525. }
  526. .spell {
  527. font-size: 12px;
  528. height: 18px;
  529. }
  530. .chinese {
  531. font-size: 18px;
  532. }
  533. .pinyin_hidden {
  534. visibility: hidden;
  535. height: 18px;
  536. }
  537. }
  538. .learn-box {
  539. list-style: none;
  540. width: 600px;
  541. max-height: 400px;
  542. overflow: auto;
  543. margin: 10px auto;
  544. li {
  545. margin: 6px;
  546. > div {
  547. width: 180px;
  548. height: 180px;
  549. box-shadow: 0px 3px 0px rgba(239, 167, 28, 0.4);
  550. border-radius: 12px;
  551. padding-top: 6px;
  552. > p {
  553. height: 30px;
  554. padding: 6px 15px;
  555. font-size: 12px;
  556. }
  557. b {
  558. height: 54px;
  559. font-size: 24px;
  560. padding: 15px 0;
  561. }
  562. span {
  563. height: 51px;
  564. padding: 12px 15px 3px 15px;
  565. font-size: 12px;
  566. }
  567. .operate-box {
  568. padding: 0 9px;
  569. }
  570. a {
  571. width: 44px;
  572. height: 24px;
  573. border-radius: 12px;
  574. margin: 0 6px;
  575. &:hover {
  576. background: rgba(255, 137, 133, 0.1);
  577. }
  578. &:active {
  579. background: rgba(255, 87, 87, 0.15);
  580. }
  581. img {
  582. width: 12px;
  583. }
  584. }
  585. }
  586. }
  587. }
  588. .practiceBox {
  589. padding-top: 16px;
  590. }
  591. }
  592. </style>
  593. <style lang="scss">
  594. .left-box .article-img {
  595. max-width: 444px;
  596. max-height: 560px;
  597. display: block;
  598. text-align: center;
  599. img {
  600. width: 100%;
  601. height: 560px;
  602. }
  603. }
  604. .el-image {
  605. max-width: 100%;
  606. max-height: 100%;
  607. }
  608. .questionMiddle {
  609. .left-box .article-img {
  610. max-width: 296px;
  611. max-height: 373px;
  612. img {
  613. max-width: 100%;
  614. max-height: 373px;
  615. }
  616. }
  617. }
  618. .questionSmall {
  619. .left-box .article-img {
  620. max-width: 222px;
  621. max-height: 280px;
  622. img {
  623. max-width: 100%;
  624. max-height: 280px;
  625. }
  626. }
  627. }
  628. </style>