Browse Source

金额处理

Chris 6 years ago
parent
commit
162b7b2244
14 changed files with 25 additions and 24 deletions
  1. 1 1
      RainbowPlanet/RainbowPlanet/Macro/Common.swift
  2. 2 2
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/OrderPayAcountView.swift
  3. 2 2
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/ShoppingCartPayOrderItemCell.swift
  4. 1 1
      RainbowPlanet/RainbowPlanet/Modules/ShoppingCartModule/ShoppingCart/View/ShoppingCartAccountView.swift
  5. 1 1
      RainbowPlanet/RainbowPlanet/Modules/ShoppingCartModule/ShoppingCart/View/ShoppingCartList/ShoppingCartListTableViewCell.swift
  6. 1 1
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailSkuView/ProductDetailSkuView.swift
  7. 2 2
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductDetailHotSell/ProductDetailHotSellCollectionViewCell.swift
  8. 2 2
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallBarChart/ProductMallBarChartCollectionViewCell.swift
  9. 2 2
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallRightSideleftPicture/ProductRightSideleftPictureCollectionViewCell.swift
  10. 4 4
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallSlidingLeftRight/ProductSlidingLeftRightCollectionViewCell.swift
  11. 2 2
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductSlidingTopBottom/ProductSlidingTopBottomCollectionViewCell.swift
  12. 2 2
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHBigTableViewCell.swift
  13. 3 2
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHSmallTableViewCell.swift
  14. BIN
      彩虹星球1期遗留问题.xmind

+ 1 - 1
RainbowPlanet/RainbowPlanet/Macro/Common.swift

@@ -176,6 +176,6 @@ func isMobileVerification(mobile:String) -> Bool {
 /// - Parameter price: 价格分
 /// - Returns: string
 func priceConversion(price:Int) -> String {
-    let price = Float(price/100)
+    let price = Float(price)/100    
     return String(format: "¥ %.2f", price)
 }

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/OrderPayAcountView.swift

@@ -16,8 +16,8 @@ class OrderPayAcountView: BaseView {
     var commitOrderBlock : CommitOrderBlock?
     
     var tPrice: Int? {
-        didSet {
-            priceLabel.text = "¥\(tPrice ?? 0)"
+        didSet {            
+            priceLabel.text = priceConversion(price: tPrice ?? 0)
         }
     }
     

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/ShoppingCartPayOrderItemCell.swift

@@ -22,8 +22,8 @@ class ShoppingCartPayOrderItemCell: UITableViewCell {
             sellScaleLabel.text = "规格:\(productMdl?.skuName ?? "")"
             // 数量
             sellNumberLabel.text = "x\(productMdl?.amount ?? 1)"
-            // 价格
-            sellPriceLabel.text = "¥\(productMdl?.skuPrice ?? 0)"
+            // 价格            
+            sellPriceLabel.text = priceConversion(price: productMdl?.skuPrice ?? 0)
         }
     }
     

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingCartModule/ShoppingCart/View/ShoppingCartAccountView.swift

@@ -28,7 +28,7 @@ class ShoppingCartAccountView: BaseView {
     
     var tPrice: Int? {
         didSet {
-            priceLabel.text = "¥\(tPrice ?? 0)"
+            priceLabel.text = priceConversion(price: tPrice ?? 0)
         }
     }
     

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingCartModule/ShoppingCart/View/ShoppingCartList/ShoppingCartListTableViewCell.swift

@@ -47,7 +47,7 @@ class ShoppingCartListTableViewCell: UITableViewCell {
             // 数量
             sellNumberLabel.text = "x\(productMdl?.amount ?? 1)"
             // 价格
-            sellPriceLabel.text = "¥\(productMdl?.skuPrice ?? 0)"
+            sellPriceLabel.text = priceConversion(price: productMdl?.skuPrice ?? 0)
             // 数量
             numberLabel.text = "\(productMdl?.amount ?? 1)"
         }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailSkuView/ProductDetailSkuView.swift

@@ -365,7 +365,7 @@ class ProductDetailSkuView: FWPopupView {
          let  productDetailSkuModel = filter?.currentResult as? ProductDetailSkuModel
         if productDetailSkuModel != nil {
             self.productDetailSkuModel = productDetailSkuModel
-            priceLabel.text = "¥\(productDetailSkuModel!.price ?? 0)"
+            priceLabel.text = priceConversion(price: productDetailSkuModel!.price ?? 0)
             stockLabel.text = "库存\(productDetailSkuModel!.stock ?? 0)件"
             if productDetailSkuModel!.stock ?? 0 > 0 {
                  sureButton.isEnabled = true

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductDetailHotSell/ProductDetailHotSellCollectionViewCell.swift

@@ -152,8 +152,8 @@ class ProductDetailHotSellCollectionViewCell: UICollectionViewCell {
             iconImagView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "pic_preload"), placeholder: kImage(name: "pic_preload"))
             titleLabel.text = productSearchModel?.saleName
             detailTitleLabel.text = productSearchModel?.saleName
-            sellPriceLabel.text = "¥\(productSearchModel?.price ?? 0)"
-            let attributeString = NSMutableAttributedString(string:"¥\(productSearchModel?.originPrice ?? 0)")
+            sellPriceLabel.text = priceConversion(price: productSearchModel?.price ?? 0)
+            let attributeString = NSMutableAttributedString(string:priceConversion(price: productSearchModel?.originPrice ?? 0))
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
             markPriceLabel.attributedText = attributeString
             if productSearchModel?.totalStock == 0 {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallBarChart/ProductMallBarChartCollectionViewCell.swift

@@ -247,8 +247,8 @@ class ProductMallBarChartCollectionViewCell: UICollectionViewCell {
             titleLabel.text = productModel?.saleName
             detailTitleLabel.text = productModel?.saleName
             sellNumberLabel.text = "已售\(productModel?.totalCount ?? 0)件"
-            sellPriceLabel.text = "¥\(productModel?.price ?? 0)"
-            let attributeString = NSMutableAttributedString(string:"¥\(productModel?.originPrice ?? 0)")
+            sellPriceLabel.text = priceConversion(price: productModel?.price ?? 0)
+            let attributeString = NSMutableAttributedString(string:priceConversion(price: productModel?.originPrice ?? 0))
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
            
             if productModel?.totalStock == 0 {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallRightSideleftPicture/ProductRightSideleftPictureCollectionViewCell.swift

@@ -154,8 +154,8 @@ class ProductRightSideleftPictureCollectionViewCell: UICollectionViewCell {
             titleLabel.text = productModel?.saleName
             detailTitleLabel.text = productModel?.saleName
             sellNumberLabel.text = "已售\(productModel?.totalCount ?? 0)件"
-            sellPriceLabel.text = "¥\(productModel?.price ?? 0)"
-            let attributeString = NSMutableAttributedString(string:"¥\(productModel?.originPrice ?? 0)")
+            sellPriceLabel.text = priceConversion(price: productModel?.price ?? 0)
+            let attributeString = NSMutableAttributedString(string:priceConversion(price: productModel?.originPrice ?? 0))
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
             markPriceLabel.attributedText = attributeString
             if productModel?.totalStock == 0 {

+ 4 - 4
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallSlidingLeftRight/ProductSlidingLeftRightCollectionViewCell.swift

@@ -146,8 +146,8 @@ class ProductSlidingLeftRightCollectionViewCell: UICollectionViewCell {
             iconImagView.kf.setImage(with: kURLImage(name: productModel?.img ?? "pic_preload"), placeholder: kImage(name: "pic_preload"))
             titleLabel.text = productModel?.saleName
             detailTitleLabel.text = productModel?.saleName
-            sellPriceLabel.text = "¥\(productModel?.price ?? 0)"
-            let attributeString = NSMutableAttributedString(string:"¥\(productModel?.originPrice ?? 0)")
+            sellPriceLabel.text = priceConversion(price: productModel?.price ?? 0)
+            let attributeString = NSMutableAttributedString(string:priceConversion(price: productModel?.originPrice ?? 0))
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
             markPriceLabel.attributedText = attributeString
         }
@@ -158,8 +158,8 @@ class ProductSlidingLeftRightCollectionViewCell: UICollectionViewCell {
             iconImagView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "pic_preload"), placeholder: kImage(name: "pic_preload"))
             titleLabel.text = productSearchModel?.saleName
             detailTitleLabel.text = productSearchModel?.saleName
-            sellPriceLabel.text = "¥\(productSearchModel?.price ?? 0)"
-            let attributeString = NSMutableAttributedString(string:"¥\(productSearchModel?.originPrice ?? 0)")
+            sellPriceLabel.text = priceConversion(price: productSearchModel?.price ?? 0)
+            let attributeString = NSMutableAttributedString(string:priceConversion(price: productSearchModel?.originPrice ?? 0))
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
             markPriceLabel.attributedText = attributeString
             if productModel?.totalStock == 0 {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductSlidingTopBottom/ProductSlidingTopBottomCollectionViewCell.swift

@@ -18,8 +18,8 @@ class ProductSlidingTopBottomCollectionViewCell: UICollectionViewCell {
             iconImagView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "pic_preload"), placeholder: kImage(name: "pic_preload"))
             titleLabel.text = productSearchModel?.saleName
             sellNumberLabel.text = "已售\(productSearchModel?.totalCount ?? 0)件"
-            sellPriceLabel.text = "¥\(productSearchModel?.price ?? 0)"
-            let attrString = NSMutableAttributedString(string:"¥\(productSearchModel?.originPrice ?? 0)")
+            sellPriceLabel.text = priceConversion(price: productSearchModel?.price ?? 0)                        
+            let attrString = NSMutableAttributedString(string:priceConversion(price: productSearchModel?.originPrice ?? 0))
             attrString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
             markPriceLabel.attributedText = attrString
             if productSearchModel?.totalStock == 0 {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHBigTableViewCell.swift

@@ -151,8 +151,8 @@ class ProductHBigTableViewCell: UITableViewCell {
             titleLabel.text = productSearchModel?.name
             detailTitleLabel.text = productSearchModel?.saleName
             sellNumberLabel.text = "已售\(productSearchModel?.totalCount ?? 0)件"
-            sellPriceLabel.text = "¥\(productSearchModel?.price ?? 0)"
-            let attributeString = NSMutableAttributedString(string:"¥\(productSearchModel?.originPrice ?? 0)")
+            sellPriceLabel.text = priceConversion(price: productSearchModel?.price ?? 0)            
+            let attributeString = NSMutableAttributedString(string:priceConversion(price: productSearchModel?.originPrice ?? 0))
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
             markPriceLabel.textColor = kbbbbbbColor
             markPriceLabel.attributedText = attributeString

+ 3 - 2
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHSmallTableViewCell.swift

@@ -157,8 +157,9 @@ class ProductHSmallTableViewCell: UITableViewCell {
             titleLabel.text = productSearchModel?.name
             detailTitleLabel.text = productSearchModel?.saleName
             sellNumberLabel.text = "已售\(productSearchModel?.totalCount ?? 0)件"
-            sellPriceLabel.text = "¥\(productSearchModel?.price ?? 0)"
-            let attributeString = NSMutableAttributedString(string:"¥\(productSearchModel?.originPrice ?? 0)")
+            
+            sellPriceLabel.text = priceConversion(price: productSearchModel?.price ?? 0)            
+            let attributeString = NSMutableAttributedString(string:priceConversion(price: productSearchModel?.originPrice ?? 0))
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
             markPriceLabel.attributedText = attributeString
             if productSearchModel?.totalStock == 0 {

BIN
彩虹星球1期遗留问题.xmind