help.vue 998 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view>
  3. <u-navbar title="帮助中心"></u-navbar>
  4. <view class="collapse">
  5. <u-collapse v-if="itemList.length">
  6. <u-collapse-item :title="item.title" v-for="(item, index) in itemList" :key="index">
  7. {{item.content}}
  8. </u-collapse-item>
  9. </u-collapse>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import * as API from '@/apis/finance.js'
  15. export default {
  16. data() {
  17. return {
  18. itemList: [],
  19. }
  20. },
  21. onReady() {
  22. this.getHomePage()
  23. },
  24. methods: {
  25. getHomePage(){
  26. uni.showLoading({
  27. title: "加载中",
  28. mask: true,
  29. })
  30. API.helpList({
  31. category:3
  32. }).then((res) => {
  33. this.itemList = res.data.helpList
  34. uni.hideLoading()
  35. }).catch(error => {
  36. uni.showToast({
  37. title: error
  38. })
  39. })
  40. }
  41. }
  42. }
  43. </script>
  44. <style>
  45. page{
  46. background-color: #F7F7F7;
  47. }
  48. </style>
  49. <style lang="scss" scoped>
  50. .collapse{
  51. margin: 16px;
  52. background-color: #fff;
  53. padding:0 10px;
  54. }
  55. </style>