197 lines
4.1 KiB
Vue
197 lines
4.1 KiB
Vue
<template>
|
||
<view class="container">
|
||
<view class="mk-title">
|
||
<text class="title"> {{ commodityDTO.title }}</text>
|
||
<image class="wave" src="@/static/wave_icon.png" mode="widthFix"/>
|
||
</view>
|
||
<view class="container-scroll">
|
||
<view class="mk-card-item" v-for="(item, index) in commodityDTO.commodityList" :key="item.commodityName">
|
||
<view class="card-badge">超值推荐</view>
|
||
<image class="card-img" :src="item.commodityIcon" mode="widthFix" />
|
||
<view class="card-content">
|
||
<view class="card-title-column">
|
||
<text class="card-title">{{ item.commodityName }}</text>
|
||
<view class="card-tags">
|
||
<text class="card-tag">随时可退</text>
|
||
<text class="card-tag">民俗表演</text>
|
||
</view>
|
||
</view>
|
||
<view class="card-desc">· 往返观光车票</view>
|
||
<view class="card-desc">· 营业时间:9:00-22:00</view>
|
||
<view class="card-bottom-row">
|
||
<view class="card-price-row">
|
||
<text class="card-price-fu">¥</text>
|
||
<text class="card-price">{{ item.commodityPrice }}</text>
|
||
<text class="card-unit">/人</text>
|
||
</view>
|
||
|
||
<text class="card-btn">下单</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { defineProps } from 'vue'
|
||
const props = defineProps({
|
||
commodityDTO: {
|
||
type: Object,
|
||
default: {}
|
||
}
|
||
})
|
||
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.container {
|
||
.mk-title {
|
||
padding: 4px 0;
|
||
display: inline-block;
|
||
position: relative;
|
||
.title {
|
||
font-weight: 400;
|
||
font-size: 16px;
|
||
color: #000000;
|
||
z-index: 2;
|
||
position: relative;
|
||
}
|
||
.wave {
|
||
position: absolute;
|
||
bottom: 2px;
|
||
left: 0;
|
||
width: 100%;
|
||
z-index: 1;
|
||
}
|
||
}
|
||
|
||
.container-scroll {
|
||
display: flex;
|
||
flex-direction: row;
|
||
overflow-x: auto;
|
||
overflow-y: hidden;
|
||
margin: 4px 0;
|
||
|
||
/* 隐藏滚动条 */
|
||
scrollbar-width: none;
|
||
&::-webkit-scrollbar {
|
||
display: none;
|
||
}
|
||
|
||
.mk-card-item {
|
||
position: relative;
|
||
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: start;
|
||
width: 188px;
|
||
height: 244px;
|
||
background-color: #ffffff;
|
||
border-radius: 10px;
|
||
margin-right: 8px;
|
||
padding-bottom: 12px;
|
||
|
||
.card-badge {
|
||
position: absolute;
|
||
top: 8px;
|
||
left: 8px;
|
||
background: #ffe7b2;
|
||
color: #b97a00;
|
||
font-size: 12px;
|
||
padding: 2px 8px;
|
||
border-radius: 4px;
|
||
z-index: 2;
|
||
}
|
||
|
||
.card-img {
|
||
width: 188px;
|
||
height: 114px;
|
||
border-radius: 10px;
|
||
}
|
||
|
||
.card-content {
|
||
box-sizing: border-box;
|
||
padding: 10px 12px 0 12px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: start;
|
||
width: 100%;
|
||
}
|
||
|
||
.card-title-column {
|
||
display: flex;
|
||
align-items: start;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.card-title {
|
||
font-size: 16px;
|
||
font-weight: bold;
|
||
color: #222;
|
||
}
|
||
|
||
.card-tags {
|
||
display: flex;
|
||
flex-direction: row;
|
||
align-items: start;
|
||
padding: 6px 0;
|
||
}
|
||
|
||
.card-tag {
|
||
background: #f5f5f5;
|
||
color: #ff6600;
|
||
font-size: 12px;
|
||
border-radius: 4px;
|
||
padding: 0 6px;
|
||
margin-left: 2px;
|
||
}
|
||
|
||
.card-desc {
|
||
font-size: 13px;
|
||
color: #888;
|
||
margin-top: 2px;
|
||
}
|
||
|
||
.card-bottom-row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-top: 8px;
|
||
width: 100%;
|
||
}
|
||
|
||
.card-price-row {
|
||
.card-price-fu {
|
||
color: #ff6600;
|
||
font-size: 11px;
|
||
font-weight: normal;
|
||
}
|
||
|
||
.card-price {
|
||
color: #ff6600;
|
||
font-size: 16px;
|
||
font-weight: bold;
|
||
}
|
||
.card-unit {
|
||
font-size: 11px;
|
||
color: #888;
|
||
font-weight: normal;
|
||
margin-left: 2px;
|
||
}
|
||
}
|
||
|
||
.card-btn {
|
||
background: #ff6600;
|
||
color: #fff;
|
||
font-size: 15px;
|
||
border-radius: 20px;
|
||
padding: 0 18px;
|
||
height: 32px;
|
||
line-height: 32px;
|
||
}
|
||
}
|
||
|
||
}
|
||
}
|
||
</style> |