删除埋点,im和客服
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:analytics_sdk/analytics_sdk.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:jydj/assets_tool/images.dart';
|
||||
import 'package:jydj/config/config.dart';
|
||||
import 'package:jydj/hj_model/home/plate_model.dart';
|
||||
import 'package:jydj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:jydj/hj_utils/const.dart';
|
||||
import 'package:jydj/hj_utils/free_play_manager.dart';
|
||||
import 'package:jydj/im_manager/im_manager.dart';
|
||||
import 'package:jydj/tools_base/global_store/store.dart';
|
||||
|
||||
import '../../hj_utils/holiday_theme.dart';
|
||||
import '../../tools_base/event_bus/event_bus_util.dart';
|
||||
import '../../tools_base/event_bus/events.dart';
|
||||
import '../../tools_base/toast.dart';
|
||||
@@ -46,13 +44,11 @@ class MainTabModel {
|
||||
final String title; //title
|
||||
final String imageNor; //nor图片
|
||||
final String imageSel; //选中图片
|
||||
final String trackKey; //导航埋点key
|
||||
|
||||
MainTabModel({
|
||||
required this.title,
|
||||
required this.imageNor,
|
||||
required this.imageSel,
|
||||
required this.trackKey,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -60,40 +56,34 @@ class MainPageLogic extends GetxController {
|
||||
final tabs = <MainTabModel>[
|
||||
MainTabModel(
|
||||
title: '首页',
|
||||
imageNor: HolidayTheme.theme.homeNor,
|
||||
imageSel: HolidayTheme.theme.homeSel,
|
||||
trackKey: 'Home',
|
||||
imageNor: 'home_0_0.png'.homePath,
|
||||
imageSel: 'home_0_1.png'.homePath,
|
||||
),
|
||||
MainTabModel(
|
||||
title: '短剧',
|
||||
imageNor: HolidayTheme.theme.shortNor,
|
||||
imageSel: HolidayTheme.theme.shortSel,
|
||||
trackKey: 'ShortVideo',
|
||||
imageNor: 'home_1_0.png'.homePath,
|
||||
imageSel: 'home_1_1.png'.homePath,
|
||||
),
|
||||
if (Config.darkWebEnable)
|
||||
MainTabModel(
|
||||
title: Config.darkWebIconName?.isNotEmpty == true ? Config.darkWebIconName! : '暗网',
|
||||
imageNor: HolidayTheme.theme.darkNor,
|
||||
imageSel: HolidayTheme.theme.darkSel,
|
||||
trackKey: 'DarkWeb',
|
||||
imageNor: 'home_2_0.png'.homePath,
|
||||
imageSel: 'home_2_1.png'.homePath,
|
||||
),
|
||||
MainTabModel(
|
||||
title: 'AI',
|
||||
imageNor: HolidayTheme.theme.aiNor,
|
||||
imageSel: HolidayTheme.theme.aiSel,
|
||||
trackKey: 'AI',
|
||||
imageNor: 'home_3_0.png'.homePath,
|
||||
imageSel: 'home_3_1.png'.homePath,
|
||||
),
|
||||
MainTabModel(
|
||||
title: '社区',
|
||||
imageNor: HolidayTheme.theme.communityNor,
|
||||
imageSel: HolidayTheme.theme.communitySel,
|
||||
trackKey: 'Community',
|
||||
imageNor: 'home_4_0.png'.homePath,
|
||||
imageSel: 'home_4_1.png'.homePath,
|
||||
),
|
||||
MainTabModel(
|
||||
title: '我的',
|
||||
imageNor: HolidayTheme.theme.mineNor,
|
||||
imageSel: HolidayTheme.theme.mineSel,
|
||||
trackKey: 'Mine',
|
||||
imageNor: 'home_5_0.png'.homePath,
|
||||
imageSel: 'home_5_1.png'.homePath,
|
||||
),
|
||||
];
|
||||
|
||||
@@ -152,7 +142,6 @@ class MainPageLogic extends GetxController {
|
||||
_backToRoot();
|
||||
jumpToPage(0);
|
||||
globalStore.refreshWallet();
|
||||
unawaited(ImManager().reloginOnAccountSwitch()); //切换账号:登出旧 IM 并用新账号重连,避免私信列表残留旧数据
|
||||
MineMsgProvider().loadData(); //内含 refreshPayPopup:重拉支付分层配置,即时刷新浮窗/我的横幅/播放器横幅
|
||||
unawaited(FreePlayManager().refresh()); //切号:免费观看次数是账户维度的,不重拉会一直用着上个账号的次数
|
||||
HomeUpdateMarkerProvider().loadData();
|
||||
@@ -275,7 +264,6 @@ class MainPageLogic extends GetxController {
|
||||
void onClose() {
|
||||
_yinseSub.cancel();
|
||||
_loginSub.cancel();
|
||||
unawaited(AnalyticsSdk.instance.dispose());
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import 'package:analytics_sdk/analytics_sdk.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:jydj/assets_tool/images.dart';
|
||||
import 'package:jydj/hj_page/main_page/provider/bottom_bar_provider.dart';
|
||||
import 'package:jydj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:jydj/hj_utils/holiday_theme.dart';
|
||||
import 'package:jydj/hj_utils/screen.dart';
|
||||
import 'package:jydj/im_manager/im_notification.dart';
|
||||
import 'package:jydj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -42,11 +39,6 @@ class MainPageTabbar extends StatelessWidget {
|
||||
if (index == logic.tabs.length - 1 && Get.isRegistered<MineMainLogic>()) {
|
||||
Get.find<MineMainLogic>().onRefresh();
|
||||
}
|
||||
// 用户点击底部 Tab 时调用,应早于页面切换完成
|
||||
AnalyticsSdk.instance.trackNavigation(
|
||||
pageKey: logic.tabs[index].trackKey, // 'Home'
|
||||
pageName: logic.tabs[index].title, // '主页'
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -96,7 +88,7 @@ class MainPageTabbar extends StatelessWidget {
|
||||
});
|
||||
}
|
||||
|
||||
/// 普通 tab;最后一个(我的)带私信未读小红点
|
||||
/// 普通 tab
|
||||
Widget _normalItem(int index, int cur) {
|
||||
final isSelected = index == cur;
|
||||
final imagePath = _iconPath(index, isSelected);
|
||||
@@ -104,32 +96,10 @@ class MainPageTabbar extends StatelessWidget {
|
||||
child: InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => _selectIndex(index),
|
||||
child: Stack(
|
||||
children: [
|
||||
_tabContent(
|
||||
isSelected: isSelected,
|
||||
text: logic.tabs[index].title,
|
||||
icon: Image.asset(imagePath, key: ValueKey(imagePath), width: 24),
|
||||
),
|
||||
if (index == logic.tabs.length - 1)
|
||||
Consumer<ImMsgProvider>(
|
||||
builder: (_, imPro, __) {
|
||||
if (!imPro.hasUnreadCount) return const SizedBox.shrink();
|
||||
return Positioned(
|
||||
right: 22,
|
||||
top: 24,
|
||||
child: Container(
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xfff74f49),
|
||||
borderRadius: BorderRadius.all(Radius.circular(6)),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
child: _tabContent(
|
||||
isSelected: isSelected,
|
||||
text: logic.tabs[index].title,
|
||||
icon: Image.asset(imagePath, key: ValueKey(imagePath), width: 24),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -153,7 +123,7 @@ class MainPageTabbar extends StatelessWidget {
|
||||
AnimatedDefaultTextStyle(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
style: TextStyle(
|
||||
color: isSelected ? HolidayTheme.theme.tabSelColor : HolidayTheme.theme.tabNorColor,
|
||||
color: isSelected ? const Color(0xffFFC000) : const Color(0x59FFFFFF),
|
||||
fontSize: 10,
|
||||
),
|
||||
child: Text(text),
|
||||
|
||||
Reference in New Issue
Block a user