sellItem.vue 5.0 KB
<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>