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

180 lines
4.0 KiB

3 years ago
<!--
* @Author: ch
* @Date: 2022-03-23 10:29:07
* @LastEditors: ch
2 years ago
* @LastEditTime: 2022-05-06 11:20:23
3 years ago
* @Description: file content
-->
<template>
<view class="pick">
3 years ago
<view class="max" @click="$Router.push(`/goodsDetail?id=${max.id}`)">
2 years ago
<view class="title">{{max.title}}</view>
2 years ago
<view class="desc">{{max.subtitle}}</view>
<view class="tag">
2 years ago
<image v-for="i in max.labelList" :key="i.code"
:src="i.code === 'second_kill' ? require('@/static/index/tag1.png') :
i.code === 'recommended' ? require('@/static/index/tag3.png') :
require('@/static/index/tag2.png')">
2 years ago
</view>
2 years ago
<!-- <view class="price">{{max.startingPrice}}</view> -->
<UiMoney class="price" :money="max.startingPrice" prefix></UiMoney>
<view class="img-box">
2 years ago
<image class="img" mode="aspectFit" :src="max.recommendPicture"/>
</view>
</view>
3 years ago
<view class="min" @click="$Router.push(`/goodsDetail?id=${minOne.id}`)">
2 years ago
<view class="title">{{minOne.title}}</view>
<view class="min--info-box">
<view class="min--info-box-right">
2 years ago
<view class="desc">{{minOne.subtitle}}</view>
<view class="tag">
2 years ago
<image v-for="i in minOne.labelList" :key="i.code"
:src="i.code === 'second_kill' ? require('@/static/index/tag1.png') :
i.code === 'recommended' ? require('@/static/index/tag3.png') :
require('@/static/index/tag2.png')">
</view>
2 years ago
<UiMoney class="price" :money="minOne.startingPrice" prefix></UiMoney>
</view>
<view class="img-box">
2 years ago
<image class="img" mode="aspectFit" :src="minOne.recommendPicture"/>
</view>
</view>
</view>
3 years ago
<view class="min" @click="$Router.push(`/goodsDetail?id=${minTwo.id}`)">
2 years ago
<view class="title">{{minTwo.title}}</view>
<view class="min--info-box">
<view class="min--info-box-right">
2 years ago
<view class="desc">{{minTwo.subtitle}}</view>
<view class="tag">
2 years ago
<image v-for="i in minTwo.labelList" :key="i.code"
:src="i.code === 'second_kill' ? require('@/static/index/tag1.png') :
i.code === 'recommended' ? require('@/static/index/tag3.png') :
require('@/static/index/tag2.png')">
2 years ago
</view>
2 years ago
<UiMoney class="price" :money="minTwo.startingPrice" prefix></UiMoney>
</view>
<view class="img-box">
2 years ago
<image class="img" mode="aspectFit" :src="minTwo.recommendPicture"/>
</view>
</view>
3 years ago
</view>
</view>
</template>
<script>
2 years ago
import UiMoney from '../../../components/UiMoney.vue'
export default {
2 years ago
components: { UiMoney },
data(){
return{}
},
props:{
data : {
type : Array,
3 years ago
default : () => ([])
}
},
computed:{
max (){
return this.data[0] || {}
},
minOne (){
return this.data[1] || {}
},
minTwo (){
return this.data[2] || {}
}
}
}
</script>
3 years ago
<style lang="scss" scoped>
.pick{
margin: 0 30rpx;
height: 450rpx;
display: flex;
flex-flow: column wrap;
justify-content: space-between;
.title,.desc{
2 years ago
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
2 years ago
line-height: 24rpx;
padding: 10rpx 20rpx 0;
}
.title{
2 years ago
padding-top: 20rpx;
line-height: 28rpx;
2 years ago
font-weight: bold;
}
2 years ago
.tag{
padding-left: 20rpx;
padding-top: 20rpx;
image{
width: 60rpx;
height: 32rpx;
margin-right: 4rpx;
}
}
.desc{
color: $color-grey4;
font-size: 22rpx;
}
.price{
2 years ago
margin: 16rpx 0 0 20rpx;
}
}
.max{
width: 335rpx;
height: 450rpx;
background: $color-grey0;
border-radius: 8rpx;
.img-box{
2 years ago
overflow: hidden;
width: 100%;
}
.img{
width: 260rpx;
height: 260rpx;
2 years ago
margin-left: 66rpx;
float: right;
}
}
.min{
width: 335rpx;
height: 215rpx;
background: $color-grey0;
border-radius: 8rpx;
2 years ago
margin-left: 20rpx;
&--info-box{
display: flex;
justify-content: space-between;
}
&--info-box-right{
width: 180rpx;
}
.img{
width: 160rpx;
height: 160rpx;
3 years ago
}
2 years ago
.desc{
margin-top: 0;
}
}
/deep/ .price{
text{
color: $color-yellow4;
font-size: $font-size-lg;
2 years ago
line-height: $font-size-lg;
font-weight: bold;
2 years ago
}
.ui-money--prefix{
font-size: $font-size-sm;
2 years ago
line-height: $font-size-sm;
2 years ago
}
3 years ago
}
</style>