Commit 5b9b3e13 by lee

修正bug,新添加的商品购物车点编辑会闪退,自动设置送货方式,图片url修改

parent 206e71f1
...@@ -220,10 +220,14 @@ ...@@ -220,10 +220,14 @@
[[KWMShoppingCart sharedInstance] increaseProductWithVariantId:identifier quantity:quantity callback:^(NSError *error, KWMCartResult *cart) { [[KWMShoppingCart sharedInstance] increaseProductWithVariantId:identifier quantity:quantity callback:^(NSError *error, KWMCartResult *cart) {
if (cart.items.firstObject && !cart.items.firstObject.product_id) { if (cart.items.firstObject && !cart.items.firstObject.product_id) {
KWMShopCartModel *model = cart.items.firstObject; KWMShopCartModel *model = cart.items.firstObject;
model.imageStr = [KWMImageUtil getProductImageUrl:this.product.identifier ImageSize:NormalImage]; BUYImageLink *il = this.product.images.firstObject;
// model.imageStr = [KWMImageUtil getProductImageUrl:this.product.identifier ImageSize:NormalImage];
model.imageStr = [KWMImageUtil getProductImageUrlByOriginalUrl:il.sourceURL.absoluteString ImageSize:NormalImage];
model.name = this.product.title; model.name = this.product.title;
model.brand = this.product.vendor;
model.size = variant.title; model.size = variant.title;
model.price = variant.price.floatValue; model.price = variant.price.floatValue;
model.product_id = this.product.identifier;
} }
if (!error) { if (!error) {
[this showToast:@"添加成功"]; [this showToast:@"添加成功"];
......
...@@ -455,7 +455,7 @@ ...@@ -455,7 +455,7 @@
this.checkout = checkout; this.checkout = checkout;
[this initData]; [this initData];
[this.userDao saveCheckoutCache:responseObject[@"checkout"]]; [this.userDao saveCheckoutCache:responseObject[@"checkout"]];
if(!this.checkout.shippingAddress) { if(!this.checkout.shippingRate) {
[this requestShippingData]; [this requestShippingData];
} }
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment