微信小程序登录页面调整

This commit is contained in:
2026-07-12 15:30:58 +08:00
parent bfac6c6663
commit 758760eb36
7 changed files with 134 additions and 21 deletions
@@ -0,0 +1,37 @@
import { View, Text } from '@tarojs/components';
type WechatLoginButtonProps = {
loading?: boolean;
disabled?: boolean;
onClick: () => void;
};
function WechatIcon() {
return (
<View className="wechat-login-icon" aria-hidden>
<View className="wechat-login-icon__big" />
<View className="wechat-login-icon__small" />
</View>
);
}
/** 微信授权一键登录按钮(对齐 h5-user login-wechat-btn */
export default function WechatLoginButton({
loading = false,
disabled = false,
onClick,
}: WechatLoginButtonProps) {
const inactive = loading || disabled;
return (
<View
className={`login-wechat-btn${inactive ? ' login-wechat-btn--disabled' : ''}`}
onClick={inactive ? undefined : onClick}
>
<WechatIcon />
<Text className="login-wechat-btn__text">
{loading ? '授权中...' : '微信一键授权'}
</Text>
</View>
);
}