You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shop-app/pages/index/components/Pick.vue

132 lines
2.5 KiB

<!--
* @Author: ch
* @Date: 2022-03-23 10:29:07
* @LastEditors: ch
* @LastEditTime: 2022-04-12 18:54:58
* @Description: file content
-->
<template>
<view class="pick">
<view class="max" @click="$Router.push(`/goodsDetail?id=${max.id}`)">
<view class="title">{{max.name}}</view>
<view class="desc">{{max.name}}</view>
<!-- <view class="tag"></view> -->
<view class="price">{{max.startingPrice}}</view>
<view class="img-box">
<image class="img" :src="max.mainPicture"/>
</view>
</view>
<view class="min" @click="$Router.push(`/goodsDetail?id=${minOne.id}`)">
<view class="title">{{minOne.name}}</view>
<view class="min--info-box">
<view class="min--info-box-right">
<view class="desc">{{minOne.name}}</view>
<!-- <view class="tag"></view> -->
<view class="price">{{minOne.startingPrice}}</view>
</view>
<view class="img-box">
<image class="img" :src="minOne.mainPicture"/>
</view>
</view>
</view>
<view class="min" @click="$Router.push(`/goodsDetail?id=${minTwo.id}`)">
<view class="title">{{minTwo.name}}</view>
<view class="min--info-box">
<view class="min--info-box-right">
<view class="desc">{{minTwo.name}}</view>
<view class="tag"></view>
<view class="price">{{minTwo.startingPrice}}</view>
</view>
<view class="img-box">
<image class="img" :src="minTwo.mainPicture"/>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data(){
return{}
},
props:{
data : {
type : Array,
default : () => ([])
}
},
computed:{
max (){
return this.data[0] || {}
},
minOne (){
return this.data[1] || {}
},
minTwo (){
return this.data[2] || {}
}
}
}
</script>
<style lang="scss" scoped>
.pick{
margin: 0 30rpx;
height: 450rpx;
display: flex;
flex-flow: column wrap;
justify-content: space-between;
.title,.desc{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin: 10rpx 20rpx;
}
.title{
margin-top: 20rpx;
}
.desc{
color: $color-grey4;
font-size: 22rpx;
}
.price{
margin: 24rpx 0 10rpx 20rpx;
color: $color-yellow4;
}
}
.max{
width: 335rpx;
height: 450rpx;
background: $color-grey0;
border-radius: 8rpx;
.img-box{
display: flex;
justify-content: end;
}
.img{
width: 260rpx;
height: 260rpx;
}
}
.min{
width: 335rpx;
height: 215rpx;
background: $color-grey0;
border-radius: 8rpx;
&--info-box{
display: flex;
justify-content: space-between;
}
&--info-box-right{
width: 180rpx;
}
.img{
width: 160rpx;
height: 160rpx;
}
}
</style>