12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- //
- // YMWithdrawalAccountListCellViewModel.m
- // MSYOUPAI
- //
- // Created by YoMi on 2024/3/6.
- // Copyright © 2024 MS. All rights reserved.
- //
- #import "YMWithdrawalAccountListCellViewModel.h"
- #import "YMWithdrawalAccountModel.h"
- @interface YMWithdrawalAccountListCellViewModel ()
- /// 提现账号Id
- @property (nonatomic, assign, readwrite) NSInteger withdrawalAccountId;
- /// 提现账号类型
- @property (nonatomic, assign, readwrite) NSInteger withdrawalAccountType;
- /// 提现账号类型名称
- @property (nonatomic, strong, readwrite) NSString *withdrawalAccountTypeName;
- /// 提现账号持有人
- @property (nonatomic, strong, readwrite) NSString *withdrawalAccountHolder;
- /// 提现账号
- @property (nonatomic, strong, readwrite) NSString *withdrawalAccount;
- /// 是否隐藏编辑按钮
- @property (nonatomic, assign, readwrite) BOOL isHideEditButton;
- @end
- @implementation YMWithdrawalAccountListCellViewModel
- - (void)ym_initialize{
- [super ym_initialize];
- if ([self.params[ParamsModel] isKindOfClass:[YMWithdrawalAccountModel class]]) {
- YMWithdrawalAccountModel *model = self.params[ParamsModel];
-
- self.withdrawalAccountId = model.withdrawal_account_id;
- self.withdrawalAccountType = model.type;
- self.withdrawalAccountTypeName = model.bank;
- self.withdrawalAccountHolder = model.card_name;
- self.withdrawalAccount = model.card_account;
- self.isHideEditButton = model.status == 0 ? NO : YES;
-
- }
- }
- - (void)gotoBindWithdrawalAccount{
- YMBindWithdrawalAccountViewModel *bindWithdrawalAccountVM = [[YMBindWithdrawalAccountViewModel alloc]initWithParams:@{
- ParamsCategoryType:@(YMBindWithdrawalAccountTypeEdit),
- @"withdrawalAccountId":@(self.withdrawalAccountId),
- @"withdrawalAccountType":@(self.withdrawalAccountType),
- @"withdrawalAccountHolder":self.withdrawalAccountHolder,
- @"withdrawalAccount":self.withdrawalAccount,
- }];
- WS(weakSelf)
- bindWithdrawalAccountVM.bindWithdrawalAccountBlock = ^{
- /// 编辑绑定提现账号成功后回调之前的提现接口
- if (weakSelf.refreshWithdrawalAccountListBlock) {
- weakSelf.refreshWithdrawalAccountListBlock();
- }
- };
- [YMRouter openURL:stringFormat(@"%@%@", YM_ROUTER_URL_PREFIX, YM_ROUTER_BIND_WITHDRAWAL_ACCOUNT) withUserInfo:@{
- RouterViewModel:bindWithdrawalAccountVM
- } completion:nil];
- }
- @end
|