_id.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <div>
  3. <help-header></help-header>
  4. <div id="main">
  5. <div class="container" style="padding: 0; width: 1190px;">
  6. <div style="display: inline-block; width: 100%; margin: 0 auto">
  7. <div class="left">
  8. <left></left>
  9. </div>
  10. <div class="right">
  11. <div class="help-center">
  12. <div class="help-head"><img src="/images/help/help-title.png"></div>
  13. <div class="help-center-title">
  14. <a v-bind:href="'/help/home'" style="font-size: 14px">帮助中心首页<i class="fa fa-angle-right"></i></a>
  15. <span>
  16. <nuxt-link :to="`/help/home`" class="box" style="font-size: 16px"><span>{{helpTitle.item}}</span><i class="fa fa-close"></i></nuxt-link>
  17. </span>
  18. </div>
  19. <!-- 文章列表-->
  20. <div class="help-center-list">
  21. <h4>问题知识列表</h4>
  22. <ul>
  23. <li v-for="list in helpList">
  24. <em></em>
  25. <nuxt-link :to="`/help/helpDetail/${list.num}`" v-text="list.title" :title="list.title"></nuxt-link>
  26. </li>
  27. <li v-if="helpList.length == 0" style="color: #999;">暂无数据!</li>
  28. </ul>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. // 升序
  39. function compare (property) {
  40. return function (a, b) {
  41. var value1 = a[property]
  42. var value2 = b[property]
  43. return value1 - value2
  44. }
  45. }
  46. import { left, helpHeader } from '~components/help'
  47. export default {
  48. name: 'help',
  49. components: {
  50. left,
  51. helpHeader
  52. },
  53. fetch ({ store, route }) {
  54. return Promise.all([
  55. store.dispatch('loadHelpSnapsho', { parentId: 0 }),
  56. store.dispatch('loadHelpList', { navId: route.params.id }),
  57. store.dispatch('loadHelpTitle', route.params)
  58. ])
  59. },
  60. computed: {
  61. helpTitle () {
  62. return this.$store.state.help.title.data
  63. },
  64. helpList () {
  65. return this.$store.state.help.helplist.data.sort(compare('detno'))
  66. }
  67. }
  68. }
  69. </script>
  70. <style>
  71. @import '~assets/scss/help.css';
  72. </style>