1,新增实名认证购买流程
2,新增实名认证获取用户余量接口对接 3,修改实名认证购买记录和使用记录逻辑及UI完善
This commit is contained in:
parent
529ada69e4
commit
983dce53f6
@ -790,5 +790,7 @@
|
|||||||
"固件升级完成": "Firmware upgrade completed",
|
"固件升级完成": "Firmware upgrade completed",
|
||||||
"记录":"Record",
|
"记录":"Record",
|
||||||
"开通高级功能后才可以对锁进行管理":"You can manage locks only after the advanced function is enabled",
|
"开通高级功能后才可以对锁进行管理":"You can manage locks only after the advanced function is enabled",
|
||||||
"去开通":"Go and Activate"
|
"去开通":"Go and Activate",
|
||||||
|
"实名认证":"Real-name authentication",
|
||||||
|
"当前剩余数量":"Current surplus quantity"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -817,5 +817,7 @@
|
|||||||
"固件升级完成":"固件升级完成",
|
"固件升级完成":"固件升级完成",
|
||||||
"记录":"记录",
|
"记录":"记录",
|
||||||
"开通高级功能后才可以对锁进行管理":"开通高级功能后才可以对锁进行管理",
|
"开通高级功能后才可以对锁进行管理":"开通高级功能后才可以对锁进行管理",
|
||||||
"去开通":"去开通"
|
"去开通":"去开通",
|
||||||
|
"实名认证":"实名认证",
|
||||||
|
"当前剩余数量":"当前剩余数量"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -820,5 +820,7 @@
|
|||||||
"文件校验失败 0x03":"文件校验失败 0x03",
|
"文件校验失败 0x03":"文件校验失败 0x03",
|
||||||
"固件升级完成":"固件升级完成",
|
"固件升级完成":"固件升级完成",
|
||||||
"开通高级功能后才可以对锁进行管理":"开通高级功能后才可以对锁进行管理",
|
"开通高级功能后才可以对锁进行管理":"开通高级功能后才可以对锁进行管理",
|
||||||
"去开通":"去开通"
|
"去开通":"去开通",
|
||||||
|
"实名认证":"实名认证",
|
||||||
|
"当前剩余数量":"当前剩余数量"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,7 +65,7 @@ class _WebviewShowPageState extends State<WebviewShowPage> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
},
|
},
|
||||||
icon: Icon(Icons.arrow_back_ios)),
|
icon: const Icon(Icons.arrow_back_ios)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -91,7 +91,8 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
|||||||
Obx(() => GestureDetector(
|
Obx(() => GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (state.isVip.value == null || !state.isVip.value) {
|
if (state.isVip.value == null || !state.isVip.value) {
|
||||||
Get.toNamed(Routers.advancedFeaturesWebPage);
|
Get.toNamed(Routers.advancedFeaturesWebPage,
|
||||||
|
arguments: {'isShop': true});
|
||||||
} else {
|
} else {
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
Routers.valueAddedServicesHighFunctionPage);
|
Routers.valueAddedServicesHighFunctionPage);
|
||||||
|
|||||||
@ -12,17 +12,20 @@ import 'package:star_lock/webview/webview_logic.dart';
|
|||||||
import 'package:webview_flutter/webview_flutter.dart';
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
|
|
||||||
class AdvancedFeaturesWebLogic extends BaseGetXController {
|
class AdvancedFeaturesWebLogic extends BaseGetXController {
|
||||||
late AdvancedFeaturesWebState state;
|
late AdvancedFeaturesWebState state = AdvancedFeaturesWebState();
|
||||||
|
|
||||||
AdvancedFeaturesWebLogic({required bool allowReturn})
|
// AdvancedFeaturesWebLogic({required bool allowReturn, required bool isShop})
|
||||||
: state = AdvancedFeaturesWebState(allowReturn: allowReturn);
|
// : state =
|
||||||
|
// AdvancedFeaturesWebState(allowReturn: allowReturn, isShop: isShop);
|
||||||
|
|
||||||
//获取商城跳转地址
|
//获取商城跳转地址
|
||||||
Future<void> getVipBuyURLRequest() async {
|
Future<void> getVipBuyURLRequest() async {
|
||||||
AdvancedFeaturesWebEntity entity =
|
AdvancedFeaturesWebEntity entity =
|
||||||
await ApiRepository.to.getServicePackageBuyUrl();
|
await ApiRepository.to.getServicePackageBuyUrl();
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.vipBuyUrl.value = entity.data!.shopList!;
|
state.vipBuyUrl.value = state.isShop.value == true
|
||||||
|
? entity.data!.shopList!
|
||||||
|
: entity.data!.cloudauthBuyUrl!;
|
||||||
state.mallWebView.setNavigationDelegate(
|
state.mallWebView.setNavigationDelegate(
|
||||||
NavigationDelegate(
|
NavigationDelegate(
|
||||||
onProgress: (int progress) {
|
onProgress: (int progress) {
|
||||||
|
|||||||
@ -8,10 +8,14 @@ import 'package:webview_flutter/webview_flutter.dart';
|
|||||||
|
|
||||||
class AdvancedFeaturesWebPage extends StatefulWidget {
|
class AdvancedFeaturesWebPage extends StatefulWidget {
|
||||||
AdvancedFeaturesWebPage(
|
AdvancedFeaturesWebPage(
|
||||||
{Key? key, this.showAppBar = true, this.allowReturn = true})
|
{Key? key,
|
||||||
|
this.showAppBar = true,
|
||||||
|
this.allowReturn = true,
|
||||||
|
this.isShop = true})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
bool showAppBar;
|
bool showAppBar;
|
||||||
bool allowReturn;
|
bool allowReturn;
|
||||||
|
bool isShop;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<AdvancedFeaturesWebPage> createState() =>
|
State<AdvancedFeaturesWebPage> createState() =>
|
||||||
@ -27,7 +31,7 @@ class _AdvancedFeaturesWebPageState extends State<AdvancedFeaturesWebPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GetBuilder<AdvancedFeaturesWebLogic>(
|
return GetBuilder<AdvancedFeaturesWebLogic>(
|
||||||
init: AdvancedFeaturesWebLogic(allowReturn: widget.allowReturn),
|
init: AdvancedFeaturesWebLogic(),
|
||||||
builder: (AdvancedFeaturesWebLogic logic) {
|
builder: (AdvancedFeaturesWebLogic logic) {
|
||||||
return PopScope(
|
return PopScope(
|
||||||
onPopInvoked: logic.canGoBack,
|
onPopInvoked: logic.canGoBack,
|
||||||
@ -37,7 +41,9 @@ class _AdvancedFeaturesWebPageState extends State<AdvancedFeaturesWebPage> {
|
|||||||
backgroundColor: const Color(0xFFFFFFFF),
|
backgroundColor: const Color(0xFFFFFFFF),
|
||||||
appBar: widget.showAppBar
|
appBar: widget.showAppBar
|
||||||
? TitleAppBar(
|
? TitleAppBar(
|
||||||
barTitle: '高级功能',
|
barTitle: logic.state.isShop.value == true
|
||||||
|
? '高级功能'.tr
|
||||||
|
: '实名认证'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -4,12 +4,13 @@ import 'package:star_lock/webview/webview_logic.dart';
|
|||||||
import 'package:webview_flutter/webview_flutter.dart';
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
|
|
||||||
class AdvancedFeaturesWebState {
|
class AdvancedFeaturesWebState {
|
||||||
AdvancedFeaturesWebState({required this.allowReturn});
|
// AdvancedFeaturesWebState({required this.allowReturn, required this.isShop});
|
||||||
|
|
||||||
var vipBuyUrl = "".obs;
|
var vipBuyUrl = "".obs;
|
||||||
var webProgress = 0.0.obs;
|
var webProgress = 0.0.obs;
|
||||||
bool allowReturn;
|
bool allowReturn = true;
|
||||||
late WebViewController mallWebView = initWebViewController();
|
late WebViewController mallWebView = initWebViewController();
|
||||||
|
var isShop = true.obs; //是否为高级功能购买页面
|
||||||
|
|
||||||
//初始化webView控制器
|
//初始化webView控制器
|
||||||
WebViewController initWebViewController() {
|
WebViewController initWebViewController() {
|
||||||
@ -19,4 +20,11 @@ class AdvancedFeaturesWebState {
|
|||||||
allWebView.setUserAgent(WebViewLogic.userAgent);
|
allWebView.setUserAgent(WebViewLogic.userAgent);
|
||||||
return allWebView;
|
return allWebView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AdvancedFeaturesWebState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
if (map['isShop'] != null) {
|
||||||
|
isShop.value = map['isShop'];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,7 +65,8 @@ class _ValueAddedServicesPageListState
|
|||||||
TranslationLoader.lanKeys!.advancedFunction!.tr, () async {
|
TranslationLoader.lanKeys!.advancedFunction!.tr, () async {
|
||||||
var isVip = await Storage.getBool(saveIsVip);
|
var isVip = await Storage.getBool(saveIsVip);
|
||||||
if (isVip == null || !isVip) {
|
if (isVip == null || !isVip) {
|
||||||
Get.toNamed(Routers.advancedFeaturesWebPage);
|
Get.toNamed(Routers.advancedFeaturesWebPage,
|
||||||
|
arguments: {'isShop': true});
|
||||||
} else {
|
} else {
|
||||||
Get.toNamed(Routers.valueAddedServicesHighFunctionPage);
|
Get.toNamed(Routers.valueAddedServicesHighFunctionPage);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,13 +5,12 @@ import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/fac
|
|||||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_state.dart';
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_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';
|
||||||
import '../../../tools/eventBusEventManage.dart';
|
|
||||||
|
|
||||||
class ValueAddedServicesRealNameLogic extends BaseGetXController {
|
class ValueAddedServicesRealNameLogic extends BaseGetXController {
|
||||||
final ValueAddedServicesRealNameState state =
|
final ValueAddedServicesRealNameState state =
|
||||||
ValueAddedServicesRealNameState();
|
ValueAddedServicesRealNameState();
|
||||||
|
|
||||||
//请求消息列表
|
//实名认证频次设置
|
||||||
Future<bool> setFaceAuthentication(int faceAuthFrequence) async {
|
Future<bool> setFaceAuthentication(int faceAuthFrequence) async {
|
||||||
FaceAuthenticationEntity entity =
|
FaceAuthenticationEntity entity =
|
||||||
await ApiRepository.to.setFaceAuthentication(
|
await ApiRepository.to.setFaceAuthentication(
|
||||||
@ -20,6 +19,24 @@ class ValueAddedServicesRealNameLogic extends BaseGetXController {
|
|||||||
return entity.errorCode!.codeIsSuccessful;
|
return entity.errorCode!.codeIsSuccessful;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取增值服务用户余量包
|
||||||
|
Future<void> getServiceUserPackage() async {
|
||||||
|
var entity = await ApiRepository.to.getServiceUserPackage();
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
state.realNameRemainCount.value = entity.data!.cloudauthCount!;
|
||||||
|
state.realNameRemainCount.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//增值服务套餐购包链接
|
||||||
|
Future<void> getServicePackageBuyUrl() async {
|
||||||
|
var entity = await ApiRepository.to.getServicePackageBuyUrl();
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
state.realNameBuyUrl.value = entity.data!.cloudauthBuyUrl!;
|
||||||
|
state.realNameBuyUrl.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> check(int index) async {
|
Future<void> check(int index) async {
|
||||||
bool isSuccessful = await setFaceAuthentication(state.index + 1);
|
bool isSuccessful = await setFaceAuthentication(state.index + 1);
|
||||||
if (isSuccessful) {
|
if (isSuccessful) {
|
||||||
@ -37,6 +54,8 @@ class ValueAddedServicesRealNameLogic extends BaseGetXController {
|
|||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|
||||||
|
getServiceUserPackage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -19,6 +19,9 @@ class ValueAddedServicesRealNamePage extends StatefulWidget {
|
|||||||
|
|
||||||
class _ValueAddedServicesRealNamePageState
|
class _ValueAddedServicesRealNamePageState
|
||||||
extends State<ValueAddedServicesRealNamePage> {
|
extends State<ValueAddedServicesRealNamePage> {
|
||||||
|
final logic = Get.put(ValueAddedServicesRealNameLogic());
|
||||||
|
final state = Get.find<ValueAddedServicesRealNameLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GetBuilder<ValueAddedServicesRealNameLogic>(
|
return GetBuilder<ValueAddedServicesRealNameLogic>(
|
||||||
@ -27,7 +30,7 @@ class _ValueAddedServicesRealNamePageState
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
barTitle: '实名认证'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Column(
|
body: Column(
|
||||||
@ -42,12 +45,6 @@ class _ValueAddedServicesRealNamePageState
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
||||||
)),
|
)),
|
||||||
TextButton(
|
|
||||||
onPressed: () {
|
|
||||||
Get.toNamed(Routers.valueAddedServicesRecordPage,
|
|
||||||
arguments: UseRecordListArg.cloudauth);
|
|
||||||
},
|
|
||||||
child: Text('asdasd')),
|
|
||||||
middleWidget(),
|
middleWidget(),
|
||||||
bottomWidget()
|
bottomWidget()
|
||||||
],
|
],
|
||||||
@ -73,10 +70,10 @@ class _ValueAddedServicesRealNamePageState
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Obx(() => Text(
|
||||||
"${TranslationLoader.lanKeys!.currentRemainingQuantity!.tr}:0",
|
"${'当前剩余数量'.tr}:${state.realNameRemainCount.value}",
|
||||||
style: TextStyle(fontSize: 24.sp),
|
style: TextStyle(fontSize: 24.sp),
|
||||||
)
|
))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -92,25 +89,24 @@ class _ValueAddedServicesRealNamePageState
|
|||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 200.w,
|
width: 200.w,
|
||||||
|
color: Colors.transparent,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(TranslationLoader.lanKeys!.record!.tr,
|
child: Text('记录'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.black, fontSize: 24.sp)))),
|
color: Colors.black, fontSize: 24.sp)))),
|
||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// Navigator.pushNamed(
|
Get.toNamed(Routers.advancedFeaturesWebPage,
|
||||||
// context, Routers.valueAddedServicesBuyPage,
|
arguments: {'isShop': false});
|
||||||
// arguments: 3);
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 200.w,
|
width: 200.w,
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(TranslationLoader.lanKeys!.buy!.tr,
|
child: Text('购买'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
// color: AppColors.mainColor,
|
color: AppColors.mainColor,
|
||||||
color: AppColors.blackColor,
|
|
||||||
fontSize: 24.sp)))),
|
fontSize: 24.sp)))),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class ValueAddedServicesRealNameState {
|
class ValueAddedServicesRealNameState {
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
var realNameRemainCount = 0.obs; //当前剩余数量
|
||||||
|
var realNameBuyUrl = ''.obs; //购买链接
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,25 +1,130 @@
|
|||||||
class BuyRecordListEntity {
|
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;
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
String? errorMsg;
|
String? errorMsg;
|
||||||
|
BuyRecordListData? data;
|
||||||
|
|
||||||
|
BuyRecordListEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
BuyRecordListEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
description = json['description'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
data =
|
||||||
|
json['data'] != null ? BuyRecordListData.fromJson(json['data']) : null;
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final map = <String, dynamic>{};
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
map['description'] = description;
|
data['errorCode'] = errorCode;
|
||||||
map['errorCode'] = errorCode;
|
data['description'] = description;
|
||||||
map['errorMsg'] = errorMsg;
|
data['errorMsg'] = errorMsg;
|
||||||
return map;
|
if (this.data != null) {
|
||||||
|
data['data'] = this.data!.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class BuyRecordListData {
|
||||||
|
int? pageNo;
|
||||||
|
int? pageSize;
|
||||||
|
int? total;
|
||||||
|
List<BuyRecordItem>? buyRecordlist;
|
||||||
|
|
||||||
|
BuyRecordListData(
|
||||||
|
{this.pageNo, this.pageSize, this.total, this.buyRecordlist});
|
||||||
|
|
||||||
|
BuyRecordListData.fromJson(Map<String, dynamic> json) {
|
||||||
|
pageNo = json['pageNo'];
|
||||||
|
pageSize = json['pageSize'];
|
||||||
|
total = json['total'];
|
||||||
|
if (json['list'] != null) {
|
||||||
|
buyRecordlist = <BuyRecordItem>[];
|
||||||
|
json['list'].forEach((v) {
|
||||||
|
buyRecordlist!.add(BuyRecordItem.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['pageNo'] = pageNo;
|
||||||
|
data['pageSize'] = pageSize;
|
||||||
|
data['total'] = total;
|
||||||
|
if (buyRecordlist != null) {
|
||||||
|
data['list'] = buyRecordlist!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class BuyRecordItem {
|
||||||
|
int? id;
|
||||||
|
int? userId;
|
||||||
|
String? orderNumber;
|
||||||
|
String? type;
|
||||||
|
int? recordType;
|
||||||
|
int? smsCount;
|
||||||
|
int? emailCount;
|
||||||
|
int? cloudauthCount;
|
||||||
|
int? vipLockCount;
|
||||||
|
int? vipYear;
|
||||||
|
int? isApply;
|
||||||
|
String? money;
|
||||||
|
String? createdAt;
|
||||||
|
String? updatedAt;
|
||||||
|
|
||||||
|
BuyRecordItem(
|
||||||
|
{this.id,
|
||||||
|
this.userId,
|
||||||
|
this.orderNumber,
|
||||||
|
this.type,
|
||||||
|
this.recordType,
|
||||||
|
this.smsCount,
|
||||||
|
this.emailCount,
|
||||||
|
this.cloudauthCount,
|
||||||
|
this.vipLockCount,
|
||||||
|
this.vipYear,
|
||||||
|
this.isApply,
|
||||||
|
this.money,
|
||||||
|
this.createdAt,
|
||||||
|
this.updatedAt});
|
||||||
|
|
||||||
|
BuyRecordItem.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
userId = json['user_id'];
|
||||||
|
orderNumber = json['order_number'];
|
||||||
|
type = json['type'];
|
||||||
|
recordType = json['record_type'];
|
||||||
|
smsCount = json['sms_count'];
|
||||||
|
emailCount = json['email_count'];
|
||||||
|
cloudauthCount = json['cloudauth_count'];
|
||||||
|
vipLockCount = json['vip_lock_count'];
|
||||||
|
vipYear = json['vip_year'];
|
||||||
|
isApply = json['is_apply'];
|
||||||
|
money = json['money'];
|
||||||
|
createdAt = json['created_at'];
|
||||||
|
updatedAt = json['updated_at'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['user_id'] = userId;
|
||||||
|
data['order_number'] = orderNumber;
|
||||||
|
data['type'] = type;
|
||||||
|
data['record_type'] = recordType;
|
||||||
|
data['sms_count'] = smsCount;
|
||||||
|
data['email_count'] = emailCount;
|
||||||
|
data['cloudauth_count'] = cloudauthCount;
|
||||||
|
data['vip_lock_count'] = vipLockCount;
|
||||||
|
data['vip_year'] = vipYear;
|
||||||
|
data['is_apply'] = isApply;
|
||||||
|
data['money'] = money;
|
||||||
|
data['created_at'] = createdAt;
|
||||||
|
data['updated_at'] = updatedAt;
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,10 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
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/buy_record_list_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';
|
||||||
import '../../../tools/eventBusEventManage.dart';
|
|
||||||
|
|
||||||
class ValueAddedServicesRecordLogic extends BaseGetXController {
|
class ValueAddedServicesRecordLogic extends BaseGetXController {
|
||||||
ValueAddedServicesRecordLogic();
|
ValueAddedServicesRecordLogic();
|
||||||
@ -27,7 +24,7 @@ class ValueAddedServicesRecordLogic extends BaseGetXController {
|
|||||||
type = data['type'];
|
type = data['type'];
|
||||||
}
|
}
|
||||||
|
|
||||||
//请求消息列表
|
//请求购买记录列表
|
||||||
Future<void> loadBuyRecordList(bool load) async {
|
Future<void> loadBuyRecordList(bool load) async {
|
||||||
if (!load) {
|
if (!load) {
|
||||||
buyPageNo = 1;
|
buyPageNo = 1;
|
||||||
@ -37,16 +34,15 @@ class ValueAddedServicesRecordLogic extends BaseGetXController {
|
|||||||
recordType: 10,
|
recordType: 10,
|
||||||
pageNo: buyPageNo,
|
pageNo: buyPageNo,
|
||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {}
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
state.buyRecordList.value = entity.data!.buyRecordlist!;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
loadBuyRecordList(true);
|
||||||
void onClose() {
|
|
||||||
super.onClose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
import 'package:easy_refresh/easy_refresh.dart';
|
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:get/get.dart';
|
import 'package:get/get.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 '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
import '../../../tools/titleAppBar.dart';
|
import '../../../tools/titleAppBar.dart';
|
||||||
|
|
||||||
class ValueAddedServicesRecordPage extends StatefulWidget {
|
class ValueAddedServicesRecordPage extends StatefulWidget {
|
||||||
ValueAddedServicesRecordPage({
|
const ValueAddedServicesRecordPage({
|
||||||
Key? key,
|
Key? key,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@ -33,15 +35,20 @@ class _ValueAddedServicesRealNamePageState
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
TabBar(
|
TabBar(
|
||||||
tabs: [
|
tabs: [tabTextItem('购买记录'.tr), tabTextItem('使用记录'.tr)],
|
||||||
Text('购买记录'.tr),
|
indicatorColor: AppColors.mainColor,
|
||||||
Text('使用记录'.tr),
|
indicatorSize: TabBarIndicatorSize.label,
|
||||||
],
|
labelColor: AppColors.mainColor,
|
||||||
|
unselectedLabelColor: AppColors.darkGrayTextColor,
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TabBarView(children: [
|
child: TabBarView(children: [
|
||||||
_PurchaseRecords(),
|
_PurchaseRecords(
|
||||||
Text('使用记录'),
|
getRecordList: logic.state.buyRecordList.value,
|
||||||
|
),
|
||||||
|
_PurchaseRecords(
|
||||||
|
getRecordList: logic.state.useRecordList.value,
|
||||||
|
),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -52,14 +59,26 @@ class _ValueAddedServicesRealNamePageState
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget tabTextItem(String tabText) {
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.only(top: 16.h, bottom: 16.h),
|
||||||
|
child: Text(
|
||||||
|
tabText,
|
||||||
|
style: TextStyle(fontSize: 24.sp),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//购买记录、使用记录
|
||||||
class _PurchaseRecords extends StatefulWidget {
|
class _PurchaseRecords extends StatefulWidget {
|
||||||
const _PurchaseRecords({key});
|
final List getRecordList;
|
||||||
|
|
||||||
|
const _PurchaseRecords({required this.getRecordList});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<_PurchaseRecords> createState() => _PurchaseRecordsState();
|
State<_PurchaseRecords> createState() => _PurchaseRecordsState();
|
||||||
}
|
}
|
||||||
|
|
||||||
//购买记录
|
|
||||||
class _PurchaseRecordsState extends State<_PurchaseRecords> {
|
class _PurchaseRecordsState extends State<_PurchaseRecords> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -68,9 +87,13 @@ class _PurchaseRecordsState extends State<_PurchaseRecords> {
|
|||||||
return EasyRefresh(
|
return EasyRefresh(
|
||||||
onRefresh: () async {},
|
onRefresh: () async {},
|
||||||
onLoad: () async {},
|
onLoad: () async {},
|
||||||
child: ListView.builder(itemCount: 0,itemBuilder: (BuildContext context, int index) {
|
child: widget.getRecordList.isNotEmpty
|
||||||
return SizedBox();
|
? ListView.builder(
|
||||||
}),
|
itemCount: widget.getRecordList.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return const SizedBox();
|
||||||
|
})
|
||||||
|
: NoData(),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class ValueAddedServicesRecordState {
|
class ValueAddedServicesRecordState {
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
var buyRecordList = [].obs;
|
||||||
|
var useRecordList = [].obs;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,8 @@ class AdvancedFunctionHandle {
|
|||||||
style: TextStyle(color: AppColors.mainColor),
|
style: TextStyle(color: AppColors.mainColor),
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Get.toNamed(Routers.advancedFeaturesWebPage);
|
Get.toNamed(Routers.advancedFeaturesWebPage,
|
||||||
|
arguments: {'isShop': true});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -67,7 +68,9 @@ class AdvancedFunctionHandle {
|
|||||||
backgroundColor: AppColors.vipFeatureBtnBgColor,
|
backgroundColor: AppColors.vipFeatureBtnBgColor,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.toNamed(Routers.advancedFeaturesWebPage);
|
Get.toNamed(Routers.advancedFeaturesWebPage, arguments: {
|
||||||
|
'isShop': true,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'去开通'.tr,
|
'去开通'.tr,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user