Commit 2a71c649 authored by pete谢兆麟's avatar pete谢兆麟

银河甄选接口及直播接口接入。后续文哥代办

parent 82ad94e1
......@@ -12,6 +12,7 @@
04013E3A2CF85086001A8E40 /* YHSelectCategoryModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04013E392CF85086001A8E40 /* YHSelectCategoryModel.swift */; };
04013E3C2CF86BB5001A8E40 /* YHSelectMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04013E3B2CF86BB5001A8E40 /* YHSelectMenuView.swift */; };
04013E3E2CF87F3A001A8E40 /* zhibo.json in Resources */ = {isa = PBXBuildFile; fileRef = 04013E3D2CF87F3A001A8E40 /* zhibo.json */; };
04013E402CF99505001A8E40 /* live.json in Resources */ = {isa = PBXBuildFile; fileRef = 04013E3F2CF99505001A8E40 /* live.json */; };
040450CF2CC8A0F400D1CFE5 /* YHResignDocumentMultiLineTipsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040450CE2CC8A0F400D1CFE5 /* YHResignDocumentMultiLineTipsCell.swift */; };
0408C3632BEC7C6900DB1E25 /* YHVideoPlayerControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0408C3622BEC7C6900DB1E25 /* YHVideoPlayerControlView.swift */; };
0409BEEB2C5B41D4003FCFD7 /* YHPrincipleProfileListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0409BEEA2C5B41D4003FCFD7 /* YHPrincipleProfileListCell.swift */; };
......@@ -1077,6 +1078,7 @@
04013E392CF85086001A8E40 /* YHSelectCategoryModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectCategoryModel.swift; sourceTree = "<group>"; };
04013E3B2CF86BB5001A8E40 /* YHSelectMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectMenuView.swift; sourceTree = "<group>"; };
04013E3D2CF87F3A001A8E40 /* zhibo.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = zhibo.json; sourceTree = "<group>"; };
04013E3F2CF99505001A8E40 /* live.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = live.json; sourceTree = "<group>"; };
040450CE2CC8A0F400D1CFE5 /* YHResignDocumentMultiLineTipsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignDocumentMultiLineTipsCell.swift; sourceTree = "<group>"; };
0408C3622BEC7C6900DB1E25 /* YHVideoPlayerControlView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVideoPlayerControlView.swift; sourceTree = "<group>"; };
0409BEEA2C5B41D4003FCFD7 /* YHPrincipleProfileListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleProfileListCell.swift; sourceTree = "<group>"; };
......@@ -5513,6 +5515,7 @@
04EA2E6D2BF74FA200AE80B0 /* shipin.json */,
04EA2E6F2BF74FA200AE80B0 /* zixun.json */,
04EA2E6E2BF74FA200AE80B0 /* shouye.json */,
04013E3F2CF99505001A8E40 /* live.json */,
);
path = jsons;
sourceTree = "<group>";
......@@ -5743,6 +5746,7 @@
A5573EDB2B317C0000D98EC0 /* Assets.xcassets in Resources */,
04F0ABF52C364F9400518C30 /* community.json in Resources */,
04EA2E712BF74FA200AE80B0 /* shouye.json in Resources */,
04013E402CF99505001A8E40 /* live.json in Resources */,
048FA0332BFDDFF400AD3BA9 /* submit_head_animation.gif in Resources */,
A5E69D512BA304D400411932 /* DIN Alternate Bold.ttf in Resources */,
A5EE42022C216C78005BBA5D /* img_2.jpg in Resources */,
......
......@@ -84,7 +84,7 @@ class YHHomeHoldViewPageViewController: YHBaseViewController {
}
if item.id == 2 {
let vc = YHHomeIdentityViewController()
vc.hideFlag = false
vc.hideFlag = true
arrItemVCs.append(vc)
}
if item.id == 3 {
......@@ -97,7 +97,7 @@ class YHHomeHoldViewPageViewController: YHBaseViewController {
arrItemVCs.append(vc)
}
if item.id == 5 {
let vc = YHHomeIdentityViewController()
let vc = YHSelectViewController()
vc.hideFlag = true
arrItemVCs.append(vc)
}
......@@ -379,7 +379,6 @@ extension YHHomeHoldViewPageViewController {
make.right.equalTo(-20)
make.height.equalTo(YHHomeSearchView.viewH)
}
// 隐藏消息铃铛UI
// view.addSubview(msgUnreadView)
// msgUnreadView.snp.makeConstraints { make in
......
......@@ -9,6 +9,7 @@
import UIKit
import JXSegmentedView
import ESPullToRefresh
import Lottie
class YHLifeViewController: YHBaseViewController {
var sectionView: YHLifeSectionView!
......@@ -270,7 +271,7 @@ extension YHLifeViewController: UICollectionViewDelegate, UICollectionViewDataSo
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
//跳转直播
//跳转直播 文哥代办
}
}
......@@ -278,7 +279,7 @@ class YHLookCollectionViewCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHLookCollectionViewCell"
var lookImageView: UIImageView!
var flagImageView: UIImageView!
var flagImageView: LottieAnimationView!
var headImageView: UIImageView!
var titleLabel: UILabel!
var nameLabel: UILabel!
......@@ -311,9 +312,10 @@ class YHLookCollectionViewCell: UICollectionViewCell {
}
flagImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "home_look_flag")
return imageView
let view = LottieAnimationView(name: "live")
view.backgroundColor = UIColor.black
view.loopMode = .loop
return view
}()
contentView.addSubview(flagImageView)
flagImageView.snp.makeConstraints { make in
......@@ -363,6 +365,7 @@ class YHLookCollectionViewCell: UICollectionViewCell {
make.bottom.equalTo(-8)
make.right.equalToSuperview()
}
flagImageView.play()
}
func updataAllSubViews() {
......
......@@ -13,7 +13,7 @@ class YHBannerModel: SmartCodable {
var name: String = ""
var skip_url: String = ""
var img_url: String = ""
var type: Int = 0//banner 跳转类型:0-不跳转,1-跳转H5,2-跳转APP内Tab,3-跳转资讯页
var type: Int = 0//banner 跳转类型:0-不跳转,1-跳转H5,2-跳转APP内Tab,3-跳转资讯页 100 101
var create_at: String = ""
var skip_type: Int = 0
var id: Int = 0
......
......@@ -211,6 +211,8 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
printLog("跳转直播")
case 101://录播
printLog("跳转录播")
case 102://图片直播
printLog("跳转录播")
case 0://0 不需要跳转
printLog("0 不需要跳转")
default:
......
......@@ -8,15 +8,18 @@
import UIKit
import AttributedString
import JXSegmentedView
class YHSelectViewController: YHBaseViewController {
var sectionView: YHSelectLookView!
var tableView: UITableView!
var headView: YHSelectLookHeadView!
var viewModel: YHSelectViewModel = YHSelectViewModel()
var selectItem: Int = 100
var selectItem: Int = 0
var selectMenuView: YHSelectMenuView!
var canShowMenu: Bool = true
var hideFlag: Bool = false
lazy var noDataView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("暂无产品", kEmptyCommonBgName)
view.isHidden = true
......@@ -25,7 +28,6 @@ class YHSelectViewController: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "银河甄选"
setupUI()
loadData()
}
......@@ -36,8 +38,10 @@ class YHSelectViewController: YHBaseViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillAppear(animated)
if (self.selectMenuView != nil) {
self.selectMenuView.removeFromSuperview()
}
}
}
extension YHSelectViewController {
......@@ -45,7 +49,7 @@ extension YHSelectViewController {
self.viewModel.getCategoryList {[weak self] success, error in
guard let self = self else { return }
}
self.viewModel.getGoodsList(categoryID: "6") {[weak self] success, error in
self.viewModel.getGoodsList(categoryID: "0") {[weak self] success, error in
guard let self = self else { return }
self.tableView.reloadData()
if self.viewModel.goodsArray.count == 0 {
......@@ -80,6 +84,11 @@ extension YHSelectViewController {
}
func setupUI() {
if hideFlag {
gk_navigationBar.isHidden = true
} else {
gk_navTitle = "银河甄选"
}
view.backgroundColor = .white
sectionView = {
let view = YHSelectLookView()
......@@ -102,10 +111,15 @@ extension YHSelectViewController {
if self.canShowMenu {
self.canShowMenu = false
self.selectMenuView = YHSelectMenuView()
self.selectMenuView.show(top: k_Height_NavigationtBarAndStatuBar + 46, selectItem: 100, dataSource: dataSource) { item in
var top: CGFloat = k_Height_NavigationtBarAndStatuBar + 46
if self.hideFlag {
top = k_Height_safeAreaInsetsTop() + 6 + 36 + 46 + 46
}
self.selectMenuView.show(top: top, selectItem: 100, dataSource: dataSource) { item in
self.selectItem = item
self.updataData()
self.canShowMenu = true
self.headView.itemButton.isSelected = false
}
}
}
......@@ -129,12 +143,17 @@ extension YHSelectViewController {
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
if hideFlag {
make.top.equalToSuperview()
} else {
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
}
}
// tableView.es.addYHPullToRefresh {
// self.loadData()
// }
tableView.es.addYHPullToRefresh {
self.updataData()
self.tableView.es.stopPullToRefresh()
}
tableView.addSubview(noDataView)
noDataView.snp.makeConstraints { make in
......@@ -166,6 +185,11 @@ extension YHSelectViewController: UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if selectItem < self.viewModel.categoryArray.count {
let model = self.viewModel.categoryArray[selectItem]
headView.itemButton.setTitle(model.name, for: .normal)
headView.itemButton.iconInRight(with: 0.5)
}
return headView
}
......@@ -182,6 +206,19 @@ extension YHSelectViewController: UITableViewDelegate, UITableViewDataSource {
}
}
extension YHSelectViewController: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
}
func listWillDisappear() {
self.headView.itemButton.isSelected = false
if (self.selectMenuView != nil) {
self.selectMenuView.removeFromSuperview()
}
}
}
class YHSelectLookTableViewCell: UITableViewCell {
var centerImageView: UIImageView!
var titleLabel: UILabel!
......
......@@ -37,6 +37,8 @@ class YHSelectLookHeadView: UIView {
button.setTitle("全部产品", for: .normal)
button.setImage(UIImage(named: "home_select_icon"), for: .normal)
button.setTitleColor(UIColor(hex: 0x6d788a), for: .normal)
button.setTitleColor(UIColor.brandMainColor, for: .selected)
button.setImage(UIImage(named: "home_select_icon_select"), for: .selected)
button.backgroundColor = UIColor.contentBkgColor
button.addTarget(self, action: #selector(itemClick), for: .touchUpInside)
return button
......@@ -46,12 +48,13 @@ class YHSelectLookHeadView: UIView {
make.left.equalTo(20)
make.top.equalTo(12)
make.height.equalTo(26)
make.width.equalTo(92)
// make.width.equalTo(92)
}
itemButton.iconInRight(with: 0.5)
}
@objc func itemClick() {
itemButton.isSelected = true
if let block = self.block {
block()
}
......
......@@ -89,24 +89,23 @@ extension YHSelectLookView: UICollectionViewDelegate, UICollectionViewDataSource
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
selectIndex = indexPath.row
collectionView.reloadData()
if let block = block {
block(indexPath.row)
}
print("index is \(indexPath.row)")
//跳转直播 文哥代办
}
}
class YHSelectLookViewCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHSelectLookViewCell"
var animationView: LottieAnimationView!
var liveAnimationView: LottieAnimationView!
lazy var headIamge: UIImageView = {
let image = UIImageView()
image.image = UIImage(named: "home_look_head")
image.layer.cornerRadius = 27
image.layer.cornerRadius = 24
image.layer.masksToBounds = true
image.layer.borderWidth = 2
image.layer.borderColor = UIColor.brandMainColor.cgColor
return image
}()
......@@ -152,12 +151,26 @@ class YHSelectLookViewCell: UICollectionViewCell {
make.width.height.equalTo(48)
}
liveAnimationView = {
let view = LottieAnimationView(name: "live")
view.backgroundColor = UIColor.brandMainColor
view.loopMode = .loop
return view
}()
contentView.addSubview(liveAnimationView)
liveAnimationView.snp.makeConstraints { make in
make.bottom.equalTo(animationView.snp.bottom)
make.right.equalTo(animationView.snp.right)
make.width.height.equalTo(14)
}
contentView.addSubview(descripeLable)
descripeLable.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(14)
}
animationView.play()
liveAnimationView.play()
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_select_icon_select@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_select_icon_select@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{"v":"5.6.10","fr":60,"ip":30,"op":90,"w":54,"h":54,"nm":"直播中lottie","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Rectangle 346242416","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[39,27,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":30,"s":[{"i":[[0,-1.657],[0,0],[1.657,0],[0,1.657],[0,0],[-1.657,0]],"o":[[0,0],[0,1.657],[-1.657,0],[0,0],[0,-1.657],[1.657,0]],"v":[[3,-12],[3,12],[0,15],[-3,12],[-3,-12],[0,-15]],"c":true}]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":60,"s":[{"i":[[0,-1.657],[0,0],[1.657,0],[0,1.657],[0,0],[-1.657,0]],"o":[[0,0],[0,1.657],[-1.657,0],[0,0],[0,-1.657],[1.657,0]],"v":[[3,6],[3,12],[0,15],[-3,12],[-3,6],[0,3]],"c":true}]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":90,"s":[{"i":[[0,-1.657],[0,0],[1.657,0],[0,1.657],[0,0],[-1.657,0]],"o":[[0,0],[0,1.657],[-1.657,0],[0,0],[0,-1.657],[1.657,0]],"v":[[3,-12],[3,12],[0,15],[-3,12],[-3,-12],[0,-15]],"c":true}]},{"t":120,"s":[{"i":[[0,-1.657],[0,0],[1.657,0],[0,1.657],[0,0],[-1.657,0]],"o":[[0,0],[0,1.657],[-1.657,0],[0,0],[0,-1.657],[1.657,0]],"v":[[3,6],[3,12],[0,15],[-3,12],[-3,6],[0,3]],"c":true}]}],"ix":2},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"Rectangle 346242416","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":120,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Rectangle 346242415","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[27,27,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":15,"s":[{"i":[[0,-1.657],[0,0],[1.657,0],[0,1.657],[0,0],[-1.657,0]],"o":[[0,0],[0,1.657],[-1.657,0],[0,0],[0,-1.657],[1.657,0]],"v":[[3,-12],[3,12],[0,15],[-3,12],[-3,-12],[0,-15]],"c":true}]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":45,"s":[{"i":[[0,-1.657],[0,0],[1.657,0],[0,1.657],[0,0],[-1.657,0]],"o":[[0,0],[0,1.657],[-1.657,0],[0,0],[0,-1.657],[1.657,0]],"v":[[3,6],[3,12],[0,15],[-3,12],[-3,6],[0,3]],"c":true}]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":75,"s":[{"i":[[0,-1.657],[0,0],[1.657,0],[0,1.657],[0,0],[-1.657,0]],"o":[[0,0],[0,1.657],[-1.657,0],[0,0],[0,-1.657],[1.657,0]],"v":[[3,-12],[3,12],[0,15],[-3,12],[-3,-12],[0,-15]],"c":true}]},{"t":105,"s":[{"i":[[0,-1.657],[0,0],[1.657,0],[0,1.657],[0,0],[-1.657,0]],"o":[[0,0],[0,1.657],[-1.657,0],[0,0],[0,-1.657],[1.657,0]],"v":[[3,6],[3,12],[0,15],[-3,12],[-3,6],[0,3]],"c":true}]}],"ix":2},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"Rectangle 346242415","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":120,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Rectangle 346242414","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[15,27,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[{"i":[[0,-1.657],[0,0],[1.657,0],[0,1.657],[0,0],[-1.657,0]],"o":[[0,0],[0,1.657],[-1.657,0],[0,0],[0,-1.657],[1.657,0]],"v":[[3,-12],[3,12],[0,15],[-3,12],[-3,-12],[0,-15]],"c":true}]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":30,"s":[{"i":[[0,-1.657],[0,0],[1.657,0],[0,1.657],[0,0],[-1.657,0]],"o":[[0,0],[0,1.657],[-1.657,0],[0,0],[0,-1.657],[1.657,0]],"v":[[3,6],[3,12],[0,15],[-3,12],[-3,6],[0,3]],"c":true}]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":60,"s":[{"i":[[0,-1.657],[0,0],[1.657,0],[0,1.657],[0,0],[-1.657,0]],"o":[[0,0],[0,1.657],[-1.657,0],[0,0],[0,-1.657],[1.657,0]],"v":[[3,-12],[3,12],[0,15],[-3,12],[-3,-12],[0,-15]],"c":true}]},{"t":90,"s":[{"i":[[0,-1.657],[0,0],[1.657,0],[0,1.657],[0,0],[-1.657,0]],"o":[[0,0],[0,1.657],[-1.657,0],[0,0],[0,-1.657],[1.657,0]],"v":[[3,6],[3,12],[0,15],[-3,12],[-3,6],[0,3]],"c":true}]}],"ix":2},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":120,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file
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