service.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <div id="service">
  3. <service-detail
  4. :info="info"
  5. :videosList="sphyzxList"
  6. :ztytList="ztytList"
  7. :jswdList="jswdList"
  8. :hyyjList="hyyjList"
  9. :kjpxList="kjpxList"
  10. :changyongList="changyongList"
  11. ></service-detail>
  12. </div>
  13. </template>
  14. <script>
  15. import serviceDetail from '@/components/service/service.vue';
  16. import { createNamespacedHelpers, mapGetters } from 'vuex';
  17. const { mapActions: mapSite } = createNamespacedHelpers('site');
  18. const { mapActions: mapColumn } = createNamespacedHelpers('serveColumn');
  19. const { mapActions: mapNews } = createNamespacedHelpers('serveNews');
  20. export default {
  21. name: 'service',
  22. props: {},
  23. components: {
  24. serviceDetail,
  25. },
  26. data: () => ({
  27. info: {},
  28. // 视频会议中心
  29. sphyzxList: [],
  30. // 专题研讨
  31. ztytList: [],
  32. // 技术问答
  33. jswdList: [],
  34. // 行业研究
  35. hyyjList: [],
  36. // 科技培训
  37. kjpxList: [],
  38. // 常用服务
  39. changyongList: [
  40. {
  41. url: '',
  42. pic: require('@/assets/zscqfw1.png'),
  43. },
  44. {
  45. url: '',
  46. pic: require('@/assets/zscqfw2.png'),
  47. },
  48. {
  49. url: '',
  50. pic: require('@/assets/zscqfw3.png'),
  51. },
  52. {
  53. url: '',
  54. pic: require('@/assets/zscqfw4.png'),
  55. },
  56. {
  57. url: '',
  58. pic: require('@/assets/zscqfw5.png'),
  59. },
  60. {
  61. url: '',
  62. pic: require('@/assets/zscqfw6.png'),
  63. },
  64. {
  65. url: '',
  66. pic: require('@/assets/zscqfw7.png'),
  67. },
  68. {
  69. url: '',
  70. pic: require('@/assets/zscqfw8.png'),
  71. },
  72. {
  73. url: '',
  74. pic: require('@/assets/zscqfw9.png'),
  75. },
  76. ],
  77. }),
  78. created() {
  79. this.searchSite();
  80. this.searchColumn();
  81. },
  82. computed: {},
  83. methods: {
  84. ...mapSite(['showInfo']),
  85. ...mapColumn({ columnList: 'query', columnInfo: 'fetch' }),
  86. ...mapNews({ newsList: 'query' }),
  87. // 查询站点信息
  88. async searchSite() {
  89. let res = await this.showInfo();
  90. let object = JSON.parse(JSON.stringify(res.data));
  91. if (object) {
  92. this.$set(this, `info`, res.data);
  93. } else {
  94. this.$message.error(res.errmsg ? res.errmsg : 'error');
  95. }
  96. },
  97. // 查询科技服务栏目
  98. async searchColumn({ ...info } = {}) {
  99. const res = await this.columnList({ ...info });
  100. for (const val of res.data) {
  101. this.tpxwSearch({ column_id: val.id, site: val.site });
  102. }
  103. },
  104. // 查询信息列表
  105. async tpxwSearch({ skip = 0, limit = 10, column_id, site } = {}) {
  106. console.log(column_id, site);
  107. const res = await this.newsList({ skip, limit, column_id: column_id });
  108. for (const val of res.data) {
  109. const result = await this.columnInfo(val.column_id);
  110. val.column_name = result.data.name;
  111. }
  112. this.$set(this, `${site}List`, res.data);
  113. console.log(res.data);
  114. },
  115. },
  116. };
  117. </script>
  118. <style lang="less" scoped></style>