Commit bc0a8738b04b9e1f3d52dea1040010407636e2a2

Authored by 常守达
1 parent d6997fb0

feat(email): 埋点及协议勾选

... ... @@ -196,6 +196,16 @@ class LoginController extends GetxController {
Future<void> selectServiceRegion(AppRegion region) async {
if (environmentConfig.region.value == region) return;
await environmentConfig.setRegion(region);
if (environmentConfig.region.value == AppRegion.china) {
if (termsChecked.value) toggleTermsChecked();
} else {
if (!termsChecked.value) toggleTermsChecked();
}
ta.setSuperProperties({
'app_region': environmentConfig.region.value == AppRegion.china
? 'mainland'
: 'overseas'
});
}
void openUserTerms() {
... ...
... ... @@ -678,22 +678,25 @@ class _AgreementText extends GetView<LoginController> {
TextSpan(
style: baseStyle,
children: [
if (controller.environmentConfig.region.value == AppRegion.china)
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Obx(() {
final isChecked = controller.termsChecked.value;
return Icon(
isChecked
? Icons.check_circle_rounded
: Icons.radio_button_unchecked_rounded,
color: isChecked
? context.colors.primary
: context.colors.textSecondary,
size: 18,
);
}),
),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Obx(() {
if (controller.environmentConfig.region.value ==
AppRegion.global) {
return const SizedBox.shrink();
}
final isChecked = controller.termsChecked.value;
return Icon(
isChecked
? Icons.check_circle_rounded
: Icons.radio_button_unchecked_rounded,
color: isChecked
? context.colors.primary
: context.colors.textSecondary,
size: 18,
);
}),
),
const WidgetSpan(
child: SizedBox(width: 8),
),
... ...
... ... @@ -25,6 +25,10 @@ class ThinkingDataService {
if (_environment.isDebug) {
TDAnalytics.enableLog(true);
}
setSuperProperties({
'app_region':
_environment.region.value == AppRegion.china ? 'mainland' : 'overseas'
});
}
void login(String userId) {
... ...