Files
jjx-wap/pages/junk/my.vue
T
2026-10-08 18:34:09 +08:00

208 lines
5.2 KiB
Vue

<template>
<view class="wrap">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="我发布的旧货"></uititle>
</u-sticky>
<view class="issue" @click="toRelease">
<u-icon name="plus" color="#fff" size="24"></u-icon>
</view>
<view class="layout-goods">
<view class="goods-box p-top-10" v-if="list.length">
<view class="item bg-white" v-for="(item, index) in list"
:key="index">
<view @click="detailLink(item._id)" class="askfor">查看详情</view>
<view @click="detailLink(item._id)" class="title text-single">{{ item.title }}</view>
<view class="text m-top-10">{{ typeList[item.type].label }}</view>
<view @click="detailLink(item._id)" class="text m-top-10">
<text class="red" v-if="item.addressRegion && item.addressRegion.province">
所在地:{{ item.addressRegion.province.name }} {{ item.addressRegion.city.name }} {{
item.addressRegion.area.name
}}
</text>
<text class="red">{{ item.quoteNum }}家已报价</text>
</view>
<text @click="detailLink(item._id)" class="text-25 text-gray" v-if="item.remark">备注:{{ item.remark }}</text>
<view @click="detailLink(item._id)" class="date">{{ item._add_time_str }} 发布</view>
<view>
<u-button type="primary" plain size="mini" @click="del(item._id)">删除</u-button>
</view>
</view>
</view>
<u-empty v-else text="您未发布旧货"></u-empty>
</view>
</view>
</template>
<script>
import uititle from '@/components/common/title'
export default {
name: "my",
components: {uititle},
data() {
return {
list: [],
userInfo: null,
typeList: [
{value: 0, label: '拍卖'},
{value: 1, label: '采购'},
{value: 2, label: '租赁'},
{value: 3, label: '物资回收'},
]
}
},
methods: {
detailLink(id) {
vk.navigateTo(`/pages/junk/detail?id=${id}`);
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/old/kh/getList'
})
this.list = rows
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
uni.showModal({
title: '提示',
content: '您尚未认证, 是否前往认证?',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 0)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
uni.showModal({
title: '提示',
content: '请完善名片信息',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 1)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else if (accountNum === 0) {
uni.showModal({
title: '提示',
content: '请先到个人中心添加收款账户',
success: res => {
if (res.confirm) {
uni.setStorageSync('user_tab', 7)
uni.switchTab({url: '/pages/user/user'})
}
}
})
} else {
vk.navigateTo({
url: '/pages/junk/publish'
})
}
},
del(_id) {
uni.showModal({
title: '提示',
content: '如果你要删除此条信息,之前其他客户填写的留言将无法查看',
success: res => {
if (res.confirm) {
vk.callFunction({
url: 'client/old/kh/delete',
title: '请求中...',
data: {
_id
},
}).then(res => {
this.getList()
})
}
}
})
}
},
onShow() {
this.userInfo = vk.getStorageSync('uni_id_user_info')
this.getList()
}
}
</script>
<style lang="scss" scoped>
.layout-goods {
// width: 690rpx;
padding: 10rpx 30rpx;
.item {
position: relative;
margin-top: 30rpx;
padding: 10rpx 20rpx 20rpx;
border-radius: 12rpx;
.title {
width: 90%;
font-size: 30rpx;
font-weight: 600;
line-height: 48rpx;
color: #101010;
}
.link, .askfor {
position: absolute;
right: 20rpx;
top: 16rpx;
z-index: 9;
font-size: 24rpx;
line-height: 36rpx;
color: #A92924;
padding: 4rpx 8rpx;
}
.link {
border: 1px solid #A92924;
}
.text {
font-size: 24rpx;
line-height: 36rpx;
color: #999999;
}
.red {
margin-right: 20rpx;
color: #A92924;
}
.date {
font-size: 24rpx;
line-height: 36rpx;
color: #9a9a9a;
}
.company {
height: 40rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
.text {
//width: 300rpx;
height: 40rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #4f4f4f;
}
}
}
.item:nth-child(1) {
margin-top: 0 !important;
}
}
</style>