|
@@ -29,10 +29,14 @@ class UpdateModel { |
|
@@ -29,10 +29,14 @@ class UpdateModel { |
|
29
|
String deviceId = await Utils.getUUID();
|
29
|
String deviceId = await Utils.getUUID();
|
|
30
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
30
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
31
|
int versionCode = await Utils.getCurrBuildNum();
|
31
|
int versionCode = await Utils.getCurrBuildNum();
|
|
|
|
32
|
+ String make="3";
|
|
|
|
33
|
+ if(Platform.isIOS)make="4";
|
|
32
|
Map<String, String> params = {
|
34
|
Map<String, String> params = {
|
|
33
|
"deviceId": deviceId,
|
35
|
"deviceId": deviceId,
|
|
34
|
"sid": userModel.user.sellerid,
|
36
|
"sid": userModel.user.sellerid,
|
|
35
|
- "versionCode": versionCode.toString()
|
37
|
+ "versionCode": versionCode.toString(),
|
|
|
|
38
|
+ "flag":"4",
|
|
|
|
39
|
+ "make":make,//3 android 4 ios
|
|
36
|
};
|
40
|
};
|
|
37
|
BaseResp<List> baseResp = await DioUtil()
|
41
|
BaseResp<List> baseResp = await DioUtil()
|
|
38
|
.request<List>(context, Method.get, HttpUrl.check_update, data: params)
|
42
|
.request<List>(context, Method.get, HttpUrl.check_update, data: params)
|
|
@@ -41,12 +45,13 @@ class UpdateModel { |
|
@@ -41,12 +45,13 @@ class UpdateModel { |
|
41
|
});
|
45
|
});
|
|
42
|
if (baseResp.code == Constant.status_success) {
|
46
|
if (baseResp.code == Constant.status_success) {
|
|
43
|
LogUtil.v(baseResp.data);
|
47
|
LogUtil.v(baseResp.data);
|
|
44
|
- Map<String, String> dataMap = baseResp.data[0];
|
|
|
|
45
|
- if (int.parse(dataMap["version"]) > versionCode) {
|
48
|
+ Map<String, dynamic> dataMap = baseResp.data[0];
|
|
|
|
49
|
+ if (int.parse(dataMap["version"].toString()) > versionCode) {
|
|
46
|
Version version = Version.fromJson({
|
50
|
Version version = Version.fromJson({
|
|
47
|
- "version": dataMap["versionName"],
|
|
|
|
48
|
- "file_url":dataMap["file_url"],
|
|
|
|
49
|
- "content": dataMap["content"]
|
51
|
+ "name":dataMap["name"].toString(),
|
|
|
|
52
|
+ "version": dataMap["version"].toString(),
|
|
|
|
53
|
+ "file_url":dataMap["file_url"].toString(),
|
|
|
|
54
|
+ "content": dataMap["content"].toString()
|
|
50
|
});
|
55
|
});
|
|
51
|
showUpdateDialog(context, version);
|
56
|
showUpdateDialog(context, version);
|
|
52
|
}
|
57
|
}
|
|
@@ -93,7 +98,7 @@ class UpdateModel { |
|
@@ -93,7 +98,7 @@ class UpdateModel { |
|
93
|
children: <Widget>[
|
98
|
children: <Widget>[
|
|
94
|
Center(
|
99
|
Center(
|
|
95
|
child: Text(
|
100
|
child: Text(
|
|
96
|
- "${version.version}版本更新啦",
|
101
|
+ "${version.name}版本更新啦",
|
|
97
|
style: TextStyle(
|
102
|
style: TextStyle(
|
|
98
|
fontSize: ScreenUtil().setSp(36),
|
103
|
fontSize: ScreenUtil().setSp(36),
|
|
99
|
color: MyColours.color_353535),
|
104
|
color: MyColours.color_353535),
|