liveh5-nuxt/app/components/itemDetail/index.vue
xingyy 70602bd077 refactor(app): 优化艺术品详情页面并修复相关组件问题
- 移除了 itemDetail 组件中的 console.log 语句
- 在 artDetail 页面中添加了 floating2 组件以改进浮动元素的实现
- 优化了 itemDetail 组件中价格规则图片的显示,添加了图片处理参数
- 移除了 collectCode/payment 组件中的冗余空行
2025-03-07 15:00:15 +08:00

87 lines
3.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script setup>
import { showImagePreview } from 'vant';
import xImage from '@/components/x-image/index.vue'
const props = defineProps({
detailInfo: {
type: Object,
default: null
}
})
const filteredPriceRules = computed(() => {
if (!props.detailInfo?.priceRules) return []
// 找到第一个price为空的索引
const emptyIndex = props.detailInfo.priceRules.findIndex(item => !item.price)
if (emptyIndex === -1) {
// 如果没有空价格,返回全部
return props.detailInfo.priceRules
} else {
// 如果有空价格,只返回到空价格之前的数据
return props.detailInfo.priceRules.slice(0, emptyIndex)
}
})
</script>
<template>
<div>
<div class="flex justify-center">
<xImage class="h-188px" :src="detailInfo?.artwork?.hdPic"></xImage>
</div>
<div class="px-[16px] bg-[#fff] pt-[11px] mb-6px">
<div class="text-[#000] text-[16px] mb-[12px]">{{detailInfo?.artworkTitle}}</div>
<div class="text-#575757 text-[14px] pb-8px">
<div class="flex mb-[4px]">
<div class="w-[70px]">{{$t('detail.text1')}}</div>
<div>{{detailInfo?.artwork?.artistName??'-'}}</div>
</div>
<div class="flex mb-[4px]">
<div class="w-[70px] flex-shrink-0">{{$t('detail.text2')}}</div>
<div>{{detailInfo?.artwork?.ruler??'-'}}</div>
</div>
<div class="flex mb-[4px]">
<div class="w-[70px] flex-shrink-0">{{$t('detail.text3')}}*{{$t('detail.text4')}}</div>
<div>{{detailInfo?.artwork?.length}}*{{detailInfo?.artwork?.width}}cm</div>
</div>
<div class="flex mb-[4px]">
<div class="w-[70px] flex-shrink-0">{{$t('detail.text5')}}</div>
<div>{{detailInfo?.artwork?.abstract??'-'}}</div>
</div>
</div>
</div>
<div class="flex px-[16px] bg-#fff h-[36px] items-center mb-6px">
<div class="text-[#575757] text-[14px]">{{$t('detail.text6')}}</div>
<div class="text-#575757 text-14px font-bold">{{detailInfo?.startPriceCurrency}} {{detailInfo?.startPrice}}</div>
</div>
<div class="flex px-[16px] bg-#fff h-[36px] items-center mb-6px" v-if="detailInfo?.soldPrice">
<div class="text-[#B58047] text-[14px]">成交价</div>
<div class="text-#B58047 text-14px font-bold">{{detailInfo?.soldPriceCurrency}} {{detailInfo?.soldPrice}}</div>
</div>
<div class="px-[16px] bg-#fff pt-12px pb-18px">
<div class="text-[#575757] text-[14px] mb-4px">{{$t('detail.text7')}}</div>
<div v-if="detailInfo?.priceRuleType!=='diy'">
<xImage :src="detailInfo?.priceRuleImage+'?x-oss-process=image/resize,w_580,h_580/format,webp/quality,q_80'" alt=""/>
</div>
<div v-else class="mt-20px">
<div class="flex text-#575757 text-12px">
<div class="grow-1 text-center">序号</div>
<div class="grow-1 text-center">叫价金额</div>
</div>
<div v-for="(item,index) of filteredPriceRules" :key="item.index" class="flex text-#575757 text-12px mt-10px">
<div class="grow-1 text-center">{{item.index}}</div>
<div class="grow-1 text-center">{{item.price}}</div>
</div>
</div>
</div>
<div class="flex text-[#575757] text-[14px] justify-center">
<div>{{$t('detail.text9')}}:</div>
<div>{{ detailInfo?.priceRuleAdd }}</div>
</div>
</div>
</template>
<style scoped>
</style>