Commit 0df57af6 authored by lujunye's avatar lujunye

修复显示bug

parent eb0fd85b
...@@ -1564,7 +1564,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -1564,7 +1564,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell") collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell")
if guiGeArr.count > 0 { if guiGeArr.count > 0 {
collectionView.layoutIfNeeded() collectionView.layoutIfNeeded()
collectionView.scrollToItem(at: selectIdx!, at: .centeredHorizontally, animated: false) collectionView.scrollToItem(at: selectIdx!, at: .top, animated: false)
} }
if guiGeArr.count > 2{ if guiGeArr.count > 2{
let leftImg = UIImageView() let leftImg = UIImageView()
...@@ -1666,16 +1666,22 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -1666,16 +1666,22 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
var skuArr:Array<Any> = [] var skuArr:Array<Any> = []
for i in 0 ..< dataArr.count{ for i in 0 ..< dataArr.count{
let item = dataArr[i] let item = dataArr[i]
var pData = ""
if isPurnNumber(str: item.price) { if item.price.contains(",") {
let arr = item.price.components(separatedBy: ",")
pData = arr.joined(separator: "")
}else{
pData = item.price
}
if isPurnNumber(str: pData) {
if isgetP { if isgetP {
let peiceP = Float(item.price)! //第n个售价(n > 1) let peiceP = Float(pData)! //第n个售价(n > 1)
if peiceP < price { if peiceP < price {
price = peiceP price = peiceP
model = item model = item
} }
}else { }else {
price = Float(item.price)! //第一个售价 price = Float(pData)! //第一个售价
model = item model = item
isgetP = true isgetP = true
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
......
...@@ -1136,7 +1136,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -1136,7 +1136,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell") collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell")
if guiGeArr.count > 0 { if guiGeArr.count > 0 {
collectionView.layoutIfNeeded() collectionView.layoutIfNeeded()
collectionView.scrollToItem(at: selectIdx!, at: .centeredHorizontally, animated: false) collectionView.scrollToItem(at: selectIdx!, at: .top, animated: false)
} }
if guiGeArr.count > 2{ if guiGeArr.count > 2{
let leftImg = UIImageView() let leftImg = UIImageView()
......
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