Commit 538d5d51 authored by 刘俊宏's avatar 刘俊宏

完成工作中心选择时间UI

parent ed333573
...@@ -323,6 +323,8 @@ ...@@ -323,6 +323,8 @@
F969BF08244EC38000C79953 /* GoodsCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F969BF06244EC38000C79953 /* GoodsCollectionViewCell.xib */; }; F969BF08244EC38000C79953 /* GoodsCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F969BF06244EC38000C79953 /* GoodsCollectionViewCell.xib */; };
F969BF1E244EE67900C79953 /* GoodsManageListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F969BF1C244EE67900C79953 /* GoodsManageListVC.swift */; }; F969BF1E244EE67900C79953 /* GoodsManageListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F969BF1C244EE67900C79953 /* GoodsManageListVC.swift */; };
F969BF1F244EE67900C79953 /* GoodsManageListVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = F969BF1D244EE67900C79953 /* GoodsManageListVC.xib */; }; F969BF1F244EE67900C79953 /* GoodsManageListVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = F969BF1D244EE67900C79953 /* GoodsManageListVC.xib */; };
F9956B1C2463D941001A617D /* WorkSelectTimeView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F9956B1B2463D941001A617D /* WorkSelectTimeView.xib */; };
F9956B1E2463D94E001A617D /* WorkSelectTimeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9956B1D2463D94E001A617D /* WorkSelectTimeView.swift */; };
F9DDBE922457BFEC00A32CB2 /* HUDEXT.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9DDBE912457BFEC00A32CB2 /* HUDEXT.swift */; }; F9DDBE922457BFEC00A32CB2 /* HUDEXT.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9DDBE912457BFEC00A32CB2 /* HUDEXT.swift */; };
F9DDBE962457D3EC00A32CB2 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9DDBE942457D3EC00A32CB2 /* WebViewController.swift */; }; F9DDBE962457D3EC00A32CB2 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9DDBE942457D3EC00A32CB2 /* WebViewController.swift */; };
F9DDBE972457D3EC00A32CB2 /* WebViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F9DDBE952457D3EC00A32CB2 /* WebViewController.xib */; }; F9DDBE972457D3EC00A32CB2 /* WebViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F9DDBE952457D3EC00A32CB2 /* WebViewController.xib */; };
...@@ -696,6 +698,8 @@ ...@@ -696,6 +698,8 @@
F969BF06244EC38000C79953 /* GoodsCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GoodsCollectionViewCell.xib; sourceTree = "<group>"; }; F969BF06244EC38000C79953 /* GoodsCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GoodsCollectionViewCell.xib; sourceTree = "<group>"; };
F969BF1C244EE67900C79953 /* GoodsManageListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoodsManageListVC.swift; sourceTree = "<group>"; }; F969BF1C244EE67900C79953 /* GoodsManageListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoodsManageListVC.swift; sourceTree = "<group>"; };
F969BF1D244EE67900C79953 /* GoodsManageListVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GoodsManageListVC.xib; sourceTree = "<group>"; }; F969BF1D244EE67900C79953 /* GoodsManageListVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GoodsManageListVC.xib; sourceTree = "<group>"; };
F9956B1B2463D941001A617D /* WorkSelectTimeView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WorkSelectTimeView.xib; sourceTree = "<group>"; };
F9956B1D2463D94E001A617D /* WorkSelectTimeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkSelectTimeView.swift; sourceTree = "<group>"; };
F9DDBE912457BFEC00A32CB2 /* HUDEXT.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HUDEXT.swift; sourceTree = "<group>"; }; F9DDBE912457BFEC00A32CB2 /* HUDEXT.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HUDEXT.swift; sourceTree = "<group>"; };
F9DDBE942457D3EC00A32CB2 /* WebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = "<group>"; }; F9DDBE942457D3EC00A32CB2 /* WebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = "<group>"; };
F9DDBE952457D3EC00A32CB2 /* WebViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WebViewController.xib; sourceTree = "<group>"; }; F9DDBE952457D3EC00A32CB2 /* WebViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WebViewController.xib; sourceTree = "<group>"; };
...@@ -1558,6 +1562,8 @@ ...@@ -1558,6 +1562,8 @@
children = ( children = (
F950FDE724518CD800C40530 /* TimeSelectView.swift */, F950FDE724518CD800C40530 /* TimeSelectView.swift */,
F950FDE92451920200C40530 /* DIYCalendarCell.swift */, F950FDE92451920200C40530 /* DIYCalendarCell.swift */,
F9956B1B2463D941001A617D /* WorkSelectTimeView.xib */,
F9956B1D2463D94E001A617D /* WorkSelectTimeView.swift */,
); );
path = TimeSelectView; path = TimeSelectView;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1856,6 +1862,7 @@ ...@@ -1856,6 +1862,7 @@
E0A2E82824555B4400D6DB34 /* KuCunShangPinCell.xib in Resources */, E0A2E82824555B4400D6DB34 /* KuCunShangPinCell.xib in Resources */,
E042F73D245288F800CDFA12 /* WenDuCell.xib in Resources */, E042F73D245288F800CDFA12 /* WenDuCell.xib in Resources */,
E02DDD92244FE55400ABB707 /* NewCreateHeader.xib in Resources */, E02DDD92244FE55400ABB707 /* NewCreateHeader.xib in Resources */,
F9956B1C2463D941001A617D /* WorkSelectTimeView.xib in Resources */,
E09B03B72445B85A00211A51 /* LoginViewController.xib in Resources */, E09B03B72445B85A00211A51 /* LoginViewController.xib in Resources */,
E09F4C9E2452BEBB00BE033D /* JiPaiFangShiViewController.xib in Resources */, E09F4C9E2452BEBB00BE033D /* JiPaiFangShiViewController.xib in Resources */,
E09B03C12445B96500211A51 /* FgPassViewController.xib in Resources */, E09B03C12445B96500211A51 /* FgPassViewController.xib in Resources */,
...@@ -2190,6 +2197,7 @@ ...@@ -2190,6 +2197,7 @@
E0516F772448003D00E373CE /* PayViewController.swift in Sources */, E0516F772448003D00E373CE /* PayViewController.swift in Sources */,
E02DDD952450106C00ABB707 /* PuTongJieTiCell.swift in Sources */, E02DDD952450106C00ABB707 /* PuTongJieTiCell.swift in Sources */,
E0BE8A8B245A7D3300E80134 /* BtmBtnCell.swift in Sources */, E0BE8A8B245A7D3300E80134 /* BtmBtnCell.swift in Sources */,
F9956B1E2463D94E001A617D /* WorkSelectTimeView.swift in Sources */,
F950FDE024518B9500C40530 /* FSCalendarExtensions.m in Sources */, F950FDE024518B9500C40530 /* FSCalendarExtensions.m in Sources */,
E09B03A32445AF9500211A51 /* NetworkRequest.swift in Sources */, E09B03A32445AF9500211A51 /* NetworkRequest.swift in Sources */,
E0D46C5624503EC50087B564 /* TitleAndSelectCell.swift in Sources */, E0D46C5624503EC50087B564 /* TitleAndSelectCell.swift in Sources */,
......
{ {
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [ "colors" : [
{ {
"idiom" : "universal",
"color" : { "color" : {
"color-space" : "srgb", "color-space" : "srgb",
"components" : { "components" : {
"red" : "0.400",
"alpha" : "1.000", "alpha" : "1.000",
"blue" : "0.400", "blue" : "0x66",
"green" : "0.400" "green" : "0x66",
"red" : "0x66"
} }
} },
"idiom" : "universal"
} }
] ],
} "info" : {
\ No newline at end of file "author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "workTimeDel.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "workTimeDel@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "workTimeDel@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
//
// WorkSelectTimeView.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/5/7.
// Copyright © 2020 junye lu. All rights reserved.
//
import Foundation
protocol WorkSelectTimeViewDelegate {
func selectWorkIndx(sender:Int)
}
class WorkSelectTimeView: UIView ,TimeSelectViewDelgate{
var delegate:WorkSelectTimeViewDelegate?
var contentView:UIView!
@IBAction func tapBlackAction(_ sender: UITapGestureRecognizer) {
if selectIndex != 1004 {
timeView.removeFromSuperview()
wContentHeight.constant = 73
}
self.delegate?.selectWorkIndx(sender: selectIndex)
self.removeFromSuperview()
}
@IBOutlet weak var wContentView: UIView!
@IBOutlet weak var wContentHeight: NSLayoutConstraint!
@IBOutlet weak var fBtn: UIButton!
@IBOutlet weak var sBtn: UIButton!
@IBOutlet weak var tbtn: UIButton!
@IBOutlet weak var lBtn: UIButton!
var selectIndex = 0 {
didSet {
fBtn.setTitleColor(UIColor.init(named: "多选按钮字体颜色"), for: .normal)
fBtn.backgroundColor = UIColor.init(named: "多选按钮背景颜色")
sBtn.setTitleColor(UIColor.init(named: "多选按钮字体颜色"), for: .normal)
sBtn.backgroundColor = UIColor.init(named: "多选按钮背景颜色")
tbtn.setTitleColor(UIColor.init(named: "多选按钮字体颜色"), for: .normal)
tbtn.backgroundColor = UIColor.init(named: "多选按钮背景颜色")
lBtn.setTitleColor(UIColor.init(named: "多选按钮字体颜色"), for: .normal)
lBtn.backgroundColor = UIColor.init(named: "多选按钮背景颜色")
if selectIndex == 1001 {
fBtn.setTitleColor(UIColor.init(named: "白色背景色"), for: .normal)
fBtn.backgroundColor = UIColor.init(named: "蓝色字体颜色")
}else if selectIndex == 1002 {
sBtn.setTitleColor(UIColor.init(named: "白色背景色"), for: .normal)
sBtn.backgroundColor = UIColor.init(named: "蓝色字体颜色")
}else if selectIndex == 1003 {
tbtn.setTitleColor(UIColor.init(named: "白色背景色"), for: .normal)
tbtn.backgroundColor = UIColor.init(named: "蓝色字体颜色")
}else if selectIndex == 1004 {
lBtn.setTitleColor(UIColor.init(named: "白色背景色"), for: .normal)
lBtn.backgroundColor = UIColor.init(named: "蓝色字体颜色")
}
}
}
@IBAction func btnAction(_ sender: UIButton) {
fBtn.setTitleColor(UIColor.init(named: "多选按钮字体颜色"), for: .normal)
fBtn.backgroundColor = UIColor.init(named: "多选按钮背景颜色")
sBtn.setTitleColor(UIColor.init(named: "多选按钮字体颜色"), for: .normal)
sBtn.backgroundColor = UIColor.init(named: "多选按钮背景颜色")
tbtn.setTitleColor(UIColor.init(named: "多选按钮字体颜色"), for: .normal)
tbtn.backgroundColor = UIColor.init(named: "多选按钮背景颜色")
lBtn.setTitleColor(UIColor.init(named: "多选按钮字体颜色"), for: .normal)
lBtn.backgroundColor = UIColor.init(named: "多选按钮背景颜色")
sender.setTitleColor(UIColor.init(named: "白色背景色"), for: .normal)
sender.backgroundColor = UIColor.init(named: "蓝色字体颜色")
timeView.removeFromSuperview()
if sender.tag == 1004 {
wContentHeight.constant = 73 + 300*glscale
wContentView.addSubview(timeView)
timeView.snp.makeConstraints { (make) in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(lBtn.snp_bottom).offset(20*glscale)
}
addTimeView()
}else{
wContentHeight.constant = 73
//还需要传文字出去
self.delegate?.selectWorkIndx(sender: sender.tag)
self.removeFromSuperview()
}
}
let timeView = UIView()
func addTimeView() {
let line = UIView()
line.backgroundColor = UIColor.init(named: "灰色分界线")
timeView.addSubview(line)
line.snp.makeConstraints { (make) in
make.left.equalTo(15*glscale)
make.right.equalTo(-15*glscale)
make.top.equalToSuperview()
make.height.equalTo(1)
}
let calendarV = TimeSelectView(frame: CGRect(x: 0, y: 1, width: fullScreenWidth, height: 235*glscale))
calendarV.moreSelection = true
timeView.addSubview(calendarV)
calendarV.delegate = self
let line2 = UIView()
line2.backgroundColor = UIColor.init(named: "灰色分界线")
timeView.addSubview(line2)
line2.snp.makeConstraints { (make) in
make.left.equalTo(15*glscale)
make.right.equalTo(-15*glscale)
make.top.equalTo(calendarV.snp_bottom)
make.height.equalTo(1)
}
let sureBtn = UIButton(type: .custom)
sureBtn.setTitleColor(UIColor.init(named: "白色背景色"), for: .normal)
sureBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
sureBtn.backgroundColor = UIColor.init(named: "蓝色字体颜色")
sureBtn.setTitle("确定", for: .normal)
sureBtn.layer.cornerRadius = 3
sureBtn.addTarget(self, action: #selector(sureBtnAction(sender:)), for: .touchUpInside)
timeView.addSubview(sureBtn)
sureBtn.snp.makeConstraints { (make) in
make.right.bottom.equalTo(-15*glscale)
make.width.equalTo(70*glscale)
make.height.equalTo(30*glscale)
}
let kuangV = UIView()
kuangV.layer.borderColor = UIColor.init(named: "灰色字体颜色")?.cgColor
kuangV.layer.borderWidth = 1
kuangV.layer.cornerRadius = 3
timeView.addSubview(kuangV)
kuangV.snp.makeConstraints { (make) in
make.height.equalTo(sureBtn)
make.right.equalTo(sureBtn.snp_left).offset(-15*glscale)
make.width.equalTo(180*glscale)
make.centerY.equalTo(sureBtn)
}
let clearBtn = UIButton(type: .custom)
clearBtn.setImage(UIImage.init(named: "workTimeDel"), for: .normal)
clearBtn.addTarget(self, action: #selector(clearBtnAction(sender:)), for: .touchUpInside)
timeView.addSubview(clearBtn)
clearBtn.snp.makeConstraints { (make) in
make.right.equalTo(kuangV.snp_right).offset(-7*glscale)
make.centerY.equalTo(sureBtn)
}
let timeLbl = UILabel()
timeLbl.text = "2020.4.15-2020.4.23"
timeLbl.font = UIFont.systemFont(ofSize: 13)
timeLbl.textColor = UIColor.init(named: "蓝色字体颜色")
timeView.addSubview(timeLbl)
timeLbl.snp.makeConstraints { (make) in
make.centerY.equalTo(kuangV)
make.left.equalTo(kuangV.snp_left).offset(10*glscale)
}
}
func selectMoreDate(beginDate: Date, endginDate: Date) {
print("选择日期·····")
}
@objc func clearBtnAction(sender:UIButton){
print("清除日期·····")
}
@objc func sureBtnAction(sender:UIButton){
//还要传日期文本出去
self.delegate?.selectWorkIndx(sender: 1004)
self.removeFromSuperview()
}
//初始化时将xib中的view添加进来
override init(frame: CGRect) {
super.init(frame: frame)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
}
// /初始化时将xib中的view添加进来
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
}
//加载xib
func loadViewFromNib() -> UIView {
let className = type(of: self)
let bundle = Bundle(for: className)
let name = NSStringFromClass(className).components(separatedBy: ".").last
let nib = UINib(nibName: name!, bundle: bundle)
let view = nib.instantiate(withOwner: self, options: nil).first as! UIView
return view
}
}
...@@ -23,7 +23,7 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable ...@@ -23,7 +23,7 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
adminInfo(["user_token":UserToken as Any], success: { (data) in adminInfo(["user_token":UserToken as Any], success: { (data) in
self.dataModel = (data as! AdminInfoModel) self.dataModel = (data as! AdminInfoModel)
self.iconImg.kf.setImage(with: URL(string: SERVERCE_HOST + (self.dataModel?.data?.shop_img)!)) // self.iconImg.kf.setImage(with: URL(string: SERVERCE_HOST + (self.dataModel?.data?.shop_img)!))
self.shopNameLbl.text = self.dataModel?.data?.stall_name self.shopNameLbl.text = self.dataModel?.data?.stall_name
self.nameLbl.text = self.dataModel?.data?.admin_name self.nameLbl.text = self.dataModel?.data?.admin_name
}) { (error) in }) { (error) in
......
...@@ -369,7 +369,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect ...@@ -369,7 +369,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
let rowModel = self.items[indexPath.row] let rowModel = self.items[indexPath.row]
cell.goodsName.text = rowModel.goods_name cell.goodsName.text = rowModel.goods_name
cell.priceLbl.text = "¥" + rowModel.price! cell.priceLbl.text = "¥" + rowModel.price!
cell.goodsImgV.kf.setImage(with: URL.init(string:SERVERCE_HOST + rowModel.goods_thumb!)!, placeholder: nil, options: nil, progressBlock: nil, completionHandler: nil) // cell.goodsImgV.kf.setImage(with: URL.init(string:SERVERCE_HOST + rowModel.goods_thumb!)!, placeholder: nil, options: nil, progressBlock: nil, completionHandler: nil)
if rowModel.is_show == 0 { if rowModel.is_show == 0 {
cell.leftBtn.setTitle("下架", for: .normal) cell.leftBtn.setTitle("下架", for: .normal)
......
...@@ -28,7 +28,7 @@ class ShopInfoViewController: BaseViewController { ...@@ -28,7 +28,7 @@ class ShopInfoViewController: BaseViewController {
shopInfo(["user_token":UserToken as Any], success: { (data) in shopInfo(["user_token":UserToken as Any], success: { (data) in
self.dataModel = (data as! ShopInfoModel) self.dataModel = (data as! ShopInfoModel)
self.shopImgV.kf.setImage(with: URL(string: SERVERCE_HOST + (self.dataModel?.data?.shop_img)!)) // self.shopImgV.kf.setImage(with: URL(string: SERVERCE_HOST + (self.dataModel?.data?.shop_img)!))
self.shopNameLbl.text = self.dataModel?.data?.shop_name self.shopNameLbl.text = self.dataModel?.data?.shop_name
self.compAddressLbl.text = self.dataModel?.data?.addr_str self.compAddressLbl.text = self.dataModel?.data?.addr_str
self.addressDetLbl.text = self.dataModel?.data?.address self.addressDetLbl.text = self.dataModel?.data?.address
...@@ -43,7 +43,7 @@ class ShopInfoViewController: BaseViewController { ...@@ -43,7 +43,7 @@ class ShopInfoViewController: BaseViewController {
self.emailLbl.text = self.dataModel?.data?.shop_email self.emailLbl.text = self.dataModel?.data?.shop_email
self.businessNumLbl.text = self.dataModel?.data?.business_licence_number self.businessNumLbl.text = self.dataModel?.data?.business_licence_number
self.businessSphereLbl.text = self.dataModel?.data?.business_sphere self.businessSphereLbl.text = self.dataModel?.data?.business_sphere
self.idCardImgV.kf.setImage(with: URL(string: SERVERCE_HOST + (self.dataModel?.data?.identity_card_front)!)) // self.idCardImgV.kf.setImage(with: URL(string: SERVERCE_HOST + (self.dataModel?.data?.identity_card_front)!))
}) { (error) in }) { (error) in
//缺省数据,隐藏滚动视图,展示错误视图 //缺省数据,隐藏滚动视图,展示错误视图
...@@ -51,12 +51,12 @@ class ShopInfoViewController: BaseViewController { ...@@ -51,12 +51,12 @@ class ShopInfoViewController: BaseViewController {
} }
@IBAction func previousAction(_ sender: UIButton) { @IBAction func previousAction(_ sender: UIButton) {
self.idCardImgV.kf.setImage(with: URL(string: SERVERCE_HOST + (self.dataModel?.data?.identity_card_front)!)) // self.idCardImgV.kf.setImage(with: URL(string: SERVERCE_HOST + (self.dataModel?.data?.identity_card_front)!))
rightChangeImgBtn.setImage(UIImage.init(named: "idCard2"), for: .normal) rightChangeImgBtn.setImage(UIImage.init(named: "idCard2"), for: .normal)
leftChangeImgBtn.setImage(UIImage.init(named: "idCard1"), for: .normal) leftChangeImgBtn.setImage(UIImage.init(named: "idCard1"), for: .normal)
} }
@IBAction func nextAction(_ sender: UIButton) { @IBAction func nextAction(_ sender: UIButton) {
self.idCardImgV.kf.setImage(with: URL(string: SERVERCE_HOST + (self.dataModel?.data?.identity_card_back)!)) // self.idCardImgV.kf.setImage(with: URL(string: SERVERCE_HOST + (self.dataModel?.data?.identity_card_back)!))
rightChangeImgBtn.setImage(UIImage.init(named: "idCard4"), for: .normal) rightChangeImgBtn.setImage(UIImage.init(named: "idCard4"), for: .normal)
leftChangeImgBtn.setImage(UIImage.init(named: "idCard3"), for: .normal) leftChangeImgBtn.setImage(UIImage.init(named: "idCard3"), for: .normal)
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import UIKit import UIKit
class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewDataSource { class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewDataSource ,WorkSelectTimeViewDelegate{
@IBOutlet weak var topNavBtn: UIButton! @IBOutlet weak var topNavBtn: UIButton!
@IBOutlet weak var contentView: UIView! @IBOutlet weak var contentView: UIView!
...@@ -16,10 +16,36 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD ...@@ -16,10 +16,36 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
super.viewDidLoad() super.viewDidLoad()
setTabv() setTabv()
} }
//MARK:--二维码方法
@IBAction func codeAction(_ sender: UIButton) {
print("二维码方法")
}
//MARK:--头部按钮方法 //MARK:--头部按钮方法
let selectV = WorkSelectTimeView()
var selelctIndex = 1001
@IBAction func topNavBtnAction(_ sender: UIButton) { @IBAction func topNavBtnAction(_ sender: UIButton) {
sender.isSelected = !sender.isSelected
if sender.isSelected {
selectV.delegate = self
selectV.selectIndex = selelctIndex
self.view.window?.addSubview(selectV)
selectV.snp.makeConstraints { (make) in
make.top.equalTo(contentView)
make.left.right.bottom.equalToSuperview()
}
topNavBtn.setImage(UIImage.init(named: "workzhankai"), for: .normal)
}else{
selectV.removeFromSuperview()
topNavBtn.setImage(UIImage.init(named: "workxiala"), for: .normal)
}
}
//MARK:--时间选择视图反馈
func selectWorkIndx(sender: Int) {
selelctIndex = sender;
topNavBtn.setImage(UIImage.init(named: "workxiala"), for: .normal)
topNavBtn.isSelected = false
} }
//MARK:--列表视图
var tableV :UITableView! var tableV :UITableView!
func setTabv() { func setTabv() {
......
...@@ -36,6 +36,9 @@ ...@@ -36,6 +36,9 @@
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YIb-m5-MdC"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YIb-m5-MdC">
<rect key="frame" x="343" y="11" width="17" height="22"/> <rect key="frame" x="343" y="11" width="17" height="22"/>
<state key="normal" image="workerweima"/> <state key="normal" image="workerweima"/>
<connections>
<action selector="codeAction:" destination="-1" eventType="touchUpInside" id="q4J-lo-HKl"/>
</connections>
</button> </button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ljz-8E-4Zf"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ljz-8E-4Zf">
<rect key="frame" x="0.0" y="44" width="375" height="623"/> <rect key="frame" x="0.0" y="44" width="375" height="623"/>
......
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