【银保app】轮播图增加跳转

This commit is contained in:
liu.xiaofeng@ebiz-digits.com
2022-11-09 14:32:09 +08:00
parent bc184fd681
commit 000054dffd

View File

@@ -2,7 +2,7 @@
<div class="public_container" :style="{paddingTop:marginTop+'px'}"> <div class="public_container" :style="{paddingTop:marginTop+'px'}">
<div class="head" style="margin: 10px;border-radius: 5px;"> <div class="head" style="margin: 10px;border-radius: 5px;">
<van-swipe :autoplay="3000" style="width: 100%;"> <van-swipe :autoplay="3000" style="width: 100%;">
<van-swipe-item v-for="(item, index) in activity" :key="index"> <van-swipe-item v-for="(item, index) in activity" :key="index" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend(item)">
<!-- <img :src="config.assetsUrl + item.img + '?v=' + thisGetTime" /> --> <!-- <img :src="config.assetsUrl + item.img + '?v=' + thisGetTime" /> -->
<img :src="item.img"> <img :src="item.img">
</van-swipe-item> </van-swipe-item>
@@ -324,6 +324,7 @@ export default {
colorTwo:false, colorTwo:false,
colorThree:false, colorThree:false,
thisValue:'12.9', thisValue:'12.9',
clickFlag:false,
} }
}, },
mounted(){ mounted(){
@@ -381,11 +382,7 @@ export default {
this.calendarShow = true this.calendarShow = true
}, },
setAnimation(){ setAnimation(){
let ruleTrue = ` @keyframes changeWidth3 { let ruleTrue = ` @keyframes changeWidth3 { 0% {width: 0px;} 100% {width: 170px;} }`
0% {width: 0px;}
100% {width: 170px;}
}`
let sheet = document.styleSheets[0] let sheet = document.styleSheets[0]
sheet.insertRule(ruleTrue, 0) sheet.insertRule(ruleTrue, 0)
this.$refs.imageup1.style.animation = "changeWidth3 1s forwards" this.$refs.imageup1.style.animation = "changeWidth3 1s forwards"
@@ -397,6 +394,24 @@ export default {
}else{ }else{
this.$toast('暂未开放') this.$toast('暂未开放')
} }
},
touchstart(){
this.clickFlag = true
},
touchmove(){
this.clickFlag = false
},
touchend(data){
if(this.clickFlag){
window.location.href = JSON.parse(data.route).extra.url
}else{
}
},
swiperJump(data){
if(JSON.parse(data.route).extra.url){
window.location.href = JSON.parse(data.route).extra.url
}
} }
}, },
} }