Commit bc0a8738b04b9e1f3d52dea1040010407636e2a2

Authored by 常守达
1 parent d6997fb0

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

@@ -196,6 +196,16 @@ class LoginController extends GetxController { @@ -196,6 +196,16 @@ class LoginController extends GetxController {
196 Future<void> selectServiceRegion(AppRegion region) async { 196 Future<void> selectServiceRegion(AppRegion region) async {
197 if (environmentConfig.region.value == region) return; 197 if (environmentConfig.region.value == region) return;
198 await environmentConfig.setRegion(region); 198 await environmentConfig.setRegion(region);
  199 + if (environmentConfig.region.value == AppRegion.china) {
  200 + if (termsChecked.value) toggleTermsChecked();
  201 + } else {
  202 + if (!termsChecked.value) toggleTermsChecked();
  203 + }
  204 + ta.setSuperProperties({
  205 + 'app_region': environmentConfig.region.value == AppRegion.china
  206 + ? 'mainland'
  207 + : 'overseas'
  208 + });
199 } 209 }
200 210
201 void openUserTerms() { 211 void openUserTerms() {
@@ -678,22 +678,25 @@ class _AgreementText extends GetView<LoginController> { @@ -678,22 +678,25 @@ class _AgreementText extends GetView<LoginController> {
678 TextSpan( 678 TextSpan(
679 style: baseStyle, 679 style: baseStyle,
680 children: [ 680 children: [
681 - if (controller.environmentConfig.region.value == AppRegion.china)  
682 - WidgetSpan(  
683 - alignment: PlaceholderAlignment.middle,  
684 - child: Obx(() {  
685 - final isChecked = controller.termsChecked.value;  
686 - return Icon(  
687 - isChecked  
688 - ? Icons.check_circle_rounded  
689 - : Icons.radio_button_unchecked_rounded,  
690 - color: isChecked  
691 - ? context.colors.primary  
692 - : context.colors.textSecondary,  
693 - size: 18,  
694 - );  
695 - }),  
696 - ), 681 + WidgetSpan(
  682 + alignment: PlaceholderAlignment.middle,
  683 + child: Obx(() {
  684 + if (controller.environmentConfig.region.value ==
  685 + AppRegion.global) {
  686 + return const SizedBox.shrink();
  687 + }
  688 + final isChecked = controller.termsChecked.value;
  689 + return Icon(
  690 + isChecked
  691 + ? Icons.check_circle_rounded
  692 + : Icons.radio_button_unchecked_rounded,
  693 + color: isChecked
  694 + ? context.colors.primary
  695 + : context.colors.textSecondary,
  696 + size: 18,
  697 + );
  698 + }),
  699 + ),
697 const WidgetSpan( 700 const WidgetSpan(
698 child: SizedBox(width: 8), 701 child: SizedBox(width: 8),
699 ), 702 ),
@@ -25,6 +25,10 @@ class ThinkingDataService { @@ -25,6 +25,10 @@ class ThinkingDataService {
25 if (_environment.isDebug) { 25 if (_environment.isDebug) {
26 TDAnalytics.enableLog(true); 26 TDAnalytics.enableLog(true);
27 } 27 }
  28 + setSuperProperties({
  29 + 'app_region':
  30 + _environment.region.value == AppRegion.china ? 'mainland' : 'overseas'
  31 + });
28 } 32 }
29 33
30 void login(String userId) { 34 void login(String userId) {