Single.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <!-- -->
  2. <template>
  3. <div class="Big-Book-prev-Textdes NNPE-single" v-if="curQue">
  4. <div v-for="(itemI,indexI) in curQue" :key="indexI">
  5. <div class="stem-box">
  6. <b v-if="itemI.topicNumber">{{itemI.topicNumber}}</b>
  7. <p v-if="itemI.topic.con" :class="[/^[\u4e00-\u9fa5]/.test(itemI.topic.con)?'hasCn':'']">{{itemI.topic.con}}</p>
  8. <Audio
  9. :mp3="
  10. itemI.topic.mp3_list.length > 0 ? itemI.topic.mp3_list[0].url : ''"
  11. :themeColor="themeColor"
  12. class="audio-play"
  13. />
  14. <div v-for="(itemss,indexss) in itemI.topic.img_list" :key="indexss">
  15. <el-image
  16. :src="itemss.id"
  17. fit="scale-down"
  18. class="img_url"
  19. >
  20. <div slot="placeholder" class="image-slot">
  21. <img src="../../../assets/common/icon-imgloading.png" />
  22. </div>
  23. </el-image>
  24. </div>
  25. </div>
  26. <ul v-if="itemI.option">
  27. <li v-for="(item, index) in itemI.option" :key="index" :class="['option'+itemI.numberList.con,curQue.Bookanswer[indexI].answer===index?'active':'']">
  28. <el-radio
  29. v-model="curQue.Bookanswer[indexI].answer"
  30. :label="index"
  31. style="margin-right: 0"
  32. :readonly="TaskModel=='ANSWER'"
  33. >
  34. <span v-if="item.number">{{item.number}}</span>
  35. <p :class="[item.font=='py'?'hasPinyin':item.font=='en'?'hasEn':item.font=='cn'?'hasCn':'']">{{ item.con }}</p>
  36. <div v-for="(itemss,indexss) in item.img_list" :key="indexss">
  37. <el-image
  38. :src="itemss.id"
  39. fit="scale-down"
  40. class="img_urls"
  41. >
  42. <div slot="placeholder" class="image-slot">
  43. <img src="../../../assets/common/icon-imgloading.png" />
  44. </div>
  45. </el-image>
  46. </div>
  47. </el-radio>
  48. <!-- <template v-if="curQue.type == 'checkbox'">
  49. <el-checkbox v-model="single" :label="index">
  50. {{ item.con }}
  51. </el-checkbox>
  52. </template> -->
  53. </li>
  54. </ul>
  55. <Soundrecord @handleWav="handleWav" type="pro" class="luyin-box" v-if="itemI.IsRecord" :answerRecordList="curQue.Bookanswer[indexI].recordList" :tmIndex="indexI" :TaskModel="TaskModel"/>
  56. </div>
  57. </div>
  58. </template>
  59. <script>
  60. import Soundrecord from "../preview/Soundrecord.vue"; // 录音模板
  61. import Audio from "../preview/components/AudioRed.vue"; // 音频播放
  62. export default {
  63. components: {Soundrecord, Audio},
  64. props: ["curQue","themeColor","TaskModel"],
  65. data() {
  66. return {
  67. single:[]
  68. };
  69. },
  70. computed: {},
  71. watch: {},
  72. //方法集合
  73. methods: {
  74. // 处理数据
  75. handleData(){
  76. let _this = this
  77. let single = []
  78. _this.curQue.forEach(item => {
  79. single.push({
  80. answer: "",
  81. recordList: [],
  82. });
  83. });
  84. if (!this.curQue.Bookanswer) {
  85. this.$set(this.curQue, "Bookanswer", single);
  86. }
  87. },
  88. handleWav(data) {
  89. },
  90. },
  91. //生命周期 - 创建完成(可以访问当前this实例)
  92. created() {
  93. this.handleData()
  94. },
  95. //生命周期 - 挂载完成(可以访问DOM元素)
  96. mounted() {},
  97. beforeCreate() {}, //生命周期 - 创建之前
  98. beforeMount() {}, //生命周期 - 挂载之前
  99. beforeUpdate() {}, //生命周期 - 更新之前
  100. updated() {}, //生命周期 - 更新之后
  101. beforeDestroy() {}, //生命周期 - 销毁之前
  102. destroyed() {}, //生命周期 - 销毁完成
  103. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  104. };
  105. </script>
  106. <style lang='scss' scoped>
  107. //@import url(); 引入公共css类
  108. ul {
  109. list-style: none;
  110. margin: 0;
  111. display: flex;
  112. justify-content: start;
  113. flex-flow: wrap;
  114. li {
  115. padding: 8px 16px;
  116. border-radius: 4px;
  117. &:hover,&.active{
  118. background: #fff;
  119. }
  120. &.option1{
  121. width: 100%;
  122. }
  123. &.option2{
  124. width: 50%;
  125. }
  126. &.option3{
  127. width: 33.33%;
  128. }
  129. &.option4{
  130. width: 25%;
  131. }
  132. .el-radio{
  133. width: 100%;
  134. }
  135. }
  136. }
  137. .Big-Book-prev-Textdes{
  138. width: 100%;
  139. background: #F7F7F7;
  140. border: 1px solid rgba(0, 0, 0, 0.1);
  141. padding: 24px;
  142. border-radius: 8px;
  143. >div{
  144. margin-bottom: 24px;
  145. }
  146. .stem-box{
  147. display: flex;
  148. align-items: flex-start;
  149. justify-content: flex-start;
  150. margin-bottom: 8px;
  151. .audio-play{
  152. width: 16px;
  153. margin-left: 8px;
  154. }
  155. b{
  156. font-size: 16px;
  157. font-weight: normal;
  158. line-height: 24px;
  159. }
  160. p{
  161. margin: 0 0 0 8px;
  162. color: #000000;
  163. font-size: 16px;
  164. line-height: 24px;
  165. }
  166. }
  167. .hasCn{
  168. font-family: 'FZJCGFKTK';
  169. }
  170. .hasPinyin{
  171. font-family: 'GB-PINYINOK-B';
  172. }
  173. .hasEn{
  174. font-family: 'robot';
  175. }
  176. .luyin-box{
  177. width: 200px;
  178. height: 32px;
  179. background: #FFFFFF;
  180. border: 1px solid rgba(0, 0, 0, 0.1);
  181. box-sizing: border-box;
  182. border-radius: 8px;
  183. padding: 8px 12px;
  184. margin-top: 16px;
  185. }
  186. .img_url{
  187. width: 380px;
  188. height: 265px;
  189. background: #FFFFFF;
  190. border: 1px solid rgba(0, 0, 0, 0.1);
  191. box-sizing: border-box;
  192. border-radius: 8px;
  193. margin-left: 24px;
  194. }
  195. .img_urls{
  196. margin-left: 5px;
  197. width: 100%;
  198. height: 221px;
  199. background: #FFFFFF;
  200. border: 1px solid rgba(0, 0, 0, 0.1);
  201. box-sizing: border-box;
  202. border-radius: 8px;
  203. }
  204. }
  205. </style>
  206. <style lang="scss">
  207. .NNPE-single{
  208. .el-radio{
  209. display: flex;
  210. align-items: flex-start;
  211. }
  212. .el-radio__label{
  213. color: #000;
  214. font-size: 16px;
  215. line-height: 150%;
  216. font-weight: normal;
  217. display: flex;
  218. align-items: flex-start;
  219. }
  220. .el-radio__input.is-checked+.el-radio__label{
  221. color: #000;
  222. }
  223. .el-radio__inner::after{
  224. width: 8px;
  225. height: 8px;
  226. }
  227. .el-radio__label{
  228. span{
  229. font-family: 'FZJCGFKTK';
  230. margin-right: 4px;
  231. }
  232. p{
  233. margin: 0;
  234. }
  235. }
  236. .el-radio__inner{
  237. width: 16px;
  238. height: 16px;
  239. margin-top: 4px;
  240. margin-right: 2px;
  241. }
  242. }
  243. </style>