Single.vue 6.2 KB

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