Commit e97dd36b authored by Steven杜宇's avatar Steven杜宇

// 关于我们界面

parent fc89447a
...@@ -9,8 +9,22 @@ ...@@ -9,8 +9,22 @@
import UIKit import UIKit
import DeviceKit import DeviceKit
struct AboutAdvantageItem {
var iconName : String
var title : String
var detail : String
}
class YHAboutUsViewController: YHBaseViewController { class YHAboutUsViewController: YHBaseViewController {
lazy var items = {
return [AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高"),
AboutAdvantageItem(iconName: "about_response", title: "快速响应", detail: "身份规划师一对一专业服务,第一时间响应您的需求"),
AboutAdvantageItem(iconName: "about_service", title: "专业服务", detail: "5年经验+英语专8级文案导师团队倾力支持"),
AboutAdvantageItem(iconName: "about_service2", title: "精准匹配", detail: "香港专才、香港留学获批常年保持90%以上")]
}()
lazy var collectView = { lazy var collectView = {
// 设置布局方向 // 设置布局方向
...@@ -20,6 +34,7 @@ class YHAboutUsViewController: YHBaseViewController { ...@@ -20,6 +34,7 @@ class YHAboutUsViewController: YHBaseViewController {
let itemWidth = floor((KScreenWidth-2*margin-gap)/2.0) let itemWidth = floor((KScreenWidth-2*margin-gap)/2.0)
flowLayout.itemSize = CGSize(width: itemWidth, height: itemWidth) flowLayout.itemSize = CGSize(width: itemWidth, height: itemWidth)
flowLayout.minimumInteritemSpacing = 12.0 flowLayout.minimumInteritemSpacing = 12.0
flowLayout.minimumLineSpacing = 12.0
flowLayout.scrollDirection = .vertical flowLayout.scrollDirection = .vertical
let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout) let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
...@@ -129,12 +144,12 @@ class YHAboutUsViewController: YHBaseViewController { ...@@ -129,12 +144,12 @@ class YHAboutUsViewController: YHBaseViewController {
extension YHAboutUsViewController: UICollectionViewDelegateFlowLayout, UICollectionViewDelegate, UICollectionViewDataSource { extension YHAboutUsViewController: UICollectionViewDelegateFlowLayout, UICollectionViewDelegate, UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 4 return items.count
} }
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHAboutUsAdvantageCell.cellReuseIdentifier, for: indexPath) as! YHAboutUsAdvantageCell let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHAboutUsAdvantageCell.cellReuseIdentifier, for: indexPath) as! YHAboutUsAdvantageCell
cell.advantateItem = items[indexPath.row]
return cell return cell
} }
......
...@@ -11,6 +11,17 @@ import UIKit ...@@ -11,6 +11,17 @@ import UIKit
class YHAboutUsAdvantageCell: UICollectionViewCell { class YHAboutUsAdvantageCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHAboutUsAdvantageCell" static let cellReuseIdentifier = "YHAboutUsAdvantageCell"
var advantateItem : AboutAdvantageItem? {
didSet {
if let advantateItem = advantateItem {
iconImgView.image = UIImage(named: advantateItem.iconName)
titleLabel.text = advantateItem.title
detailLabel.text = advantateItem.detail
}
}
}
lazy var iconImgView:UIImageView = { lazy var iconImgView:UIImageView = {
let icon = UIImageView(image: UIImage(named: "mine_manager")) let icon = UIImageView(image: UIImage(named: "mine_manager"))
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2995@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2995@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2998@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2998@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2999@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 3000@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 3000@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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