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