ImageRecordSenten.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <template>
  2. <!-- 根据短语和图片造句录音 -->
  3. <div>
  4. <div class="SelectCorrect">
  5. <div class="SelectCorrect-top">
  6. <img alt src="../../assets/qp/Ellipse 27.png">
  7. <img alt src="../../assets/qp/Ellipse 28.png">
  8. <img alt src="../../assets/qp/Ellipse 29.png">
  9. </div>
  10. <div class="SelectCorrect-main">
  11. <div :key="index" class="translate" v-for="(item,index) in option">
  12. <div v-if="item.stemCn.length>0">
  13. <div :key="indexs" v-for="(items,indexs) in item.stemCn">
  14. <p
  15. :class="bd.indexOf(item.stemPy[indexs]) != -1 ? 'pinyin_hidden' : 'spell'"
  16. >{{item.stemPy[indexs]}}</p>
  17. <p class="chinese">{{items}}</p>
  18. </div>
  19. </div>
  20. <div class="img-box" v-else>
  21. <!-- <img :src="item.img_url" @click="handleChildSrcList(item.img_url)"
  22. class="img_url"
  23. v-if="item.img_url && item.img_url.indexOf('http') > -1" /> -->
  24. <el-image
  25. :src="item.img_url"
  26. fit="scale-down"
  27. :preview-src-list="[item.img_url]"
  28. class="img_url"
  29. v-if="item.img_url && item.img_url.indexOf('http') > -1"
  30. >
  31. <div slot="placeholder" class="image-slot">
  32. <img src="../../assets/common/icon-imgloading.png" />
  33. </div>
  34. </el-image>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. <Soundrecord :queIndex="queIndex" :wavData="wavData" @handle-Wav="handleWav"/>
  40. </div>
  41. </template>
  42. <script>
  43. import Soundrecord from "../../components/common/Soundrecord";
  44. export default {
  45. name: 'listenAndLearn',
  46. components: {
  47. Soundrecord
  48. },
  49. props: [
  50. "cur",
  51. "getAnswer",
  52. "queIndex",
  53. "answer",
  54. "uiType",
  55. "watchIndex",
  56. "handleChildSrcList"
  57. ],
  58. data () {
  59. return {
  60. wavData: null,
  61. option: [],
  62. bd: [
  63. ",",
  64. ",",
  65. "。",
  66. ".",
  67. "!",
  68. "?",
  69. ":",
  70. ";",
  71. "(",
  72. ")",
  73. "【",
  74. "】",
  75. "{",
  76. "}",
  77. "‘",
  78. "“",
  79. "’",
  80. "”",
  81. "、",
  82. "、",
  83. "《",
  84. "》",
  85. "…",
  86. "·",
  87. "—",
  88. "~"
  89. ],
  90. previewSrcList: []
  91. };
  92. },
  93. watch: {
  94. watchIndex: {
  95. handler: function (val, oldVal) {
  96. if (val) {
  97. this.handleData()
  98. }
  99. },
  100. // 深度观察监听
  101. deep: true,
  102. },
  103. },
  104. mounted () {
  105. },
  106. methods: {
  107. handleWav (data) {
  108. this.userAnswer = []
  109. this.userAnswer.push(data)
  110. this.cur.Bookanswer = this.userAnswer
  111. },
  112. // 初始化数据
  113. handleData () {
  114. this.previewSrcList = []
  115. this.option = this.cur.stem
  116. this.option.forEach((item) => {
  117. item.stemCn = item.con.split("")
  118. item.stemPy = item.pinyin.split(" ")
  119. if (item.img_url) this.previewSrcList.push(item.img_url)
  120. })
  121. if (this.cur.Bookanswer) {
  122. this.wavData = this.cur.Bookanswer[0]
  123. } else {
  124. this.wavData = null
  125. }
  126. },
  127. // 判断对错
  128. practiceJudge () {
  129. if(this.cur.Bookanswer){
  130. return true
  131. }else{
  132. return false
  133. }
  134. }
  135. },
  136. created () {
  137. this.handleData()
  138. },
  139. };
  140. </script>
  141. <style lang="scss" scoped>
  142. * {
  143. margin: 0;
  144. padding: 0;
  145. }
  146. .SelectCorrect {
  147. width: 1200px;
  148. height: 564px;
  149. margin: 52px auto 0 auto;
  150. background: #fff;
  151. box-shadow: 0px 6px 0px rgba(239, 167, 28, 0.4);
  152. border-radius: 24px;
  153. .SelectCorrect-top {
  154. width: 100%;
  155. height: 60px;
  156. background: rgba(255, 214, 107, 0.3);
  157. border-top-left-radius: 24px;
  158. border-top-right-radius: 24px;
  159. display: flex;
  160. align-items: center;
  161. > img {
  162. margin-left: 20px;
  163. width: 24px;
  164. }
  165. }
  166. .SelectCorrect-main {
  167. height: 504px;
  168. overflow: auto;
  169. background: #fff;
  170. padding: 72px 48px;
  171. border-bottom-left-radius: 24px;
  172. border-bottom-right-radius: 24px;
  173. display: flex;
  174. justify-content: center;
  175. align-items: center;
  176. flex-flow: wrap;
  177. &::after {
  178. content: '';
  179. display: block;
  180. height: 0;
  181. clear: both;
  182. visibility: hidden;
  183. }
  184. .translate {
  185. padding: 12px;
  186. > div {
  187. margin-left: 5px;
  188. align-items: center;
  189. justify-content: center;
  190. display: flex;
  191. padding: 7px 16px 0 16px;
  192. background: #fff8ed;
  193. border-radius: 24px;
  194. min-width: 252px;
  195. min-height: 156px;
  196. }
  197. .img-box {
  198. height: 156px;
  199. width: 252px;
  200. .img_url {
  201. width: 100%;
  202. height: 100%;
  203. font-size: 0;
  204. .image-slot {
  205. width: 100%;
  206. height: 100%;
  207. > img {
  208. width: 100%;
  209. height: 100%;
  210. }
  211. }
  212. }
  213. }
  214. .spell {
  215. font-family: GB-PINYINOK-B;
  216. font-style: normal;
  217. font-weight: normal;
  218. font-size: 24px;
  219. line-height: 1.5;
  220. color: #000;
  221. margin: 0 2px;
  222. text-align: center;
  223. }
  224. .chinese {
  225. font-family: 'FZJCGFKTK';
  226. font-style: normal;
  227. font-weight: normal;
  228. font-size: 48px;
  229. line-height: 1.5;
  230. color: #000;
  231. text-align: center;
  232. }
  233. // img {
  234. // width: 150px;
  235. // }
  236. }
  237. }
  238. }
  239. .Book-record {
  240. width: 444px;
  241. margin: 72px auto 0 auto;
  242. }
  243. .questionMiddle {
  244. .SelectCorrect {
  245. width: 800px;
  246. height: 376px;
  247. margin: 28px auto 0 auto;
  248. box-shadow: 0px 4px 0px rgba(239, 167, 28, 0.4);
  249. border-radius: 16px;
  250. .SelectCorrect-top {
  251. height: 40px;
  252. border-top-left-radius: 16px;
  253. border-top-right-radius: 16px;
  254. > img {
  255. margin-left: 13px;
  256. width: 16px;
  257. }
  258. }
  259. .SelectCorrect-main {
  260. height: 336px;
  261. padding: 48px 32px;
  262. border-bottom-left-radius: 16px;
  263. border-bottom-right-radius: 16px;
  264. .translate {
  265. padding: 8px;
  266. > div {
  267. margin-left: 4px;
  268. padding: 5px 10px 0 10px;
  269. border-radius: 16px;
  270. min-width: 168px;
  271. min-height: 104px;
  272. }
  273. .img-box {
  274. height: 104px;
  275. width: 168px;
  276. }
  277. .spell {
  278. font-size: 16px;
  279. margin: 0 2px;
  280. }
  281. .chinese {
  282. font-size: 32px;
  283. }
  284. // img {
  285. // width: 100px;
  286. // }
  287. }
  288. }
  289. }
  290. .Book-record {
  291. width: 296px;
  292. margin: 48px auto 0 auto;
  293. }
  294. }
  295. .questionSmall {
  296. .SelectCorrect {
  297. width: 600px;
  298. height: 282px;
  299. margin: 16px auto 0 auto;
  300. box-shadow: 0px 3px 0px rgba(239, 167, 28, 0.4);
  301. border-radius: 12px;
  302. .SelectCorrect-top {
  303. height: 30px;
  304. border-top-left-radius: 12px;
  305. border-top-right-radius: 12px;
  306. > img {
  307. margin-left: 10px;
  308. width: 12px;
  309. }
  310. }
  311. .SelectCorrect-main {
  312. height: 252px;
  313. padding: 36px 24px;
  314. border-bottom-left-radius: 12px;
  315. border-bottom-right-radius: 12px;
  316. .translate {
  317. padding: 6px;
  318. > div {
  319. margin-left: 2px;
  320. padding: 3px 8px 0 8px;
  321. border-radius: 12px;
  322. min-width: 126px;
  323. min-height: 78px;
  324. }
  325. .img-box {
  326. height: 78px;
  327. width: 126px;
  328. }
  329. .spell {
  330. font-size: 12px;
  331. margin: 0 1px;
  332. }
  333. .chinese {
  334. font-size: 24px;
  335. }
  336. // img {
  337. // width: 75px;
  338. // }
  339. }
  340. }
  341. }
  342. .Book-record {
  343. width: 222px;
  344. margin: 36px auto 0 auto;
  345. }
  346. }
  347. </style>