|
@@ -11,6 +11,7 @@ import UIKit
|
|
class DealView: BaseView {
|
|
class DealView: BaseView {
|
|
|
|
|
|
var VM: DealViewModel?
|
|
var VM: DealViewModel?
|
|
|
|
+ var dateStr:(String,String) = ("","")
|
|
|
|
|
|
lazy var navView:DealNavView = {
|
|
lazy var navView:DealNavView = {
|
|
let view = DealNavView()
|
|
let view = DealNavView()
|
|
@@ -101,6 +102,7 @@ class DealView: BaseView {
|
|
lazy var sectionView:DealSectionView = {
|
|
lazy var sectionView:DealSectionView = {
|
|
let view = DealSectionView.init(frame: CGRectMake(0, 0, SCREEN_WIDTH, 100))
|
|
let view = DealSectionView.init(frame: CGRectMake(0, 0, SCREEN_WIDTH, 100))
|
|
view.clickSelectBlock = {[weak self] index in
|
|
view.clickSelectBlock = {[weak self] index in
|
|
|
|
+ self?.reloadTable()
|
|
guard OperationalUserInfoData.getLogin() else {
|
|
guard OperationalUserInfoData.getLogin() else {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -114,6 +116,48 @@ class DealView: BaseView {
|
|
self?.VM?.netGetCloseOrderList()
|
|
self?.VM?.netGetCloseOrderList()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ view.timerControl.indexChangeBlock = {[weak self](index) in
|
|
|
|
+ guard let self = self else{return}
|
|
|
|
+ if index == 0 {
|
|
|
|
+ self.VM?.startDate = dateToString(stmap: decimalNumber(A:currentTimeStamp(), B: "86400", type: .Subtract) , formatter: "yyyy-MM-dd")
|
|
|
|
+ }
|
|
|
|
+ else if index == 1{
|
|
|
|
+ self.VM?.startDate = dateToString(stmap: decimalNumber(A:currentTimeStamp(), B: "604800", type: .Subtract) , formatter: "yyyy-MM-dd")
|
|
|
|
+ }
|
|
|
|
+ else if index == 2{
|
|
|
|
+ self.VM?.startDate = dateToString(stmap: decimalNumber(A:currentTimeStamp(), B: "2592000", type: .Subtract) , formatter: "yyyy-MM-dd")
|
|
|
|
+ }else if index == 3{
|
|
|
|
+ let pop = PositionHistoryDatePopView()
|
|
|
|
+ if self.dateStr.0.length == 0 {
|
|
|
|
+ self.dateStr.0 = dateToString(stmap:currentTimeStamp(),formatter: "yyyy-MM-dd")
|
|
|
|
+ self.dateStr.1 = dateToString(stmap:currentTimeStamp(),formatter: "yyyy-MM-dd")
|
|
|
|
+ }
|
|
|
|
+ pop.showPopupView(date: self.dateStr) { dateStr in
|
|
|
|
+ self.dateStr = dateStr
|
|
|
|
+ self.VM?.endDate = dateStr.1
|
|
|
|
+ self.VM?.startDate = dateStr.0
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ view.timerControl.indexClickBlock = {[weak self](index) in
|
|
|
|
+ guard let self = self else{return}
|
|
|
|
+ if index == 3{
|
|
|
|
+ let pop = PositionHistoryDatePopView()
|
|
|
|
+ if self.dateStr.0.length == 0 {
|
|
|
|
+ self.dateStr.0 = dateToString(stmap:currentTimeStamp(),formatter: "yyyy-MM-dd")
|
|
|
|
+ self.dateStr.1 = dateToString(stmap:currentTimeStamp(),formatter: "yyyy-MM-dd")
|
|
|
|
+ }
|
|
|
|
+ pop.showPopupView(date: self.dateStr) { dateStr in
|
|
|
|
+ self.dateStr = dateStr
|
|
|
|
+ self.VM?.endDate = dateStr.1
|
|
|
|
+ self.VM?.startDate = dateStr.0
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return view
|
|
return view
|
|
}()
|
|
}()
|
|
|
|
|
|
@@ -439,63 +483,15 @@ extension DealView {
|
|
func showPopupMenu() -> Void {
|
|
func showPopupMenu() -> Void {
|
|
let pop = KMenuPopupMenuView()
|
|
let pop = KMenuPopupMenuView()
|
|
var list:[(UIImage,String,Bool)] = [(UIImage,String,Bool)]()
|
|
var list:[(UIImage,String,Bool)] = [(UIImage,String,Bool)]()
|
|
- if self.VM!.selectSymbolModel.isCollection {
|
|
|
|
- list = [
|
|
|
|
- (_image("Deal_W_Transfer&Deal_W_Transfer"),switchLanguage("资金划转"),true),
|
|
|
|
- (_image("Deal_W_FC&Deal_W_FC"),switchLanguage("法币存款"),true),
|
|
|
|
- (_image("Deal_W_Deposit&Deal_W_Deposit"),switchLanguage("充币"),true),
|
|
|
|
- (_image("Deal_W_Finance&Deal_W_Finance"),switchLanguage("资金明细"),true),
|
|
|
|
- (_image("Deal_W_Account&Deal_W_Account"),switchLanguage("模拟账户"),true),
|
|
|
|
- (_image("Deal_W_Collection&Deal_W_Collection"),switchLanguage("取消自选"),true),
|
|
|
|
- ]
|
|
|
|
- }else{
|
|
|
|
- list = [
|
|
|
|
- (_image("Deal_W_Transfer&Deal_W_Transfer"),switchLanguage("资金划转"),true),
|
|
|
|
- (_image("Deal_W_FC&Deal_W_FC"),switchLanguage("法币存款"),true),
|
|
|
|
- (_image("Deal_W_Deposit&Deal_W_Deposit"),switchLanguage("充币"),true),
|
|
|
|
- (_image("Deal_W_Finance&Deal_W_Finance"),switchLanguage("资金明细"),true),
|
|
|
|
- (_image("Deal_W_Account&Deal_W_Account"),switchLanguage("模拟账户"),true),
|
|
|
|
- (_image("Deal_W_Collection&Deal_W_Collection"),switchLanguage("添加自选"),true),
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ list = [
|
|
|
|
+ (_image("Deal_W_Lock&Deal_W_Lock"),switchLanguage("锁定交易"),true),
|
|
|
|
+ (_image("Deal_W_Set&Deal_W_Set"),switchLanguage("下单设置"),true),
|
|
|
|
+ (_image("Deal_W_Market&Deal_W_Market"),switchLanguage("我的行情"),true),
|
|
|
|
+ (_image("Deal_W_Help&Deal_W_Help"),switchLanguage("帮助中心"),true)
|
|
|
|
+ ]
|
|
pop.showRelyPopupView(view: self.navView.menuBtn, source: list ,topB: -15,leftB: 80) {[weak self] index in
|
|
pop.showRelyPopupView(view: self.navView.menuBtn, source: list ,topB: -15,leftB: 80) {[weak self] index in
|
|
- guard OperationalUserInfoData.getLogin() else {
|
|
|
|
- currentVc()!.navigationController?.pushViewController(LoginViewController(), animated: true)
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if index == 0{
|
|
|
|
- let vc = ASelsectCurrencyViewController()
|
|
|
|
- vc.type = .Transfer
|
|
|
|
- currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
|
- }
|
|
|
|
- else if index == 1{
|
|
|
|
- let vc = AFiatDepositsViewController()
|
|
|
|
- currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
|
- }
|
|
|
|
- else if index == 2{
|
|
|
|
-
|
|
|
|
- let vc = ASelsectCurrencyViewController()
|
|
|
|
- vc.type = .Deposit
|
|
|
|
- currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
|
- }
|
|
|
|
- else if index == 3{
|
|
|
|
-
|
|
|
|
- let vc = AssetsHistoryViewController()
|
|
|
|
- vc.updateIndex(index: 0)
|
|
|
|
- currentVc()!.navigationController?.pushViewController(vc, animated: true)
|
|
|
|
- }
|
|
|
|
- else if index == 4{
|
|
|
|
- AssetsIndex = 2
|
|
|
|
- currentVc()?.tabBarController?.selectedIndex = TabbarAssetsIndex
|
|
|
|
- }
|
|
|
|
- else if index == 5{
|
|
|
|
-// if self!.VM!.selectSymbolModel.isCollection {
|
|
|
|
-// self?.VM?.netDeleteProductUser(symbol: (self?.VM?.selectSymbolModel.symbol)!)
|
|
|
|
-// }else{
|
|
|
|
-// self?.VM?.netInsertProductUser(symbol: (self?.VM?.selectSymbolModel.symbol)!)
|
|
|
|
-// }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -687,10 +683,16 @@ extension DealView:UITableViewDelegate,UITableViewDataSource{
|
|
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
|
|
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
|
|
if self.VM!.isChangeServer(){
|
|
if self.VM!.isChangeServer(){
|
|
if section == 1 {
|
|
if section == 1 {
|
|
|
|
+ if self.sectionView.segmentedControl.selectedSegmentIndex == 2{
|
|
|
|
+ return 80
|
|
|
|
+ }
|
|
return 40
|
|
return 40
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
if section == 2 {
|
|
if section == 2 {
|
|
|
|
+ if self.sectionView.segmentedControl.selectedSegmentIndex == 2{
|
|
|
|
+ return 80
|
|
|
|
+ }
|
|
return 40
|
|
return 40
|
|
}
|
|
}
|
|
}
|
|
}
|