diff --git a/src/pages/my/index.ts b/src/pages/my/index.ts index c9522f6..f29ea60 100644 --- a/src/pages/my/index.ts +++ b/src/pages/my/index.ts @@ -83,9 +83,7 @@ Page({ this.setData({ toastShow: false, }); - setTimeout(() => { - wx.showTabBar({}); - }, 1000); + wx.showTabBar({}); }, handleTopic() { wx.navigateTo({ diff --git a/src/pages/topic/index.ts b/src/pages/topic/index.ts index 04d3f8c..4c4c021 100644 --- a/src/pages/topic/index.ts +++ b/src/pages/topic/index.ts @@ -1,4 +1,5 @@ const app = getApp(); +const licia = require('miniprogram-licia'); Page({ data: { @@ -29,7 +30,7 @@ Page({ }); }); }, - handleBtn(e) { + handleBtn: licia.debounce(function (e) { const { index, id } = e.currentTarget.dataset; const { question, nav } = this.data; question[index].answer = id; @@ -38,7 +39,7 @@ Page({ nav: nav === question.length - 1 ? nav : nav + 1, percentage: ((nav + 1) / question.length) * 100, }); - }, + }, 200), handlePrev() { this.setData({ nav: this.data.nav - 1, diff --git a/src/pages/topic/index.wxml b/src/pages/topic/index.wxml index 15aac9b..f3fabad 100644 --- a/src/pages/topic/index.wxml +++ b/src/pages/topic/index.wxml @@ -31,7 +31,7 @@ class="btn {{questionItem.answer==='1' && 'active'}}" bind:tap="handleBtn" data-id="1" - data-index="{{index }}" + data-index="{{index}}" > 非常了解