|
@@ -3,12 +3,14 @@
|
|
|
<div class="discover-bos" :style="boxCss">
|
|
<div class="discover-bos" :style="boxCss">
|
|
|
<!-- 头部 -->
|
|
<!-- 头部 -->
|
|
|
<div class="home-title flex-row-between" :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}">
|
|
<div class="home-title flex-row-between" :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}">
|
|
|
- <div>
|
|
|
|
|
- <span :style="titleCss" class="title1 mr-[10px]">{{ componentData.title }}</span>
|
|
|
|
|
|
|
+ <div @click="onPath(componentData.titleUrl)">
|
|
|
|
|
+ <span :style="titleCss" class="title1 mr-[10px] hover-color">{{ componentData.title }}</span>
|
|
|
<span :style="subtitleCss">{{ componentData.subtitle }}</span>
|
|
<span :style="subtitleCss">{{ componentData.subtitle }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="title-more flex-row-start">
|
|
<div class="title-more flex-row-start">
|
|
|
- <div class="ml-[10px]" v-for="(item, index) in componentData.labelList" :key="index">{{ item.title }}</div>
|
|
|
|
|
|
|
+ <div @click="onPath(item.url)" class="ml-[10px] hover-color" v-for="(item, index) in componentData.labelList" :key="index">
|
|
|
|
|
+ {{ item.title }}
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 中间区域 -->
|
|
<!-- 中间区域 -->
|
|
@@ -16,12 +18,12 @@
|
|
|
<el-image
|
|
<el-image
|
|
|
class="discover-image"
|
|
class="discover-image"
|
|
|
:src="componentData.imageUrl ? componentData.imageUrl : figure"
|
|
:src="componentData.imageUrl ? componentData.imageUrl : figure"
|
|
|
- :fit="componentData.imgType == 1 ? 'fill' : componentData.imgType == 2 ? 'contain' : 'cover'"
|
|
|
|
|
|
|
+ :fit="componentData.imageUrl ? (componentData.imgType == 1 ? 'fill' : componentData.imgType == 2 ? 'contain' : 'cover') : 'cover'"
|
|
|
:style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}"
|
|
:style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}"
|
|
|
/>
|
|
/>
|
|
|
<div class="plan-bos" :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}">
|
|
<div class="plan-bos" :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}">
|
|
|
<div class="plan-head">方案推荐</div>
|
|
<div class="plan-head">方案推荐</div>
|
|
|
- <div v-for="(item, index) in componentData.planList" :key="index" class="plan-list">
|
|
|
|
|
|
|
+ <div v-for="(item, index) in componentData.planList" :key="index" class="plan-list hover-color" @click="onPath(item.url)">
|
|
|
<el-image
|
|
<el-image
|
|
|
class="plan-image"
|
|
class="plan-image"
|
|
|
:src="item.imageUrl ? item.imageUrl : figure"
|
|
:src="item.imageUrl ? item.imageUrl : figure"
|
|
@@ -29,7 +31,7 @@
|
|
|
:style="componentData.imageRadius ? { borderRadius: componentData.imageRadius + 'px' } : {}"
|
|
:style="componentData.imageRadius ? { borderRadius: componentData.imageRadius + 'px' } : {}"
|
|
|
/>
|
|
/>
|
|
|
<div class="plan-box flex-column-between">
|
|
<div class="plan-box flex-column-between">
|
|
|
- <div class="plan-title ellipsis">{{ item.title }}</div>
|
|
|
|
|
|
|
+ <div class="plan-title ellipsis zi-hover">{{ item.title }}</div>
|
|
|
<div class="plan-subtitle">{{ item.subtitle }}</div>
|
|
<div class="plan-subtitle">{{ item.subtitle }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -38,9 +40,13 @@
|
|
|
<div class="detect-head">发现</div>
|
|
<div class="detect-head">发现</div>
|
|
|
<div class="detect-box">
|
|
<div class="detect-box">
|
|
|
<div class="detect-two">
|
|
<div class="detect-two">
|
|
|
- <div class="detect-list" :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}">
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ @click="onPath(componentData.detectList[0].url)"
|
|
|
|
|
+ class="detect-list hover-color"
|
|
|
|
|
+ :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}"
|
|
|
|
|
+ >
|
|
|
<div class="detect-item">
|
|
<div class="detect-item">
|
|
|
- <div class="detect-title ellipsis">{{ componentData.detectList[0].title }}</div>
|
|
|
|
|
|
|
+ <div class="detect-title ellipsis zi-hover">{{ componentData.detectList[0].title }}</div>
|
|
|
<div class="detect-subtitle mt-[6px] h-[32px]">{{ componentData.detectList[0].subtitle }}</div>
|
|
<div class="detect-subtitle mt-[6px] h-[32px]">{{ componentData.detectList[0].subtitle }}</div>
|
|
|
<div class="detect-btn" :style="{ backgroundColor: componentData.boxColor }">立即进入</div>
|
|
<div class="detect-btn" :style="{ backgroundColor: componentData.boxColor }">立即进入</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -51,9 +57,13 @@
|
|
|
:style="componentData.imageRadius ? { borderRadius: componentData.imageRadius + 'px' } : {}"
|
|
:style="componentData.imageRadius ? { borderRadius: componentData.imageRadius + 'px' } : {}"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="detect-list" :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}">
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ @click="onPath(componentData.detectList[1].url)"
|
|
|
|
|
+ class="detect-list hover-color"
|
|
|
|
|
+ :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}"
|
|
|
|
|
+ >
|
|
|
<div class="detect-item">
|
|
<div class="detect-item">
|
|
|
- <div class="detect-title ellipsis">{{ componentData.detectList[1].title }}</div>
|
|
|
|
|
|
|
+ <div class="detect-title ellipsis zi-hover">{{ componentData.detectList[1].title }}</div>
|
|
|
<div class="detect-subtitle mt-[6px] h-[32px]">{{ componentData.detectList[1].subtitle }}</div>
|
|
<div class="detect-subtitle mt-[6px] h-[32px]">{{ componentData.detectList[1].subtitle }}</div>
|
|
|
<div class="detect-btn" :style="{ backgroundColor: componentData.boxColor }">立即进入</div>
|
|
<div class="detect-btn" :style="{ backgroundColor: componentData.boxColor }">立即进入</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -65,9 +75,13 @@
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="detect-one flex-column-between" :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}">
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="detect-one flex-column-between hover-color"
|
|
|
|
|
+ :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}"
|
|
|
|
|
+ @click="onPath(componentData.detectList[2].url)"
|
|
|
|
|
+ >
|
|
|
<div>
|
|
<div>
|
|
|
- <div class="detect-title ellipsis">{{ componentData.detectList[2].title }}</div>
|
|
|
|
|
|
|
+ <div class="detect-title ellipsis zi-hover">{{ componentData.detectList[2].title }}</div>
|
|
|
<div class="detect-subtitle mt-[6px]">{{ componentData.detectList[2].subtitle }}</div>
|
|
<div class="detect-subtitle mt-[6px]">{{ componentData.detectList[2].subtitle }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<el-image
|
|
<el-image
|
|
@@ -85,44 +99,44 @@
|
|
|
<div class="discover-tab" :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}">
|
|
<div class="discover-tab" :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}">
|
|
|
<div class="tab-head" :style="{ color: componentData.boxColor }">采购导航</div>
|
|
<div class="tab-head" :style="{ color: componentData.boxColor }">采购导航</div>
|
|
|
<div class="tab-bos">
|
|
<div class="tab-bos">
|
|
|
- <div v-for="(item, index) in componentData.tabList" :key="index" class="tab-list flex-row-center">
|
|
|
|
|
|
|
+ <div @click="onPath(item.url)" v-for="(item, index) in componentData.tabList" :key="index" class="tab-list flex-row-center hover-color">
|
|
|
{{ item.title }}
|
|
{{ item.title }}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div
|
|
|
|
|
- class="goods-bos flex-column-between"
|
|
|
|
|
- v-for="(item, index) in dataList"
|
|
|
|
|
- :key="index"
|
|
|
|
|
- :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}"
|
|
|
|
|
- >
|
|
|
|
|
- <img
|
|
|
|
|
- class="goods-img"
|
|
|
|
|
- :src="item.productImage ? item.productImage : figure"
|
|
|
|
|
- alt=""
|
|
|
|
|
- :style="componentData.imageRadius ? { borderRadius: componentData.imageRadius + 'px' } : {}"
|
|
|
|
|
- />
|
|
|
|
|
- <div>
|
|
|
|
|
- <div class="goods-name">{{ item.itemName || '' }}</div>
|
|
|
|
|
- <div class="goods-price" :style="{ color: componentData.boxColor }">¥{{ item.memberPrice }}</div>
|
|
|
|
|
|
|
+ <template v-for="(item, index) in dataList" :key="index">
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-if="Number(index) < 4"
|
|
|
|
|
+ class="goods-bos flex-column-between hover-color"
|
|
|
|
|
+ :style="componentData.boxRadius ? { borderRadius: componentData.boxRadius + 'px' } : {}"
|
|
|
|
|
+ @click="onPath('/item?id=' + item.id)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <img
|
|
|
|
|
+ class="goods-img"
|
|
|
|
|
+ :src="item.productImage ? item.productImage : figure"
|
|
|
|
|
+ alt=""
|
|
|
|
|
+ :style="componentData.imageRadius ? { borderRadius: componentData.imageRadius + 'px' } : {}"
|
|
|
|
|
+ />
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div class="goods-name zi-hover">{{ item.itemName || '商品名称' }}</div>
|
|
|
|
|
+ <div class="goods-price" :style="{ color: componentData.boxColor }">¥{{ item.memberPrice || '0.00' }}</div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </template>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
|
|
+import { onPath } from '@/utils/siteConfig';
|
|
|
import figure from '@/assets/images/figure.png';
|
|
import figure from '@/assets/images/figure.png';
|
|
|
-import usePcdiyStore from '@/store/modules/pcdiy';
|
|
|
|
|
-import { listBase } from '@/api/pmsProduct/base';
|
|
|
|
|
-const diyStore = usePcdiyStore();
|
|
|
|
|
-
|
|
|
|
|
-const props = defineProps<{
|
|
|
|
|
- index: number; // 确保声明 index 为可选属性
|
|
|
|
|
|
|
+import { getDiyProductPage } from '@/api/home/diy';
|
|
|
|
|
+interface Props {
|
|
|
row?: any;
|
|
row?: any;
|
|
|
-}>();
|
|
|
|
|
-const componentData = props.row ? props.row : diyStore.componentList[props.index];
|
|
|
|
|
|
|
+}
|
|
|
|
|
+const props = defineProps<Props>();
|
|
|
|
|
+const componentData = props.row || {};
|
|
|
const dataList = ref<any>([{}, {}, {}, {}]);
|
|
const dataList = ref<any>([{}, {}, {}, {}]);
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
@@ -132,7 +146,7 @@ onMounted(() => {
|
|
|
const getDataList = () => {
|
|
const getDataList = () => {
|
|
|
dataList.value = [{}, {}, {}, {}];
|
|
dataList.value = [{}, {}, {}, {}];
|
|
|
if (componentData.goodsIds.length > 0) {
|
|
if (componentData.goodsIds.length > 0) {
|
|
|
- listBase({ pageNum: 1, pageSize: 10, ids: componentData.goodsIds.join(',') }).then((res) => {
|
|
|
|
|
|
|
+ getDiyProductPage({ pageNum: 1, pageSize: 10, ids: componentData.goodsIds.join(',') }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
dataList.value = res.rows;
|
|
dataList.value = res.rows;
|
|
|
}
|
|
}
|
|
@@ -140,14 +154,6 @@ const getDataList = () => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-watch(
|
|
|
|
|
- () => componentData.goodsIds,
|
|
|
|
|
- () => {
|
|
|
|
|
- getDataList();
|
|
|
|
|
- },
|
|
|
|
|
- { deep: true } // 5. 数组变化需要 deep 监听
|
|
|
|
|
-);
|
|
|
|
|
-
|
|
|
|
|
const warpCss = computed(() => {
|
|
const warpCss = computed(() => {
|
|
|
let style = '';
|
|
let style = '';
|
|
|
style += 'position:relative;';
|
|
style += 'position:relative;';
|
|
@@ -179,7 +185,15 @@ const warpCss = computed(() => {
|
|
|
if (componentData.topRounded) style += 'border-top-right-radius:' + componentData.topRounded + 'px;';
|
|
if (componentData.topRounded) style += 'border-top-right-radius:' + componentData.topRounded + 'px;';
|
|
|
if (componentData.bottomRounded) style += 'border-bottom-left-radius:' + componentData.bottomRounded + 'px;';
|
|
if (componentData.bottomRounded) style += 'border-bottom-left-radius:' + componentData.bottomRounded + 'px;';
|
|
|
if (componentData.bottomRounded) style += 'border-bottom-right-radius:' + componentData.bottomRounded + 'px;';
|
|
if (componentData.bottomRounded) style += 'border-bottom-right-radius:' + componentData.bottomRounded + 'px;';
|
|
|
-
|
|
|
|
|
|
|
+ //间距
|
|
|
|
|
+ if (componentData.margin) {
|
|
|
|
|
+ if (componentData.margin.top > 0) {
|
|
|
|
|
+ style += 'margin-top:' + componentData.margin.top + 'px' + ';';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (componentData.margin.bottom > 0) {
|
|
|
|
|
+ style += 'margin-bottom:' + componentData.margin.bottom + 'px' + ';';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return style;
|
|
return style;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -232,13 +246,14 @@ const subtitleCss = computed(() => {
|
|
|
.discover-box {
|
|
.discover-box {
|
|
|
height: 340px;
|
|
height: 340px;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- margin-top: 15px;
|
|
|
|
|
|
|
+ margin-top: 10px;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
gap: 10px;
|
|
gap: 10px;
|
|
|
|
|
|
|
|
.discover-image {
|
|
.discover-image {
|
|
|
width: 230px;
|
|
width: 230px;
|
|
|
height: 340px;
|
|
height: 340px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 方案
|
|
// 方案
|
|
@@ -390,7 +405,7 @@ const subtitleCss = computed(() => {
|
|
|
.discover-foot {
|
|
.discover-foot {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
gap: 10px;
|
|
gap: 10px;
|
|
|
- margin-top: 15px;
|
|
|
|
|
|
|
+ margin-top: 10px;
|
|
|
.discover-tab {
|
|
.discover-tab {
|
|
|
width: 230px;
|
|
width: 230px;
|
|
|
height: 310px;
|
|
height: 310px;
|