mod: 优化未登录时用户跳转
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/http/user.dart';
|
||||
@ -111,4 +112,20 @@ class MineController extends GetxController {
|
||||
}
|
||||
Get.forceAppUpdate();
|
||||
}
|
||||
|
||||
pushFollow() {
|
||||
if (!userLogin.value) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
Get.toNamed('/follow?mid=${userInfo.value.mid}');
|
||||
}
|
||||
|
||||
pushFans() {
|
||||
if (!userLogin.value) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
Get.toNamed('/fan?mid=${userInfo.value.mid}');
|
||||
}
|
||||
}
|
||||
|
||||
@ -264,8 +264,7 @@ class _MinePageState extends State<MinePage> {
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => Get.toNamed(
|
||||
'/follow?mid=${_mineController.userInfo.value.mid}'),
|
||||
onTap: () => _mineController.pushFollow(),
|
||||
borderRadius: StyleString.mdRadius,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -295,8 +294,7 @@ class _MinePageState extends State<MinePage> {
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => Get.toNamed(
|
||||
'/fan?mid=${_mineController.userInfo.value.mid}'),
|
||||
onTap: () => _mineController.pushFollow(),
|
||||
borderRadius: StyleString.mdRadius,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
||||
Reference in New Issue
Block a user