Commit ed595ecb authored by Steven杜宇's avatar Steven杜宇

// 我的tab

parent 8b9bacfb
......@@ -37,11 +37,11 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
}()
lazy var items: [PersonalModuleItem] = {
return [PersonalModuleItem(title: "调整颜色".local.local),
PersonalModuleItem(title: "深色模式".local),
PersonalModuleItem(title: "个人信息收集清单".local),
PersonalModuleItem(title: "第三方信息共享清单".local),
PersonalModuleItem(title: "关于我们".local)]
return [PersonalModuleItem(title: "调整设置".local, type:.changeSettings),
PersonalModuleItem(title: "深色模式".local, type:.darkMode),
PersonalModuleItem(title: "个人信息收集清单".local, type:.infoCollectList),
PersonalModuleItem(title: "第三方信息共享清单".local, type:.infoShareList),
PersonalModuleItem(title: "关于我们".local, type:.aboutUs)]
}()
override func viewDidLoad() {
......@@ -72,6 +72,7 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
@objc func logout() {
YHLoginManager.shared.clearUserInfo()
NotificationCenter.default.post(name: YhConstant.YhNotification.didLoginoutSuccessNotifiction, object: nil)
YHHUD.flash(message: "退出成功")
self.navigationController?.popViewController(animated: true)
}
}
......@@ -96,7 +97,11 @@ extension YHMySettingViewController : UITableViewDelegate, UITableViewDataSource
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if (indexPath.row >= items.count) { return }
let item = items[indexPath.row]
if item.type == .aboutUs {
let vc = YHAboutUsViewController()
self.navigationController?.pushViewController(vc)
}
}
}
......@@ -9,12 +9,32 @@ import UIKit
import SnapKit
import NEConversationUIKit
enum YHPersonalModuleItemType: Int {
case none = 0
case myMessage
case myProgress
case scoreCenter
case recommend
case myPoster
case myTestCode
case appointGalaxyBay
case changeSettings
case darkMode
case infoCollectList
case infoShareList
case aboutUs
}
struct PersonalModuleItem {
var icon: String?
var title: String
init(icon: String? = nil, title: String) {
var type:YHPersonalModuleItemType = .none
init(icon: String? = nil, title: String, type:YHPersonalModuleItemType) {
self.icon = icon
self.title = title
self.type = type
}
}
......@@ -25,6 +45,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.tableHeaderView = headerView
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
......@@ -35,13 +56,14 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
}()
lazy var items: [PersonalModuleItem] = {
return [PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local),
PersonalModuleItem(icon: "mine_item_progress", title: "我的进度".local),
PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local),
PersonalModuleItem(icon: "mine_item_recommend", title: "推荐有礼".local),
PersonalModuleItem(icon: "mine_item_poster", title: "我的海报".local),
PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local),
PersonalModuleItem(icon: "mine_item_appoint", title: "预约银河湾".local),]
return [PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type:.myMessage),
PersonalModuleItem(icon: "mine_item_progress", title: "我的进度".local, type:.myProgress),
PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local, type:.scoreCenter),
PersonalModuleItem(icon: "mine_item_recommend", title: "推荐有礼".local, type:.recommend),
PersonalModuleItem(icon: "mine_item_poster", title: "我的海报".local, type:.myPoster),
PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local, type:.myTestCode),
PersonalModuleItem(icon: "mine_item_appoint", title: "预约银河湾".local, type:.appointGalaxyBay),
]
}()
lazy var headerView: YHUserInfoHeaderView = {
......
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