Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
fef7c1e8
Commit
fef7c1e8
authored
Aug 02, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uat' into youhua-dev
* uat: 灰度逻辑 添加解析字段 修改 一处备注 完成 灰度功能开发 test 添加 获取规则方法 uat接口调节完成 订单搜索 uat
parents
4e97ee30
deae3ffa
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
231 additions
and
64 deletions
+231
-64
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+8
-8
AppDelegate.swift
galaxy/galaxy/AppDelegate.swift
+4
-0
YHHomeHoldViewPageViewController.swift
...Modules/Home(首页)/C/YHHomeHoldViewPageViewController.swift
+10
-0
YHOrderDetailViewController.swift
...elligentService(服务中心)/C/YHOrderDetailViewController.swift
+20
-16
YHH5WebViewVC.swift
.../Classes/Modules/InteractionH5(与H5交互)/YHH5WebViewVC.swift
+1
-1
YHMySettingViewController.swift
...lasses/Modules/Mine(我的)/C/YHMySettingViewController.swift
+5
-0
YHMyViewController.swift
...alaxy/Classes/Modules/Mine(我的)/C/YHMyViewController.swift
+61
-13
YHUatHelper.swift
.../galaxy/Classes/Modules/UatModule(灰度功能)/YHUatHelper.swift
+59
-8
YHUatHelperViewModel.swift
...lasses/Modules/UatModule(灰度功能)/YHUatHelperViewModel.swift
+41
-4
YHAppVersionManager.swift
...s/Modules/VersionUpload(版本更新)/M/YHAppVersionManager.swift
+20
-14
YHNetRequest.swift
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
+2
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
fef7c1e8
...
@@ -4074,7 +4074,7 @@
...
@@ -4074,7 +4074,7 @@
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxyTestEnv.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxyTestEnv.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
4
;
CURRENT_PROJECT_VERSION
=
1
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
FRAMEWORK_SEARCH_PATHS
=
(
...
@@ -4099,7 +4099,7 @@
...
@@ -4099,7 +4099,7 @@
"$(inherited)"
,
"$(inherited)"
,
"@executable_path/Frameworks"
,
"@executable_path/Frameworks"
,
);
);
MARKETING_VERSION
=
0.9.
3
;
MARKETING_VERSION
=
0.9.
4
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.intelligence.galaxy
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.intelligence.galaxy
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
...
@@ -4215,7 +4215,7 @@
...
@@ -4215,7 +4215,7 @@
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxy.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxy.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
4
;
CURRENT_PROJECT_VERSION
=
1
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
FRAMEWORK_SEARCH_PATHS
=
(
...
@@ -4240,7 +4240,7 @@
...
@@ -4240,7 +4240,7 @@
"$(inherited)"
,
"$(inherited)"
,
"@executable_path/Frameworks"
,
"@executable_path/Frameworks"
,
);
);
MARKETING_VERSION
=
0.9.
3
;
MARKETING_VERSION
=
0.9.
4
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.intelligence.galaxy
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.intelligence.galaxy
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
...
@@ -4419,7 +4419,7 @@
...
@@ -4419,7 +4419,7 @@
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxyDebug.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxyDebug.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
4
;
CURRENT_PROJECT_VERSION
=
1
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
FRAMEWORK_SEARCH_PATHS
=
(
...
@@ -4444,7 +4444,7 @@
...
@@ -4444,7 +4444,7 @@
"$(inherited)"
,
"$(inherited)"
,
"@executable_path/Frameworks"
,
"@executable_path/Frameworks"
,
);
);
MARKETING_VERSION
=
0.9.
3
;
MARKETING_VERSION
=
0.9.
4
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.intelligence.galaxy
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.intelligence.galaxy
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
...
@@ -4465,7 +4465,7 @@
...
@@ -4465,7 +4465,7 @@
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxy.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
galaxy/galaxy.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
4
;
CURRENT_PROJECT_VERSION
=
1
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
DEVELOPMENT_TEAM
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
FRAMEWORK_SEARCH_PATHS
=
(
...
@@ -4490,7 +4490,7 @@
...
@@ -4490,7 +4490,7 @@
"$(inherited)"
,
"$(inherited)"
,
"@executable_path/Frameworks"
,
"@executable_path/Frameworks"
,
);
);
MARKETING_VERSION
=
0.9.
3
;
MARKETING_VERSION
=
0.9.
4
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.intelligence.galaxy
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.intelligence.galaxy
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
...
...
galaxy/galaxy/AppDelegate.swift
View file @
fef7c1e8
...
@@ -53,6 +53,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
...
@@ -53,6 +53,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
printLog
(
string
)
printLog
(
string
)
}
}
//灰度规则配置
YHUatHelper
.
shared
.
loadUatData
()
// 一键登录
// 一键登录
YHOneKeyLoginManager
.
shared
.
configOneKeyLogin
()
YHOneKeyLoginManager
.
shared
.
configOneKeyLogin
()
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeHoldViewPageViewController.swift
View file @
fef7c1e8
...
@@ -82,6 +82,8 @@ class YHHomeHoldViewPageViewController: YHBaseViewController {
...
@@ -82,6 +82,8 @@ class YHHomeHoldViewPageViewController: YHBaseViewController {
needReloadDataFlag
=
false
needReloadDataFlag
=
false
homePageVC
.
requestOrder
()
homePageVC
.
requestOrder
()
}
}
getUatRules
()
}
}
override
func
viewWillDisappear
(
_
animated
:
Bool
)
{
override
func
viewWillDisappear
(
_
animated
:
Bool
)
{
...
@@ -122,6 +124,14 @@ class YHHomeHoldViewPageViewController: YHBaseViewController {
...
@@ -122,6 +124,14 @@ class YHHomeHoldViewPageViewController: YHBaseViewController {
//MARK: - 内部函数
//MARK: - 内部函数
extension
YHHomeHoldViewPageViewController
{
extension
YHHomeHoldViewPageViewController
{
func
getUatRules
()
{
DispatchQueue
.
global
()
.
async
{
//灰度规则配置
YHUatHelper
.
shared
.
loadUatData
()
}
}
@objc
func
clickMsgitem
()
{
@objc
func
clickMsgitem
()
{
needReloadDataFlag
=
true
needReloadDataFlag
=
true
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/C/YHOrderDetailViewController.swift
View file @
fef7c1e8
...
@@ -24,22 +24,26 @@ class YHOrderDetailViewController: YHBaseViewController {
...
@@ -24,22 +24,26 @@ class YHOrderDetailViewController: YHBaseViewController {
viewModel
.
getWhitelist
{[
weak
self
]
success
,
error
in
viewModel
.
getWhitelist
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
if
success
{
if
success
{
let
searchButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
if
YHUatHelper
.
shared
.
getUatModuleStatusBy
(
module
:
YHUatModules
(
rawValue
:
7
))
{
button
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
81
,
height
:
21
)
let
searchButton
=
{
button
.
setImage
(
UIImage
(
named
:
"service_detail_search"
),
for
:
.
normal
)
let
button
=
UIButton
(
type
:
.
custom
)
button
.
setTitleColor
(
UIColor
.
mainTextColor
,
for
:
.
normal
)
button
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
81
,
height
:
21
)
button
.
setTitle
(
"订单搜索"
,
for
:
.
normal
)
button
.
setImage
(
UIImage
(
named
:
"service_detail_search"
),
for
:
.
normal
)
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
button
.
setTitleColor
(
UIColor
.
mainTextColor
,
for
:
.
normal
)
button
.
contentHorizontalAlignment
=
.
right
button
.
setTitle
(
"订单搜索"
,
for
:
.
normal
)
button
.
addTarget
(
self
,
action
:
#selector(
self.searchButtonClick
)
,
for
:
.
touchUpInside
)
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
button
.
isSelected
=
false
button
.
contentHorizontalAlignment
=
.
right
button
.
iconInLeft
(
spacing
:
4
)
button
.
addTarget
(
self
,
action
:
#selector(
self.searchButtonClick
)
,
for
:
.
touchUpInside
)
return
button
button
.
isSelected
=
false
}()
button
.
iconInLeft
(
spacing
:
4
)
let
rightButtonItem
=
UIBarButtonItem
(
customView
:
searchButton
)
return
button
gk_navRightBarButtonItem
=
rightButtonItem
}()
gk_navItemRightSpace
=
16
let
rightButtonItem
=
UIBarButtonItem
(
customView
:
searchButton
)
gk_navRightBarButtonItem
=
rightButtonItem
gk_navItemRightSpace
=
16
}
}
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/InteractionH5(与H5交互)/YHH5WebViewVC.swift
View file @
fef7c1e8
...
@@ -295,7 +295,7 @@ extension YHH5WebViewVC {
...
@@ -295,7 +295,7 @@ extension YHH5WebViewVC {
switch
result
{
switch
result
{
case
.
success
(
let
value
):
case
.
success
(
let
value
):
self
.
saveImage
(
value
.
image
)
self
.
saveImage
(
value
.
image
)
case
.
failure
(
let
value
):
case
.
failure
(
_
):
YHHUD
.
flash
(
message
:
"保存失败"
)
YHHUD
.
flash
(
message
:
"保存失败"
)
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMySettingViewController.swift
View file @
fef7c1e8
...
@@ -158,6 +158,11 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
...
@@ -158,6 +158,11 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
@objc
func
didLogoutBtnClicked
()
{
@objc
func
didLogoutBtnClicked
()
{
//灰度规则配置
YHUatHelper
.
shared
.
loadUatData
()
YHCommonAlertView
.
show
(
""
,
"您确定要退出登录吗?"
,
"取消"
,
"确定"
,
fullGuestureEnable
:
false
)
{
YHCommonAlertView
.
show
(
""
,
"您确定要退出登录吗?"
,
"取消"
,
"确定"
,
fullGuestureEnable
:
false
)
{
}
callBack
:
{
}
callBack
:
{
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyViewController.swift
View file @
fef7c1e8
...
@@ -76,18 +76,20 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
...
@@ -76,18 +76,20 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
return
imgView
return
imgView
}()
}()
lazy
var
items
:
[
PersonalModuleItem
]
=
{
// var items: [PersonalModuleItem] = {
var
arrData
=
[
// var arrData = [
PersonalModuleItem
(
icon
:
"mine_item_card"
,
title
:
"我的名片"
.
local
,
type
:
.
myCard
),
// PersonalModuleItem(icon: "mine_item_card", title: "我的名片".local, type:.myCard),
PersonalModuleItem
(
icon
:
"mine_item_msg"
,
title
:
"我的消息"
.
local
,
type
:
.
myMessage
),
// PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type:.myMessage),
PersonalModuleItem
(
icon
:
"mine_item_scoreCenter"
,
title
:
"积分中心"
.
local
,
type
:
.
scoreCenter
),
// PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local, type:.scoreCenter),
PersonalModuleItem
(
icon
:
"mine_item_code"
,
title
:
"我的测评码"
.
local
,
type
:
.
myTestCode
),
// PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local, type:.myTestCode),
PersonalModuleItem
(
icon
:
"mine_item_appoint"
,
title
:
"关于银河湾"
.
local
,
type
:
.
appointGalaxyBay
),
// PersonalModuleItem(icon: "mine_item_appoint", title: "关于银河湾".local, type:.appointGalaxyBay),
PersonalModuleItem
(
icon
:
"mine_item_activity"
,
title
:
"我的活动"
.
local
,
type
:
.
myActivity
),
// PersonalModuleItem(icon: "mine_item_activity", title: "我的活动".local, type:.myActivity),
PersonalModuleItem
(
icon
:
"mine_item_about_us"
,
title
:
"关于我们"
.
local
,
type
:
.
aboutUs
)
// PersonalModuleItem(icon: "mine_item_about_us", title: "关于我们".local, type:. aboutUs)
]
// ]
return
arrData
// return arrData
}()
// }()
var
items
:
[
PersonalModuleItem
]
=
[]
lazy
var
headerView
:
YHUserInfoHeaderView
=
{
lazy
var
headerView
:
YHUserInfoHeaderView
=
{
let
view
=
YHUserInfoHeaderView
.
createView
()
let
view
=
YHUserInfoHeaderView
.
createView
()
...
@@ -151,10 +153,13 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
...
@@ -151,10 +153,13 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
super
.
viewWillAppear
(
animated
)
loadItems
()
requestLikeCollectionCount
()
requestLikeCollectionCount
()
getTotalUnreadMsgCount
()
getTotalUnreadMsgCount
()
checkSettingRedPoint
()
checkSettingRedPoint
()
self
.
headerView
.
updateAvatar
()
headerView
.
updateAvatar
()
requstUserBasicInfo
()
requstUserBasicInfo
()
}
}
...
@@ -253,6 +258,49 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
...
@@ -253,6 +258,49 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
self
.
tableView
.
reloadData
()
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
{
extension
YHMyViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
...
...
galaxy/galaxy/Classes/Modules/UatModule(灰度功能)/YHUatHelper.swift
View file @
fef7c1e8
...
@@ -8,6 +8,19 @@
...
@@ -8,6 +8,19 @@
import
Foundation
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
{
enum
YHUatModules
:
Int
{
/*
/*
默认展示
默认展示
...
@@ -21,10 +34,11 @@ enum YHUatModules: Int {
...
@@ -21,10 +34,11 @@ enum YHUatModules: Int {
默认不展示
默认不展示
7、服务-订单搜索、false
7、服务-订单搜索、false
8、更新-强制更新弹窗、
fals
e
8、更新-强制更新弹窗、
tru
e
9、更新-建议更新弹窗、false
9、更新-建议更新弹窗、false
*/
*/
case
Mine_Unknow
=
0
case
Mine_MyCard
=
1
// 我的-我的名片
case
Mine_MyCard
=
1
// 我的-我的名片
case
Mine_IntegralCenter
=
2
// 我的-积分中心
case
Mine_IntegralCenter
=
2
// 我的-积分中心
case
Mine_EvaluationCode
=
3
// 我的-我的测评码
case
Mine_EvaluationCode
=
3
// 我的-我的测评码
...
@@ -55,22 +69,25 @@ enum YHUatModules: Int {
...
@@ -55,22 +69,25 @@ enum YHUatModules: Int {
return
true
return
true
case
.
Service_OrderSearch
:
case
.
Service_OrderSearch
:
return
true
return
false
case
.
Update_Fource
:
case
.
Update_Fource
:
return
false
return
false
case
.
Update_Suggest
:
case
.
Update_Suggest
:
return
false
return
false
default
:
return
false
}
}
}
}
}
}
class
YHUatHelper
:
NSObject
{
class
YHUatHelper
:
NSObject
{
static
let
shared
=
YHUatHelper
()
static
let
shared
=
YHUatHelper
()
private
lazy
var
viewModel
:
YHUatHelperViewModel
=
{
let
vm
=
YHUatHelperViewModel
()
return
vm
}()
}
}
// MARK: - 私有方法
// MARK: - 私有方法
...
@@ -82,9 +99,43 @@ private extension YHUatHelper {
...
@@ -82,9 +99,43 @@ private extension YHUatHelper {
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
{
}
}
}
}
}
}
}
galaxy/galaxy/Classes/Modules/UatModule(灰度功能)/YHUatHelperViewModel.swift
View file @
fef7c1e8
...
@@ -10,9 +10,31 @@ import Foundation
...
@@ -10,9 +10,31 @@ import Foundation
import
HandyJSON
import
HandyJSON
class
YHUatModel2
:
HandyJSON
{
var
op
:
Int
=
-
1
//"op": 1, //1-可见 2-不可见
required
init
()
{
}
}
class
YHUatModel
:
HandyJSON
{
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
module_number
:
String
=
""
var
result
:
Int
=
0
//命中结果 0-未找到该规则,走默认逻辑 1-未命中,2-命中
var
result
:
Int
=
0
//命中结果 0-未找到该规则,走默认逻辑 1-未命中,2-命中
var
show_config
:
YHUatModel2
?
required
init
()
{
required
init
()
{
}
}
...
@@ -27,15 +49,25 @@ class YHUatListModel : HandyJSON {
...
@@ -27,15 +49,25 @@ class YHUatListModel : HandyJSON {
class
YHUatHelperViewModel
:
YHBaseViewModel
{
class
YHUatHelperViewModel
:
YHBaseViewModel
{
var
dataList
:
YHUatListModel
?
var
dataList
:
YHUatListModel
?
var
isDataOk
:
Bool
=
false
}
}
// MARK: - 共有方法
// MARK: - 共有方法
extension
YHUatHelperViewModel
{
extension
YHUatHelperViewModel
{
//请求灰度功能列表配置
//请求灰度功能列表配置
func
getUatList
(
_
id
:
Int
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
func
getUatList
(
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
params
:
[
String
:
Any
]
=
[
"id"
:
id
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Uat
.
uatListApi
let
params
:
[
String
]
=
[
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"9"
]
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
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字符串 转 对象
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
let
dic
=
json
.
data
let
dic
=
json
.
data
...
@@ -43,10 +75,15 @@ extension YHUatHelperViewModel {
...
@@ -43,10 +75,15 @@ extension YHUatHelperViewModel {
callBackBlock
(
false
,
nil
)
callBackBlock
(
false
,
nil
)
return
return
}
}
self
.
isDataOk
=
true
self
.
dataList
=
resultModel
self
.
dataList
=
resultModel
callBackBlock
(
true
,
nil
)
callBackBlock
(
true
,
nil
)
}
failBlock
:
{
err
in
}
failBlock
:
{
err
in
self
.
isDataOk
=
false
callBackBlock
(
false
,
err
)
callBackBlock
(
false
,
err
)
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/VersionUpload(版本更新)/M/YHAppVersionManager.swift
View file @
fef7c1e8
...
@@ -33,33 +33,39 @@ class YHAppVersionManager {
...
@@ -33,33 +33,39 @@ class YHAppVersionManager {
func
needShowRedPointOfSuggestVersionUpdate
()
->
Bool
{
func
needShowRedPointOfSuggestVersionUpdate
()
->
Bool
{
var
isShowRedPoint
=
false
var
isShowRedPoint
=
false
// 判断版本更新逻辑
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
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
let
showDateString
=
UserDefaults
.
standard
.
object
(
forKey
:
kShowRedPointOfSuggestLatestVersionDate
)
as?
String
{
if
!
showDateString
.
isEmpty
,
showDateString
!=
self
.
getCurrentDateSaveKey
()
{
// 需要更新且今天没有展示过
isShowRedPoint
=
true
}
}
else
{
// 没有任何一天展示过所以本地没有保存日期数据
isShowRedPoint
=
true
isShowRedPoint
=
true
}
}
}
else
{
// 没有任何一天展示过所以本地没有保存日期数据
isShowRedPoint
=
true
}
}
}
}
}
}
return
isShowRedPoint
return
isShowRedPoint
}
}
// 是否需要显示建议版本更新弹窗
// 是否需要显示建议版本更新弹窗
func
needShowAlertViewOfSuggestVersionUpdate
()
->
Bool
{
func
needShowAlertViewOfSuggestVersionUpdate
()
->
Bool
{
var
isShow
=
false
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
YHUatHelper
.
shared
.
getUatModuleStatusBy
(
module
:
YHUatModules
(
rawValue
:
9
))
{
if
!
configModel
.
max_version
.
isEmpty
,
configModel
.
max_version
!=
alertLatestVersion
{
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
isShow
=
true
}
}
}
else
{
isShow
=
true
}
}
}
}
return
isShow
return
isShow
...
...
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
View file @
fef7c1e8
...
@@ -333,6 +333,7 @@ class YHNetRequest: NSObject {
...
@@ -333,6 +333,7 @@ class YHNetRequest: NSObject {
#if DEBUG
#if DEBUG
printLog
(
"服务器返回数据是:
\(
obj
)
"
)
printLog
(
"服务器返回数据是:
\(
obj
)
"
)
#endif
#endif
if
obj
.
code
==
YHErrorCode
.
forceUpdate
.
rawValue
{
// 强制版本升级
if
obj
.
code
==
YHErrorCode
.
forceUpdate
.
rawValue
{
// 强制版本升级
DispatchQueue
.
main
.
async
{
DispatchQueue
.
main
.
async
{
YHAppVersionForceUpdateView
.
alertView
()
.
show
()
YHAppVersionForceUpdateView
.
alertView
()
.
show
()
...
@@ -346,6 +347,7 @@ class YHNetRequest: NSObject {
...
@@ -346,6 +347,7 @@ class YHNetRequest: NSObject {
return
return
}
}
if
obj
.
code
==
YHErrorCode
.
tokenInvalidError
.
rawValue
{
if
obj
.
code
==
YHErrorCode
.
tokenInvalidError
.
rawValue
{
DispatchQueue
.
main
.
async
{
DispatchQueue
.
main
.
async
{
YHLoginManager
.
shared
.
clearUserInfo
()
YHLoginManager
.
shared
.
clearUserInfo
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment