Commit 7c9bc515 by 胡悦

提交

1 parent 93e1f267
......@@ -5,13 +5,36 @@
<view class="title">{{ title }}</view>
<view class="container">
<view class="container-left">
<view v-for="item in list" :key="item.name" class="item" :class="item.class" :style="item.style">
<image :src="item.detailUrl" mode="widthFix" class="item-image" />
<view class="item-text">{{item.name}}</view>
</view>
<view v-for="(item, index) in views" :key="item.name" class="item" @click="showSection(index)" :class="item.class" :style="item.style">
<view class="image-container">
<image :src="item.detailUrl" mode="widthFix" class="item-image" />
<view class="item-text">{{item.name}}</view>
</view>
<view class="details-container">
<view class="details-section" :class="showIndex == index ? 'show' : 'hide'">
<view class="section-title">{{item.name}}</view>
<view class="section-description">冷却风扇电机、散热器、冷却液水壶盖、冷却液水壶、冷却液循环泵</view>
</view>
</view>
</view>
</view>
<view class="container-right">
<image src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-15.webp" mode="widthFix" class="serice-image" />
<view class="ul">
<view class="ul-title">高价值零部件</view>
<view class="li-item" v-for="i in ulList" :key="i.index" @click="open(i.flagName)">
<view class="li-content">
<view class="li-item-content"><view class="li-number">{{i.index}}</view>{{i.name}}</view>
<image
v-if="i.hasArrow"
src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/icon-arrow.webp"
mode="scaleToFill"
class="icon-arrow"
/>
</view>
<view class="li-value">{{i.value}}</view>
</view>
</view>
</view>
</view>
</template>
......@@ -25,7 +48,8 @@ const list = [
detailUrl:
"https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-1.webp",
style: 'width: 284rpx;height: 498rpx;float: left;',
class: 'm-r-b'
class: 'm-r-b',
sectionStyle: 'top: -498rpx'
},
{
name: "悬挂系统",
......@@ -118,6 +142,44 @@ const list = [
style: 'width: 286rpx;height: 332rpx;float: left;'
},
];
const ulList = [
{
index: '01',
name: '元宝梁',
value: '价值4千-1万元'
},
{
index: '02',
name: '转向节',
value: '价值2千-5千元'
},
{
index: '03',
name: '减震器上座',
value: '价值1千-3千元'
},
{
index: '04',
name: '智能中控屏',
value: '价值5千-3万元',
hasArrow: true,
flagName: 'control'
},
{
index: '05',
name: '空调压缩机',
value: '价值4千-1.6万元',
hasArrow: true,
flagName: 'compressor'
},
{
index: '06',
name: '空气悬挂',
value: '价值1万-1.3万元',
hasArrow: true,
flagName: 'airSuspension'
}
]
export default {
name: "Guarantee",
props: {
......@@ -129,12 +191,29 @@ export default {
data() {
return {
viewIndex: 6,
list
list,
ulList,
showIndex: -1
};
},
mounted() {
console.log(this.views);
},
methods: {
open(name) {
console.log(name)
},
showSection(index) {
console.log(index)
if (this.showIndex === index) {
// 如果当前点击的项已经是翻转状态,则关闭它
this.showIndex = -1;
} else {
// 否则,打开新点击的项
this.showIndex = index;
}
}
},
};
</script>
......@@ -164,18 +243,14 @@ export default {
column-gap: 64rpx;
&-left {
position: relative;
// display: flex;
// flex-direction: row;
// flex-wrap: wrap;
// column-count: auto;
column-gap: 16rpx;
border-radius: 24rpx;
&::after{
content: "";
display: block;
clear: both;
}
flex: 1;
// width: 1786rpx;
.item {
position: relative;
}
......@@ -190,6 +265,46 @@ export default {
color: #FFFFFF;
line-height: 44rpx;
}
.details-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
border-radius: 24rpx;
}
.details-section {
// position: absolute;
// top: 0;
// left: 0;
width: 100%;
height: 100%;
color: #FFFFFF;
padding: 24rpx;
border-radius: 24rpx;
background-image: linear-gradient(180deg, #21425cb3 0%, #4A84F9 68%);
display: none;
flex-direction: column;
justify-content: flex-end;
animation: show-gradient .2s linear;
// overflow: hidden;
// animation: slide-top 2s linear;
.section-title {
font-size: 30rpx;
}
.section-description {
font-size: 24rpx;
margin-top: 12rpx;
}
}
.show {
display: flex;
}
.hide {
// display: none;
animation: hidden-gradient 2s linear;
}
}
&-right {
width: 336rpx;
......@@ -197,6 +312,67 @@ export default {
width: 336rpx;
height: 280rpx;
}
.ul {
width: 100%;
border: 4rpx solid #FDFDFF;
border-radius: 24rpx;
margin-top: 36rpx;
box-sizing: border-box;
&-title {
background-color: #4A84F9;
box-shadow: inset 0 0 16rpx 0 #FFFFFF;
border-radius: 24rpx 24rpx 0 0;
height: 88rpx;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
line-height: 88rpx;
text-align: center;
}
.li-item {
width: 100%;
height: 128rpx;
box-sizing: border-box;
display: flex;
justify-content: center;
flex-direction: column;
padding-left: 40rpx;
// margin-bottom: 4rpx;
border: 2rpx solid #FDFDFF;
.li-number {
font-size: 32rpx;
margin-right: 12rpx;
}
.li-content {
display: flex;
align-items: center;
.li-item-content {
display: flex;
align-items: baseline;
}
.icon-arrow {
width: 28rpx;
height: 28rpx;
margin-left: 12rpx;
}
}
.li-value {
margin-top: 8rpx;
font-size: 22rpx;
color: #1462FF;
}
&:nth-child(odd) {
background-color: #E5EDFF;
}
&:nth-child(even) {
background-color: rgba(255, 255, 255, 0.35);
}
&:last-child {
border-radius: 0 0 24rpx 24rpx;
height: 140rpx;
}
}
}
}
}
}
......@@ -210,4 +386,24 @@ export default {
.m-r {
margin-right: 16rpx;
}
// 动画效果
@keyframes show-gradient {
0% {
transform: translateY(100%);
}
100% {
transform: translateY(0);
}
}
@keyframes hidden-gradient {
0% {
transform: translateY(0);
}
100% {
transform: translateY(100%);
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!