增加检测实名认证是否支持开启的接口
This commit is contained in:
parent
c2cb7218ee
commit
21dacd0bb3
@ -1,7 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/buy_record_list_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_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';
|
||||
@ -29,13 +29,15 @@ class ValueAddedServicesRecordLogic extends BaseGetXController {
|
||||
if (!load) {
|
||||
buyPageNo = 1;
|
||||
}
|
||||
BuyRecordListEntity entity = await ApiRepository.to.getBuyRecordList(
|
||||
AdvancedFunctionRecordEntity entity =
|
||||
await ApiRepository.to.getBuyRecordList(
|
||||
type: type,
|
||||
recordType: 10,
|
||||
pageNo: buyPageNo,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.buyRecordList.value = entity.data!.buyRecordlist!;
|
||||
state.buyRecordList.value = entity.data!.recordList!;
|
||||
state.buyRecordList.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:easy_refresh/easy_refresh.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_logic.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
@ -41,16 +42,16 @@ class _ValueAddedServicesRealNamePageState
|
||||
labelColor: AppColors.mainColor,
|
||||
unselectedLabelColor: AppColors.darkGrayTextColor,
|
||||
),
|
||||
Expanded(
|
||||
child: TabBarView(children: [
|
||||
_PurchaseRecords(
|
||||
getRecordList: logic.state.buyRecordList.value,
|
||||
),
|
||||
_PurchaseRecords(
|
||||
getRecordList: logic.state.useRecordList.value,
|
||||
),
|
||||
]),
|
||||
),
|
||||
Obx(() => Expanded(
|
||||
child: TabBarView(children: [
|
||||
_PurchaseRecords(
|
||||
getRecordList: logic.state.buyRecordList.value,
|
||||
),
|
||||
_PurchaseRecords(
|
||||
getRecordList: logic.state.useRecordList.value,
|
||||
),
|
||||
]),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -91,10 +92,54 @@ class _PurchaseRecordsState extends State<_PurchaseRecords> {
|
||||
? ListView.builder(
|
||||
itemCount: widget.getRecordList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return const SizedBox();
|
||||
return _recordKeyItem(widget.getRecordList[index]);
|
||||
})
|
||||
: NoData(),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget _recordKeyItem(RecordItem itemData) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 10.h),
|
||||
padding:
|
||||
EdgeInsets.only(left: 20.w, right: 20.w, top: 16.h, bottom: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
itemData.createdAt!.length > 10
|
||||
? itemData.createdAt!.substring(0, 10)
|
||||
: itemData.createdAt!,
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
color: AppColors.blackColor,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
Expanded(child: Container()),
|
||||
Text('¥${itemData.amount}',
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
color: AppColors.blackColor,
|
||||
fontWeight: FontWeight.bold)),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8.h,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text('实名认证/${itemData.cloudauthCount}次',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor))
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,6 @@ import 'package:get/get.dart';
|
||||
|
||||
class ValueAddedServicesRecordState {
|
||||
int index = 0;
|
||||
var buyRecordList = [].obs;
|
||||
var useRecordList = [].obs;
|
||||
var buyRecordList = [].obs; //购买记录列表
|
||||
var useRecordList = [].obs; //使用记录列表
|
||||
}
|
||||
|
||||
@ -227,4 +227,6 @@ abstract class Api {
|
||||
final String deleteLockCloudStorageURL = '/lockCloudStorage/delete'; //删除云存
|
||||
final String getServiceUserPackageURL =
|
||||
'/v2/service/getUserPackage'; //获取增值服务用户余量包
|
||||
final String isFaceAuthenticationURL =
|
||||
'/key/isFaceAuthentication'; //检测实名认证是否支持开启
|
||||
}
|
||||
|
||||
@ -2016,6 +2016,18 @@ class ApiProvider extends BaseProvider {
|
||||
'pageSize': pageSize,
|
||||
'record_type': recordType,
|
||||
}));
|
||||
|
||||
// 检测实名认证是否支持开启
|
||||
Future<Response> isFaceAuthentication(
|
||||
int countryCode,
|
||||
String account,
|
||||
) =>
|
||||
post(
|
||||
isFaceAuthenticationURL.toUrl,
|
||||
jsonEncode({
|
||||
'countryCode': countryCode,
|
||||
'account': account,
|
||||
}));
|
||||
}
|
||||
|
||||
extension ExtensionString on String {
|
||||
|
||||
@ -317,13 +317,11 @@ class ApiRepository {
|
||||
|
||||
//锁电量更新
|
||||
Future<KeyOperationRecordEntity> uploadElectricQuantity(
|
||||
{
|
||||
String? electricQuantity,
|
||||
String? electricQuantityStandby,
|
||||
String? lockId
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.uploadElectricQuantity(electricQuantity!, electricQuantityStandby!, lockId!);
|
||||
{String? electricQuantity,
|
||||
String? electricQuantityStandby,
|
||||
String? lockId}) async {
|
||||
final res = await apiProvider.uploadElectricQuantity(
|
||||
electricQuantity!, electricQuantityStandby!, lockId!);
|
||||
return KeyOperationRecordEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -465,8 +463,7 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
//自定义密码
|
||||
Future<PasswordKeyEntity> addPasswordKey(
|
||||
{
|
||||
Future<PasswordKeyEntity> addPasswordKey({
|
||||
required String lockId,
|
||||
required String keyboardPwdName,
|
||||
required String keyboardPwd,
|
||||
@ -2003,7 +2000,7 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
// 获取使用记录
|
||||
Future<BuyRecordListEntity> getBuyRecordList({
|
||||
Future<AdvancedFunctionRecordEntity> getBuyRecordList({
|
||||
required String type,
|
||||
required int pageNo,
|
||||
required int recordType,
|
||||
@ -2011,7 +2008,7 @@ class ApiRepository {
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.getBuyRecordList(type, recordType, pageNo, pageSize);
|
||||
return BuyRecordListEntity.fromJson(res.body);
|
||||
return AdvancedFunctionRecordEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取购买记录
|
||||
@ -2047,4 +2044,13 @@ class ApiRepository {
|
||||
type, pageNo, recordType, pageSize);
|
||||
return AdvancedFunctionRecordEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 检测实名认证是否支持开启
|
||||
Future<AdvancedFunctionRecordEntity> isFaceAuthentication({
|
||||
required int countryCode,
|
||||
required String account,
|
||||
}) async {
|
||||
final res = await apiProvider.isFaceAuthentication(countryCode, account);
|
||||
return AdvancedFunctionRecordEntity.fromJson(res.body);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/tools/showTFView.dart';
|
||||
|
||||
import '../translations/trans_lib.dart';
|
||||
@ -132,13 +133,17 @@ class ShowTipView {
|
||||
title: Text(titleStr),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(color: AppColors.mainColor),
|
||||
),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text('购买'.tr),
|
||||
child:
|
||||
Text('购买'.tr, style: TextStyle(color: AppColors.mainColor)),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
sureClick();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user