fix(login): 修复多端适配及事件重复绑定问题

1. 修正微信小程序平台的条件编译标识
2. 为uniapp页面元素补充@tap事件,兼容多端点击事件规范
This commit is contained in:
2026-06-04 17:28:24 +08:00
parent 5a0c903346
commit 65b49fe4d5
2 changed files with 10 additions and 8 deletions

View File

@@ -253,7 +253,7 @@ export default {
// 打开弹窗 // 打开弹窗
open(url = '', mode = 'navigateTo') { open(url = '', mode = 'navigateTo') {
if (url) this.url = url; if (url) this.url = url;
// #ifdef MP // #ifdef MP-WEIXIN
this.getCode(authData => { this.getCode(authData => {
this.authLogin(authData, 'authOnlyLogin'); this.authLogin(authData, 'authOnlyLogin');
}); });
@@ -279,7 +279,7 @@ export default {
} }
// #endif // #endif
// #ifndef MP || H5 // #ifndef MP-WEIXIN || H5
this.toLogin(mode); this.toLogin(mode);
// #endif // #endif
}, },

View File

@@ -27,7 +27,7 @@
<input type="password" :placeholder="$lang('passwordInputPlaceholder')" <input type="password" :placeholder="$lang('passwordInputPlaceholder')"
placeholder-class="input-placeholder" class="input" v-model="formData.password" /> placeholder-class="input-placeholder" class="input" v-model="formData.password" />
<view class="align-right" v-show="loginMode == 'account'"> <view class="align-right" v-show="loginMode == 'account'">
<text @click="forgetPassword">{{ $lang('forgetPasswordText') }}</text> <text @click="forgetPassword" @tap="forgetPassword">{{ $lang('forgetPasswordText') }}</text>
</view> </view>
</view> </view>
</view> </view>
@@ -37,25 +37,27 @@
placeholder-class="input-placeholder" class="input" v-model="formData.dynacode" /> placeholder-class="input-placeholder" class="input" v-model="formData.dynacode" />
<view class="dynacode" <view class="dynacode"
:class="dynacodeData.seconds == 120 ? 'color-base-text' : 'color-tip'" :class="dynacodeData.seconds == 120 ? 'color-base-text' : 'color-tip'"
@click="sendMobileCode">{{ dynacodeData.codeText }}</view> @click="sendMobileCode" @tap="sendMobileCode">{{ dynacodeData.codeText }}</view>
</view> </view>
</view> </view>
</view> </view>
<view class="btn_view"> <view class="btn_view">
<button type="primary" @click="login" class="login-btn color-base-border color-base-bg" <button type="primary" @click="login" @tap="login" class="login-btn color-base-border color-base-bg"
style="background: #2796f2 !important;border: none;">{{ $lang('loginButtonText') }}</button> style="background: #2796f2 !important;border: none;">{{ $lang('loginButtonText') }}</button>
</view> </view>
<view class="regisiter-agreement" <view class="regisiter-agreement"
style="margin: 0 50rpx;padding-top: 40rpx;line-height: 1.5;display: flex;"> style="margin: 0 50rpx;padding-top: 40rpx;line-height: 1.5;display: flex;">
<view style="" class="iconfont" <view style="" class="iconfont"
:class="isAgree ? 'icon-fuxuankuang1 color-base-text' : 'icon-fuxuankuang2'" :class="isAgree ? 'icon-fuxuankuang1 color-base-text' : 'icon-fuxuankuang2'"
@click="isAgree = !isAgree"></view> @click="isAgree = !isAgree" @tap="isAgree = !isAgree"></view>
<view style="text-align: left;margin-left: 10rpx;padding-top: 2rpx;">{{ <view style="text-align: left;margin-left: 10rpx;padding-top: 2rpx;">{{
$lang('registerAgreementText') }} <text @click="tourl('/pages_tool/agreement/contenr?type=0')" $lang('registerAgreementText') }} <text @click="tourl('/pages_tool/agreement/contenr?type=0')"
@tap="tourl('/pages_tool/agreement/contenr?type=0')"
style="color:#4395ff">{{ $lang('privacyPolicyText') }}</text> <text style="color:#4395ff">{{ $lang('privacyPolicyText') }}</text> <text
@click="tourl('/pages_tool/agreement/contenr?type=1')" style="color:#4395ff">{{ @click="tourl('/pages_tool/agreement/contenr?type=1')"
$lang('userServiceAgreementText') }}</text></view> @tap="tourl('/pages_tool/agreement/contenr?type=1')"
style="color:#4395ff">{{ $lang('userServiceAgreementText') }}</text></view>
</view> </view>
</view> </view>
<loading-cover ref="loadingCover"></loading-cover> <loading-cover ref="loadingCover"></loading-cover>