_id.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 (propertyName) {
  40. return function (object1, object2) {
  41. var value1 = object1[propertyName]
  42. var value2 = object2[propertyName]
  43. if (value1 > value2) {
  44. return 1
  45. } else if (value1 < value2) {
  46. return -1
  47. } else {
  48. return 0
  49. }
  50. }
  51. }
  52. import { left, helpHeader } from '~components/help'
  53. export default {
  54. name: 'help',
  55. components: {
  56. left,
  57. helpHeader
  58. },
  59. fetch ({ store, route }) {
  60. return Promise.all([
  61. store.dispatch('loadHelpSnapsho', { parentId: 0 }),
  62. store.dispatch('loadHelpList', { navId: route.params.id }),
  63. store.dispatch('loadHelpTitle', route.params)
  64. ])
  65. },
  66. computed: {
  67. helpTitle () {
  68. return this.$store.state.help.title.data
  69. },
  70. helpList () {
  71. return this.$store.state.help.helplist.data.sort(compare('detno'))
  72. }
  73. }
  74. }
  75. </script>
  76. <style>
  77. @import '~assets/scss/help.css';
  78. </style>