import 'package:account_center/account_center.dart';

import 'join_or_new_enterprise_state.dart';

class JoinOrNewEnterpriseLogic extends GetxController {
  final JoinOrNewEnterpriseState state = JoinOrNewEnterpriseState();

  List list = [
    {
      'title': "创建",
      'title2': '  企业',
      'describe': '创建我的企业',
      'page': RouteConfig.newEnterprisePage
    },
    {
      'title': "加入",
      'title2': '  企业',
      'describe': '申请加入企业',
      'page': RouteConfig.joinEnterpriseCodePage
    },
    {
      'title': '',
      'title2': '创建企业记录',
      'describe': '我创建过的所有企业记录',
      'page': RouteConfig.newEnterpriseRecordPage
    },
    {
      'title': '',
      'title2': '加入企业记录',
      'describe': '我加入过的所有企业记录',
      'page': RouteConfig.joinEnterpriseRecordPage
    },
  ];

  ///为什么两个title 处理字体变色
  String title(int index) => list[index]['title'];

  String title2(int index) => list[index]['title2'];

  String describe(int index) => list[index]['describe'];

  String page(int index) => list[index]['page'];

  int color(int index) {
    switch (index) {
      case 0:
        return 0xff00B444;
      case 1:
        return 0xff1F59EF;
      default:
        return 0xff000000;
    }
  }

  void goToPage(index) {
    if (index == 0) {
      Get.toNamed(page(index), arguments: {
        'basicInfo': {},
        'proxyPersonInfo': {},
        'legalPersonInfo': {}
      });
      return;
    }
    Get.toNamed(page(index));
  }
}
