603 lines
18 KiB
Vue
603 lines
18 KiB
Vue
<template>
|
|
<view>
|
|
<top-bar></top-bar>
|
|
<common-header></common-header>
|
|
<category-bar></category-bar>
|
|
|
|
<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/index/process/list">找加工</navigator>
|
|
</el-breadcrumb-item>
|
|
<el-breadcrumb-item class="text-main">加工厂列表</el-breadcrumb-item>
|
|
</el-breadcrumb>
|
|
<el-row class="">
|
|
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
|
|
<el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>
|
|
</el-row>
|
|
</view>
|
|
<view class="w-1200 m-a">
|
|
<common-swiper page="factory"/>
|
|
</view>
|
|
<!-- 筛选表单 -->
|
|
<view class="w-1200 m-a" style="margin-top: 30rpx">
|
|
<el-form @submit.native.prevent label-width="80px">
|
|
<el-form-item label="关键词:" class="border-bottom pb-30">
|
|
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
|
|
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
|
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
|
|
</el-button>
|
|
</el-input>
|
|
</el-form-item>
|
|
<el-form-item label="分类:" class="border-bottom pb-30">
|
|
<view class="flex justify-start items-center flex-wrap">
|
|
<text @click="selectCate({name: -1})" class="pointer mr-25"
|
|
:class="[(checkCategoryList.includes(-1) || checkCategoryList.length === 0) ? 'text-main selected-cate' : '']">全部
|
|
</text>
|
|
<view v-for="(item, index) in categoryTreeData" :key="index">
|
|
<text @click="selectCate(item)" class="pointer mr-25"
|
|
:class="[checkCategoryList.includes(item.name) ? 'text-main selected-cate' : '']">
|
|
{{ item.name }}
|
|
</text>
|
|
</view>
|
|
</view>
|
|
</el-form-item>
|
|
<el-form-item label="地区" class="border-bottom pb-30">
|
|
<el-cascader :options="areaOptions"
|
|
:props="{label: 'name', value: 'code', checkStrictly: true}"
|
|
v-model="area"
|
|
clearable
|
|
style="width: 300px;"
|
|
@change="selectArea"/>
|
|
</el-form-item>
|
|
</el-form>
|
|
</view>
|
|
<div class="flex justify-between items-center w-1200 m-a">
|
|
<template v-if="ad12.length">
|
|
<el-carousel :height="`100px`" :style="{width: '100%'}" class="m-a">
|
|
<el-carousel-item v-for="(item, index) in ad12" :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="ad122.length">
|
|
<el-carousel :height="`100px`" :style="{width: '100%'}" class="m-a">
|
|
<el-carousel-item v-for="(item, index) in ad122" :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>
|
|
<!-- 商品列表 -->
|
|
<view class="goods-list">
|
|
<view v-for="(item, index) in list.rows" :key="index" class="goods">
|
|
<view class="goods-info" @click="navTo(`/pages/yellowPage/factory?userId=${item.uid}`)">
|
|
<!-- <el-image src="https://oss.wsdns.cn/20231204/d35332fa6a3b4596b522edf9527ac612.png"-->
|
|
<!-- class="goods-img"/>-->
|
|
<view class="info">
|
|
<view class="field">
|
|
<view class="desc" style="width: 1000px">
|
|
<view class="text">加工主体</view>
|
|
<view class="font-bold" v-if="item.user">{{
|
|
item.user.accountType === 2 ? item.user.company.companyName : item.user.person.personName
|
|
}}
|
|
</view>
|
|
</view>
|
|
<view class="desc">
|
|
<view class="text">所在地区</view>
|
|
<view>{{ item.addressRegion.province.name }}{{ item.addressRegion.city.name }}</view>
|
|
</view>
|
|
<view class="desc">
|
|
<view class="text">成立年限</view>
|
|
<view>{{ item.year }}年</view>
|
|
</view>
|
|
<view class="desc">
|
|
<view class="text">年产值</view>
|
|
<view>{{ item.yearsIncome }}万元</view>
|
|
</view>
|
|
<view class="desc">
|
|
<view class="text">员工人数</view>
|
|
<view>{{ item.employeeNum }}人</view>
|
|
</view>
|
|
<view class="desc">
|
|
<view class="text">流水线数量</view>
|
|
<view>{{ item.flowNum }}条</view>
|
|
</view>
|
|
<view class="desc">
|
|
<view class="text">厂房归属</view>
|
|
<view>{{ item.blongTo }}</view>
|
|
</view>
|
|
<view class="desc">
|
|
<view class="text">厂房面积</view>
|
|
<view>{{ item.size }}㎡</view>
|
|
</view>
|
|
<view class="desc">
|
|
<view class="text">服务信息</view>
|
|
<view>{{ item.serviceInfo }}</view>
|
|
</view>
|
|
<view class="desc" v-if="item.mainSpotCategory && item.mainSpotCategory.length > 0">
|
|
<view class="text">主营类别</view>
|
|
<view>{{ item.mainSpotCategory.join() }}</view>
|
|
</view>
|
|
<view class="desc">
|
|
<view class="text">主营工艺和业务范围</view>
|
|
<view>{{ item.mainProcess }}</view>
|
|
</view>
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="buttons">
|
|
<button type="default" class="btn" plain @click="doShowContract(index)">查看电话
|
|
</button>
|
|
<button type="default" class="btn green mt-20" plain @click="doShowWechat(index)">添加微信
|
|
</button>
|
|
<button type="default" class="btn mt-20" plain @click="navTo(`/pages/yellowPage/factory?userId=${item.uid}`)">
|
|
查看详情
|
|
</button>
|
|
<view class="wechat"
|
|
v-if="item.user && parseInt(item.user.accountType) === 2 && item.user.businessCard && item.user.businessCard.companyWechat && item.showWechat">
|
|
<el-image :src="item.user.businessCard.companyWechat" style="width: 100%; height: 100%"/>
|
|
</view>
|
|
<view class="wechat"
|
|
v-if="item.user && parseInt(item.user.accountType) === 1 && item.user.businessCard && item.user.businessCard.personalWechat && item.showWechat">
|
|
<el-image :src="item.user.businessCard.personalWechat" style="width: 100%; height: 100%"/>
|
|
</view>
|
|
<view class="mobile" v-if="item.user && item.showContract && item.user.businessCard">
|
|
<i class="el-icon-phone"></i>
|
|
<text class="ml-20">{{
|
|
(item.user.businessCard && item.user.businessCard.companyMobile) ? item.user.businessCard.companyMobile : '暂无电话'
|
|
}}
|
|
</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="paginatio">
|
|
<el-pagination @current-change="search" background layout="prev, pager, next" :total="list.total"
|
|
:page-size="pageSize">
|
|
</el-pagination>
|
|
</view>
|
|
</view>
|
|
<common-footer></common-footer>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
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 dayjs from "dayjs";
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
checkCategoryList: [],
|
|
clickedCateIndex: -1,
|
|
provinceData: provinces,
|
|
cityData: citys,
|
|
areaData: areas,
|
|
areaOptions: [],
|
|
area: [],
|
|
checkProvinceList: [],
|
|
keyword: '',
|
|
list: {
|
|
total: 0,
|
|
rows: []
|
|
},
|
|
showAllProvince: false,
|
|
type: 0,
|
|
pageSize: 20,
|
|
ad12: [],
|
|
ad122: [],
|
|
categoryTreeData: [],
|
|
};
|
|
},
|
|
onLoad(option) {
|
|
if (option.type) this.type = option.type
|
|
this.areaOptions = provinces.map(item => {
|
|
item.children = [];
|
|
return item
|
|
})
|
|
this.areaOptions.forEach((province, index) => {
|
|
citys[index].forEach(city => {
|
|
city.children = []
|
|
this.areaOptions[index].children.push(city)
|
|
})
|
|
})
|
|
this.areaOptions.forEach((province, index) => {
|
|
province.children.forEach((city, cityIndex) => {
|
|
this.areaOptions[index].children[cityIndex].children.push(...areas[index][cityIndex])
|
|
})
|
|
})
|
|
vk.callFunction({
|
|
url: 'client/process/category/pub/getTree',
|
|
title: '请求中...',
|
|
success: (data) => {
|
|
this.categoryTreeData = data.rows
|
|
this.allChildCate = []
|
|
this.categoryTreeData.forEach(item => {
|
|
item.children.forEach(child => {
|
|
this.allChildCate.push(child)
|
|
})
|
|
})
|
|
}
|
|
});
|
|
},
|
|
onShow() {
|
|
this.search(1)
|
|
},
|
|
methods: {
|
|
navTo(url) {
|
|
vk.navigateTo({
|
|
url
|
|
})
|
|
},
|
|
selectCate({name}) {
|
|
if (name === -1) this.checkCategoryList = []
|
|
const index = this.checkCategoryList.indexOf(name)
|
|
if (index === -1) {
|
|
this.checkCategoryList = [name]
|
|
} else {
|
|
this.checkCategoryList = []
|
|
}
|
|
console.log(this.checkCategoryList)
|
|
this.search(1)
|
|
},
|
|
selectProvince(code) {
|
|
if (code === -1) this.checkProvinceList = []
|
|
else {
|
|
this.checkProvinceList = [code]
|
|
}
|
|
this.search(1)
|
|
},
|
|
selectArea(e) {
|
|
this.area = e
|
|
this.checkProvinceList = e && e.length ? [e[0]] : []
|
|
this.search(1)
|
|
},
|
|
toMyEnquiry() {
|
|
vk.navigateTo({
|
|
url: '/pages/process/my'
|
|
})
|
|
},
|
|
async toRelease() {
|
|
const {userInfo, accountNum} = await vk.callFunction({
|
|
url: 'user/kh/getMyUserInfo'
|
|
})
|
|
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
|
|
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({url: '/pages/user/user?menu=fadada'});
|
|
})
|
|
} else if (accountNum === 0) {
|
|
this.$confirm('请先到个人中心添加收款账户', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
vk.navigateTo({url: '/pages/user/user?menu=account'});
|
|
})
|
|
} else {
|
|
if (userInfo.businessCard.status !== 1) {
|
|
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
})
|
|
return
|
|
}
|
|
vk.navigateTo({
|
|
url: '/pages/process/release'
|
|
})
|
|
}
|
|
},
|
|
|
|
search(pageIndex) {
|
|
// const categoryIds = []
|
|
// this.allChildCate.map(item => {
|
|
// if (this.checkCategoryList.indexOf(item._id) > -1) categoryIds.push(item.name)
|
|
// })
|
|
vk.callFunction({
|
|
url: 'client/factory/pub/getList',
|
|
title: '加载中...',
|
|
data: {
|
|
pageIndex,
|
|
pageSize: this.pageSize,
|
|
keyword: this.keyword,
|
|
mainSpotCategory: this.checkCategoryList.length ? this.checkCategoryList[0] : null,
|
|
area: this.area
|
|
},
|
|
success: ({data}) => {
|
|
data.rows.map(item => {
|
|
item.showWechat = false
|
|
item.showContract = false
|
|
return item
|
|
})
|
|
this.list = data
|
|
this.getAd12()
|
|
this.getAd122()
|
|
}
|
|
});
|
|
},
|
|
getCertUrl() {
|
|
vk.callFunction({
|
|
url: 'client/fadada.getVerifyUrl',
|
|
success: (res) => {
|
|
location.href = res.data.url
|
|
}
|
|
});
|
|
},
|
|
doShowWechat(index) {
|
|
if (parseInt(this.list.rows[index].user.accountType) === 2 && !this.list.rows[index].user.businessCard.companyWechat)
|
|
return vk.toast('用户暂未上传')
|
|
else if (parseInt(this.list.rows[index].user.accountType) === 1 && !this.list.rows[index].user.businessCard.personalWechat)
|
|
return vk.toast('用户暂未上传')
|
|
this.list.rows[index].showContract = false
|
|
this.list.rows[index].showWechat = !this.list.rows[index].showWechat
|
|
},
|
|
doShowContract(index) {
|
|
this.list.rows[index].showWechat = false
|
|
this.list.rows[index].showContract = !this.list.rows[index].showContract
|
|
},
|
|
async getAd12() {
|
|
this.ad12 = []
|
|
const res = await vk.callFunction({
|
|
url: 'client/ad/pub/getList',
|
|
data: {
|
|
adKey: 12,
|
|
categoryName: this.checkCategoryList.length ? this.checkCategoryList[0] : null,
|
|
region: this.area && this.area.length ? this.area : (this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null)
|
|
}
|
|
})
|
|
if (res.data) this.ad12 = res.data
|
|
},
|
|
async getAd122() {
|
|
this.ad122 = []
|
|
const res = await vk.callFunction({
|
|
url: 'client/ad/pub/getList',
|
|
data: {
|
|
adKey: 122,
|
|
categoryName: this.checkCategoryList.length ? this.pickValue : null,
|
|
categoryNames: this.checkCategoryList.length ? [this.pickValue] : null,
|
|
region: this.area && this.area.length ? this.area : (this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null)
|
|
}
|
|
})
|
|
if (res.data) this.ad122 = res.data
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.carousel {
|
|
width: 1200px;
|
|
margin: 20px auto;
|
|
}
|
|
|
|
.page-nav {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.carousel-img {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.goods-options {
|
|
background-color: #FFFFFF;
|
|
padding: 20px;
|
|
}
|
|
|
|
.filter-outer {
|
|
width: 1200px;
|
|
margin: 20px auto;
|
|
background-color: #FFFFFF;
|
|
padding: 20px;
|
|
}
|
|
|
|
.tags {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
|
|
.el-tag {
|
|
margin-right: 10px;
|
|
}
|
|
}
|
|
|
|
|
|
.goods-list {
|
|
width: 1200px;
|
|
margin: 20px auto;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.goods {
|
|
background-color: #FFFFFF;
|
|
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.05);
|
|
text-align: center;
|
|
width: 1200px;
|
|
margin: 10px auto;
|
|
padding: 20px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
|
|
.goods-info {
|
|
display: flex;
|
|
flex: 1;
|
|
|
|
.goods-img {
|
|
width: 200px;
|
|
height: 150px;
|
|
}
|
|
|
|
.info {
|
|
width: 1000px;
|
|
text-align: left;
|
|
margin-left: 20px;
|
|
|
|
.goods-name {
|
|
font-size: 20px;
|
|
font-weight: 500;
|
|
line-height: 2.5em;
|
|
}
|
|
|
|
.field {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
|
|
.desc {
|
|
display: flex;
|
|
width: 330px;
|
|
line-height: 2.5em;
|
|
|
|
.text {
|
|
width: 140px;
|
|
color: #999999;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
.buttons {
|
|
padding: 0 20px;
|
|
width: 200px;
|
|
border-left: 1px solid #f3f3f3;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-around;
|
|
position: relative;
|
|
|
|
.btn {
|
|
width: 120px;
|
|
}
|
|
|
|
.green {
|
|
background-color: #7ec050 !important;
|
|
color: #ffffff;
|
|
}
|
|
|
|
.wechat {
|
|
position: absolute;
|
|
left: -140px;
|
|
top: 0;
|
|
width: 150px;
|
|
height: 150px;
|
|
background-color: white;
|
|
border-radius: 10px;
|
|
padding: 5px;
|
|
box-shadow: 0 1px 10px 0 #eee
|
|
}
|
|
|
|
.mobile {
|
|
position: absolute;
|
|
left: -110px;
|
|
top: 10px;
|
|
background-color: white;
|
|
border-radius: 10px;
|
|
padding: 5px;
|
|
box-shadow: 0 1px 10px 0 #eee;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
}
|
|
|
|
&-title {
|
|
font-size: 15px;
|
|
color: #101010;
|
|
height: 62px;
|
|
padding-top: 20px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
&-stock {
|
|
font-size: 12px;
|
|
color: #BD3124;
|
|
}
|
|
|
|
&-address {
|
|
font-size: 12px;
|
|
margin: 10px 0;
|
|
}
|
|
|
|
&-image {
|
|
width: 200px;
|
|
height: 70px;
|
|
margin: 0 auto;
|
|
|
|
image {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
|
|
&-company {
|
|
color: #4F4F4F;
|
|
font-size: 14px;
|
|
margin: 10px 0;
|
|
}
|
|
|
|
&-buy {
|
|
width: 108px;
|
|
height: 30px;
|
|
line-height: 30px;
|
|
background-color: rgba(255, 255, 255, 1);
|
|
color: rgba(169, 41, 36, 1);
|
|
font-size: 13px;
|
|
text-align: center;
|
|
font-family: Roboto;
|
|
border: 1px solid rgba(169, 41, 36, 1);
|
|
margin: 0 auto;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.goods-image {
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
.paginatio {
|
|
float: none;
|
|
width: 1200px;
|
|
margin: 20px auto;
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
|
|
.selected-cate {
|
|
border-bottom: 2px solid #BD3124;
|
|
line-height: 40rpx;
|
|
}
|
|
|
|
.child-cate {
|
|
background-color: #DB8382;
|
|
color: white;
|
|
margin-top: 10rpx;
|
|
border-radius: 15rpx;
|
|
padding: 0 20rpx;
|
|
}
|
|
</style>
|