logo和名称替换
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/config/config.dart';
|
||||
import 'package:hgmj/hj_model/home/plate_model.dart';
|
||||
import 'package:hgmj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:hgmj/hj_utils/free_play_manager.dart';
|
||||
import 'package:hgmj/tools_base/global_store/store.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/config/config.dart';
|
||||
import 'package:wydj/hj_model/home/plate_model.dart';
|
||||
import 'package:wydj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
import 'package:wydj/hj_utils/free_play_manager.dart';
|
||||
import 'package:wydj/tools_base/global_store/store.dart';
|
||||
|
||||
import '../../tools_base/event_bus/event_bus_util.dart';
|
||||
import '../../tools_base/event_bus/events.dart';
|
||||
@@ -66,7 +66,9 @@ class MainPageLogic extends GetxController {
|
||||
),
|
||||
if (Config.darkWebEnable)
|
||||
MainTabModel(
|
||||
title: Config.darkWebIconName?.isNotEmpty == true ? Config.darkWebIconName! : '暗网',
|
||||
title: Config.darkWebIconName?.isNotEmpty == true
|
||||
? Config.darkWebIconName!
|
||||
: '暗网',
|
||||
imageNor: 'home_2_0.png'.homePath,
|
||||
imageSel: 'home_2_1.png'.homePath,
|
||||
),
|
||||
@@ -125,7 +127,8 @@ class MainPageLogic extends GetxController {
|
||||
final app = Config.plateModule;
|
||||
if (app == null) return;
|
||||
void put(List<ModuleData> modules, int tab, int sub) {
|
||||
modules.asMap().forEach((i, e) => moduleMap[e.id ?? ''] = ModuleModel(tab: tab, sub: sub, module: i));
|
||||
modules.asMap().forEach((i, e) =>
|
||||
moduleMap[e.id ?? ''] = ModuleModel(tab: tab, sub: sub, module: i));
|
||||
}
|
||||
|
||||
put(app.homePage, 0, 0);
|
||||
@@ -142,7 +145,8 @@ class MainPageLogic extends GetxController {
|
||||
_backToRoot();
|
||||
jumpToPage(0);
|
||||
globalStore.refreshWallet();
|
||||
MineMsgProvider().loadData(); //内含 refreshPayPopup:重拉支付分层配置,即时刷新浮窗/我的横幅/播放器横幅
|
||||
MineMsgProvider()
|
||||
.loadData(); //内含 refreshPayPopup:重拉支付分层配置,即时刷新浮窗/我的横幅/播放器横幅
|
||||
unawaited(FreePlayManager().refresh()); //切号:免费观看次数是账户维度的,不重拉会一直用着上个账号的次数
|
||||
HomeUpdateMarkerProvider().loadData();
|
||||
presaleProvider.refreshStatus(); //刷新预售权益
|
||||
@@ -172,7 +176,9 @@ class MainPageLogic extends GetxController {
|
||||
|
||||
//首页/暗网共用 HomeMainLogic,靠 tag 区分;页面还没建时返回 null
|
||||
HomeMainLogic? _homeLogic([String tag = 'HomeMainLogic']) =>
|
||||
Get.isRegistered<HomeMainLogic>(tag: tag) ? Get.find<HomeMainLogic>(tag: tag) : null;
|
||||
Get.isRegistered<HomeMainLogic>(tag: tag)
|
||||
? Get.find<HomeMainLogic>(tag: tag)
|
||||
: null;
|
||||
|
||||
void _openNavBar() {
|
||||
_backToRoot();
|
||||
@@ -226,9 +232,15 @@ class MainPageLogic extends GetxController {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
final tag = ["", MediaStyle.Pic.name, MediaStyle.Game.name, MediaStyle.Novel.name][module.sub];
|
||||
final tag = [
|
||||
"",
|
||||
MediaStyle.Pic.name,
|
||||
MediaStyle.Game.name,
|
||||
MediaStyle.Novel.name
|
||||
][module.sub];
|
||||
if (Get.isRegistered<CartoonSubModuleLogic>(tag: tag)) {
|
||||
Get.find<CartoonSubModuleLogic>(tag: tag).skipToTabIndex(module.module);
|
||||
Get.find<CartoonSubModuleLogic>(tag: tag)
|
||||
.skipToTabIndex(module.module);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -238,7 +250,8 @@ class MainPageLogic extends GetxController {
|
||||
}
|
||||
|
||||
//返回首页
|
||||
void _backToRoot() => Get.until((route) => route.settings.name == MainPage.routeName);
|
||||
void _backToRoot() =>
|
||||
Get.until((route) => route.settings.name == MainPage.routeName);
|
||||
|
||||
/// 切 tab:内容页和底栏选中态都监听 curPageIndex,改它一处即可
|
||||
void jumpToPage(int index) {
|
||||
@@ -250,7 +263,8 @@ class MainPageLogic extends GetxController {
|
||||
bool confirmExit() {
|
||||
final now = DateTime.now();
|
||||
// 物理键,两次间隔大于 2 秒,退出请求无效
|
||||
if (_lastBackAt == null || now.difference(_lastBackAt!) > const Duration(seconds: 2)) {
|
||||
if (_lastBackAt == null ||
|
||||
now.difference(_lastBackAt!) > const Duration(seconds: 2)) {
|
||||
_lastBackAt = now;
|
||||
showToast('再次返回即可退出');
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user