|
@@ -1,17 +1,20 @@
|
|
|
<script setup lang="ts">
|
|
|
-import ExchangeProduct from './ExchangeProduct.vue'
|
|
|
+import { Picture as IconPicture } from '@element-plus/icons-vue'
|
|
|
+import { computed, inject, onMounted, ref, watch } from 'vue'
|
|
|
import { getDetail } from '../../api'
|
|
|
-import { computed, inject, onMounted, ref } from 'vue'
|
|
|
+import ExchangeProduct from './ExchangeProduct.vue'
|
|
|
import emitter from '/@/utils/emitter'
|
|
|
|
|
|
+
|
|
|
const profile = <any>inject('profile')
|
|
|
+const dateRange = <any>inject('dateRange')
|
|
|
const topCardloading = ref(false)
|
|
|
const dataSet = <any>ref({})
|
|
|
|
|
|
const parentAsin = ref('')
|
|
|
const childAsin = ref('')
|
|
|
const sku = ref('')
|
|
|
-const rating = ref('')
|
|
|
+const rating = ref('3')
|
|
|
|
|
|
// 根据不同的点击事件发送请求获取数据
|
|
|
emitter.on('useSelectItem-clickParentAsinBtn', (value: any) => {
|
|
@@ -71,6 +74,10 @@ const classificationStyle = computed(() => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+watch(dateRange, () => {
|
|
|
+ fetchDetail()
|
|
|
+})
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
fetchDetail()
|
|
|
})
|
|
@@ -81,7 +88,17 @@ onMounted(() => {
|
|
|
<el-card body-style="padding: 8px;">
|
|
|
<div class="product-card">
|
|
|
<div class="product-image">
|
|
|
- <img :src="dataSet.Image" class="img" />
|
|
|
+ <!-- <img :src="dataSet.Image ? dataSet.Image : 123" class="img" /> -->
|
|
|
+ <img v-if="dataSet.Image" :src="dataSet.Image" class="img" />
|
|
|
+ <div v-else>
|
|
|
+ <el-image>
|
|
|
+ <template #error>
|
|
|
+ <div class="image-slot">
|
|
|
+ <el-icon><icon-picture /></el-icon>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-image>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="product-info">
|
|
|
<div>
|
|
@@ -91,7 +108,7 @@ onMounted(() => {
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="product-title">
|
|
|
- {{ dataSet.Title }}
|
|
|
+ {{ dataSet.Title ? dataSet.Title : '--' }}
|
|
|
</div>
|
|
|
<div class="product-detail">
|
|
|
<span class="product-detail__label"> 父ASIN: </span>
|
|
@@ -106,15 +123,16 @@ onMounted(() => {
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="product-price">
|
|
|
- <div class="product-price__label">价格:</div>
|
|
|
+ <div class="product-price__label">价格</div>
|
|
|
<div class="product-price__content">
|
|
|
<div>${{ dataSet.priceMin ? dataSet.priceMin : '--' }} ~ ${{ dataSet.priceMax ? dataSet.priceMax : '--' }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- TODO: 星级评分未完成 -->
|
|
|
<div class="product-stars">
|
|
|
- <div>星级评分:</div>
|
|
|
- <el-rate v-model="rating" disabled show-score text-color="#ff9900" score-template="{value} ()" />
|
|
|
+ <!-- <div>星级评分</div> -->
|
|
|
+ <div class="product-price__label">星级评分</div>
|
|
|
+ <el-rate v-model="rating" disabled show-score text-color="#1d2129" score-template="{value} ()" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-card>
|
|
@@ -133,7 +151,7 @@ onMounted(() => {
|
|
|
width: 126px;
|
|
|
height: 126px;
|
|
|
}
|
|
|
-.img {
|
|
|
+.product-image .img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
border: 1px solid #e5e6eb;
|
|
@@ -152,7 +170,7 @@ onMounted(() => {
|
|
|
}
|
|
|
.product-title {
|
|
|
display: -webkit-box;
|
|
|
- -webkit-line-clamp: 2;
|
|
|
+ -webkit-line-clamp: 1;
|
|
|
-webkit-box-orient: vertical;
|
|
|
color: #1d2129;
|
|
|
font-size: 18px;
|
|
@@ -200,7 +218,7 @@ onMounted(() => {
|
|
|
}
|
|
|
.classification-title {
|
|
|
position: absolute;
|
|
|
- top: -29px;
|
|
|
+ top: -38px;
|
|
|
left: -152px;
|
|
|
width: 70px;
|
|
|
height: 22px;
|
|
@@ -209,4 +227,16 @@ onMounted(() => {
|
|
|
border-top-left-radius: 4px;
|
|
|
color: white;
|
|
|
}
|
|
|
+.image-slot {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ width: 126px;
|
|
|
+ height: 126px;
|
|
|
+ border: 1px solid #dde0eb;
|
|
|
+ border-radius: 4px;
|
|
|
+ background: var(--el-fill-color-light);
|
|
|
+ color: var(--el-text-color-secondary);
|
|
|
+ font-size: 30px;
|
|
|
+}
|
|
|
</style>
|