修改首页的滚动逻辑
Showing
3 changed files
with
70 additions
and
56 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", | ... | ... |
... | @@ -88,51 +88,51 @@ export default { | ... | @@ -88,51 +88,51 @@ export default { |
88 | 88 | ||
89 | // 繳費期列表 | 89 | // 繳費期列表 |
90 | paymentPeriodList: [{ | 90 | paymentPeriodList: [{ |
91 | v: 3, | 91 | v: 3, |
92 | n: "", | 92 | n: "", |
93 | p: 333.330000 | 93 | p: 333.330000 |
94 | }, | 94 | }, |
95 | { | 95 | { |
96 | v: 5, | 96 | v: 5, |
97 | n: "", | 97 | n: "", |
98 | p: 200.000000 | 98 | p: 200.000000 |
99 | }, | 99 | }, |
100 | { | 100 | { |
101 | v: 8, | 101 | v: 8, |
102 | n: "", | 102 | n: "", |
103 | p: 125.000000 | 103 | p: 125.000000 |
104 | }, | 104 | }, |
105 | { | 105 | { |
106 | v: 10, | 106 | v: 10, |
107 | n: "", | 107 | n: "", |
108 | p: 100.000000 | 108 | p: 100.000000 |
109 | } | 109 | } |
110 | ], | 110 | ], |
111 | // 缴费选项列表 | 111 | // 缴费选项列表 |
112 | paymentOptionList: [{ | 112 | paymentOptionList: [{ |
113 | v: 1, | 113 | v: 1, |
114 | m: 12, | 114 | m: 12, |
115 | n: "", | 115 | n: "", |
116 | p: 1 | 116 | p: 1 |
117 | }, | 117 | }, |
118 | { | 118 | { |
119 | v: 2, | 119 | v: 2, |
120 | m: 6, | 120 | m: 6, |
121 | n: "", | 121 | n: "", |
122 | p: 0.5064 | 122 | p: 0.5064 |
123 | }, | 123 | }, |
124 | { | 124 | { |
125 | v: 4, | 125 | v: 4, |
126 | m: 6, | 126 | m: 6, |
127 | n: "", | 127 | n: "", |
128 | p: 0.2548 | 128 | p: 0.2548 |
129 | }, | 129 | }, |
130 | { | 130 | { |
131 | v: 12, | 131 | v: 12, |
132 | m: 1, | 132 | m: 1, |
133 | n: "", | 133 | n: "", |
134 | p: 0.0853 | 134 | p: 0.0853 |
135 | } | 135 | } |
136 | ], | 136 | ], |
137 | 137 | ||
138 | // 当前选择保费期 | 138 | // 当前选择保费期 |
... | @@ -157,13 +157,13 @@ export default { | ... | @@ -157,13 +157,13 @@ export default { |
157 | }, | 157 | }, |
158 | titleList() { | 158 | titleList() { |
159 | let result = [{ | 159 | let result = [{ |
160 | n: this.i18n.common.Male, | 160 | n: this.i18n.common.Male, |
161 | v: "M" | 161 | v: "M" |
162 | }, | 162 | }, |
163 | { | 163 | { |
164 | n: this.i18n.common.Female, | 164 | n: this.i18n.common.Female, |
165 | v: "F" | 165 | v: "F" |
166 | } | 166 | } |
167 | ] | 167 | ] |
168 | // console.log("result:", result); | 168 | // console.log("result:", result); |
169 | return result; | 169 | return result; |
... | @@ -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