Commit 4de9ed08 by 李伟康

commit 三包图片使用base64

1 parent 53e6417f
......@@ -20,26 +20,40 @@
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 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"
: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`"
:src="viewsImg()"
/>
<view class="content-tab">
<view class="tab-item" @click="tabSwitch(1)"></view>
<view class="tab-item" @click="tabSwitch(2)"></view>
<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"
:key="imgKey"
:class="direction"
class="content-image"
:src="`https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/${list[activeIndex - 1].urlName}.webp`"
:src="viewsImg()"
/>
</template>
</view>
......@@ -83,22 +97,29 @@ export default {
tabIndex: 1
}
},
mounted () {
},
methods: {
tabChange(item) {
tabChange (item) {
if (this.activeIndex === id) return
const { id } = item
this.direction = ''
console.log(id, this.activeIndex,' !!!!!!!!!!')
console.log(id, this.activeIndex, ' !!!!!!!!!!')
this.direction = id > this.activeIndex ? 'bottom' : 'top'
this.activeIndex = id
this.imgKey = Date.now()
},
tabSwitch(val) {
tabSwitch (val) {
console.log(val)
if (val == this.tabIndex) return
this.tabIndex = val
},
viewsImg () {
let { activeIndex, tabIndex } = this
if (activeIndex == 3) activeIndex = 4
if (activeIndex == 2) return this.views[tabIndex].detailUrl
return this.views[activeIndex - 1].detailUrl
}
}
}
......@@ -142,21 +163,21 @@ export default {
// justify-content: center;
width: 100%;
height: 312rpx;
background: #F2F5FF;
background: #f2f5ff;
border: 4rpx solid hsl(0, 80%, 100%);
box-shadow: inset 0 0 16rpx 0 #FFFFFF;
box-shadow: inset 0 0 16rpx 0 #ffffff;
border-radius: 32rpx;
margin-bottom: 48rpx;
font-weight: 500;
font-size: 40rpx;
color: #1A1A1A;
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;
background-image: linear-gradient(180deg, #6795ff 0%, #4a84f9 100%);
box-shadow: 16px 16px 24px 0 #849dc240, inset 0 0 16px 0 #ffffff;
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!