待商榷
parent
2396819644
commit
a6543dc7ca
|
|
@ -123,6 +123,7 @@
|
|||
if (code !== 0) {
|
||||
return;
|
||||
}
|
||||
console.log('nibuhao ')
|
||||
state.pagination.list = _.concat(state.pagination.list, data.list);
|
||||
state.pagination.total = data.total;
|
||||
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
||||
|
|
|
|||
|
|
@ -14,7 +14,37 @@
|
|||
<!-- 商品轮播图 -->
|
||||
<su-swiper class="ss-m-b-14" isPreview :list="formatGoodsSwiper(state.goodsInfo.sliderPicUrls)"
|
||||
otStyle="tag" imageMode="widthFix" dotCur="bg-mask-40" :seizeHeight="750" />
|
||||
|
||||
<!-- 限时折扣 -->
|
||||
<view class="discount">
|
||||
<image class="disImg" src="../../static/images/dis.png"></image>
|
||||
<view class="discountCont">
|
||||
<view class="disContT">
|
||||
<view class="disContT1">
|
||||
<view class="disContT1P">
|
||||
¥0.7
|
||||
</view>
|
||||
<view class="disContT1End">
|
||||
限时到手¥0.4
|
||||
</view>
|
||||
</view>
|
||||
<view class="disContT2">
|
||||
限时折扣
|
||||
</view>
|
||||
</view>
|
||||
<view class="disContB">
|
||||
<view class="disContB1">
|
||||
价格:¥1 丨 剩余:100
|
||||
</view>
|
||||
<view class="disContB2">
|
||||
距结束仅剩
|
||||
<countDown :tipText="' '" :bgColor="bgColor" :dayText="':'" :hourText="':'"
|
||||
:minuteText="':'" :secondText="' '" :datatime="1725033600000 / 1000"
|
||||
:isDay="false" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 限时折扣 -->
|
||||
<!-- 价格+标题 -->
|
||||
<view class="title-card detail-card ss-p-y-40 ss-p-x-20">
|
||||
<view class="ss-flex ss-row-between ss-col-center ss-m-b-26">
|
||||
|
|
@ -34,15 +64,15 @@
|
|||
<!-- 满减送/限时折扣活动的提示 -->
|
||||
<div class="tag-content">
|
||||
<view class="tag-box ss-flex">
|
||||
<view class="tag ss-m-r-10" v-for="promos in state.activityInfo"
|
||||
:key="promos.id" @tap="onActivity">
|
||||
<view class="tag ss-m-r-10" v-for="promos in state.activityInfo" :key="promos.id"
|
||||
@tap="onActivity">
|
||||
{{ promos.name }}
|
||||
</view>
|
||||
</view>
|
||||
</div>
|
||||
|
||||
<!-- 优惠劵 -->
|
||||
<view class="get-coupon-box ss-flex ss-col-center ss-m-l-20" @tap="state.showModel = true"
|
||||
<!-- 优惠劵@tap="state.showModel = true" -->
|
||||
<view class="get-coupon-box ss-flex ss-col-center ss-m-l-20" @tap="onActivity"
|
||||
v-if="state.couponInfo.length">
|
||||
<view class="discounts-title ss-m-r-8">领券</view>
|
||||
<text class="cicon-forward"></text>
|
||||
|
|
@ -87,8 +117,8 @@
|
|||
</detail-tabbar>
|
||||
|
||||
<!-- 优惠劵弹窗 -->
|
||||
<s-coupon-get v-model="state.couponInfo" :show="state.showModel" @close="state.showModel = false"
|
||||
@get="onGet" />
|
||||
<!-- <s-coupon-get v-model="state.couponInfo" :show="state.showModel" @close="state.showModel = false"
|
||||
@get="onGet" /> -->
|
||||
|
||||
<!-- 满减送/限时折扣活动弹窗 -->
|
||||
<s-activity-pop v-model="state.activityInfo" :show="state.showActivityModel"
|
||||
|
|
@ -99,13 +129,24 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, computed } from 'vue';
|
||||
import { onLoad, onPageScroll } from '@dcloudio/uni-app';
|
||||
import {
|
||||
reactive,
|
||||
computed,
|
||||
ref
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad,
|
||||
onPageScroll
|
||||
} from '@dcloudio/uni-app';
|
||||
import sheep from '@/sheep';
|
||||
import CouponApi from '@/sheep/api/promotion/coupon';
|
||||
import ActivityApi from '@/sheep/api/promotion/activity';
|
||||
import FavoriteApi from '@/sheep/api/product/favorite';
|
||||
import { formatSales, formatGoodsSwiper, fen2yuan } from '@/sheep/hooks/useGoods';
|
||||
import {
|
||||
formatSales,
|
||||
formatGoodsSwiper,
|
||||
fen2yuan
|
||||
} from '@/sheep/hooks/useGoods';
|
||||
import detailNavbar from './components/detail/detail-navbar.vue';
|
||||
import detailCellSku from './components/detail/detail-cell-sku.vue';
|
||||
import detailTabbar from './components/detail/detail-tabbar.vue';
|
||||
|
|
@ -113,11 +154,20 @@
|
|||
import detailCommentCard from './components/detail/detail-comment-card.vue';
|
||||
import detailContentCard from './components/detail/detail-content-card.vue';
|
||||
import detailActivityTip from './components/detail/detail-activity-tip.vue';
|
||||
import { isEmpty } from 'lodash-es';
|
||||
import {
|
||||
isEmpty
|
||||
} from 'lodash-es';
|
||||
import SpuApi from '@/sheep/api/product/spu';
|
||||
|
||||
onPageScroll(() => {});
|
||||
|
||||
import countDown from '@/sheep/components/countDown/index.vue'
|
||||
const bgColor = {
|
||||
'bgColor': '#E93323',
|
||||
'Color': '#fff',
|
||||
'width': '44rpx',
|
||||
'timeTxtwidth': '16rpx',
|
||||
'isDay': true
|
||||
}
|
||||
const isLogin = computed(() => sheep.$store('user').isLogin);
|
||||
const state = reactive({
|
||||
goodsId: 0,
|
||||
|
|
@ -170,7 +220,9 @@
|
|||
|
||||
// 立即领取
|
||||
async function onGet(id) {
|
||||
const { code } = await CouponApi.takeCoupon(id);
|
||||
const {
|
||||
code
|
||||
} = await CouponApi.takeCoupon(id);
|
||||
if (code !== 0) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -203,12 +255,22 @@
|
|||
});
|
||||
|
||||
async function getCoupon() {
|
||||
const { code, data } = await CouponApi.getCouponTemplateList(state.goodsId, 2, 10);
|
||||
const {
|
||||
code,
|
||||
data
|
||||
} = await CouponApi.getCouponTemplateList(state.goodsId, 2, 10);
|
||||
if (code === 0) {
|
||||
state.couponInfo = data;
|
||||
}
|
||||
}
|
||||
|
||||
//获取结算信息
|
||||
const settleData = ref()
|
||||
async function getSettlementByIds(ids) {
|
||||
const { data } = await SpuApi.getSettlementProduct(ids);
|
||||
settleData.value = data
|
||||
console.log('结算信息',data)
|
||||
return data;
|
||||
}
|
||||
onLoad((options) => {
|
||||
// 非法参数
|
||||
if (!options.id) {
|
||||
|
|
@ -226,7 +288,7 @@
|
|||
// 加载到商品
|
||||
state.skeletonLoading = false;
|
||||
state.goodsInfo = res.data;
|
||||
|
||||
console.log('sku',res.data)
|
||||
// 加载是否收藏
|
||||
if (isLogin.value) {
|
||||
FavoriteApi.isFavoriteExists(state.goodsId, 'goods').then((res) => {
|
||||
|
|
@ -256,6 +318,8 @@
|
|||
}
|
||||
})
|
||||
});
|
||||
//获取结算信息
|
||||
getSettlementByIds(state.goodsId)
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -404,4 +468,101 @@
|
|||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
// 限时折扣
|
||||
.discount {
|
||||
width: 750rpx;
|
||||
height: 100rpx;
|
||||
// background-color: red;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.disImg {
|
||||
width: 750rpx;
|
||||
height: 100rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.discountCont {
|
||||
width: 680rpx;
|
||||
height: 90rpx;
|
||||
margin: 10rpx auto 0 auto;
|
||||
// background-color: gold;
|
||||
}
|
||||
|
||||
.disContT {
|
||||
width: 680rpx;
|
||||
height: 50rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.disContT1 {
|
||||
width: 300rpx;
|
||||
height: 50rpx;
|
||||
// background-color: green;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.disContT2 {
|
||||
width: 300rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
// background-color: green;
|
||||
font-size: 30rpx;
|
||||
text-align: end;
|
||||
color: white;
|
||||
font-weight: bolder;
|
||||
font-style: oblique 20deg;
|
||||
letter-spacing: .1rem;
|
||||
}
|
||||
|
||||
.disContT1P {
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.disContT1End {
|
||||
// width: 180rpx;
|
||||
padding: 0 10rpx;
|
||||
height: 30rpx;
|
||||
line-height: 28rpx;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
background-color: white;
|
||||
color: #ff3000;
|
||||
font-size: 23rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.disContB {
|
||||
width: 680rpx;
|
||||
height: 40rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 20rpx;
|
||||
color: white;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.disContB1 {
|
||||
width: 300rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.disContB2 {
|
||||
width: 300rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -118,7 +118,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive } from 'vue';
|
||||
import { reactive,ref } from 'vue';
|
||||
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
||||
import sheep from '@/sheep';
|
||||
import _ from 'lodash-es';
|
||||
|
|
@ -277,7 +277,16 @@
|
|||
if (code !== 0) {
|
||||
return;
|
||||
}
|
||||
state.pagination.list = _.concat(state.pagination.list, data.list);
|
||||
console.log('数据流',data)
|
||||
// 使用 map 提取每个对象的 id 属性
|
||||
const ids = data.list.map(item => item.id);
|
||||
// 使用 join 方法将 id 数组连接成一个用逗号分隔的字符串
|
||||
const idsString = ids.join(',');
|
||||
// 获取结算信息
|
||||
settleData.value = await getSettlementByIds(idsString)
|
||||
// 处理获得的数据
|
||||
const ms = enrichDataWithSkus(data.list,settleData.value)
|
||||
state.pagination.list = _.concat(state.pagination.list, ms);
|
||||
state.pagination.total = data.total;
|
||||
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
||||
mountMasonry();
|
||||
|
|
@ -291,7 +300,55 @@
|
|||
state.pagination.pageNo++;
|
||||
getList(state.currentSort, state.currentOrder);
|
||||
}
|
||||
//获取结算信息
|
||||
const settleData = ref()
|
||||
async function getSettlementByIds(ids) {
|
||||
const { data } = await SpuApi.getSettlementProduct(ids);
|
||||
// console.log('结算信息',data)
|
||||
return data;
|
||||
}
|
||||
|
||||
//计算展示价格的函数
|
||||
function enrichDataWithSkus(data, array) {
|
||||
// 创建一个映射,以 id 为键,存储 data 数组中的对象
|
||||
const dataMap = new Map(data.map(item => [item.id, { ...item }]));
|
||||
|
||||
// 遍历 array 数组
|
||||
array.forEach(item => {
|
||||
// 初始化 discountPrice 和 vipPrice 为 null
|
||||
let discountPrice = null;
|
||||
let vipPrice = null;
|
||||
let foundType4 = false;
|
||||
let foundType6 = false;
|
||||
|
||||
// 遍历 skus 数组,寻找 type 为 4 和 6 的首个条目
|
||||
item.skus.forEach(sku => {
|
||||
if (!foundType4 && sku.type === 4) {
|
||||
discountPrice = sku.price;
|
||||
foundType4 = true;
|
||||
}
|
||||
if (!foundType6 && sku.type === 6) {
|
||||
vipPrice = sku.price;
|
||||
foundType6 = true;
|
||||
}
|
||||
|
||||
// 如果已经找到 type 为 4 和 6 的条目,则不需要继续遍历
|
||||
if (foundType4 && foundType6) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
// 更新 dataMap 中对应的对象
|
||||
if (dataMap.has(item.id)) {
|
||||
dataMap.get(item.id).discountPrice = discountPrice;
|
||||
dataMap.get(item.id).vipPrice = vipPrice;
|
||||
dataMap.get(item.id).reward = item.reward;
|
||||
}
|
||||
});
|
||||
|
||||
// 返回更新后的数据数组
|
||||
return Array.from(dataMap.values());
|
||||
}
|
||||
onLoad((options) => {
|
||||
state.categoryId = options.categoryId;
|
||||
state.keyword = options.keyword;
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@
|
|||
if (code !== 0) {
|
||||
return;
|
||||
}
|
||||
console.log('nihao ')
|
||||
state.categoryList = handleTree(data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,18 @@ const SpuApi = {
|
|||
},
|
||||
});
|
||||
},
|
||||
// 获得商品结算信息
|
||||
getSettlementProduct: (ids) => {
|
||||
return request({
|
||||
url: '/trade/order/settlementProduct',
|
||||
method: 'GET',
|
||||
params: { ids },
|
||||
custom: {
|
||||
showLoading: false,
|
||||
showError: false,
|
||||
},
|
||||
});
|
||||
},
|
||||
// 获得商品 SPU 分页
|
||||
getSpuPage: (params) => {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -2,20 +2,23 @@
|
|||
<template>
|
||||
<su-popup :show="show" type="bottom" round="20" @close="emits('close')" showClose>
|
||||
<view class="model-box">
|
||||
<view class="title ss-m-t-16 ss-m-l-20 ss-flex">营销活动</view>
|
||||
<view class="title ss-m-t-16 ss-m-l-20 ss-flex">优惠</view>
|
||||
<scroll-view
|
||||
class="model-content ss-m-t-50"
|
||||
scroll-y
|
||||
:scroll-with-animation="false"
|
||||
:enable-back-to-top="true"
|
||||
>
|
||||
<view v-for="item in state.activityInfo" :key="item.id">
|
||||
<view class="ss-flex ss-col-top ss-m-b-40" @tap="onGoodsList(item)">
|
||||
<view class="model-content-tag ss-flex ss-row-center">满减</view>
|
||||
<view class="actBox" v-for="item in state.activityInfo" :key="item.id">
|
||||
<view class="boxCont ss-flex ss-col-top ss-m-b-40" @tap="onGoodsList(item)">
|
||||
<view class="model-content-tag ss-flex ss-row-center">活动</view>
|
||||
<view class="ss-m-l-20 model-content-title ss-flex-1">
|
||||
<view class="ss-m-b-24" v-for="rule in state.activityMap[item.id]?.rules" :key="rule">
|
||||
<view class="contBu ss-m-b-24" v-for="rule in state.activityMap[item.id]?.rules" :key="rule">
|
||||
{{ formatRewardActivityRule(state.activityMap[item.id], rule) }}
|
||||
</view>
|
||||
<view class="contBu ss-m-b-24">
|
||||
2024.08.05-2025.10.10
|
||||
</view>
|
||||
</view>
|
||||
<text class="cicon-forward" />
|
||||
</view>
|
||||
|
|
@ -45,7 +48,7 @@
|
|||
activityInfo: computed(() => props.modelValue),
|
||||
activityMap: {}
|
||||
});
|
||||
|
||||
console.log('shuju',state)
|
||||
watch(
|
||||
() => props.show,
|
||||
() => {
|
||||
|
|
@ -73,6 +76,7 @@
|
|||
.model-box {
|
||||
height: 60vh;
|
||||
.title {
|
||||
justify-content: center;
|
||||
font-size: 36rpx;
|
||||
height: 80rpx;
|
||||
font-weight: bold;
|
||||
|
|
@ -80,26 +84,50 @@
|
|||
}
|
||||
}
|
||||
.model-content {
|
||||
height: 300rpx;
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: red;
|
||||
.model-content-tag {
|
||||
background: rgba(#ff6911, 0.1);
|
||||
font-size: 24rpx;
|
||||
// background: rgba(#ff6911, 0.1);
|
||||
font-size: 35rpx;
|
||||
font-weight: 500;
|
||||
color: #ff6911;
|
||||
line-height: 42rpx;
|
||||
width: 68rpx;
|
||||
height: 32rpx;
|
||||
border-radius: 5rpx;
|
||||
line-height: 150rpx;
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
text-align: center;
|
||||
// border-radius: 5rpx;
|
||||
}
|
||||
.model-content-title {
|
||||
height: 150rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
background-color: gold;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cicon-forward {
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
// 新增的
|
||||
.actBox{
|
||||
width: 700rpx;
|
||||
height: 150rpx;
|
||||
background-color: #fff2f2;
|
||||
margin: 10rpx auto;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.boxCont{
|
||||
width: 700rpx;
|
||||
height: 150rpx;
|
||||
align-items: center;
|
||||
}
|
||||
.contBu{
|
||||
height: 75rpx;
|
||||
line-height: 75rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@
|
|||
/**
|
||||
* 商品卡片
|
||||
*/
|
||||
import { computed, reactive, onMounted } from 'vue';
|
||||
import { computed, reactive, onMounted,ref } from 'vue';
|
||||
import sheep from '@/sheep';
|
||||
import SpuApi from '@/sheep/api/product/spu';
|
||||
|
||||
|
|
@ -202,6 +202,8 @@
|
|||
*/
|
||||
function calculateGoodsColumn(height = 0, where = 'left') {
|
||||
// 处理完
|
||||
console.log('用来处理的数据',state.goodsList)
|
||||
console.log(11111)
|
||||
if (!state.goodsList[count]) return;
|
||||
// 增加列的高度
|
||||
if (where === 'left') leftHeight += height;
|
||||
|
|
@ -224,16 +226,69 @@
|
|||
*/
|
||||
async function getGoodsListByIds(ids) {
|
||||
const { data } = await SpuApi.getSpuListByIds(ids);
|
||||
// console.log('商品信息',data)
|
||||
return data;
|
||||
}
|
||||
//获取结算信息
|
||||
const settleData = ref()
|
||||
async function getSettlementByIds(ids) {
|
||||
const { data } = await SpuApi.getSettlementProduct(ids);
|
||||
// console.log('结算信息',data)
|
||||
return data;
|
||||
}
|
||||
|
||||
//计算展示价格的函数
|
||||
function enrichDataWithSkus(data, array) {
|
||||
// 创建一个映射,以 id 为键,存储 data 数组中的对象
|
||||
const dataMap = new Map(data.map(item => [item.id, { ...item }]));
|
||||
|
||||
// 遍历 array 数组
|
||||
array.forEach(item => {
|
||||
// 初始化 discountPrice 和 vipPrice 为 null
|
||||
let discountPrice = null;
|
||||
let vipPrice = null;
|
||||
let foundType4 = false;
|
||||
let foundType6 = false;
|
||||
|
||||
// 遍历 skus 数组,寻找 type 为 4 和 6 的首个条目
|
||||
item.skus.forEach(sku => {
|
||||
if (!foundType4 && sku.type === 4) {
|
||||
discountPrice = sku.price;
|
||||
foundType4 = true;
|
||||
}
|
||||
if (!foundType6 && sku.type === 6) {
|
||||
vipPrice = sku.price;
|
||||
foundType6 = true;
|
||||
}
|
||||
|
||||
// 如果已经找到 type 为 4 和 6 的条目,则不需要继续遍历
|
||||
if (foundType4 && foundType6) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
// 更新 dataMap 中对应的对象
|
||||
if (dataMap.has(item.id)) {
|
||||
dataMap.get(item.id).discountPrice = discountPrice;
|
||||
dataMap.get(item.id).vipPrice = vipPrice;
|
||||
dataMap.get(item.id).reward = item.reward;
|
||||
}
|
||||
});
|
||||
|
||||
// 返回更新后的数据数组
|
||||
return Array.from(dataMap.values());
|
||||
}
|
||||
// 初始化
|
||||
onMounted(async () => {
|
||||
// 加载商品列表
|
||||
state.goodsList = await getGoodsListByIds(spuIds.join(','));
|
||||
const ms = await getGoodsListByIds(spuIds.join(','));
|
||||
settleData.value = await getSettlementByIds(spuIds.join(','))
|
||||
state.goodsList = await enrichDataWithSkus(ms,settleData.value)
|
||||
// console.log('计算后',state.goodsList)
|
||||
// 只有双列布局时需要
|
||||
if (layoutType === LayoutTypeEnum.TWO_COL){
|
||||
// 分列
|
||||
console.log('用来分流的数据',state.goodsList)
|
||||
calculateGoodsColumn();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,36 +2,19 @@
|
|||
<template>
|
||||
<view class="ss-goods-wrap">
|
||||
<!-- xs卡片:横向紧凑型,一行放两个,图片左内容右边 -->
|
||||
<view
|
||||
v-if="size === 'xs'"
|
||||
class="xs-goods-card ss-flex ss-col-stretch"
|
||||
:style="[elStyles]"
|
||||
@tap="onClick"
|
||||
>
|
||||
<view v-if="size === 'xs'" class="xs-goods-card ss-flex ss-col-stretch" :style="[elStyles]" @tap="onClick">
|
||||
<view v-if="tagStyle.show" class="tag-icon-box">
|
||||
<image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src || tagStyle.imgUrl)"></image>
|
||||
</view>
|
||||
<image
|
||||
class="xs-img-box"
|
||||
:src="sheep.$url.cdn(data.image || data.picUrl)"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<view
|
||||
v-if="goodsFields.title?.show || goodsFields.name?.show || goodsFields.price?.show"
|
||||
class="xs-goods-content ss-flex-col ss-row-around"
|
||||
>
|
||||
<view
|
||||
v-if="goodsFields.title?.show || goodsFields.name?.show"
|
||||
class="xs-goods-title ss-line-1"
|
||||
:style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]"
|
||||
>
|
||||
<image class="xs-img-box" :src="sheep.$url.cdn(data.image || data.picUrl)" mode="aspectFit"></image>
|
||||
<view v-if="goodsFields.title?.show || goodsFields.name?.show || goodsFields.price?.show"
|
||||
class="xs-goods-content ss-flex-col ss-row-around">
|
||||
<view v-if="goodsFields.title?.show || goodsFields.name?.show" class="xs-goods-title ss-line-1"
|
||||
:style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]">
|
||||
{{ data.title || data.name }}
|
||||
</view>
|
||||
<view
|
||||
v-if="goodsFields.price?.show"
|
||||
class="xs-goods-price font-OPPOSANS"
|
||||
:style="[{ color: goodsFields.price.color }]"
|
||||
>
|
||||
<view v-if="goodsFields.price?.show" class="xs-goods-price font-OPPOSANS"
|
||||
:style="[{ color: goodsFields.price.color }]">
|
||||
<text class="price-unit ss-font-24">{{ priceUnit }}</text>
|
||||
{{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}
|
||||
</view>
|
||||
|
|
@ -43,28 +26,16 @@
|
|||
<view v-if="tagStyle.show" class="tag-icon-box">
|
||||
<image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src || tagStyle.imgUrl)"></image>
|
||||
</view>
|
||||
<image
|
||||
class="sm-img-box"
|
||||
:src="sheep.$url.cdn(data.image || data.picUrl)"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<image class="sm-img-box" :src="sheep.$url.cdn(data.image || data.picUrl)" mode="aspectFill"></image>
|
||||
|
||||
<view
|
||||
v-if="goodsFields.title?.show || goodsFields.name?.show || goodsFields.price?.show"
|
||||
class="sm-goods-content"
|
||||
:style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]"
|
||||
>
|
||||
<view
|
||||
v-if="goodsFields.title?.show || goodsFields.name?.show"
|
||||
class="sm-goods-title ss-line-1 ss-m-b-16"
|
||||
>
|
||||
<view v-if="goodsFields.title?.show || goodsFields.name?.show || goodsFields.price?.show"
|
||||
class="sm-goods-content" :style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]">
|
||||
<view v-if="goodsFields.title?.show || goodsFields.name?.show"
|
||||
class="sm-goods-title ss-line-1 ss-m-b-16">
|
||||
{{ data.title || data.name }}
|
||||
</view>
|
||||
<view
|
||||
v-if="goodsFields.price?.show"
|
||||
class="sm-goods-price font-OPPOSANS"
|
||||
:style="[{ color: goodsFields.price.color }]"
|
||||
>
|
||||
<view v-if="goodsFields.price?.show" class="sm-goods-price font-OPPOSANS"
|
||||
:style="[{ color: goodsFields.price.color }]">
|
||||
<text class="price-unit ss-font-24">{{ priceUnit }}</text>
|
||||
{{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}
|
||||
</view>
|
||||
|
|
@ -76,58 +47,43 @@
|
|||
<view v-if="tagStyle.show" class="tag-icon-box">
|
||||
<image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src || tagStyle.imgUrl)"></image>
|
||||
</view>
|
||||
<image
|
||||
class="md-img-box"
|
||||
:src="sheep.$url.cdn(data.image || data.picUrl)"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
<view
|
||||
class="md-goods-content ss-flex-col ss-row-around ss-p-b-20 ss-p-t-20 ss-p-x-16"
|
||||
:id="elId"
|
||||
>
|
||||
<view
|
||||
v-if="goodsFields.title?.show || goodsFields.name?.show"
|
||||
class="md-goods-title ss-line-1"
|
||||
:style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]"
|
||||
>
|
||||
<image class="md-img-box" :src="sheep.$url.cdn(data.image || data.picUrl)" mode="widthFix"></image>
|
||||
<view class="md-goods-content ss-flex-col ss-row-around ss-p-b-20 ss-p-t-20 ss-p-x-16" :id="elId">
|
||||
<view v-if="goodsFields.title?.show || goodsFields.name?.show" class="md-goods-title ss-line-1"
|
||||
:style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]">
|
||||
{{ data.title || data.name }}
|
||||
</view>
|
||||
<view
|
||||
v-if="goodsFields.subtitle?.show || goodsFields.introduction?.show"
|
||||
<view v-if="goodsFields.subtitle?.show || goodsFields.introduction?.show"
|
||||
class="md-goods-subtitle ss-m-t-16 ss-line-1"
|
||||
:style="[{ color: subTitleColor, background: subTitleBackground }]"
|
||||
>
|
||||
:style="[{ color: subTitleColor, background: subTitleBackground }]">
|
||||
{{ data.subtitle || data.introduction }}
|
||||
</view>
|
||||
<slot name="activity">
|
||||
<view v-if="data.promos?.length" class="tag-box ss-flex-wrap ss-flex ss-col-center">
|
||||
<view
|
||||
class="activity-tag ss-m-r-10 ss-m-t-16"
|
||||
v-for="item in data.promos"
|
||||
:key="item.id"
|
||||
>
|
||||
<view class="activity-tag ss-m-r-10 ss-m-t-16" v-for="item in data.promos" :key="item.id">
|
||||
{{ item.title }}
|
||||
</view>
|
||||
</view>
|
||||
</slot>
|
||||
<!-- 这里是新加的会员价和限时优惠 -->
|
||||
<view class="iconBox" v-if="data.discountPrice || data.vipPrice || data.reward">
|
||||
<view class="card" v-if="iconShow">{{iconShow}}</view>
|
||||
<view class="card2" v-if="data.reward">{{data.reward.rewardActivity}}</view>
|
||||
</view>
|
||||
<!-- 这里是新加的会员价和限时优惠结束 -->
|
||||
<view class="ss-flex ss-col-bottom">
|
||||
<view
|
||||
v-if="goodsFields.price?.show"
|
||||
class="md-goods-price ss-m-t-16 font-OPPOSANS ss-m-r-10"
|
||||
:style="[{ color: goodsFields.price.color }]"
|
||||
>
|
||||
<view v-if="goodsFields.price?.show" class="md-goods-price ss-m-t-16 font-OPPOSANS ss-m-r-10"
|
||||
:style="[{ color: goodsFields.price.color }]">
|
||||
<text class="price-unit ss-font-24">{{ priceUnit }}</text>
|
||||
{{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}
|
||||
<text v-if="iconShow=='限时优惠'">{{fen2yuan(data.discountPrice)}}</text>
|
||||
<text v-else-if="iconShow=='会员价'">{{fen2yuan(data.vipPrice)}}</text>
|
||||
<text v-else>{{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}</text>
|
||||
</view>
|
||||
|
||||
<view
|
||||
v-if="
|
||||
<view v-if="
|
||||
(goodsFields.original_price?.show || goodsFields.marketPrice?.show) &&
|
||||
(data.original_price > 0 || data.marketPrice > 0)
|
||||
"
|
||||
class="goods-origin-price ss-m-t-16 font-OPPOSANS ss-flex"
|
||||
:style="[{ color: originPriceColor }]"
|
||||
>
|
||||
" class="goods-origin-price ss-m-t-16 font-OPPOSANS ss-flex" :style="[{ color: originPriceColor }]">
|
||||
<text class="price-unit ss-font-20">{{ priceUnit }}</text>
|
||||
<view class="ss-m-l-8">{{ fen2yuan(data.marketPrice) }}</view>
|
||||
</view>
|
||||
|
|
@ -146,12 +102,7 @@
|
|||
</view>
|
||||
|
||||
<!-- lg卡片:横向型,一行放一个,图片左内容右边 -->
|
||||
<view
|
||||
v-if="size === 'lg'"
|
||||
class="lg-goods-card ss-flex ss-col-stretch"
|
||||
:style="[elStyles]"
|
||||
@tap="onClick"
|
||||
>
|
||||
<view v-if="size === 'lg'" class="lg-goods-card ss-flex ss-col-stretch" :style="[elStyles]" @tap="onClick">
|
||||
<view v-if="tagStyle.show" class="tag-icon-box">
|
||||
<image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src || tagStyle.imgUrl)"></image>
|
||||
</view>
|
||||
|
|
@ -159,25 +110,16 @@
|
|||
<view v-if="grouponTag" class="groupon-tag ss-flex ss-row-center">
|
||||
<view class="tag-icon">拼团</view>
|
||||
</view>
|
||||
<image
|
||||
class="lg-img-box"
|
||||
:src="sheep.$url.cdn(data.image || data.picUrl)"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<image class="lg-img-box" :src="sheep.$url.cdn(data.image || data.picUrl)" mode="aspectFill"></image>
|
||||
<view class="lg-goods-content ss-flex-1 ss-flex-col ss-row-between ss-p-b-10 ss-p-t-20">
|
||||
<view>
|
||||
<view
|
||||
v-if="goodsFields.title?.show || goodsFields.name?.show"
|
||||
class="lg-goods-title ss-line-2"
|
||||
:style="[{ color: titleColor }]"
|
||||
>
|
||||
<view v-if="goodsFields.title?.show || goodsFields.name?.show" class="lg-goods-title ss-line-2"
|
||||
:style="[{ color: titleColor }]">
|
||||
{{ data.title || data.name }}
|
||||
</view>
|
||||
<view
|
||||
v-if="goodsFields.subtitle?.show || goodsFields.introduction?.show"
|
||||
<view v-if="goodsFields.subtitle?.show || goodsFields.introduction?.show"
|
||||
class="lg-goods-subtitle ss-m-t-10 ss-line-1"
|
||||
:style="[{ color: subTitleColor, background: subTitleBackground }]"
|
||||
>
|
||||
:style="[{ color: subTitleColor, background: subTitleBackground }]">
|
||||
{{ data.subtitle || data.introduction }}
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -190,22 +132,16 @@
|
|||
</view>
|
||||
</slot>
|
||||
<view class="ss-flex ss-col-bottom ss-m-t-10">
|
||||
<view
|
||||
v-if="goodsFields.price?.show"
|
||||
<view v-if="goodsFields.price?.show"
|
||||
class="lg-goods-price ss-m-r-12 ss-flex ss-col-bottom font-OPPOSANS"
|
||||
:style="[{ color: goodsFields.price.color }]"
|
||||
>
|
||||
:style="[{ color: goodsFields.price.color }]">
|
||||
<text class="ss-font-24">{{ priceUnit }}</text>
|
||||
{{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}
|
||||
</view>
|
||||
<view
|
||||
v-if="
|
||||
<view v-if="
|
||||
(goodsFields.original_price?.show || goodsFields.marketPrice?.show) &&
|
||||
(data.original_price > 0 || data.marketPrice > 0)
|
||||
"
|
||||
class="goods-origin-price ss-flex ss-col-bottom font-OPPOSANS"
|
||||
:style="[{ color: originPriceColor }]"
|
||||
>
|
||||
" class="goods-origin-price ss-flex ss-col-bottom font-OPPOSANS" :style="[{ color: originPriceColor }]">
|
||||
<text class="price-unit ss-font-20">{{ priceUnit }}</text>
|
||||
<view class="ss-m-l-8">{{ fen2yuan(data.marketPrice) }}</view>
|
||||
</view>
|
||||
|
|
@ -227,54 +163,45 @@
|
|||
<image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src || tagStyle.imgUrl)"></image>
|
||||
</view>
|
||||
|
||||
<image
|
||||
class="sl-img-box"
|
||||
:src="sheep.$url.cdn(data.image || data.picUrl)"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<image class="sl-img-box" :src="sheep.$url.cdn(data.image || data.picUrl)" mode="aspectFill"></image>
|
||||
|
||||
<view class="sl-goods-content">
|
||||
<view>
|
||||
<view
|
||||
v-if="goodsFields.title?.show || goodsFields.name?.show"
|
||||
class="sl-goods-title ss-line-1"
|
||||
:style="[{ color: titleColor }]"
|
||||
>
|
||||
<view v-if="goodsFields.title?.show || goodsFields.name?.show" class="sl-goods-title ss-line-1"
|
||||
:style="[{ color: titleColor }]">
|
||||
{{ data.title || data.name }}
|
||||
</view>
|
||||
<view
|
||||
v-if="goodsFields.subtitle?.show || goodsFields.introduction?.show"
|
||||
<view v-if="goodsFields.subtitle?.show || goodsFields.introduction?.show"
|
||||
class="sl-goods-subtitle ss-m-t-16"
|
||||
:style="[{ color: subTitleColor, background: subTitleBackground }]"
|
||||
>
|
||||
:style="[{ color: subTitleColor, background: subTitleBackground }]">
|
||||
{{ data.subtitle || data.introduction }}
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<slot name="activity">
|
||||
<view v-if="data.promos?.length" class="tag-box ss-flex ss-col-center ss-flex-wrap">
|
||||
<view
|
||||
class="activity-tag ss-m-r-10 ss-m-t-16"
|
||||
v-for="item in data.promos"
|
||||
:key="item.id"
|
||||
>
|
||||
<view class="activity-tag ss-m-r-10 ss-m-t-16" v-for="item in data.promos" :key="item.id">
|
||||
{{ item.title }}
|
||||
</view>
|
||||
</view>
|
||||
</slot>
|
||||
<!-- 这里是新加的会员价和限时优惠 -->
|
||||
<view class="iconBox" v-if="data.discountPrice || data.vipPrice || data.reward">
|
||||
<view class="card" v-if="iconShow">{{iconShow}}</view>
|
||||
<view class="card2" v-if="data.reward">{{data.reward.rewardActivity}}</view>
|
||||
</view>
|
||||
<!-- 这里是新加的会员价和限时优惠结束 -->
|
||||
<view v-if="goodsFields.price?.show" class="ss-flex ss-col-bottom font-OPPOSANS">
|
||||
<view class="sl-goods-price ss-m-r-12" :style="[{ color: goodsFields.price.color }]">
|
||||
<text class="price-unit ss-font-24">{{ priceUnit }}</text>
|
||||
{{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}
|
||||
<text v-if="iconShow=='限时优惠'">{{fen2yuan(data.discountPrice)}}</text>
|
||||
<text v-else-if="iconShow=='会员价'">{{fen2yuan(data.vipPrice)}}</text>
|
||||
<text v-else>{{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}</text>
|
||||
</view>
|
||||
<view
|
||||
v-if="
|
||||
<view v-if="
|
||||
(goodsFields.original_price?.show || goodsFields.marketPrice?.show) &&
|
||||
(data.original_price > 0 || data.marketPrice > 0)
|
||||
"
|
||||
class="goods-origin-price ss-m-t-16 font-OPPOSANS ss-flex"
|
||||
:style="[{ color: originPriceColor }]"
|
||||
>
|
||||
" class="goods-origin-price ss-m-t-16 font-OPPOSANS ss-flex" :style="[{ color: originPriceColor }]">
|
||||
<text class="price-unit ss-font-20">{{ priceUnit }}</text>
|
||||
<view class="ss-m-l-8">{{ fen2yuan(data.marketPrice) }}</view>
|
||||
</view>
|
||||
|
|
@ -285,9 +212,9 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<slot name="cart"
|
||||
><view class="buy-box ss-flex ss-col-center ss-row-center">去购买</view></slot
|
||||
>
|
||||
<slot name="cart">
|
||||
<view class="buy-box ss-flex ss-col-center ss-row-center">去购买</view>
|
||||
</slot>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -321,13 +248,26 @@
|
|||
* @event {Function()} click - 点击卡片
|
||||
*
|
||||
*/
|
||||
import { computed, reactive, getCurrentInstance, onMounted, nextTick } from 'vue';
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
getCurrentInstance,
|
||||
onMounted,
|
||||
nextTick,
|
||||
ref
|
||||
} from 'vue';
|
||||
import sheep from '@/sheep';
|
||||
import { fen2yuan, formatSales } from '@/sheep/hooks/useGoods';
|
||||
import { formatStock } from '@/sheep/hooks/useGoods';
|
||||
import {
|
||||
fen2yuan,
|
||||
formatSales
|
||||
} from '@/sheep/hooks/useGoods';
|
||||
import {
|
||||
formatStock
|
||||
} from '@/sheep/hooks/useGoods';
|
||||
import goodsCollectVue from '@/pages/user/goods-collect.vue';
|
||||
import { isArray } from 'lodash-es';
|
||||
|
||||
import {
|
||||
isArray
|
||||
} from 'lodash-es';
|
||||
// 数据
|
||||
const state = reactive({});
|
||||
|
||||
|
|
@ -338,17 +278,29 @@
|
|||
default () {
|
||||
return {
|
||||
// 商品价格
|
||||
price: { show: true },
|
||||
price: {
|
||||
show: true
|
||||
},
|
||||
// 库存
|
||||
stock: { show: true },
|
||||
stock: {
|
||||
show: true
|
||||
},
|
||||
// 商品名称
|
||||
name: { show: true },
|
||||
name: {
|
||||
show: true
|
||||
},
|
||||
// 商品介绍
|
||||
introduction: { show: true },
|
||||
introduction: {
|
||||
show: true
|
||||
},
|
||||
// 市场价
|
||||
marketPrice: { show: true },
|
||||
marketPrice: {
|
||||
show: true
|
||||
},
|
||||
// 销量
|
||||
salesCount: { show: true },
|
||||
salesCount: {
|
||||
show: true
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
|
|
@ -417,7 +369,26 @@
|
|||
default: false,
|
||||
},
|
||||
});
|
||||
//判断限时优惠和会员价标签内容暂时导致页面出错,又舍不得丢,等着把新的数据整合到商品信息中,也用起来
|
||||
const iconShow = handle()
|
||||
|
||||
function handle() {
|
||||
console.log('传来的数据',props.data)
|
||||
if (props.data.discountPrice === null && props.data.vipPrice === null) {
|
||||
// 如果两个值都为 null,则不展示任何内容
|
||||
return '';
|
||||
} else if (props.data.discountPrice === null) {
|
||||
// 如果 discountPrice 为 null,展示 vipPrice
|
||||
return '会员价';
|
||||
} else if (props.data.vipPrice === null) {
|
||||
// 如果 vipPrice 为 null,展示 discountPrice
|
||||
return '限时优惠';
|
||||
} else if (props.data.discountPrice < props.data.vipPrice) {
|
||||
return '限时优惠';
|
||||
} else if (props.data.discountPrice > props.data.vipPrice) {
|
||||
return '会员价';
|
||||
}
|
||||
}
|
||||
// 组件样式
|
||||
const elStyles = computed(() => {
|
||||
return {
|
||||
|
|
@ -449,12 +420,18 @@
|
|||
};
|
||||
|
||||
// 获取卡片实时高度
|
||||
const { proxy } = getCurrentInstance();
|
||||
const {
|
||||
proxy
|
||||
} = getCurrentInstance();
|
||||
const elId = `sheep_${Math.ceil(Math.random() * 10e5).toString(36)}`;
|
||||
|
||||
function getGoodsPriceCardWH() {
|
||||
if (props.size === 'md') {
|
||||
const view = uni.createSelectorQuery().in(proxy);
|
||||
view.select(`#${elId}`).fields({ size: true, scrollOffset: true });
|
||||
view.select(`#${elId}`).fields({
|
||||
size: true,
|
||||
scrollOffset: true
|
||||
});
|
||||
view.exec((data) => {
|
||||
let totalHeight = 0;
|
||||
const goodsPriceCard = data[0];
|
||||
|
|
@ -482,11 +459,13 @@
|
|||
left: 0;
|
||||
top: 0;
|
||||
z-index: 2;
|
||||
|
||||
.tag-icon {
|
||||
width: 72rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.seckill-tag {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
|
|
@ -501,6 +480,7 @@
|
|||
color: #ffffff;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
.groupon-tag {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
|
|
@ -515,14 +495,17 @@
|
|||
color: #ffffff;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
.goods-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.price-unit {
|
||||
margin-right: -4px;
|
||||
}
|
||||
|
||||
.sales-text {
|
||||
display: table;
|
||||
font-size: 24rpx;
|
||||
|
|
@ -586,10 +569,12 @@
|
|||
width: 100%;
|
||||
height: 208rpx;
|
||||
}
|
||||
|
||||
.sm-goods-content {
|
||||
padding: 20rpx 16rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.sm-goods-title {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
|
|
@ -619,6 +604,7 @@
|
|||
color: #333;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.md-goods-subtitle {
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
|
|
@ -669,6 +655,7 @@
|
|||
// line-height: 36rpx;
|
||||
// width: 410rpx;
|
||||
}
|
||||
|
||||
.lg-goods-subtitle {
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
|
|
@ -695,6 +682,7 @@
|
|||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.tag-box {
|
||||
width: 100%;
|
||||
}
|
||||
|
|
@ -708,10 +696,12 @@
|
|||
z-index: 1;
|
||||
width: 100%;
|
||||
background-color: $white;
|
||||
|
||||
.sl-goods-content {
|
||||
padding: 20rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.sl-img-box {
|
||||
width: 100%;
|
||||
height: 360rpx;
|
||||
|
|
@ -722,6 +712,7 @@
|
|||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.sl-goods-subtitle {
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
|
|
@ -748,4 +739,31 @@
|
|||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
width: fit-content;
|
||||
height: fit-content;
|
||||
padding: 2rpx 10rpx;
|
||||
background-color: red;
|
||||
color: #ffffff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.card2 {
|
||||
width: fit-content;
|
||||
height: fit-content;
|
||||
padding: 2rpx 10rpx;
|
||||
background-color: rgb(255, 242, 241);
|
||||
color: #ff2621;
|
||||
font-size: 24rpx;
|
||||
margin-left: 5rpx;
|
||||
}
|
||||
|
||||
.iconBox {
|
||||
width: 100%;
|
||||
height: fit-content;
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
});
|
||||
|
||||
const propertyList = convertProductPropertyList(props.goodsInfo.skus);
|
||||
|
||||
console.log('传递来的sku信息',props.goodsInfo.skus)
|
||||
// SKU 列表
|
||||
const skuList = computed(() => {
|
||||
let skuPrices = props.goodsInfo.skus;
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Loading…
Reference in New Issue