Commit 84d3c6a7 by 胡悦

提交

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