|
@@ -1,15 +1,16 @@
|
|
<template>
|
|
<template>
|
|
<div class="top-parent-asin" v-loading="topCardloading">
|
|
<div class="top-parent-asin" v-loading="topCardloading">
|
|
- <el-card body-style="padding: 10px;">
|
|
|
|
|
|
+ <el-card body-style="padding: 8px;">
|
|
<div class="product-card">
|
|
<div class="product-card">
|
|
<div class="product-image">
|
|
<div class="product-image">
|
|
<img :src="dataSet.Image" class="img" />
|
|
<img :src="dataSet.Image" class="img" />
|
|
</div>
|
|
</div>
|
|
<div class="product-info">
|
|
<div class="product-info">
|
|
<div>
|
|
<div>
|
|
- <ExchangeProduct></ExchangeProduct>
|
|
|
|
|
|
+ <ExchangeProduct />
|
|
|
|
+
|
|
<div style="position: relative">
|
|
<div style="position: relative">
|
|
- <div style="position: absolute; top: -21px; left: 100px;">父Asin</div>
|
|
|
|
|
|
+ <div class="classification-title" :style="classificationStyle">{{ classification }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="product-title">
|
|
<div class="product-title">
|
|
@@ -46,12 +47,13 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import ExchangeProduct from './ExchangeProduct.vue'
|
|
import ExchangeProduct from './ExchangeProduct.vue'
|
|
import { getDetail } from '../../api'
|
|
import { getDetail } from '../../api'
|
|
-import { inject, onMounted, ref } from 'vue'
|
|
|
|
|
|
+import { computed, inject, onMounted, ref } from 'vue'
|
|
import emitter from '/@/utils/emitter'
|
|
import emitter from '/@/utils/emitter'
|
|
|
|
|
|
const profile = <any>inject('profile')
|
|
const profile = <any>inject('profile')
|
|
const topCardloading = ref(false)
|
|
const topCardloading = ref(false)
|
|
const dataSet = <any>ref({})
|
|
const dataSet = <any>ref({})
|
|
|
|
+// const classification = ref('')
|
|
|
|
|
|
const parentAsin = ref('')
|
|
const parentAsin = ref('')
|
|
const childAsin = ref('')
|
|
const childAsin = ref('')
|
|
@@ -88,11 +90,32 @@ async function fetchDetail() {
|
|
dataSet.value = res.data
|
|
dataSet.value = res.data
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.log('error:', error)
|
|
console.log('error:', error)
|
|
- } finally{
|
|
|
|
|
|
+ } finally {
|
|
topCardloading.value = false
|
|
topCardloading.value = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const classification = computed(() => {
|
|
|
|
+ if (dataSet.value.Asin) {
|
|
|
|
+ return 'ASIN'
|
|
|
|
+ } else if (dataSet.value.sku) {
|
|
|
|
+ return 'SKU'
|
|
|
|
+ } else {
|
|
|
|
+ return '父ASIN'
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+const classificationStyle = computed(() => {
|
|
|
|
+ switch (classification.value) {
|
|
|
|
+ case 'ASIN':
|
|
|
|
+ return { backgroundImage: 'linear-gradient(to right bottom, #ffffff, #6759f6)' }
|
|
|
|
+ case 'SKU':
|
|
|
|
+ return { backgroundImage: 'linear-gradient(to right bottom, #ffffff, #91cc69)' }
|
|
|
|
+ default:
|
|
|
|
+ return { backgroundImage: 'linear-gradient(to right bottom, #ffffff, #478cf7)' }
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
+
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
fetchDetail()
|
|
fetchDetail()
|
|
})
|
|
})
|
|
@@ -171,4 +194,15 @@ onMounted(() => {
|
|
line-height: 16px;
|
|
line-height: 16px;
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
}
|
|
}
|
|
|
|
+.classification-title {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: -29px;
|
|
|
|
+ left: -152px;
|
|
|
|
+ width: 70px;
|
|
|
|
+ height: 22px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ border-bottom-right-radius: 12px;
|
|
|
|
+ border-top-left-radius: 4px;
|
|
|
|
+ color: white;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|