sellItem.vue
5.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<template>
<view>
<view class="listBox" :style="info.tag_list.length == 0 ? 'max-height: 234rpx; min-height: 0;' : ''" >
<view class="listBox_top" style="justify-content: space-between;" @click="goDetail">
<view class="listBox_top" style="width: 50vw;">
<view class="box1" style="margin-right: 24rpx;">
<image src="../../static/need.png" style="width: 68rpx; height: 40rpx;" v-if="info.type == 2" mode=""></image>
<image src="../../static/need2.png" style="width: 68rpx; height: 40rpx;" v-else-if="info.type == 1" mode=""></image>
</view>
<view class="oneh" style="color: #000000e6;font-size: 34rpx;font-weight: 500; ">
{{info.category.name + info.brand.name + info.xinghao.name}}
</view>
</view>
<view v-if="isBtn">
<p style="font-size: 28rpx; color: #3375D8;" v-if="info.status == 2">已发布</p>
<p style="font-size: 28rpx; color: #3375D8;" v-if="info.status == 1">审核中</p>
<p style="font-size: 28rpx; color: #E63D27;" v-if="info.status == 3">已拒绝</p>
<p style="font-size: 28rpx; color: #000000;" v-if="info.status == 4">已关闭</p>
</view>
<view class="font oneh" style="width: 30vw;" v-else-if="info.price && info.price !== ''">
<!-- <text>{{info.price}}</text> -->
<text>**</text>
<text style="font-size: 26rpx;">{{info.category.price_unit}}/{{info.category.day_unit}}</text>
</view>
</view>
<view class="listBox_top" style="justify-content: space-between; margin-top: 28rpx; margin-bottom: 46rpx;" v-if="info.tag_list.length > 0" @click="goDetail">
<view class="listBox_top" >
<view style="margin: 0 5rpx" v-for="item in info.tag_list">
<u-tag :text="item.name" plain size="mini" type="info"></u-tag>
</view>
</view>
</view>
<view class="tips" v-if="isBtn" style="margin-top: 28rpx;">
{{info.province}} - {{info.city}} - {{info.region}}-距您{{info.distance || '0'}}km
</view>
<view class="line">
</view>
<view class="flexBox" style="justify-content: space-between; padding-bottom: 20rpx;" v-if="!isBtn">
<view class="tips">
{{info.province}} - {{info.city}} - {{info.region}}-距您{{info.distance || 0}}km
</view>
<view class="tips" style="margin-left: 20rpx; text-align: end;">
{{info.createtime_text}}
</view>
</view>
<view class="flexBox" style="justify-content: flex-end !important; padding-bottom: 16rpx;" v-else>
<view style="display: flex;">
<view class="" v-if="info.status == 1 || info.status == 2 || info.status == 3">
<u-button type="info" size="small" text="关闭信息" @click="close"></u-button>
</view>
<view class="" style="margin-right: 16rpx;" v-if="info.status == 2 ">
<u-button type="primary" size="small" style="margin: 0 16rpx;" text="修改信息" @click="goPublish1"></u-button>
</view>
<view class="" v-else-if="info.status == 4">
<u-button type="primary" size="small" text="重新发布" @click="goNeeds(info.type)"></u-button>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
isBtn: {
type: Boolean,
default: false
},
info:{
type: Object,
default:{}
}
},
data() {
return {
}
},
methods: {
close(){
uni.$u.http.post('/api/equip/close_equip',{
equip_id: this.info.id
}).then(res => {
console.log(res);
uni.showToast({
title:res.msg
})
this.$emit('close')
}).catch(err => {
console.log(err);
})
},
goDetail(){
uni.navigateTo({
url:`/pages/subPages/detail?id=${this.info.id}`
})
},
goPublish1(){
uni.navigateTo({
url:`/pages/sellAndBuy/hub?info=${JSON.stringify(this.info)}`
})
},
goPub(){
uni.navigateTo({
url: '/pages/subPages/detail'
})
},
goNeeds(type) {
uni.navigateTo({
url: `/pages/sellAndBuy/hub?val=${type}&info=${JSON.stringify(this.info)}`
})
}
}
}
</script>
<style scoped lang="scss">
.listBox_top {
display: flex;
align-items: center;
}
.listBox_right {
width: 100%;
}
.flexBox {
display: flex;
align-items: center;
justify-content: space-between;
}
.tips {
color: #00000099;
font-size: 26rpx;
font-weight: 400;
}
.listBox_cont {
display: flex;
align-items: center;
margin: 16rpx 0;
}
.font {
color: #e63d27ff;
font-size: 40rpx;
font-weight: 500;
text-align: right;
}
.box2 {
width: 128rpx;
height: 44rpx;
line-height: 44rpx;
text-align: center;
border-radius:8rpx;
opacity: 1;
background: #f0f2f5ff;
}
.line {
height: 1rpx;
opacity: 1;
background: #f0f2f5ff;
margin: 24rpx 0 17rpx 0;
}
.listBox {
min-height: 234rpx;
border-radius: 8rpx;
opacity: 1;
background: #ffffffff;
margin-bottom: 24rpx;
padding: 24rpx 24rpx 0 24rpx;
}
.oneh{
display: inline-block;
white-space: nowrap;
width: 100%;
overflow: hidden;
text-overflow:ellipsis;
}
.box1 {
width: 56rpx;
height: 32rpx;
border-radius: 8rpx;
opacity: 1;
background: #d6e5ffff;
}
</style>