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
* @LastEditTime: 2022-05-05 10:45:44
3 years ago
* @Description: file content
-->
<template>
<view class="pick">
3 years ago
<view class="max" @click="$Router.push(`/goodsDetail?id=${max.id}`)">
3 years ago
<view class="title">{{max.title}}</view>
3 years ago
<view class="desc">{{max.subtitle}}</view>
<view class="tag">
3 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')">
3 years ago
</view>
3 years ago
<!-- <view class="price">{{max.startingPrice}}</view> -->
<UiMoney class="price" :money="max.startingPrice" prefix></UiMoney>
<view class="img-box">
<image class="img" :src="max.recommendPicture"/>
</view>
</view>
3 years ago
<view class="min" @click="$Router.push(`/goodsDetail?id=${minOne.id}`)">
3 years ago
<view class="title">{{minOne.title}}</view>
<view class="min--info-box">
<view class="min--info-box-right">
3 years ago
<view class="desc">{{minOne.subtitle}}</view>
<view class="tag">
3 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>
3 years ago
<UiMoney class="price" :money="minOne.startingPrice" prefix></UiMoney>
</view>
<view class="img-box">
3 years ago
<image class="img" :src="minOne.recommendPicture"/>
</view>
</view>
</view>
3 years ago
<view class="min" @click="$Router.push(`/goodsDetail?id=${minTwo.id}`)">
3 years ago
<view class="title">{{minTwo.title}}</view>
<view class="min--info-box">
<view class="min--info-box-right">
3 years ago
<view class="desc">{{minTwo.subtitle}}</view>
<view class="tag">
3 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')">
3 years ago
</view>
3 years ago
<UiMoney class="price" :money="minTwo.startingPrice" prefix></UiMoney>
</view>
<view class="img-box">
3 years ago
<image class="img" :src="minTwo.recommendPicture"/>
</view>
</view>
3 years ago
</view>
</view>
</template>
<script>
3 years ago
import UiMoney from '../../../components/UiMoney.vue'
export default {
3 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{
3 years ago
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
3 years ago
line-height: 24rpx;
padding: 10rpx 20rpx 0;
}
.title{
3 years ago
padding-top: 20rpx;
line-height: 28rpx;
3 years ago
font-weight: bold;
}
3 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{
3 years ago
margin: 20rpx 0 10rpx 20rpx;
}
}
.max{
width: 335rpx;
height: 450rpx;
background: $color-grey0;
border-radius: 8rpx;
.img-box{
3 years ago
overflow: hidden;
width: 100%;
}
.img{
width: 260rpx;
height: 260rpx;
3 years ago
margin-left: 66rpx;
float: right;
}
}
.min{
width: 335rpx;
height: 215rpx;
background: $color-grey0;
border-radius: 8rpx;
3 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
}
3 years ago
.desc{
margin-top: 0;
}
}
/deep/ .price{
text{
color: $color-yellow4;
font-size: $font-size-lg;
3 years ago
line-height: $font-size-lg;
font-weight: bold;
3 years ago
}
.ui-money--prefix{
font-size: $font-size-sm;
3 years ago
line-height: $font-size-sm;
3 years ago
}
3 years ago
}
</style>