Commit fef7c1e8 authored by David黄金龙's avatar David黄金龙

Merge branch 'uat' into youhua-dev

* uat:
  灰度逻辑
  添加解析字段
  修改 一处备注
  完成 灰度功能开发
  test
  添加 获取规则方法
  uat接口调节完成
  订单搜索 uat
parents 4e97ee30 deae3ffa
......@@ -4074,7 +4074,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyTestEnv.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -4099,7 +4099,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.9.3;
MARKETING_VERSION = 0.9.4;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -4215,7 +4215,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -4240,7 +4240,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.9.3;
MARKETING_VERSION = 0.9.4;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -4419,7 +4419,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -4444,7 +4444,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.9.3;
MARKETING_VERSION = 0.9.4;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -4465,7 +4465,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -4490,7 +4490,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.9.3;
MARKETING_VERSION = 0.9.4;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......
......@@ -53,6 +53,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
printLog(string)
}
//灰度规则配置
YHUatHelper.shared.loadUatData()
// 一键登录
YHOneKeyLoginManager.shared.configOneKeyLogin()
......
......@@ -82,6 +82,8 @@ class YHHomeHoldViewPageViewController: YHBaseViewController {
needReloadDataFlag = false
homePageVC.requestOrder()
}
getUatRules()
}
override func viewWillDisappear(_ animated: Bool) {
......@@ -122,6 +124,14 @@ class YHHomeHoldViewPageViewController: YHBaseViewController {
//MARK: - 内部函数
extension YHHomeHoldViewPageViewController {
func getUatRules() {
DispatchQueue.global().async {
//灰度规则配置
YHUatHelper.shared.loadUatData()
}
}
@objc func clickMsgitem() {
needReloadDataFlag = true
}
......
......@@ -24,22 +24,26 @@ class YHOrderDetailViewController: YHBaseViewController {
viewModel.getWhitelist {[weak self] success, error in
guard let self = self else { return }
if success {
let searchButton = {
let button = UIButton(type: .custom)
button.frame = CGRect(x: 0, y: 0, width: 81, height: 21)
button.setImage(UIImage(named: "service_detail_search"), for: .normal)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setTitle("订单搜索", for: .normal)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.contentHorizontalAlignment = .right
button.addTarget(self, action: #selector(self.searchButtonClick), for: .touchUpInside)
button.isSelected = false
button.iconInLeft(spacing: 4)
return button
}()
let rightButtonItem = UIBarButtonItem(customView: searchButton)
gk_navRightBarButtonItem = rightButtonItem
gk_navItemRightSpace = 16
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 7)) {
let searchButton = {
let button = UIButton(type: .custom)
button.frame = CGRect(x: 0, y: 0, width: 81, height: 21)
button.setImage(UIImage(named: "service_detail_search"), for: .normal)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setTitle("订单搜索", for: .normal)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.contentHorizontalAlignment = .right
button.addTarget(self, action: #selector(self.searchButtonClick), for: .touchUpInside)
button.isSelected = false
button.iconInLeft(spacing: 4)
return button
}()
let rightButtonItem = UIBarButtonItem(customView: searchButton)
gk_navRightBarButtonItem = rightButtonItem
gk_navItemRightSpace = 16
}
}
}
}
......
......@@ -295,7 +295,7 @@ extension YHH5WebViewVC {
switch result {
case .success(let value):
self.saveImage(value.image)
case .failure(let value):
case .failure(_):
YHHUD.flash(message: "保存失败")
}
}
......
......@@ -158,6 +158,11 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
@objc func didLogoutBtnClicked() {
//灰度规则配置
YHUatHelper.shared.loadUatData()
YHCommonAlertView.show("", "您确定要退出登录吗?", "取消", "确定",fullGuestureEnable: false) {
} callBack: {
......
......@@ -76,18 +76,20 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
return imgView
}()
lazy var items: [PersonalModuleItem] = {
var arrData = [
PersonalModuleItem(icon: "mine_item_card", title: "我的名片".local, type:.myCard),
PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type:.myMessage),
PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local, type:.scoreCenter),
PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local, type:.myTestCode),
PersonalModuleItem(icon: "mine_item_appoint", title: "关于银河湾".local, type:.appointGalaxyBay),
PersonalModuleItem(icon: "mine_item_activity", title: "我的活动".local, type:.myActivity),
PersonalModuleItem(icon: "mine_item_about_us", title: "关于我们".local, type:. aboutUs)
]
return arrData
}()
// var items: [PersonalModuleItem] = {
// var arrData = [
// PersonalModuleItem(icon: "mine_item_card", title: "我的名片".local, type:.myCard),
// PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type:.myMessage),
// PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local, type:.scoreCenter),
// PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local, type:.myTestCode),
// PersonalModuleItem(icon: "mine_item_appoint", title: "关于银河湾".local, type:.appointGalaxyBay),
// PersonalModuleItem(icon: "mine_item_activity", title: "我的活动".local, type:.myActivity),
// PersonalModuleItem(icon: "mine_item_about_us", title: "关于我们".local, type:. aboutUs)
// ]
// return arrData
// }()
var items: [PersonalModuleItem] = []
lazy var headerView: YHUserInfoHeaderView = {
let view = YHUserInfoHeaderView.createView()
......@@ -151,10 +153,13 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
loadItems()
requestLikeCollectionCount()
getTotalUnreadMsgCount()
checkSettingRedPoint()
self.headerView.updateAvatar()
headerView.updateAvatar()
requstUserBasicInfo()
}
......@@ -253,6 +258,49 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
self.tableView .reloadData()
}
}
//uat 添加items
func loadItems() {
items.removeAll()
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 1)) {
let item = PersonalModuleItem(icon: "mine_item_card", title: "我的名片".local, type:.myCard)
items.append(item)
}
do {
let item = PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type:.myMessage)
items.append(item)
}
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 2)) {
let item = PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local, type:.scoreCenter)
items.append(item)
}
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 2)) {
let item = PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local, type:.myTestCode)
items.append(item)
}
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 4)) {
let item = PersonalModuleItem(icon: "mine_item_appoint", title: "关于银河湾".local, type:.appointGalaxyBay)
items.append(item)
}
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 5)) {
let item = PersonalModuleItem(icon: "mine_item_activity", title: "我的活动".local, type:.myActivity)
items.append(item)
}
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 5)) {
let item = PersonalModuleItem(icon: "mine_item_about_us", title: "关于我们".local, type:. aboutUs)
items.append(item)
}
tableView.reloadData()
}
}
extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
......
......@@ -8,6 +8,19 @@
import Foundation
extension Int {
//1-可见 2-不可见 3-新界面
var uatValue : Bool {
if self == 1 {
return true
} else if self == 2 {
return false
}
return false
}
}
enum YHUatModules: Int {
/*
默认展示
......@@ -21,10 +34,11 @@ enum YHUatModules: Int {
默认不展示
7、服务-订单搜索、false
8、更新-强制更新弹窗、false
8、更新-强制更新弹窗、true
9、更新-建议更新弹窗、false
*/
case Mine_Unknow = 0
case Mine_MyCard = 1 // 我的-我的名片
case Mine_IntegralCenter = 2 // 我的-积分中心
case Mine_EvaluationCode = 3 // 我的-我的测评码
......@@ -55,22 +69,25 @@ enum YHUatModules: Int {
return true
case .Service_OrderSearch:
return true
return false
case .Update_Fource:
return false
case .Update_Suggest:
return false
default:
return false
}
}
}
class YHUatHelper: NSObject {
static let shared = YHUatHelper()
private lazy var viewModel: YHUatHelperViewModel = {
let vm = YHUatHelperViewModel()
return vm
}()
}
// MARK: - 私有方法
......@@ -82,9 +99,43 @@ private extension YHUatHelper {
extension YHUatHelper {
//获取功能模块的展示状态
func getUatModuleStatusBy(module : YHUatModules) -> Bool {
func getUatModuleStatusBy(module : YHUatModules?) -> Bool {
guard let module = module else { return false }
//1.查找服务端返回的值
if let arr = viewModel.dataList?.list {
for (_,item) in arr.enumerated() {
if item.module_number.int == module.rawValue,item.result == 2 {
if let model = item.show_config {
return model.op.uatValue
}
return module.defaultValue
}
}
}
//2.返回默认值
return module.defaultValue
}
//加载服务器的uat配置
func loadUatData() {
return true
if !YHNetworkStatusManager.shared.isNetWorkOK {
printLog("网络不可用")
return
}
if !viewModel.isDataOk {
viewModel.getUatList { success, error in
if success {
} else {
}
}
}
}
}
......@@ -10,9 +10,31 @@ import Foundation
import HandyJSON
class YHUatModel2 : HandyJSON {
var op : Int = -1 //"op": 1, //1-可见 2-不可见
required init() {
}
}
class YHUatModel : HandyJSON {
/*
默认展示
1、我的-我的名片、 true
2、我的-积分中心、true
3、我的-我的测评码、true
4、我的-银河湾、true
5、我的-我的活动、true
6、我的-关于我们、true
默认不展示
7、服务-订单搜索、false
8、更新-强制更新弹窗、true
9、更新-建议更新弹窗、false
*/
var module_number : String = ""
var result : Int = 0 //命中结果 0-未找到该规则,走默认逻辑 1-未命中,2-命中
var show_config : YHUatModel2?
required init() {
}
......@@ -27,15 +49,25 @@ class YHUatListModel : HandyJSON {
class YHUatHelperViewModel : YHBaseViewModel {
var dataList : YHUatListModel?
var isDataOk : Bool = false
}
// MARK: - 共有方法
extension YHUatHelperViewModel {
//请求灰度功能列表配置
func getUatList(_ id: Int, callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Uat.uatListApi
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
func getUatList(callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let params: [String] = ["1", "2","3", "4","5","6", "7","9"]
var strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Uat.uatListApi
for (index,item) in params.enumerated() {
if index == 0 {
strUrl = strUrl + "?module_numbers=" + item
} else {
strUrl = strUrl + "&module_numbers=" + item
}
}
let _ = YHNetRequest.getRequest(url: strUrl) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
let dic = json.data
......@@ -43,10 +75,15 @@ extension YHUatHelperViewModel {
callBackBlock(false,nil)
return
}
self.isDataOk = true
self.dataList = resultModel
callBackBlock(true,nil)
} failBlock: { err in
self.isDataOk = false
callBackBlock(false,err)
}
}
......
......@@ -33,33 +33,39 @@ class YHAppVersionManager {
func needShowRedPointOfSuggestVersionUpdate() -> Bool {
var isShowRedPoint = false
// 判断版本更新逻辑
if let configModel = YHConfigManager.shared.reqVM.configModel, configModel.suggest_updating == true {
if configModel.max_version != UIDevice.appVersion() {
if let showDateString = UserDefaults.standard.object(forKey: kShowRedPointOfSuggestLatestVersionDate) as? String {
if !showDateString.isEmpty, showDateString != self.getCurrentDateSaveKey() { // 需要更新且今天没有展示过
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 9)) {
// 判断版本更新逻辑
if let configModel = YHConfigManager.shared.reqVM.configModel, configModel.suggest_updating == true {
if configModel.max_version != UIDevice.appVersion() {
if let showDateString = UserDefaults.standard.object(forKey: kShowRedPointOfSuggestLatestVersionDate) as? String {
if !showDateString.isEmpty, showDateString != self.getCurrentDateSaveKey() { // 需要更新且今天没有展示过
isShowRedPoint = true
}
} else { // 没有任何一天展示过所以本地没有保存日期数据
isShowRedPoint = true
}
} else { // 没有任何一天展示过所以本地没有保存日期数据
isShowRedPoint = true
}
}
}
return isShowRedPoint
}
// 是否需要显示建议版本更新弹窗
func needShowAlertViewOfSuggestVersionUpdate() -> Bool {
var isShow = false
if let configModel = YHConfigManager.shared.reqVM.configModel, configModel.suggest_updating == true {
if let alertLatestVersion = UserDefaults.standard.object(forKey: YhConstant.kShowAlertOfSuggestLatestVersion) as? String {
if !configModel.max_version.isEmpty, configModel.max_version != alertLatestVersion {
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 9)) {
if let configModel = YHConfigManager.shared.reqVM.configModel, configModel.suggest_updating == true {
if let alertLatestVersion = UserDefaults.standard.object(forKey: YhConstant.kShowAlertOfSuggestLatestVersion) as? String {
if !configModel.max_version.isEmpty, configModel.max_version != alertLatestVersion {
isShow = true
}
} else {
isShow = true
}
} else {
isShow = true
}
}
return isShow
......
......@@ -333,6 +333,7 @@ class YHNetRequest: NSObject {
#if DEBUG
printLog("服务器返回数据是:\(obj)")
#endif
if obj.code == YHErrorCode.forceUpdate.rawValue { // 强制版本升级
DispatchQueue.main.async {
YHAppVersionForceUpdateView.alertView().show()
......@@ -346,6 +347,7 @@ class YHNetRequest: NSObject {
return
}
if obj.code == YHErrorCode.tokenInvalidError.rawValue {
DispatchQueue.main.async {
YHLoginManager.shared.clearUserInfo()
......
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