AgencyResidentList.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <div class="home-wrapper">
  3. <!-- <TopSearch :searchVal="searchVal" :searchType="searchType" :searchTypeArr="searchTypeArr"/>-->
  4. <div class="nav" stype="height:500px">
  5. <!--搜索框-->
  6. <el-row class="search-nav" style="padding: 30px 0 20px 0">
  7. <el-col :span="6">
  8. <div class="pull-left" @click="gotoHome" style="cursor: pointer">
  9. <img class="logo-img" src="../../assets/img/logo-blue.png"/>
  10. <span class="logo-title">群智众测平台</span>
  11. </div>
  12. </el-col>
  13. <el-col :span="12">
  14. <div class="search-nav">
  15. <div id="search-block ">
  16. <el-tabs v-model="searchType" type="card" @tab-click="handleTypeClick">
  17. <el-tab-pane v-for="item in searchTypeArr" v-if="item.value!=='all'" :label="item.name"
  18. :name="item.value"
  19. :key="item.value"></el-tab-pane>
  20. </el-tabs>
  21. <div class="search-input">
  22. <el-input placeholder="请输入内容" v-model="searchVal" class="input-with-select">
  23. <el-button class="search-button" slot="append" type="primary" @click="handleSearchData">搜索</el-button>
  24. </el-input>
  25. </div>
  26. </div>
  27. </div>
  28. </el-col>
  29. <el-col :span="6">
  30. <el-button type="primary pull-right" class="releaseBtn" @click="checkLogin()">免费发布众测需求</el-button>
  31. </el-col>
  32. </el-row>
  33. </div>
  34. <div class="container" style="margin: 20px auto;">
  35. <div class="create-body">
  36. <div class="title h2">入驻品牌机构</div>
  37. <el-collapse accordion style="margin: 0 30px">
  38. <el-collapse-item v-for="(item,index) in curAgencyList" :key="item.id" class="item-template">
  39. <template slot="title">
  40. <el-row style="width: 100%;font-size: 16px">
  41. <el-col :span="8"><img :src="item.agencyPhoto" style="width: 50px; height: 50px;"></el-col>
  42. <el-col :span="8">{{item.evaluationAgencyName}}</el-col>
  43. <el-col :span="8">
  44. <el-tag type="success">{{item.city}}省市无</el-tag>
  45. </el-col>
  46. </el-row>
  47. </template>
  48. </el-collapse-item>
  49. <el-pagination
  50. v-if="curAgencyList&&curAgencyList.length"
  51. :page-size="9"
  52. layout="prev, pager, next"
  53. :total="totalElements"
  54. :current-page="activePage"
  55. @current-change="handlePageChange"
  56. class="pull-right"
  57. >
  58. </el-pagination>
  59. </el-collapse>
  60. </div>
  61. </div>
  62. </div>
  63. </template>
  64. <script>
  65. import Http from '@/js/http.js';
  66. import TopSearch from "../../components/commons/TopSearch";
  67. import {storageGet} from '@/js/index.js'
  68. import {notify} from "../../constants";
  69. export default {
  70. name: "AgencyResidentList",
  71. props: ['searchVal', 'agencyList'],
  72. components: {TopSearch},
  73. data() {
  74. return {
  75. isLogin: false,
  76. // searchVal: '',
  77. searchType: '1',
  78. searchTypeArr: [
  79. {
  80. "name": "全部",
  81. "value": "all"
  82. },
  83. {
  84. "name": "项目",
  85. "value": "0"
  86. },
  87. {
  88. "name": "机构",
  89. "value": "1"
  90. },
  91. {
  92. "name": "工具",
  93. "value": "2"
  94. },
  95. {
  96. "name": "专家",
  97. "value": "3"
  98. }],
  99. curAgencyList: this.agencyList,
  100. activePage: 1,
  101. totalElements: 0
  102. }
  103. },
  104. methods: {
  105. loadData() {
  106. if (storageGet('user') != null) {
  107. this.isLogin = true;
  108. }
  109. let url = '/api/common/index/page';
  110. let params = {
  111. "keyword": this.searchVal,
  112. "activePage": this.activePage,
  113. "columnFilters": [
  114. {
  115. "field": "type",
  116. "type": "enums",
  117. "enums": this.searchTypeArr,
  118. "value": this.searchType
  119. }
  120. ]
  121. }
  122. Http.post(url, params).then((res) => {
  123. this.curAgencyList = res.data.agencyPage.content;
  124. })
  125. },
  126. checkLogin() {
  127. if (!this.isLogin) {
  128. console.log("请登录后访问");
  129. notify('warning', '请登录后访问');
  130. } else {
  131. console.log("已登录");
  132. this.$router.push('/project/create');
  133. }
  134. },
  135. handleSearchData() {
  136. let url = '/api/common/index/page';
  137. let params = {
  138. "keyword": this.searchVal,
  139. "activePage": 1,
  140. "columnFilters": [
  141. {
  142. "field": "type",
  143. "type": "enums",
  144. "enums": this.searchTypeArr,
  145. "value": this.searchType
  146. }
  147. ]
  148. }
  149. Http.post(url, params).then((res) => {
  150. this.curAgencyList = res.data.agencyPage.content;
  151. })
  152. },
  153. gotoHome() {
  154. this.$router.push('/home');
  155. },
  156. handleTypeClick(tab) {
  157. this.searchType = tab.name
  158. },
  159. handlePageChange(index) {
  160. this.activePage = index;
  161. this.searchData();
  162. }
  163. },
  164. mounted() {
  165. this.loadData();
  166. }
  167. }
  168. </script>
  169. <style scoped>
  170. .item-template {
  171. height: 80px;
  172. }
  173. </style>