Commit eb70ad1a by 陈英杰

合并分支 'test' 到 'dev'

取消关闭后的打赏面板回到0位置



查看合并请求 !159
parents ab362b62 c266c8fd
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<div style="width:100%;height: auto;border-radius: 15px 15px 0 0;overflow: hidden;"> <div style="width:100%;height: auto;border-radius: 15px 15px 0 0;overflow: hidden;">
<div style="background: rgba(0, 0, 0, 0.9); width:100%;height: auto" @click.stop> <div style="background: rgba(0, 0, 0, 0.9); width:100%;height: auto" @click.stop>
<div class="top-box"> <div class="top-box">
<div class="tab-box"> <div class="tab-box" v-show="swiper">
<div :class="{ 'z-active': list[tabIndex].nameKey === 'gift' }" @click.stop="_tabSwitch(0)" <div :class="{ 'z-active': list[tabIndex].nameKey === 'gift' }" @click.stop="_tabSwitch('0')"
v-if="list.some(item => item.nameKey === 'gift')"> v-if="list.some(item => item.nameKey === 'gift')">
礼物 礼物
</div> </div>
<div :class="{ 'z-active': list[tabIndex].nameKey === 'cash' }" @click.stop="_tabSwitch(1)" <div :class="{ 'z-active': list[tabIndex].nameKey === 'cash' }" @click.stop="_tabSwitch('1')"
v-if="list.some(item => item.nameKey === 'cash')"> v-if="list.some(item => item.nameKey === 'cash')">
现金打赏 现金打赏
</div> </div>
...@@ -86,11 +86,9 @@ export default { ...@@ -86,11 +86,9 @@ export default {
methods: { methods: {
close() { close() {
this.$emit('input', false) this.$emit('input', false)
this.tabIndex = 0
this.swiper.slideTo('0')
}, },
_tabSwitch(index) { _tabSwitch(index) {
this.swiper && this.swiper.slideTo(index + '' || this.tabIndex + ''); this.swiper.slideTo(index + '' || this.tabIndex + '');
}, },
_initSwiper() { _initSwiper() {
const self = this; const self = this;
...@@ -108,9 +106,11 @@ export default { ...@@ -108,9 +106,11 @@ export default {
watch: { watch: {
value(newVal) { value(newVal) {
if (newVal){ if (newVal){
this.tabIndex = 0
this.$nextTick(() => { this.$nextTick(() => {
this._initSwiper(); this._initSwiper();
this.$nextTick(() => {
this.swiper.slideTo(this.tabIndex)
})
}); });
} }
} }
......
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 sign in to comment