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.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'
// HMS Core Push
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>
<app appid="__UNI__ACD00DA" 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
/// when the Flutter Engine is detached from the Activity
private lateinit var channel : MethodChannel
private lateinit var context : Context;
private lateinit var context : Context
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
context = flutterPluginBinding.applicationContext;
@ -44,7 +44,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler {
.setMenuDefFontColor("#000000")
.setMenuDefFontWeight("normal")
.setMenuActionSheetItems(sheetItems)
.setEnableBackground(true)
.setEnableBackground(false) //后台运行
.build()
DCUniMPSDK.getInstance().initialize(context, config) {
result.success(it)
@ -60,6 +60,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler {
}
DCUniMPSDK.getInstance().setUniMPOnCloseCallBack {
Logger.e("用户点击了退出 it: $it")
DCUniMPSDK.getInstance().closeCurrentApp()
}
}
} else if (call.method == "isInitialize") {

18
lib/login/login_page.dart

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

5
lib/main.dart

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

8
lib/retrofit/retrofit_api.dart

@ -37,11 +37,11 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
const baseUrl = "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 base_url = "http://192.168.10.236:8766/app/"; ///
// const baseUrl = "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 base_url = "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) {
miniAppids.forEach((element) async {
print("appid: $element");
await Min.closeCurrentApp();
String path = await Min.getAppBasePath(element);
AppUtils.deleteDirectory(Directory(path));
String filePath = "";

4
lib/union/union_details_page.dart

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

48
lib/union/union_view/store_info.dart

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

7
lib/view_widget/mine_vip_view.dart

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

Loading…
Cancel
Save