feat: 调整商品详情的展示样式

This commit is contained in:
2025-08-18 20:13:34 +08:00
parent 41f6543f47
commit b28625906b
2 changed files with 35 additions and 34 deletions

View File

@@ -17,7 +17,7 @@
<ModuleTitle title="购买须知" /> <ModuleTitle title="购买须知" />
<zero-markdown-view :markdown="goodsData.commodityTip" /> <zero-markdown-view :markdown="goodsData.commodityTip" :aiMode='true' />
</view> </view>
</scroll-view> </scroll-view>

View File

@@ -1,48 +1,50 @@
<template> <template>
<view class="container"> <view class="container">
<ModuleTitle :title="recommendTheme.themeName" /> <ModuleTitle :title="recommendTheme.themeName" />
<view class="container-scroll"> <view class="container-scroll">
<view v-for="(item, index) in recommendTheme.recommendPostsList" :key="index"> <view
<view class="mk-card-item" @click="sendReply(item)"> v-for="(item, index) in recommendTheme.recommendPostsList"
<image :src="item.coverPhoto" mode="aspectFill"></image> :key="index"
<view class="overlay-gradient"> >
<text class="overlay-text">{{ item.topic }}</text> <view class="mk-card-item" @click="sendReply(item)">
</view> <image :src="item.coverPhoto" mode="aspectFill"></image>
</view> <view class="overlay-gradient">
</view> <text class="overlay-text">{{ item.topic }}</text>
</view> </view>
</view> </view>
</view>
</view>
</view>
</template> </template>
<script setup> <script setup>
import ModuleTitle from '@/components/ModuleTitle/index.vue' import ModuleTitle from "@/components/ModuleTitle/index.vue";
import { defineProps } from 'vue' import { defineProps } from "vue";
import { RECOMMEND_POSTS_TITLE } from '@/constant/constant.js' import { RECOMMEND_POSTS_TITLE } from "@/constant/constant.js";
const props = defineProps({ const props = defineProps({
recommendTheme: { recommendTheme: {
type: Object, type: Object,
default: {} default: {},
} },
}) });
const sendReply = (item) => {
const topic = item.userInputContent || item.topic.replace(/^#/, '');
uni.$emit(RECOMMEND_POSTS_TITLE, topic);
}
const sendReply = (item) => {
const topic = item.userInputContent || item.topic.replace(/^#/, "");
uni.$emit(RECOMMEND_POSTS_TITLE, topic);
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
width: 100%; width: 100%;
} }
.container-scroll { .container-scroll {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
overflow-x: auto; overflow-x: auto;
margin-top: 4px; margin: 4px 0 6px;
.mk-card-item { .mk-card-item {
flex-shrink: 0; /* 关键:防止 flex 布局压缩子元素宽度 */ flex-shrink: 0; /* 关键:防止 flex 布局压缩子元素宽度 */
@@ -87,5 +89,4 @@
} }
} }
} }
</style> </style>