|
@@ -215,10 +215,10 @@
|
|
|
|
|
|
|
|
|
}
|
|
|
- [self reqNet_Cart_cartsMineTotals];
|
|
|
+// [self reqNet_Cart_cartsMineTotals];
|
|
|
}
|
|
|
-
|
|
|
- } else if ([mark isEqualToString:Chectout_getShipMethod] || [mark isEqualToString:Chectout_addBillingAddress]) {
|
|
|
+ /// || [mark isEqualToString:Chectout_addBillingAddress]
|
|
|
+ } else if ([mark isEqualToString:Chectout_getShipMethod]) {
|
|
|
|
|
|
if(sucessOrFail){
|
|
|
NSArray *shipMethodArr = (NSArray *)data;
|
|
@@ -262,22 +262,28 @@
|
|
|
}
|
|
|
} else if ([mark isEqualToString:Goods_productGetProductsById]) {
|
|
|
//请求赠品详情
|
|
|
- GoodsInformationM *model = (GoodsInformationM *)[arry firstObject];
|
|
|
+ if(sucessOrFail) {
|
|
|
+ GoodsInformationM *model = (GoodsInformationM *)[arry firstObject];
|
|
|
+
|
|
|
+ NSMutableDictionary *param = [NSMutableDictionary dictionaryWithDictionary:@{@"product_id":model.Id, @"isPromoItems":@"yes"}];
|
|
|
+ if (model.options.count > 0) {
|
|
|
+ NSMutableDictionary *optionDic = [NSMutableDictionary dictionary];
|
|
|
+ for (OptionsModel *optionM in model.options) {
|
|
|
+ OptionsValuesM *valuesM = optionM.values[0];
|
|
|
+ NSString *tempStr =[NSString stringWithFormat:@"options[%@]",optionM.option_id];
|
|
|
+ optionDic[tempStr] =valuesM.option_type_id;
|
|
|
+ }
|
|
|
+ [param addEntriesFromDictionary:optionDic];
|
|
|
+ }
|
|
|
+ [self.addGiftParamArr addObject:param];
|
|
|
+ if (self.giftShowCount < 1 && self.addGiftParamArr.count == 1 && self.addGiftView.hidden) {
|
|
|
+
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
+ self.addGiftView.hidden = NO;
|
|
|
+ [self.addGiftView setGiftData:model.add_gooodsImgUrl];
|
|
|
+ });
|
|
|
|
|
|
- NSMutableDictionary *param = [NSMutableDictionary dictionaryWithDictionary:@{@"product_id":model.Id, @"isPromoItems":@"yes"}];
|
|
|
- if (model.options.count > 0) {
|
|
|
- NSMutableDictionary *optionDic = [NSMutableDictionary dictionary];
|
|
|
- for (OptionsModel *optionM in model.options) {
|
|
|
- OptionsValuesM *valuesM = optionM.values[0];
|
|
|
- NSString *tempStr =[NSString stringWithFormat:@"options[%@]",optionM.option_id];
|
|
|
- optionDic[tempStr] =valuesM.option_type_id;
|
|
|
}
|
|
|
- [param addEntriesFromDictionary:optionDic];
|
|
|
- }
|
|
|
- [self.addGiftParamArr addObject:param];
|
|
|
- if (self.giftShowCount < 2 && self.addGiftParamArr.count == 1 && self.addGiftView.hidden) {
|
|
|
- self.addGiftView.hidden = NO;
|
|
|
- [self.addGiftView setGiftData:model.add_gooodsImgUrl];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -331,7 +337,7 @@
|
|
|
|
|
|
NSDictionary *freeData = (NSDictionary *)[[self.totalsM.extension_attributes objectForKey:@"free_data"] mj_JSONObject];
|
|
|
BOOL is_show = [[freeData objectForKey:@"is_show"] boolValue];
|
|
|
- if (is_show && self.giftShowCount< 2) {//显示存在赠品
|
|
|
+ if (is_show && self.giftShowCount< 1) {//显示存在赠品
|
|
|
NSArray *productArr = [freeData objectForKey:@"products"];
|
|
|
if (productArr.count > 0) { //存在赠品
|
|
|
for (int i = 0; i < productArr.count; i++) {
|
|
@@ -388,7 +394,7 @@
|
|
|
self.addressCellM.addressModel = addressM;
|
|
|
|
|
|
[self requestAddShipAddress];
|
|
|
-// [self requestAddBillingAddress];
|
|
|
+ [self requestAddBillingAddress];
|
|
|
};
|
|
|
[self.navigationController pushViewController:vc animated:true];
|
|
|
}
|
|
@@ -406,7 +412,7 @@
|
|
|
}
|
|
|
//添加账单地址
|
|
|
- (void)requestAddBillingAddress {
|
|
|
- [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
|
|
+// [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
|
|
|
|
|
NSDictionary *addressDic1 = (NSDictionary *)[self.addressCellM.addressModel.region mj_JSONObject];
|
|
|
NSDictionary *addressDic = (NSDictionary *)[self.addressCellM.addressModel mj_JSONObject];
|
|
@@ -508,7 +514,7 @@
|
|
|
NSDictionary *payDic = (NSDictionary *)payData;
|
|
|
if (isSucess == 1) {
|
|
|
|
|
|
- [self.view makeToast:@"支付成功,正在为你下单" duration:0.5 position:CSToastPositionCenter];
|
|
|
+ [self.view makeToast:@"Payment success" duration:0.5 position:CSToastPositionCenter];
|
|
|
K_WEAK_SELF;
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
K_STRONG_SELF;
|
|
@@ -536,8 +542,8 @@
|
|
|
|
|
|
NSString *msg = [NSString stringWithFormat:@"%@", [payDic objectForKey:@"msg"]];
|
|
|
|
|
|
- if ([msg isEqualToString:@"支付异常"] && [payMethod isEqualToString:@"klarna_kco"]) {
|
|
|
- [self.view makeToast:@"支付失败,请重试" duration:0.5 position:CSToastPositionCenter];
|
|
|
+ if ([msg isEqualToString:@"Payment anomaly"] && [payMethod isEqualToString:@"klarna_kco"]) {
|
|
|
+ [self.view makeToast:@"Payment Failed" duration:0.5 position:CSToastPositionCenter];
|
|
|
|
|
|
K_WEAK_SELF;
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
@@ -547,7 +553,7 @@
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- [self.view makeToast:@"支付失败" duration:0.5 position:CSToastPositionCenter];
|
|
|
+ [self.view makeToast:@"Payment Failed" duration:0.5 position:CSToastPositionCenter];
|
|
|
K_WEAK_SELF;
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
K_STRONG_SELF;
|
|
@@ -573,11 +579,8 @@
|
|
|
|
|
|
//请求赠品商品详情
|
|
|
-(void)reqNet_GoodsDetails_productGetProduct:(NSString *)enterId{
|
|
|
- NSMutableDictionary * params = [[NSMutableDictionary alloc] init];
|
|
|
-// [params setObject:@"55475" forKey:@"productId"];
|
|
|
+ NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
|
|
|
[params setObject:enterId forKey:@"productId"];
|
|
|
- [params setObject:ASCurrencyManager.shared.currentCur forKey:@"currencyCode"];
|
|
|
-// [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
|
|
[self.goodsDetailsVM ry_requestGetApi:Goods_productGetProductsById param:params];
|
|
|
}
|
|
|
|