修改首页的滚动逻辑
Showing
3 changed files
with
21 additions
and
7 deletions
... | @@ -2,8 +2,8 @@ module.exports = { | ... | @@ -2,8 +2,8 @@ module.exports = { |
2 | common: { | 2 | common: { |
3 | Confirm: "Confirm", | 3 | Confirm: "Confirm", |
4 | Cancel: "Cancel", | 4 | Cancel: "Cancel", |
5 | Male: "Male", | 5 | Male: "Mr.", |
6 | Female: "Female", | 6 | Female: "Mrs.", |
7 | Sex: "Sex", | 7 | Sex: "Sex", |
8 | Age: "Age", | 8 | Age: "Age", |
9 | Birthday: "Birthday", | 9 | Birthday: "Birthday", | ... | ... |
... | @@ -270,6 +270,7 @@ export default { | ... | @@ -270,6 +270,7 @@ export default { |
270 | break; | 270 | break; |
271 | default: | 271 | default: |
272 | location.href = link; | 272 | location.href = link; |
273 | this.initView(); | ||
273 | break; | 274 | break; |
274 | } | 275 | } |
275 | }, | 276 | }, |
... | @@ -481,7 +482,18 @@ export default { | ... | @@ -481,7 +482,18 @@ export default { |
481 | this.modalContent = content; | 482 | this.modalContent = content; |
482 | this.modalVisiable = true; | 483 | this.modalVisiable = true; |
483 | }, | 484 | }, |
484 | 485 | initView() { | |
486 | let pos = this.$route.query.pos; | ||
487 | let idx = this.$route.query.idx; | ||
488 | if (pos && this.$refs[pos]) { | ||
489 | this.$refs[pos].scrollIntoView(); | ||
490 | } | ||
491 | if (idx >= 0) { | ||
492 | idx = idx > this.dataList.length - 1 ? this.dataList.length - 1 : idx; | ||
493 | this.curTab = this.dataList[idx]; | ||
494 | this.swiperSiderTo(idx); | ||
495 | } | ||
496 | }, | ||
485 | initData() { | 497 | initData() { |
486 | 498 | ||
487 | this.curPaymentPeriod = this.paymentPeriodList[0]; | 499 | this.curPaymentPeriod = this.paymentPeriodList[0]; |
... | @@ -549,11 +561,13 @@ export default { | ... | @@ -549,11 +561,13 @@ export default { |
549 | // 设置缓存 | 561 | // 设置缓存 |
550 | sessionStorage.setItem("_pingan_index_datalist", JSON.stringify(this.dataList)); | 562 | sessionStorage.setItem("_pingan_index_datalist", JSON.stringify(this.dataList)); |
551 | sessionStorage.setItem("_pingan_index_bannerlist", JSON.stringify(this.bannerList)); | 563 | sessionStorage.setItem("_pingan_index_bannerlist", JSON.stringify(this.bannerList)); |
564 | |||
565 | this.initView(); | ||
552 | }) | 566 | }) |
553 | 567 | ||
554 | }, | 568 | }, |
555 | }, | 569 | }, |
556 | beforeDestroy() {}, | 570 | beforeDestroy() { }, |
557 | mounted() { | 571 | mounted() { |
558 | this.initData(); | 572 | this.initData(); |
559 | }, | 573 | }, |
... | @@ -562,7 +576,7 @@ export default { | ... | @@ -562,7 +576,7 @@ export default { |
562 | try { | 576 | try { |
563 | // this.refreshBanner(); | 577 | // this.refreshBanner(); |
564 | this.initData(); | 578 | this.initData(); |
565 | } catch (e) {} | 579 | } catch (e) { } |
566 | }); | 580 | }); |
567 | }, | 581 | }, |
568 | watch: { | 582 | watch: { | ... | ... |
... | @@ -93,7 +93,7 @@ | ... | @@ -93,7 +93,7 @@ |
93 | <div class="quote-cont"> | 93 | <div class="quote-cont"> |
94 | <!-- tab表格 --> | 94 | <!-- tab表格 --> |
95 | <div class="table" :class="{'table-1':dataList.length<=1}"> | 95 | <div class="table" :class="{'table-1':dataList.length<=1}"> |
96 | <div class="table-tab"> | 96 | <div class="table-tab" ref="quote"> |
97 | <!-- <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=" | 97 | <!-- <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=" |
98 | 'margin:0 -'+tableTapIndentation.mar+'px;width: calc(100% / ' + dataList.length + ');z-index:' + (dataList.length - index) + ''">{{ item.name }}</div> | 98 | 'margin:0 -'+tableTapIndentation.mar+'px;width: calc(100% / ' + dataList.length + ');z-index:' + (dataList.length - index) + ''">{{ item.name }}</div> |
99 | </div> --> | 99 | </div> --> |
... | @@ -210,7 +210,7 @@ | ... | @@ -210,7 +210,7 @@ |
210 | </div> | 210 | </div> |
211 | 211 | ||
212 | <!-- 联系我们表单 --> | 212 | <!-- 联系我们表单 --> |
213 | <div class="contact"> | 213 | <div class="contact" ref="contact"> |
214 | <div class="box-w panel"> | 214 | <div class="box-w panel"> |
215 | <div class="panel-left"> | 215 | <div class="panel-left"> |
216 | <div v-html="$t('index.contact.t1')" class="t1"></div> | 216 | <div v-html="$t('index.contact.t1')" class="t1"></div> | ... | ... |
-
Please register or sign in to post a comment