feat: 相关商品问题修复
This commit is contained in:
@@ -4,14 +4,17 @@
|
||||
|
||||
<SwipeCards :cardsData="commodityList">
|
||||
<template #default="{ card }">
|
||||
<view class="inner-card" @click="placeOrderHandle(card)">
|
||||
<view
|
||||
class="inner-card overflow-hidden"
|
||||
@click="placeOrderHandle(card)"
|
||||
>
|
||||
<!-- 商品大图部分:自适应剩余空间 -->
|
||||
<view class="goods-image-wrapper">
|
||||
<image
|
||||
class="goods-image"
|
||||
:src="card.commodityPhoto"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
/>
|
||||
<view class="goods-title">
|
||||
<text class="goods-text">{{ card.commodityName }}</text>
|
||||
<view class="card-price-row">
|
||||
@@ -27,17 +30,17 @@
|
||||
<!-- 底部相册部分:固定比例或高度 -->
|
||||
<view class="album-row">
|
||||
<view
|
||||
v-for="(item, index) in normalizedAlbums(commodityList)"
|
||||
v-for="(item, index) in card.commodityPhotoList"
|
||||
:key="index"
|
||||
class="album-item"
|
||||
>
|
||||
<view v-if="item" class="album-image-wrapper">
|
||||
<image
|
||||
class="album-image"
|
||||
:src="item.commodityPhoto"
|
||||
:src="item.photoUrl"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<view class="album-title">{{ item.commodityName }}</view>
|
||||
<view class="album-title">{{ item.photoName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -48,7 +51,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { defineProps } from "vue";
|
||||
import { defineProps, computed } from "vue";
|
||||
import { checkToken } from "@/hooks/useGoLogin";
|
||||
import ModuleTitle from "@/components/ModuleTitle/index.vue";
|
||||
import SwipeCards from "@/components/SwipeCards/index.vue";
|
||||
@@ -60,13 +63,6 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
// 补齐3个的
|
||||
const normalizedAlbums = (list = []) => {
|
||||
const arr = list.slice(0, 3);
|
||||
while (arr.length < 3) arr.push(null);
|
||||
return arr;
|
||||
};
|
||||
|
||||
// 去下单
|
||||
const placeOrderHandle = (item) => {
|
||||
checkToken().then(() => {
|
||||
|
||||
Reference in New Issue
Block a user