Notes.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <div class="NPC-zhedie">
  3. <div class="topTitle">
  4. <div class="NPC-top-left">
  5. <span class="NPC-topTitle-text">{{ curQue.title }}</span>
  6. </div>
  7. <div class="NPC-top-right" @click="handleChangeTab">
  8. <span class="NPC-top-right-text">{{ wordShow ? "收起" : "展开" }}</span>
  9. <img v-if="wordShow" src="../../../assets/NPC/down.png" alt="" />
  10. <img v-else class="rotate" src="../../../assets/NPC/down.png" alt="" />
  11. </div>
  12. </div>
  13. <el-collapse-transition>
  14. <div class="NPC-notes-list" v-show="wordShow">
  15. <div
  16. class="NPC-notes"
  17. v-for="(item, index) in curQue.option"
  18. :key="'NPC-notes' + index"
  19. >
  20. <div class="NPC-notes-con">
  21. <span class="NPC-notes-con-number">{{ item.number }}</span>
  22. <span class="NPC-notes-con-text">{{ item.con }}</span>
  23. </div>
  24. <div class="NPC-notes-trans">
  25. {{ item.interpret }}
  26. </div>
  27. <div class="NPC-notes-note" v-if="item.note" v-html="item.note"></div>
  28. <div
  29. class="NPC-notes-note-img"
  30. v-if="item.img_list && item.img_list.length > 0"
  31. >
  32. <div
  33. v-for="(imgItem, imgIndex) in item.img_list"
  34. :key="'imgList' + imgIndex"
  35. >
  36. <img :src="imgItem.id" class="NPC-notes-img" />
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </el-collapse-transition>
  42. </div>
  43. </template>
  44. <script>
  45. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  46. //例如:import 《组件名称》from ‘《组件路径》';
  47. import WordPhraseDetail from "./components/WordPhraseDetail.vue";
  48. export default {
  49. //import引入的组件需要注入到对象中才能使用
  50. components: {
  51. WordPhraseDetail,
  52. },
  53. props: ["curQue"],
  54. data() {
  55. //这里存放数据
  56. return {
  57. wordShow: true,
  58. };
  59. },
  60. //计算属性 类似于data概念
  61. computed: {},
  62. //监控data中数据变化
  63. watch: {},
  64. //方法集合
  65. methods: {
  66. handleChangeTab() {
  67. this.wordShow = !this.wordShow;
  68. },
  69. },
  70. //生命周期 - 创建完成(可以访问当前this实例)
  71. created() {},
  72. //生命周期 - 挂载完成(可以访问DOM元素)
  73. mounted() {},
  74. //生命周期-创建之前
  75. beforeCreated() {},
  76. //生命周期-挂载之前
  77. beforeMount() {},
  78. //生命周期-更新之前
  79. beforUpdate() {},
  80. //生命周期-更新之后
  81. updated() {},
  82. //生命周期-销毁之前
  83. beforeDestory() {},
  84. //生命周期-销毁完成
  85. destoryed() {},
  86. //如果页面有keep-alive缓存功能,这个函数会触发
  87. activated() {},
  88. };
  89. </script>
  90. <style lang="scss" scoped>
  91. /* @import url(); 引入css类 */
  92. .NPC-zhedie {
  93. width: 780px;
  94. margin-bottom: 24px;
  95. .topTitle {
  96. width: 100%;
  97. display: flex;
  98. justify-content: space-between;
  99. padding-left: 24px;
  100. padding-right: 16px;
  101. border: 1px solid rgba(0, 0, 0, 0.1);
  102. overflow: hidden;
  103. border-radius: 8px 8px 0 0;
  104. .NPC-top-left {
  105. display: flex;
  106. justify-content: flex-start;
  107. align-items: center;
  108. .NPC-topTitle-text {
  109. font-family: "sourceR";
  110. font-size: 16px;
  111. color: #fff;
  112. font-weight: bold;
  113. margin-right: 8px;
  114. }
  115. .NPC-play-all {
  116. width: 24px;
  117. height: 24px;
  118. background: url("../../../assets/NPC/play-white.png") no-repeat left top;
  119. background-size: 100% 100%;
  120. cursor: pointer;
  121. }
  122. }
  123. .NPC-top-right {
  124. display: flex;
  125. justify-content: flex-start;
  126. align-items: center;
  127. cursor: pointer;
  128. &-text {
  129. font-weight: normal;
  130. font-size: 14px;
  131. line-height: 16px;
  132. color: #ffffff;
  133. }
  134. img {
  135. width: 16px;
  136. height: 16px;
  137. margin-left: 4px;
  138. }
  139. }
  140. .rotate {
  141. animation-name: firstrotate;
  142. animation-direction: 2s;
  143. animation-fill-mode: both;
  144. animation-timing-function: linear;
  145. }
  146. }
  147. .NPC-notes-list {
  148. padding: 24px 24px 5px 24px;
  149. border: 1px solid rgba(0, 0, 0, 0.1);
  150. border-top: none;
  151. border-radius: 0 0 8px 8px;
  152. .NPC-notes {
  153. width: 100%;
  154. margin-bottom: 24px;
  155. .NPC-notes-con {
  156. display: flex;
  157. justify-content: flex-start;
  158. align-items: center;
  159. margin-bottom: 8px;
  160. > span {
  161. font-style: normal;
  162. font-weight: normal;
  163. font-size: 14px;
  164. line-height: 150%;
  165. color: #e35454;
  166. &.NPC-notes-con-number {
  167. font-family: "robot";
  168. }
  169. &.NPC-notes-con-text {
  170. flex: 1;
  171. margin-left: 5px;
  172. font-family: "GB-PINYINOK-B";
  173. }
  174. }
  175. }
  176. .NPC-notes-trans {
  177. font-family: "robot";
  178. font-style: normal;
  179. font-weight: bold;
  180. font-size: 14px;
  181. line-height: 150%;
  182. color: #000000;
  183. margin-bottom: 8px;
  184. padding-left: 27px;
  185. }
  186. .NPC-notes-note {
  187. font-family: "robot";
  188. font-style: normal;
  189. font-weight: normal;
  190. font-size: 14px;
  191. line-height: 150%;
  192. color: #000000;
  193. text-indent: 27px;
  194. }
  195. }
  196. }
  197. .NPC-notes-note-img {
  198. width: 100%;
  199. > div {
  200. width: 100%;
  201. > img {
  202. max-width: 100%;
  203. }
  204. }
  205. }
  206. }
  207. @keyframes firstrotate {
  208. 0% {
  209. transform: rotateZ(0deg);
  210. }
  211. 100% {
  212. transform: rotateZ(180deg);
  213. }
  214. }
  215. @keyframes huifuRotate {
  216. 0% {
  217. transform: rotateZ(180deg);
  218. }
  219. 100% {
  220. transform: rotateZ(0deg);
  221. }
  222. }
  223. </style>
  224. <style lang="scss">
  225. .NPC-zhedie {
  226. .el-collapse-item__content {
  227. padding-bottom: 0;
  228. }
  229. .el-slider__button {
  230. width: 8px;
  231. height: 8px;
  232. }
  233. .el-slider__runway {
  234. margin: 0;
  235. padding: 0;
  236. }
  237. .el-slider {
  238. position: relative;
  239. top: -3px;
  240. }
  241. .el-collapse {
  242. background: #f7f7f7;
  243. box-sizing: border-box;
  244. border-radius: 8px;
  245. }
  246. .el-collapse-item__header {
  247. height: 48px;
  248. background: #e35454;
  249. border: 1px solid rgba(0, 0, 0, 0.1);
  250. box-sizing: border-box;
  251. border-radius: 8px 8px 0px 0px;
  252. }
  253. .el-collapse-item__wrap {
  254. border: 1px solid rgba(0, 0, 0, 0.1);
  255. border-top: 0;
  256. background: #f7f7f7;
  257. border-radius: 0px 0px 8px 8px;
  258. }
  259. .el-collapse-item__arrow {
  260. display: none;
  261. }
  262. .el-table__row {
  263. padding: 4px 0;
  264. }
  265. }
  266. </style>