【界面优化】优化装修秒杀列表的样式,补全关键信息

pull/82/head
卢越 2024-08-18 13:03:52 +08:00
parent ef3a82ee14
commit f10c9ec16c
1 changed files with 50 additions and 28 deletions

View File

@ -2,37 +2,39 @@
<template> <template>
<view> <view>
<!-- 样式一三列 - 上图下文 --> <!-- 样式一三列 - 上图下文 -->
<view v-if="layoutType === 'threeCol'" class="goods-sm-box ss-flex ss-flex-wrap" <view v-if="layoutType === 'threeCol'" class="goods-sm-box ss-flex ss-flex-wrap" :style="[{ margin: '-' + data.space + 'rpx' }]">
:style="[{ margin: '-' + data.space + 'rpx' }]"> <view v-for="product in productList" :key="product.id" class="goods-card-box" :style="[{padding: data.space + 'rpx',},]">
<view v-for="product in productList" :key="product.id" class="goods-card-box" :style="[ <s-goods-column
{ class="goods-card" size="sm"
padding: data.space + 'rpx', :goodsFields="goodsFields"
}, :tagStyle="badge"
]"> :data="product"
<s-goods-column class="goods-card" size="sm" :goodsFields="data.fields" :tagStyle="tagStyle" :titleColor="data.fields.name?.color"
:data="product" :titleColor="data.fields.name?.color" :topRadius="data.borderRadiusTop" :topRadius="data.borderRadiusTop"
:bottomRadius="data.borderRadiusBottom" @click=" :bottomRadius="data.borderRadiusBottom"
sheep.$router.go('/pages/goods/seckill', { @click="sheep.$router.go('/pages/goods/seckill', { id: props.data.activityId, })">
id: props.data.activityId, </s-goods-column>
})
"></s-goods-column>
</view> </view>
</view> </view>
<!-- 样式二一列 - 左图右文 --> <!-- 样式二一列 - 左图右文 -->
<view class="goods-box" v-if="layoutType === 'oneCol'"> <view class="goods-box" v-if="layoutType === 'oneCol'">
<view class="goods-list" v-for="(product, index) in productList" :key="index" <view class="goods-list" v-for="(product, index) in productList" :key="index"
:style="[{ marginBottom: space + 'px' }]"> :style="[{ marginBottom: space + 'px' }]">
<s-goods-column class="goods-card" size="lg" :goodsFields="data.fields" :tagStyle="tagStyle" <s-goods-column
:data="product" :titleColor="data.fields.name?.color" class="goods-card"
:subTitleColor="data.fields.introduction?.color" :topRadius="data.borderRadiusTop" size="lg"
:bottomRadius="data.borderRadiusBottom" @click=" :goodsFields="goodsFields"
sheep.$router.go('/pages/goods/seckill', { :seckillTag="true"
id: props.data.activityId, :tagStyle="badge"
}) :data="product"
"> :titleColor="data.fields.name?.color"
:subTitleColor="data.fields.introduction?.color"
:topRadius="data.borderRadiusTop"
:bottomRadius="data.borderRadiusBottom"
@click="sheep.$router.go('/pages/goods/seckill', { id: props.data.activityId, })">
<template v-slot:cart> <template v-slot:cart>
<button class="ss-reset-button cart-btn" :style="[buyStyle]"> <button class="ss-reset-button cart-btn" :style="[buyStyle]">
{{ btnBuy?.type === 'text' ? btnBuy.text : '' }} {{ btnBuy?.type === 'text' ? btnBuy.text : '立即秒杀' }}
</button> </button>
</template> </template>
</s-goods-column> </s-goods-column>
@ -50,6 +52,7 @@
import { import {
computed, computed,
onMounted, onMounted,
reactive,
ref ref
} from 'vue'; } from 'vue';
import sheep from '@/sheep'; import sheep from '@/sheep';
@ -58,21 +61,39 @@
// //
const props = defineProps({ const props = defineProps({
//
data: { data: {
type: Object, type: Object,
default () {}, default: () => ({}),
}, },
//
styles: { styles: {
type: Object, type: Object,
default () {}, default: () => ({}),
}, },
}); });
//
const goodsFields = reactive({
//
price: { show: true },
//
stock: { show: true },
//
name: { show: true },
//
introduction: { show: true },
//
marketPrice: { show: true },
//
salesCount: { show: true },
});
let { let {
layoutType, layoutType,
tagStyle, badge,
btnBuy, btnBuy,
space space,
} = props.data; } = props.data;
let { let {
marginLeft, marginLeft,
@ -139,6 +160,7 @@
border-radius: 25rpx; border-radius: 25rpx;
font-size: 24rpx; font-size: 24rpx;
color: #fff; color: #fff;
background: linear-gradient(90deg, #ff6600 0%, #fe832a 100%);
} }
} }