Commit 84d3c6a7 by 胡悦

提交

1 parent 746181f1
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-05-30 14:40:39 * @Date: 2024-05-30 14:40:39
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2024-05-31 18:06:10 * @LastEditTime: 2024-06-03 14:49:06
--> -->
<template> <template>
<view style="position: relative;"> <view style="position: relative;">
...@@ -19,22 +19,22 @@ ...@@ -19,22 +19,22 @@
<view class="first-tab"> <view class="first-tab">
<view <view
class="tab-item" class="tab-item"
v-for="(i, index) in firstNav" v-for="(i, index) in views"
:key="index" :key="index"
@click="changeIndex(index, 'firstIndex')" @click="changeIndex(index, 'firstIndex')"
> >
<view <view
class="sprite-icon" class="sprite-icon"
:class="[firstIndex == index ? `icon-${i.class} active` : '']" :class="[firstIndex == index ? `icon-${firstClass[index]} active` : '']"
:style="{ left: i.left }" :style="{ left: firstLeft[index] }"
></view> ></view>
{{ i.name }} <view class="text" :class="[firstIndex == index ? `active` : '']">{{ i.tabName }}</view>
</view> </view>
</view> </view>
<view class="content"> <view class="content" id="content">
<view class="second-tab"> <view class="second-tab" ref="secondTab" v-if="views[firstIndex].receptionSourceDetailInfoList">
<view <view
v-for="(item, ind) in secondNav" v-for="(item, ind) in views[firstIndex].receptionSourceDetailInfoList"
:key="ind" :key="ind"
class="tab-item" class="tab-item"
@click="changeIndex(ind, 'secondIndex')" @click="changeIndex(ind, 'secondIndex')"
...@@ -42,11 +42,12 @@ ...@@ -42,11 +42,12 @@
<view <view
class="text" class="text"
:class="[secondIndex == ind ? 'active' : '']" :class="[secondIndex == ind ? 'active' : '']"
>{{ item }}</view >{{ item.tabName }}</view
> >
</view> </view>
</view> </view>
<view class="product-list"> <template v-if="views[firstIndex].receptionSourceDetailInfoList && views[firstIndex].receptionSourceDetailInfoList[secondIndex].receptionSourceDetailInfoList">
<view class="product-list" :style="{height: views[firstIndex].receptionSourceDetailInfoList ? '908rpx' : '1040rpx'}">
<view class="product-item"> <view class="product-item">
<image <image
:src="require('@/assets/images/boutique/product.png')" :src="require('@/assets/images/boutique/product.png')"
...@@ -88,6 +89,16 @@ ...@@ -88,6 +89,16 @@
<view class="product-name">AITO问界 3M车窗膜(M5)</view> <view class="product-name">AITO问界 3M车窗膜(M5)</view>
</view> </view>
</view> </view>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../assets/images/boutique/nothing.png"
/>
<view>暂无产品内容</view>
</view>
</template>
</view> </view>
</view> </view>
</view> </view>
...@@ -103,29 +114,22 @@ ...@@ -103,29 +114,22 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
export default { export default {
name: 'Membranes', name: 'Membranes',
props: {
views: {
type: Array,
default: () => []
},
madiaId: {
type: Number,
default: 0
}
},
data () { data () {
return { return {
firstIndex: 0, firstIndex: 0,
firstNav: [ firstLeft: ['0rpx', '352rpx', '756rpx'],
{ firstClass: ['first-nav', 'second-nav', 'second-nav'],
name: '问界M5',
left: '0rpx',
class: 'first-nav'
},
{
name: '问界M7',
left: '352rpx',
class: 'second-nav'
},
{
name: '问界M9',
left: '756rpx',
class: 'second-nav'
}
],
secondIndex: 0, secondIndex: 0,
secondNav: ['车窗膜', '改色膜', '车衣', '天窗冰甲'],
// animationList: ['m5', 'm7', 'm9']
animationList: [require('@/assets/images/boutique/animation-m5.png'), require('@/assets/images/boutique/animation-m7.png'), require('@/assets/images/boutique/animation-m9.png')] animationList: [require('@/assets/images/boutique/animation-m5.png'), require('@/assets/images/boutique/animation-m7.png'), require('@/assets/images/boutique/animation-m9.png')]
} }
}, },
...@@ -139,21 +143,19 @@ export default { ...@@ -139,21 +143,19 @@ export default {
this.firstIndex = 0 this.firstIndex = 0
} }
}, },
mounted () {
},
methods: { methods: {
changeIndex (index, name) { changeIndex(index, name) {
console.log(index, name)
this[name] = index this[name] = index
if (name === 'fristIndex') {
this.secondIndex = 0
}
}, },
async findSoureList () { async findSoureList () {
console.log(1111) console.log(1111)
const data = await uni.$api.boutiqueApi.findSoureList({}) const data = await uni.$api.boutiqueApi.findSoureList({})
console.log(data) console.log(data)
}, },
back () {
console.log('back')
}
} }
} }
</script> </script>
...@@ -219,10 +221,29 @@ export default { ...@@ -219,10 +221,29 @@ export default {
font-weight: 500; font-weight: 500;
font-size: 40rpx; font-size: 40rpx;
color: #1f2133; color: #1f2133;
.text {
position: relative;
text-align: center;
width: 400rpx;
}
.active { .active {
position: absolute; position: absolute;
top: 0; top: 0;
z-index: -1; z-index: -1;
font-weight: 700;
font-size: 40rpx;
color: #2C66F7;
&::after {
content: "";
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 48rpx;
height: 8rpx;
background-color: #2C66F7;
border-radius: 16rpx;
}
} }
} }
} }
...@@ -233,6 +254,7 @@ export default { ...@@ -233,6 +254,7 @@ export default {
padding: 64rpx 0; padding: 64rpx 0;
margin-top: -48rpx; margin-top: -48rpx;
border-radius: 48rpx; border-radius: 48rpx;
height: calc(100% - 128rpx);
.second-tab { .second-tab {
display: inline-flex; display: inline-flex;
background: #f2f2f2; background: #f2f2f2;
...@@ -240,6 +262,7 @@ export default { ...@@ -240,6 +262,7 @@ export default {
height: 84rpx; height: 84rpx;
align-items: center; align-items: center;
margin-left: 64rpx; margin-left: 64rpx;
margin-bottom: 48rpx;
.tab-item { .tab-item {
display: inline-block; display: inline-block;
height: 100%; height: 100%;
...@@ -263,10 +286,8 @@ export default { ...@@ -263,10 +286,8 @@ export default {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 48rpx; gap: 48rpx;
margin-top: 48rpx; // height: 908rpx;
height: 908rpx;
padding: 0 64rpx; padding: 0 64rpx;
// height: 998rpx;
overflow-y: auto; overflow-y: auto;
.product-item { .product-item {
text-align: center; text-align: center;
...@@ -284,6 +305,19 @@ export default { ...@@ -284,6 +305,19 @@ export default {
} }
} }
} }
.nothing {
width: 100%;
flex-direction: column;
font-size: 14px;
color: #999999;position: absolute;
top: 50%;
transform: translateY(-50%);
.icon {
width: 676rpx;
height: 284rpx;
margin-bottom: 24rpx;
}
}
@keyframes moveAndFade { @keyframes moveAndFade {
0% { 0% {
transform: translate(100%, -100%) scale(0.2); /* 移动到右上角并缩小 */ transform: translate(100%, -100%) scale(0.2); /* 移动到右上角并缩小 */
...@@ -302,5 +336,7 @@ export default { ...@@ -302,5 +336,7 @@ export default {
position: absolute; /* 确保图片可以移动 */ position: absolute; /* 确保图片可以移动 */
top: 0; top: 0;
right: 0; right: 0;
width: 600rpx;
height: 400rpx;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!