| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- <template>
- <div
- :class="$deviceType.isMobile() ? 'mobileMain' : ''"
- :style="{marginTop: mainMarginTop, marginBottom: $deviceType.isMobile() ? '0px' : '30px !important'}">
- <div class="consult-wrapper">
- <div class="consult-top">
- <div class="tabs">
- <div class="tabs-item" :class="num==0 ? 'active' : ''" @click="tabsItem(0)">全部</div>
- <div class="tabs-item" :class="num==19 ? 'active' : ''" @click="tabsItem(19)">技术服务商</div>
- <div class="tabs-item" :class="num==18 ? 'active' : ''" @click="tabsItem(18)">人力外包</div>
- </div>
- </div>
- <div>
- <div class="company-list" v-if="companyList.length">
- <a :href="`/company/${item.uid}`" v-for="item in companyList" :key="item.uid">
- <!-- <img class="img" :src="item.logo" :alt="item.name"> -->
- <img class="img" :src="defaultImg" v-real-img="item.logo" :alt="item.name">
- <div class="right">
- <h3 class="title">{{ item.name }}</h3>
- <div class="industry">
- <span v-for="tag in item.tag" :key="tag.name">{{ tag.name }}</span>
- </div>
- <div class="intro">
- <span>入驻平台: <em>{{ !item.time ? 0 : item.time }}年</em></span>
- <span>企业规模: <em>{{ !item.group_type ? 0 : item.group_type }}人</em></span>
- <span>办公地址: <em>{{ !item.address ? '暂无' : item.address }}</em></span>
- </div>
- <p class="info">{{ item.brief_introduction }}</p>
- </div>
- </a>
- </div>
- <div class="result-empty-wrapper" style="margin-top: 10px;" v-else>
- <img src="@/assets/img/common/empty@2x.png" alt="empty">
- <span>暂无内容</span>
- </div>
- </div>
- <div class="pagination">
- <el-pagination
- background
- layout="prev, pager, next"
- :current-page="pagination.page"
- :total="pagination.total"
- @current-change="handlePageChange">
- </el-pagination>
- </div>
- </div>
- </div>
- </template>
- <script>
- import {mapState} from "vuex"
- import DealSeoList from "@/components/company/dealSeoList"
- import qs from "qs"
- export default {
- name: 'SeoCompanyList',
- data () {
- return {
- num: 0,
- baseUrl: '',
- isWeixinApp: true,
- defaultImg: require('@/assets/img/common/empty@2x.png')
- }
- },
- head() {
- const {
- title = "",
- keyword = "",
- description = "",
- h1 = "",
- canonical = "",
- metaLocation
- } = this.head || {}
- let obj = {
- title: title,
- meta: [{
- name: "keywords",
- content: keyword
- }, {
- name: "description",
- content: description
- }, {
- name: "h1",
- content: h1
- }],
- link: [{rel: "canonical", href: canonical}]
- }
- if (metaLocation) {
- obj.meta.push({name: "location", content: metaLocation})
- }
- return obj
- },
- computed: {
- ...mapState(["deviceType"]),
- showWxHeader () {
- return !this.deviceType.app && !this.isWeixinApp &&
- (this.deviceType.android || this.deviceType.ios)
- },
- mainMarginTop () {
- if (this.mobile && this.showWxHeader) {
- return '64px !important'
- } else if (this.mobile) {
- return '0px !important'
- } else {
- return '10px !important'
- }
- }
- },
- async asyncData ({...params}) {
- let dealDataObj = new DealSeoList(params)
- let result = await dealDataObj.dealData()
- return {
- ...result
- }
- },
- mounted () {
- this.baseUrl = this.$store.state.domainConfig.siteUrl
- this.isWeixinApp = navigator.userAgent.indexOf("miniProgram") > -1
- },
- methods: {
- tabsItem(num){
- this.num = num
- this.getCompanyList(num)
- },
- getCompanyList (num=0) {
- this.pagination.loading = true
- let data = {
- cert_id: num,
- page: this.pagination.page,
- pagesize: this.pagination.pagesize
- }
- this.$axios.$post('/uapi/company', data).then(res => {
- const { data, info, status} = res
- if(status===1){
- this.companyList = data.list
- this.pagination.total = data.count
- }
- }).then(()=>{
- this.pagination.loading = false
- })
- // this.pagination.loading = true
- // this.pagination.noMore = false
- },
- /** 分页页码改变时 */
- handlePageChange (val) {
- this.pagination.page = val
- this.getCompanyList(this.num)
- },
- /** mobile 加载更多 */
- // handleLoadMoreConsult () {
- // if (this.pagination.loading) {
- // return
- // }
- // this.pagination.page++
- // this.getCompanyList()
- // },
- }
- }
- </script>
- <style lang="scss" scoped>
- @import "@/assets/css/consult/list.scss";
- </style>
- <style lang="scss">
- .consult-wrapper .consult-top{
- padding-bottom: 0 !important;
- border-radius: 6px !important;
- }
- .company-list {
- a {
- display: flex;
- font-family: PingFangSC, PingFangSC-Regular;
- padding: 18px;
- margin-top: 10px;
- background: #fff;
- .right {
- flex: 1;
- padding-left: 16px;
- }
- .img {
- width: 164px;
- height: 164px;
- background: #fff;
- border-radius: 8px;
- }
- .title {
- color: #222;
- font-size: 20px;
- padding-top: 4px;
- }
- .industry {
- padding: 12px 0;
- span {
- background: rgba(48,142,255,0.11);
- border-radius: 1px;
- padding: 9px 11px;
- color: #308eff;
- font-size: 12px;
- display: inline-block;
- margin-right: 8px;
- }
- }
- .intro {
- color: #999;
- font-size: 14px;
- span {
- display: inline-block;
- margin-right: 16px;
- }
- em {
- color: #308eff;
- }
- }
- .info {
- padding: 12px 0;
- color: #666;
- font-size: 14px;
- line-height: 22px;
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- }
- }
- .pagination {
- margin-top: 10px;
- background: #fff;
- width: 100%;
- height: 65px;
- display: flex;
- align-items: center;
- justify-content: center;
- .el-pagination {
- padding: 0;
- }
- }
- .consult-wrapper .consult-top .tabs .tabs-item {
- cursor: pointer;
- }
- .wx-header-custom-list {
- position: fixed !important;
- z-index: 11 !important;
- }
- </style>
|