123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- //
- // KWSearchViewModel.m
- // westkissMob
- //
- // Created by iOS on 2022/9/20.
- //
- #import "KWSearchViewModel.h"
- #import "KWSearchSubTypeModel.h"
- @implementation KWSearchViewModel
- - (void)switchCurrencie:(KWSubTypeSectionModel *)m callback:(void(^)(BOOL flag))success {
- // NSMutableDictionary *paraDic = [NSMutableDictionary dictionary];
- // paraDic[@"currency"] = m.Id;
- //// @weakify(self);
- // [PPNetworkHelper POST:SwitchCurrencies parameters:paraDic success:^(id responseObject) {
- // if (RequestSuccess) {
- // NSLog(@"success:%@",responseObject);
- // [PPNetworkCache removeAllHttpCache];
- success(true);
- // } else {
- // NSLog(@"fail:%@",RequestErrorMsg);
- // success(false);
- // }
- // } failure:^(NSError *error) {
- // NSLog(@"err:%@",error);
- // success(false);
- // }];
-
-
- }
- - (void)reqCurrenciesList:(btnClickBlock)success {
- // NSMutableDictionary *paraDic = [NSMutableDictionary dictionary];
- // @weakify(self);
- // [PPNetworkHelper POST:GetCurrencies parameters:paraDic success:^(id responseObject) {
- // if (RequestSuccess) {
- // NSLog(@"success:%@",responseObject);
- // NSArray *arr = (NSArray *)responseObject[@"data"];
- // NSMutableArray *subArr = [[NSMutableArray alloc] init];
- // for (NSDictionary *dic in arr) {
- // NSString *name = dic[@"name"];
- // NSString *short_name = dic[@"short_name"];
- // NSNumber *status = dic[@"status"];
- //
- // KWSubTypeSectionModel *m = [[KWSubTypeSectionModel alloc] init];
- // m.Id = short_name;
- // m.title = name;
- // m.isOpen = status.boolValue;
- // m.isMoneyType = true;
- // m.children = [[NSMutableArray alloc] init];
- // [subArr addObject:m];
- // }
- //
- // KWMainTypeModel *model = [KWMainTypeModel new];
- // model.title = @"CURRENCY";
- // model.isMoneyType = true;
- // model.children = subArr;
- // weak_self.moneyType = model;
- // success();
- // } else {
- // NSLog(@"fail:%@",RequestErrorMsg);
- // success();
- // }
- // } failure:^(NSError *error) {
- // NSLog(@"err:%@",error);
- success();
- // }];
- }
- - (void)reqProductTypeList: (btnClickBlock)success {
- // NSString *url = SearchType;//[NSString stringWithFormat:@"%@%@",Formal_Server,SearchType];
- // NSMutableDictionary *paraDic = [NSMutableDictionary dictionary];
- // @weakify(self);
- // [PPNetworkHelper POST:url parameters:paraDic responseCache:^(id responseObject) {
- // if (RequestSuccess) {
- // NSLog(@"success:%@",responseObject);
- //
- // NSMutableArray *arr = [KWMainTypeModel mj_objectArrayWithKeyValuesArray:responseObject[@"data"]];
- // weak_self.arr = arr;
- // if (arr.count > 0 ) {
- success();
- // }
- // }
- // } success:^(id responseObject) {
- // if (RequestSuccess) {
- // NSLog(@"success:%@",responseObject);
- //
- // NSArray *arr = [KWMainTypeModel mj_objectArrayWithKeyValuesArray:responseObject[@"data"]];
- // weak_self.arr = arr;
- // success();
- // } else {
- // NSLog(@"fail:%@",RequestErrorMsg);
- // weak_self.arr = @[];
- // success();
- // }
- // } failure:^(NSError *error) {
- // NSLog(@"err:%@",error);
- // weak_self.arr = @[];
- // success();
- // } isSetToken:false];
- }
- @end
|