672 lines
19 KiB
Vue
672 lines
19 KiB
Vue
<template>
|
|
<view>
|
|
<top-bar></top-bar>
|
|
<common-header></common-header>
|
|
<category-bar></category-bar>
|
|
<view class="carousel">
|
|
<el-carousel height="500px">
|
|
<common-swiper page="old"/>
|
|
</el-carousel>
|
|
<view class="goods-options">
|
|
<el-row class="">
|
|
<el-button @click="toRelease" type="primary" round>发布旧货交易</el-button>
|
|
<el-button @click="navTo('/pages/index/old/my')" type="primary" round plain
|
|
class="empty-bg-plain-btn">我发布的信息
|
|
</el-button>
|
|
<el-button @click="navTo('/pages/index/old/quote/my')" type="primary" round plain
|
|
class="empty-bg-plain-btn">我的报价
|
|
</el-button>
|
|
</el-row>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="nav-tool">
|
|
<view class="btn pointer" @click="navTo('/pages/index/old/list/list')">
|
|
<image src="/static/images/old/btn01.png" mode="widthFix"/>
|
|
<text>拍卖信息</text>
|
|
</view>
|
|
<view class="btn pointer" @click="navTo('/pages/index/old/list/list?type=1')">
|
|
<image src="/static/images/old/btn02.png" mode="widthFix"/>
|
|
<text>采购信息</text>
|
|
</view>
|
|
<view class="btn pointer" @click="navTo('/pages/index/old/list/list?type=2')">
|
|
<image src="/static/images/old/btn03.png" mode="widthFix"/>
|
|
<text>租赁信息</text>
|
|
</view>
|
|
<view class="btn pointer" @click="navTo('/pages/index/old/list/list?type=3')">
|
|
<image src="/static/images/old/btn04.png" mode="widthFix"/>
|
|
<text>物资回收信息</text>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<!-- <view class="carousel news-list-1">-->
|
|
<!-- <view class="title">-->
|
|
<!-- 成交动态-->
|
|
<!-- </view>-->
|
|
<!-- <view class="news-list">-->
|
|
<!-- <el-row class="wrap" type="flex" :gutter="10" justify="space-between">-->
|
|
<!-- <el-col :span="7" v-for="(item, index) in list" :key="index">-->
|
|
<!-- <view class="item">-->
|
|
<!-- <view class="text">[南宁]{{ item.title }}</view>-->
|
|
<!-- <view class="date-time">11-15</view>-->
|
|
<!-- </view>-->
|
|
<!-- </el-col>-->
|
|
<!-- </el-row>-->
|
|
<!-- </view>-->
|
|
<!-- </view>-->
|
|
|
|
<!-- <view class="carousel ad">-->
|
|
<!-- <el-row class="wrap" type="flex" :gutter="10" justify="space-between">-->
|
|
<!-- <el-col :span="12">-->
|
|
<!-- <div class="ad-img">-->
|
|
<!-- <el-image-->
|
|
<!-- src="http://jyx.gxwebsoft.com/uploads/20210817/57f8333bed0d3a4e2aac3fd251e19007.jpg"/>-->
|
|
<!-- </div>-->
|
|
<!-- </el-col>-->
|
|
<!-- <el-col :span="12">-->
|
|
<!-- <div class="ad-img">-->
|
|
<!-- <el-image-->
|
|
<!-- src="http://jyx.gxwebsoft.com/uploads/20210506/f3afbd29ce99dc6e2fdf4c8f3ec16221.jpg"/>-->
|
|
<!-- </div>-->
|
|
<!-- </el-col>-->
|
|
<!-- </el-row>-->
|
|
<!-- </view>-->
|
|
|
|
|
|
<view class="carousel news-list-1">
|
|
<view class="title">
|
|
加急公告
|
|
</view>
|
|
<view class="news-gg">
|
|
<el-carousel height="50px" direction="vertical" autoplay class="w-100p">
|
|
<el-carousel-item v-for="i in Math.ceil(urgentList.length / 4)" :key="i">
|
|
<view class="flex justify-start items-start flex-wrap">
|
|
<view class="item w-50p mb-10" v-for="index in 4" :key="index">
|
|
<template v-if="urgentList[(i - 1) * 4 + (index - 1)]">
|
|
<view
|
|
@click="navTo(`/pages/index/old/detail?id=${urgentList[(i - 1) * 4 + (index - 1)]._id}`)">
|
|
<view class="text pointer">
|
|
<span class="text-gray"
|
|
v-if="urgentList[(i - 1) * 4 + (index - 1)].addressRegion && urgentList[(i - 1) * 4 + (index - 1)].addressRegion.city">[{{
|
|
urgentList[(i - 1) * 4 + (index - 1)].addressRegion.city.name
|
|
}}]</span>
|
|
<span class="urgent">[加急]</span>
|
|
<text>{{ urgentList[(i - 1) * 4 + (index - 1)].title }}</text>
|
|
<span class="ml-20">{{
|
|
urgentList[(i - 1) * 4 + (index - 1)].addTime
|
|
}}</span>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</view>
|
|
</view>
|
|
</el-carousel-item>
|
|
</el-carousel>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="carousel">
|
|
<el-row class="wrap" type="flex" :gutter="20" justify="space-between">
|
|
<el-col :span="12">
|
|
<el-card class="new-box">
|
|
<div slot="header" class="clearfix">
|
|
<span class="title">最新拍卖信息</span>
|
|
<el-button style="float: right; padding: 3px 0" type="text"
|
|
@click="navTo('/pages/index/old/list/list')">查看更多
|
|
</el-button>
|
|
</div>
|
|
<view class="list8">
|
|
<view class="article pointer" v-for="(item, index) in dataList[0]" :key="index"
|
|
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
|
|
<view class="title2 " v-if="index < 8">
|
|
<view class="flex justify-start">
|
|
<span v-if="item.addressRegion && item.addressRegion.city ">[{{
|
|
item.addressRegion.city.name
|
|
}}]</span>
|
|
<span v-else>[区域不限]</span>
|
|
<span class="urgent" v-if="item.isUrgent">[加急]</span>
|
|
<text class="line-1 ">{{ item.title }}</text>
|
|
</view>
|
|
<view class="date-time">{{ item.addDate }}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</el-card>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-card class="new-box">
|
|
<div slot="header" class="clearfix">
|
|
<span class="title">最新采购信息</span>
|
|
<el-button style="float: right; padding: 3px 0" type="text"
|
|
@click="navTo('/pages/index/old/list/list?type=1')">查看更多
|
|
</el-button>
|
|
</div>
|
|
<view class="list8">
|
|
<view class="article pointer" v-for="(item, index) in dataList[1]" :key="index"
|
|
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
|
|
<view class="title2" v-if="index < 8">
|
|
<view class="flex justify-start">
|
|
<span v-if="item.addressRegion && item.addressRegion.city">[{{
|
|
item.addressRegion.city.name
|
|
}}]</span>
|
|
<template v-else>
|
|
<span v-if="item.deliverAddressRegion && item.deliverAddressRegion.city">[{{
|
|
item.deliverAddressRegion.city.name
|
|
}}]</span>
|
|
</template>
|
|
<span class="urgent" v-if="item.isUrgent">[加急]</span>
|
|
<text class="line-1 ">{{ item.title }}</text>
|
|
</view>
|
|
<view class="date-time">{{ item.addDate }}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</el-card>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-card class="new-box">
|
|
<div slot="header" class="clearfix">
|
|
<span class="title">最新租赁信息</span>
|
|
<el-button style="float: right; padding: 3px 0" type="text"
|
|
@click="navTo('/pages/index/old/list/list?type=2')">查看更多
|
|
</el-button>
|
|
</div>
|
|
<view class="list8">
|
|
<view class="article pointer" v-for="(item, index) in dataList[2]" :key="index"
|
|
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
|
|
<view class="title2" v-if="index < 8">
|
|
<view class="flex justify-start">
|
|
<span v-if="item.offerAddressRegion && item.offerAddressRegion.city">[{{
|
|
item.offerAddressRegion.city.name
|
|
}}]</span>
|
|
<span v-else>[区域不限]</span>
|
|
<span class="urgent" v-if="item.isUrgent">[加急]</span>
|
|
<text class="line-1">{{ item.title }}</text>
|
|
</view>
|
|
<view class="date-time">{{ item.addDate }}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</el-card>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-card class="new-box">
|
|
<div slot="header" class="clearfix">
|
|
<span class="title">最新物资回收信息</span>
|
|
<el-button style="float: right; padding: 3px 0" type="text"
|
|
@click="navTo('/pages/index/old/list/list?type=3')">查看更多
|
|
</el-button>
|
|
</div>
|
|
<view class="list8">
|
|
<view class="article pointer" v-for="(item, index) in dataList[3]" :key="index"
|
|
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
|
|
<view class="title2" v-if="index < 8">
|
|
<view class="flex justify-start">
|
|
<span v-if="item.addressRegion && item.addressRegion.city">[{{
|
|
item.addressRegion.city.name
|
|
}}]</span>
|
|
<span v-else>[区域不限]</span>
|
|
<span class="urgent" v-if="item.isUrgent">[加急]</span>
|
|
<text class="line-1">{{ item.title }}</text>
|
|
</view>
|
|
<view class="date-time">{{ item.addDate }}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</el-card>
|
|
</el-col>
|
|
</el-row>
|
|
</view>
|
|
|
|
<!-- 合作单位/联营单位-->
|
|
<view class="cooperate">
|
|
<view class="title">
|
|
<el-image src="https://oss.wsdns.cn/20231204/860581fbcb9741658de15470f053e42e.png"
|
|
style="width: 180px"/>
|
|
</view>
|
|
<u-gap height="1" bg-color="#f3f3f3"/>
|
|
<view class="flex justify-start items-center flex-wrap">
|
|
<view class="w-25p pointer" v-for="(item, index) in companyList" :key="index"
|
|
@click="navTo(`/pages/yellowPage/info?id=${item.uid}`)">
|
|
<view class="border bg-white flex justify-start items-start p-20" style="height: 250rpx">
|
|
<image v-if="item.businessCard" :src="item.businessCard.logo" class="logo"/>
|
|
<image v-else src="/static/images/no-logo.jpg" class="logo" mode="aspectFill"/>
|
|
<div class="flex flex-col justify-start items-start ml-20 w-67p">
|
|
<span class="text-28 font-bold mb-25">{{ item.company.companyName }}</span>
|
|
<span class="mt-20 line-2 w-100p">
|
|
主营: {{
|
|
(item.mainSpotCategory && item.mainSpotCategory.length > 0) ? item.mainSpotCategory.join() : ''
|
|
}}
|
|
</span>
|
|
</div>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<u-gap height="5" bg-color="#f3f3f3"/>
|
|
</view>
|
|
|
|
<!-- 现货市场 end -->
|
|
<gap height="50"/>
|
|
<common-footer></common-footer>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import UGap from "@/uni_modules/vk-uview-ui/components/u-gap/u-gap.vue";
|
|
import dayjs from "dayjs";
|
|
|
|
export default {
|
|
components: {
|
|
UGap
|
|
},
|
|
data() {
|
|
return {
|
|
info: {
|
|
name: ''
|
|
},
|
|
companyList: [],
|
|
dataList: [],
|
|
urgentList: [],
|
|
allChildCate: [],
|
|
};
|
|
},
|
|
onLoad(options) {
|
|
if (options && options.id) {
|
|
this.getInfo(options.id)
|
|
}
|
|
this.getCategoryTreeData()
|
|
this.getDataList()
|
|
this.getUrgentList()
|
|
},
|
|
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.getCompanyList()
|
|
}
|
|
});
|
|
},
|
|
navTo(url) {
|
|
vk.navigateTo(url);
|
|
},
|
|
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/index/old/release'
|
|
})
|
|
}
|
|
},
|
|
async getInfo(id) {
|
|
this.info = await vk.callFunction({
|
|
url: 'client/goods/list/pub/getDetail',
|
|
data: {
|
|
id
|
|
}
|
|
})
|
|
},
|
|
async getCompanyList() {
|
|
const {rows} = await vk.callFunction({
|
|
url: 'client/user/pub/getCompany',
|
|
data: {isCoop: 1}
|
|
})
|
|
this.companyList = 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 getDataList() {
|
|
for (let i = 0; i < 4; i++) {
|
|
const {rows} = await vk.callFunction({
|
|
url: 'client/old/pub/getList',
|
|
data: {
|
|
type: i
|
|
}
|
|
})
|
|
this.dataList[i] = rows.map(item => {
|
|
item.addDate = dayjs(item._add_time).format('MM-DD')
|
|
return item
|
|
})
|
|
this.$forceUpdate()
|
|
}
|
|
},
|
|
async getUrgentList() {
|
|
const {rows} = await vk.callFunction({
|
|
url: 'client/old/pub/getList',
|
|
data: {
|
|
isUrgent: true
|
|
}
|
|
})
|
|
this.urgentList = rows.map(item => {
|
|
item.addDate = dayjs(item._add_time).format('MM-DD')
|
|
return item
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.carousel {
|
|
width: 1200px;
|
|
margin: 20px auto;
|
|
|
|
.wrap {
|
|
flex-wrap: wrap;
|
|
}
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.nav-tool {
|
|
background-color: #FFFFFF;
|
|
width: 1200px;
|
|
margin: 20px auto;
|
|
display: flex;
|
|
justify-content: space-around;
|
|
|
|
.btn {
|
|
margin: 20px auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
|
|
image {
|
|
width: 80px;
|
|
}
|
|
|
|
text {
|
|
font-size: 18px;
|
|
font-weight: 500;
|
|
}
|
|
}
|
|
}
|
|
|
|
.news-list-1 {
|
|
padding: 20px;
|
|
background-color: #FFFFFF;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
|
|
.title {
|
|
color: #bf2b28;
|
|
font-weight: bold;
|
|
font-size: 20px;
|
|
width: 56px;
|
|
border-right: 1px solid #ccc;
|
|
margin-right: 10px;
|
|
}
|
|
|
|
.news-list {
|
|
flex: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-around;
|
|
|
|
.wrap {
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.item {
|
|
line-height: 2em;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
|
|
.text {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.date-time {
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
}
|
|
|
|
.news-gg {
|
|
flex: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
|
|
.wrap {
|
|
width: 100%;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.item {
|
|
display: flex;
|
|
align-items: center;
|
|
|
|
.new-avatar {
|
|
padding: 10px;
|
|
|
|
.image {
|
|
width: 70px;
|
|
height: 70px;
|
|
}
|
|
}
|
|
|
|
.list3 {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-between;
|
|
|
|
span {
|
|
padding-right: 10px;
|
|
color: #999;
|
|
}
|
|
|
|
.text {
|
|
line-height: 1.8em;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
|
|
.date-time {
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.new-box {
|
|
margin-bottom: 20px;
|
|
height: 600rpx;
|
|
|
|
.title {
|
|
color: #bf2b28;
|
|
font-size: 20px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.list8 {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-between;
|
|
|
|
span {
|
|
padding-right: 10px;
|
|
color: #999;
|
|
}
|
|
|
|
.article {
|
|
.title2 {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
line-height: 2em;
|
|
|
|
.date-time {
|
|
color: #999999;
|
|
}
|
|
}
|
|
|
|
.title2:hover {
|
|
color: #a92924;
|
|
}
|
|
}
|
|
|
|
.text {
|
|
line-height: 1.8em;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
}
|
|
|
|
.cooperate {
|
|
width: 1200px;
|
|
margin: 20px auto;
|
|
background-color: #ffffff;
|
|
|
|
.title {
|
|
text-align: center;
|
|
}
|
|
|
|
.wrap {
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.grid-content {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
padding: 10px;
|
|
flex-direction: column;
|
|
|
|
.comments {
|
|
line-height: 2em;
|
|
}
|
|
}
|
|
|
|
.bg-purple {
|
|
border-top: 1px solid #f3f3f3;
|
|
border-right: 1px solid #f3f3f3;
|
|
|
|
.image {
|
|
width: 140px;
|
|
}
|
|
}
|
|
|
|
.logo {
|
|
width: 80px;
|
|
height: 80px;
|
|
}
|
|
}
|
|
|
|
.tags {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
|
|
.el-tag {
|
|
margin-right: 10px;
|
|
}
|
|
}
|
|
|
|
//
|
|
.album {
|
|
width: 500px;
|
|
|
|
.album-item {
|
|
width: 500px;
|
|
height: 400px;
|
|
}
|
|
}
|
|
|
|
.desc {
|
|
background-color: #F5E2E3;
|
|
}
|
|
|
|
.add-to-cart-btn {
|
|
background-color: #FF7300;
|
|
}
|
|
|
|
.intro-title {
|
|
background-color: #EF0021;
|
|
padding: 10px 20px;
|
|
color: white;
|
|
width: 120px;
|
|
text-align: center;
|
|
}
|
|
|
|
.intro {
|
|
border-top: 1px solid #F95F6E;
|
|
}
|
|
|
|
.urgent {
|
|
color: #bf2b28 !important;
|
|
}
|
|
</style>
|