Files
2026-10-08 18:34:09 +08:00

442 lines
14 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template> <!-- 黄页 -->
<view class="wrap">
<!-- 吸顶 -->
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uiheader title="金久信黄页"></uiheader>
<!-- 搜索栏 -->
<cmsearch></cmsearch>
<!-- 轮播图-传值:list="数组" -->
<cmswiper page="yellowPage" height="320rpx"></cmswiper>
<!-- 选择器 -->
<view class="layout-pick flex justify-between align-center bg-white">
<view class="ip down" @click="showIndustry = true">行业:{{ industry }}</view>
</view>
<view class="layout-pick flex justify-between align-center bg-white">
<view style="max-width: 60%" class="ip down" @click="isPick = true">主营类目:{{ pickValue }}</view>
<view style="max-width: 40%" class="ip down" @click="showAddress">省份:{{ locationValue }}</view>
</view>
</u-sticky>
<!-- 广告图(可封装组件) -->
<!-- <view class="layout layout-banner">-->
<!-- <view class="banner">-->
<!-- <image class="full" src="/static/img/yellow-1.png" mode=""></image>-->
<!-- </view>-->
<!-- <view class="banner">-->
<!-- <image class="full" src="/static/img/yellow-2.png" mode=""></image>-->
<!-- </view>-->
<!-- <view class="banner">-->
<!-- <image class="full" src="/static/img/yellow-3.png" mode=""></image>-->
<!-- </view>-->
<!-- </view>-->
<!-- 列表 -->
<view class="layout layout-list">
<view class="item " style="line-height: 40rpx!important;" v-for="(item, index) in companyList" :key="index"
@click="detailLink(item._id)">
<!-- 基础信息 -->
<view class="company flex">
<view class="logo">
<image v-if="item && item.businessCard" style="width: 120rpx; height: 120rpx" mode="widthFix"
:src="item.businessCard.logo"/>
<image v-else class="full" src="/static/no-logo.jpg" style="width: 120rpx; height: 120rpx" mode=""></image>
</view>
<view class="info flex-1 flex flex-col justify-center items-start p-left-20" style="height: 120rpx">
<view class="name flex justify-start align-center">
<view class="name-text text-single font-bold">{{ item.company.companyName }}</view>
<!-- 认证图标 -->
</view>
<!-- <view class="rate">-->
<!-- <u-rate :count="5" v-model="rate"></u-rate>-->
<!-- </view>-->
<view class="people flex justify-start align-center">
<u-icon name="account" size="18"></u-icon>
<text class="xm p-left-10" v-if="item.manager">{{ item.manager.personName }}</text>
<text class="job p-left-20" v-if="item.businessCard">{{ item.businessCard.position }}</text>
</view>
</view>
</view>
<!-- 联系信息 -->
<view class="detail">
<view class="text-25 flex justify-start items-start">
<view class="flex justify-start align-center w-20p flex-shrink">
<u-icon name="map" size="18"></u-icon>
<view class="text">地址:</view>
</view>
<view style="line-height: 30rpx"
v-if="item.company && item.company.addressRegion && item.company.addressRegion.province && item.company.addressRegion.city && item.company.addressRegion.area">
{{
item.company.addressRegion.province.name
}}{{ item.company.addressRegion.city.name }}{{
item.company.addressRegion.area.name
}}{{
item.company.addressDetail
}}
</view>
</view>
<view class="mt-10 text-25 flex justify-start items-center">
<view class="flex justify-start items-center w-20p flex-shrink">
<u-icon name="phone" size="18"></u-icon>
<view class="text">电话:</view>
</view>
<view>{{ item.businessCard.companyMobile ? item.businessCard.companyMobile : '商家暂未填写' }}</view>
</view>
<view class="mt-10 text-25 flex justify-start items-center">
<view class="flex justify-start items-center w-20p flex-shrink">
<u-icon name="email" size="18"></u-icon>
<view class="text">邮箱:</view>
</view>
<view>{{ item.businessCard.email ? item.businessCard.email : '商家暂未填写' }}</view>
</view>
<view class="mt-10 text-25 flex justify-start items-center">
<view class="flex justify-start items-center w-20p flex-shrink">
<u-icon name="kefu-ermai" size="18"></u-icon>
<view class="text">手机:</view>
</view>
<view>{{ item.manager.mobile ? item.manager.mobile : '商家暂未填写' }}</view>
</view>
<view class="mt-10 text-25 flex justify-start items-center" v-if="item.userLevel > 1">
<view class="flex justify-start items-center w-20p flex-shrink">
<u-icon name="ie" size="18"></u-icon>
<view class="text">网址:</view>
</view>
<view>{{ item.businessCard ? item.businessCard.website : '商家暂未填写' }}</view>
</view>
</view>
<!-- 主营业务 -->
<view class="flex justify-start mt-25 text-25">
<text class="red w-20p flex-shrink">主营业务:</text>
<!-- <text class="text-left" style="line-height: 30rpx">{{-->
<!-- item.mainSpotCategory.length > 0 ? item.mainSpotCategory.join() : '无'-->
<!-- }}-->
<!-- </text>-->
<text class="ml-20 flex-1" style="line-height: 30rpx" v-if="item.mainSpotCategory.length">
{{ item.mainSpotCategory.join() }}
</text>
<text class="ml-20 flex-1" style="line-height: 30rpx"
v-if="!item.mainSpotCategory.length && item.company.mainSpotCategorySelf">
{{ item.company.mainSpotCategorySelf }}
</text>
</view>
<view class="flex justify-between items-center w-100p">
<view class="link mt-25">查看详情</view>
<view class="flex justify-end items-center">
<image src="/static/img/idente.png" class="ml-10" mode="" style="width: 80rpx; height: 28rpx"></image>
<i class="el-icon-star-off text-main ml-20"/>
</view>
</view>
</view>
</view>
<!-- 没有数据 -->
<u-empty mode="list" text="暂无更多内容~" v-if="companyList.length === 0"></u-empty>
<!-- <cmempty></cmempty> -->
<uiswiper :ad="23" padding="10rpx 0"></uiswiper>
<uiswiper :ad="24" padding="10rpx 0"></uiswiper>
<uiswiper :ad="25" padding="10rpx 0"></uiswiper>
<uiswiper :ad="26" padding="10rpx 0"></uiswiper>
<collapse></collapse>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<u-picker v-if="isPick" :show="isPick" :columns="[categoryTreeData, categoryTreeData[cateIndex[0]].children]"
key-name="name" @confirm="handConfirmPick" @change="handleChangeCate" @cancel="isPick = false">
<template #more>
<text @click="resetCate">重置</text>
</template>
</u-picker>
<u-picker v-if="showIndustry" :show="showIndustry" :columns="[industryList]"
key-name="name" @confirm="handConfirmPickIndustry" @cancel="showIndustry = false">
<template #more>
<text @click="resetIndustry">重置</text>
</template>
</u-picker>
</view>
</template>
<script>
import uiheader from '@/components/index/header'
import cmsearch from '@/components/common/search'
import cmempty from '@/components/common/empty'
import cmswiper from '@/components/common/swiper'
import Collapse from "@/components/index/collapse.vue";
import AddressSelect from "@/components/AddressSelect.vue";
import uiswiper from "@/components/index/swiper.vue";
export default {
components: {
uiswiper,
AddressSelect,
Collapse,
uiheader,
cmsearch,
cmempty,
cmswiper,
},
data() {
return {
rate: 3,
checkProvinceList: [],
keyword: '',
checkCategoryList: [],
industryList: [],
selectedIndustryList: [],
categoryTreeData: [],
allChildCate: [],
companyList: [],
locationValue: '全国',
region: {
province: {
code: null,
name: null,
}
},
pickValue: '全部',
isPick: false,
showIndustry: false,
industry: '全部',
cateId: null,
cateIndex: [0, 0],
};
},
methods: {
handleChangeCate({indexs}) {
this.cateIndex = indexs
},
handConfirmPick({value}) {
this.pickValue = value[1].name
this.cateId = value[1]._id
this.isPick = false
this.getCompany()
},
resetCate() {
this.cateIndex = [0, 0]
this.pickValue = '全部'
this.cateId = null
this.isPick = false
this.getCompany()
},
handConfirmPickIndustry({value}) {
this.industry = value[0].name
this.showIndustry = false
this.getCompany()
},
resetIndustry() {
this.industry = '全部'
this.showIndustry = false
this.getCompany()
},
showAddress() {
this.$refs.AddressSelect.open(this.region, 1, true);
},
regionConfirm({province}) {
this.region = {province}
this.locationValue = `${province.name}`
this.getCompany()
},
detailLink(id) {
vk.navigateTo(`/pages/yellow/detail?id=${id}`)
},
getCategoryTreeData() {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
this.getCompany()
}
});
},
getCompany() {
vk.callFunction({
url: 'client/user/pub/getCompany',
title: '请求中...',
data: {
province: this.region.province.code ? [this.region.province.code] : null,
keyword: this.keyword,
mainSpotCategoryIds: this.cateId ? [this.cateId] : null,
showInYellow: 1,
// factoryFilter: this.factoryFilter,
industryList: this.industry === '全部' ? null : [this.industry]
},
success: (data) => {
this.companyList = data.rows.map(item => {
item.name = item.company.companyName
item.mainSpotCategory = []
if (item.company && item.company.mainSpotCategoryIds) {
this.allChildCate.forEach(child => {
if (item.company.mainSpotCategoryIds.includes(child._id)) {
item.mainSpotCategory.push(child.name)
}
})
}
return item
})
}
});
},
async getIndustryList() {
const {rows} = await vk.callFunction({
url: 'client/industry/pub/getList'
})
this.industryList = rows
},
},
onLoad() {
this.getIndustryList()
this.getCategoryTreeData()
}
}
</script>
<style lang="scss">
.layout-pick {
// width: 690rpx;
height: 68rpx;
padding: 0 10rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #4F4F4F;
.ip {
position: relative;
max-width: 50%;
height: 40rpx;
padding-right: 25rpx;
overflow: hidden;
box-sizing: border-box;
}
.down::after {
position: absolute;
right: 5rpx;
top: 50%;
z-index: 9;
content: '';
margin-top: -6rpx;
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
border-top: 12rpx solid #999999;
}
}
.layout-banner {
padding: 0rpx 30rpx;
.banner {
margin-top: 20rpx;
width: 100%;
height: 126rpx;
}
}
.layout-list {
margin: 30rpx 30rpx;
.item {
margin-top: 20rpx;
padding: 20rpx 20rpx;
background: #ffffff;
border-radius: 12rpx;
}
.item:nth-child(1) {
margin-top: 0;
}
.company {
.logo {
width: 120rpx;
height: 120rpx;
}
.info {
.name-text {
max-width: 380rpx;
font-size: 30rpx;
line-height: 40rpx;
color: #666666;
}
.name-icon {
width: 80rpx;
height: 28rpx;
}
.rate {
padding: 10rpx 0;
}
.xm {
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
.job {
font-size: 24rpx;
line-height: 40rpx;
color: #999999;
}
}
}
.detail {
padding: 10rpx 0;
.p {
position: relative;
padding: 10rpx 0;
.lb {
position: absolute;
left: 0;
top: 10rpx;
z-index: 9;
width: 150rpx;
height: auto;
.text {
padding-left: 6rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
}
.vl {
padding-left: 120rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #666666;
}
}
}
.main {
padding: 10rpx 0;
font-size: 26rpx;
line-height: 40rpx;
text-align: center;
color: #666666;
}
.link {
width: 140rpx;
height: 60rpx;
font-size: 24rpx;
line-height: 60rpx;
text-align: center;
color: #ffffff;
background: #A92924;
}
}
</style>