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

// 我的课程

parent 1334471c
...@@ -24,8 +24,10 @@ class YHUserMemberInfoModel: SmartCodable { ...@@ -24,8 +24,10 @@ class YHUserMemberInfoModel: SmartCodable {
var current_level: Int = 0 var current_level: Int = 0
var growth_value: Int = 0 var growth_value: Int = 0
var max_growth: Int = 0 var max_growth: Int = 0
var has_education_video_permission: Bool = false
required init() { required init() {
} }
func getVipMemberLevel() -> YHUserVipLevel { func getVipMemberLevel() -> YHUserVipLevel {
......
...@@ -260,6 +260,11 @@ class YHMyNewViewController: YHBaseViewController { ...@@ -260,6 +260,11 @@ class YHMyNewViewController: YHBaseViewController {
serviceGroupArr.append(item) serviceGroupArr.append(item)
} }
if self.loginViewModel.memberInfo.has_education_video_permission {
let item = PersonalModuleItem(icon: "mine_item_video", title: "我的课程".local, type: .myCourseVideo)
serviceGroupArr.append(item)
}
// 其他功能 // 其他功能
do { do {
let item = PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type: .myMessage) let item = PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type: .myMessage)
...@@ -414,6 +419,8 @@ extension YHMyNewViewController { ...@@ -414,6 +419,8 @@ extension YHMyNewViewController {
let memberInfo = self.loginViewModel.memberInfo let memberInfo = self.loginViewModel.memberInfo
self.userInfoView.vipLevel = memberInfo.getVipMemberLevel() self.userInfoView.vipLevel = memberInfo.getVipMemberLevel()
self.vipInfoView.update(growValue: memberInfo.growth_value, vipLevel: memberInfo.getVipMemberLevel()) self.vipInfoView.update(growValue: memberInfo.growth_value, vipLevel: memberInfo.getVipMemberLevel())
self.loadItems()
} }
} else { } else {
self.userInfoView.vipLevel = .none self.userInfoView.vipLevel = .none
...@@ -713,9 +720,47 @@ extension YHMyNewViewController { ...@@ -713,9 +720,47 @@ extension YHMyNewViewController {
UIViewController.current?.tabBarController?.selectedIndex = 1 UIViewController.current?.tabBarController?.selectedIndex = 1
case .inviteFriends: case .inviteFriends:
inviteFriends() inviteFriends()
case .myCourseVideo:
if let token = YHLoginManager.shared.userModel?.token, token.count > 5 {
var url = self.getMyCourseVideoUrl()
url = url + "?param=" + YHLoginManager.shared.h5Token
printLog("URL: \(url)")
var tUrl = url
if !url.contains("navigationH=") {
tUrl = url + "?navigationH=\(k_Height_NavigationtBarAndStatuBar)"
if url.contains("?") {
tUrl = url + "&navigationH=\(k_Height_NavigationtBarAndStatuBar)"
}
}
if !url.contains("statusBarH=") {
tUrl = url + "?statusBarH=\(k_Height_StatusBar)"
if url.contains("?") {
tUrl = url + "&statusBarH=\(k_Height_StatusBar)"
}
}
let vc = YHH5WebViewVC()
vc.url = tUrl
vc.isFullScreenFlag = false
vc.navTitle = "我的课程"
vc.isSupportWebviewInterBackFlag = true
UIViewController.current?.navigationController?.pushViewController(vc)
}
default: default:
printLog("不需要响应") printLog("不需要响应")
} }
} }
func getMyCourseVideoUrl() -> String {
#if DEBUG
return "https://test-supporth5.galaxy-immi.com/articleDetail.html#/video-list"
#elseif TESTENV
return "https://test-supporth5.galaxy-immi.com/articleDetail.html#/video-list"
#elseif UATENV
return "https://test-supporth5.galaxy-immi.com/articleDetail.html#/video-list"
#else
return "https://supporth5.galaxy-immi.com/articleDetail.html#/video-list"
#endif
}
} }
...@@ -22,6 +22,7 @@ enum YHPersonalModuleItemType: Int { ...@@ -22,6 +22,7 @@ enum YHPersonalModuleItemType: Int {
case myTestCode case myTestCode
case appointGalaxyBay case appointGalaxyBay
case exchangeHistory case exchangeHistory
case myCourseVideo
case notifySettings case notifySettings
case permissionSettings case permissionSettings
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon_我的课程@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon_我的课程@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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