Commit d428df9e authored by sxl's avatar sxl 💬

fix:【bug】:swiper联动

parent 7aa1b5c7
......@@ -4,9 +4,7 @@
<Header :activeIndex="4" />
<CommonDialog :show="dialogVisible" @close-dialog="handleCloseDialog" :omDemandName="omDemandName" />
<el-dialog :title="conDia.lifeCycleName" :visible.sync="showConfirmButton" width="30%" center>
<span>
{{ conDia.intro }}
</span>
<p style=" white-space: pre-wrap;margin-left: 80px;" v-html="conDia.intro"></p>
<div class="mt20"></div>
<div>
<el-form label-width="90px" :model="formDia" :rules="rules" ref="formDia" label-position="right">
......@@ -45,8 +43,8 @@
transform: translate3d(0px, 0px, 0px);
">
<div class="swiper-slide" style="height: 435px; margin-bottom: 10px" v-for="item in lifeServiceList2"
:key="item.lifeCycleId" @mouseenter="swiper2.autoplay.stop()"
@mouseleave="swiper2.autoplay.start()">
:key="item.lifeCycleId" @mouseenter="swiper2 && swiper2.autoplay.stop()"
@mouseleave="swiper2 && swiper2.autoplay.start()">
<div style="
overflow-y: scroll;
display: flex;
......@@ -278,6 +276,9 @@ export default {
showTip(item) {
this.showConfirmButton = true;
this.conDia = item;
this.conDia.intro = this.conDia.intro.split('').join('<br/>')
console.log(item, 'item');
this.omDemandName = item.lifeCycleName;
this.formDia.omDemandName = item.lifeCycleName;
},
......@@ -300,13 +301,17 @@ export default {
this.lifeServiceList2 = this.sortLifeServiceList(index, JSON.parse(JSON.stringify(this.lifeServiceList)));
// swiper2停止自动滚动
if (this.swiper2) {
this.swiper2.autoplay.stop();
}
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(() => {
if (this.swiper2) {
this.swiper2.autoplay.start();
}
}, 3000);
},
sortLifeServiceList(idx, arr) {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment