Commit 4de9ed08 by 李伟康

commit 三包图片使用base64

1 parent 53e6417f
...@@ -20,26 +20,40 @@ ...@@ -20,26 +20,40 @@
src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/icon-car.webp" src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/icon-car.webp"
/> />
<view class="container"> <view class="container">
<view class="left-tab" > <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="tab-item"
v-for="item in list"
:key="item.id"
@click="tabChange(item)"
:class="[item.id == activeIndex ? 'active' : '']"
>{{item.name}}</view>
</view> </view>
<view class="content"> <view class="content">
<template v-if="activeIndex == 2"> <template v-if="activeIndex == 2">
<image <image
:key="imgKey" :class="direction" :key="imgKey"
:class="direction"
class="content-image" 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="content-tab">
<view class="tab-item" @click="tabSwitch(1)"></view> <view
<view class="tab-item" @click="tabSwitch(2)"></view> class="tab-item"
@click="tabSwitch(1)"
></view>
<view
class="tab-item"
@click="tabSwitch(2)"
></view>
</view> </view>
</template> </template>
<template v-else> <template v-else>
<image <image
:key="imgKey" :class="direction" :key="imgKey"
:class="direction"
class="content-image" class="content-image"
:src="`https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/${list[activeIndex - 1].urlName}.webp`" :src="viewsImg()"
/> />
</template> </template>
</view> </view>
...@@ -83,22 +97,29 @@ export default { ...@@ -83,22 +97,29 @@ export default {
tabIndex: 1 tabIndex: 1
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
tabChange(item) { tabChange (item) {
if (this.activeIndex === id) return if (this.activeIndex === id) return
const { id } = item const { id } = item
this.direction = '' this.direction = ''
console.log(id, this.activeIndex,' !!!!!!!!!!') console.log(id, this.activeIndex, ' !!!!!!!!!!')
this.direction = id > this.activeIndex ? 'bottom' : 'top' this.direction = id > this.activeIndex ? 'bottom' : 'top'
this.activeIndex = id this.activeIndex = id
this.imgKey = Date.now() this.imgKey = Date.now()
}, },
tabSwitch(val) { tabSwitch (val) {
console.log(val) console.log(val)
if (val == this.tabIndex) return if (val == this.tabIndex) return
this.tabIndex = val 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 { ...@@ -142,21 +163,21 @@ export default {
// justify-content: center; // justify-content: center;
width: 100%; width: 100%;
height: 312rpx; height: 312rpx;
background: #F2F5FF; background: #f2f5ff;
border: 4rpx solid hsl(0, 80%, 100%); 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; border-radius: 32rpx;
margin-bottom: 48rpx; margin-bottom: 48rpx;
font-weight: 500; font-weight: 500;
font-size: 40rpx; font-size: 40rpx;
color: #1A1A1A; color: #1a1a1a;
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
&.active { &.active {
color: #fff; color: #fff;
background-image: linear-gradient(180deg, #6795FF 0%, #4A84F9 100%); background-image: linear-gradient(180deg, #6795ff 0%, #4a84f9 100%);
box-shadow: 16px 16px 24px 0 #849dc240, inset 0 0 16px 0 #FFFFFF; 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!