Commit b1e798bc authored by lujunye's avatar lujunye

阿萨德法师法师打算复读

parent 3fcb1bbd
...@@ -625,8 +625,9 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD ...@@ -625,8 +625,9 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
return return
case 134: //分销商管理 case 134: //分销商管理
// HUD.flash(.label("敬请期待"),delay: 1.2) // HUD.flash(.label("敬请期待"),delay: 1.2)
let vc = GYS_HZ_Vc() // let vc = GYS_HZ_Vc()
vc.title_str = "分销商管理" // vc.title_str = "分销商管理"
let vc = DZGL_VC()
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
return return
case 133: //供应商管理 case 133: //供应商管理
......
...@@ -8,12 +8,20 @@ ...@@ -8,12 +8,20 @@
import UIKit import UIKit
class DZSHViewController: BaseViewController, UITableViewDelegate, UITableViewDataSource { class DZSHViewController: BaseViewController, UITableViewDelegate, UITableViewDataSource, DZSH_Detail_ViewController_Delegate {
func DZSH_Detail_ViewController_refresh() {
listView.mj_header?.beginRefreshing()
}
//MARK: - 跳转详情 //MARK: - 跳转详情
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let model = dataArr[indexPath.row] let model = dataArr[indexPath.row]
let vc = DZSH_Detail_ViewController() let vc = DZSH_Detail_ViewController()
vc.delegate = self
vc.title_str = "信息审核" vc.title_str = "信息审核"
vc.type = type!
vc.action = model.vendor_audit_status!
vc.shop_id = model.shop_id! vc.shop_id = model.shop_id!
vc.user_token = UserToken as! String vc.user_token = UserToken as! String
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
......
...@@ -14,7 +14,11 @@ ...@@ -14,7 +14,11 @@
<connections> <connections>
<outlet property="btm_action_bg" destination="CZj-xH-82j" id="M7S-ek-C6P"/> <outlet property="btm_action_bg" destination="CZj-xH-82j" id="M7S-ek-C6P"/>
<outlet property="btm_action_view" destination="ZZe-yd-lSO" id="F5v-Ri-4nr"/> <outlet property="btm_action_view" destination="ZZe-yd-lSO" id="F5v-Ri-4nr"/>
<outlet property="btm_h" destination="pdL-Mg-Muo" id="ppn-pA-twG"/>
<outlet property="btm_title_lbl" destination="sCd-fT-s0A" id="4Fv-qe-RVU"/>
<outlet property="lbl_top" destination="C3P-7Y-z6s" id="O0t-TV-Fo6"/>
<outlet property="list_view" destination="kaX-Nj-dzM" id="YBY-Lo-0Y8"/> <outlet property="list_view" destination="kaX-Nj-dzM" id="YBY-Lo-0Y8"/>
<outlet property="save_btn" destination="tlo-ih-Itu" id="9nu-TH-5R8"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections> </connections>
</placeholder> </placeholder>
...@@ -51,7 +55,7 @@ ...@@ -51,7 +55,7 @@
<rect key="frame" x="0.0" y="813" width="414" height="83"/> <rect key="frame" x="0.0" y="813" width="414" height="83"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="确认修改" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sCd-fT-s0A"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="保存" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sCd-fT-s0A">
<rect key="frame" x="0.0" y="813" width="414" height="49"/> <rect key="frame" x="0.0" y="813" width="414" height="49"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="49" id="pdL-Mg-Muo"/> <constraint firstAttribute="height" constant="49" id="pdL-Mg-Muo"/>
...@@ -138,7 +142,7 @@ ...@@ -138,7 +142,7 @@
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="tlo-ih-Itu" firstAttribute="top" secondItem="sCd-fT-s0A" secondAttribute="top" id="5xQ-JM-oQa"/> <constraint firstItem="tlo-ih-Itu" firstAttribute="top" secondItem="sCd-fT-s0A" secondAttribute="top" id="5xQ-JM-oQa"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="sCd-fT-s0A" secondAttribute="bottom" id="C3P-7Y-z6s"/> <constraint firstAttribute="bottom" secondItem="sCd-fT-s0A" secondAttribute="bottom" constant="34" id="C3P-7Y-z6s"/>
<constraint firstAttribute="bottom" secondItem="CZj-xH-82j" secondAttribute="bottom" id="EZ2-fG-iuy"/> <constraint firstAttribute="bottom" secondItem="CZj-xH-82j" secondAttribute="bottom" id="EZ2-fG-iuy"/>
<constraint firstAttribute="bottom" secondItem="tlo-ih-Itu" secondAttribute="bottom" id="GCx-fS-5co"/> <constraint firstAttribute="bottom" secondItem="tlo-ih-Itu" secondAttribute="bottom" id="GCx-fS-5co"/>
<constraint firstItem="tlo-ih-Itu" firstAttribute="top" secondItem="ZZe-yd-lSO" secondAttribute="top" id="HK2-48-cv4"/> <constraint firstItem="tlo-ih-Itu" firstAttribute="top" secondItem="ZZe-yd-lSO" secondAttribute="top" id="HK2-48-cv4"/>
......
...@@ -34,7 +34,7 @@ class OnlyTimeSelectView: UIView,UIPickerViewDelegate,UIPickerViewDataSource { ...@@ -34,7 +34,7 @@ class OnlyTimeSelectView: UIView,UIPickerViewDelegate,UIPickerViewDataSource {
var titleStr = "" { var titleStr = "" {
didSet{ didSet{
let arr = titleStr.components(separatedBy: "~") let arr = titleStr.components(separatedBy: "-")
let startArr = arr.first?.components(separatedBy: ":") as! Array<NSString> let startArr = arr.first?.components(separatedBy: ":") as! Array<NSString>
start_hour = startArr.first!.integerValue start_hour = startArr.first!.integerValue
start_min = startArr.last!.integerValue start_min = startArr.last!.integerValue
......
...@@ -105,8 +105,8 @@ ...@@ -105,8 +105,8 @@
<color key="textColor" name="个人中心灰色字体"/> <color key="textColor" name="个人中心灰色字体"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="254-Ff-3p7"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="合作中" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="254-Ff-3p7">
<rect key="frame" x="80" y="98.5" width="33" height="19"/> <rect key="frame" x="80" y="98.5" width="39" height="19"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/> <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="个人中心灰色字体"/> <color key="textColor" name="个人中心灰色字体"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
......
...@@ -8,13 +8,70 @@ ...@@ -8,13 +8,70 @@
import UIKit import UIKit
class DZGL_VC: BaseViewController, UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate, SearchBarViewDelegate ,DZGL_Cell_Delegate{ class DZGL_VC: BaseViewController, UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate, SearchBarViewDelegate ,DZGL_Cell_Delegate,GeliAlertViewDelegate,DZSH_Detail_ViewController_Delegate {
func DZSH_Detail_ViewController_refresh() {
tableView.mj_header?.beginRefreshing()
}
func rightBtnClick() {
print("新增店铺")//GLAlertTbAddView
loadCenterData()
}
var centers:Array<getAllShopDataModel> = []
func loadCenterData(){
HUD.flash(.progress)
if centers.count == 0 {
getAllShop(["user_token":UserToken as Any]) { (data) in
let model = data as! getAllShopModel
model.data?.forEach({ (item) in
self.centers.append(item)
})
let alertView = GLAlertTbAddView(frame: self.view.bounds)
alertView.bottom_tableview.isHidden = true
alertView.centers = self.centers
alertView.is_gys = false
self.view.addSubview(alertView)
HUD.hide()
} failture: { (err) in
}
}else{
let alertView = GLAlertTbAddView(frame: self.view.bounds)
alertView.bottom_tableview.isHidden = true
alertView.centers = self.centers
alertView.is_gys = false
self.view.addSubview(alertView)
}
}
func sureGeliAlertViewAction(sender: UIButton) {
let model = dbt_datas[sender.tag]
stopContract(["user_token":UserToken as Any,"dbt_id":model.dbt_id]) { (data) in
HUD.flash(.label("删除成功~"), delay: 1.2)
self.tableView.mj_header?.beginRefreshing()
} failture: { (err) in}
}
func DZGL_Cell_Del_Action(cell: DZGL_Cell) { func DZGL_Cell_Del_Action(cell: DZGL_Cell) {
print("Del",cell.tag) let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.delegate = self;
alertView.tishiLbl.text = ""
let model = dbt_datas[cell.tag]
alertView.titileLbl.text = "确定删除 ‘\(model.shop_name!)’?"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "确定"), for: .normal)
alertView.rightBtn.tag = cell.tag
self.view.window?.addSubview(alertView)
} }
func DZGL_Cell_Edit_Action(cell: DZGL_Cell) { func DZGL_Cell_Edit_Action(cell: DZGL_Cell) {
print("Edit",cell.tag) let model = dbt_datas[cell.tag]
let vc = DZSH_Detail_ViewController()
vc.delegate = self
vc.title_str = "店铺信息"
vc.shop_id = model.dbt_id!
vc.user_token = UserToken as! String
self.navigationController?.pushViewController(vc, animated: true)
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
...@@ -26,12 +83,18 @@ class DZGL_VC: BaseViewController, UITableViewDelegate, UITableViewDataSource, U ...@@ -26,12 +83,18 @@ class DZGL_VC: BaseViewController, UITableViewDelegate, UITableViewDataSource, U
@IBOutlet weak var cover_btn: UIButton! @IBOutlet weak var cover_btn: UIButton!
@IBOutlet weak var select_list: UITableView! @IBOutlet weak var select_list: UITableView!
var dbt_datas:Array<dbtListDataModel> = []
@IBAction func close_action(_ sender: UIButton) { @IBAction func close_action(_ sender: UIButton) {
cover_btn.isHidden = true cover_btn.isHidden = true
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView.tag == 2 {
return 3 return 3
} }
return dbt_datas.count
}
var select_num = 0 var select_num = 0
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if tableView.tag == 2 { if tableView.tag == 2 {
...@@ -39,7 +102,7 @@ class DZGL_VC: BaseViewController, UITableViewDelegate, UITableViewDataSource, U ...@@ -39,7 +102,7 @@ class DZGL_VC: BaseViewController, UITableViewDelegate, UITableViewDataSource, U
select_list.isHidden = true select_list.isHidden = true
cover_btn.isHidden = true cover_btn.isHidden = true
type_lbl.text = type_arr[select_num] type_lbl.text = type_arr[select_num]
// self.tableView.mj_header?.beginRefreshing() self.tableView.mj_header?.beginRefreshing()
} }
} }
...@@ -53,11 +116,25 @@ class DZGL_VC: BaseViewController, UITableViewDelegate, UITableViewDataSource, U ...@@ -53,11 +116,25 @@ class DZGL_VC: BaseViewController, UITableViewDelegate, UITableViewDataSource, U
cell?.textLabel?.font = UIFont.systemFont(ofSize:13) cell?.textLabel?.font = UIFont.systemFont(ofSize:13)
} }
cell?.textLabel?.text = type_arr[indexPath.row] cell?.textLabel?.text = type_arr[indexPath.row]
cell?.textLabel?.textColor = UIColor.black
return cell! return cell!
} }
let cell = tableView.dequeueReusableCell(withIdentifier: "DZGL_Cell") as! DZGL_Cell let cell = tableView.dequeueReusableCell(withIdentifier: "DZGL_Cell") as! DZGL_Cell
cell.delegate = self cell.delegate = self
cell.tag = indexPath.row cell.tag = indexPath.row
let model = dbt_datas[indexPath.row]
cell.name_lbl.text = model.shop_name
cell.img_view.sd_setImage(with:URL(string:SERVERCE_ImageHost + model.shop_img_thumb!))
cell.adr_lbl.text = model.address
cell.time_lbl.text = model.create_time
var status = "一对多"
cell.del_Btn.isHidden = false
if model.is_shopowner == 1 {
status = "一对一"
cell.del_Btn.isHidden = true
}
cell.relation_lbl.text = status
return cell return cell
} }
...@@ -149,21 +226,74 @@ class DZGL_VC: BaseViewController, UITableViewDelegate, UITableViewDataSource, U ...@@ -149,21 +226,74 @@ class DZGL_VC: BaseViewController, UITableViewDelegate, UITableViewDataSource, U
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData)) headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData))
tableView.mj_header = self.headerMJ tableView.mj_header = self.headerMJ
// tableView.mj_header?.beginRefreshing() tableView.mj_header?.beginRefreshing()
self.footerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadMoreData)) self.footerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadMoreData))
tableView.mj_footer = self.footerMJ tableView.mj_footer = self.footerMJ
tableView.register(UINib(nibName: "DZGL_Cell", bundle: nil), forCellReuseIdentifier: "DZGL_Cell") tableView.register(UINib(nibName: "DZGL_Cell", bundle: nil), forCellReuseIdentifier: "DZGL_Cell")
NotificationCenter.default.addObserver(self, selector: #selector(getNoti(noti:)), name: NSNotification.Name(rawValue: "haveAdd"), object: nil)
} }
deinit {
/// 移除通知
NotificationCenter.default.removeObserver(self)
}
@objc func getNoti(noti:Notification){
tableView.mj_header?.beginRefreshing()
}
var is_shopowner = 100
@objc func loadData(){ @objc func loadData(){
switch select_num {
case 0:
is_shopowner = 100
break
case 1:
is_shopowner = 1
break
default:
is_shopowner = 0
break
}
page = 1 page = 1
isUpData = true isUpData = true
dbtList(["page":page as Any,"user_token":UserToken as Any,"is_shopowner":is_shopowner as Any,"keyword":keyword as Any]) { (data) in
self.dbt_datas.removeAll()
let model = data as! dbtListModel
model.data?.forEach({ (item) in
self.dbt_datas.append(item)
})
self.tableView.reloadData()
self.tableView?.mj_header?.endRefreshing()
if model.data?.count == 0 {
self.tableView?.mj_footer?.endRefreshingWithNoMoreData()
}else{
self.tableView?.mj_footer?.endRefreshing()
}
self.page = 2
} failture: { (err) in
self.tableView?.mj_header?.endRefreshing()
}
} }
@objc func loadMoreData(){ @objc func loadMoreData(){
dbtList(["page":page as Any,"user_token":UserToken as Any,"is_shopowner":is_shopowner as Any,"keyword":keyword as Any]){ (data) in
let dataM = data as! dbtListModel
if dataM.data?.count == 0 {
self.tableView.mj_footer?.endRefreshingWithNoMoreData()
}else{
self.page += 1
dataM.data?.forEach({ (model) in
self.dbt_datas.append(model)
})
self.tableView.reloadData()
self.tableView.mj_footer?.endRefreshing()
}
} failture: { (error) in
self.tableView.mj_footer?.endRefreshing()
} }
}
} }
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