Browse Source

fix:购物车规格

“wangdongchao” 1 year ago
parent
commit
0a91e5ea93
1 changed files with 16 additions and 1 deletions
  1. 16 1
      Asteria/Fuction/Cart/Cell/MyCartItemCell.m

+ 16 - 1
Asteria/Fuction/Cart/Cell/MyCartItemCell.m

@@ -125,7 +125,22 @@
     NSString *imgStr =  [NSString stringWithFormat:@"https:%@%@%@",HostPath,ProductImgPath,itemM.image];
     [self.leftImg sd_setImageWithURL:[NSURL URLWithString:imgStr] placeholderImage:UIImageDefaultImg_SD];
     self.nameLab.text = itemM.name;
-    self.optionsLab.text = itemM.options;
+    
+    
+    NSArray *array = [Current_normalTool arrFromjsonStr:itemM.options];
+    
+    NSString *optionStr = @"";
+    for (int i = 0; i < array.count; i++) {
+        NSDictionary *dic = [array objectAtIndex:i];
+        optionStr = [NSString stringWithFormat:@"%@%@:%@", optionStr, dic[@"label"], dic[@"value"]];
+        
+        if (i < array.count - 1) {
+            optionStr = [NSString stringWithFormat:@"%@\n", optionStr];
+        }
+    }
+    self.optionsLab.text = optionStr;
+    
+    
     self.priceLab.attributedText = [MyCartItemCell tool_changePriceAtr:itemM];
     
     self.closeBtn.hidden = itemM.isGift;