introduce.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div class="introduce">
  3. <jm-box :navList='navList' @navListC='navListC'>
  4. <div class="boooox">
  5. </div>
  6. <div class="center" v-if="navChoose == 2">
  7. <div class="inlist">
  8. <div class="initem" v-for="(q,index) in qxlist" @click="isShowQx = index">
  9. <div class="titley" :class="{title: isShowQx == index}">
  10. {{ q.title }}
  11. <div class="img">
  12. <img src="../../assets/img/up.png" v-show="isShowQx == index">
  13. </div>
  14. <div class="img">
  15. <img src="../../assets/img/down.png" v-show="isShowQx != index">
  16. </div>
  17. </div>
  18. <transition name="slide-fade">
  19. <div class="nr" v-html="q.content" v-show="index==isShowQx">
  20. </div>
  21. </transition>
  22. </div>
  23. </div>
  24. </div>
  25. </jm-box>
  26. </div>
  27. </template>
  28. <script>
  29. import { getArticList,getList,details } from '@/request/api.js'
  30. import jmBox from '@/components/box.vue'
  31. export default {
  32. components: {
  33. jmBox,
  34. },
  35. data() {
  36. return {
  37. list: [
  38. {
  39. name: '沙洋县红十字会',
  40. phone: ''
  41. }
  42. ]
  43. }
  44. },
  45. mounted() {
  46. this.init()
  47. },
  48. data() {
  49. return {
  50. navChoose: this.$route.params.navChoose || this.$route.query.navChoose || 0,
  51. navList: {
  52. title: '组织介绍',
  53. url: 'introduce',
  54. list: this.$store.state.introduce || []
  55. },
  56. qxlist: [],
  57. isShowQx: 0
  58. }
  59. },
  60. methods: {
  61. init() {
  62. this.getdataList()
  63. this.getGqx()
  64. },
  65. getdataList() {
  66. getList({},14).then(res => {
  67. this.navList.list = res.data
  68. this.$store.commit('setIntroduce',res.data)
  69. })
  70. },
  71. getGqx() {
  72. getArticList({},35).then(res => {
  73. console.log(res);
  74. this.qxlist = res.data.list
  75. for(let i = 0; i<res.data.count; i++) {
  76. details({},res.data.list[i].id).then(e => {
  77. this.qxlist[i].content = e.data.content
  78. })
  79. }
  80. })
  81. },
  82. navListC(index) {
  83. this.navChoose = index
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. // .slide-fade-enter-active {
  90. // transition: all .8s ease;
  91. // }
  92. // .slide-fade-enter, .slide-fade-leave-to {
  93. // transform: translateY(-20px);
  94. // opacity: 0;
  95. // }
  96. .center {
  97. background-color: #F9F9F9;
  98. .inlist {
  99. .initem {
  100. width: 100%;
  101. .titley {
  102. position: relative;
  103. border-bottom: solid 1px #EEEEEE;
  104. background-color: #fff;
  105. padding: 0 25px;
  106. height: 50px;
  107. line-height: 50px;
  108. font-weight: bold;
  109. .img {
  110. position: absolute;
  111. top: 7px;
  112. right: 30px;
  113. img {
  114. width: 25px;
  115. }
  116. }
  117. }
  118. .title {
  119. background-color: #333333;
  120. color: #fff;
  121. }
  122. .nr {
  123. background-color: #F9F9F9;
  124. padding: 10px 0;
  125. }
  126. }
  127. }
  128. }
  129. </style>