【界面优化】优化装修拼团单列商品列表样式
parent
47f4295316
commit
ef3a82ee14
|
@ -1,37 +1,38 @@
|
||||||
<!-- 装修组件 - 拼团 -->
|
<!-- 装修组件 - 拼团 -->
|
||||||
<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" class="goods-card-box" :key="product.id" :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"
|
||||||
padding: data.space + 'rpx',
|
size="sm"
|
||||||
},
|
:goodsFields="goodsFields"
|
||||||
]">
|
:tagStyle="badge"
|
||||||
<s-goods-column class="goods-card" size="sm" :goodsFields="data.fields" :tagStyle="tagStyle"
|
:data="product"
|
||||||
:data="product" :titleColor="data.fields.name?.color" :topRadius="data.borderRadiusTop"
|
:titleColor="data.fields.name?.color"
|
||||||
:bottomRadius="data.borderRadiusBottom" @click="
|
:topRadius="data.borderRadiusTop"
|
||||||
sheep.$router.go('/pages/goods/groupon', {
|
:bottomRadius="data.borderRadiusBottom"
|
||||||
id: props.data.activityId,
|
@click="sheep.$router.go('/pages/goods/groupon', { id: props.data.activityId, })">
|
||||||
})
|
</s-goods-column>
|
||||||
"></s-goods-column>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 样式2 一行一个 图片左 文案右 -->
|
<!-- 样式2 一行一个 图片左 文案右 -->
|
||||||
<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
|
||||||
<s-goods-column class="goods-card" size="lg" :goodsFields="data.fields" :tagStyle="tagStyle"
|
class="goods-card" size="lg"
|
||||||
:data="product" :titleColor="data.fields.name?.color"
|
:grouponTag="true"
|
||||||
:subTitleColor="data.fields.introduction?.color" :topRadius="data.borderRadiusTop"
|
:goodsFields="goodsFields"
|
||||||
:bottomRadius="data.borderRadiusBottom" @click="
|
:tagStyle="badge"
|
||||||
sheep.$router.go('/pages/goods/groupon', {
|
:data="product"
|
||||||
id: props.data.activityId,
|
:titleColor="data.fields.name?.color"
|
||||||
})
|
:subTitleColor="data.fields.introduction?.color"
|
||||||
">
|
:topRadius="data.borderRadiusTop"
|
||||||
|
:bottomRadius="data.borderRadiusBottom"
|
||||||
|
@click="sheep.$router.go('/pages/goods/groupon', { 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>
|
||||||
|
@ -47,6 +48,7 @@
|
||||||
import {
|
import {
|
||||||
computed,
|
computed,
|
||||||
onMounted,
|
onMounted,
|
||||||
|
reactive,
|
||||||
ref
|
ref
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
|
@ -55,28 +57,46 @@
|
||||||
|
|
||||||
// 接收参数
|
// 接收参数
|
||||||
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,
|
||||||
marginRight
|
marginRight
|
||||||
} = props.styles;
|
} = props.styles;
|
||||||
|
|
||||||
// 购买按钮样式
|
// 购买按钮样式(暂未实现)
|
||||||
const buyStyle = computed(() => {
|
const buyStyle = computed(() => {
|
||||||
let btnBuy = props.data.btnBuy;
|
let btnBuy = props.data.btnBuy;
|
||||||
if (btnBuy?.type === 'text') {
|
if (btnBuy?.type === 'text') {
|
||||||
|
@ -127,6 +147,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%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue