98 lines
1.9 KiB
Vue
98 lines
1.9 KiB
Vue
<template>
|
|
<view class="hot-devices">
|
|
<view class="hot-devices__head">
|
|
<text class="hot-devices__title">热门设备</text>
|
|
<text class="hot-devices__link" @tap="$emit('mall')">去商城看看 ></text>
|
|
</view>
|
|
<scroll-view class="hot-devices__scroll" scroll-x :show-scrollbar="false">
|
|
<view class="hot-devices__list">
|
|
<view v-for="item in items" :key="item.id" class="hot-devices__card">
|
|
<view class="hot-devices__img" />
|
|
<text class="hot-devices__name">{{ item.name }}</text>
|
|
<text class="hot-devices__desc">{{ item.desc }}</text>
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import type { HotDeviceItem } from '../../device.types'
|
|
|
|
defineProps<{
|
|
items: HotDeviceItem[]
|
|
}>()
|
|
|
|
defineEmits<{
|
|
mall: []
|
|
}>()
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.hot-devices {
|
|
padding: 0 32rpx 32rpx;
|
|
}
|
|
|
|
.hot-devices__head {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
margin-bottom: 24rpx;
|
|
}
|
|
|
|
.hot-devices__title {
|
|
font-size: 32rpx;
|
|
font-weight: 600;
|
|
color: $color-text;
|
|
}
|
|
|
|
.hot-devices__link {
|
|
font-size: 26rpx;
|
|
color: $color-text-secondary;
|
|
}
|
|
|
|
.hot-devices__scroll {
|
|
width: 100%;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.hot-devices__list {
|
|
display: inline-flex;
|
|
gap: 24rpx;
|
|
padding-bottom: 8rpx;
|
|
}
|
|
|
|
.hot-devices__card {
|
|
display: inline-flex;
|
|
flex-direction: column;
|
|
width: 300rpx;
|
|
padding: 24rpx;
|
|
background: #fff;
|
|
border-radius: 24rpx;
|
|
box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.04);
|
|
vertical-align: top;
|
|
white-space: normal;
|
|
}
|
|
|
|
.hot-devices__img {
|
|
width: 100%;
|
|
height: 200rpx;
|
|
background: linear-gradient(145deg, #f0f2f5 0%, #e8eaed 100%);
|
|
border-radius: 16rpx;
|
|
margin-bottom: 20rpx;
|
|
}
|
|
|
|
.hot-devices__name {
|
|
font-size: 28rpx;
|
|
font-weight: 600;
|
|
color: $color-text;
|
|
margin-bottom: 8rpx;
|
|
}
|
|
|
|
.hot-devices__desc {
|
|
font-size: 22rpx;
|
|
color: $color-text-secondary;
|
|
line-height: 1.4;
|
|
}
|
|
</style>
|