import 'package:account_center/api/base_model.dart';
import 'package:account_center/common/sp/sp_util.dart';
import 'package:account_center/common/utils/format.dart';
import 'package:account_center/routes/route_config.dart';
import 'package:get/get.dart';

class ChangePhoneConfirmLogic extends GetxController {
  String phone = '';
  List<dynamic> products = [];
  @override
  void onInit() {
    phone = Get.arguments['phone'];
    fetchList(Method.get, url: HttpApi.listUserProductsAll, queryParameters: {
      'userNo': getUserNo(),
    }, onSuccess: (response) {
      products = response;
      update();
    });
    super.onInit();
  }

  String getShowPhone() {
    return Format.getEllipsisPhone(phone);
  }

  void changePhone() {
    Get.offNamed(RouteConfig.changePhone, arguments: {'phone': phone});
    // Get.to(ChangePhoneSuccess());
  }
}
