协议修改
This commit is contained in:
@@ -29,14 +29,6 @@ class HomeController extends GetxController with BaseControllerMixin {
|
|||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|
||||||
// 检查是否同意过隐私政策,只有同意后才初始化推送
|
|
||||||
if (StorageService.to.isPrivacyAgreed) {
|
|
||||||
requestPermission();
|
|
||||||
initAliyunPush();
|
|
||||||
addPushCallback();
|
|
||||||
}
|
|
||||||
|
|
||||||
FlutterNativeSplash.remove();
|
FlutterNativeSplash.remove();
|
||||||
log('page-init');
|
log('page-init');
|
||||||
|
|
||||||
@@ -159,6 +151,13 @@ class HomeController extends GetxController with BaseControllerMixin {
|
|||||||
// 根据登录状态和登录渠道返回不同的首页
|
// 根据登录状态和登录渠道返回不同的首页
|
||||||
Widget getHomePage() {
|
Widget getHomePage() {
|
||||||
if (StorageService.to.isLoggedIn) {
|
if (StorageService.to.isLoggedIn) {
|
||||||
|
// 检查是否同意过隐私政策,只有同意后才初始化推送
|
||||||
|
if (StorageService.to.isPrivacyAgreed) {
|
||||||
|
requestPermission();
|
||||||
|
initAliyunPush();
|
||||||
|
addPushCallback();
|
||||||
|
}
|
||||||
|
|
||||||
if (StorageService.to.loginChannel == LoginChannel.station) {
|
if (StorageService.to.loginChannel == LoginChannel.station) {
|
||||||
return B_BaseWidgetsPage();
|
return B_BaseWidgetsPage();
|
||||||
} else if (StorageService.to.loginChannel == LoginChannel.driver) {
|
} else if (StorageService.to.loginChannel == LoginChannel.driver) {
|
||||||
|
|||||||
@@ -140,9 +140,29 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
|
|||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
// 根据 Tab 显示不同的输入框
|
// 根据 Tab 显示不同的输入框
|
||||||
_tabController.index == 0
|
!_isAgreed
|
||||||
|
? GestureDetector(
|
||||||
|
onTap: () => _handleLogin(controller),
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 55.h,
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 24,
|
||||||
|
),
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Text(
|
||||||
|
"请先阅读并同意用户协议和隐私政策",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey,
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: (_tabController.index == 0
|
||||||
? _buildDriverInputFields(controller)
|
? _buildDriverInputFields(controller)
|
||||||
: _buildStationInputFields(controller),
|
: _buildStationInputFields(controller)),
|
||||||
|
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
// 统一登录按钮
|
// 统一登录按钮
|
||||||
@@ -151,7 +171,7 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
|
|||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
buildAgreement(),
|
buildAgreement(),
|
||||||
const SizedBox(height: 80),
|
const SizedBox(height: 80),
|
||||||
_buildFooterSlogan()
|
_buildFooterSlogan(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -475,7 +495,6 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_processLoginResponse(responseData, "station", account);
|
_processLoginResponse(responseData, "station", account);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
dismissLoading();
|
dismissLoading();
|
||||||
@@ -539,7 +558,6 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
|
|||||||
Logger.d("暂时不处理 查询车辆信息失败的情况");
|
Logger.d("暂时不处理 查询车辆信息失败的情况");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dismissLoading();
|
dismissLoading();
|
||||||
Get.offAll(() => BaseWidgetsPage());
|
Get.offAll(() => BaseWidgetsPage());
|
||||||
} else {
|
} else {
|
||||||
@@ -596,9 +614,7 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 添加推送回调
|
// 添加推送回调
|
||||||
_aliyunPush.addMessageReceiver(
|
_aliyunPush.addMessageReceiver(onNotificationOpened: _onNotificationOpened);
|
||||||
onNotificationOpened: _onNotificationOpened,
|
|
||||||
);
|
|
||||||
|
|
||||||
isPushInitialized = true;
|
isPushInitialized = true;
|
||||||
Logger.d('推送服务初始化成功');
|
Logger.d('推送服务初始化成功');
|
||||||
|
|||||||
Reference in New Issue
Block a user