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

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 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>
</button>
</view>
@ -84,6 +84,8 @@ import { getServiceTerms, getPrivacyPolicy } from '@/api/article/article.js'
import { commonEnum } from '../../enum/commonEnum'
import { getNavBarHeight, getTitleBarHeight } from '../../utils/system'
import throttle from 'uview-ui/libs/function/throttle'
export default {
data() {
return {
@ -126,7 +128,11 @@ export default {
this.pageLoading.destroy()
}
},
methods: {
throttle() {
return throttle
},
getTitleBarHeight,
getNavBarHeight,
goback() {