更新眠花糖web升级提示

This commit is contained in:
wyf
2026-03-28 16:29:52 +08:00
parent 446d884ac2
commit 3a2956658d
4 changed files with 63 additions and 32 deletions

View File

@@ -1,4 +1,4 @@
[ [
"assets/miniapp/mhtControl_1.0.90.zip", "assets/miniapp/mhtControl_1.0.94.zip",
"assets/xiaoe/xiaoe_1.0.0.zip" "assets/xiaoe/xiaoe_1.0.0.zip"
] ]

Binary file not shown.

View File

@@ -537,7 +537,7 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
String serviceName = ServiceConstant.server_service; String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.user_setting; String serviceApi = ServiceConstant.user_setting;
String type = "control_${tmp}"; String type = "control_${tmp}";
if(tmp['type'] != null){ if (tmp['type'] != null) {
type = "control_${tmp['mac']}_${tmp['type']}"; type = "control_${tmp['mac']}_${tmp['type']}";
} }
String queryUrl = String queryUrl =
@@ -561,4 +561,30 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
return data; return data;
} }
//查询是否需要更新提示
selectUpdateTips() async {
bool tips = false;
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.user_setting;
String type = "web_control_tip";
String queryUrl =
"${serviceAddress}${serviceName}${serviceApi}?type=$type&code=mht";
await requestWithLog(
logTitle: "查询更新提示",
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
if (res.data != null) {
tips = res.data["tip"];
}
updateAll();
},
onFailure: (res) {
print(res);
},
);
return tips;
}
} }

View File

@@ -94,35 +94,40 @@ class _NewHomePageState extends State<NewHomePage> {
//未登录 //未登录
return; return;
} }
showTipUpgradeDialog( homeController.selectUpdateTips().then((bool tips) {
context, //眠花糖更新提示
Column( if (tips) {
children: [ showTipUpgradeDialog(
SizedBox( context,
width: 94.rpx, Column(
height: 70.rpx, children: [
child: SvgPicture.asset( SizedBox(
'assets/img/icon/upgrade.svg', width: 94.rpx,
fit: BoxFit.cover, height: 70.rpx,
// color: themeController.currentColor.sc3, // 若你想加颜色控制可取消注释 child: SvgPicture.asset(
), 'assets/img/icon/upgrade.svg',
), fit: BoxFit.cover,
Text( // color: themeController.currentColor.sc3, // 若你想加颜色控制可取消注释
"web控制更新".tr, ),
style: TextStyle( ),
color: stringToColor("#333333"), Text(
fontSize: AppConstants().title_text_fontSize, "web控制更新".tr,
), style: TextStyle(
), color: stringToColor("#333333"),
Text("新版本号".tr + fontSize: AppConstants().title_text_fontSize,
"" + ),
"${pkg.version}" + ),
"" + Text("新版本号".tr +
"点击确认退出app重新进入".tr), "" +
].divide(SizedBox( "${pkg.version}" +
height: 37.rpx, "" +
)), "点击确认退出app重新进入".tr),
)); ].divide(SizedBox(
height: 37.rpx,
)),
));
}
});
}); });
} catch (e) { } catch (e) {
print(e); print(e);