|
@@ -11,7 +11,7 @@ import UIKit
|
|
|
class JDMineViewController: BaseViewController {
|
|
|
lazy var headerView: JDMineHeaderView = {
|
|
|
let v = JDMineHeaderView(frame: CGRectMake(0, 0, SCREEN_WIDTH, 100))
|
|
|
-
|
|
|
+
|
|
|
return v
|
|
|
}()
|
|
|
|
|
@@ -51,7 +51,7 @@ class JDMineViewController: BaseViewController {
|
|
|
super.viewWillAppear(animated)
|
|
|
|
|
|
netForGetAccouontInfo()
|
|
|
-
|
|
|
+
|
|
|
tableView.reloadData()
|
|
|
}
|
|
|
|
|
@@ -65,24 +65,16 @@ class JDMineViewController: BaseViewController {
|
|
|
make.height.equalTo(NavigationViewHeight+StatusBarHeight)
|
|
|
}
|
|
|
|
|
|
-// self.myNavigationBar.title_Label.text = switchLanguage("我的")
|
|
|
-// self.myNavigationBar.right_SuperView.isHidden = false
|
|
|
-// self.myNavigationBar.right_Button.setImage(_image("Infomation_chat&Infomation_chat"), for: .normal)
|
|
|
-// self.myNavigationBar.right_Button.addTarget(self, action: #selector(clickRightBtnAction), for: .touchUpInside)
|
|
|
-
|
|
|
view.addSubview(tableView)
|
|
|
tableView.snp.makeConstraints { make in
|
|
|
make.left.right.bottom.equalTo(self.view)
|
|
|
-// make.top.equalTo(self.myNavigationBar.snp.bottom)
|
|
|
make.top.equalTo(navView.snp.bottom)
|
|
|
-// make.top.equalTo(self.view.snp.top).offset(-StatusBarHeight)
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@objc func clickRightBtnAction() {
|
|
|
-// let vc = JDMessageViewController()
|
|
|
-//
|
|
|
-// self.navigationController?.pushViewController(vc, animated: true)
|
|
|
+
|
|
|
let vc = JDSystemNotificationViewController()
|
|
|
vc.myNavigationBar.title_Label.text = switchLanguage("个人消息")
|
|
|
vc.viewModel.category = ""
|
|
@@ -126,13 +118,7 @@ extension JDMineViewController: UITableViewDataSource {
|
|
|
|
|
|
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
|
|
if section == 0 {
|
|
|
-// let on = SaveData.shared().getCryptoOnOff()
|
|
|
-//
|
|
|
-// if on {
|
|
|
-// return 1
|
|
|
-// } else {
|
|
|
- return 0
|
|
|
-// }
|
|
|
+ return 0
|
|
|
} else if section == 1 {
|
|
|
return 1
|
|
|
} else {
|
|
@@ -154,9 +140,8 @@ extension JDMineViewController: UITableViewDataSource {
|
|
|
guard OperationalUserInfoData.getLogin() else {
|
|
|
return UITableViewCell()
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
let cell = tableView.dequeueReusableCell(withIdentifier: JDMineNewInviteCell.description()) as! JDMineNewInviteCell
|
|
|
-// cell.codeLb.text = OperationalUserInfoData.getUserInfoDataModel().code
|
|
|
cell.setCode()
|
|
|
|
|
|
return cell
|
|
@@ -168,16 +153,11 @@ extension JDMineViewController: UITableViewDataSource {
|
|
|
cell.subTitleLb.text = subTitleAry[indexPath.section][indexPath.row]
|
|
|
cell.iconIv.image = UIImage(named: iconAry[indexPath.section][indexPath.row])
|
|
|
|
|
|
-// if indexPath.row == 0 && indexPath.section == 2{
|
|
|
-// cell.youliIcon.isHidden = false
|
|
|
-//
|
|
|
-// }else {
|
|
|
cell.youliIcon.isHidden = true
|
|
|
-
|
|
|
-// }
|
|
|
+
|
|
|
|
|
|
if indexPath.section == 2 {
|
|
|
- if /* indexPath.row == 2 || */ indexPath.row == 0 {
|
|
|
+ if indexPath.row == 0 {
|
|
|
if OperationalUserInfoData.getLogin() {
|
|
|
cell.line.isHidden = true
|
|
|
} else {
|
|
@@ -224,7 +204,7 @@ extension JDMineViewController: UITableViewDataSource {
|
|
|
|
|
|
extension JDMineViewController: UITableViewDelegate {
|
|
|
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
|
|
|
- if section == 0 /* || section == 1 */ {
|
|
|
+ if section == 0 {
|
|
|
return UIView()
|
|
|
} else if section == 2 {
|
|
|
let v = UIView(frame: CGRectMake(0, 0, SCREEN_WIDTH, 9))
|
|
@@ -234,9 +214,9 @@ extension JDMineViewController: UITableViewDelegate {
|
|
|
|
|
|
return UIView()
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
|
|
|
- if section == 0 /* || section == 1 */ {
|
|
|
+ if section == 0 {
|
|
|
return 0.00001
|
|
|
} else if section == 2 {
|
|
|
return 6
|
|
@@ -271,9 +251,9 @@ extension JDMineViewController: UITableViewDelegate {
|
|
|
currentVc()?.navigationController?.pushViewController(JDLoginViewController(), animated: true)
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if indexPath.row == 0 {
|
|
|
- // let vc = JDMineVIPViewController()
|
|
|
+
|
|
|
let vc = JDMineNewVipViewController()
|
|
|
|
|
|
currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
@@ -286,69 +266,54 @@ extension JDMineViewController: UITableViewDelegate {
|
|
|
currentVc()?.navigationController?.pushViewController(JDLoginViewController(), animated: true)
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if indexPath.row == 0 {
|
|
|
let vc = BaseWebViewController()
|
|
|
vc.needHiddenWebNav = false
|
|
|
|
|
|
switch GlobalSingle.sharedInstance.currentLan {
|
|
|
- case .EnglishLanguage:
|
|
|
- vc.url = JoinENUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
|
|
|
- case .TraditionalLanguage:
|
|
|
- vc.url = JoinTWUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
|
|
|
- case .ChineseLanguage:
|
|
|
- vc.url = JoinUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
|
|
|
- default:
|
|
|
- vc.url = JoinENUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
|
|
|
+ case .EnglishLanguage:
|
|
|
+ vc.url = JoinENUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
|
|
|
+ case .TraditionalLanguage:
|
|
|
+ vc.url = JoinTWUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
|
|
|
+ case .ChineseLanguage:
|
|
|
+ vc.url = JoinUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
|
|
|
+ default:
|
|
|
+ vc.url = JoinENUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
|
|
|
}
|
|
|
|
|
|
vc.myNavigationBar.title_Label.text = switchLanguage("合伙人计划")
|
|
|
currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
} else if indexPath.row == 1 {
|
|
|
-// let vc = JDMineJoinUsViewController()
|
|
|
-//
|
|
|
-// currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
-
|
|
|
-// let vc = JDMineInviteViewController()
|
|
|
-//
|
|
|
-// currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
-
|
|
|
return
|
|
|
} else if indexPath.row == 2 {
|
|
|
let vc = JDMineCouponManagerViewController()
|
|
|
currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
} else if indexPath.row == 3 {
|
|
|
let vc = BaseWebViewController()
|
|
|
-
|
|
|
+
|
|
|
var url = ACTIVITYCENTER+"?tab=1"
|
|
|
|
|
|
switch GlobalSingle.sharedInstance.currentLan {
|
|
|
- case .EnglishLanguage:
|
|
|
- url = ACTIVITYCENTER+"?tab=1&language=en"
|
|
|
- case .TraditionalLanguage:
|
|
|
- url = ACTIVITYCENTER+"?tab=1&language=zh-TW"
|
|
|
- case .ChineseLanguage:
|
|
|
- url = ACTIVITYCENTER+"?tab=1&language=zh-CN"
|
|
|
- default:
|
|
|
- url = ACTIVITYCENTER+"?tab=1&language=en"
|
|
|
+ case .EnglishLanguage:
|
|
|
+ url = ACTIVITYCENTER+"?tab=1&language=en"
|
|
|
+ case .TraditionalLanguage:
|
|
|
+ url = ACTIVITYCENTER+"?tab=1&language=zh-TW"
|
|
|
+ case .ChineseLanguage:
|
|
|
+ url = ACTIVITYCENTER+"?tab=1&language=zh-CN"
|
|
|
+ default:
|
|
|
+ url = ACTIVITYCENTER+"?tab=1&language=en"
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
vc.url = url
|
|
|
vc.myNavigationBar.title_Label.text = switchLanguage("活动中心")
|
|
|
|
|
|
-// vc.myNavigationBar.right_SuperView.isHidden = false
|
|
|
-// vc.myNavigationBar.right_Button.setTitle(switchLanguage("往期")+" ", for: .normal)
|
|
|
-// vc.myNavigationBar.right_Button.setTitleColor(_color("#0F6EFF�F6EFF"), for: .normal)
|
|
|
-// vc.myNavigationBar.right_Button.setTextFont(.PFSM, 15)
|
|
|
-// vc.myNavigationBar.right_Button.addTarget(self, action: #selector(activityBtnAction), for: .touchUpInside)
|
|
|
-
|
|
|
let navBtn: UIButton = {
|
|
|
let v = UIButton(type: .custom)
|
|
|
v.setTitle(switchLanguage("往期活动"), for: .normal)
|
|
|
-
|
|
|
+
|
|
|
v.setTextFont(.PFSM, 15)
|
|
|
v.setTitleColor(.black, for: .normal)
|
|
|
- // v.layoutButtonEdgeInsetStyle(type: .left, space: 2)
|
|
|
v.addTarget(self, action: #selector(activityBtnAction), for: .touchUpInside)
|
|
|
return v
|
|
|
}()
|
|
@@ -360,27 +325,25 @@ extension JDMineViewController: UITableViewDelegate {
|
|
|
}
|
|
|
currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
|
|
|
-// let vc = JDMineActiveViewController()
|
|
|
-// currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
}
|
|
|
|
|
|
} else if indexPath.section == 3 {
|
|
|
if indexPath.row == 0 {
|
|
|
let vc = BaseWebViewController()
|
|
|
-
|
|
|
+
|
|
|
var url = HELPCENTER
|
|
|
|
|
|
switch GlobalSingle.sharedInstance.currentLan {
|
|
|
- case .EnglishLanguage:
|
|
|
- url = HELPCENTER+"/?language=en"
|
|
|
- case .TraditionalLanguage:
|
|
|
- url = HELPCENTER+"/?language=zh-TW"
|
|
|
- case .ChineseLanguage:
|
|
|
- url = HELPCENTER+"/?language=zh-CN"
|
|
|
- default:
|
|
|
- url = HELPCENTER
|
|
|
+ case .EnglishLanguage:
|
|
|
+ url = HELPCENTER+"/?language=en"
|
|
|
+ case .TraditionalLanguage:
|
|
|
+ url = HELPCENTER+"/?language=zh-TW"
|
|
|
+ case .ChineseLanguage:
|
|
|
+ url = HELPCENTER+"/?language=zh-CN"
|
|
|
+ default:
|
|
|
+ url = HELPCENTER
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
vc.url = url
|
|
|
|
|
|
vc.myNavigationBar.title_Label.text = switchLanguage("帮助中心")
|
|
@@ -391,11 +354,8 @@ extension JDMineViewController: UITableViewDelegate {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// let vc = JDMineServiceViewController()
|
|
|
-// currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
-
|
|
|
let vc = BaseWebViewController()
|
|
|
-
|
|
|
+
|
|
|
vc.needHiddenWebNav = false
|
|
|
vc.url = getCustomerUrl()
|
|
|
vc.myNavigationBar.title_Label.text = switchLanguage("在线客服")
|
|
@@ -450,21 +410,20 @@ extension JDMineViewController: UITableViewDelegate {
|
|
|
|
|
|
@objc func activityBtnAction() {
|
|
|
let vc = BaseWebViewController()
|
|
|
-
|
|
|
- // vc.url = "https://news.jdnx.com/activity.html?tab=2"
|
|
|
+
|
|
|
var url = ACTIVITYCENTER+"?tab=2"
|
|
|
-
|
|
|
+
|
|
|
switch GlobalSingle.sharedInstance.currentLan {
|
|
|
- case .EnglishLanguage:
|
|
|
- url = ACTIVITYCENTER+"?tab=2&language=en"
|
|
|
- case .TraditionalLanguage:
|
|
|
- url = ACTIVITYCENTER+"?tab=2&language=zh-TW"
|
|
|
- case .ChineseLanguage:
|
|
|
- url = ACTIVITYCENTER+"?tab=2&language=zh-CN"
|
|
|
- default:
|
|
|
- url = ACTIVITYCENTER+"?tab=2"
|
|
|
+ case .EnglishLanguage:
|
|
|
+ url = ACTIVITYCENTER+"?tab=2&language=en"
|
|
|
+ case .TraditionalLanguage:
|
|
|
+ url = ACTIVITYCENTER+"?tab=2&language=zh-TW"
|
|
|
+ case .ChineseLanguage:
|
|
|
+ url = ACTIVITYCENTER+"?tab=2&language=zh-CN"
|
|
|
+ default:
|
|
|
+ url = ACTIVITYCENTER+"?tab=2"
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
vc.url = url
|
|
|
vc.myNavigationBar.title_Label.text = switchLanguage("往期活动")
|
|
|
|
|
@@ -485,7 +444,7 @@ extension JDMineViewController: UITableViewDelegate {
|
|
|
]
|
|
|
|
|
|
NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: jd_netForUpdateUserLanguage, parameters: param) { _, _ in
|
|
|
-
|
|
|
+
|
|
|
} failured: { _, _ in
|
|
|
}
|
|
|
}
|