help.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view>
  3. <navbar :iSimmersive="false" title-color="#ffffff" background="#1b43c4" :placeholder="true" title="帮助中心"></navbar>
  4. <view class='help'>
  5. <view
  6. class='item'
  7. v-if="list.length > 0"
  8. v-for="(item,index) in list"
  9. :key="index"
  10. >
  11. <view class='title' @click='panel(item.id)'>
  12. <view class="a">{{ item.title }}</view>
  13. <view class="b">
  14. <text
  15. class="iconfont iconarrow-top"
  16. :class="{ 'down': active == item.id, 'up': active != item.id }"
  17. ></text>
  18. </view>
  19. </view>
  20. <view class="content" v-if="active == item.id">
  21. <view v-html="item.content"></view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import navbar from "@/components/navbar/navbar";
  29. export default {
  30. components: {
  31. navbar
  32. },
  33. data(){
  34. return {
  35. active:0,
  36. list: []
  37. };
  38. },
  39. onLoad() {
  40. this.$http.gethelp().then((res)=>{
  41. if(res.status){
  42. this.list = res.data;
  43. this.active = res.data[0] != undefined ? res.data[0].id : 0;
  44. }else{
  45. this.$utils.msg(res.info);
  46. }
  47. }).catch((error)=>{
  48. this.$utils.msg("网络出错,请检查网络是否连接");
  49. });
  50. },
  51. methods: {
  52. panel: function (index) {
  53. if (index != this.active) {
  54. this.active = index;
  55. } else {
  56. this.active = 0;
  57. }
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss">
  63. .help {
  64. width: 100%;
  65. margin: 0 auto;
  66. background-color: #fff;
  67. }
  68. .help .item {
  69. width: 95%;
  70. margin: 0 auto;
  71. }
  72. .help .item .title {
  73. width: 100%;
  74. font-size: 30rpx;
  75. height: 80rpx;
  76. line-height: 80rpx;
  77. border-bottom: 1px solid #ebedf0;
  78. }
  79. .help .item:last-child .title {
  80. border-bottom: 0;
  81. }
  82. .help .item .title .a {
  83. float: left;
  84. }
  85. .help .item .title .b {
  86. display: inline-block;
  87. float: right;
  88. position: relative;
  89. color: #969799;
  90. }
  91. .help .item .content {
  92. font-size: 26rpx;
  93. line-height: 40rpx;
  94. color: #969799;
  95. padding: 20rpx 0;
  96. }
  97. .up {
  98. position: absolute;
  99. right: 0;
  100. transform:rotate(180deg);
  101. }
  102. .down {
  103. position: absolute;
  104. right: 0;
  105. transform:rotate(360deg);
  106. }
  107. </style>