Browse Source

safety

master
fmk 3 years ago
parent
commit
6b2cffa34e
  1. 2
      android/app/build.gradle
  2. 2
      android/app/src/main/assets/data/dcloud_control.xml
  3. 5
      android/app/src/main/kotlin/com/zsw/huixiang/MinPlugin.kt
  4. 18
      lib/login/login_page.dart
  5. 5
      lib/main.dart
  6. 8
      lib/retrofit/retrofit_api.dart
  7. 1
      lib/setting/setting_page.dart
  8. 4
      lib/union/union_details_page.dart
  9. 48
      lib/union/union_view/store_info.dart
  10. 7
      lib/view_widget/mine_vip_view.dart

2
android/app/build.gradle

@ -190,6 +190,8 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.12.0' implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'com.alibaba:fastjson:1.2.54' implementation 'com.alibaba:fastjson:1.2.54'
implementation 'com.tencent.tpns:xiaomi:1.2.7.1-release'
implementation 'com.tencent.tpns:huawei:1.2.6.0-release' implementation 'com.tencent.tpns:huawei:1.2.6.0-release'
// HMS Core Push // HMS Core Push
implementation 'com.huawei.hms:push:5.3.0.304' implementation 'com.huawei.hms:push:5.3.0.304'

2
android/app/src/main/assets/data/dcloud_control.xml

@ -1,4 +1,4 @@
<hbuilder version="1.9.9.80110" debug="false" syncDebug ="false"> <hbuilder version="1.9.9.80110" debug="false" syncDebug ="true">
<apps> <apps>
<app appid="__UNI__ACD00DA" appver="1.0"/> <app appid="__UNI__ACD00DA" appver="1.0"/>
<app appid="__UNI__E60E056" appver="1.0"/> <app appid="__UNI__E60E056" appver="1.0"/>

5
android/app/src/main/kotlin/com/zsw/huixiang/MinPlugin.kt

@ -24,7 +24,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler {
/// This local reference serves to register the plugin with the Flutter Engine and unregister it /// This local reference serves to register the plugin with the Flutter Engine and unregister it
/// when the Flutter Engine is detached from the Activity /// when the Flutter Engine is detached from the Activity
private lateinit var channel : MethodChannel private lateinit var channel : MethodChannel
private lateinit var context : Context; private lateinit var context : Context
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
context = flutterPluginBinding.applicationContext; context = flutterPluginBinding.applicationContext;
@ -44,7 +44,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler {
.setMenuDefFontColor("#000000") .setMenuDefFontColor("#000000")
.setMenuDefFontWeight("normal") .setMenuDefFontWeight("normal")
.setMenuActionSheetItems(sheetItems) .setMenuActionSheetItems(sheetItems)
.setEnableBackground(true) .setEnableBackground(false) //后台运行
.build() .build()
DCUniMPSDK.getInstance().initialize(context, config) { DCUniMPSDK.getInstance().initialize(context, config) {
result.success(it) result.success(it)
@ -60,6 +60,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler {
} }
DCUniMPSDK.getInstance().setUniMPOnCloseCallBack { DCUniMPSDK.getInstance().setUniMPOnCloseCallBack {
Logger.e("用户点击了退出 it: $it") Logger.e("用户点击了退出 it: $it")
DCUniMPSDK.getInstance().closeCurrentApp()
} }
} }
} else if (call.method == "isInitialize") { } else if (call.method == "isInitialize") {

18
lib/login/login_page.dart

@ -85,11 +85,12 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
Image image; Image image;
buildImageInfo(BuildContext context) async { buildImageInfo(BuildContext context) async {
image = Image.asset("assets/image/laoban.png"); image = Image.asset("assets/image/laoban.png");
double screenWidth = MediaQuery.of(this.context).size.width;
image.image image.image
.resolve(ImageConfiguration()) .resolve(ImageConfiguration())
.addListener(ImageStreamListener((ImageInfo info, bool _) { .addListener(ImageStreamListener((ImageInfo info, bool _) {
double width = info.image.width.toDouble(); double width = info.image.width.toDouble();
double screenWidth = 375; if (!mounted) return;
if ((width / screenWidth) < rota) { if ((width / screenWidth) < rota) {
rota = (screenWidth * 1.04) / width; rota = (screenWidth * 1.04) / width;
} }
@ -98,22 +99,11 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
})); }));
} }
@override
void didChangeDependencies() {
super.didChangeDependencies();
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
isLogin(); isLogin();
try {
buildImageInfo(this.context);
} catch(ex) {}
} }
initController() { initController() {
@ -390,6 +380,10 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
try {
buildImageInfo(this.context);
} catch(ex) {}
if (animatedContainer != null && !animatedContainer.isAnimating) { if (animatedContainer != null && !animatedContainer.isAnimating) {
animatedContainer.forward(); animatedContainer.forward();
} }

5
lib/main.dart

@ -110,8 +110,9 @@ initSdk() async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi(); XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi();
// //
// androidApi.setMiPushAppId(appId:"APP_ID"); androidApi.setMiPushAppId(appId:"2882303761520050452");
// androidApi.setMiPushAppKey(appKey: "APPKEY"); androidApi.setMiPushAppKey(appKey: "5582005091452");
androidApi.enableOtherPush(); androidApi.enableOtherPush();
androidApi.regPush(); androidApi.regPush();
} }

8
lib/retrofit/retrofit_api.dart

@ -37,11 +37,11 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/"; /// // const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; /// // const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// const base_url = "http://192.168.10.236:8766/app/"; /// const base_url = "http://192.168.10.236:8766/app/"; ///
// const baseUrl = "http://192.168.10.236:8766/app/"; /// const baseUrl = "http://192.168.10.236:8766/app/"; ///
// const base_url = "http://192.168.10.37:8766/app/"; // const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";

1
lib/setting/setting_page.dart

@ -190,6 +190,7 @@ class _SettingPage extends State<SettingPage> {
if (miniAppids != null && miniAppids.length > 0) { if (miniAppids != null && miniAppids.length > 0) {
miniAppids.forEach((element) async { miniAppids.forEach((element) async {
print("appid: $element"); print("appid: $element");
await Min.closeCurrentApp();
String path = await Min.getAppBasePath(element); String path = await Min.getAppBasePath(element);
AppUtils.deleteDirectory(Directory(path)); AppUtils.deleteDirectory(Directory(path));
String filePath = ""; String filePath = "";

4
lib/union/union_details_page.dart

@ -265,8 +265,8 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
"tenantCode": storeInfo.tenantCode, "tenantCode": storeInfo.tenantCode,
if (latitude != null && longitude != null) if (latitude != null && longitude != null)
"position": "$latitude,$longitude", "position": "$latitude,$longitude",
"baseURL": "https://pos.api.lotus-wallet.com/app/", // "baseURL": "https://pos.api.lotus-wallet.com/app/",
// "baseURL": "http://192.168.10.236:8765/app/", "baseURL": "http://192.168.10.236:8765/app/",
"uid": userId, "uid": userId,
"userInfo": { "userInfo": {
"nickname": nickname, "nickname": nickname,

48
lib/union/union_view/store_info.dart

@ -66,35 +66,37 @@ class _StoreInfos extends State<StoreInfos> {
children: [ children: [
Row( Row(
children: [ children: [
Text(
widget.storeInfo != null
? widget.storeInfo.storeName
: "",
style: TextStyle(
fontSize: 16.sp,
color: Colors.black,
fontWeight: MyFontWeight.medium,
),
),
Expanded( Expanded(
child: Container( child: Container(
alignment: alignment:
Alignment.centerRight, Alignment.centerLeft,
child: Text( child: Text(
S.of(context).ren( widget.storeInfo != null
widget.storeInfo != null ? widget.storeInfo.storeName
? widget.storeInfo : "",
.perCapitaConsumption overflow: TextOverflow.ellipsis,
: "",
),
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.regular, color: Colors.black,
color: Color(0xFF353535), fontWeight: MyFontWeight.medium,
), ),
), ),
), ),
), ),
Text(
S.of(context).ren(
widget.storeInfo != null
? widget.storeInfo
.perCapitaConsumption
: "",
),
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
], ],
), ),
Text( Text(
@ -117,10 +119,8 @@ class _StoreInfos extends State<StoreInfos> {
), ),
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(

7
lib/view_widget/mine_vip_view.dart

@ -312,9 +312,10 @@ class MineVipView extends StatelessWidget {
}); });
} }
}, },
child: (tag == null || tag == "") child: widget,
? widget //(tag == null || tag == "")
: Hero(tag: tag, child: widget), // ? widget
// : Hero(tag: tag, child: widget)
); );
} }
} }

Loading…
Cancel
Save