This commit is contained in:
2026-10-08 18:20:51 +08:00
parent dec4ebc773
commit 6f1b2dc03a
621 changed files with 47117 additions and 43176 deletions
+49
View File
@@ -0,0 +1,49 @@
<template>
<view>
<view class="bg-gray-light flex justify-center items-center table-header p-30">
<view class="text-gray font-bold text-30 flex-1">品名/材质</view>
<view class="text-gray font-bold text-30 flex-1">采购量</view>
<view class="text-gray font-bold text-30 flex-2">采购企业</view>
<view class="text-gray font-bold text-30 flex-1">报价情况</view>
<view class="text-gray font-bold text-30 flex-1">发布时间</view>
<view class="text-gray font-bold text-30 flex-1 flex justify-end">操作</view>
</view>
<view class="flex justify-center items-center w-100p p-30"
v-for="(item, index) in info.enquiryList.filter((_, i) => i < limit)" :key="`enquiryList_${index}`">
<template
v-if="item.productList && item.productList.length > 0 && JSON.stringify(item.productList[0]) !== '{}'">
<view class="text-main flex-1 font-bold">{{ item.productList[0].goodsName }}</view>
<view class="flex-1">{{ item.productList[0].procureNumber }}{{
item.productList[0].procureUnit
}}
</view>
<view class="flex-2">{{ info.company.companyName }}</view>
<view class="flex-1">{{ item.answerNumber }}家已报价</view>
<view class="flex-1">{{ item._add_time_str }}</view>
<view class="flex-1 flex justify-end">
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="vk.navigateTo('/pages/enquiry/detail?id=' + item._id);">
查看详情
</el-button>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
name: "enquiry",
props: {
info: Object,
limit: {
type: Number,
default: 999999
},
},
data() {
return {}
},
methods: {}
}
</script>
+71
View File
@@ -0,0 +1,71 @@
<template>
<view>
<view class="bg-gray-light flex justify-center items-center table-header p-30">
<view class="text-gray font-bold text-30 flex-1">品名/材质</view>
<view class="text-gray font-bold text-30 flex-1">加工量</view>
<!-- <view class="text-gray flex-1">收购地</view>-->
<view class="text-gray font-bold text-30 flex-2">采购企业</view>
<view class="text-gray font-bold text-30 flex-1">报价情况</view>
<view class="text-gray font-bold text-30 flex-1">发布时间</view>
<view class="text-gray font-bold text-30 flex-1 flex justify-end">操作</view>
</view>
<view class="flex justify-center items-center w-100p p-30"
v-for="(item, index) in info.processList" :key="`processList_${index}`">
<view class="text-main flex-1 font-bold">{{ item.title }}</view>
<!-- <view class="flex-1">{{ item.address }}</view>-->
<view class="flex-1">{{ item.num }}</view>
<view class="flex-2">{{ info.company.companyName }}</view>
<view class="flex-1">{{ item.answerNumber }}家已报价</view>
<view class="flex-1">{{ item._add_time_str }}</view>
<view class="flex-1 flex justify-end">
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="toProcessDetail(item._id)">查看详情
</el-button>
</view>
</view>
</view>
</template>
<script>
export default {
name: "process",
props: {
info: Object,
limit: {
type: Number,
default: 999999
},
},
data() {
return {}
},
methods: {
async toProcessDetail(id) {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
vk.navigateTo({
url: `/pages/process/detail?id=${id}`
})
}
},
}
}
</script>
+149
View File
@@ -0,0 +1,149 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<gap/>
<view class="m-a w-1200 bg-white p-20 rounded">
<el-divider>
<span class="text-50 text-main font-bold">工厂信息</span>
</el-divider>
<el-descriptions border :column="2">
<el-descriptions-item label="成立年限">
<p>{{ info.year }}年</p>
</el-descriptions-item>
<el-descriptions-item label="年产值">
<p>{{ info.yearsIncome }}万元</p>
</el-descriptions-item>
<el-descriptions-item label="员工人数">
<p>{{ info.employeeNum }}人</p>
</el-descriptions-item>
<el-descriptions-item label="流水线数量">
<p>{{ info.flowNum }}条</p>
</el-descriptions-item>
<el-descriptions-item label="厂房归属">
<p>{{ info.blongTo }}</p>
</el-descriptions-item>
<el-descriptions-item label="厂房面积">
<p>{{ info.size }}平方米</p>
</el-descriptions-item>
<el-descriptions-item label="所在地">
<p>{{ info.addressRegion.province.name }}{{ info.addressRegion.city.name }}</p>
</el-descriptions-item>
<el-descriptions-item label="主营工艺和业务范围">
<p>{{ info.mainProcess }}</p>
</el-descriptions-item>
<el-descriptions-item label="主营类别" v-if="info.mainSpotCategory">
<p>{{ info.mainSpotCategory.join() }}</p>
</el-descriptions-item>
<el-descriptions-item label="服务信息">
<p>{{ info.serviceInfo }}</p>
</el-descriptions-item>
</el-descriptions>
<template v-if="info.video">
<el-divider>
<span class="text-50 text-main font-bold">视频</span>
</el-divider>
<video :src="info.video" style="width: 100%" controls></video>
</template>
<el-divider>
<span class="text-50 text-main font-bold">设备信息</span>
</el-divider>
<el-row :gutter="10" class="p-20 bg-gray-light">
<el-col :span="3">
<p class="text-center">设备名称</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备数量</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备来源</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备类型</p>
</el-col>
<el-col :span="3">
<p class="text-center">品牌</p>
</el-col>
<el-col :span="3">
<p class="text-center">型号</p>
</el-col>
<el-col :span="3">
<p class="text-center">投产年限</p>
</el-col>
<el-col :span="3">
<p class="text-center">特点描述</p>
</el-col>
</el-row>
<el-row :gutter="10" class="p-20" v-for="(item, index) in info.deviceList" :key="index">
<el-col :span="3">
<p class="text-center">{{ item.name }}</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.num }}台</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.source }}</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.type }}</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.brand }}</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.model }}</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.year }}年</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.desc }}</p>
</el-col>
</el-row>
<el-divider>
<span class="text-50 text-main font-bold">工厂实景</span>
</el-divider>
<div class="flex justify-start items-start">
<el-image v-for="(item, index) in info.album" :key="index" :src="item" class="mr-25 mb-25"
style="width: 200px; height: 200px;" fit="cover" :preview-src-list="info.album"/>
</div>
</view>
<gap/>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "factory",
data() {
return {
info: null
}
},
methods: {
async getInfo(userId) {
const {data} = await vk.callFunction({
url: 'client/factory/pub/getInfo',
data: {
userId
}
})
if (!data) {
this.$message.error('获取工厂信息失败')
setTimeout(() => {
vk.navigationBack()
}, 1000)
} else {
this.info = data
}
}
},
onLoad(options) {
if (options && options.userId) {
this.getInfo(options.userId)
}
}
}
</script>
+381 -259
View File
@@ -1,169 +1,232 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<view class="page-nav">
<el-breadcrumb separator=">">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/yellowPage/list">金久信黄页</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item class="text-main">{{ info.company.companyName }}</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="mt-40 bg-white company">
<view class="p-50 flex justify-between items-center pb-30 border-bottom">
<view class="flex justify-start items-center">
<image class="logo" :src="info.businessCard.logo" v-if="info.businessCard"/>
<view class="ml-35 flex flex-col justify-start items-start">
<text class="text-40 font-bold">{{ info.company.companyName }}</text>
<text class="text-gray text-28 mt-40" v-if="info.businessCard">主营业务:
{{ info.businessCard.mainBusiness }}
</text>
</view>
</view>
<view class="flex justify-end items-center">
<view class="flex flex-col justify-center items-center">
<view class="flex justify-center items-center">
<protect theme="filled" size="24" fill="#d0021b" strokeLinecap="square"/>
<view class="text-gray">平台累计交易</view>
</view>
<text class="text-main font-bold text-50">{{ info.transactionAmount }}</text>
</view>
<view class="flex flex-col justify-center items-center ml-35">
<view class="flex justify-center items-center">
<exchange-three theme="filled" size="24" fill="#d0021b" strokeLinecap="square"/>
<view class="text-gray">已缴纳交易保证金</view>
</view>
<text class="text-main font-bold text-50">{{ info.paidEnsure }}</text>
</view>
<view class="w-1200 m-a">
<view class="page-nav">
<el-breadcrumb separator=">">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/yellowPage/list">金久信黄页</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item class="text-main">{{ info.company.companyName }}</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="mt-40 bg-white company">
<view class="p-50 flex justify-between items-center pb-30 border-bottom">
<view class="flex justify-start items-center">
<image class="logo" :src="info.businessCard.logo" v-if="info.businessCard"/>
<view class="ml-35 flex flex-col justify-start items-start ">
<view class="flex justify-between items-center w-100p">
<text class="text-40 font-bold">{{ info.company.companyName }}</text>
<view class="flex justify-end items-start">
<view class="flex justify-center items-center">
<protect theme="filled" size="24" fill="#d0021b" strokeLinecap="square"/>
<view class="text-gray mx-15">平台累计交易</view>
</view>
<text class="text-main font-bold text-50">{{ info.transactionAmount.toFixed(2) }}</text>
<view class="flex justify-end items-start " v-if="info.paidEnsure && info.paidEnsure > 0" style="margin-left: 60rpx">
<view class="flex justify-center items-center">
<exchange-three theme="filled" size="24" fill="#d0021b" strokeLinecap="square"/>
<view class="text-gray mx-15">已缴纳交易保证金</view>
</view>
<text class="text-main font-bold text-50">{{ info.paidEnsure.toFixed(2) }}</text>
</view>
</view>
<view class="mt-30 p-40">
<view class="flex justify-between items-center mb-20">
<view class="title">企业简介</view>
<view class="mt-20" v-html="info.companyIntroduction"></view>
</view>
<view class="flex flex-col justify-start items-start mb-20">
<view class="title">联系我们</view>
<view class="mt-20 flex justify-start items-start flex-wrap w-100p text-30">
<view class="flex justify-start items-center w-33p mb-20">
<i class="el-icon-map-location mr-15"/>
<text v-if="info.manager">地址:{{ info.manager.address }}</text>
</view>
<view class="flex justify-start items-center w-33p mb-20">
<i class="el-icon-phone mr-15"/>
<text v-if="info.businessCard">电话:{{ info.businessCard.phone }}</text>
</view>
<view class="flex justify-start items-center w-33p mb-20">
<i class="el-icon-mobile mr-15"/>
<text v-if="info.businessCard">手机:{{ info.businessCard.mobile }}</text>
</view>
<view class="flex justify-start items-center w-33p">
<i class="el-icon-message mr-15"/>
<text v-if="info.businessCard">邮箱:{{ info.businessCard.email }}</text>
</view>
<view class="flex justify-start items-center w-33p">
<i class="el-icon-data-board mr-15"/>
<text v-if="info.businessCard">网址:{{ info.businessCard.website }}</text>
</view>
</view>
</view>
<view class="flex flex-col justify-start items-start mb-20">
<view class="title">发布的现货</view>
<view class="mt-20 bg-gray w-100p p-40" v-for="(item, index) in info.spotList" :key="index">
<view class="w-100p flex justify-between items-center">
<text class="font-bold text-40">{{ item.name }}</text>
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id)">查看详情
</el-button>
</view>
<view class="w-60p flex justify-between items-center text-main my-20">
<text>库存:{{ item.stock }}吨</text>
<text>供货地:{{ item.address.province.name }}-{{
item.address.city.name
}}-{{ item.address.area.name }}
</text>
</view>
<view class="w-60p flex justify-between items-center text-gray">
<view class="flex justify-start items-center">
<i class="el-icon-user"/>
<text>{{ info.company.companyName }}</text>
</view>
<text class="">{{ item._add_time_str }}发布</text>
</view>
</view>
<text class="text-gray text-28 mt-40" v-if="info.company.mainSpotCategory">
主营业务:{{ info.company.mainSpotCategory.join() }}
</text>
</view>
</view>
</view>
</view>
<view class="flex justify-between items-start mb-20">
<view class="title">发布的询价单</view>
<view class="text-main pointer" @click="vk.navigateTo('/pages/spot/goods/goods')">查看更多>
</view>
</view>
<view class="bg-gray-light flex justify-center items-center table-header p-20">
<view class="text-gray flex-1">品名/材质</view>
<view class="text-gray flex-1">采购量</view>
<view class="text-gray flex-1">收购地</view>
<view class="text-gray flex-1">采购企业</view>
<view class="text-gray flex-1">报价情况</view>
<view class="text-gray flex-1">发布时间</view>
<view class="text-gray flex-1">操作</view>
</view>
<view class="flex justify-center items-center mt-20 w-100p p-20"
v-for="(item, index) in info.enquiryList" :key="index">
<template v-if="item.productList && item.productList.length > 0 && JSON.stringify(item.productList[0]) !== '{}'">
<view class="text-main flex-1">{{ item.productList[0].goodsName }}</view>
<view class="flex-1">{{ item.productList[0].procureNumber }}{{
item.productList[0].procureUnit
}}
</view>
<view class="flex-1">{{ item.address }}</view>
<view class="flex-1">{{ info.company.companyName }}</view>
<view class="flex-1">{{ item.answerNumber }}家已报价</view>
<view class="flex-1">{{ item._add_time_str }}</view>
<view class="flex-1">
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="vk.navigateTo('/pages/enquiry/detail?id=' + item._id);">查看
</el-button>
</view>
</template>
</view>
<view class="flex justify-between items-start mb-20">
<view class="title">发布的加工单</view>
<view class="text-main" @click="vk.navigateTo('/pages/process/list')">查看更多></view>
</view>
<view class="bg-gray-light flex justify-center items-center table-header p-20">
<view class="text-gray flex-1">品名/材质</view>
<view class="text-gray flex-1">加工量</view>
<!-- <view class="text-gray flex-1">收购地</view>-->
<view class="text-gray flex-1">采购企业</view>
<view class="text-gray flex-1">报价情况</view>
<view class="text-gray flex-1">发布时间</view>
<view class="text-gray flex-1">操作</view>
</view>
<view class="flex justify-center items-center mt-20 w-100p p-20"
v-for="(item, index) in info.processList" :key="index">
<view class="text-main flex-1">{{ item.title }}</view>
<!-- <view class="flex-1">{{ item.address }}</view>-->
<view class="flex-1">{{ item.num }}</view>
<view class="flex-1">{{ info.company.companyName }}</view>
<view class="flex-1">{{ item.answerNumber }}家已报价</view>
<view class="flex-1">{{ item._add_time_str }}</view>
<view class="flex-1">
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="toProcessDetail(row._id)">查看
</el-button>
</view>
</view>
</view>
</view>
</view>
<gap/>
<common-footer></common-footer>
<view class="mt-30 p-40" v-if="info">
<el-carousel height="300px`" :style="{width: '100%'}" class="m-a"
v-if="info.businessCard && info.businessCard.album">
<template v-if="Array.isArray(info.businessCard.album)">
<el-carousel-item v-for="(item, index) in info.businessCard.album" :key="index"
:style="{width: '100%'}">
<el-image :src="item" fit="cover" :style="{width: '100%'}"/>
</el-carousel-item>
</template>
<el-carousel-item v-else :style="{width: '100%'}">
<el-image :src="info.businessCard.album" fit="cover" :style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
<view class="flex flex-col justify-start items-start mb-20">
<view class="title">企业简介</view>
<view class="mt-20" v-if="info.businessCard && info.businessCard.companyIntroduction"
v-html="info.businessCard.companyIntroduction"></view>
<text v-else>商家暂未填写</text>
</view>
<view class="flex flex-col justify-start items-start mb-20"
v-if="info.businessCard && info.businessCard.video">
<view class="title">企业视频</view>
<video :src="info.businessCard.video" autoplay controls style="width: 100%"/>
</view>
<view class="flex flex-col justify-start items-start mb-20"
v-if="info.businessCard && info.businessCard.productImageList">
<view class="title">产品展示</view>
<view class="flex justify-start items-start flex-wrap">
<el-image :preview-src-list="info.businessCard.productImageList" :src="item"
v-for="(item, index) in info.businessCard.productImageList"
:key="index" fit="cover"
:style="{margin: (index !== 0 && (index + 1) % 5 === 0) ? '0 0 21px 0' : '0 21px 21px 0'}"
style="width: 215px; height: 215px;"/>
</view>
</view>
<view class="flex flex-col justify-start items-start mb-20"
v-if="info.businessCard && info.businessCard.exampleImageList">
<view class="title">案例展示</view>
<view class="flex justify-start items-start flex-wrap">
<el-image :preview-src-list="info.businessCard.exampleImageList" :src="item"
v-for="(item, index) in info.businessCard.exampleImageList"
:style="{margin: (index !== 0 && (index + 1) % 5 === 0) ? '0 0 21px 0' : '0 21px 21px 0'}"
:key="index" fit="cover"
style="width: 215px; height: 215px;"/>
</view>
</view>
<view class="flex flex-col justify-start items-start mb-20"
v-if="info.businessCard && info.businessCard.longitude">
<view class="title">地图定位</view>
<view class="mapDiv">
<tdt-map :center="[info.businessCard.longitude, info.businessCard.latitude]" :zoom="12">
<tdt-marker :position="[info.businessCard.longitude, info.businessCard.latitude]"
:draggable="false"/>
</tdt-map>
</view>
</view>
<view class="flex flex-col justify-start items-start mb-20"
v-if="userArticle.length > 0">
<view class="title">新闻动态</view>
<view class="flex justify-start items-start flex-col w-100p">
<view class="flex justify-between items-center pointer w-100p mb-25"
@click="showArticle(index)"
v-for="(item, index) in userArticle" :key="index">
<text>{{ item.title }}</text>
<text class="text-gray">{{ item._add_time_str }}</text>
</view>
</view>
</view>
<view class="flex flex-col justify-start items-start mb-20">
<view class="title">联系我们</view>
<view class="mt-20 flex justify-start items-start flex-wrap w-100p text-30">
<view class="flex justify-start items-center w-50p mb-20">
<i class="el-icon-map-location mr-15"/>
<text class="content" v-if="info.company.addressRegion">地址:{{
info.company.addressRegion.province.name
}}{{ info.company.addressRegion.city.name }}{{
info.company.addressRegion.area.name
}}{{ info.company.addressDetail }}
</text>
</view>
<view class="flex justify-start items-center w-25p mb-20">
<i class="el-icon-phone mr-15"/>
<text class="content" v-if="info.businessCard">电话:{{
info.businessCard.companyMobile ? info.businessCard.companyMobile : '商家暂未填写'
}}
</text>
</view>
<view class="flex justify-start items-center w-25p mb-20">
<i class="el-icon-mobile mr-15"/>
<text class="content" v-if="info.manager">手机:{{
info.manager.mobile ? info.manager.mobile : '商家暂未填写'
}}
</text>
</view>
<view class="flex justify-start items-center w-33p">
<i class="el-icon-message mr-15"/>
<text class="content" v-if="info.businessCard">邮箱:{{
info.businessCard.email ? info.businessCard.email : '商家暂未填写'
}}
</text>
</view>
<view class="flex justify-start items-center w-33p" v-if="info.userLevel > 1">
<i class="el-icon-data-board mr-15"/>
<text class="content" v-if="info.businessCard">网址:{{
info.businessCard.website ? info.businessCard.website : '商家暂未填写'
}}
</text>
</view>
</view>
</view>
<template v-if="parseInt(info.userLevel) > 0">
<view class="flex flex-col justify-start items-start mb-20">
<view class="title">发布的现货</view>
<view class="mt-20 spot-bg w-100p p-40" v-if="info.spotList">
<view class="w-100p flex justify-between items-center">
<text class="font-bold text-40">{{ info.spotList.name }}</text>
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="vk.navigateTo('/pages/spot/goods/detail?id=' + info.spotList._id)">
查看详情
</el-button>
</view>
<view class="w-60p flex justify-between items-center text-main my-20">
<text>库存:{{ info.spotList.stock }}吨</text>
<text
v-if="info.spotList.address && info.spotList.address.province && info.spotList.address.area && info.spotList.address.area ">
供货地:{{ info.spotList.address.province.name }}-{{
info.spotList.address.city.name
}}-{{ info.spotList.address.area.name }}
</text>
</view>
<view class="w-60p flex justify-between items-center text-gray">
<view class="flex justify-start items-center">
<i class="el-icon-user"/>
<text>{{ info.company.companyName }}</text>
</view>
<text class="">{{ info.spotList._add_time_str }}发布</text>
</view>
</view>
</view>
<view class="flex justify-between items-center mb-20">
<view class="title">发布的询价单</view>
<!-- <view class="text-main pointer" @click="vk.navigateTo('/pages/spot/goods/goods')">查看更多>-->
<view class="text-main pointer" v-if="info.enquiryList.length > 5" @click="showAllEnquiry = true">查看更多>
</view>
</view>
<enquiry :info="info" :limit="5"/>
<view class="flex justify-between items-center mb-20">
<view class="title">发布的加工单</view>
<!-- <view class="text-main pointer" @click="vk.navigateTo('/pages/process/list')">查看更多>-->
<view class="text-main pointer" v-if="info.processList.length > 5" @click="showAllProcess = true">查看更多>
</view>
</view>
<process :info="info" :limit="5"/>
</template>
</view>
</view>
</view>
<gap/>
<common-footer></common-footer>
<el-dialog v-if="articleIndex > -1 && dialogVisible"
title="新闻动态"
:visible.sync="dialogVisible"
width="70%">
<p class="text-35 font-bold pb-20">{{ userArticle[articleIndex].title }}</p>
<p class="text-gray text-28 pb-20 border-bottom">{{ userArticle[articleIndex]._add_time_str }}</p>
<div v-html="userArticle[articleIndex].content" class="pt-20"></div>
<div slot="footer">
<el-button @click="dialogVisible = false">关 闭</el-button>
</div>
</el-dialog>
<el-dialog v-if="showAllEnquiry"
title="全部询价单"
:visible.sync="showAllEnquiry"
width="70%">
<enquiry :info="info"/>
</el-dialog>
<el-dialog v-if="showAllProcess"
title="全部加工单"
:visible.sync="showAllProcess"
width="70%">
<process :info="info"/>
</el-dialog>
</view>
</template>
<script>
@@ -172,117 +235,176 @@ import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import Gap from "../../components/gap/gap.vue";
import Enquiry from "@/pages/yellowPage/components/enquiry.vue";
import Process from "@/pages/yellowPage/components/process.vue";
export default {
name: "info",
components: {Gap, Protect, ExchangeThree},
data() {
return {
id: null,
provinceData: provinces,
cityData: citys,
areaData: areas,
info: {
transactionAmount: 0,
paidEnsure: 0,
spotList: [],
enquiryList: [],
processList: [],
},
}
},
methods: {
getInfo() {
vk.callFunction({
url: "client/user/pub/getDetail",
data: {
_id: this.id
},
success: (res) => {
this.info = res.data
this.info.enquiryList.map(val => {
let str = ''
if (val.productList.length > 0 && val.productList[0].addressRegion.length > 0) {
let provinceIndex = 0, cityIndex = 0, areaIndex = 0
this.provinceData.forEach((item, index) => {
if (parseInt(val.productList[0].addressRegion[0]) === parseInt(item.code)) {
provinceIndex = index
str = item.name
}
})
this.cityData[provinceIndex].forEach((item, index) => {
if (parseInt(val.productList[0].addressRegion[1]) === parseInt(item.code)) {
cityIndex = index
str += item.name
}
})
this.areaData[provinceIndex][cityIndex].forEach((item, index) => {
if (parseInt(val.productList[0].addressRegion[2]) === parseInt(item.code)) {
areaIndex = index
str += item.name
}
})
str += val.productList[0].addressDetail
}
val.address = str
return val
})
}
});
},
async toProcessDetail(id) {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
vk.navigateTo({
url: `/pages/process/detail?id=${id}`
})
}
},
},
onLoad(option) {
if (option.id) {
this.id = option.id
this.getInfo()
name: "info",
components: {Process, Enquiry, Gap, Protect, ExchangeThree},
data() {
return {
id: null,
provinceData: provinces,
cityData: citys,
areaData: areas,
info: {
transactionAmount: 0,
paidEnsure: 0,
spotList: [],
enquiryList: [],
processList: [],
company: {
companyName: ''
}
},
allChildCate: [],
userArticle: [],
articleIndex: -1,
dialogVisible: false,
showAllEnquiry: false,
showAllProcess: false,
}
},
methods: {
getCategoryTreeData() {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.allChildCate = []
data.rows.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
this.getInfo()
}
});
},
getUserArticle() {
vk.callFunction({
url: 'client/userArticle/pub/getList',
title: '请求中...',
data: {
userId: this.id
},
success: (data) => {
this.userArticle = data.rows
}
});
},
getInfo() {
vk.callFunction({
url: "client/user/pub/getDetail",
data: {
_id: this.id
},
success: (res) => {
this.info = res.data
this.info.company.mainSpotCategory = []
if (this.info.company && this.info.company.mainSpotCategoryIds) {
this.allChildCate.forEach(child => {
if (this.info.company.mainSpotCategoryIds.includes(child._id)) {
this.info.company.mainSpotCategory.push(child.name)
}
})
}
this.info.enquiryList.map(val => {
let str = ''
if (val.addressRegion && val.addressRegion.area) {
str = val.addressRegion.province.name + val.addressRegion.city.name + val.addressRegion.area.name
}
if (val.addressDetail) str += val.addressDetail
val.address = str
return val
})
}
});
},
async toProcessDetail(id) {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
vk.navigateTo({
url: `/pages/process/detail?id=${id}`
})
}
},
showArticle(index) {
this.articleIndex = index
this.dialogVisible = true
this.$nextTick(() => {
// 获取所有的img元素
var imgElements = document.getElementsByTagName('img');
// 遍历img元素数组
for (var i = 0; i < imgElements.length; i++) {
// 添加style属性,并设置width为100%
imgElements[i].style.width = '100%';
}
})
}
},
onLoad(option) {
if (option.id) {
this.id = option.id
this.getCategoryTreeData()
this.getUserArticle()
}
}
}
</script>
<style lang="scss" scoped>
.company {
.logo {
width: 100px;
height: 100px;
}
.logo {
width: 100px;
height: 100px;
}
.title {
font-size: 16px;
padding-left: 5px;
border-left: 3px solid #d0021b;
color: #d0021b;
}
.title {
font-weight: bold;
font-size: 16px;
padding-left: 5px;
border-left: 3px solid #d0021b;
color: #d0021b;
margin: 20px 0;
}
.table-header {
border-top: 8px solid #F4F4F4;
}
.table-header {
border-top: 8px solid #F4F4F4;
}
.content {
color: #555;
}
}
.spot-bg {
background-color: #F9F9F9;
}
.mapDiv {
width: 100%;
height: 300px;
}
</style>
+569 -290
View File
@@ -1,171 +1,253 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
</view>
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词:" class="border-bottom pb-30">
<el-input @keyup.enter.native="getCompany()" clearable placeholder="输入关键字搜索"
v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-getCompany"></i>
<el-button @click="getCompany()" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="行业类型:" class="border-bottom pb-30">
</el-form-item>
<el-form-item label="分类:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="clickedCateIndex = index" class="pointer mr-25"
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']"
v-if="index < 10">
{{ item.name }}
</text>
</view>
</view>
<view class="child-cate flex justify-start items-center flex-wrap" v-if="clickedCateIndex !== null">
<template v-if="clickedCateIndex === -1">
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in allChildCate" :key="index">{{ item.name }}
</text>
</template>
<template v-else>
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">
{{ item.name }}
</text>
</template>
</view>
</el-form-item>
<el-form-item label="城市" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
</text>
<view v-for="(item, index) in provinceData" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectProvince(item.code)"
:class="[checkProvinceList.includes(item.code)? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllProvince">
{{ item.name }}
</text>
</view>
<text @click="showAllProvince = !showAllProvince" class="pointer mr-25">查看更多
</text>
</view>
</el-form-item>
<el-form-item label="已选择">
<view class="tags">
<el-tag v-for="(item, index) in checkCategoryArr" :key="index">{{ item.name }}</el-tag>
</view>
</el-form-item>
</el-form>
</view>
<view class="w-1200 flex justify-start items-start flex-wrap m-a">
<view v-for="(item, index) in companyList" :key="index" class="w-50p company-item">
<view class="p-40">
<view class="rounded shadow p-50 bg-white flex flex-col justify-start items-start">
<view class="flex justify-end w-100p">
<image class="authed" src="/static/images/authed.png" mode="aspectFit"
v-if="item.authStatus === 1"/>
<gap height="40" v-else/>
</view>
<view class="flex justify-start items-center">
<image :src="item.businessCard.logo" class="logo" v-if="item.businessCard"
mode="aspectFill"/>
<image v-else src="/static/images/no-logo.jpg" class="logo" mode="aspectFill"/>
<view class="ml-35 flex flex-col justify-start items-start">
<text>{{ item.name }}</text>
<i class="el-icon-star-off text-main my-20"/>
<view class="flex justify-start items-center">
<i class="el-icon-user"/>
<text class="ml-10" v-if="item.manager">{{ item.manager.personName }}</text>
<text class="ml-20 text-28" v-if="item.businessCard">{{
item.businessCard.position
}}
</text>
</view>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-map-location mr-15"/>
<view class="flex-col justify-start items-center">
<text>地址:</text>
<text
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
}}
</text>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-phone mr-15"/>
<view class="flex-col justify-start items-center">
<text>电话:</text>
<text v-if="item.businessCard">{{ item.company.companyMobile }}</text>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-mobile mr-15"/>
<view class="flex-col justify-start items-center">
<text>手机:</text>
<text v-if="item.businessCard">{{ item.businessCard.managerMobile }}</text>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-message mr-15"/>
<view class="flex-col justify-start items-center">
<text>邮箱:</text>
<text v-if="item.businessCard">{{ item.businessCard.email }}</text>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-data-board mr-15"/>
<view class="flex-col justify-start items-center">
<text>网址:</text>
<text v-if="item.businessCard">{{ item.businessCard.website }}</text>
</view>
</view>
<view class="flex justify-between items-center w-100p">
<view class="flex justify-start items-center mt-20">
<text class="text-main">主营业务:</text>
<text v-if="item.businessCard">{{ item.businessCard.mainBusiness }}</text>
</view>
<el-button type="primary" @click="showInfo(item._id)">查看详情</el-button>
</view>
</view>
</view>
</view>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
<view class="carousel">
<el-carousel height="500px">
<common-swiper page="yellowPage"/>
</el-carousel>
</view>
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词:" class="border-bottom pb-30">
<el-input @keyup.enter.native="search()" clearable placeholder="输入关键字搜索"
v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-getCompany"></i>
<el-button @click="search()" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<!-- <el-form-item label="行业类型:" class="border-bottom pb-30">-->
<!-- </el-form-item>-->
<el-form-item label="主营类目:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="clickedCateIndex = index" class="pointer mr-25"
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']"
v-if="index < 10">
{{ item.name }}
</text>
</view>
</view>
<view class="child-cate flex justify-start items-center flex-wrap" v-if="clickedCateIndex !== null">
<template v-if="clickedCateIndex === -1">
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in allChildCate" :key="index">{{ item.name }}
</text>
</template>
<template v-else>
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">
{{ item.name }}
</text>
</template>
</view>
</el-form-item>
<el-form-item label="行业分类" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectIndustry(-1)" class="pointer mr-25 flex-grow-0"
:class="[selectedIndustryList.length === 0 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in industryList" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectIndustry(item.name)"
:class="[selectedIndustryList.includes(item.name)? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllIndustry">
{{ item.name }}
</text>
</view>
<!-- <text @click="showAllIndustry = !showAllIndustry" class="pointer mr-25">查看更多-->
<!-- </text>-->
</view>
</el-form-item>
<el-form-item label="城市" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
</text>
<view v-for="(item, index) in provinceData" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectProvince(item.code)"
:class="[checkProvinceList.includes(item.code)? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllProvince">
{{ item.name }}
</text>
</view>
<!-- <text @click="showAllProvince = !showAllProvince" class="pointer mr-25">查看更多-->
<!-- </text>-->
</view>
</el-form-item>
<!-- <el-form-item label="其他" class="border-bottom pb-30">-->
<!-- <el-checkbox v-model="factoryFilter" @change="factoryFilterChange">筛选加工商</el-checkbox>-->
<!-- </el-form-item>-->
<el-form-item label="已选择">
<view class="tags">
<el-tag v-for="(item, index) in checkCategoryArr" :key="index">{{ item.name }}</el-tag>
</view>
</el-form-item>
</el-form>
</view>
<view class="w-1200 flex justify-start items-start flex-wrap m-a">
<view v-for="(item, index) in companyList.filter((_, i) => hasAuth ? true : i < 6)" :key="index"
class="w-50p company-item">
<view class="p-40">
<view class="rounded shadow p-50 bg-white flex flex-col justify-start items-start"
style="height: 900rpx">
<view class="flex justify-end w-100p">
<image class="authed" src="/static/images/authed.png" mode="aspectFit"
v-if="item.authStatus === 1"/>
<gap height="40" v-else/>
</view>
<view class="flex justify-start items-center">
<image :src="item.businessCard.logo" class="logo" v-if="item.businessCard"
mode="aspectFill"/>
<image v-else src="/static/images/no-logo.jpg" class="logo" mode="aspectFill"/>
<view class="ml-35 flex flex-col justify-start items-start">
<div class="flex justify-start items-center font-bold">
<text>{{ item.name }}</text>
<!-- <text v-if="item.factoryStatus === 1" class="text-main">[加工商]</text>-->
<i class="el-icon-star-off text-main ml-20"/>
</div>
<view class="flex justify-start items-center">
<i class="el-icon-user"/>
<text class="ml-10" v-if="item.manager">{{ item.manager.personName }}</text>
<text class="ml-20 text-28" v-if="item.businessCard">{{
item.businessCard.position
}}
</text>
</view>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-map-location mr-15"/>
<view class="flex-col justify-start items-center">
<text>地址:</text>
<text
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
}}
</text>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<view class="flex justify-start items-center ">
<i class="el-icon-mobile mr-15"/>
<view class="flex-col justify-start items-center">
<text>手机:</text>
<text v-if="item.manager">{{
item.manager.mobile ? item.manager.mobile : '商家暂未填写'
}}
</text>
</view>
</view>
<view class="flex justify-start items-center ml-25">
<i class="el-icon-phone mr-15"/>
<view class="flex-col justify-start items-center">
<text>电话:</text>
<text v-if="item.businessCard">{{
item.businessCard.companyMobile ? item.businessCard.companyMobile : '商家暂未填写'
}}
</text>
</view>
</view>
</view>
<view class="mt-20 flex justify-between items-center w-100p">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center ">
<i class="el-icon-message mr-15"/>
<view class="flex-col justify-start items-center">
<text>邮箱:</text>
<text v-if="item.businessCard">
{{ item.businessCard.email ? item.businessCard.email : '商家暂未填写' }}
</text>
</view>
</view>
<view class="flex justify-start items-center mt-20" v-if="item.userLevel > 1">
<i class="el-icon-data-board mr-15"/>
<view class="flex-col justify-start items-center">
<text>网址:</text>
<text v-if="item.businessCard">
{{ item.businessCard.website ? item.businessCard.website : '商家暂未填写' }}
</text>
</view>
</view>
</view>
<el-image v-if="item.businessCard && item.businessCard.companyWechat"
:src="item.businessCard.companyWechat" class="wechat" fix="cover"/>
</view>
<view class="flex justify-between items-center w-100p">
<view class="flex justify-start items-center mt-20">
<text class="text-main" style="width: 140rpx">主营业务:</text>
<text class="ml-20 flex-1">{{ item.mainSpotCategory.join() }}</text>
</view>
</view>
<view class="flex justify-end items-center w-100p">
<!-- <el-button type="primary" plain @click="showFactoryInfo(item._id)"-->
<!-- v-if="item.factoryStatus === 1">查看加工商详情-->
<!-- </el-button>-->
<el-button type="primary" @click="showInfo(item._id)">查看详情</el-button>
</view>
</view>
</view>
</view>
</view>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad23.length">
<el-carousel :height="`100px`" :style="{width: ad24.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad23" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad24.length">
<el-carousel :height="`100px`" :style="{width: ad23.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad24" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad25.length">
<el-carousel :height="`100px`" :style="{width: ad26.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad25" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad26.length">
<el-carousel :height="`100px`" :style="{width: ad25.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad26" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</template>
<script>
@@ -173,170 +255,367 @@ import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import Gap from "../../components/gap/gap.vue";
export default {
name: "list",
components: {Gap},
data() {
return {
categoryTreeData: [],
allChildCate: [],
clickedCateIndex: null,
checkCategoryList: [],
keyword: '',
provinceData: provinces,
checkProvinceList: [],
showAllProvince: false,
companyList: []
}
},
methods: {
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)
})
})
}
});
},
selectCate(id) {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) this.checkCategoryList.push(id)
else this.checkCategoryList.splice(index, 1)
this.getCompany()
},
selectProvince(code) {
if (code === -1) this.checkProvinceList = []
else {
const index = this.checkProvinceList.indexOf(code)
if (index === -1) this.checkProvinceList.push(code)
else this.checkProvinceList.splice(index, 1)
}
this.getCompany()
},
getCompany() {
vk.callFunction({
url: 'client/user/pub/getCompany',
title: '请求中...',
data: {
province: this.checkProvinceList,
keyword: this.keyword,
mainSpotCategoryIds: this.checkCategoryList,
},
success: (data) => {
this.companyList = data.rows.map(item => {
item.name = item.company.companyName
return item
})
}
});
},
showInfo(id) {
vk.navigateTo({
url: `/pages/yellowPage/info?id=${id}`
})
}
},
onShow() {
this.getCategoryTreeData()
this.getCompany()
},
computed: {
checkCategoryArr() {
const arr = []
this.allChildCate.forEach(item => {
if (this.checkCategoryList.includes(item._id)) arr.push(item)
})
this.provinceData.forEach(item => {
if (this.checkProvinceList.includes(item.code)) {
arr.push(item)
}
})
return arr
}
name: "list",
components: {Gap},
data() {
return {
categoryTreeData: [],
allChildCate: [],
clickedCateIndex: -1,
checkCategoryList: [],
keyword: '',
provinceData: provinces,
checkProvinceList: [],
showAllProvince: true,
companyList: [],
factoryFilter: false,
industryList: [],
selectedIndustryList: [],
showAllIndustry: true,
ad23: [],
ad24: [],
ad25: [],
ad26: [],
hasAuth: true
}
},
methods: {
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()
}
});
},
selectCate(id) {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) this.checkCategoryList = [id]
else this.checkCategoryList = []
this.getCompany()
},
selectProvince(code) {
if (code === -1) this.checkProvinceList = []
else {
// const index = this.checkProvinceList.indexOf(code)
// if (index === -1) this.checkProvinceList.push(code)
// else this.checkProvinceList.splice(index, 1)
this.checkProvinceList = [code]
}
this.getCompany()
},
selectIndustry(name) {
if (name === -1) this.selectedIndustryList = []
else {
const index = this.selectedIndustryList.indexOf(name)
if (index === -1) this.selectedIndustryList = [name]
else this.selectedIndustryList = []
}
this.getCompany()
},
search() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm') || [-1, 2].includes(vk.getVuex('$user.userInfo.authStatus'))) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else {
this.getCompany()
}
},
getCompany() {
vk.callFunction({
url: 'client/user/pub/getCompany',
title: '请求中...',
data: {
province: this.checkProvinceList,
keyword: this.keyword,
mainSpotCategoryIds: this.checkCategoryList,
showInYellow: 1,
// factoryFilter: this.factoryFilter,
industryList: this.selectedIndustryList
},
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
})
this.getAd23()
this.getAd24()
this.getAd25()
this.getAd26()
}
});
},
showInfo(id) {
vk.navigateTo({
url: `/pages/yellowPage/info?id=${id}`
})
},
showFactoryInfo(id) {
vk.navigateTo({
url: `/pages/yellowPage/factory?userId=${id}`
})
},
factoryFilterChange(val) {
this.factoryFilter = val
this.getCompany()
},
async getIndustryList() {
const {rows} = await vk.callFunction({
url: 'client/industry/pub/getList'
})
this.industryList = rows
},
async getAd23() {
this.ad23 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 23,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad23 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 1,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad23.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd24() {
this.ad24 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 24,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad24 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 2,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad24.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd25() {
this.ad25 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 25,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad25 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 3,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad25.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd26() {
this.ad26 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 26,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad26 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 4,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad26.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
},
onShow() {
this.getCategoryTreeData()
this.getIndustryList()
this.hasAuth = (vk.getVuex('$user.userInfo.fadadaConfirm') && vk.getVuex('$user.userInfo.authStatus') === 1)
},
computed: {
checkCategoryArr() {
const arr = []
this.allChildCate.forEach(item => {
if (this.checkCategoryList.includes(item._id)) arr.push(item)
})
this.provinceData.forEach(item => {
if (this.checkProvinceList.includes(item.code)) {
arr.push(item)
}
})
this.selectedIndustryList.forEach(item => {
arr.push({name: item})
})
return arr
}
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
display: flex;
.el-tag {
margin-right: 10px;
}
.el-tag {
margin-right: 10px;
}
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
.post-btn {
background: none;
background: none;
}
.post-btn:hover {
background: #f6eae9;
color: #A92924;
background: #f6eae9;
color: #A92924;
}
.selected-cate {
border-bottom: 2px solid #BD3124;
line-height: 40rpx;
border-bottom: 2px solid #BD3124;
line-height: 40rpx;
}
.child-cate {
background-color: #DB8382;
color: white;
margin-top: 10rpx;
border-radius: 15rpx;
padding: 0 20rpx;
background-color: #DB8382;
color: white;
margin-top: 10rpx;
border-radius: 15rpx;
padding: 0 20rpx;
}
.company-item {
font-size: 16px;
font-size: 16px;
.authed {
height: 40px;
width: 60px;
}
.authed {
height: 40px;
width: 60px;
}
.logo {
width: 100px;
height: 100px;
}
.logo {
width: 100px;
height: 100px;
}
}
.wechat {
width: 60px;
height: 60px;
}
</style>