更新微信登录

This commit is contained in:
wyf
2025-08-19 18:00:51 +08:00
parent b2cd46bc7a
commit 2cca7c7716
11 changed files with 211 additions and 76 deletions

View File

@@ -1751,64 +1751,132 @@ class MHTLoginPage extends GetView<MHTLoginController> {
),
);
}),
Divider(
color: stringToColor("#495A67"), // 线的颜色
thickness: 1.rpx, // 线的粗细
height: 20, // 垂直方向的占位高度
indent: 16, // 左边缩进
endIndent: 16, // 右边缩进
),
Text(
"其他登录方式".tr,
style: TextStyle(
color: Colors.white,
fontSize: AppConstants()
.normal_text_fontSize),
),
SizedBox(
height: 30.rpx,
),
ClickableContainer(
backgroundColor: Colors.white, // 背景色
highlightColor: Colors.grey, // 点击水波纹颜色
borderRadius: 999.rpx,
padding: EdgeInsets.zero,
onTap: () async {
// loginController.model.isIos == true &&
MHTRegisterController registerController =
Get.find();
if (registerController
.model.register_agree ==
null ||
registerController
.model.register_agree !=
true) {
TopSlideNotification.show(
context,
text: "需要同意协议".tr,
textColor:
themeController.currentColor.sc9,
);
return;
}
MHTLoginController loginController =
Get.find();
await loginController.wxLoginSendAuth();
// TopSlideNotification.show(context,
// text: "测试阶段,暂不支持".tr);
},
child: Container(
width: 90.rpx,
height: 90.rpx,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
'assets/images/wechat.png'), // 本地图片
fit: BoxFit.fill, // 填满整个 Container
// Divider(
// color: stringToColor("#495A67"), // 线的颜色
// thickness: 1.rpx, // 线的粗细
// height: 20, // 垂直方向的占位高度
// indent: 16, // 左边缩进
// endIndent: 16, // 右边缩进
// ),
// Text(
// "其他登录方式".tr,
// style: TextStyle(
// color: Colors.white,
// fontSize: AppConstants()
// .normal_text_fontSize),
// ),
// SizedBox(
// height: 30.rpx,
// ),
// ClickableContainer(
// backgroundColor: Colors.white, // 背景色
// highlightColor: Colors.grey, // 点击水波纹颜色
// borderRadius: 999.rpx,
// padding: EdgeInsets.zero,
// onTap: () async {
// // loginController.model.isIos == true &&
// MHTRegisterController registerController =
// Get.find();
// if (registerController
// .model.register_agree ==
// null ||
// registerController
// .model.register_agree !=
// true) {
// TopSlideNotification.show(
// context,
// text: "需要同意协议".tr,
// textColor:
// themeController.currentColor.sc9,
// );
// return;
// }
// MHTLoginController loginController =
// Get.find();
// await loginController.wxLoginSendAuth();
// // TopSlideNotification.show(context,
// // text: "测试阶段,暂不支持".tr);
// },
// child: Container(
// width: 90.rpx,
// height: 90.rpx,
// decoration: BoxDecoration(
// image: DecorationImage(
// image: AssetImage(
// 'assets/images/wechat.png'), // 本地图片
// fit: BoxFit.fill, // 填满整个 Container
// ),
// ),
// ),
// ),
Obx(() {
// 条件iOS 且微信未安装
if (controller.model.isIos == true &&
controller.model.isWeChatNotInstalled ==
true) {
return SizedBox.shrink(); // 不显示任何内容
}
MHTRegisterController
mhtRegisterController = Get.find();
// 显示其他登录方式
return Column(
children: [
Divider(
color:
stringToColor("#495A67"), // 线的颜色
thickness: 1.rpx, // 线的粗细
height: 20, // 垂直方向的占位高度
indent: 16, // 左边缩进
endIndent: 16, // 右边缩进
),
),
),
),
Text(
"其他登录方式".tr,
style: TextStyle(
color: Colors.white,
fontSize: AppConstants()
.normal_text_fontSize,
),
),
SizedBox(height: 30.rpx),
ClickableContainer(
backgroundColor: Colors.white, // 背景色
highlightColor:
Colors.grey, // 点击水波纹颜色
borderRadius: 999.rpx,
padding: EdgeInsets.zero,
onTap: () async {
if (mhtRegisterController
.model.register_agree !=
true) {
TopSlideNotification.show(
context,
text: "需要同意协议".tr,
textColor: themeController
.currentColor.sc9,
);
return;
}
final loginController =
Get.find<MHTLoginController>();
await loginController
.wxLoginSendAuth();
},
child: Container(
width: 90.rpx,
height: 90.rpx,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
'assets/images/wechat.png'),
fit: BoxFit.fill,
),
),
),
),
],
);
})
],
),
),