_id.vue 2.2 KB

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