index.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <div class="single" v-if="cur">
  3. <component
  4. :answer="answer"
  5. :cur="cur"
  6. :getAnswer="getAnswer"
  7. :handleChildSrcList="handleChildSrcList"
  8. :is="getViewCom"
  9. :queIndex="queIndex"
  10. :uiType="uiType"
  11. :watchIndex="watchIndex"
  12. :bookAnswerShowFlag="bookAnswerShowFlag"
  13. :bookExamAnswer="bookExamAnswer"
  14. ref="bookChildren"
  15. />
  16. </div>
  17. </template>
  18. <script>
  19. import SingleChooseTone from "./SingleChooseToneMAnswer"; // 选择正确发音
  20. import JudgeAndReason from "./JudgeAndReasonAnswer" // 判断对错并说明原因
  21. export default {
  22. name: "Single",
  23. components: {
  24. SingleChooseTone,
  25. JudgeAndReason
  26. },
  27. props: ["moduleType", "cur", "getAnswer", "queIndex", "answer", "uiType", "watchIndex", "handleChildSrcList","bookAnswerShowFlag","bookExamAnswer"],
  28. data () {
  29. return {
  30. // singleData: ['héng', 'shù', 'piě', 'nà']
  31. // singleData: ['4', '5', '6', '7']
  32. // singleData: ['structure1.png', 'structure2.png', 'structure3.png', 'structure4.png']
  33. //singleData: null,
  34. // singleData: [['一', '讠', '冫', '厶'], ['氵', '忄', '冫', '厶'], ['冖', '又', '冫', '厶']]
  35. // singleData: ['一', '讠', '冫']
  36. // singleData: {
  37. // data: [
  38. // ['一', '', '三', '', '', 'null', 'null'],
  39. // ['null', 'null', '', 'null', 'null', 'null', 'null'],
  40. // ['null', 'null', '', 'null', 'null', 'null', 'null'],
  41. // ['', '', '六', '七', '', '', '']
  42. // ],
  43. // optionalData: ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
  44. // }
  45. // singleData: {
  46. // data: ["héng", "shù", "piě", "nà"],
  47. // right: ["i"],
  48. // },
  49. };
  50. },
  51. created () {
  52. console.log(this.cur)
  53. },
  54. watch: {
  55. cur: {
  56. handler: function (val, oldVal) {
  57. // let _this = this;
  58. // _this.singleData = val;
  59. // console.log(_this.singleData);
  60. },
  61. // 深度观察监听
  62. deep: true,
  63. },
  64. },
  65. mounted () {
  66. this.$nextTick(function () {
  67. this.$on('singleActiveindex', function () {
  68. this.$refs.bookChildren.$emit("singleActiveindex")
  69. });
  70. });
  71. },
  72. methods: {
  73. // getAnswer (data) {
  74. // console.log(2)
  75. // this.$emit("getAnswer", data);
  76. // }
  77. practiceTip () {
  78. return this.$refs.bookChildren.practiceJudge()
  79. }
  80. },
  81. computed: {
  82. getViewCom () {
  83. switch (this.moduleType) {
  84. case "01":
  85. return SingleChooseTone;
  86. case "02":
  87. return JudgeAndReason;
  88. }
  89. }
  90. }
  91. };
  92. </script>
  93. <style lang="scss">
  94. // .single {
  95. // width: 100%;
  96. // // height: 100vh;
  97. // overflow: auto;
  98. // padding-top: 20px;
  99. // .singleNovoice {
  100. // width: 100%;
  101. // display: flex;
  102. // justify-content: center;
  103. // align-items: center;
  104. // font-family: GB-PINYINOK-B;
  105. // .content {
  106. // position: relative;
  107. // }
  108. // .content-top {
  109. // width: 444px;
  110. // height: 444px;
  111. // margin: 0 auto;
  112. // background: #fff url('../../assets/single/bg-rice.png') center
  113. // no-repeat;
  114. // background-size: 100% 100%;
  115. // box-shadow: 0px 6px 0px rgba(239, 167, 28, 0.4);
  116. // border-radius: 24px;
  117. // text-align: center;
  118. // position: relative;
  119. // img {
  120. // width: 300px;
  121. // margin-top: 70px;
  122. // }
  123. // .btn-play {
  124. // position: absolute;
  125. // right: 0;
  126. // top: 0;
  127. // width: 56px;
  128. // height: 56px;
  129. // background: #7663ec url('../../assets/single/icon-play.png')
  130. // center no-repeat;
  131. // background-size: 20px;
  132. // border-radius: 0 28px 0 28px;
  133. // cursor: pointer;
  134. // }
  135. // }
  136. // .content-bottom {
  137. // display: flex;
  138. // align-items: center;
  139. // justify-content: center;
  140. // padding-top: 40px;
  141. // li {
  142. // margin: 0 20px 10px 20px;
  143. // min-width: 230px;
  144. // height: 124px;
  145. // box-shadow: 0px 6px 0px rgba(239, 167, 28, 0.4);
  146. // border-radius: 16px;
  147. // text-align: center;
  148. // background: #ffffff url('../../assets/single/bg-line.png')
  149. // center;
  150. // background-size: 100% 100%;
  151. // color: #494949;
  152. // font-size: 74px;
  153. // line-height: 92px;
  154. // padding: 7px 5px 25px 5px;
  155. // cursor: pointer;
  156. // font-family: GB-PINYINOK-B;
  157. // }
  158. // li.active {
  159. // background: #fff3d5
  160. // url('../../assets/single/bg-line-red-small.png') center
  161. // no-repeat;
  162. // background-size: 100% 40px;
  163. // }
  164. // li:hover {
  165. // transform: scale(1.13);
  166. // }
  167. // }
  168. // }
  169. // ul {
  170. // list-style: none;
  171. // margin: 0;
  172. // }
  173. // .el-message__icon {
  174. // font-size: 20px;
  175. // }
  176. // .pinyin-box {
  177. // width: 644px;
  178. // height: 444px;
  179. // box-shadow: 0px 6px 0px rgba(239, 167, 28, 0.4);
  180. // border-radius: 24px;
  181. // background: #ffffff url('../../assets/single/bg-line-red.png') center
  182. // no-repeat;
  183. // background-size: 100% 100%;
  184. // margin: 0 auto;
  185. // font-size: 240px;
  186. // line-height: 276px;
  187. // padding: 56px 0 108px 0;
  188. // font-family: GB-PINYINOK-B;
  189. // color: #404040;
  190. // text-align: center;
  191. // b {
  192. // font-weight: 400;
  193. // }
  194. // // b.active {
  195. // // color: #31d486;
  196. // // }
  197. // }
  198. // .single-input {
  199. // width: 433px;
  200. // height: 124px;
  201. // background: #ffffff;
  202. // border: 4px solid #ffffff;
  203. // box-sizing: border-box;
  204. // box-shadow: 0px 6px 0px rgba(239, 167, 28, 0.4);
  205. // border-radius: 16px;
  206. // padding: 15px 16px;
  207. // text-align: center;
  208. // outline: 0;
  209. // font-size: 80px;
  210. // line-height: 94px;
  211. // color: #494949;
  212. // // font-family: sourceR;
  213. // }
  214. // }
  215. </style>