提交 7eecc59e authored 作者: 祁增奎's avatar 祁增奎

提示修改逻辑

上级 c976bf41
...@@ -28,10 +28,18 @@ class AppUpgradeControl { ...@@ -28,10 +28,18 @@ class AppUpgradeControl {
}); });
/// 检查更新 /// 检查更新
Future<void> checkUpdate() async { Future<dynamic> checkUpdate({bool isShowTips = true}) async {
// 检查更新,获取新版本详情 // 检查更新,获取新版本详情
final versionInfo = await versionService.checkVersion(); final versionInfo = await versionService.checkVersion();
if (versionInfo == null) return; // 一天提示一次升级,是在应用首次设置,不需要提示最新版本toast
if (!config.onceDay && versionInfo == null && isShowTips) {
// 当前已经是最新版本
ToastUtil.showToast("已经是最新版本了!");
return null;
}
if (versionInfo == null) {
return;
}
// 升级弹框提示 // 升级弹框提示
_showUpgradeDialog(versionInfo, config.appleId); _showUpgradeDialog(versionInfo, config.appleId);
} }
......
...@@ -38,12 +38,7 @@ class CarrierVersionImpl implements VersionService { ...@@ -38,12 +38,7 @@ class CarrierVersionImpl implements VersionService {
} }
//缓存当前时间 //缓存当前时间
SpUtil.putString(Constants.spCurrentDay, current); SpUtil.putString(Constants.spCurrentDay, current);
// 一天提示一次升级,是在应用首次设置,不需要提示最新版本toast
if (!config.onceDay && result == null) {
// 当前已经是最新版本
ToastUtil.showToast("已经是最新版本了!");
return null;
}
if (result == null) { if (result == null) {
// 无升级任务,拦截 // 无升级任务,拦截
return null; return null;
......
...@@ -37,12 +37,7 @@ class MSLVersionImpl implements VersionService { ...@@ -37,12 +37,7 @@ class MSLVersionImpl implements VersionService {
} }
//缓存当前时间 //缓存当前时间
SpUtil.putString(Constants.spCurrentDay, current); SpUtil.putString(Constants.spCurrentDay, current);
// 一天提示一次升级,是在应用首次设置,不需要提示最新版本toast
if (!config.onceDay && result == null) {
// 当前已经是最新版本
ToastUtil.showToast("已经是最新版本了!");
return null;
}
if (result == null) { if (result == null) {
// 无升级任务,拦截 // 无升级任务,拦截
return null; return null;
......
...@@ -35,12 +35,7 @@ class PMVersionImpl implements VersionService { ...@@ -35,12 +35,7 @@ class PMVersionImpl implements VersionService {
//缓存当前时间 //缓存当前时间
SpUtil.putString(Constants.spCurrentDay, current); SpUtil.putString(Constants.spCurrentDay, current);
var details = result?["detailVo"]; var details = result?["detailVo"];
// 一天提示一次升级,是在应用首次设置,不需要提示最新版本toast
if (!config.onceDay && details == null) {
// 当前已经是最新版本
ToastUtil.showToast("已经是最新版本了!");
return null;
}
// 返回升级版本信息 // 返回升级版本信息
return VersionInfo( return VersionInfo(
name: details['name'], name: details['name'],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论