hyzp_ybqx-Commit066:一套APP适应多个区县,已经实现登录验证通过后,先等待预加载数据完成后,再跳转

This commit is contained in:
WinUser01
2022-01-03 10:18:17 +08:00
parent 66ba345393
commit b31e960a17
5 changed files with 151 additions and 27 deletions
+96 -9
View File
@@ -1,16 +1,19 @@
import 'package:hyzp_ybqx/components/commonFun.dart';
import 'EncryptUtil.dart';
import 'dart:convert';
import 'commonFun.dart';
class UserInfo {
UserInfo({this.mapUserInfoRet}) {
setUserInfo(theMapUserInfoRet: mapUserInfoRet);
}
setUserInfo({Map theMapUserInfoRet}) {
Future setUserInfo({Map theMapUserInfoRet}) async {
if (200 == theMapUserInfoRet["ret"]) {
mapUserInfoRet = theMapUserInfoRet;
mapUserInfo = theMapUserInfoRet["data"];
print('mapUserInfo = ${mapUserInfo.toString()}');
setQxInfo(mapUserInfo["qx_code"], mapUserInfo["qx_name"]);
}
}
@@ -18,23 +21,107 @@ class UserInfo {
setUserInfoFaceLogin(Map _mapGetData) {
mapUserInfo['user_id'] = _mapGetData['user_id'];
mapUserInfo['token'] = _mapGetData['token'];
setQxInfo(mapUserInfo["qx_code"], mapUserInfo["qx_name"]);
}
setQxInfo(String _qx_code, String _qx_name) {
qx_code = int.parse(_qx_code.trim());
qx_name = _qx_name;
// 511528、兴文县
// int qx_code = 511528;
// String qx_name = '宜宾市兴文';
// String service_tel = '\n服务热线:187-8467-8300';
// String copyright_info = '© ' + qx_name + '生态环境局 四川省踏石科技 版权所有' + service_tel;
// String copyright_info_PinYin = 'YIBIN XINGWEN BLACK SMOKE CAR CAPTURE SYSTEM';
// // 兴文县中心地址:天泉商城
// double center_latitude = 28.29678023715008; // 区县中心纬度
// double center_longitude = 105.24189826141459; // 区县中心经度
// 511501 市辖区
// 511502 翠屏区
// 511503 南溪区
// 511504 叙州区
// 511523 江安县
// 511524 长宁县
// 511525 高县
// 511526 珙县
// 511527 筠连县
// 511528 兴文县
// 511529 屏山县
// 511501、宜宾市生态环境局、四川省踏石科技,保留客服电话
// 511502、宜宾市翠屏生态环境局,去掉客服电话
// 511505、宜宾三江新区城乡融合发展局、四川省踏石科技,保留客服电话
// 511524、宜宾市长宁生态环境局,去掉客服电话
// 511528、宜宾市兴文生态环境局、四川省踏石科技,保留客服电话
// 511527、宜宾市筠连生态环境局、四川省踏石科技,保留客服电话
qx_name_long = '宜宾市' + trim_county(qx_name);
service_tel = '\n服务热线:187-8467-8300';
copyright_info = '© ' + qx_name_long + '生态环境局 四川省踏石科技 版权所有' + service_tel;
// 中心地址:宜宾市白塔山
center_latitude = 28.77914; // 区县中心纬度
center_longitude = 104.644079; // 区县中心经度
// App开发登录用户:
// 翠屏区:mancpq
// 三江新区:mansjxq
// 长宁县:mancnx
// 高县:mangx
// 筠连县:manjlx
// 兴文县:manxwx
switch (qx_code) {
case 511502: // 翠屏区
service_tel = '';
copyright_info = '© ' + qx_name_long + '生态环境局 版权所有' + service_tel;
copyright_info_PinYin = 'YIBIN CUIPING BLACK SMOKE CAR CAPTURE SYSTEM';
break;
case 511505: // 三江新区
qx_name_long = '宜宾' + qx_name;
copyright_info = '© ' + qx_name_long + '城乡融合发展局 四川省踏石科技\n版权所有, ' + service_tel;
copyright_info_PinYin = 'YIBIN SANJIANG NEW AREA BLACK SMOKE CAR CAPTURE SYSTEM';
break;
case 511524: // 长宁县
service_tel = '';
copyright_info = '© ' + qx_name_long + '生态环境局 版权所有' + service_tel;
copyright_info_PinYin = 'YIBIN CHANGNING BLACK SMOKE CAR CAPTURE SYSTEM';
break;
case 511525: // 高县
copyright_info_PinYin = 'YIBIN GAOXIAN BLACK SMOKE CAR CAPTURE SYSTEM';
break;
case 511527: // 筠连县
copyright_info_PinYin = 'YIBIN JUNLIAN BLACK SMOKE CAR CAPTURE SYSTEM';
break;
case 511528: // 兴文县
copyright_info_PinYin = 'YIBIN XINGWEN BLACK SMOKE CAR CAPTURE SYSTEM';
// 中心地址:天泉商城
center_latitude = 28.29678023715008; // 区县中心纬度
center_longitude = 105.24189826141459; // 区县中心经度
break;
default:
break;
}
}
// 去除末尾的区县
String trim_county(String _name) {
return _name.substring(0, _name.length - 1);
}
Map mapUserInfoRet = {
"ret": 200,
"data": {
"is_login": true,
"user_id": 1,
"token": "B93EC91FA2FE293B7077162D4527FC4BB228CD6C0A4F24A882B9A8BBE6C3FB47"
"user_id": 152,
"token": "959091E2A5E362E22F22F8DBE05737A95545A43AF28B19AB3DAD5F8557EE2E29",
"qx_code": "511528",
"qx_name": "兴文县"
},
"msg": ""
};
Map mapUserInfo = {
"is_login": false,
"user_id": -1,
"token": ""
};
Map mapUserInfo = {"is_login": false, "user_id": -1, "token": "", "qx_code": "", "qx_name": ""};
//若list[i]为'',解密时会报错:aes decode error:RangeError: Value not in range: -16
String thisAndroidId = ''; //每个手机唯一的设备号
+27 -2
View File
@@ -43,8 +43,8 @@ import 'UserInfo.dart';
// 511501、宜宾市
// String APPkey = 'ijddvzgEGaxbzsbmCtpdohxHyrAArwJB'; // 宜宾市APPkey
// String service_tel = '\n服务热线:187-8467-8300';
// String qx_name = '宜宾';
// String copyright_info = '© ' + qx_name + '市生态环境局 四川省踏石科技有限公司 版权所有' + service_tel;
// String yibin_QuXian = '宜宾';
// String copyright_info = '© ' + yibin_QuXian + '市生态环境局 四川省踏石科技有限公司 版权所有' + service_tel;
// String copyright_info_PinYin = 'YIBIN BLACK SMOKE CAR CAPTURE SYSTEM';
// const serviceUrl_ybqx = 'http://125.64.218.67:9904'; // 宜宾市
@@ -74,6 +74,7 @@ const String setSphericalCameraUrl = 'http://125.64.218.67:9914/';
// 一套APP适应多个区县,等用户登录后,会返回 qx_code、qx_name
int qx_code = -1;
String qx_name = '';
String qx_name_long = '';
String service_tel = '';
String copyright_info = '';
String copyright_info_PinYin = '';
@@ -81,6 +82,18 @@ String copyright_info_PinYin = '';
double center_latitude = -1; // 区县中心纬度
double center_longitude = -1; // 区县中心经度
clear_user_info() {
qx_code = -1;
qx_name = '';
qx_name_long = '';
service_tel = '';
copyright_info = '';
copyright_info_PinYin = '';
// 区县中心地址
center_latitude = -1; // 区县中心纬度
center_longitude = -1; // 区县中心经度
}
// 511528、兴文县
// int qx_code = 511528;
// String qx_name = '宜宾市兴文';
@@ -220,6 +233,11 @@ UserInfo g_userInfo = UserInfo(mapUserInfoRet: {
"msg": ""
});
// 去除末尾的区县
String trim_county(String _name) {
return _name.substring(0, _name.length - 1);
}
Future<Map> getMapFromJson(var response) async {
String _str = json.encode(response);
Map _map = json.decode(_str);
@@ -747,6 +765,13 @@ Widget getImageWidget() {
color: Color.fromRGBO(49, 216, 123, 1),
fontWeight: FontWeight.bold)),
),
SizedBox(height: ScreenUtil().setHeight(copyright_info.contains('\n') ? 50 : 90)),
Container(
alignment: Alignment.center,
child: Text(copyright_info,
style: TextStyle(fontSize: 13, color: Color.fromRGBO(192, 192, 192, 1)),
textAlign: TextAlign.center),
),
],
),
// child: Image.asset(
+3 -3
View File
@@ -475,7 +475,7 @@ Future getAllStatisData({String ip = '', String date = ''}) async {
}
//访问区县后台接口,需要统一添加区县代码参数
map['qx_code'] = qx_code;
map['qxdm'] = qx_code;
Dio dio = Dio();
String api = ServicePath.getStaAllUrl;
@@ -735,7 +735,7 @@ Future getStatisData({@required String statisType, String ip = '', String date =
}
//访问区县后台接口,需要统一添加区县代码参数
map['qx_code'] = qx_code;
map['qxdm'] = qx_code;
Dio dio = Dio();
String api = mapStatisType[statisType]['api'];
@@ -1963,7 +1963,7 @@ Future getThePageList(
}
//访问区县后台接口,需要统一添加区县代码参数
map['qx_code'] = qx_code;
map['qxdm'] = qx_code;
print('mapHyshlx[theHyshlx][api] = ${mapHyshlx[theHyshlx]['api']}');
// mapHyshlx[theHyshlx][api] = http://125.64.218.67:9904/?s=App.Car_Hyc.GetList