Commit 0df57af6 authored by lujunye's avatar lujunye

修复显示bug

parent eb0fd85b
......@@ -1564,7 +1564,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell")
if guiGeArr.count > 0 {
collectionView.layoutIfNeeded()
collectionView.scrollToItem(at: selectIdx!, at: .centeredHorizontally, animated: false)
collectionView.scrollToItem(at: selectIdx!, at: .top, animated: false)
}
if guiGeArr.count > 2{
let leftImg = UIImageView()
......@@ -1666,16 +1666,22 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
var skuArr:Array<Any> = []
for i in 0 ..< dataArr.count{
let item = dataArr[i]
if isPurnNumber(str: item.price) {
var pData = ""
if item.price.contains(",") {
let arr = item.price.components(separatedBy: ",")
pData = arr.joined(separator: "")
}else{
pData = item.price
}
if isPurnNumber(str: pData) {
if isgetP {
let peiceP = Float(item.price)! //第n个售价(n > 1)
let peiceP = Float(pData)! //第n个售价(n > 1)
if peiceP < price {
price = peiceP
model = item
}
}else {
price = Float(item.price)! //第一个售价
price = Float(pData)! //第一个售价
model = item
isgetP = true
}
......
<?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"/>
<dependencies>
<deployment identifier="iOS"/>
......
......@@ -1136,7 +1136,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell")
if guiGeArr.count > 0 {
collectionView.layoutIfNeeded()
collectionView.scrollToItem(at: selectIdx!, at: .centeredHorizontally, animated: false)
collectionView.scrollToItem(at: selectIdx!, at: .top, animated: false)
}
if guiGeArr.count > 2{
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