supermarket.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <div id="supermarket">
  3. <supermarket-detail
  4. :info="info"
  5. :nativeList="nativeList"
  6. @onsave="nativeClick"
  7. :display="display"
  8. :jishuList="jishuList"
  9. :jishuTotal="jishuTotal"
  10. :chanpinList="chanpinList"
  11. :chanpinTotal="chanpinTotal"
  12. :serviceList="serviceList"
  13. :serveTotal="serveTotal"
  14. :fabuList="chanpinList"
  15. :tableData="tableData"
  16. :schoolList="schoolList"
  17. :scientificList="scientificList"
  18. :schoolTotal="schoolTotal"
  19. :scientificTotal="scientificTotal"
  20. :companyList="companyList"
  21. :companyTotal="companyTotal"
  22. :mechanismList="mechanismList"
  23. :mechanismTotal="mechanismTotal"
  24. @fabu="fabu"
  25. ></supermarket-detail>
  26. </div>
  27. </template>
  28. <script>
  29. import supermarketDetail from '@/components/supermaket/supermarket.vue';
  30. import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
  31. const { mapActions: mapSite } = createNamespacedHelpers('site');
  32. const { mapActions: user } = createNamespacedHelpers('user');
  33. const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
  34. // 获取学校
  35. import { school } from '@/util/school';
  36. export default {
  37. name: 'supermarket',
  38. props: {},
  39. components: {
  40. supermarketDetail,
  41. },
  42. data: () => ({
  43. // 站点信息
  44. info: {},
  45. nativeList: [
  46. {
  47. name: '高校院所',
  48. },
  49. {
  50. name: '科研院所',
  51. },
  52. {
  53. name: '科技企业',
  54. },
  55. {
  56. name: '机构团体',
  57. },
  58. {
  59. name: '研发服务',
  60. },
  61. {
  62. name: '科技需求',
  63. },
  64. {
  65. name: '创新产品',
  66. },
  67. {
  68. name: '咨询服务',
  69. },
  70. {
  71. name: '创新人才',
  72. },
  73. ],
  74. display: 'first',
  75. // 高校院所
  76. schoolList: school,
  77. schoolTotal: 76,
  78. // 科研院所
  79. scientificList: [
  80. {
  81. pic: require('@/assets/fabu.jpg'),
  82. title: '科研院所',
  83. com: 'www.baidu.com',
  84. type: '二级本科',
  85. address: '吉林省长春市力旺广场B座16楼',
  86. },
  87. ],
  88. scientificTotal: 1,
  89. // 科技企业
  90. companyList: [
  91. // {
  92. // title: '长春市福瑞科技有限公司',
  93. // city: '吉林省 长春市',
  94. // address: '吉林省长春市朝阳区力旺广场B座16楼1608',
  95. // content:
  96. // '长春市福瑞科技有限公司办公室地址位于中国汽车和“新中国电影的摇篮--长春,长春 怡众名城第20幢3单元505室(住所期限至2043年8月19日止),于2013年08月22日在长春市工商行政管理局高新技术产业开发区分局注册成立,注册资本为100万元人民币',
  97. // },
  98. ],
  99. // 技术型
  100. jishuList: [],
  101. // 技术型分页
  102. jishuTotal: 0,
  103. // 产品型
  104. chanpinList: [],
  105. // 产品型分页
  106. chanpinTotal: 0,
  107. // 服务供求,研发服务
  108. serviceList: [
  109. {
  110. title: '标题',
  111. type: '服务供求',
  112. yen: '1000元/台',
  113. date: '2019-12-26',
  114. },
  115. {
  116. title: '八条数据',
  117. type: '服务供求',
  118. yen: '1000元/台',
  119. date: '2019-12-26',
  120. },
  121. ],
  122. // 服务分页
  123. serveTotal: 0,
  124. // 交易展示
  125. tableData: [],
  126. companyTotal: 1,
  127. // 机构团体
  128. mechanismList: [
  129. {
  130. pic: require('@/assets/fabu.jpg'),
  131. title: '标题',
  132. city: '吉林长春',
  133. guimo: '562人',
  134. dengji: '国家级',
  135. lingyu: '重点研究领域',
  136. jianjie: '简介',
  137. },
  138. ],
  139. mechanismTotal: 1,
  140. }),
  141. async created() {
  142. await this.search();
  143. await this.searchList();
  144. },
  145. computed: {
  146. ...mapState(['user']),
  147. },
  148. methods: {
  149. ...mapSite(['showInfo']),
  150. ...user({ userQuery: 'query' }),
  151. ...marketproduct({ productquery: 'query' }),
  152. // 查询站点信息
  153. async search() {
  154. let res = await this.showInfo();
  155. let object = JSON.parse(JSON.stringify(res.data));
  156. if (object) {
  157. this.$set(this, `info`, res.data);
  158. }
  159. },
  160. // 查询列表
  161. async searchList({ ...info }) {
  162. let res = await this.userQuery({ role: 5, ...info });
  163. // 科技需求
  164. res = await this.productquery({ type: 0, ...info });
  165. if (this.$checkRes(res)) {
  166. this.$set(this, `jishuList`, res.data);
  167. this.$set(this, `jishuTotal`, res.total);
  168. }
  169. // 创新产品
  170. res = await this.productquery({ type: 1, ...info });
  171. if (this.$checkRes(res)) {
  172. this.$set(this, `chanpinList`, res.data);
  173. this.$set(this, `chanpinTotal`, res.total);
  174. }
  175. // 研发服务+咨询服务
  176. res = await this.productquery({ type: 2, ...info });
  177. if (this.$checkRes(res)) {
  178. this.$set(this, `serviceList`, res.data);
  179. this.$set(this, `serveTotal`, res.total);
  180. }
  181. },
  182. // 发布
  183. fabu() {},
  184. // 跳转
  185. async nativeClick({ name }) {
  186. if (name === '高校院所') {
  187. this.display = 'second';
  188. } else if (name === '科研院所') {
  189. this.display = 'thirth';
  190. } else if (name === '科技企业') {
  191. this.display = 'fourth';
  192. } else if (name === '机构团体') {
  193. this.display = 'fivth';
  194. } else if (name === '研发服务') {
  195. this.display = 'sixth';
  196. } else if (name === '科技需求') {
  197. this.display = 'seventh';
  198. } else if (name === '创新产品') {
  199. this.display = 'eighth';
  200. } else if (name === '咨询服务') {
  201. this.display = 'nineth';
  202. } else {
  203. this.$router.push({ path: '/personnel/personnel' });
  204. }
  205. },
  206. },
  207. };
  208. </script>
  209. <style lang="scss" scoped></style>