Single.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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.url"
  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.url"
  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. debugger
  87. }
  88. },
  89. handleWav(data) {
  90. },
  91. },
  92. //生命周期 - 创建完成(可以访问当前this实例)
  93. created() {
  94. this.handleData()
  95. },
  96. //生命周期 - 挂载完成(可以访问DOM元素)
  97. mounted() {},
  98. beforeCreate() {}, //生命周期 - 创建之前
  99. beforeMount() {}, //生命周期 - 挂载之前
  100. beforeUpdate() {}, //生命周期 - 更新之前
  101. updated() {}, //生命周期 - 更新之后
  102. beforeDestroy() {}, //生命周期 - 销毁之前
  103. destroyed() {}, //生命周期 - 销毁完成
  104. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  105. };
  106. </script>
  107. <style lang='scss' scoped>
  108. //@import url(); 引入公共css类
  109. ul {
  110. list-style: none;
  111. margin: 0;
  112. display: flex;
  113. justify-content: start;
  114. flex-flow: wrap;
  115. li {
  116. padding: 8px 16px;
  117. border-radius: 4px;
  118. &:hover,&.active{
  119. background: #fff;
  120. }
  121. &.option1{
  122. width: 100%;
  123. }
  124. &.option2{
  125. width: 50%;
  126. }
  127. &.option3{
  128. width: 33.33%;
  129. }
  130. &.option4{
  131. width: 25%;
  132. }
  133. .el-radio{
  134. width: 100%;
  135. }
  136. }
  137. }
  138. .Big-Book-prev-Textdes{
  139. width: 100%;
  140. background: #F7F7F7;
  141. border: 1px solid rgba(0, 0, 0, 0.1);
  142. padding: 24px;
  143. border-radius: 8px;
  144. >div{
  145. margin-bottom: 24px;
  146. }
  147. .stem-box{
  148. display: flex;
  149. align-items: flex-start;
  150. justify-content: flex-start;
  151. margin-bottom: 8px;
  152. .audio-play{
  153. width: 16px;
  154. margin-left: 8px;
  155. }
  156. b{
  157. font-size: 16px;
  158. font-weight: normal;
  159. line-height: 24px;
  160. }
  161. p{
  162. margin: 0 0 0 8px;
  163. color: #000000;
  164. font-size: 16px;
  165. line-height: 24px;
  166. }
  167. }
  168. .hasCn{
  169. font-family: 'FZJCGFKTK';
  170. }
  171. .hasPinyin{
  172. font-family: 'GB-PINYINOK-B';
  173. }
  174. .hasEn{
  175. font-family: 'robot';
  176. }
  177. .luyin-box{
  178. width: 200px;
  179. height: 32px;
  180. background: #FFFFFF;
  181. border: 1px solid rgba(0, 0, 0, 0.1);
  182. box-sizing: border-box;
  183. border-radius: 8px;
  184. padding: 8px 12px;
  185. margin-top: 16px;
  186. }
  187. .img_url{
  188. width: 380px;
  189. height: 265px;
  190. background: #FFFFFF;
  191. border: 1px solid rgba(0, 0, 0, 0.1);
  192. box-sizing: border-box;
  193. border-radius: 8px;
  194. margin-left: 24px;
  195. }
  196. .img_urls{
  197. margin-left: 5px;
  198. width: 100%;
  199. height: 221px;
  200. background: #FFFFFF;
  201. border: 1px solid rgba(0, 0, 0, 0.1);
  202. box-sizing: border-box;
  203. border-radius: 8px;
  204. }
  205. }
  206. </style>
  207. <style lang="scss">
  208. .NNPE-single{
  209. .el-radio{
  210. display: flex;
  211. align-items: flex-start;
  212. }
  213. .el-radio__label{
  214. color: #000;
  215. font-size: 16px;
  216. line-height: 150%;
  217. font-weight: normal;
  218. display: flex;
  219. align-items: flex-start;
  220. }
  221. .el-radio__input.is-checked+.el-radio__label{
  222. color: #000;
  223. }
  224. .el-radio__inner::after{
  225. width: 8px;
  226. height: 8px;
  227. }
  228. .el-radio__label{
  229. span{
  230. font-family: 'FZJCGFKTK';
  231. margin-right: 4px;
  232. }
  233. p{
  234. margin: 0;
  235. }
  236. }
  237. .el-radio__inner{
  238. width: 16px;
  239. height: 16px;
  240. margin-top: 4px;
  241. margin-right: 2px;
  242. }
  243. }
  244. </style>