NewWordShow.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <!-- -->
  2. <template>
  3. <div class="Big-Book-prev-Textdes NewWordShow" v-if="curQue">
  4. <div class="item-box">
  5. <div class="item" v-for="(item,index) in curQue.option" :key="index">
  6. <p v-if="item.pinyin">{{item.pinyin}}</p>
  7. <div class="con-box">
  8. <template v-if="item.imgOrText=='text'">
  9. <template v-if="item.con">
  10. <div
  11. :key="conindex"
  12. class="strockplay"
  13. v-for="(conItem, conindex) in item.con"
  14. @click="writeWord(conItem,item.pinyin)"
  15. >
  16. <Strockplayredline
  17. :Book_text="conItem"
  18. :playStorkes="true"
  19. :targetDiv="'bwcHanziIntp' + conItem + conindex"
  20. />
  21. <div
  22. class="bwc-line"
  23. v-if="conindex < item.con.length - 1"
  24. ></div>
  25. </div>
  26. </template>
  27. <template v-else>
  28. <div class="blank-item">
  29. </div>
  30. </template>
  31. </template>
  32. <template v-else>
  33. <div class="img-box" v-for="(imgItem,imgIndex) in item.img_list" :key="imgIndex">
  34. <el-image
  35. :src="imgItem.url"
  36. fit="scale-down"
  37. class="img_url"
  38. >
  39. <div slot="placeholder" class="image-slot">
  40. <img src="../../../assets/common/icon-imgloading.png" />
  41. </div>
  42. </el-image>
  43. </div>
  44. </template>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="practiceBox practiceBoxStrock" v-if="isPraShow">
  49. <Practice :changePraShow="changePraShow" :cur="curData" />
  50. </div>
  51. </div>
  52. </template>
  53. <script>
  54. import Strockplayredline from "../preview/components/Strockplayredline.vue";
  55. import Practice from "../preview/components/Practice.vue";
  56. export default {
  57. components: {Strockplayredline,Practice},
  58. props: ["curQue"],
  59. data() {
  60. return {
  61. isPraShow: false,
  62. curData: null,
  63. };
  64. },
  65. computed: {},
  66. watch: {},
  67. //方法集合
  68. methods: {
  69. // 处理数据
  70. handleData(){
  71. let _this = this
  72. },
  73. changePraShow() {
  74. this.isPraShow = false;
  75. },
  76. writeWord(words, pinyin) {
  77. this.isPraShow = true;
  78. this.curData = {
  79. stem: [
  80. {
  81. con: words ? words : "",
  82. pinyin: pinyin && pinyin ? pinyin : "",
  83. mp3_url: "",
  84. },
  85. ],
  86. };
  87. },
  88. },
  89. //生命周期 - 创建完成(可以访问当前this实例)
  90. created() {
  91. },
  92. //生命周期 - 挂载完成(可以访问DOM元素)
  93. mounted() {},
  94. beforeCreate() {}, //生命周期 - 创建之前
  95. beforeMount() {}, //生命周期 - 挂载之前
  96. beforeUpdate() {}, //生命周期 - 更新之前
  97. updated() {}, //生命周期 - 更新之后
  98. beforeDestroy() {}, //生命周期 - 销毁之前
  99. destroyed() {}, //生命周期 - 销毁完成
  100. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  101. };
  102. </script>
  103. <style lang='scss' scoped>
  104. //@import url(); 引入公共css类
  105. .NewWordShow{
  106. width: 100%;
  107. padding: 0 4px;
  108. background: #F7F7F7;
  109. border: 1px solid rgba(0, 0, 0, 0.1);
  110. border-radius: 8px;
  111. .item-box{
  112. display: flex;
  113. flex-flow: wrap;
  114. padding-bottom: 8px;
  115. .item{
  116. display: flex;
  117. align-items: flex-end;
  118. justify-content: center;
  119. flex-flow: wrap;
  120. margin: 9px 20px;
  121. box-sizing: border-box;
  122. width: 66px;
  123. cursor: pointer;
  124. >p{
  125. color: #2C2C2C;
  126. font-size: 14px;
  127. line-height: 130%;
  128. font-family: 'GB-PINYINOK-B';
  129. width: 100%;
  130. text-align: center;
  131. margin: 0 0 8px 0;
  132. }
  133. .strockplay {
  134. display: flex;
  135. justify-content: center;
  136. align-items: center;
  137. position: relative;
  138. width: 64px;
  139. height: 64px;
  140. }
  141. .strockplayRedInner{
  142. width: 64px;
  143. height: 64px;
  144. }
  145. .bwc-line {
  146. width: 1px;
  147. height: 62px;
  148. background: #BF875E;
  149. }
  150. }
  151. .con-box{
  152. display: flex;
  153. border: 1px solid #BF875E;
  154. border-radius: 8px;
  155. overflow: hidden;
  156. .img-box{
  157. background: url('../../../assets/NPC/chinaTianYellow.png') center no-repeat;
  158. background-size: cover;
  159. .img_url{
  160. width: 64px;
  161. height: 64px;
  162. }
  163. }
  164. .blank-item{
  165. width: 64px;
  166. height: 64px;
  167. }
  168. }
  169. }
  170. .practiceBox {
  171. position: fixed;
  172. left: 0;
  173. top: 0;
  174. z-index: 999;
  175. width: 100%;
  176. height: 100vh;
  177. background: rgba(0, 0, 0, 0.19);
  178. padding-top: 32px;
  179. box-sizing: border-box;
  180. overflow: hidden;
  181. overflow-y: auto;
  182. &.practiceBoxStrock {
  183. display: flex;
  184. justify-content: center;
  185. align-items: center;
  186. padding-top: 0px;
  187. }
  188. }
  189. }
  190. </style>
  191. <style lang="scss">
  192. .NewWordShow{
  193. .strock-play-box{
  194. width: 16px;
  195. height: 16px;
  196. right: -1px;
  197. background: url('../../../assets/NPC/strock-play-yellow-click.png') center no-repeat;
  198. background-size: cover;
  199. }
  200. .character-target-div{
  201. background-color: initial;
  202. }
  203. }
  204. </style>