Commit 704e39167e923035633a2b3d2d569c945a61d167

Authored by 常守达
1 parent 06be138c

fix(today):埋点及UI修改

... ... @@ -122,7 +122,7 @@ class HomeController extends GetxController {
}
switch (index) {
case 0:
// ta.track('enter_doublefeel_my_page');
Get.find<TodayController>().refreshTab();
break;
case 3:
ta.track('enter_doublefeel_my_page');
... ...
... ... @@ -96,6 +96,7 @@ class TodayController extends GetMaterialController {
final isLoadingToday = false.obs;
final showHealthDataAuthCardStatus = 1.obs;
final stressSubtitle = ''.obs;
bool _isFirstLoad = true;
// ── HRV 表盘引导 Banner ───────────────────
final showHrvAdBanner = false.obs;
... ... @@ -253,6 +254,7 @@ class TodayController extends GetMaterialController {
if (selectedDate.value == date) {
isLoadingToday.value = false;
}
_isFirstLoad = false;
}
}
... ... @@ -659,6 +661,10 @@ class TodayController extends GetMaterialController {
}
Future<void> refreshTab() async {
if (_isFirstLoad) {
_isFirstLoad = false;
return;
}
checkAddFriendVisible();
checkHrvAdBannerVisible();
checkHealthDataAuthCardVisible();
... ...
... ... @@ -871,6 +871,7 @@ class _StressBarChartState extends State<_StressBarChart> {
children: [
Container(
margin: const EdgeInsets.only(top: gridTop),
padding: EdgeInsets.only(right: 3),
child: BarChart(
BarChartData(
minY: 0,
... ... @@ -1014,7 +1015,7 @@ class _StressBarChartState extends State<_StressBarChart> {
...sleepWidgets,
// 手绘 100、50、0 标签在对应的横线上方
Positioned(
right: 0,
right: -5,
top: gridTop - 12,
child: Text(
'100',
... ... @@ -1023,7 +1024,7 @@ class _StressBarChartState extends State<_StressBarChart> {
),
),
Positioned(
right: 0,
right: -6,
top: gridTop + gridHeight * 0.5 - 12,
child: Text(
'50',
... ... @@ -1032,7 +1033,7 @@ class _StressBarChartState extends State<_StressBarChart> {
),
),
Positioned(
right: 0,
right: -1,
top: gridBottom - 12,
child: Text(
'0',
... ...
... ... @@ -416,7 +416,7 @@ class _TodaySummaryCard extends StatelessWidget {
style: TextStyle(
color: colors.textPrimary,
fontSize: 14,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
),
),
const Spacer(),
... ... @@ -482,7 +482,7 @@ class _MetricBlock extends StatelessWidget {
style: TextStyle(
color: labelColor,
fontSize: 12,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 5),
... ...
... ... @@ -252,7 +252,6 @@ class LoginController extends GetxController {
String accessToken = loginData.accessToken;
if (isRegister) {
ta.track('success_regist');
final regRes = await _userApi.register(isApple
? {
'login_type': 'apple',
... ... @@ -325,6 +324,9 @@ class LoginController extends GetxController {
}
await _userStateService.onLogin();
if (isRegister) {
ta.track('success_regist');
}
// 用户登录成功即代表同意了协议,持久化到本地供冷启动时 SDK 初始化判断使用
await Get.find<LocalStorage>().setTermsAgreed(true);
... ...
... ... @@ -70,6 +70,7 @@ class MembershipOfferController extends GetxController {
AppleProductPaymentResult? result,
) async {
if (result?.success == true) {
_trackSuccessPayOrder();
await _completeSuccessfulPurchase();
return;
}
... ... @@ -81,6 +82,22 @@ class MembershipOfferController extends GetxController {
}
}
void _trackSuccessPayOrder() {
final trackMap = <String, dynamic>{};
if (Get.arguments?['from'] == 'onboarding') {
trackMap['channel_type'] = '新手引导';
} else {
trackMap['channel_type'] = Get.arguments?['channel_type'] ?? '';
}
trackMap['product_type'] = yearlyProduct.value?.appleId;
trackMap['price'] = yearlyProduct.value?.price;
ta.track(
'success_doublefeel_pay_order',
properties: trackMap,
);
}
String _applePaymentFailureMessage(AppleProductPaymentResult result) {
final errorCode = result.errorCode;
if (errorCode != null) {
... ...
... ... @@ -176,9 +176,9 @@ class V2HealthData {
sleepStateColor(BuildContext context) {
switch (sleepState) {
case 1:
return context.colors.chartBlue;
case 2:
return context.colors.chartGreen;
case 2:
return context.colors.chartBlue;
case 3:
return context.colors.chartOrange;
}
... ...