290 lines
8.4 KiB
Vue
290 lines
8.4 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 url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
|
|
</el-breadcrumb>
|
|
</view> -->
|
|
|
|
<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>-->
|
|
<common-swiper page="old-mine" :height="200"/>
|
|
<view class="goods-options">
|
|
<el-row class="">
|
|
<el-button @click="toRelease" type="primary" round>发布旧货交易</el-button>
|
|
<!-- <el-button type="primary" round plain>我发布的询价单</el-button> -->
|
|
</el-row>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 商品列表 -->
|
|
<view class="sheet-list">
|
|
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
|
|
:customRightBtns="table1.customRightBtns"
|
|
:pagination="true" :query-form-param="queryForm1"></vk-data-table>
|
|
</view>
|
|
|
|
|
|
<common-footer></common-footer>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
keyword: '',
|
|
// 表格相关开始 -----------------------------------------------------------
|
|
queryForm1: {
|
|
formData: {
|
|
userId: vk.getVuex('$user.userInfo._id')
|
|
},
|
|
columns: [
|
|
{key: "userId", title: "发布人ID", type: "text", width: 160, mode: "="},
|
|
]
|
|
},
|
|
table1: {
|
|
// 表格数据请求地址
|
|
action: "client/old/kh/getList",
|
|
customRightBtns: [
|
|
{
|
|
title: '详情',
|
|
icon: 'el-icon-search',
|
|
type: 'primary',
|
|
onClick: (item) => {
|
|
vk.navigateTo('/pages/index/old/detail?id=' + item._id);
|
|
}
|
|
},
|
|
{
|
|
title: '删除',
|
|
icon: 'el-icon-delete',
|
|
type: 'primary',
|
|
onClick: (item) => {
|
|
this.$confirm('如果你要删除此条信息,之前其他客户填写的留言将无法查看', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
vk.callFunction({
|
|
url: 'client/old/kh/delete',
|
|
title: '请求中...',
|
|
data: {
|
|
id: item._id
|
|
},
|
|
}).then(res => {
|
|
this.$refs.table1.refresh()
|
|
})
|
|
})
|
|
},
|
|
show: (item) => {
|
|
console.log(item.status)
|
|
return item.status === 0
|
|
}
|
|
},
|
|
],
|
|
// 表格字段显示规则
|
|
columns: [
|
|
{
|
|
key: "title",
|
|
title: "标题",
|
|
type: "text",
|
|
width: 280
|
|
},
|
|
{
|
|
key: "addressRegion",
|
|
title: "所在地",
|
|
type: "text",
|
|
minWidth: 200,
|
|
formatter: (val, row, column, index) => {
|
|
let str = ""
|
|
try {
|
|
if (row.type === 1) str = (row.deliverAddressRegion && row.deliverAddressRegion.city) ? (row.deliverAddressRegion.province.name + "-" + row.deliverAddressRegion.city.name) : ''
|
|
else str = (row.addressRegion && row.addressRegion.city) ? (row.addressRegion.province.name + "-" + row.addressRegion.city.name) : ''
|
|
|
|
// if (row.type === 2) {
|
|
// str = row.offerAddressRegion.province.name + row.offerAddressRegion.city.name + row.offerAddressRegion.area.name
|
|
// } else if (row.type === 1) {
|
|
// str = row.deliverAddressRegion.province.name + row.deliverAddressRegion.city.name + row.deliverAddressRegion.area.name
|
|
// } else {
|
|
// str = val.province.name + val.city.name + val.area.name
|
|
// }
|
|
} catch (err) {
|
|
str = ""
|
|
}
|
|
|
|
return str
|
|
}
|
|
},
|
|
{
|
|
key: "quoteNum",
|
|
title: "报价数",
|
|
type: "text",
|
|
formatter: (val, row, column, index) => {
|
|
return `${val}家已报价`
|
|
}
|
|
},
|
|
{
|
|
key: "type",
|
|
title: "类型",
|
|
type: "select",
|
|
data: [
|
|
{value: 0, label: '拍卖'},
|
|
{value: 1, label: '采购'},
|
|
{value: 2, label: '租赁'},
|
|
{value: 3, label: '物资回收'},
|
|
]
|
|
},
|
|
// {
|
|
// key: "supplier",
|
|
// title: "供应商",
|
|
// type: "text",
|
|
// formatter: (val, row, column, index) => {
|
|
// console.log(val.companyName, val.companyName === '')
|
|
// if (val.companyName && val.companyName !== '') return val.companyName
|
|
// else return val.personName
|
|
// // console.log((val.companyName && val.companyName !== ''), val.companyName)
|
|
// // return ((val.companyName && val.companyName !== '') ? val.companyName : val.personName)
|
|
// }
|
|
// },
|
|
{
|
|
key: "_add_time_str",
|
|
title: "添加时间",
|
|
type: "time",
|
|
width: 160
|
|
},
|
|
|
|
],
|
|
// 多选框选中的值
|
|
multipleSelection: [],
|
|
// 当前高亮的记录
|
|
selectItem: "",
|
|
|
|
},
|
|
// 表格相关结束 -----------------------------------------------------------
|
|
};
|
|
},
|
|
onLoad() {
|
|
|
|
},
|
|
methods: {
|
|
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'
|
|
})
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
checkCategoryArr() {
|
|
let arr = []
|
|
this.checkCategoryList.forEach(item => {
|
|
arr.push(...item)
|
|
})
|
|
|
|
this.checkProvinceList.forEach(item => {
|
|
arr.push({
|
|
...item
|
|
})
|
|
})
|
|
return arr
|
|
}
|
|
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.carousel {
|
|
width: 1200px;
|
|
margin: 20px auto;
|
|
}
|
|
|
|
.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;
|
|
|
|
.el-tag {
|
|
margin-right: 10px;
|
|
}
|
|
}
|
|
|
|
|
|
.sheet-list {
|
|
width: 1200px;
|
|
margin: 20px auto;
|
|
// display: flex;
|
|
|
|
}
|
|
|
|
|
|
.paginatio {
|
|
float: none;
|
|
width: 1200px;
|
|
margin: 20px auto;
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
</style> |