Commit 182ccda0 by 胡悦

提交

1 parent be3b7e7f
<!--
* @Description:
* @Author: huyue
* @Date: 2024-06-24 16:35:00
* @LastEditors: huyue
* @LastEditTime: 2024-06-25 13:53:14
-->
<template>
<view class="layout">
<wnCanvas
:drawStatus="penSwitch"
:canvasId="`c-${madiaId}`"
custom
>
<template slot="customContent">
<view class="title">{{title}}</view>
<image
class="icon-car"
src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/icon-car.webp"
/>
<view class="container">
<view class="left-tab" >
<view class="tab-item" v-for="item in list" :key="item.id" @click="tabChange(item)" :class="[item.id == activeIndex ? 'active' : '']">{{item.name}}</view>
</view>
<view class="content">
<template v-if="activeIndex == 2">
<image
:key="imgKey" :class="direction"
class="content-image"
:src="`https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/${list[activeIndex - 1].urlName}-${tabIndex}.webp`"
/>
<view class="content-tab">
<view class="tab-item" @click="tabSwitch(1)"></view>
<view class="tab-item" @click="tabSwitch(2)"></view>
</view>
</template>
<template v-else>
<image
:key="imgKey" :class="direction"
class="content-image"
:src="`https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/${list[activeIndex - 1].urlName}.webp`"
/>
</template>
</view>
</view>
</template>
</wnCanvas>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
views: Array,
penSwitch: Boolean,
title: String,
madiaId: Number,
},
name: 'MediaComponent',
data () {
return {
activeIndex: 1,
list: [
{
id: 1,
name: '整车质保',
urlName: '5-1'
},
{
id: 2,
name: '零部件范围及质保期',
urlName: '5-2'
},
{
id: 3,
name: '三包凭证',
urlName: '5-3'
}
],
direction: 'bottom',
imgKey: Date.now(),
tabIndex: 1
}
},
mounted () {
},
methods: {
tabChange(item) {
if (this.activeIndex === id) return
const { id } = item
this.direction = ''
console.log(id, this.activeIndex,' !!!!!!!!!!')
this.direction = id > this.activeIndex ? 'bottom' : 'top'
this.activeIndex = id
this.imgKey = Date.now()
},
tabSwitch(val) {
console.log(val)
if (val == this.tabIndex) return
this.tabIndex = val
}
}
}
</script>
<style scoped lang='scss'>
.layout {
width: 100vw;
height: 100vh;
position: relative;
background-image: url("@/assets/images/media/media-bg.webp");
background-size: 100%;
.title {
position: absolute;
left: 0;
top: 112rpx;
font-weight: 500;
font-size: 48rpx;
color: #1a1a1a;
letter-spacing: 4rpx;
line-height: 64rpx;
text-align: center;
width: 100%;
z-index: 2;
}
.container {
display: flex;
align-items: center;
padding-top: 248rpx;
padding-bottom: 96rpx;
height: 100%;
margin: 0 80rpx;
.left-tab {
width: 360rpx;
margin-right: 48rpx;
.tab-item {
display: flex;
padding: 0 76rpx;
box-sizing: border-box;
align-items: center;
// justify-content: center;
width: 100%;
height: 312rpx;
background: #F2F5FF;
border: 4rpx solid hsl(0, 80%, 100%);
box-shadow: inset 0 0 16rpx 0 #FFFFFF;
border-radius: 32rpx;
margin-bottom: 48rpx;
font-weight: 500;
font-size: 40rpx;
color: #1A1A1A;
&:last-child {
margin-bottom: 0;
}
&.active {
color: #fff;
background-image: linear-gradient(180deg, #6795FF 0%, #4A84F9 100%);
box-shadow: 16px 16px 24px 0 #849dc240, inset 0 0 16px 0 #FFFFFF;
}
}
}
.content {
background-color: rgba(255, 255, 255, 0.4);
backdrop-filter: blur(4px);
z-index: 1;
border-radius: 64rpx;
position: relative;
&-tab {
display: flex;
position: absolute;
width: 100%;
top: 0;
height: 112rpx;
z-index: 1;
.tab-item {
width: 50%;
height: 100%;
}
}
}
.content-image {
width: 1778rpx;
height: 1192rpx;
}
}
.icon-car {
position: absolute;
bottom: 0;
right: 0;
width: 952rpx;
height: 248rpx;
}
}
.top {
animation: show-view-top 0.5s;
}
.bottom {
animation: show-view-bottom 0.3s;
}
@keyframes show-view-top {
0% {
opacity: 0;
transform: translateY(-224rpx);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
@keyframes show-view-bottom {
0% {
opacity: 0;
transform: translateY(100%);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-04-08 11:30:30 * @Date: 2024-04-08 11:30:30
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2024-06-24 13:52:12 * @LastEditTime: 2024-06-24 16:41:54
--> -->
<template> <template>
<view <view
...@@ -72,6 +72,7 @@ import Reception from "./components/Reception.vue"; ...@@ -72,6 +72,7 @@ import Reception from "./components/Reception.vue";
import MediaComponent from "./components/MediaComponent.vue"; import MediaComponent from "./components/MediaComponent.vue";
import Media_6 from "./components/Media_6.vue"; import Media_6 from "./components/Media_6.vue";
import History from "./components/History.vue"; import History from "./components/History.vue";
import ThreeGuarantees from "./components/ThreeGuarantees.vue";
import Guarantee from './components/Guarantee.vue'; import Guarantee from './components/Guarantee.vue';
import payPop from "./components/payPop.vue"; import payPop from "./components/payPop.vue";
import FinishStep from '@/components/FinishStep.vue'; import FinishStep from '@/components/FinishStep.vue';
...@@ -85,7 +86,8 @@ export default { ...@@ -85,7 +86,8 @@ export default {
payPop, payPop,
FinishStep, FinishStep,
Guarantee, Guarantee,
History History,
ThreeGuarantees
}, },
props: { props: {
id: [String, Number], id: [String, Number],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!