index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="style">
  5. <el-col :span="24" class="top">
  6. <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
  7. </el-col>
  8. <el-col :span="24" class="main">
  9. <!-- <el-col :span="12" class="btn">
  10. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '智慧推荐' } })" disabled>
  11. <el-image :src="onePic"></el-image>
  12. <p>智慧推荐</p>
  13. </el-link>
  14. </el-col>
  15. <el-col :span="12" class="btn">
  16. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '展会管理' } })">
  17. <el-image :src="twoPic"></el-image>
  18. <p>展会管理</p>
  19. </el-link>
  20. </el-col>
  21. <el-col :span="12" class="btn">
  22. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '科技评估' } })" disabled>
  23. <el-image :src="threePic"></el-image>
  24. <p>科技评估</p>
  25. </el-link>
  26. </el-col>
  27. <el-col :span="12" class="btn">
  28. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '合同在线' } })" disabled>
  29. <el-image :src="fourPic"></el-image>
  30. <p>合同在线</p>
  31. </el-link>
  32. </el-col>
  33. <el-col :span="12" class="btn">
  34. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '信用认证' } })" disabled>
  35. <el-image :src="fivePic"></el-image>
  36. <p>信用认证</p>
  37. </el-link>
  38. </el-col>
  39. <el-col :span="12" class="btn">
  40. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '绩效评价' } })" disabled>
  41. <el-image :src="sixPic"></el-image>
  42. <p>绩效评价</p>
  43. </el-link>
  44. </el-col> -->
  45. <!-- <el-col :span="24" class="topImage">
  46. <el-image :src="topImage"></el-image>
  47. </el-col>
  48. <el-col :span="24" class="info">
  49. <el-col :span="6" class="btn">
  50. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '智慧推荐' } })" disabled>
  51. <el-image :src="onePic"></el-image>
  52. <p>智慧推荐</p>
  53. </el-link>
  54. </el-col>
  55. <el-col :span="6" class="btn">
  56. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '展会管理' } })">
  57. <el-image :src="twoPic"></el-image>
  58. <p>展会管理</p>
  59. </el-link>
  60. </el-col>
  61. <el-col :span="6" class="btn">
  62. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '动态监测' } })">
  63. <el-image :src="sevenPic"></el-image>
  64. <p>动态监测</p>
  65. </el-link>
  66. </el-col>
  67. <el-col :span="6" class="btn">
  68. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '科技评估' } })" disabled>
  69. <el-image :src="threePic"></el-image>
  70. <p>科技评估</p>
  71. </el-link>
  72. </el-col>
  73. <el-col :span="6" class="btn">
  74. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '合同在线' } })" disabled>
  75. <el-image :src="fourPic"></el-image>
  76. <p>合同在线</p>
  77. </el-link>
  78. </el-col>
  79. <el-col :span="6" class="btn">
  80. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '信用认证' } })" disabled>
  81. <el-image :src="fivePic"></el-image>
  82. <p>信用认证</p>
  83. </el-link>
  84. </el-col>
  85. <el-col :span="6" class="btn">
  86. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '绩效评价' } })" disabled>
  87. <el-image :src="sixPic"></el-image>
  88. <p>绩效评价</p>
  89. </el-link>
  90. </el-col>
  91. <el-col :span="6" class="btn">
  92. <el-link :underline="false" @click="$router.push({ path: '/service/detail', query: { column_name: '在线咨询' } })" disabled>
  93. <el-image :src="eightPic"></el-image>
  94. <p>在线咨询</p>
  95. </el-link>
  96. </el-col>
  97. </el-col> -->
  98. </el-col>
  99. <el-col :span="24" class="main1">
  100. <el-col :span="24" class="search">
  101. <el-col :span="6" class="type">
  102. <el-select v-model="type" placeholder="请选择" clearable @change="typeChange">
  103. <el-option v-for="(item, index) in typelist" :key="index" :label="item.name" :value="item.type"> </el-option>
  104. </el-select>
  105. </el-col>
  106. <el-col :span="18" class="input">
  107. <van-search v-model="name" @search="onSearch" placeholder="请输入信息标题" />
  108. </el-col>
  109. </el-col>
  110. <el-col :span="24" class="main1info">
  111. <van-tabs v-model="active">
  112. <van-tab title="专家问诊">
  113. <technicallist type="1" :list="oneList"></technicallist>
  114. </van-tab>
  115. <van-tab title="行业研究">
  116. <technicallist type="2" :list="twoList"></technicallist>
  117. </van-tab>
  118. <van-tab title="嘉宾访谈">
  119. <technicallist type="3" :list="threeList"></technicallist>
  120. </van-tab>
  121. <van-tab title="项目路演">
  122. <technicallist type="4" :list="fourList"></technicallist>
  123. </van-tab>
  124. </van-tabs>
  125. </el-col>
  126. </el-col>
  127. </el-col>
  128. </el-row>
  129. </div>
  130. </template>
  131. <script>
  132. import { mapState, createNamespacedHelpers } from 'vuex';
  133. import NavBar from '@/layout/common/topInfo.vue';
  134. import footInfo from '@/layout/common/footInfo.vue';
  135. import technicallist from './parts/technicallist.vue';
  136. const { mapActions: column } = createNamespacedHelpers('column');
  137. const { mapActions: news } = createNamespacedHelpers('news');
  138. const { mapActions: newsguidance } = createNamespacedHelpers('newsguidance');
  139. const { mapActions: newsroadshow } = createNamespacedHelpers('newsroadshow');
  140. export default {
  141. name: 'index',
  142. props: {},
  143. components: {
  144. NavBar,
  145. // footInfo,
  146. technicallist,
  147. },
  148. data: function() {
  149. return {
  150. // 头部标题
  151. title: '',
  152. // meta为true
  153. isleftarrow: '',
  154. // 返回
  155. navShow: true,
  156. topImage: require('@/assets/topImage.jpg'),
  157. onePic: require('@/assets/bendi1.png'),
  158. twoPic: require('@/assets/bendi2.png'),
  159. threePic: require('@/assets/bendi3.png'),
  160. fourPic: require('@/assets/bendi4.png'),
  161. fivePic: require('@/assets/bendi5.png'),
  162. sixPic: require('@/assets/bendi6.png'),
  163. sevenPic: require('@/assets/bendi7.png'),
  164. eightPic: require('@/assets/bendi8.png'),
  165. // 技术交流
  166. // 栏目列表
  167. columnList: [],
  168. active: 0,
  169. oneList: [],
  170. twoList: [],
  171. threeList: [],
  172. fourList: [],
  173. // 查询
  174. typelist: [
  175. { name: '专家问诊', type: '1' },
  176. { name: '行业研究', type: '2' },
  177. { name: '嘉宾访谈', type: '3' },
  178. { name: '项目路演', type: '4' },
  179. ],
  180. name: '',
  181. type: '',
  182. };
  183. },
  184. async created() {
  185. await this.searchCloumn();
  186. await this.search();
  187. },
  188. methods: {
  189. ...column({ columnquery: 'query', columnInfo: 'fetch' }),
  190. ...news({ newsList: 'query' }),
  191. ...newsguidance({ danceQuery: 'query' }),
  192. ...newsroadshow({ adshowQuery: 'query' }),
  193. // 技术交流
  194. async searchCloumn() {
  195. const res = await this.columnquery();
  196. if (this.$checkRes(res)) {
  197. this.$set(this, `columnList`, res.data);
  198. }
  199. },
  200. // 查询列表
  201. async search() {
  202. let column = this.columnList;
  203. for (const i of column) {
  204. if (i.name == '专家问诊') {
  205. const res = await this.newsList({ column_id: i._id });
  206. if (this.$checkRes(res)) this.$set(this, `oneList`, res.data);
  207. } else if (i.name == '行业研究') {
  208. const res = await this.newsList({ column_id: i._id });
  209. if (this.$checkRes(res)) this.$set(this, `twoList`, res.data);
  210. }
  211. }
  212. const jiabin = await this.danceQuery();
  213. if (this.$checkRes(jiabin)) this.$set(this, `threeList`, jiabin.data);
  214. const luyan = await this.adshowQuery();
  215. if (this.$checkRes(luyan)) this.$set(this, `fourList`, luyan.data);
  216. },
  217. // 输入框是搜索
  218. async searchList({ ...info } = {}) {
  219. if (this.name) {
  220. info.title = this.name;
  221. let type = this.type;
  222. if (type == 1) {
  223. let expertCol = this.columnList.find(i => i.name == '专家问诊');
  224. const res = await this.newsList({ column_id: expertCol._id, ...info });
  225. if (this.$checkRes(res)) this.$set(this, `oneList`, res.data);
  226. } else if (type == 2) {
  227. let workCol = this.columnList.find(i => i.name == '行业研究');
  228. const res = await this.newsList({ column_id: workCol._id, ...info });
  229. if (this.$checkRes(res)) this.$set(this, `twoList`, res.data);
  230. } else if (type == 3) {
  231. const jiabin = await this.danceQuery({ ...info });
  232. if (this.$checkRes(jiabin)) this.$set(this, `threeList`, jiabin.data);
  233. } else if (type == 4) {
  234. const luyan = await this.adshowQuery({ ...info });
  235. if (this.$checkRes(luyan)) this.$set(this, `fourList`, luyan.data);
  236. }
  237. } else {
  238. this.search();
  239. }
  240. },
  241. // 选择类型
  242. typeChange(value) {
  243. if (value) {
  244. this.active = '';
  245. this.$set(this, `type`, value);
  246. let index = this.typelist.findIndex(i => i.type == value);
  247. if (index) {
  248. this.$set(this, `active`, index);
  249. }
  250. }
  251. },
  252. // 输入框查询
  253. onSearch(data) {
  254. this.$set(this, `name`, data);
  255. if (this.type) {
  256. this.searchList();
  257. } else {
  258. this.$notify({
  259. message: '请选择信息类型',
  260. type: 'danger',
  261. });
  262. }
  263. },
  264. // 智慧推荐
  265. oneBtn() {},
  266. // 展会管理
  267. twoBtn() {
  268. console.log('智慧推荐');
  269. },
  270. // 科技评估
  271. threeBtn() {
  272. console.log('智慧推荐');
  273. },
  274. // 合同在线
  275. fourBtn() {
  276. console.log('智慧推荐');
  277. },
  278. // 信用认证
  279. fiveBtn() {
  280. console.log('智慧推荐');
  281. },
  282. // 绩效评价
  283. sixBtn() {
  284. console.log('智慧推荐');
  285. },
  286. },
  287. computed: {
  288. ...mapState(['user']),
  289. },
  290. mounted() {
  291. this.title = this.$route.meta.title;
  292. this.isleftarrow = this.$route.meta.isleftarrow;
  293. },
  294. };
  295. </script>
  296. <style lang="less" scoped>
  297. .style {
  298. width: 100%;
  299. min-height: 667px;
  300. position: relative;
  301. background-color: #fff;
  302. }
  303. .top {
  304. height: 46px;
  305. overflow: hidden;
  306. position: relative;
  307. z-index: 999;
  308. }
  309. .main {
  310. // min-height: 570px;
  311. .topImage {
  312. height: 160px;
  313. .el-image {
  314. width: 100%;
  315. height: 160px;
  316. }
  317. }
  318. .info {
  319. .btn {
  320. padding: 15px 0;
  321. text-align: center;
  322. border: 1px solid #f9f9f9;
  323. .el-image {
  324. width: 45px;
  325. height: 45px;
  326. overflow: hidden;
  327. }
  328. p {
  329. font-size: 15px;
  330. font-family: 楷体;
  331. padding: 5px 0 0 0;
  332. font-weight: bold;
  333. }
  334. }
  335. .btn:nth-child(2) .el-image {
  336. width: 45px;
  337. height: 40px;
  338. margin: 2px 0 3px 0;
  339. }
  340. }
  341. // .btn {
  342. // text-align: center;
  343. // background: #fff;
  344. // margin: 10px 10px 0 10px;
  345. // width: 44%;
  346. // border-radius: 5px;
  347. // padding: 15px 0;
  348. // p {
  349. // font-size: 17px;
  350. // font-family: 楷体;
  351. // padding: 5px 0 0 0;
  352. // font-weight: bold;
  353. // }
  354. // }
  355. }
  356. .main1 {
  357. position: relative;
  358. .search {
  359. position: fixed;
  360. width: 100%;
  361. z-index: 999;
  362. border-bottom: 1px solid #ccc;
  363. .type {
  364. /deep/.el-input__inner {
  365. border: none;
  366. padding: 0;
  367. height: 30px;
  368. line-height: 30px;
  369. }
  370. .el-select {
  371. padding: 10px 0px 0px 5px;
  372. }
  373. /deep/.el-input__icon {
  374. line-height: 30px;
  375. }
  376. }
  377. .input {
  378. .van-search {
  379. padding: 10px 12px 10px 0;
  380. }
  381. }
  382. }
  383. .main1info {
  384. position: absolute;
  385. width: 100%;
  386. top: 54px;
  387. background: #f9fafc;
  388. }
  389. }
  390. .foot {
  391. position: absolute;
  392. bottom: 0;
  393. }
  394. </style>