feat: 添加一个新的sdk初始化方法,参数为config和uiConfig
parent
d86d2e232b
commit
01c782236a
|
@ -90,9 +90,10 @@
|
||||||
uiconfig.hideFeedbackMenu = [_uiConfig[@"isHideFeedbackAndComplaints"] boolValue];
|
uiconfig.hideFeedbackMenu = [_uiConfig[@"isHideFeedbackAndComplaints"] boolValue];
|
||||||
uiconfig.hideBackToHome = [_uiConfig[@"isHideBackHome"] boolValue];
|
uiconfig.hideBackToHome = [_uiConfig[@"isHideBackHome"] boolValue];
|
||||||
uiconfig.hideForwardMenu = [_uiConfig[@"isHideForwardMenu"] boolValue];
|
uiconfig.hideForwardMenu = [_uiConfig[@"isHideForwardMenu"] boolValue];
|
||||||
// uiconfig. = [_uiConfig[@"isHideRefreshMenu"] integerValue];
|
uiconfig.hideShareAppletMenu = [_uiConfig[@"isHideShareAppletMenu"] boolValue];
|
||||||
uiconfig.moreMenuStyle = [_uiConfig[@"moreMenuStyle"] integerValue];
|
uiconfig.hideRefreshMenu = [_uiConfig[@"isHideRefreshMenu"] boolValue];
|
||||||
uiconfig.moreMenuStyle = [_uiConfig[@"moreMenuStyle"] integerValue];
|
uiconfig.hideTransitionCloseButton = [_uiConfig[@"hideTransitionCloseButton"] integerValue];
|
||||||
|
uiconfig.disableSlideCloseAppletGesture = [_uiConfig[@"disableSlideCloseAppletGesture"] boolValue];
|
||||||
if (_uiConfig[@"progressBarColor"]) {
|
if (_uiConfig[@"progressBarColor"]) {
|
||||||
uiconfig.progressBarColor = [MOPTools colorWithRGBHex:[_uiConfig[@"progressBarColor"] intValue]];
|
uiconfig.progressBarColor = [MOPTools colorWithRGBHex:[_uiConfig[@"progressBarColor"] intValue]];
|
||||||
}
|
}
|
||||||
|
@ -102,7 +103,6 @@
|
||||||
uiconfig.autoAdaptDarkMode = [_uiConfig[@"autoAdaptDarkMode"] boolValue];
|
uiconfig.autoAdaptDarkMode = [_uiConfig[@"autoAdaptDarkMode"] boolValue];
|
||||||
|
|
||||||
uiconfig.appletText = _uiConfig[@"appletText"];
|
uiconfig.appletText = _uiConfig[@"appletText"];
|
||||||
uiconfig.hideTransitionCloseButton = [_uiConfig[@"hideTransitionCloseButton"] boolValue];
|
|
||||||
uiconfig.disableSlideCloseAppletGesture = [_uiConfig[@"disableSlideCloseAppletGesture"] boolValue];
|
uiconfig.disableSlideCloseAppletGesture = [_uiConfig[@"disableSlideCloseAppletGesture"] boolValue];
|
||||||
if (_uiConfig[@"capsuleConfig"]) {
|
if (_uiConfig[@"capsuleConfig"]) {
|
||||||
NSDictionary *capsuleConfigDic = _uiConfig[@"capsuleConfig"];
|
NSDictionary *capsuleConfigDic = _uiConfig[@"capsuleConfig"];
|
||||||
|
@ -127,8 +127,120 @@
|
||||||
uiconfig.capsuleConfig = capsuleConfig;
|
uiconfig.capsuleConfig = capsuleConfig;
|
||||||
|
|
||||||
}
|
}
|
||||||
uiconfig.appendingCustomUserAgent = _uiConfig[@"customWebViewUserAgent"];
|
|
||||||
|
if (_uiConfig[@"navHomeConfig"]) {
|
||||||
|
NSDictionary *navHomeConfigDic = _uiConfig[@"navHomeConfig"];
|
||||||
|
FATNavHomeConfig *navHomeConfig = [[FATNavHomeConfig alloc]init];
|
||||||
|
navHomeConfig.width = [navHomeConfigDic[@"width"] floatValue];
|
||||||
|
navHomeConfig.height = [navHomeConfigDic[@"height"] floatValue];
|
||||||
|
navHomeConfig.leftMargin = [navHomeConfigDic[@"leftMargin"] floatValue];
|
||||||
|
navHomeConfig.cornerRadius = [navHomeConfigDic[@"cornerRadius"] floatValue];
|
||||||
|
navHomeConfig.borderWidth = [navHomeConfigDic[@"width"] floatValue];
|
||||||
|
if (navHomeConfigDic[@"borderLightColor"]) {
|
||||||
|
navHomeConfig.borderLightColor = [MOPTools colorWithRGBHex:[navHomeConfigDic[@"borderLightColor"] intValue]];
|
||||||
}
|
}
|
||||||
|
if (navHomeConfigDic[@"borderDarkColor"]) {
|
||||||
|
navHomeConfig.borderDarkColor = [MOPTools colorWithRGBHex:[navHomeConfigDic[@"borderDarkColor"] intValue]];
|
||||||
|
}
|
||||||
|
if (navHomeConfigDic[@"bgLightColor"]) {
|
||||||
|
navHomeConfig.bgLightColor = [MOPTools colorWithRGBHex:[navHomeConfigDic[@"bgLightColor"] intValue]];
|
||||||
|
}
|
||||||
|
if (navHomeConfigDic[@"bgDarkColor"]) {
|
||||||
|
navHomeConfig.bgDarkColor = [MOPTools colorWithRGBHex:[navHomeConfigDic[@"bgDarkColor"] intValue]];
|
||||||
|
}
|
||||||
|
uiconfig.navHomeConfig = navHomeConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_uiConfig[@"authViewConfig"]) {
|
||||||
|
NSDictionary *authViewConfigDic = _uiConfig[@"authViewConfig"];
|
||||||
|
FATAuthViewConfig *authViewConfig = [[FATAuthViewConfig alloc]init];
|
||||||
|
authViewConfig.appletNameFont = [UIFont systemFontOfSize:[authViewConfigDic[@"appletNameFont"] integerValue]];
|
||||||
|
if (authViewConfigDic[@"appletNameLightColor"]) {
|
||||||
|
authViewConfig.appletNameLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"appletNameLightColor"] intValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (authViewConfigDic[@"appletNameDarkColor"]) {
|
||||||
|
authViewConfig.appletNameDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"appletNameDarkColor"] intValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
authViewConfig.authorizeTitleFont = [UIFont systemFontOfSize:[authViewConfigDic[@"authorizeTitleFont"] integerValue] weight:UIFontWeightMedium];
|
||||||
|
|
||||||
|
if (authViewConfigDic[@"authorizeTitleLightColor"]) {
|
||||||
|
authViewConfig.authorizeTitleLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"authorizeTitleLightColor"] intValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (authViewConfigDic[@"authorizeTitleDarkColor"]) {
|
||||||
|
authViewConfig.authorizeTitleDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"authorizeTitleDarkColor"] intValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
authViewConfig.authorizeDescriptionFont = [UIFont systemFontOfSize:[authViewConfigDic[@"authorizeDescriptionFont"] integerValue]];
|
||||||
|
|
||||||
|
if (authViewConfigDic[@"authorizeDescriptionLightColor"]) {
|
||||||
|
authViewConfig.authorizeDescriptionLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"authorizeDescriptionLightColor"] intValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (authViewConfigDic[@"authorizeDescriptionDarkColor"]) {
|
||||||
|
authViewConfig.authorizeDescriptionDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"authorizeDescriptionDarkColor"] intValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
authViewConfig.agreementTitleFont = [UIFont systemFontOfSize:[authViewConfigDic[@"agreementTitleFont"] integerValue]];
|
||||||
|
|
||||||
|
if (authViewConfigDic[@"agreementTitleLightColor"]) {
|
||||||
|
authViewConfig.agreementTitleLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"agreementTitleLightColor"] intValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (authViewConfigDic[@"agreementTitleDarkColor"]) {
|
||||||
|
authViewConfig.agreementTitleDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"agreementTitleDarkColor"] intValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
authViewConfig.agreementDescriptionFont = [UIFont systemFontOfSize:[authViewConfigDic[@"agreementDescriptionFont"] integerValue]];
|
||||||
|
|
||||||
|
if (authViewConfigDic[@"agreementDescriptionLightColor"]) {
|
||||||
|
authViewConfig.agreementDescriptionLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"agreementDescriptionLightColor"] intValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (authViewConfigDic[@"agreementDescriptionDarkColor"]) {
|
||||||
|
authViewConfig.agreementDescriptionDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"agreementDescriptionDarkColor"] intValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (authViewConfigDic[@"linkLightColor"]) {
|
||||||
|
authViewConfig.linkLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"linkLightColor"] intValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (authViewConfigDic[@"linkDarkColor"]) {
|
||||||
|
authViewConfig.linkDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"linkDarkColor"] intValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (authViewConfigDic[@"allowButtonLightConfig"]) {
|
||||||
|
FATAuthButtonConfig *allowButtonLightConfig = [self createAuthButtonConfigWithDic:authViewConfigDic[@"allowButtonLightConfig"]];
|
||||||
|
authViewConfig.allowButtonLightConfig = allowButtonLightConfig;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (authViewConfigDic[@"allowButtonDarkConfig"]) {
|
||||||
|
FATAuthButtonConfig *allowButtonDarkConfig = [self createAuthButtonConfigWithDic:authViewConfigDic[@"allowButtonDarkConfig"]];
|
||||||
|
authViewConfig.allowButtonDarkConfig = allowButtonDarkConfig;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (authViewConfigDic[@"rejectButtonLightConfig"]) {
|
||||||
|
FATAuthButtonConfig *rejectButtonLightConfig = [self createAuthButtonConfigWithDic:authViewConfigDic[@"rejectButtonLightConfig"]];
|
||||||
|
authViewConfig.rejectButtonLightConfig = rejectButtonLightConfig;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (authViewConfigDic[@"rejectButtonDarkConfig"]) {
|
||||||
|
FATAuthButtonConfig *rejectButtonDarkConfig = [self createAuthButtonConfigWithDic:authViewConfigDic[@"rejectButtonDarkConfig"]];
|
||||||
|
authViewConfig.rejectButtonDarkConfig = rejectButtonDarkConfig;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
uiconfig.authViewConfig = authViewConfig;
|
||||||
|
}
|
||||||
|
uiconfig.appendingCustomUserAgent = _uiConfig[@"customWebViewUserAgent"];
|
||||||
|
uiconfig.hideWebViewProgressBar = [_uiConfig[@"hideWebViewProgressBar"] boolValue];
|
||||||
|
uiconfig.autoAdaptDarkMode = [_uiConfig[@"autoAdaptDarkMode"] boolValue];
|
||||||
|
uiconfig.transtionStyle = [_uiConfig[@"transtionStyle"] integerValue];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// uiconfig.moreMenuStyle = FATMoreViewStyleNormal;
|
// uiconfig.moreMenuStyle = FATMoreViewStyleNormal;
|
||||||
|
@ -146,4 +258,34 @@
|
||||||
success(@{});
|
success(@{});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (FATAuthButtonConfig *)createAuthButtonConfigWithDic:(NSDictionary *)dic {
|
||||||
|
if (!dic) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
FATAuthButtonConfig * authButtonConfig = [[FATAuthButtonConfig alloc]init];
|
||||||
|
if (dic[@"cornerRadius"]) {
|
||||||
|
authButtonConfig.cornerRadius = [dic[@"cornerRadius"] floatValue];
|
||||||
|
}
|
||||||
|
if (dic[@"normalBackgroundColor"]) {
|
||||||
|
authButtonConfig.normalBackgroundColor = [MOPTools colorWithRGBHex:[dic[@"normalBackgroundColor"] intValue]];
|
||||||
|
}
|
||||||
|
if (dic[@"pressedBackgroundColor"]) {
|
||||||
|
authButtonConfig.pressedBackgroundColor = [MOPTools colorWithRGBHex:[dic[@"pressedBackgroundColor"] intValue]];
|
||||||
|
}
|
||||||
|
if (dic[@"normalTextColor"]) {
|
||||||
|
authButtonConfig.normalTextColor = [MOPTools colorWithRGBHex:[dic[@"normalTextColor"] intValue]];
|
||||||
|
}
|
||||||
|
if (dic[@"pressedTextColor"]) {
|
||||||
|
authButtonConfig.pressedTextColor = [MOPTools colorWithRGBHex:[dic[@"pressedTextColor"] intValue]];
|
||||||
|
}
|
||||||
|
if (dic[@"normalBorderColor"]) {
|
||||||
|
authButtonConfig.normalBorderColor = [MOPTools colorWithRGBHex:[dic[@"normalBorderColor"] intValue]];
|
||||||
|
}
|
||||||
|
if (dic[@"pressedBorderColor"]) {
|
||||||
|
authButtonConfig.pressedBorderColor = [MOPTools colorWithRGBHex:[dic[@"pressedBorderColor"] intValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
return authButtonConfig;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk.
|
||||||
s.dependency 'Flutter'
|
s.dependency 'Flutter'
|
||||||
s.ios.deployment_target = '9.0'
|
s.ios.deployment_target = '9.0'
|
||||||
|
|
||||||
s.dependency 'FinApplet' , '2.39.7'
|
s.dependency 'FinApplet' , '2.39.11'
|
||||||
s.dependency 'FinAppletExt' , '2.39.7'
|
s.dependency 'FinAppletExt' , '2.39.11'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
165
lib/mop.dart
165
lib/mop.dart
|
@ -53,6 +53,10 @@ class FinStoreConfig {
|
||||||
|
|
||||||
class FATConfig {
|
class FATConfig {
|
||||||
/**
|
/**
|
||||||
|
要初始化的服务器配置对象列表
|
||||||
|
*/
|
||||||
|
List<FinStoreConfig> storeConfigs;
|
||||||
|
/**
|
||||||
当前用户id,对应管理后台的用户管理->成员管理->用户id。
|
当前用户id,对应管理后台的用户管理->成员管理->用户id。
|
||||||
若体验版本配置了体验成员,则需要设置正确的userId才能具备打开小程序的权限
|
若体验版本配置了体验成员,则需要设置正确的userId才能具备打开小程序的权限
|
||||||
登录/切换用户/退出登录时,需要修改此值。
|
登录/切换用户/退出登录时,需要修改此值。
|
||||||
|
@ -128,7 +132,7 @@ bool encryptServerData = false;
|
||||||
当设置为FATBOOLStateFalse时,非正式版会在更多菜单里显示打开和关闭调试的菜单。
|
当设置为FATBOOLStateFalse时,非正式版会在更多菜单里显示打开和关闭调试的菜单。
|
||||||
当设置为FATBOOLStateForbidden时,所有版本强制关闭vconsole,且不可调api开启,多面板不展示打开、关闭调试菜单
|
当设置为FATBOOLStateForbidden时,所有版本强制关闭vconsole,且不可调api开启,多面板不展示打开、关闭调试菜单
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, assign) FATBOOLState enableAppletDebug;
|
FATBOOLState enableAppletDebug = FATBOOLState.FATBOOLStateUndefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
是否显示水印
|
是否显示水印
|
||||||
|
@ -191,11 +195,15 @@ int pageCountLimit = 0;
|
||||||
*/
|
*/
|
||||||
List<String> schemes = [];
|
List<String> schemes = [];
|
||||||
|
|
||||||
|
FATConfig(this.storeConfigs);
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
|
List<Map<String, dynamic>>? finStoreConfigs =
|
||||||
|
storeConfigs.map((e) => e.toMap()).toList();
|
||||||
return {
|
return {
|
||||||
|
"storeConfigs": finStoreConfigs,
|
||||||
"currentUserId": currentUserId,
|
"currentUserId": currentUserId,
|
||||||
"productIdentification": productIdentification,
|
"productIdentification": productIdentification,
|
||||||
|
|
||||||
"disableAuthorize": disableAuthorize,
|
"disableAuthorize": disableAuthorize,
|
||||||
"appletAutoAuthorize": appletAutoAuthorize,
|
"appletAutoAuthorize": appletAutoAuthorize,
|
||||||
"disableGetSuperviseInfo": disableGetSuperviseInfo,
|
"disableGetSuperviseInfo": disableGetSuperviseInfo,
|
||||||
|
@ -204,7 +212,7 @@ List<String> schemes = [];
|
||||||
"apmExtension": apmExtension,
|
"apmExtension": apmExtension,
|
||||||
"enableApmDataCompression": enableApmDataCompression,
|
"enableApmDataCompression": enableApmDataCompression,
|
||||||
"encryptServerData": encryptServerData,
|
"encryptServerData": encryptServerData,
|
||||||
"enableAppletDebug": enableAppletDebug,
|
"enableAppletDebug": enableAppletDebug.index,
|
||||||
"enableWatermark": enableWatermark,
|
"enableWatermark": enableWatermark,
|
||||||
"watermarkPriority": watermarkPriority.index,
|
"watermarkPriority": watermarkPriority.index,
|
||||||
"baseLoadingViewClass": baseLoadingViewClass,
|
"baseLoadingViewClass": baseLoadingViewClass,
|
||||||
|
@ -234,19 +242,19 @@ class UIConfig {
|
||||||
int navigationBarBackBtnLightColor = 0xffffffff;
|
int navigationBarBackBtnLightColor = 0xffffffff;
|
||||||
|
|
||||||
//导航栏的返回按钮颜色(明亮主题),默认值为黑色
|
//导航栏的返回按钮颜色(明亮主题),默认值为黑色
|
||||||
int navigationBarBackBtnDarkColor 0xff000000;
|
int navigationBarBackBtnDarkColor = 0xff000000;
|
||||||
|
|
||||||
// int? navigationBackImage;
|
// int? navigationBackImage;
|
||||||
//弹出的菜单视图的样式 0:默认 1:
|
//弹出的菜单视图的样式 0:默认 1:
|
||||||
int moreMenuStyle = 0;
|
int moreMenuStyle = 0;
|
||||||
|
|
||||||
//隐藏导航栏返回首页按钮的优先级设置,默认全局配置优先 不支持FATConfigAppletFilePriority
|
//隐藏导航栏返回首页按钮的优先级设置,默认全局配置优先 不支持FATConfigAppletFilePriority
|
||||||
ConfigPriority hideBackToHomePriority = ConfigPriority.ConfigGlobalPriority
|
ConfigPriority hideBackToHomePriority = ConfigPriority.ConfigGlobalPriority;
|
||||||
|
|
||||||
///当导航栏为默认导航栏时,是否始终显示返回按钮
|
///当导航栏为默认导航栏时,是否始终显示返回按钮 ios未发现该属性
|
||||||
bool isAlwaysShowBackInDefaultNavigationBar = false;
|
bool isAlwaysShowBackInDefaultNavigationBar = false;
|
||||||
|
|
||||||
///是否清除导航栏导航按钮的背景
|
///是否清除导航栏导航按钮的背景 ios未发现该属性
|
||||||
bool isClearNavigationBarNavButtonBackground = false;
|
bool isClearNavigationBarNavButtonBackground = false;
|
||||||
|
|
||||||
///是否隐藏"更多"菜单中的"反馈与投诉"菜单入口
|
///是否隐藏"更多"菜单中的"反馈与投诉"菜单入口
|
||||||
|
@ -258,9 +266,6 @@ class UIConfig {
|
||||||
//隐藏...弹出菜单中的 【转发】 的菜单,默认为false
|
//隐藏...弹出菜单中的 【转发】 的菜单,默认为false
|
||||||
bool isHideForwardMenu = false;
|
bool isHideForwardMenu = false;
|
||||||
|
|
||||||
//隐藏...弹出菜单中的 【反馈与投诉】 的菜单,默认为false
|
|
||||||
bool isHideFeedbackMenu = false;
|
|
||||||
|
|
||||||
//隐藏...弹出菜单中的 【分享】 的菜单,默认为true
|
//隐藏...弹出菜单中的 【分享】 的菜单,默认为true
|
||||||
bool isHideShareAppletMenu = true;
|
bool isHideShareAppletMenu = true;
|
||||||
|
|
||||||
|
@ -270,12 +275,6 @@ class UIConfig {
|
||||||
//隐藏...弹出菜单中的 【设置】 的菜单,默认为false
|
//隐藏...弹出菜单中的 【设置】 的菜单,默认为false
|
||||||
bool isHideSettingMenu = false;
|
bool isHideSettingMenu = false;
|
||||||
|
|
||||||
/// 加载小程序过程中(小程序Service层还未加载成功,基础库还没有向SDK传递小程序配置信息),是否隐藏导航栏的关闭按钮
|
|
||||||
bool hideTransitionCloseButton = false;
|
|
||||||
|
|
||||||
/// 禁用侧滑关闭小程序手势
|
|
||||||
bool disableSlideCloseAppletGesture = false;
|
|
||||||
|
|
||||||
/// 胶囊按钮配置
|
/// 胶囊按钮配置
|
||||||
CapsuleConfig? capsuleConfig;
|
CapsuleConfig? capsuleConfig;
|
||||||
|
|
||||||
|
@ -294,8 +293,6 @@ class UIConfig {
|
||||||
//隐藏小程序里加载H5时进度条,默认为false
|
//隐藏小程序里加载H5时进度条,默认为false
|
||||||
bool hideWebViewProgressBar = false;
|
bool hideWebViewProgressBar = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//是否自适应暗黑模式。如果设置为true,则更多页面、关于等原生页面会随着手机切换暗黑,也自动调整为暗黑模式
|
//是否自适应暗黑模式。如果设置为true,则更多页面、关于等原生页面会随着手机切换暗黑,也自动调整为暗黑模式
|
||||||
bool autoAdaptDarkMode = true;
|
bool autoAdaptDarkMode = true;
|
||||||
|
|
||||||
|
@ -310,7 +307,7 @@ class UIConfig {
|
||||||
*/
|
*/
|
||||||
TranstionStyle transtionStyle = TranstionStyle.TranstionStyleUp;
|
TranstionStyle transtionStyle = TranstionStyle.TranstionStyleUp;
|
||||||
|
|
||||||
//是否隐藏转场页的关闭按钮。默认为false
|
/// 加载小程序过程中(小程序Service层还未加载成功,基础库还没有向SDK传递小程序配置信息),是否隐藏导航栏的关闭按钮
|
||||||
bool hideTransitionCloseButton = false;
|
bool hideTransitionCloseButton = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -338,23 +335,20 @@ class UIConfig {
|
||||||
"isHideBackHome": isHideBackHome,
|
"isHideBackHome": isHideBackHome,
|
||||||
"isHideForwardMenu": isHideForwardMenu,
|
"isHideForwardMenu": isHideForwardMenu,
|
||||||
"isHideRefreshMenu": isHideRefreshMenu,
|
"isHideRefreshMenu": isHideRefreshMenu,
|
||||||
"isHideFeedbackMenu": isHideFeedbackMenu,
|
|
||||||
"isHideShareAppletMenu": isHideShareAppletMenu,
|
"isHideShareAppletMenu": isHideShareAppletMenu,
|
||||||
"isHideSettingMenu": isHideSettingMenu,
|
"isHideSettingMenu": isHideSettingMenu,
|
||||||
"hideTransitionCloseButton": hideTransitionCloseButton,
|
"hideTransitionCloseButton": hideTransitionCloseButton,
|
||||||
"disableSlideCloseAppletGesture": disableSlideCloseAppletGesture,
|
|
||||||
"capsuleConfig": capsuleConfig?.toMap(),
|
"capsuleConfig": capsuleConfig?.toMap(),
|
||||||
"navHomeConfig": navHomeConfig?.toMap(),
|
"navHomeConfig": navHomeConfig?.toMap(),
|
||||||
"authViewConfig": authViewConfig,toMap(,)
|
"authViewConfig": authViewConfig?.toMap(),
|
||||||
"floatWindowConfig": floatWindowConfig?.toMap(),
|
"floatWindowConfig": floatWindowConfig?.toMap(),
|
||||||
"progressBarColor": progressBarColor,
|
"progressBarColor": progressBarColor,
|
||||||
"hideWebViewProgressBar": hideWebViewProgressBar,
|
"hideWebViewProgressBar": hideWebViewProgressBar,
|
||||||
"moreMenuStyle": moreMenuStyle,
|
"moreMenuStyle": moreMenuStyle,
|
||||||
"hideBackToHomePriority": hideBackToHomePriority,
|
"hideBackToHomePriority": hideBackToHomePriority.index,
|
||||||
"autoAdaptDarkMode": autoAdaptDarkMode,
|
"autoAdaptDarkMode": autoAdaptDarkMode,
|
||||||
"appendingCustomUserAgent": appendingCustomUserAgent,
|
"appendingCustomUserAgent": appendingCustomUserAgent,
|
||||||
"transtionStyle": transtionStyle.index,
|
"transtionStyle": transtionStyle.index,
|
||||||
"hideTransitionCloseButton": hideTransitionCloseButton,
|
|
||||||
"disableSlideCloseAppletGesture": disableSlideCloseAppletGesture,
|
"disableSlideCloseAppletGesture": disableSlideCloseAppletGesture,
|
||||||
"appletText": appletText
|
"appletText": appletText
|
||||||
};
|
};
|
||||||
|
@ -482,29 +476,17 @@ class NavHomeConfig {
|
||||||
/**
|
/**
|
||||||
返回首页按钮的左边距,默认值为10
|
返回首页按钮的左边距,默认值为10
|
||||||
*/
|
*/
|
||||||
double leftMargin;
|
double leftMargin = 10;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
返回首页按钮的圆角半径,默认值为5
|
返回首页按钮的圆角半径,默认值为5
|
||||||
*/
|
*/
|
||||||
double cornerRadius;
|
double cornerRadius = 5;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
返回首页按钮的边框宽度,默认值为0.8
|
返回首页按钮的边框宽度,默认值为0.8
|
||||||
*/
|
*/
|
||||||
double borderWidth;
|
double borderWidth = 0.8;
|
||||||
|
|
||||||
/**
|
|
||||||
浅色返回首页按钮的图片对象,如果不传,会使用默认图标
|
|
||||||
(暗黑模式)
|
|
||||||
*/
|
|
||||||
// int? lightImage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
深色返回首页按钮的图片对象,如果不传,会使用默认图标
|
|
||||||
(明亮模式)
|
|
||||||
*/
|
|
||||||
// int? darkImage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
返回首页按钮的边框浅色颜色
|
返回首页按钮的边框浅色颜色
|
||||||
|
@ -530,6 +512,9 @@ class NavHomeConfig {
|
||||||
*/
|
*/
|
||||||
int bgDarkColor;
|
int bgDarkColor;
|
||||||
|
|
||||||
|
NavHomeConfig(this.width, this.height, this.borderLightColor,
|
||||||
|
this.borderDarkColor, this.bgLightColor, this.bgDarkColor);
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"width": width,
|
"width": width,
|
||||||
|
@ -549,110 +534,90 @@ class AuthViewConfig {
|
||||||
/**
|
/**
|
||||||
小程序名称字体大小,默认字体为PingFangSC-Regular,默认大小16
|
小程序名称字体大小,默认字体为PingFangSC-Regular,默认大小16
|
||||||
*/
|
*/
|
||||||
int appletNameFont;
|
int appletNameFont = 16;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
小程序名称的浅色颜色(明亮模式),默认#202020
|
小程序名称的浅色颜色(明亮模式),默认#202020
|
||||||
*/
|
*/
|
||||||
int appletNameLightColor;
|
int appletNameLightColor = 0xff202020;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
小程序名称的深色颜色(暗黑模式),默认#D0D0D0
|
小程序名称的深色颜色(暗黑模式),默认#D0D0D0
|
||||||
*/
|
*/
|
||||||
int appletNameDarkColor;
|
int appletNameDarkColor = 0xffd0d0d0;
|
||||||
|
|
||||||
/**
|
|
||||||
隐私协议入口icon(明亮模式),大小:22pt(@2× @3×)
|
|
||||||
*/
|
|
||||||
int agreementLightImage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
隐私协议入口icon(暗黑模式),大小:22pt(@2× @3×)
|
|
||||||
*/
|
|
||||||
int agreementDarkImage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
权限标题字体大小,默认字体为PingFangSC-Medium,默认大小17
|
权限标题字体大小,默认字体为PingFangSC-Medium,默认大小17
|
||||||
备注:权限选项文字字体大小使用该配置项,但字体固定为PingFangSC-Regular
|
备注:权限选项文字字体大小使用该配置项,但字体固定为PingFangSC-Regular
|
||||||
*/
|
*/
|
||||||
int authorizeTitleFont;
|
int authorizeTitleFont = 17;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
权限标题的浅色颜色(明亮模式),默认#202020
|
权限标题的浅色颜色(明亮模式),默认#202020
|
||||||
备注:权限选项文字字体颜色使用该配置项
|
备注:权限选项文字字体颜色使用该配置项
|
||||||
*/
|
*/
|
||||||
int authorizeTitleLightColor;
|
int authorizeTitleLightColor = 0xff202020;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
权限标题的深色颜色(暗黑模式),默认#D0D0D0
|
权限标题的深色颜色(暗黑模式),默认#D0D0D0
|
||||||
备注:权限选项文字字体颜色使用该配置项
|
备注:权限选项文字字体颜色使用该配置项
|
||||||
*/
|
*/
|
||||||
int authorizeTitleDarkColor;
|
int authorizeTitleDarkColor = 0xffd0d0d0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
权限描述字体大小,默认字体为PingFangSC-Regular,默认大小14
|
权限描述字体大小,默认字体为PingFangSC-Regular,默认大小14
|
||||||
*/
|
*/
|
||||||
int authorizeDescriptionFont;
|
int authorizeDescriptionFont = 14;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
权限描述的浅色颜色(明亮模式),默认#666666
|
权限描述的浅色颜色(明亮模式),默认#666666
|
||||||
*/
|
*/
|
||||||
int authorizeDescriptionLightColor;
|
int authorizeDescriptionLightColor = 0xff666666;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
权限描述的深色颜色(暗黑模式),默认#8C8C8C
|
权限描述的深色颜色(暗黑模式),默认#8C8C8C
|
||||||
*/
|
*/
|
||||||
int authorizeDescriptionDarkColor;
|
int authorizeDescriptionDarkColor = 0xff8c8c8c;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
协议标题字体大小,默认字体为PingFangSC-Regular,默认大小16
|
协议标题字体大小,默认字体为PingFangSC-Regular,默认大小16
|
||||||
*/
|
*/
|
||||||
int agreementTitleFont;
|
int agreementTitleFont = 16;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
协议标题的浅色颜色(明亮模式),默认#202020
|
协议标题的浅色颜色(明亮模式),默认#202020
|
||||||
*/
|
*/
|
||||||
int agreementTitleLightColor;
|
int agreementTitleLightColor = 0xff202020;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
协议标题的深色颜色(暗黑模式),默认#D0D0D0
|
协议标题的深色颜色(暗黑模式),默认#D0D0D0
|
||||||
*/
|
*/
|
||||||
int agreementTitleDarkColor;
|
int agreementTitleDarkColor = 0xffd0d0d0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
协议描述字体大小,默认字体为PingFangSC-Regular,默认大小14
|
协议描述字体大小,默认字体为PingFangSC-Regular,默认大小14
|
||||||
*/
|
*/
|
||||||
int agreementDescriptionFont;
|
int agreementDescriptionFont = 14;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
协议描述的浅色颜色(明亮模式),默认#202020
|
协议描述的浅色颜色(明亮模式),默认#202020
|
||||||
*/
|
*/
|
||||||
int agreementDescriptionLightColor;
|
int agreementDescriptionLightColor = 0xff202020;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
协议描述的深色颜色(暗黑模式),默认#D0D0D0
|
协议描述的深色颜色(暗黑模式),默认#D0D0D0
|
||||||
*/
|
*/
|
||||||
int agreementDescriptionDarkColor;
|
int agreementDescriptionDarkColor = 0xffd0d0d0;
|
||||||
|
|
||||||
/**
|
|
||||||
权限选项选中时的icon(明亮模式),大小:22pt(@2× @3×)
|
|
||||||
*/
|
|
||||||
int authorizeSelectedLightImage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
权限选项选中时的icon(暗黑模式),大小:22pt(@2× @3×)
|
|
||||||
*/
|
|
||||||
int authorizeSelectedDarkImage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
链接的浅色颜色(明亮模式),默认#409EFF
|
链接的浅色颜色(明亮模式),默认#409EFF
|
||||||
*/
|
*/
|
||||||
int linkLightColor;
|
int linkLightColor = 0xff409eff;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
链接的深色颜色(暗黑模式),默认#368CE4
|
链接的深色颜色(暗黑模式),默认#368CE4
|
||||||
*/
|
*/
|
||||||
int linkDarkColor;
|
int linkDarkColor = 0xff368ce4;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
同意按钮配置(明亮模式),默认配置如下:
|
同意按钮配置(明亮模式),默认配置如下:
|
||||||
|
@ -664,7 +629,7 @@ int linkDarkColor;
|
||||||
按下默认描边:#3B77DB
|
按下默认描边:#3B77DB
|
||||||
按下文字颜色:#FFFFFF
|
按下文字颜色:#FFFFFF
|
||||||
*/
|
*/
|
||||||
AuthButtonConfig allowButtonLightConfig;
|
AuthButtonConfig? allowButtonLightConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
同意按钮配置(暗黑模式),默认配置如下:
|
同意按钮配置(暗黑模式),默认配置如下:
|
||||||
|
@ -676,7 +641,7 @@ AuthButtonConfig allowButtonLightConfig;
|
||||||
按下默认描边:#5E97F5
|
按下默认描边:#5E97F5
|
||||||
按下文字颜色:#FFFFFF
|
按下文字颜色:#FFFFFF
|
||||||
*/
|
*/
|
||||||
AuthButtonConfig allowButtonDarkConfig;
|
AuthButtonConfig? allowButtonDarkConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
拒绝按钮配置(明亮模式),默认配置如下:
|
拒绝按钮配置(明亮模式),默认配置如下:
|
||||||
|
@ -688,7 +653,7 @@ AuthButtonConfig allowButtonDarkConfig;
|
||||||
按下默认描边:#D8D8D8
|
按下默认描边:#D8D8D8
|
||||||
按下文字颜色:#222222
|
按下文字颜色:#222222
|
||||||
*/
|
*/
|
||||||
AuthButtonConfig rejectButtonLightConfig;
|
AuthButtonConfig? rejectButtonLightConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
拒绝按钮配置(暗黑模式),默认配置如下:
|
拒绝按钮配置(暗黑模式),默认配置如下:
|
||||||
|
@ -700,7 +665,7 @@ AuthButtonConfig rejectButtonLightConfig;
|
||||||
按下默认描边:#414141
|
按下默认描边:#414141
|
||||||
按下文字颜色:#D0D0D0
|
按下文字颜色:#D0D0D0
|
||||||
*/
|
*/
|
||||||
AuthButtonConfig rejectButtonDarkConfig;
|
AuthButtonConfig? rejectButtonDarkConfig;
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
|
@ -713,7 +678,6 @@ Map<String, dynamic> toMap() {
|
||||||
"authorizeDescriptionFont": authorizeDescriptionFont,
|
"authorizeDescriptionFont": authorizeDescriptionFont,
|
||||||
"authorizeDescriptionLightColor": authorizeDescriptionLightColor,
|
"authorizeDescriptionLightColor": authorizeDescriptionLightColor,
|
||||||
"authorizeDescriptionDarkColor": authorizeDescriptionDarkColor,
|
"authorizeDescriptionDarkColor": authorizeDescriptionDarkColor,
|
||||||
|
|
||||||
"agreementTitleFont": agreementTitleFont,
|
"agreementTitleFont": agreementTitleFont,
|
||||||
"agreementTitleLightColor": agreementTitleLightColor,
|
"agreementTitleLightColor": agreementTitleLightColor,
|
||||||
"agreementTitleDarkColor": agreementTitleDarkColor,
|
"agreementTitleDarkColor": agreementTitleDarkColor,
|
||||||
|
@ -721,10 +685,10 @@ Map<String, dynamic> toMap() {
|
||||||
"agreementDescriptionDarkColor": agreementDescriptionDarkColor,
|
"agreementDescriptionDarkColor": agreementDescriptionDarkColor,
|
||||||
"linkLightColor": linkLightColor,
|
"linkLightColor": linkLightColor,
|
||||||
"linkDarkColor": linkDarkColor,
|
"linkDarkColor": linkDarkColor,
|
||||||
"allowButtonLightConfig": allowButtonLightConfig.toMap(),
|
"allowButtonLightConfig": allowButtonLightConfig?.toMap(),
|
||||||
"allowButtonDarkConfig": allowButtonDarkConfig.toMap(),
|
"allowButtonDarkConfig": allowButtonDarkConfig?.toMap(),
|
||||||
"rejectButtonLightConfig": rejectButtonLightConfig.toMap(),
|
"rejectButtonLightConfig": rejectButtonLightConfig?.toMap(),
|
||||||
"rejectButtonDarkConfig": rejectButtonDarkConfig.toMap(),
|
"rejectButtonDarkConfig": rejectButtonDarkConfig?.toMap(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -765,6 +729,15 @@ int normalBorderColor;
|
||||||
*/
|
*/
|
||||||
int pressedBorderColor;
|
int pressedBorderColor;
|
||||||
|
|
||||||
|
AuthButtonConfig(
|
||||||
|
this.cornerRadius,
|
||||||
|
this.normalBackgroundColor,
|
||||||
|
this.pressedBackgroundColor,
|
||||||
|
this.normalTextColor,
|
||||||
|
this.pressedTextColor,
|
||||||
|
this.normalBorderColor,
|
||||||
|
this.pressedBorderColor);
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
"cornerRadius": cornerRadius,
|
"cornerRadius": cornerRadius,
|
||||||
|
@ -896,6 +869,14 @@ enum TranstionStyle {
|
||||||
TranstionStylePush, // 页面从右往左弹出,类似push效果
|
TranstionStylePush, // 页面从右往左弹出,类似push效果
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum FATBOOLState {
|
||||||
|
FATBOOLStateUndefined, // 未设置
|
||||||
|
FATBOOLStateTrue, // 所有版本强制开启vconsole,且不可调api关闭,更多面板不展示打开、关闭调试菜单
|
||||||
|
FATBOOLStateFalse, // 正式版更多面板不展示打开、关闭调试菜单;非正式版更多面板展示打开、关闭调试菜单;所有版本均可调setEnableDebug开启vconsole。
|
||||||
|
FATBOOLStateForbidden, // 所有版本强制关闭vconsole,且不可调api开启,多面板不展示打开、关闭调试菜单
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
class Mop {
|
class Mop {
|
||||||
static final Mop _instance = new Mop._internal();
|
static final Mop _instance = new Mop._internal();
|
||||||
late MethodChannel _channel;
|
late MethodChannel _channel;
|
||||||
|
@ -1024,18 +1005,10 @@ class Mop {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Map> newInitialize(
|
Future<Map> newInitialize(FATConfig config, {UIConfig? uiConfig}) async {
|
||||||
FATConfig config,
|
|
||||||
{
|
|
||||||
UIConfig? uiConfig
|
|
||||||
}
|
|
||||||
}) async {
|
|
||||||
List<Map<String, dynamic>>? storeConfigs =
|
|
||||||
finStoreConfigs?.map((e) => e.toMap()).toList();
|
|
||||||
|
|
||||||
final Map ret = await _channel.invokeMethod('newInitialize', {
|
final Map ret = await _channel.invokeMethod('newInitialize', {
|
||||||
'config': config,
|
'config': config.toMap(),
|
||||||
'uiConfig': uiConfig,
|
'uiConfig': uiConfig?.toMap(),
|
||||||
});
|
});
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue