完善游客模式登录 并且新增设备管理
This commit is contained in:
@@ -8,6 +8,7 @@ import '../controllers/kr_setting_controller.dart';
|
||||
import '../../../themes/kr_theme_service.dart';
|
||||
import '../../../localization/app_translations.dart';
|
||||
import '../../../routes/app_pages.dart';
|
||||
import '../../../common/app_run_data.dart';
|
||||
|
||||
class KRSettingView extends GetView<KRSettingController> {
|
||||
const KRSettingView({Key? key}) : super(key: key);
|
||||
@@ -235,12 +236,33 @@ class KRSettingView extends GetView<KRSettingController> {
|
||||
onChanged: (value) => controller.kr_helpImprove.value = value,
|
||||
),
|
||||
_kr_buildDivider(),
|
||||
_kr_buildActionTile(
|
||||
context,
|
||||
title: AppTranslations.kr_userInfo.myAccount,
|
||||
trailing: AppTranslations.kr_setting.goToDelete,
|
||||
onTap: controller.kr_deleteAccount,
|
||||
),
|
||||
Obx(() {
|
||||
final appRunData = KRAppRunData.getInstance();
|
||||
final isLoggedIn = appRunData.kr_isLogin.value;
|
||||
final isDeviceLogin = appRunData.isDeviceLogin();
|
||||
|
||||
if (!isLoggedIn) {
|
||||
// 未登录,不显示此项
|
||||
return SizedBox.shrink();
|
||||
} else if (isDeviceLogin) {
|
||||
// 设备登录(游客模式),显示"点击这里登录/注册"
|
||||
return _kr_buildActionTile(
|
||||
context,
|
||||
title: "登录/注册",
|
||||
trailing: "",
|
||||
onTap: () => Get.toNamed(Routes.MR_LOGIN),
|
||||
);
|
||||
} else {
|
||||
// 正常登录,显示用户邮箱
|
||||
final userEmail = appRunData.kr_account.value ?? AppTranslations.kr_userInfo.myAccount;
|
||||
return _kr_buildActionTile(
|
||||
context,
|
||||
title: userEmail,
|
||||
trailing: AppTranslations.kr_setting.goToDelete,
|
||||
onTap: controller.kr_deleteAccount,
|
||||
);
|
||||
}
|
||||
}),
|
||||
_kr_buildDivider(),
|
||||
// _kr_buildTitleTile(
|
||||
// context,
|
||||
@@ -407,7 +429,7 @@ class KRSettingView extends GetView<KRSettingController> {
|
||||
style: KrAppTextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).textTheme.bodyMedium?.color,
|
||||
color: Theme.of(context).textTheme.bodySmall?.color,
|
||||
),
|
||||
),
|
||||
trailing: Text(
|
||||
|
||||
Reference in New Issue
Block a user