fix:修复 sky 布局不显示客服按钮
This commit is contained in:
parent
c0faa26c44
commit
f2e439b3be
@ -36,11 +36,11 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
haveBack: false,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
actionsList: [
|
||||
IconButton(
|
||||
const IconButton(
|
||||
onPressed: CustomerTool.openCustomerService,
|
||||
icon: Icon(
|
||||
Icons.support_agent,
|
||||
color: AppColors.mainColor,
|
||||
color: Colors.white,
|
||||
)),
|
||||
TextButton(
|
||||
child: Text(
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_page.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_xhj_page.dart';
|
||||
import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart';
|
||||
import 'package:star_lock/mine/about/debug/debug_tool.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../main/lockMian/lockMain/lockMain_page.dart';
|
||||
@ -41,6 +44,7 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
} else if (snapshot.hasData) {
|
||||
if (snapshot.data!) {
|
||||
// 如果用户已登录,返回主页面
|
||||
getAppInfo();
|
||||
return F.sw(
|
||||
skyCall: () => StarLockMainPage(),
|
||||
xhjCall: () => const StarLockMainXHJPage());
|
||||
@ -76,4 +80,9 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
AppFirstEnterHandle().getAppFirstEnter(isShowUpdateVersion);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> getAppInfo() async {
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,41 +16,38 @@ import 'package:star_lock/tools/storage.dart';
|
||||
import '../versionUndate/versionUndateTool.dart';
|
||||
|
||||
class AppFirstEnterHandle {
|
||||
Future getAppFirstEnter(String flagStr) async {
|
||||
var getFlag = await Storage.getString(flagStr);
|
||||
Future<void> getAppFirstEnter(String flagStr) async {
|
||||
final dynamic getFlag = await Storage.getString(flagStr);
|
||||
switch (flagStr) {
|
||||
case isAgreePrivacy: // 隐私协议
|
||||
{
|
||||
if (getFlag != isAgreePrivacy) {
|
||||
showPrivacyAgreementAlert();
|
||||
}
|
||||
if (getFlag != isAgreePrivacy) {
|
||||
await showPrivacyAgreementAlert();
|
||||
}
|
||||
getAppInfo();
|
||||
break;
|
||||
case isAgreePosition: // 位置权限
|
||||
{
|
||||
if (getFlag != isAgreePosition) showPositionAlert();
|
||||
if (getFlag != isAgreePosition) {
|
||||
showPositionAlert();
|
||||
}
|
||||
break;
|
||||
case isAgreeCamera: // 相机权限
|
||||
{
|
||||
if (getFlag != isAgreeCamera) showCameraAlert();
|
||||
if (getFlag != isAgreeCamera) {
|
||||
showCameraAlert();
|
||||
}
|
||||
break;
|
||||
case isShowUpdateVersion: // 版本更新
|
||||
{
|
||||
if (getFlag != isShowUpdateVersion) VersionUndateTool();
|
||||
if (getFlag != isShowUpdateVersion) {
|
||||
VersionUndateTool();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl?? '');
|
||||
}
|
||||
|
||||
//隐私协议弹窗
|
||||
void showPrivacyAgreementAlert() {
|
||||
showCupertinoDialog(
|
||||
Future<void> showPrivacyAgreementAlert() async {
|
||||
await showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return PopScope(
|
||||
@ -62,6 +59,11 @@ class AppFirstEnterHandle {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getAppInfo() async {
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
}
|
||||
|
||||
//默认布局
|
||||
Widget _defaultPrivacyAgreementAlert(BuildContext context) {
|
||||
return CupertinoAlertDialog(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user