Merge branch 'master' of gitee.com:starlock-cn/app-starlock
# Conflicts: # star_lock/lib/network/api.dart # star_lock/lib/network/api_provider.dart # star_lock/lib/network/api_repository.dart 合并代码
This commit is contained in:
commit
e94be5a718
@ -687,6 +687,7 @@
|
||||
|
||||
"虹膜":"虹膜",
|
||||
"手掌":"手掌",
|
||||
|
||||
"商城":"商城",
|
||||
"我的":"我的",
|
||||
"微信公众号推送":"微信公众号推送"
|
||||
|
||||
@ -44,6 +44,7 @@ import 'package:star_lock/mine/mineSet/transferGateway/selectGetewayList_page.da
|
||||
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_page.dart';
|
||||
import 'package:star_lock/mine/mineSet/transferSmartLock/selectBranch/selectBranch_page.dart';
|
||||
import 'package:star_lock/mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_page.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_page.dart';
|
||||
|
||||
import 'common/safetyVerification/safetyVerification_page.dart';
|
||||
import 'login/forgetPassword/starLock_forgetPassword_page.dart';
|
||||
@ -184,7 +185,7 @@ import 'mine/valueAddedServices/valueAddedServicesEmailTemplate/valueAddedServic
|
||||
import 'mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_page.dart';
|
||||
import 'mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_page.dart';
|
||||
import 'mine/valueAddedServices/valueAddedServicesNoteAndEmailDetail/valueAddedServicesNoteAndEmailDetail_page.dart';
|
||||
import 'mine/valueAddedServices/valueAddedServicesRealName/valueAddedServicesRealName_page.dart';
|
||||
import 'mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_page.dart';
|
||||
import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/valueAddedServicesAddSMSTemplate_page.dart';
|
||||
import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/valueAddedServicesListSMSTemplate_page.dart';
|
||||
import 'mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdministratorList_page.dart';
|
||||
@ -326,6 +327,8 @@ abstract class Routers {
|
||||
'/ValueAddedServicesNoteAndEmailDetailPage'; // 增值服务-短信邮件详情
|
||||
static const valueAddedServicesRealNamePage =
|
||||
'/ValueAddedServicesRealNamePage'; // 增值服务-实名认证详情
|
||||
static const valueAddedServicesRecordPage =
|
||||
'/valueAddedServicesRecordPage'; // 增值服务-记录
|
||||
static const valueAddedServicesHighFunctionPage =
|
||||
'/ValueAddedServicesHighFunctionPage'; // 增值服务-高级功能
|
||||
static const valueAddedServicesBuyPage =
|
||||
@ -811,6 +814,10 @@ abstract class AppRouters {
|
||||
name: Routers.valueAddedServicesRealNamePage,
|
||||
page: () => const ValueAddedServicesRealNamePage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.valueAddedServicesRecordPage,
|
||||
page: () => ValueAddedServicesRecordPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.valueAddedServicesBuyPage,
|
||||
page: () => const ValueAddedServicesBuyPage(),
|
||||
|
||||
@ -132,10 +132,10 @@ class F {
|
||||
return const StarLockAMapKey(
|
||||
androidKey: 'fb0d2a3e4208b36452cf636aa025a24f',
|
||||
iosKey: '86ca725a12a629c280e116a317aaba19');
|
||||
// case Flavor.xhj:
|
||||
// return const StarLockAMapKey(
|
||||
// androidKey: 'todo',
|
||||
// iosKey: 'todo');
|
||||
case Flavor.xhj:
|
||||
return const StarLockAMapKey(
|
||||
androidKey: '9dd8073a2e96870b206269bb562a887a',
|
||||
iosKey: 'c70047e60ce704d945ea89d6c2763b82');
|
||||
default:
|
||||
throw Exception('flavor[$name] aMapKey not found');
|
||||
}
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
class FaceAuthenticationEntity {
|
||||
FaceAuthenticationEntity({
|
||||
this.description,
|
||||
this.errorCode,
|
||||
this.errorMsg,
|
||||
});
|
||||
|
||||
FaceAuthenticationEntity.fromJson(dynamic json) {
|
||||
description = json['description'];
|
||||
errorCode = json['errorCode'];
|
||||
errorMsg = json['errorMsg'];
|
||||
}
|
||||
|
||||
String? description;
|
||||
int? errorCode;
|
||||
String? errorMsg;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map['description'] = description;
|
||||
map['errorCode'] = errorCode;
|
||||
map['errorMsg'] = errorMsg;
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@ -1,209 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
import '../../../tools/commonItem.dart';
|
||||
import '../../../tools/titleAppBar.dart';
|
||||
import '../../../translations/trans_lib.dart';
|
||||
|
||||
class ValueAddedServicesRealNamePage extends StatefulWidget {
|
||||
const ValueAddedServicesRealNamePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<ValueAddedServicesRealNamePage> createState() =>
|
||||
_ValueAddedServicesRealNamePageState();
|
||||
}
|
||||
|
||||
class _ValueAddedServicesRealNamePageState
|
||||
extends State<ValueAddedServicesRealNamePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: 1.sw,
|
||||
// color: Colors.grey.shade300,
|
||||
padding: EdgeInsets.only(
|
||||
left: 25.h, right: 25.h, top: 25.h, bottom: 10.h),
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.buyRealNameTip!.tr,
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
||||
)),
|
||||
middleWidget(),
|
||||
bottomWidget()
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget middleWidget() {
|
||||
return Container(
|
||||
width: 1.sw,
|
||||
// height: 100,
|
||||
// color: Colors.grey.shade300,
|
||||
margin: EdgeInsets.all(10.h),
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
"images/mine/icon_mine_valueAddedServices_noteTop.png"),
|
||||
fit: BoxFit.cover)),
|
||||
child: Column(children: [
|
||||
// SizedBox(height:10),
|
||||
Container(
|
||||
margin:
|
||||
const EdgeInsets.only(top: 15, bottom: 15, left: 30, right: 30),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"${TranslationLoader.lanKeys!.currentRemainingQuantity!.tr}:0",
|
||||
style: TextStyle(fontSize: 24.sp),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
// SizedBox(height:20.h),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(top: 10, bottom: 10),
|
||||
// color: Colors.red,
|
||||
// height: 100.h,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
width: 200.w,
|
||||
// height: 70.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text(TranslationLoader.lanKeys!.record!.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: 24.sp)))),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// Navigator.pushNamed(
|
||||
// context, Routers.valueAddedServicesBuyPage,
|
||||
// arguments: 3);
|
||||
},
|
||||
child: Container(
|
||||
width: 200.w,
|
||||
// height: 70.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text(TranslationLoader.lanKeys!.buy!.tr,
|
||||
style: TextStyle(
|
||||
// color: AppColors.mainColor,
|
||||
color: AppColors.blackColor,
|
||||
fontSize: 24.sp)))),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]));
|
||||
}
|
||||
|
||||
Widget bottomWidget() {
|
||||
return Container(
|
||||
width: 1.sw,
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.all(20.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 20.h, bottom: 20.h, left: 30.w),
|
||||
child: Text(
|
||||
TranslationLoader
|
||||
.lanKeys!.buyRealNameSelectYouWantBuyTip!.tr,
|
||||
style:
|
||||
TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600),
|
||||
)),
|
||||
],
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.forTheFirstTime!.tr,
|
||||
rightTitle: "",
|
||||
allHeight: 60.h,
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: GestureDetector(
|
||||
onTap: () {},
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.onceDay!.tr,
|
||||
rightTitle: "",
|
||||
allHeight: 60.h,
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: GestureDetector(
|
||||
onTap: () {},
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.weekOnce!.tr,
|
||||
rightTitle: "",
|
||||
allHeight: 60.h,
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: GestureDetector(
|
||||
onTap: () {},
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.monthOnce!.tr,
|
||||
rightTitle: "",
|
||||
allHeight: 60.h,
|
||||
isHaveLine: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: GestureDetector(
|
||||
onTap: () {},
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:get/utils.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/face_authentication_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../network/api_repository.dart';
|
||||
import '../../../tools/eventBusEventManage.dart';
|
||||
|
||||
class ValueAddedServicesRealNameLogic extends BaseGetXController {
|
||||
final ValueAddedServicesRealNameState state =
|
||||
ValueAddedServicesRealNameState();
|
||||
|
||||
//请求消息列表
|
||||
Future<bool> setFaceAuthentication(int faceAuthFrequence) async {
|
||||
FaceAuthenticationEntity entity =
|
||||
await ApiRepository.to.setFaceAuthentication(
|
||||
faceAuthFrequence: faceAuthFrequence,
|
||||
);
|
||||
return entity.errorCode!.codeIsSuccessful;
|
||||
}
|
||||
|
||||
Future<void> check(int index) async {
|
||||
bool isSuccessful = await setFaceAuthentication(state.index + 1);
|
||||
if (isSuccessful) {
|
||||
showToast('修改成功'.tr);
|
||||
state.index = index;
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,186 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_logic.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_arg.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
import '../../../tools/commonItem.dart';
|
||||
import '../../../tools/titleAppBar.dart';
|
||||
import '../../../translations/trans_lib.dart';
|
||||
|
||||
class ValueAddedServicesRealNamePage extends StatefulWidget {
|
||||
const ValueAddedServicesRealNamePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<ValueAddedServicesRealNamePage> createState() =>
|
||||
_ValueAddedServicesRealNamePageState();
|
||||
}
|
||||
|
||||
class _ValueAddedServicesRealNamePageState
|
||||
extends State<ValueAddedServicesRealNamePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<ValueAddedServicesRealNameLogic>(
|
||||
init: ValueAddedServicesRealNameLogic(),
|
||||
builder: (ValueAddedServicesRealNameLogic logic) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: 1.sw,
|
||||
// color: Colors.grey.shade300,
|
||||
padding: EdgeInsets.only(
|
||||
left: 25.h, right: 25.h, top: 25.h, bottom: 10.h),
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.buyRealNameTip!.tr,
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
||||
)),
|
||||
middleWidget(),
|
||||
bottomWidget()
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget middleWidget() {
|
||||
return Container(
|
||||
width: 1.sw,
|
||||
// height: 100,
|
||||
// color: Colors.grey.shade300,
|
||||
margin: EdgeInsets.all(10.h),
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
"images/mine/icon_mine_valueAddedServices_noteTop.png"),
|
||||
fit: BoxFit.cover)),
|
||||
child: Column(children: [
|
||||
// SizedBox(height:10),
|
||||
Container(
|
||||
margin:
|
||||
const EdgeInsets.only(top: 15, bottom: 15, left: 30, right: 30),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"${TranslationLoader.lanKeys!.currentRemainingQuantity!.tr}:0",
|
||||
style: TextStyle(fontSize: 24.sp),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
// SizedBox(height:20.h),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(top: 10, bottom: 10),
|
||||
// color: Colors.red,
|
||||
// height: 100.h,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.valueAddedServicesRecordPage,
|
||||
arguments: UseRecordListArg.cloudauth);
|
||||
},
|
||||
child: Container(
|
||||
width: 200.w,
|
||||
// height: 70.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text(TranslationLoader.lanKeys!.record!.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: 24.sp)))),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// Navigator.pushNamed(
|
||||
// context, Routers.valueAddedServicesBuyPage,
|
||||
// arguments: 3);
|
||||
},
|
||||
child: Container(
|
||||
width: 200.w,
|
||||
// height: 70.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text(TranslationLoader.lanKeys!.buy!.tr,
|
||||
style: TextStyle(
|
||||
// color: AppColors.mainColor,
|
||||
color: AppColors.blackColor,
|
||||
fontSize: 24.sp)))),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]));
|
||||
}
|
||||
|
||||
Widget bottomWidget() {
|
||||
return GetBuilder<ValueAddedServicesRealNameLogic>(
|
||||
builder: (ValueAddedServicesRealNameLogic logic) {
|
||||
return Container(
|
||||
width: 1.sw,
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.all(20.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
padding:
|
||||
EdgeInsets.only(top: 20.h, bottom: 20.h, left: 30.w),
|
||||
child: Text(
|
||||
TranslationLoader
|
||||
.lanKeys!.buyRealNameSelectYouWantBuyTip!.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp, fontWeight: FontWeight.w600),
|
||||
)),
|
||||
],
|
||||
),
|
||||
checkCommonItem(
|
||||
logic, TranslationLoader.lanKeys!.forTheFirstTime!.tr, 0),
|
||||
checkCommonItem(logic, TranslationLoader.lanKeys!.onceDay!.tr, 1),
|
||||
checkCommonItem(logic, TranslationLoader.lanKeys!.weekOnce!.tr, 2),
|
||||
checkCommonItem(logic, TranslationLoader.lanKeys!.monthOnce!.tr, 3,
|
||||
isHaveLine: false, isHaveRightWidget: true),
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
//选择组件
|
||||
Widget checkCommonItem(
|
||||
ValueAddedServicesRealNameLogic logic, String text, int index,
|
||||
{bool isHaveLine = true, bool isHaveRightWidget = true}) {
|
||||
bool check = logic.state.index == index;
|
||||
return CommonItem(
|
||||
leftTitel: text,
|
||||
rightTitle: "",
|
||||
allHeight: 60.h,
|
||||
isHaveLine: isHaveLine,
|
||||
isHaveRightWidget: isHaveRightWidget,
|
||||
rightWidget: GestureDetector(
|
||||
onTap: () {
|
||||
logic.check(index);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
check
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
class ValueAddedServicesRealNameState {
|
||||
int index = 0;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
class BuyRecordListEntity {
|
||||
BuyRecordListEntity({
|
||||
this.description,
|
||||
this.errorCode,
|
||||
this.errorMsg,
|
||||
});
|
||||
|
||||
BuyRecordListEntity.fromJson(dynamic json) {
|
||||
description = json['description'];
|
||||
errorCode = json['errorCode'];
|
||||
errorMsg = json['errorMsg'];
|
||||
}
|
||||
|
||||
String? description;
|
||||
int? errorCode;
|
||||
String? errorMsg;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map['description'] = description;
|
||||
map['errorCode'] = errorCode;
|
||||
map['errorMsg'] = errorMsg;
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
class UseRecordListArg {
|
||||
static Map<String, String> sms = {
|
||||
'type': 'sms',
|
||||
};
|
||||
static Map<String, String> vip = {
|
||||
'type': 'vip',
|
||||
};
|
||||
static Map<String, String> email = {
|
||||
'type': 'email',
|
||||
};
|
||||
static Map<String, String> cloudauth = {
|
||||
'type': 'cloudauth',
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
class UseRecordListEntity {
|
||||
UseRecordListEntity({
|
||||
this.description,
|
||||
this.errorCode,
|
||||
this.errorMsg,
|
||||
});
|
||||
|
||||
UseRecordListEntity.fromJson(dynamic json) {
|
||||
description = json['description'];
|
||||
errorCode = json['errorCode'];
|
||||
errorMsg = json['errorMsg'];
|
||||
}
|
||||
|
||||
String? description;
|
||||
int? errorCode;
|
||||
String? errorMsg;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map['description'] = description;
|
||||
map['errorCode'] = errorCode;
|
||||
map['errorMsg'] = errorMsg;
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/utils.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/face_authentication_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/buy_record_list_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../network/api_repository.dart';
|
||||
import '../../../tools/eventBusEventManage.dart';
|
||||
|
||||
class ValueAddedServicesRecordLogic extends BaseGetXController {
|
||||
ValueAddedServicesRecordLogic();
|
||||
|
||||
final ValueAddedServicesRecordState state = ValueAddedServicesRecordState();
|
||||
int buyPageNo = 1;
|
||||
late String type;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
dynamic data = Get.arguments;
|
||||
if (data is! Map && data['type'] is! String) {
|
||||
Get.back();
|
||||
return;
|
||||
}
|
||||
type = data['type'];
|
||||
}
|
||||
|
||||
//请求消息列表
|
||||
Future<void> loadBuyRecordList(bool load) async {
|
||||
if (!load) {
|
||||
buyPageNo = 1;
|
||||
}
|
||||
BuyRecordListEntity entity = await ApiRepository.to.getBuyRecordList(
|
||||
type: type,
|
||||
recordType: 10,
|
||||
pageNo: buyPageNo,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {}
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
import 'package:easy_refresh/easy_refresh.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_logic.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
import '../../../tools/titleAppBar.dart';
|
||||
|
||||
class ValueAddedServicesRecordPage extends StatefulWidget {
|
||||
ValueAddedServicesRecordPage({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<ValueAddedServicesRecordPage> createState() =>
|
||||
_ValueAddedServicesRealNamePageState();
|
||||
}
|
||||
|
||||
class _ValueAddedServicesRealNamePageState
|
||||
extends State<ValueAddedServicesRecordPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<ValueAddedServicesRecordLogic>(
|
||||
init: ValueAddedServicesRecordLogic(),
|
||||
builder: (ValueAddedServicesRecordLogic logic) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: '记录'.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: DefaultTabController(
|
||||
length: 2,
|
||||
child: Column(
|
||||
children: [
|
||||
TabBar(
|
||||
tabs: [
|
||||
Text('购买记录'.tr),
|
||||
Text('使用记录'.tr),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: TabBarView(children: [
|
||||
_PurchaseRecords(),
|
||||
Text('使用记录'),
|
||||
]),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class _PurchaseRecords extends StatefulWidget {
|
||||
const _PurchaseRecords({key});
|
||||
|
||||
@override
|
||||
State<_PurchaseRecords> createState() => _PurchaseRecordsState();
|
||||
}
|
||||
|
||||
//购买记录
|
||||
class _PurchaseRecordsState extends State<_PurchaseRecords> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<ValueAddedServicesRecordLogic>(
|
||||
builder: (ValueAddedServicesRecordLogic logic) {
|
||||
return EasyRefresh(
|
||||
onRefresh: () async {},
|
||||
onLoad: () async {},
|
||||
child: ListView.builder(itemBuilder: (BuildContext context, int index) {
|
||||
return SizedBox();
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
class ValueAddedServicesRecordState {
|
||||
int index = 0;
|
||||
}
|
||||
@ -198,4 +198,11 @@ abstract class Api {
|
||||
final String setWechatPushSwitchURL =
|
||||
'/user/setMpWechatPushSwitch'; //设置微信公众号推送
|
||||
final String getMpWechatQrCodeURL = '/user/getMpWechatQrCode'; //获取微信公众号二维码
|
||||
|
||||
final String setFaceAuthenticationURL =
|
||||
'/v2/service/setFaceAuthentication'; //设置实名认证频次
|
||||
|
||||
final String getBuyRecordListURL = '/v2/service/getBuyRecordList'; //获取购买记录列表
|
||||
|
||||
final String getUseRecordListURL = '/v2/service/getUseRecordList'; //获取使用记录列表
|
||||
}
|
||||
|
||||
@ -281,6 +281,7 @@ class ApiProvider extends BaseProvider {
|
||||
"startDate": startDate,
|
||||
'endDate': endDate,
|
||||
}));
|
||||
|
||||
// 锁记录上传
|
||||
Future<Response> lockRecordUploadData(String lockId, List records) => post(
|
||||
lockRecordUploadURL.toUrl,
|
||||
@ -1791,6 +1792,35 @@ class ApiProvider extends BaseProvider {
|
||||
// 获取微信公众号二维码
|
||||
Future<Response> getMpWechatQrCode() =>
|
||||
post(getMpWechatQrCodeURL.toUrl, jsonEncode({}));
|
||||
|
||||
// 设置实名认证频次
|
||||
Future<Response> setFaceAuthentication(int faceAuthFrequence) => post(
|
||||
setFaceAuthenticationURL.toUrl,
|
||||
jsonEncode({
|
||||
'face_auth_frequence': faceAuthFrequence,
|
||||
}));
|
||||
|
||||
// 获取使用记录列表
|
||||
Future<Response> getBuyRecordList(
|
||||
String type, int recordType, int pageNo, int pageSize) =>
|
||||
post(
|
||||
getBuyRecordListURL.toUrl,
|
||||
jsonEncode({
|
||||
'type': type,
|
||||
'record_type': recordType,
|
||||
'pageNo': pageNo,
|
||||
'pageSize': pageSize,
|
||||
}));
|
||||
|
||||
// 获取使用记录列表
|
||||
Future<Response> getUseRecordList(String type, int pageNo, int pageSize) =>
|
||||
post(
|
||||
getUseRecordListURL.toUrl,
|
||||
jsonEncode({
|
||||
'type': type,
|
||||
'pageNo': pageNo,
|
||||
'pageSize': pageSize,
|
||||
}));
|
||||
}
|
||||
|
||||
extension ExtensionString on String {
|
||||
|
||||
@ -22,6 +22,9 @@ import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireFinge
|
||||
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList/keyListByUserEntity.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/weChatQRCodeEntity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/face_authentication_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/buy_record_list_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_entity.dart';
|
||||
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
||||
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
||||
import '../login/login/entity/LoginEntity.dart';
|
||||
@ -59,6 +62,7 @@ class ApiRepository {
|
||||
final ApiProvider apiProvider;
|
||||
|
||||
static ApiRepository get to => Get.find<ApiRepository>();
|
||||
|
||||
ApiRepository(this.apiProvider);
|
||||
|
||||
// 发送验证码(登陆之前使用) 1注册,2找回密码
|
||||
@ -1819,4 +1823,33 @@ class ApiRepository {
|
||||
final res = await apiProvider.getMpWechatQrCode();
|
||||
return GetWechatQrCodeEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 设置实名认证频次
|
||||
Future<FaceAuthenticationEntity> setFaceAuthentication(
|
||||
{required int faceAuthFrequence}) async {
|
||||
final res = await apiProvider.setFaceAuthentication(faceAuthFrequence);
|
||||
return FaceAuthenticationEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取使用记录
|
||||
Future<BuyRecordListEntity> getBuyRecordList({
|
||||
required String type,
|
||||
required int pageNo,
|
||||
required int recordType,
|
||||
int pageSize = 10,
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.getBuyRecordList(type, recordType, pageNo, pageSize);
|
||||
return BuyRecordListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取购买记录
|
||||
Future<UseRecordListEntity> getUseRecordList({
|
||||
required String type,
|
||||
required int pageNo,
|
||||
int pageSize = 10,
|
||||
}) async {
|
||||
final res = await apiProvider.getUseRecordList(type, pageNo, pageSize);
|
||||
return UseRecordListEntity.fromJson(res.body);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user