Notes.vue 6.5 KB

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