| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- <template>
- <view class="hot-item">
- <!-- Rank -->
- <view class="rank-col">
- <image v-if="rank === 1" src="/pages-sell/static/hot/icon-first.png" class="rank-icon" mode="widthFix"></image>
- <image v-else-if="rank === 2" src="/pages-sell/static/hot/icon-second.png" class="rank-icon" mode="widthFix"></image>
- <image v-else-if="rank === 3" src="/pages-sell/static/hot/icon-third.png" class="rank-icon" mode="widthFix"></image>
- <text v-else class="rank-text">{{ rank < 10 ? '0' + rank : rank }}</text>
- </view>
- <!-- Book Info -->
- <view class="book-info">
- <image :src="item.cover" class="book-cover" mode="aspectFill"></image>
-
- <view class="info-right">
- <text class="title">{{ item.title }}</text>
- <text class="author">{{ item.author }}</text>
-
- <view class="bottom-row">
- <view class="price-box">
- <text class="currency">¥</text>
- <text class="price">{{ item.price }}</text>
- <text class="original">¥{{ item.originalPrice }}</text>
- </view>
-
- <view class="cart-btn">
- <text>加入购物车</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'HotSellItem',
- props: {
- rank: {
- type: Number,
- required: true
- },
- item: {
- type: Object,
- required: true
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .hot-item {
- display: flex;
- align-items: center;
- padding: 30rpx 0;
- border-bottom: 1rpx solid #F0F0F0;
- .rank-col {
- width: 80rpx;
- display: flex;
- justify-content: center;
- margin-right: 10rpx;
- .rank-icon {
- width: 60rpx;
- height: 60rpx;
- }
- .rank-text {
- font-family: Arial-BoldItalicMT;
- font-size: 36rpx;
- color: #706F6D;
- font-style: italic;
- font-weight: bold;
- }
- }
- .book-info {
- flex: 1;
- display: flex;
- align-items: center;
- .book-cover {
- width: 140rpx;
- height: 180rpx;
- border-radius: 4rpx;
- background-color: #f5f5f5;
- margin-right: 24rpx;
- flex-shrink: 0;
- }
- .info-right {
- flex: 1;
- height: 190rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- padding: 10rpx 0;
- .title {
- font-size: 36rpx;
- color: #303030;
- font-weight: bold;
- line-height: 1.2;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .author {
- font-size: 24rpx;
- color: #999999;
- }
- .bottom-row {
- display: flex;
- justify-content: space-between;
- align-items: flex-end;
- .price-box {
- display: flex;
- align-items: baseline;
- .currency {
- font-size: 24rpx;
- color: #D81A00;
- font-weight: bold;
- }
- .price {
- font-size: 36rpx;
- color: #D81A00;
- font-weight: bold;
- margin-right: 12rpx;
- }
- .original {
- font-size: 24rpx;
- color: #999999;
- text-decoration: line-through;
- }
- }
- .cart-btn {
- width: 160rpx;
- height: 56rpx;
- background: linear-gradient(90deg, #4ED964 0%, #38C248 100%);
- border-radius: 28rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- text {
- font-size: 24rpx;
- color: #fff;
- font-weight: 500;
- }
- }
- }
- }
- }
- }
- </style>
|