Commit c2505dca authored by lujunye's avatar lujunye

18

parent d6450157
...@@ -10,10 +10,19 @@ import UIKit ...@@ -10,10 +10,19 @@ import UIKit
class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDelegate,UITableViewDelegate,UITableViewDataSource,SY_GYS_GL_Cell_Delegate, GeliAlertViewDelegate{ class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDelegate,UITableViewDelegate,UITableViewDataSource,SY_GYS_GL_Cell_Delegate, GeliAlertViewDelegate{
func sureGeliAlertViewAction(sender: UIButton) { func sureGeliAlertViewAction(sender: UIButton) {
if view.tag == 165 {
delAgentContract(["user_token":UserToken as Any,"agent_id":sender.tag as Any]) { (data) in delAgentContract(["user_token":UserToken as Any,"agent_id":sender.tag as Any]) { (data) in
self.list_view.mj_header?.beginRefreshing() self.list_view.mj_header?.beginRefreshing()
} failture: { (err) in } failture: { (err) in
}
}else{
stopeSupAgeCon(["user_token":UserToken as Any,"sup_id":sender.tag as Any]) { (data) in
self.list_view.mj_header?.beginRefreshing()
} failture: { (err) in
}
} }
} }
...@@ -24,8 +33,13 @@ class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDeleg ...@@ -24,8 +33,13 @@ class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDeleg
alertView.tishiLbl.text = "" alertView.tishiLbl.text = ""
alertView.titileLbl.text = "是否确定终止合作?" alertView.titileLbl.text = "是否确定终止合作?"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "确定"), for: .normal) alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "确定"), for: .normal)
if view.tag == 165 {
let model = upAgentInfoList_Arr[cell.tag] let model = upAgentInfoList_Arr[cell.tag]
alertView.rightBtn.tag = model.sup_id! alertView.rightBtn.tag = model.sup_id!
}else{
let model = upstream_arr[cell.tag]
alertView.rightBtn.tag = model.sup_id!
}
self.view.window?.addSubview(alertView) self.view.window?.addSubview(alertView)
...@@ -45,12 +59,14 @@ class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDeleg ...@@ -45,12 +59,14 @@ class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDeleg
if self.view.tag == 165 { if self.view.tag == 165 {
return upAgentInfoList_Arr.count return upAgentInfoList_Arr.count
}else{ }else{
return 3 return upstream_arr.count
} }
} }
var upAgentInfoList_Arr:Array<upAgentInfoList_Data_model> = [] var upAgentInfoList_Arr:Array<upAgentInfoList_Data_model> = []
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "SY_GYS_GL_Cell") as! SY_GYS_GL_Cell let cell = tableView.dequeueReusableCell(withIdentifier: "SY_GYS_GL_Cell") as! SY_GYS_GL_Cell
cell.delegate = self
cell.tag = indexPath.row
if self.view.tag == 165 { if self.view.tag == 165 {
let model = upAgentInfoList_Arr[indexPath.row] let model = upAgentInfoList_Arr[indexPath.row]
cell.icon.sd_setImage(with:URL(string:SERVERCE_ImageHost + model.shop_img_thumb!), placeholderImage: nil,options:.allowInvalidSSLCertificates) cell.icon.sd_setImage(with:URL(string:SERVERCE_ImageHost + model.shop_img_thumb!), placeholderImage: nil,options:.allowInvalidSSLCertificates)
...@@ -58,10 +74,13 @@ class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDeleg ...@@ -58,10 +74,13 @@ class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDeleg
cell.adr.text = model.address cell.adr.text = model.address
cell.time.text = model.create_time cell.time.text = model.create_time
cell.status.text = model.status cell.status.text = model.status
cell.tag = indexPath.row
cell.delegate = self
}else{ }else{
let model = upstream_arr[indexPath.row]
cell.icon.sd_setImage(with:URL(string:SERVERCE_ImageHost + model.shop_img_thumb!), placeholderImage: nil,options:.allowInvalidSSLCertificates)
cell.name.text = model.shop_name
cell.adr.text = model.address
cell.time.text = model.start_time
cell.status.text = "合作中"
} }
return cell return cell
} }
...@@ -96,10 +115,15 @@ class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDeleg ...@@ -96,10 +115,15 @@ class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDeleg
headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData)) headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData))
list_view.mj_header = self.headerMJ list_view.mj_header = self.headerMJ
list_view.mj_header?.beginRefreshing() list_view.mj_header?.beginRefreshing()
if view.tag != 165 {
// footerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadMoreData)) footerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadMoreData))
// list_view.mj_footer = self.footerMJ list_view.mj_footer = self.footerMJ
} }
}
var page = 0
var upstream_arr:Array<upstreamSupList_Data_model> = []
@objc func loadData(){ @objc func loadData(){
print("加载数据") print("加载数据")
if self.view.tag == 165 { if self.view.tag == 165 {
...@@ -122,6 +146,25 @@ class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDeleg ...@@ -122,6 +146,25 @@ class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDeleg
} }
}else{ }else{
page = 1
let dic = ["user_token":UserToken as Any,"keyword":keyword as Any,"page":page as Any]
upstreamSupList(dic) {[self] (data) in
upstream_arr.removeAll()
let model = data as! upstreamSupList_model
model.data?.forEach({ (item) in
upstream_arr.append(item)
})
list_view.reloadData()
list_view.mj_header?.endRefreshing()
self.page = 2
if model.data?.count == 0 {
list_view?.mj_footer?.endRefreshingWithNoMoreData()
}else{
list_view.mj_footer?.endRefreshing()
}
} failture: { (err) in
}
} }
} }
...@@ -130,7 +173,22 @@ class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDeleg ...@@ -130,7 +173,22 @@ class SY_GYS_GL_VC: BaseViewController , UISearchBarDelegate, SearchBarViewDeleg
if self.view.tag == 165 { if self.view.tag == 165 {
}else{ }else{
let dic = ["user_token":UserToken as Any,"keyword":keyword as Any,"page":page as Any]
upstreamSupList(dic) {[self] (data) in
let model = data as! upstreamSupList_model
if model.data?.count == 0 {
list_view.mj_footer?.endRefreshingWithNoMoreData()
}else{
page += 1
model.data?.forEach({ (item) in
upstream_arr.append(item)
})
list_view.reloadData()
list_view.mj_footer?.endRefreshing()
}
} failture: {[self] (err) in
list_view.mj_footer?.endRefreshing()
}
} }
} }
......
...@@ -10,7 +10,7 @@ import UIKit ...@@ -10,7 +10,7 @@ import UIKit
import Parchment import Parchment
class GYS_FX_Product_ListVc: BaseViewController ,PagingViewControllerDelegate,UITableViewDelegate,UITableViewDataSource{ class GYS_FX_Product_ListVc: BaseViewController ,PagingViewControllerDelegate,UITableViewDelegate,UITableViewDataSource{
var vcType = 0
var titleStr = "" var titleStr = ""
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
...@@ -68,6 +68,10 @@ class GYS_FX_Product_ListVc: BaseViewController ,PagingViewControllerDelegate,UI ...@@ -68,6 +68,10 @@ class GYS_FX_Product_ListVc: BaseViewController ,PagingViewControllerDelegate,UI
self.view.addSubview(navbar) self.view.addSubview(navbar)
SetTopFrameView(view: contentV, btmView: self.view) SetTopFrameView(view: contentV, btmView: self.view)
viewControllers.forEach { (vc) in
vc.vcType = vcType
}
let pagingViewController = PagingViewController(viewControllers: viewControllers) let pagingViewController = PagingViewController(viewControllers: viewControllers)
pagingViewController.indicatorColor = UIColor.init(named: "蓝色字体颜色")! pagingViewController.indicatorColor = UIColor.init(named: "蓝色字体颜色")!
pagingViewController.menuItemSize = .fixed(width: 0, height: 44*glscale) pagingViewController.menuItemSize = .fixed(width: 0, height: 44*glscale)
......
...@@ -107,8 +107,6 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS ...@@ -107,8 +107,6 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
// var centersArr:Array<getDbtShopDataModel> = [] // var centersArr:Array<getDbtShopDataModel> = []
//MARK:--VC 初始化 //MARK:--VC 初始化
convenience init(title: String) { convenience init(title: String) {
self.init(title: title, content: "") self.init(title: title, content: "")
...@@ -126,9 +124,10 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS ...@@ -126,9 +124,10 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
var vcType = 0
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
let searchBr = SearchBarView.init() let searchBr = SearchBarView.init()
searchV = searchBr searchV = searchBr
self.contentV.addSubview(searchBr) self.contentV.addSubview(searchBr)
...@@ -231,13 +230,18 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS ...@@ -231,13 +230,18 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "GYS_FX_Product_VC_Cell") as! GYS_FX_Product_VC_Cell let cell = tableView.dequeueReusableCell(withIdentifier: "GYS_FX_Product_VC_Cell") as! GYS_FX_Product_VC_Cell
if vcType != 180 {
let model = datas[indexPath.row]
if self.title!.contains("已铺货") { if self.title!.contains("已铺货") {
// cell.submitBtn.setTitle("取消铺货", for: .normal) // cell.submitBtn.setTitle("取消铺货", for: .normal)
}else{ }else{
// cell.submitBtn.setTitle("铺货", for: .normal) // cell.submitBtn.setTitle("铺货", for: .normal)
} }
}
// cell.tag = indexPath.row // cell.tag = indexPath.row
// cell.delegate = self // cell.delegate = self
// let model = datas[indexPath.row] // let model = datas[indexPath.row]
...@@ -269,7 +273,7 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS ...@@ -269,7 +273,7 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
// cell.new_price_Lbl.text = "¥" + model.dbt_price! // cell.new_price_Lbl.text = "¥" + model.dbt_price!
// } // }
// cell.old_price_Lbl.text = model.price // cell.old_price_Lbl.text = model.price
// cell.item_Icon_Img.sd_setImage(with:URL(string:SERVERCE_ImageHost + model.goods_thumb!), placeholderImage: nil,options:.allowInvalidSSLCertificates) //
return cell return cell
} }
......
...@@ -101,7 +101,7 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi ...@@ -101,7 +101,7 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi
left_btn.isSelected = false left_btn.isSelected = false
right_btn.isSelected = true right_btn.isSelected = true
last_btn.isSelected = false last_btn.isSelected = false
role_type = 2 role_type = 4
self.bottom_line.snp.updateConstraints { (make) in self.bottom_line.snp.updateConstraints { (make) in
make.left.width.equalTo(ScreenWidth*0.33) make.left.width.equalTo(ScreenWidth*0.33)
make.height.equalTo(3) make.height.equalTo(3)
...@@ -111,7 +111,7 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi ...@@ -111,7 +111,7 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi
left_btn.isSelected = false left_btn.isSelected = false
right_btn.isSelected = false right_btn.isSelected = false
last_btn.isSelected = true last_btn.isSelected = true
// role_type = 2 role_type = 2
self.bottom_line.snp.updateConstraints { (make) in self.bottom_line.snp.updateConstraints { (make) in
make.left.equalTo(ScreenWidth*0.66) make.left.equalTo(ScreenWidth*0.66)
make.width.equalTo(ScreenWidth*0.33) make.width.equalTo(ScreenWidth*0.33)
......
...@@ -54,10 +54,10 @@ ...@@ -54,10 +54,10 @@
<rect key="frame" x="138" y="0.0" width="138" height="44"/> <rect key="frame" x="138" y="0.0" width="138" height="44"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="13"/> <fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="13"/>
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="分销商"> <state key="normal" title="代理商">
<color key="titleColor" name="多选按钮字体颜色"/> <color key="titleColor" name="多选按钮字体颜色"/>
</state> </state>
<state key="selected" title="分销商"> <state key="selected" title="代理商">
<color key="titleColor" name="按钮渐变色下,字体颜色"/> <color key="titleColor" name="按钮渐变色下,字体颜色"/>
</state> </state>
<connections> <connections>
......
...@@ -770,9 +770,9 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD ...@@ -770,9 +770,9 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
vc.titleStr = "下游店长管理" vc.titleStr = "下游店长管理"
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
return return
case 161://上游代理商商品 case 161://代理商商品管理
let vc = GYS_FX_Product_ListVc() let vc = GYS_FX_Product_ListVc()
vc.titleStr = "上游代理商商品" vc.titleStr = "代理商商品管理"
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
return return
case 162://代理订单管理 case 162://代理订单管理
...@@ -808,14 +808,14 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD ...@@ -808,14 +808,14 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
vc.titleStr = "店长订单管理" vc.titleStr = "店长订单管理"
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
return return
case 171://分销收益 case 179://上游供应商管理
HUD.flash(.label("敬请期待"),delay: 1.2) HUD.flash(.label("敬请期待"),delay: 1.2)
return return
case 179://分销收益 case 180://上游供应商商品
HUD.flash(.label("敬请期待"),delay: 1.2) let vc = GYS_FX_Product_ListVc()
return vc.titleStr = "上游供应商商品"
case 180://分销收益 vc.vcType = 180
HUD.flash(.label("敬请期待"),delay: 1.2) self.navigationController?.pushViewController(vc, animated: true)
return return
default: default:
break; break;
......
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