Merge branch 'release' of https://gitee.com/starlock-cn/app-starlock into release
This commit is contained in:
commit
57a39ee3b6
@ -176,8 +176,4 @@ Future<void> getAgreePrivacyShowUpdate() async {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> getAppInfo() async {
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
WxPayTool.associationUrl = entity.data?.appSiteUrl ?? '';
|
||||
}
|
||||
|
||||
|
||||
@ -4,11 +4,14 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/mine/about/debug/debug_tool.dart';
|
||||
import 'package:star_lock/network/api_provider.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/bugly/bugly_tool.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/device_info_service.dart';
|
||||
import 'package:star_lock/tools/pay/wx_pay_tool.dart';
|
||||
import 'package:star_lock/tools/platform_info_services.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/xs_jPhush.dart';
|
||||
@ -30,7 +33,11 @@ FutureOr<void> main() async {
|
||||
final bool isLogin = await getLoginStatus();
|
||||
if (isLogin) {
|
||||
await privacySDKInitialization();
|
||||
Future<void>.delayed(const Duration(milliseconds: 500), getAppInfo);
|
||||
Future<void>.delayed(const Duration(milliseconds: 500), () async{
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
WxPayTool.setAssociationUrl(entity.data!.appSiteUrl!);
|
||||
});
|
||||
}
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
|
||||
@ -259,8 +259,8 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
|
||||
rightTitle: '',
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))))),
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, height: 50.h, child: _isAdmin())))),
|
||||
SizedBox(height: 30.h),
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||
|
||||
@ -470,8 +470,14 @@ class LockDetailLogic extends BaseGetXController {
|
||||
Storage.setString(saveLockAlias, state.lockAlias.value);
|
||||
} else if (event.type == 4) {
|
||||
// 4 更新了电量
|
||||
state.electricQuantity.value = int.parse(event.setResult);
|
||||
state.keyInfos.value.electricQuantity = int.parse(event.setResult);
|
||||
// state.electricQuantity.value = int.parse(event.setResult);
|
||||
// state.keyInfos.value.electricQuantity = int.parse(event.setResult);
|
||||
final int electricQuantity =
|
||||
int.tryParse(event.setResult['electricQuantity']) ?? 0;
|
||||
state.electricQuantity.value =electricQuantity;
|
||||
state.keyInfos.value.electricQuantity = electricQuantity;
|
||||
state.keyInfos.value.electricQuantityDate =
|
||||
event.setResult['uploadElectricQuantityDate'];
|
||||
} else if (event.type == 5) {
|
||||
// 5 远程开锁
|
||||
state.keyInfos.value.lockSetting!.remoteUnlock =
|
||||
|
||||
@ -1160,6 +1160,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.msgNotificationPage, arguments: <String, int?>{
|
||||
'lockId': state.keyInfos.value.lockId,
|
||||
'isSupportCatEye': state.keyInfos.value.lockFeature!.isSupportCatEye,
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
||||
@ -143,13 +143,15 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: '有人出现在门口'.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, height: 50.h, child: _switch(4)))),
|
||||
Obx(() => Visibility(
|
||||
visible: state.isSupportCatEye.value,
|
||||
child: CommonItem(
|
||||
leftTitel: '有人出现在门口'.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, height: 50.h, child: _switch(4))))),
|
||||
SizedBox(
|
||||
height: 60.h,
|
||||
),
|
||||
|
||||
@ -15,12 +15,16 @@ class MsgNotificationState {
|
||||
final String notifyEnable = '已启用'.tr;
|
||||
final String notifyDisable = '未启用'.tr;
|
||||
final String settingSuccess = '设置成功'.tr;
|
||||
var isSupportCatEye = false.obs;
|
||||
|
||||
MsgNotificationState() {
|
||||
Map map = Get.arguments;
|
||||
if (map['lockId'] != null) {
|
||||
getLockId.value = map['lockId'];
|
||||
}
|
||||
if (map['isSupportCatEye'] != null) {
|
||||
isSupportCatEye.value = map['isSupportCatEye'] == 1;
|
||||
}
|
||||
|
||||
nDaysNotOpenDoor.value = notifyEnable;
|
||||
isLowBattery.value = notifyEnable;
|
||||
|
||||
@ -259,8 +259,8 @@ class _AddPalmTypePageState extends State<AddPalmTypePage> {
|
||||
rightTitle: '',
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))))),
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, height: 50.h, child: _isAdmin())))),
|
||||
SizedBox(height: 30.h),
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||
|
||||
@ -52,6 +52,14 @@ class LockMainLogic extends BaseGetXController {
|
||||
if (Get.isRegistered<LockListLogic>()) {
|
||||
//设置控制器数据并刷新
|
||||
Get.find<LockListLogic>().setLockListInfoGroupEntity(entity);
|
||||
} else {
|
||||
//延迟加载
|
||||
Future<dynamic>.delayed(200.milliseconds, () {
|
||||
if (Get.isRegistered<LockListLogic>()) {
|
||||
//设置控制器数据并刷新
|
||||
Get.find<LockListLogic>().setLockListInfoGroupEntity(entity);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -54,9 +54,7 @@ class _StarLockMainPageState extends State<StarLockMainPage>
|
||||
if (clearScanDevices) {
|
||||
BlueManage().scanDevices.clear();
|
||||
}
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
setState(() {});
|
||||
});
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -313,16 +313,16 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
Navigator.pushNamed(
|
||||
context, Routers.aPPUnlockNeedMobileNetworkingLockPage);
|
||||
}),
|
||||
if (!F.isLite && widget.showAbout)
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.valueAddedServices!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.back();
|
||||
Get.toNamed(Routers.valueAddedServicesPage);
|
||||
},
|
||||
),
|
||||
// if (!F.isLite)
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.valueAddedServices!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.back();
|
||||
Get.toNamed(Routers.valueAddedServicesPage);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/tools/showTipView.dart';
|
||||
import '../appRouters.dart';
|
||||
import '../flavors.dart';
|
||||
import 'api.dart';
|
||||
@ -100,6 +101,9 @@ class BaseProvider extends GetConnect with Api {
|
||||
case 10001:
|
||||
EasyLoading.showToast('数据不存在', duration: 2000.milliseconds);
|
||||
break;
|
||||
case 434: //与后台约定弹出确认框提示
|
||||
ShowTipView().showSureBtnTipsAlert(T['errorMsg']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
} else if (snapshot.hasData) {
|
||||
if (snapshot.data!) {
|
||||
// 如果用户已登录,返回主页面
|
||||
getAppInfo();
|
||||
// getAppInfo();
|
||||
return F.sw(
|
||||
skyCall: () => StarLockMainPage(),
|
||||
xhjCall: () => const StarLockMainXHJPage());
|
||||
|
||||
@ -13,6 +13,7 @@ import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/main.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/pay/wx_pay_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../versionUndate/versionUndateTool.dart';
|
||||
@ -67,6 +68,7 @@ class AppFirstEnterHandle {
|
||||
Future<void> getAppInfo() async {
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
WxPayTool.setAssociationUrl(entity.data!.appSiteUrl!);
|
||||
}
|
||||
|
||||
//默认布局
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'package:fluwx/fluwx.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
///
|
||||
/// 微信支付
|
||||
@ -7,24 +8,29 @@ import 'package:fluwx/fluwx.dart';
|
||||
class WxPayTool {
|
||||
static Fluwx fluwx = Fluwx();
|
||||
static bool isInit = false;
|
||||
static String associationUrl = '';
|
||||
|
||||
static void setAssociationUrl(String associationUrl) {
|
||||
Storage.saveAssociationUrl(associationUrl);
|
||||
}
|
||||
|
||||
static init(String appId, String universalLink) {
|
||||
static Future<void> init(String appId, String universalLink) async {
|
||||
fluwx.registerApi(appId: appId, universalLink: universalLink);
|
||||
}
|
||||
|
||||
static Future<void> pay(Payment payment, WeChatResponseSubscriber listener) async {
|
||||
static Future<void> pay(
|
||||
Payment payment, WeChatResponseSubscriber listener) async {
|
||||
if (!isInit) {
|
||||
isInit = true;
|
||||
await init(payment.appId, associationUrl);
|
||||
final String _associationUrl = await Storage.getAssociationUrl();
|
||||
await init(payment.appId, _associationUrl);
|
||||
//回调
|
||||
responseListener(WeChatResponse response) {
|
||||
void responseListener(WeChatResponse response) {
|
||||
if (response is WeChatPaymentResponse) {
|
||||
//支付回调
|
||||
listener.call(response);
|
||||
}
|
||||
}
|
||||
|
||||
//开启监听
|
||||
fluwx.addSubscriber(responseListener);
|
||||
}
|
||||
|
||||
@ -13,7 +13,8 @@ typedef BlockIsHaveAllDataCallback = void Function(bool isAllData);
|
||||
|
||||
class ShowTipView {
|
||||
// 只有一个确定按钮
|
||||
void showSureAlertDialog(String contentStr, {String? tipTitle, String? sureStr}) {
|
||||
void showSureAlertDialog(String contentStr,
|
||||
{String? tipTitle, String? sureStr}) {
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (BuildContext context) {
|
||||
@ -121,4 +122,23 @@ class ShowTipView {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 只有一个确定按钮
|
||||
void showSureBtnTipsAlert(String tipsText) {
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (BuildContext context) {
|
||||
return CupertinoAlertDialog(
|
||||
content: Text(tipsText),
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child:
|
||||
Text('确定'.tr, style: TextStyle(color: AppColors.mainColor)),
|
||||
onPressed: Get.back,
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,6 +28,7 @@ const String saveUserLoginData = 'userLoginData';
|
||||
const String saveLockMainListData = 'lockMainListData';
|
||||
const String isOpenDeBug = 'isOpenDeBug'; //是否打开 debug
|
||||
const String automaticLockOffTime = 'automaticLockOffTime'; //自动关锁时间
|
||||
const String associationUrl = 'associationUrl'; //ios跳转微信的 url
|
||||
|
||||
class Storage {
|
||||
factory Storage() => _instance;
|
||||
@ -223,4 +224,14 @@ class Storage {
|
||||
final String data = await Storage.getString(automaticLockOffTime) ?? '0';
|
||||
return data;
|
||||
}
|
||||
|
||||
//设置自动关锁时间
|
||||
static Future<void> saveAssociationUrl(String data) async {
|
||||
await Storage.setString(associationUrl, data);
|
||||
}
|
||||
|
||||
static Future<String> getAssociationUrl() async {
|
||||
final String data = await Storage.getString(associationUrl) ?? '0';
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,8 +66,10 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# 1.0.56+2024060502:xhj 线上环境,对外发布,提交测试
|
||||
# 1.0.57+2024060702:xhj 线上环境,对外发布,提交测试
|
||||
# 1.0.58+2024060702:xhj 线上环境,对外发布,提交测试
|
||||
# 1.0.59+2024060703:xhj 线上环境,对外发布,提交测试
|
||||
# 1.0.60+2024061101:xhj 线上环境,对外发布,提交测试
|
||||
|
||||
version: 1.0.58+2024060702
|
||||
version: 1.0.60+2024061101
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user