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