|
|
|
@ -1,56 +1,24 @@ |
|
|
|
<template> |
|
|
|
<!-- 商品组 --> |
|
|
|
<view class="diy-goods" :style="{ background: itemStyle.background }"> |
|
|
|
<view class="goods-list" :class="[`display__${itemStyle.display}`, `column__${itemStyle.column}`]"> |
|
|
|
<scroll-view :scroll-x="itemStyle.display === 'slide'"> |
|
|
|
<view class="diy-goods"> |
|
|
|
<view class="goods-list display__list column__2"> |
|
|
|
<scroll-view> |
|
|
|
<view class="goods-item" v-for="(dataItem, index) in dataList" :key="index" @click="onTargetGoods(dataItem.goods_id)"> |
|
|
|
|
|
|
|
<!-- 单列商品 --> |
|
|
|
<block v-if="itemStyle.column === 1"> |
|
|
|
<view class="dis-flex"> |
|
|
|
<!-- 商品图片 --> |
|
|
|
<view class="goods-item_left"> |
|
|
|
<image class="image" :src="dataItem.goods_image"></image> |
|
|
|
</view> |
|
|
|
<view class="goods-item_right"> |
|
|
|
<!-- 商品名称 --> |
|
|
|
<view v-if="itemStyle.show.includes('goodsName')" class="goods-name"> |
|
|
|
<text class="twoline-hide">{{ dataItem.goods_name }}</text> |
|
|
|
</view> |
|
|
|
<view class="goods-item_desc"> |
|
|
|
<!-- 商品卖点 --> |
|
|
|
<view v-if="itemStyle.show.includes('sellingPoint')" class="desc-selling_point dis-flex"> |
|
|
|
<text class="oneline-hide">{{ dataItem.selling_point }}</text> |
|
|
|
</view> |
|
|
|
<!-- 商品销量 --> |
|
|
|
<view v-if="itemStyle.show.includes('goodsSales')" class="desc-goods_sales dis-flex"> |
|
|
|
<text>已售{{ dataItem.goods_sales }}件</text> |
|
|
|
</view> |
|
|
|
<!-- 商品价格 --> |
|
|
|
<view class="desc_footer"> |
|
|
|
<text v-if="itemStyle.show.includes('goodsPrice')" class="price_x">¥{{ dataItem.goods_price_min }}</text> |
|
|
|
<text class="price_y col-9" |
|
|
|
v-if="itemStyle.show.includes('linePrice') && dataItem.line_price_min > 0">¥{{ dataItem.line_price_min }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</block> |
|
|
|
<!-- 多列商品 --> |
|
|
|
<block v-else> |
|
|
|
<block> |
|
|
|
<!-- 商品图片 --> |
|
|
|
<view class="goods-image"> |
|
|
|
<image class="image" mode="aspectFill" :src="dataItem.goods_image"></image> |
|
|
|
</view> |
|
|
|
<view class="detail"> |
|
|
|
<!-- 商品标题 --> |
|
|
|
<view v-if="itemStyle.show.includes('goodsName')" class="goods-name"> |
|
|
|
<view class="goods-name"> |
|
|
|
<text class="twoline-hide">{{ dataItem.goods_name }}</text> |
|
|
|
</view> |
|
|
|
<!-- 商品价格 --> |
|
|
|
<view class="detail-price oneline-hide"> |
|
|
|
<text v-if="itemStyle.show.includes('goodsPrice')" class="goods-price f-30 col-m">¥{{ dataItem.goods_price_min }}</text> |
|
|
|
<text v-if="itemStyle.show.includes('linePrice') && dataItem.line_price_min > 0" |
|
|
|
<text class="goods-price f-30 col-m">¥{{ dataItem.goods_price_min }}</text> |
|
|
|
<text v-if="dataItem.line_price_min > 0" |
|
|
|
class="line-price col-9 f-24">¥{{ dataItem.line_price_min }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -101,8 +69,9 @@ |
|
|
|
box-sizing: border-box; |
|
|
|
|
|
|
|
.goods-item { |
|
|
|
// background-color: #fff; |
|
|
|
box-sizing: border-box; |
|
|
|
padding: 6rpx; |
|
|
|
padding: 16rpx; |
|
|
|
|
|
|
|
.goods-image { |
|
|
|
position: relative; |
|
|
|
|