添加登录按钮的节流功能,每三秒至多触发一次

This commit is contained in:
WindowBird 2025-09-04 11:27:46 +08:00
parent 23cdf42721
commit 30279799b5

View File

@ -9,7 +9,7 @@
</view> </view>
<view class="main-content"> <view class="main-content">
<!-- 登录按钮 --> <!-- 登录按钮 -->
<button :disabled="loginLoading" class="login-btn" @click="goToLogin"> <button :disabled="loginLoading" class="login-btn" @click="throttle()(goToLogin, 3000)">
<text class="btn-text">{{ loginLoading ? '登录中...' : '微信用户一键登录' }}</text> <text class="btn-text">{{ loginLoading ? '登录中...' : '微信用户一键登录' }}</text>
</button> </button>
</view> </view>
@ -84,6 +84,8 @@ import { getServiceTerms, getPrivacyPolicy } from '@/api/article/article.js'
import { commonEnum } from '../../enum/commonEnum' import { commonEnum } from '../../enum/commonEnum'
import { getNavBarHeight, getTitleBarHeight } from '../../utils/system' import { getNavBarHeight, getTitleBarHeight } from '../../utils/system'
import throttle from 'uview-ui/libs/function/throttle'
export default { export default {
data() { data() {
return { return {
@ -126,7 +128,11 @@ export default {
this.pageLoading.destroy() this.pageLoading.destroy()
} }
}, },
methods: { methods: {
throttle() {
return throttle
},
getTitleBarHeight, getTitleBarHeight,
getNavBarHeight, getNavBarHeight,
goback() { goback() {