GoodsList.vue 3.7 KB
<template>
	<view v-show="goodsList.length > 0" class="cate-right-cont">
		<view class="cate-two-box">
			<view class="cate-cont-box">
				<view class="w-full" v-for="(item, idx) in goodsList" :key="idx" @click="goodDetail(item.id)">
					<view class="cate-img-padding">
						<view class="content-left">
							<image class="image" mode="widthFix" :src="item.pic"></image>
						</view>
						<view class="content-right">
							<view style="height: 100%;" class="dis-flex flex-dir-column flex-x-between flex-y-center">
								<view class="title u-line-1">{{ item.name }}</view>
								<view class="dis-flex flex-y-center">
									<view class="btn up">上架</view>
									<view class="btn mx-20">下架</view>
									<view class="btn del">删除</view>
								</view>
							</view>
							<u-icon name="arrow-right-double"></u-icon>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"goodsCard",
		props: {
			goodsList: {
				type: Array,
				require: true
			}
		},
		methods: {
			goodDetail(goodsID){
				uni.navigateTo({
					url: '/pages_mall/goodsDetail/goodsDetail?goods_id=' + goodsID
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
// 右侧二级分类
	.cate-cont-box {
	  margin-bottom: 30rpx;
	  padding-bottom: 10rpx;
	  background: #fff;
	  overflow: hidden;
	  .cate-img-padding{
		  display: flex;
		  align-items: center;
		  .content-left{
			  width: 120rpx;
			  height: 120rpx;
			  .image{
				  width: 100%;
					border-radius: 12rpx;
			  }
		  }
		  .content-right{
				display: flex;
				align-items: center;
				justify-content: center;
			  flex: 1;
			  height: 120rpx;
			  padding: 5rpx 30rpx;
				.btn{
					width: 80rpx;
					height: 40rpx;
					border-radius: 200rpx 200rpx 200rpx 200rpx;
					border: 2rpx solid #DDDDDD;
					line-height: 40rpx;
					font-size: 24rpx;
					text-align: center;
					color: #DDDDDD;
					&.up{
						border-color: #509F00;
						color: #509F00;
					}
					&.down{
						border-color: #00A3EE;
						color: #00A3EE;
					}
					&.del{
						border-color: #CB0000;
						color: #CB0000;
					}
				}
			  .title{
				  color: #333;
				  font-size: 26rpx;
				  font-weight: 500;
				  margin-bottom: 10rpx;
			  }
			  .content-title{
				  display: inline-block;
				  color: #999;
				  font-size: 22rpx;
				  margin: 15rpx 0 15rpx 0;
				  text-overflow: ellipsis;
				  overflow: hidden;
				  white-space: nowrap;
			  }
			  .tip{
				  font-size: 24rpx;
				  margin-bottom: 12rpx;
				  .delivery{
					  width: 80rpx;
					  height: 24rpx;
					  margin-left: 10rpx;
					  border: 1px solid #40AE36;
					  border-radius: 4rpx;
					  padding: 3rpx;
					  color: #40AE36;
				  }
			  }
			  .price{
				position: relative;
				font-size: 22rpx;
				color: #999;
				margin-top: 10rpx;
				.price-detail{
					width: 116rpx;
					height: 27rpx;
					font-size: 32rpx;
					font-family: PingFangSC;
					font-weight: 500;
					color: #F55726;
				}
				.price-old{
					width: 90rpx;
					height: 21rpx;
					font-size: 22rpx;
					font-family: PingFangSC;
					font-weight: 400;
					color: #CCCCCC;
					margin-left: 6rpx;
				}
				.addCart{
					position: absolute;
					top: -8rpx;
					right: 6rpx;
					width: 46rpx;
					height: 46rpx;
					background-color: #40AE36;
					border-radius: 50%;
					text-align: center;
					line-height: 44rpx;
				}
			  }
		  }
	  }
	  .name {
	    display: block;
	    padding-bottom: 30rpx;
	    text-align: center;
	    font-size: 26rpx;
	    color: #444444;
	  }
	
	  .cate-img-padding {
	    padding: 16rpx 16rpx 4rpx 16rpx;
	  }
	
	  .cate-img {
	    position: relative;
	    width: 100%;
	    padding-top: 100%;
	  }
	}
</style>