index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <template>
  2. <div style="background: #f0f0f0;padding-bottom:50px">
  3. <div class="banner">
  4. <img src="~@/assets/images/zmqy.jpg" alt="">
  5. </div>
  6. <div class="bread">
  7. <div>
  8. <span>当前位置:首页-知名企业</span>
  9. </div>
  10. </div>
  11. <div class="smart-device">
  12. <div class="smart-title">
  13. <span><span>知名企业</span>ENTERPRISE</span>
  14. </div>
  15. <div class="smart-device-content">
  16. <div class="nav-company">
  17. <div>
  18. <ul>
  19. <li v-for="item in companyTypeList" :class="active==item.value?'active':''" @click="changeType(item.value)"><span>{{item.label}}</span></li>
  20. <!-- <li :class="active==1?'active':''" @click="active=1"><span>全部</span></li>-->
  21. <!-- <li :class="active==2?'active':''" @click="active=2"><span>新能源</span></li>-->
  22. <!-- <li :class="active==3?'active':''" @click="active=3"><span>金融</span></li>-->
  23. <!-- <li :class="active==4?'active':''" @click="active=4"><span>生物科技</span></li>-->
  24. <!-- <li :class="active==5?'active':''" @click="active=5"><span>软件</span></li>-->
  25. <!-- <li :class="active==6?'active':''" @click="active=6"><span>物联网</span></li>-->
  26. </ul>
  27. </div>
  28. </div>
  29. <ul class="company-list">
  30. <li v-for="(item,index) in zsList" :key="index" @click="detail(item)">
  31. <div class="wrap-device-detail">
  32. <div class="c-logo">
  33. <img :src="'https://smartpark.idea-sf.com'+item.img" alt="">
  34. </div>
  35. <div class="c-content">
  36. <h3>{{item.name}}</h3>
  37. <p style=" height: 5rem;">{{item.detail}}</p>
  38. </div>
  39. <div class="detail-btn">
  40. <span>查看详情</span>
  41. </div>
  42. </div>
  43. </li>
  44. </ul>
  45. <div class="paginationo-box">
  46. <van-pagination v-model="search.pageNum" :total-items="total" :show-page-size="10" @change="handleCurrentChange">
  47. <template #prev-text>
  48. <van-icon name="arrow-left" />
  49. </template>
  50. <template #next-text>
  51. <van-icon name="arrow" />
  52. </template>
  53. <template #page="{ text }">{{ text }}</template>
  54. </van-pagination>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. import {getPropaganda} from "@/service/api_service";
  62. import Base from '@/views/base/base'
  63. import BaseData from '@/views/base/baseData'
  64. export default {
  65. mixins: [Base, BaseData],
  66. data () {
  67. return {
  68. dc_key: ['company_type'],
  69. active:0,
  70. currentPage:1,
  71. total:0,
  72. zsList:[
  73. // {
  74. // img:'clogo.png',
  75. // name:'北京网讯互联网科技有限公司',
  76. // eventIndex:1,
  77. // detail:'我是一家很知名的公司我是一家很知名的公司我是一家很知名的公司我是一家很知名的公司我是一家很知名的公司我是一家很知名的公司我是一家很知名的公司'
  78. // },
  79. ],
  80. search: {
  81. pageNum: 1,
  82. pageSize: 8,
  83. status: 'published',
  84. },
  85. companyTypeList:[]
  86. }
  87. },
  88. mounted() {
  89. document.documentElement.scrollTop = document.body.scrollTop =0; //回到顶部
  90. this.initDict(this.dc_key,true).then((res) => {
  91. this.companyTypeList = this.dc_data.company_type
  92. this.getData()
  93. })
  94. if (window.history && window.history.pushState) {
  95. // 向历史记录中插入了当前页
  96. history.pushState(null, null, document.URL)
  97. window.addEventListener('popstate', this.goBack, false)
  98. }
  99. },
  100. destroyed() {
  101. window.removeEventListener('popstate', this.goBack, false)
  102. },
  103. methods: {
  104. goBack() {
  105. // console.log("点击了浏览器的返回按钮");
  106. // sessionStorage.clear()
  107. // window.history.back()
  108. // history.pushState(null, null, document.URL)
  109. this.$router.push({ path: '/' })
  110. },
  111. changeType(active){
  112. this.search.pageNum = 1
  113. this.search.companyType = active
  114. this.active=active
  115. this.getData()
  116. },
  117. handleCurrentChange: function(val) {
  118. this.search.pageNum = val
  119. this.getData()
  120. },
  121. getData(){
  122. getPropaganda(this.search).then(res=>{
  123. if(res.rows){
  124. this.total = res.total
  125. this.zsList = []
  126. res.rows.forEach(item=>{
  127. let url = ''
  128. if(item.logo&&item.logo.length>2){
  129. const annex = this.$common.castEval(item.logo)
  130. url = annex[0].url
  131. }
  132. const i = {
  133. img:this.$common.replaceWxDownload(url),
  134. name:item.companyName,
  135. content:item.content,
  136. detail:item.introduction
  137. }
  138. this.zsList.push(i)
  139. })
  140. }
  141. })
  142. },
  143. detail(index){
  144. this.$router.push({name:'companyDetail',params:index})
  145. }
  146. },
  147. };
  148. </script>
  149. <style scoped>
  150. .banner img{
  151. width: 100% !important;
  152. }
  153. @media screen and (min-width: 1000px){
  154. .bread{
  155. background: #fff;
  156. }
  157. .bread div{
  158. width: 1200px;
  159. margin: 0 auto;
  160. text-align: left;
  161. padding: 0.8rem 0;
  162. font-size: 1rem;
  163. }
  164. .smart-title{
  165. margin-top:3rem;
  166. }
  167. .smart-device{
  168. width: 1200px;
  169. margin: 0 auto;
  170. text-align: left;
  171. font-size: 1rem;
  172. }
  173. .smart-device span span{
  174. font-size: 2rem;
  175. display: inline-block;
  176. position: relative;
  177. padding-right: 1rem;
  178. margin-right: 1rem;
  179. font-weight: 900;
  180. }
  181. .smart-device span span:after{
  182. content: '';
  183. width: 1px;
  184. height: 15px;
  185. background: #666;
  186. position: absolute;
  187. right: 0;
  188. bottom: 7px;
  189. }
  190. .nav-company{
  191. margin: 3rem 0;
  192. }
  193. .nav-company>div{
  194. width: 97%;
  195. margin: 0 auto;
  196. background: #fff;
  197. padding: 1rem 0;
  198. }
  199. .nav-company ul{
  200. display: flex;
  201. width: 80%;
  202. margin: 0 auto;
  203. justify-content: center;
  204. flex-wrap: nowrap;
  205. }
  206. .nav-company ul li{
  207. width: 6rem;
  208. text-align: center;
  209. cursor: pointer;
  210. }
  211. .nav-company ul li span{
  212. width: 80%;
  213. margin: 0 auto;
  214. display: inline-block;
  215. text-align: center;
  216. color: #333;
  217. }
  218. .wrap-device-detail{
  219. background: #fff;
  220. width: 90%;
  221. margin: 0 auto;
  222. border-bottom: 2px solid rgba(75, 175, 227, 1);
  223. position: relative;
  224. padding-top: 1rem;
  225. }
  226. .smart-device-content .company-list{
  227. display: flex;
  228. justify-content: left;
  229. flex-wrap: wrap;
  230. }
  231. .smart-device-content .company-list li{
  232. width: 33.33%;
  233. margin-bottom: 2rem;
  234. }
  235. .c-logo{
  236. width: 90%;
  237. margin: 0 auto;
  238. text-align: center;
  239. }
  240. .c-logo img{
  241. width: 60%;
  242. height: 5rem;
  243. }
  244. .c-content{
  245. width: 90%;
  246. margin: 0 auto;
  247. }
  248. .c-content h3{
  249. text-align: center;
  250. font-size: 1rem;
  251. margin: 1rem 0;
  252. }
  253. .c-content p{
  254. font-size: 0.8rem;
  255. line-height: 1.6rem;
  256. /*height: 10rem;*/
  257. overflow: hidden;
  258. margin-bottom: 1rem;
  259. display: -webkit-box;
  260. -webkit-line-clamp:3;
  261. -webkit-box-orient: vertical;
  262. }
  263. .detail-btn{
  264. position: absolute;
  265. left: 0;
  266. right: 0;
  267. bottom: -10px;
  268. text-align: center;
  269. }
  270. .detail-btn span{
  271. display: inline-block;
  272. width: 40%;
  273. margin: 0 auto;
  274. text-align: center;
  275. background: rgba(75, 175, 227, 1);
  276. color: #fff;
  277. }
  278. .active{
  279. background: rgba(75, 175, 227, 1);
  280. }
  281. .active span{
  282. color: #fff!important;
  283. }
  284. .paginationo-box{
  285. width: 20%;
  286. margin: 0 auto;
  287. }
  288. }
  289. @media screen and (max-width: 1000px){
  290. .banner{
  291. display: none;
  292. }
  293. .zc-content{
  294. display: none;
  295. }
  296. .bread{
  297. display: none;
  298. }
  299. .smart-title{
  300. margin-top:2rem;
  301. }
  302. .smart-device{
  303. width: 90%;
  304. margin: 0 auto;
  305. text-align: left;
  306. font-size: 1rem;
  307. overflow: hidden;
  308. }
  309. .smart-device span span{
  310. font-size: 1.5rem;
  311. display: inline-block;
  312. position: relative;
  313. padding-right: 1rem;
  314. margin-right: 1rem;
  315. font-weight: 900;
  316. }
  317. .smart-device span span:after{
  318. content: '';
  319. width: 1px;
  320. height: 15px;
  321. background: #666;
  322. position: absolute;
  323. right: 0;
  324. bottom: 7px;
  325. }
  326. .nav-company{
  327. margin: 3rem 0;
  328. box-shadow: 10px 10px 10px #dedede;
  329. }
  330. .nav-company>div{
  331. width: 100%;
  332. margin: 0 auto;
  333. background: #fff;
  334. padding: 1rem 0;
  335. }
  336. .nav-company ul{
  337. overflow: hidden;
  338. width: 80%;
  339. margin: 0 auto;
  340. display: flex;
  341. justify-content: center;
  342. flex-wrap: wrap;
  343. }
  344. .nav-company ul li{
  345. width: 5rem;
  346. overflow: hidden;
  347. text-align: center;
  348. cursor: pointer;
  349. margin-top: 1rem;
  350. }
  351. .nav-company ul li span{
  352. width: 80%;
  353. margin: 0 auto;
  354. display: inline-block;
  355. text-align: center;
  356. border: 1px solid rgba(75, 175, 227, 1);
  357. color: rgba(75, 175, 227, 1);
  358. padding: 0 4px;
  359. }
  360. .wrap-device-detail{
  361. background: #fff;
  362. width: 90%;
  363. margin: 0 auto;
  364. border-bottom: 2px solid rgba(75, 175, 227, 1);
  365. position: relative;
  366. padding-top: 1rem;
  367. }
  368. .smart-device-content .company-list{
  369. }
  370. .smart-device-content .company-list li{
  371. width: 100%;
  372. margin-bottom: 2rem;
  373. }
  374. .c-logo{
  375. width: 90%;
  376. margin: 0 auto;
  377. text-align: center;
  378. }
  379. .c-logo img{
  380. width: 60%;
  381. height: 5rem;
  382. }
  383. .c-content{
  384. width: 90%;
  385. margin: 0 auto;
  386. }
  387. .c-content h3{
  388. text-align: center;
  389. font-size: 1rem;
  390. margin: 1rem 0;
  391. }
  392. .c-content p{
  393. font-size: 0.8rem;
  394. line-height: 1.6rem;
  395. /*height: 10rem;*/
  396. overflow: hidden;
  397. margin-bottom: 1rem;
  398. display: -webkit-box;
  399. -webkit-line-clamp:3;
  400. -webkit-box-orient: vertical;
  401. }
  402. .detail-btn{
  403. position: absolute;
  404. left: 0;
  405. right: 0;
  406. bottom: -10px;
  407. text-align: center;
  408. }
  409. .detail-btn span{
  410. display: inline-block;
  411. width: 40%;
  412. margin: 0 auto;
  413. text-align: center;
  414. background: rgba(75, 175, 227, 1);
  415. color: #fff;
  416. }
  417. .active{
  418. background: rgba(75, 175, 227, 1);
  419. }
  420. .active span{
  421. color: #fff!important;
  422. }
  423. }
  424. .paginationo-box /deep/ .van-pagination__item--active{
  425. background: rgba(75, 175, 227, 1)!important;
  426. color: #fff!important;
  427. }
  428. .paginationo-box /deep/ .van-pagination__item{
  429. color: #333;
  430. }
  431. </style>