From 9873536b6e059f4d031fb30db7876a63968a86b4 Mon Sep 17 00:00:00 2001 From: Daisy <> Date: Tue, 30 Apr 2024 11:24:47 +0800 Subject: [PATCH] =?UTF-8?q?1=EF=BC=8C=E6=B6=88=E6=81=AF=E6=8F=90=E9=86=92?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=96=B0=E5=A2=9E=E9=9C=80=E8=81=94=E7=BD=91?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=AD=202=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=AB=98=E7=BA=A7=E5=8A=9F=E8=83=BD=E8=B4=AD=E4=B9=B0=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5=203=EF=BC=8C?= =?UTF-8?q?=E5=B7=B2=E5=BC=80=E9=80=9A=E9=AB=98=E7=BA=A7=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=A4=84=E7=90=86=E4=B8=8E=E4=BC=98=E5=8C=96?= =?UTF-8?q?=204=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=B7=B2=E5=BC=80=E9=80=9A?= =?UTF-8?q?=E9=AB=98=E7=BA=A7=E5=8A=9F=E8=83=BD=E7=9A=84=E8=B4=AD=E4=B9=B0?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5=E4=B8=8E?= =?UTF-8?q?=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/images/lan/lan_en.json | 3 +- star_lock/images/lan/lan_keys.json | 3 +- star_lock/images/lan/lan_zh.json | 3 +- star_lock/lib/appRouters.dart | 8 +- .../msgNotification/msgNotification_page.dart | 4 + .../advancedFunctionRecord_entity.dart | 128 ++++++++++++++++++ .../advancedFunctionRecord_logic.dart | 20 +++ .../advancedFunctionRecord_page.dart | 97 +++++++++++++ .../advancedFunctionRecord_state.dart | 6 + ...valueAddedServicesHighFunction_entity.dart | 64 +++++++++ .../valueAddedServicesHighFunction_logic.dart | 5 +- .../valueAddedServicesHighFunction_page.dart | 91 +++++++------ .../valueAddedServicesHighFunction_state.dart | 6 +- star_lock/lib/network/api_provider.dart | 19 ++- star_lock/lib/network/api_repository.dart | 18 ++- 15 files changed, 424 insertions(+), 51 deletions(-) create mode 100644 star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart create mode 100644 star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_logic.dart create mode 100644 star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_page.dart create mode 100644 star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_state.dart create mode 100644 star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_entity.dart diff --git a/star_lock/images/lan/lan_en.json b/star_lock/images/lan/lan_en.json index e5f2ae84..18bdceba 100644 --- a/star_lock/images/lan/lan_en.json +++ b/star_lock/images/lan/lan_en.json @@ -807,5 +807,6 @@ "已开通":"Have opened", "该功能是高级功能,请开通后再使用":"This function is an advanced function. Please enable it before using it", "常用程序":"Common Programs", - "该锁已被重置":"The lock has been reset" + "该锁已被重置":"The lock has been reset", + "记录":"Record" } diff --git a/star_lock/images/lan/lan_keys.json b/star_lock/images/lan/lan_keys.json index 1d277fc9..fb86f8c0 100644 --- a/star_lock/images/lan/lan_keys.json +++ b/star_lock/images/lan/lan_keys.json @@ -806,5 +806,6 @@ "已开通":"已开通", "该功能是高级功能,请开通后再使用":"该功能是高级功能,请开通后再使用", "常用程序":"常用程序", - "该锁已被重置":"该锁已被重置" + "该锁已被重置":"该锁已被重置", + "记录":"记录" } diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json index 978de8f5..a220789a 100644 --- a/star_lock/images/lan/lan_zh.json +++ b/star_lock/images/lan/lan_zh.json @@ -809,5 +809,6 @@ "已开通":"已开通", "该功能是高级功能,请开通后再使用":"该功能是高级功能,请开通后再使用", "常用程序":"常用程序", - "该锁已被重置":"该锁已被重置" + "该锁已被重置":"该锁已被重置", + "记录":"记录" } diff --git a/star_lock/lib/appRouters.dart b/star_lock/lib/appRouters.dart index e4a5c9f0..09da688d 100644 --- a/star_lock/lib/appRouters.dart +++ b/star_lock/lib/appRouters.dart @@ -53,6 +53,7 @@ import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation/re 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/advancedFeaturesWeb/advancedFeaturesWeb_page.dart'; +import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_page.dart'; import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_page.dart'; import 'common/safetyVerification/safetyVerification_page.dart'; @@ -447,6 +448,8 @@ abstract class Routers { static const seletKeyCyclicDatePage = '/SeletKeyCyclicDatePage'; // 电子钥匙、授权管理员、卡、指纹、遥控等添加添加循环日期公共界面 static const advancedFeaturesWebPage = '/advancedFeaturesWebPage'; // 高级功能 + static const advancedFunctionRecordPage = + '/advancedFunctionRecordPage'; //高级功能购买记录 } abstract class AppRouters { @@ -1068,6 +1071,9 @@ abstract class AppRouters { GetPage(name: Routers.addPalmPage, page: (() => const AddPalmPage())), GetPage( name: Routers.advancedFeaturesWebPage, - page: (() => AdvancedFeaturesWebPage())) + page: (() => AdvancedFeaturesWebPage())), + GetPage( + name: Routers.advancedFunctionRecordPage, + page: (() => const AdvancedFunctionRecordPage())), ]; } diff --git a/star_lock/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_page.dart b/star_lock/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_page.dart index 50d4156d..30959240 100644 --- a/star_lock/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_page.dart +++ b/star_lock/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_page.dart @@ -152,6 +152,10 @@ class _MsgNotificationPageState extends State { SizedBox(width: 60.w, height: 50.h, child: _switch(4)))), SizedBox( height: 60.h, + ), + Text( + '此模块功能需要锁联网后设置方可生效', + style: TextStyle(fontSize: 20.sp), ) ], ); diff --git a/star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart b/star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart new file mode 100644 index 00000000..22c82b0e --- /dev/null +++ b/star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart @@ -0,0 +1,128 @@ +class AdvancedFunctionRecordEntity { + int? errorCode; + String? description; + String? errorMsg; + Data? data; + + AdvancedFunctionRecordEntity( + {this.errorCode, this.description, this.errorMsg, this.data}); + + AdvancedFunctionRecordEntity.fromJson(Map json) { + errorCode = json['errorCode']; + description = json['description']; + errorMsg = json['errorMsg']; + data = json['data'] != null ? Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['errorCode'] = errorCode; + data['description'] = description; + data['errorMsg'] = errorMsg; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + int? pageNo; + int? pageSize; + int? total; + List? recordList; + + Data({this.pageNo, this.pageSize, this.total, this.recordList}); + + Data.fromJson(Map json) { + pageNo = json['pageNo']; + pageSize = json['pageSize']; + total = json['total']; + if (json['list'] != null) { + recordList = []; + json['list'].forEach((v) { + recordList!.add(RecordItem.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + data['pageNo'] = pageNo; + data['pageSize'] = pageSize; + data['total'] = total; + if (recordList != null) { + data['list'] = recordList!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class RecordItem { + 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; + + RecordItem( + {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}); + + RecordItem.fromJson(Map 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 toJson() { + final Map data = {}; + 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; + } +} diff --git a/star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_logic.dart b/star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_logic.dart new file mode 100644 index 00000000..c4157d2a --- /dev/null +++ b/star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_logic.dart @@ -0,0 +1,20 @@ +import 'dart:async'; + +import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_state.dart'; + +import '../../../../network/api_repository.dart'; +import '../../../../tools/baseGetXController.dart'; + +class AdvancedFunctionRecordLogic extends BaseGetXController { + AdvancedFunctionRecordState state = AdvancedFunctionRecordState(); + + //获取购买记录列表 + Future getBuyRecordList() async { + var entity = await ApiRepository.to.advancedFunctionBuyRecordList( + type: 'vip', pageNo: 1, recordType: 10, pageSize: 10); + if (entity.errorCode!.codeIsSuccessful) { + state.buyRecordList.value = entity.data!.recordList!; + state.buyRecordList.refresh(); + } + } +} diff --git a/star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_page.dart b/star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_page.dart new file mode 100644 index 00000000..75c6a89f --- /dev/null +++ b/star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_page.dart @@ -0,0 +1,97 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:star_lock/app_settings/app_colors.dart'; +import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart'; +import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_logic.dart'; +import 'package:star_lock/tools/noData.dart'; + +import '../../../tools/titleAppBar.dart'; + +class AdvancedFunctionRecordPage extends StatefulWidget { + const AdvancedFunctionRecordPage({Key? key}) : super(key: key); + + @override + State createState() => + _AdvancedFunctionRecordPageState(); +} + +class _AdvancedFunctionRecordPageState + extends State { + final logic = Get.put(AdvancedFunctionRecordLogic()); + final state = Get.find().state; + + @override + initState() { + super.initState(); + + logic.getBuyRecordList(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: TitleAppBar( + barTitle: "记录".tr, + haveBack: true, + iconColor: Colors.black, + titleColor: Colors.black, + backgroundColor: Colors.white), + body: Container( + color: AppColors.mainBackgroundColor, + child: Obx(() => state.buyRecordList.isEmpty + ? NoData() + : ListView.builder( + itemCount: state.buyRecordList.length, + itemBuilder: (context, index) { + return _recordKeyItem(state.buyRecordList[index]); + }, + )), + )); + } + + 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.money}', + style: TextStyle( + fontSize: 24.sp, + color: AppColors.blackColor, + fontWeight: FontWeight.bold)), + ], + ), + SizedBox( + height: 8.h, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text('${itemData.vipLockCount}把锁/${itemData.vipYear}年', + textAlign: TextAlign.left, + style: TextStyle( + fontSize: 22.sp, color: AppColors.darkGrayTextColor)) + ], + ), + ], + ), + ); + } +} diff --git a/star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_state.dart b/star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_state.dart new file mode 100644 index 00000000..99e52e5b --- /dev/null +++ b/star_lock/lib/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_state.dart @@ -0,0 +1,6 @@ +import 'package:get/get.dart'; +import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart'; + +class AdvancedFunctionRecordState { + var buyRecordList = [].obs; +} diff --git a/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_entity.dart b/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_entity.dart new file mode 100644 index 00000000..5d5cbc08 --- /dev/null +++ b/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_entity.dart @@ -0,0 +1,64 @@ +class ValueAddedServicesHighFunctionEntity { + int? errorCode; + String? description; + String? errorMsg; + Data? data; + + ValueAddedServicesHighFunctionEntity( + {this.errorCode, this.description, this.errorMsg, this.data}); + + ValueAddedServicesHighFunctionEntity.fromJson(Map json) { + errorCode = json['errorCode']; + description = json['description']; + errorMsg = json['errorMsg']; + data = json['data'] != null ? Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['errorCode'] = errorCode; + data['description'] = description; + data['errorMsg'] = errorMsg; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + int? emailCount; + int? smsCount; + int? cloudauthCount; + int? vipStatus; + int? vipLockCount; + String? vipExpireAt; + + Data( + {this.emailCount, + this.smsCount, + this.cloudauthCount, + this.vipStatus, + this.vipLockCount, + this.vipExpireAt}); + + Data.fromJson(Map json) { + emailCount = json['email_count']; + smsCount = json['sms_count']; + cloudauthCount = json['cloudauth_count']; + vipStatus = json['vip_status']; + vipLockCount = json['vip_lock_count']; + vipExpireAt = json['vip_expire_at']; + } + + Map toJson() { + final Map data = {}; + data['email_count'] = emailCount; + data['sms_count'] = smsCount; + data['cloudauth_count'] = cloudauthCount; + data['vip_status'] = vipStatus; + data['vip_lock_count'] = vipLockCount; + data['vip_expire_at'] = vipExpireAt; + return data; + } +} diff --git a/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_logic.dart b/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_logic.dart index deb2c20d..44642afc 100644 --- a/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_logic.dart +++ b/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_logic.dart @@ -12,6 +12,9 @@ class ValueAddedServicesHighFunctionLogic extends BaseGetXController { //获取增值服务用户余量包 Future getServiceUserPackage() async { var entity = await ApiRepository.to.getServiceUserPackage(); - if (entity.errorCode!.codeIsSuccessful) {} + if (entity.errorCode!.codeIsSuccessful) { + state.vipExpireDate.value = entity.data!.vipExpireAt!; + state.vipExpireDate.refresh(); + } } } diff --git a/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_page.dart b/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_page.dart index 7028c33f..dbefc653 100644 --- a/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_page.dart +++ b/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_page.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:star_lock/app_settings/app_settings.dart'; import 'package:star_lock/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_logic.dart'; import '../../../appRouters.dart'; @@ -33,7 +34,7 @@ class _ValueAddedServicesHighFunctionPageState return Scaffold( backgroundColor: Colors.white, appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.advancedFunction!.tr, + barTitle: "高级功能".tr, haveBack: true, iconColor: Colors.black, titleColor: Colors.black, @@ -67,52 +68,60 @@ class _ValueAddedServicesHighFunctionPageState topRight: Radius.circular(30.h), ), ), - child: Stack( - alignment: AlignmentDirectional.centerStart, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.center, + child: GestureDetector( + onTap: () { + Get.toNamed(Routers.advancedFunctionRecordPage); + }, + child: Container( + color: Colors.transparent, + child: Stack( + alignment: AlignmentDirectional.centerStart, children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, + Row( + mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( - "已开通".tr, - style: - TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600), + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "已开通".tr, + style: TextStyle( + fontSize: 24.sp, fontWeight: FontWeight.w600), + ), + SizedBox(height: 5.h), + Obx(() => Text( + "${TranslationLoader.lanKeys!.periodValidity!.tr}:${state.vipExpireDate.value}", + style: TextStyle( + fontSize: 20.sp, fontWeight: FontWeight.w600), + )), + ], // ), - SizedBox(height: 5.h), - Text( - "${TranslationLoader.lanKeys!.periodValidity!.tr}:2023-07-29", - style: - TextStyle(fontSize: 20.sp, fontWeight: FontWeight.w600), - ), - ], // + ], ), + Positioned( + bottom: 0.h, + right: 0.w, + child: Container( + width: 90.w, + height: 50.h, + decoration: BoxDecoration( + color: const Color(0xFFBDCDDF), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(30.h), + bottomLeft: Radius.circular(30.h), + ), + ), + child: Center( + child: Text( + TranslationLoader.lanKeys!.record!.tr, + style: TextStyle(fontSize: 22.sp), + )), + )), ], ), - Positioned( - bottom: 0.h, - right: 0.w, - child: Container( - width: 90.w, - height: 50.h, - decoration: BoxDecoration( - color: const Color(0xFFBDCDDF), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(30.h), - bottomLeft: Radius.circular(30.h), - ), - ), - child: Center( - child: Text( - TranslationLoader.lanKeys!.record!.tr, - style: TextStyle(fontSize: 22.sp), - )), - )), - ], + ), ), ); } diff --git a/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_state.dart b/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_state.dart index 53e39692..5e4ba946 100644 --- a/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_state.dart +++ b/star_lock/lib/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_state.dart @@ -1 +1,5 @@ -class ValueAddedServicesHighFunctionState {} +import 'package:get/get.dart'; + +class ValueAddedServicesHighFunctionState { + var vipExpireDate = ''.obs; +} diff --git a/star_lock/lib/network/api_provider.dart b/star_lock/lib/network/api_provider.dart index 897754eb..bd95bf1e 100644 --- a/star_lock/lib/network/api_provider.dart +++ b/star_lock/lib/network/api_provider.dart @@ -785,8 +785,7 @@ class ApiProvider extends BaseProvider { jsonEncode({ 'lockId': lockId, }), - isUnShowLoading: true - ); + isUnShowLoading: true); // 锁诊断 Future setLockDiagnoseData( @@ -1999,6 +1998,22 @@ class ApiProvider extends BaseProvider { // 获取增值服务用户余量包 Future getServiceUserPackage() => post(getServiceUserPackageURL.toUrl, jsonEncode({})); + + // 高级功能购买记录 + Future advancedFunctionBuyRecordList( + String type, + int pageNo, + int recordType, + int pageSize, + ) => + post( + getBuyRecordListURL.toUrl, + jsonEncode({ + 'type': type, + 'pageNo': pageNo, + 'pageSize': pageSize, + 'record_type': recordType, + })); } extension ExtensionString on String { diff --git a/star_lock/lib/network/api_repository.dart b/star_lock/lib/network/api_repository.dart index b6473b10..dff1d189 100644 --- a/star_lock/lib/network/api_repository.dart +++ b/star_lock/lib/network/api_repository.dart @@ -27,6 +27,8 @@ import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList/keyList import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart'; import 'package:star_lock/mine/mineSet/mineSet/weChatQRCodeEntity.dart'; import 'package:star_lock/mine/valueAddedServices/advancedFeaturesWeb/advancedFeaturesWeb_entity.dart'; +import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart'; +import 'package:star_lock/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_entity.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'; @@ -2024,8 +2026,20 @@ class ApiRepository { } // 获取增值服务用户余量包 - Future getServiceUserPackage() async { + Future getServiceUserPackage() async { final res = await apiProvider.getServiceUserPackage(); - return AdvancedFeaturesWebEntity.fromJson(res.body); + return ValueAddedServicesHighFunctionEntity.fromJson(res.body); + } + + // 高级功能购买记录 + Future advancedFunctionBuyRecordList({ + required String type, + required int pageNo, + required int recordType, + required int pageSize, + }) async { + final res = await apiProvider.advancedFunctionBuyRecordList( + type, pageNo, recordType, pageSize); + return AdvancedFunctionRecordEntity.fromJson(res.body); } }