0efb0be0 by joe

修改首页的滚动逻辑

1 parent b281a1ec
......@@ -2,8 +2,8 @@ module.exports = {
common: {
Confirm: "Confirm",
Cancel: "Cancel",
Male: "Male",
Female: "Female",
Male: "Mr.",
Female: "Mrs.",
Sex: "Sex",
Age: "Age",
Birthday: "Birthday",
......
......@@ -270,6 +270,7 @@ export default {
break;
default:
location.href = link;
this.initView();
break;
}
},
......@@ -481,7 +482,18 @@ export default {
this.modalContent = content;
this.modalVisiable = true;
},
initView() {
let pos = this.$route.query.pos;
let idx = this.$route.query.idx;
if (pos && this.$refs[pos]) {
this.$refs[pos].scrollIntoView();
}
if (idx >= 0) {
idx = idx > this.dataList.length - 1 ? this.dataList.length - 1 : idx;
this.curTab = this.dataList[idx];
this.swiperSiderTo(idx);
}
},
initData() {
this.curPaymentPeriod = this.paymentPeriodList[0];
......@@ -549,11 +561,13 @@ export default {
// 设置缓存
sessionStorage.setItem("_pingan_index_datalist", JSON.stringify(this.dataList));
sessionStorage.setItem("_pingan_index_bannerlist", JSON.stringify(this.bannerList));
this.initView();
})
},
},
beforeDestroy() {},
beforeDestroy() { },
mounted() {
this.initData();
},
......@@ -562,7 +576,7 @@ export default {
try {
// this.refreshBanner();
this.initData();
} catch (e) {}
} catch (e) { }
});
},
watch: {
......
......@@ -93,7 +93,7 @@
<div class="quote-cont">
<!-- tab表格 -->
<div class="table" :class="{'table-1':dataList.length<=1}">
<div class="table-tab">
<div class="table-tab" ref="quote">
<!-- <div class="table-tab-item" @click="onTabHandler(item)" v-html="item.tabName" v-for="(item, index) in dataList" :key="item.id" :class="{ 'table-tab-item-act': item.index == curTab.index }" :style="
'margin:0 -'+tableTapIndentation.mar+'px;width: calc(100% / ' + dataList.length + ');z-index:' + (dataList.length - index) + ''">{{ item.name }}</div>
</div> -->
......@@ -210,7 +210,7 @@
</div>
<!-- 联系我们表单 -->
<div class="contact">
<div class="contact" ref="contact">
<div class="box-w panel">
<div class="panel-left">
<div v-html="$t('index.contact.t1')" class="t1"></div>
......