Commit 8e769a0b authored by David黄金龙's avatar David黄金龙

同步dev

parent 1d79476f
......@@ -240,87 +240,90 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
return
let item: PersonalModuleItem = items[indexPath.row]
switch item.type {
case .myMessage://我的消息
printLog("我的消息")
goTabBarBy(tabType: .message)
case .scoreCenter:////积分中心
printLog("积分中心")
if let param = YHLoginManager.shared.userModel?.token,param.count>5 {
printLog(param)
var token : String = param
var url = YHBaseUrlManager.shared.curH5URL() + "superApp/integral"
let addtionString = randomAlphanumericString(6)//随机6个字母或者数字
let indexToInsert = token.index(token.startIndex, offsetBy: 6) //插入位置,这里以第六个字符后面为例
token.insert(contentsOf: addtionString, at: indexToInsert)
url = url + "?param=" + token
let vc = YHHomeWebViewController()
vc.vcTitle = "积分中心"
vc.url = url
self.navigationController?.pushViewController(vc)
}
case .myTestCode://我的测评码
printLog("我的测评码")
let vc = YHHomeWebViewController()
vc.vcTitle = "香港身份测评码"
vc.showSavePicBottomFlag = true
vc.url = "https://cdn-public.galaxy-immi.com/app/cepingma.png"
self.navigationController?.pushViewController(vc)
case .appointGalaxyBay://预约银河湾
printLog("预约银河湾")
let vc = YHHomeWebViewController()
vc.vcTitle = "预约银河湾"
vc.url = "https://upload.cdn.galaxy-immi.com/sell/product/images/page-1686138671996.png"
self.navigationController?.pushViewController(vc)
default:
printLog("不需要响应")
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 1.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
let item: PersonalModuleItem = items[indexPath.row]
switch item.type {
case .myMessage://我的消息
printLog("我的消息")
goTabBarBy(tabType: .message)
case .scoreCenter:////积分中心
printLog("积分中心")
if let param = YHLoginManager.shared.userModel?.token,param.count>5 {
printLog(param)
var token : String = param
var url = YHBaseUrlManager.shared.curH5URL() + "superApp/integral"
let addtionString = randomAlphanumericString(6)//随机6个字母或者数字
let indexToInsert = token.index(token.startIndex, offsetBy: 6) //插入位置,这里以第六个字符后面为例
token.insert(contentsOf: addtionString, at: indexToInsert)
url = url + "?param=" + token
let vc = YHHomeWebViewController()
vc.vcTitle = "积分中心"
vc.url = url
self.navigationController?.pushViewController(vc)
}
case .myTestCode://我的测评码
printLog("我的测评码")
let vc = YHHomeWebViewController()
vc.vcTitle = "香港身份测评码"
vc.showSavePicBottomFlag = true
vc.url = "https://cdn-public.galaxy-immi.com/app/cepingma.png"
self.navigationController?.pushViewController(vc)
case .appointGalaxyBay://预约银河湾
printLog("预约银河湾")
let vc = YHHomeWebViewController()
vc.vcTitle = "预约银河湾"
vc.url = "https://upload.cdn.galaxy-immi.com/sell/product/images/page-1686138671996.png"
self.navigationController?.pushViewController(vc)
default:
printLog("不需要响应")
}
}
extension YHMyViewController {
func randomAlphanumericString(_ length: Int) -> String {
let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
let randomString = (0..<length).map{ _ in String(letters.randomElement()!) }.reduce("", +)
return randomString
}
@objc func loginSuccess() {
printLog("登录成功,进行相应的 UI刷新操作")
updateUserUI()
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 1.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
@objc func logoutSuccess() {
updateUserUI()
}
return UIView()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
func updateUserUI() {
if YHLoginManager.shared.isLogin() {
headerView.nickName = YHLoginManager.shared.userModel?.nickname ?? "Hi, 银河用户".local
} else {
headerView.nickName = "登录/注册"
}
return UIView()
}
}
extension YHMyViewController {
func randomAlphanumericString(_ length: Int) -> String {
let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
let randomString = (0..<length).map{ _ in String(letters.randomElement()!) }.reduce("", +)
return randomString
}
@objc func loginSuccess() {
printLog("登录成功,进行相应的 UI刷新操作")
updateUserUI()
}
@objc func logoutSuccess() {
updateUserUI()
}
func updateUserUI() {
if YHLoginManager.shared.isLogin() {
headerView.nickName = YHLoginManager.shared.userModel?.nickname ?? "Hi, 银河用户".local
} else {
headerView.nickName = "登录/注册"
}
}
}
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