1,新增短信/邮件购买记录、使用记录接口对接
2,修改发送电子钥匙报错问题
This commit is contained in:
parent
dafb40954a
commit
e2c5066bec
@ -197,7 +197,7 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
required String endTime}) async {
|
||||
final AuthorizedAdminSendEntity entity = await ApiRepository.to
|
||||
.sendElectronicKey(
|
||||
createUser: state.isCreateUser.value ? '1' : '0',
|
||||
createUser: state.createUser.value,
|
||||
countryCode: state.countryCode.value,
|
||||
usernameType: '1',
|
||||
endDate: int.parse(endDate),
|
||||
@ -224,18 +224,20 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
? state.idCardController.text
|
||||
: '');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.isCreateUser.value = false;
|
||||
state.createUser.value = 0;
|
||||
state.isSendSuccess.value = true;
|
||||
state.addUserId.value = entity.data!.receiverUser!.id.toString();
|
||||
keyId = entity.data!.keyId;
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
} else {
|
||||
//用户未注册
|
||||
if (entity.errorCode == 425) {
|
||||
//用户未注册
|
||||
state.isCreateUser.value = true;
|
||||
update();
|
||||
ShowTipView().showIosTipWithContentDialog(
|
||||
'${"是否发送授权管理员给未注册账号".tr}\n${state.emailOrPhoneController.text}',
|
||||
sendElectronicKeyRequest);
|
||||
'${"是否发送电子钥匙给未注册账号".tr}\n${state.emailOrPhoneController.text}', () {
|
||||
state.createUser.value = 1;
|
||||
sendElectronicKeyRequest();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ class AuthorizedAdminState {
|
||||
RxString countryName = '中国'.obs;
|
||||
RxString countryCode = '86'.obs;
|
||||
RxList weekdaysList = [].obs;
|
||||
RxBool isCreateUser = false.obs; //用户未注册时传1 已注册传0
|
||||
RxInt createUser = 0.obs; //用户未注册时传1 已注册传0
|
||||
|
||||
RxInt seletType = 0.obs;
|
||||
String pwdShareStr = '您好,您的授权管理员生成成功';
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_state.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
@ -16,40 +16,39 @@ import 'package:star_lock/tools/showTipView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
SendElectronicKeyViewLogic(this.type);
|
||||
String type;
|
||||
final SendElectronicKeyViewState state = SendElectronicKeyViewState();
|
||||
|
||||
SendElectronicKeyViewLogic(this.type);
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
|
||||
Storage.getBool(ifIsDemoModeOrNot)
|
||||
.then((value) => state.isDemoMode = value ?? false);
|
||||
.then((bool? value) => state.isDemoMode = value ?? false);
|
||||
}
|
||||
|
||||
//发送钥匙请求
|
||||
Future<void> sendElectronicKeyRequest() async {
|
||||
if (state.emailOrPhoneController.text.isEmpty) {
|
||||
showToast("请输入接收者账号".tr);
|
||||
showToast('请输入接收者账号'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
var startDate = "0";
|
||||
var endDate = "0";
|
||||
var startTime = "0";
|
||||
var endTime = "0";
|
||||
var startDate = '0';
|
||||
var endDate = '0';
|
||||
var startTime = '0';
|
||||
var endTime = '0';
|
||||
int typeValue;
|
||||
switch (type) {
|
||||
case '0':
|
||||
// 限时
|
||||
if (state.timeLimitBeginTime.isEmpty) {
|
||||
showToast("请选择开始时间".tr);
|
||||
showToast('请选择开始时间'.tr);
|
||||
return;
|
||||
}
|
||||
if (state.timeLimitEndTime.isEmpty) {
|
||||
showToast("请选择结束时间".tr);
|
||||
showToast('请选择结束时间'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -58,11 +57,11 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
DateTool().dateToTimestamp(state.timeLimitBeginTime, 1).toString();
|
||||
endDate =
|
||||
DateTool().dateToTimestamp(state.timeLimitEndTime, 1).toString();
|
||||
startTime = "0";
|
||||
endTime = "0";
|
||||
startTime = '0';
|
||||
endTime = '0';
|
||||
|
||||
if (int.parse(startDate) >= int.parse(endDate)) {
|
||||
showToast("失效时间要大于生效时间".tr);
|
||||
showToast('失效时间要大于生效时间'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -76,7 +75,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
case '3':
|
||||
typeValue = XSConstantMacro.keyTypeLoop;
|
||||
if (state.cycleBeginTime.isEmpty) {
|
||||
showToast("请选择有效期".tr);
|
||||
showToast('请选择有效期'.tr);
|
||||
return;
|
||||
}
|
||||
startDate =
|
||||
@ -96,12 +95,12 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
//如果打开了实名认证,需要弹出输入身份证信息框
|
||||
if (state.isAuthentication.value == true) {
|
||||
if (state.realNameController.text.isEmpty) {
|
||||
showToast("请输入真实姓名".tr);
|
||||
showToast('请输入真实姓名'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (state.idCardController.text.isEmpty) {
|
||||
showToast("请输入身份证号".tr);
|
||||
showToast('请输入身份证号'.tr);
|
||||
return;
|
||||
}
|
||||
//弹出身份证信息确认框
|
||||
@ -137,37 +136,40 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
required int typeValue,
|
||||
required String getKeyType,
|
||||
}) async {
|
||||
var entity = await ApiRepository.to.sendElectronicKey(
|
||||
createUser: state.isCreateUser == true ? "1" : "0",
|
||||
countryCode: state.countryCode,
|
||||
usernameType: RegularExpression()
|
||||
.isPhoneNumber(state.emailOrPhoneController.text) ==
|
||||
true
|
||||
? '1'
|
||||
: '2',
|
||||
endDate: int.parse(endDate),
|
||||
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
||||
isCameraEnable: '2',
|
||||
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
|
||||
keyNameForAdmin: state.keyNameController.text,
|
||||
keyRight: '0',
|
||||
keyType: getKeyType,
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId.toString(),
|
||||
operatorUid: '',
|
||||
receiverUsername: state.emailOrPhoneController.text,
|
||||
remarks: '',
|
||||
startDate: int.parse(startDate),
|
||||
weekDays: state.weekdaysList,
|
||||
startTime: int.parse(startTime),
|
||||
endTime: int.parse(endTime),
|
||||
isOnlyManageSelf: 0,
|
||||
realName: state.isRequireAuth.value == true
|
||||
? state.realNameController.text
|
||||
: "",
|
||||
idCardNumber: state.isRequireAuth.value == true
|
||||
? state.idCardController.text
|
||||
: "");
|
||||
final AuthorizedAdminSendEntity entity = await ApiRepository.to
|
||||
.sendElectronicKey(
|
||||
createUser: state.createUser.value,
|
||||
countryCode: state.countryCode,
|
||||
usernameType: RegularExpression()
|
||||
.isPhoneNumber(state.emailOrPhoneController.text) ==
|
||||
true
|
||||
? '1'
|
||||
: '2',
|
||||
endDate: int.parse(endDate),
|
||||
faceAuthentication:
|
||||
state.isAuthentication.value == true ? '1' : '2',
|
||||
isCameraEnable: '2',
|
||||
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
|
||||
keyNameForAdmin: state.keyNameController.text,
|
||||
keyRight: '0',
|
||||
keyType: getKeyType,
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId.toString(),
|
||||
operatorUid: '',
|
||||
receiverUsername: state.emailOrPhoneController.text,
|
||||
remarks: '',
|
||||
startDate: int.parse(startDate),
|
||||
weekDays: state.weekdaysList,
|
||||
startTime: int.parse(startTime),
|
||||
endTime: int.parse(endTime),
|
||||
isOnlyManageSelf: 0,
|
||||
realName: state.isRequireAuth.value == true
|
||||
? state.realNameController.text
|
||||
: '',
|
||||
idCardNumber: state.isRequireAuth.value == true
|
||||
? state.idCardController.text
|
||||
: '');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.createUser.value = 0;
|
||||
state.isSendSuccess = true;
|
||||
resetData();
|
||||
update();
|
||||
@ -175,10 +177,10 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
} else {
|
||||
if (entity.errorCode == 425) {
|
||||
//用户未注册
|
||||
state.isCreateUser = true;
|
||||
update();
|
||||
ShowTipView().showIosTipWithContentDialog(
|
||||
'${"是否发送电子钥匙给未注册账号".tr}\n${state.emailOrPhoneController.text}', () {
|
||||
state.createUser.value = 1;
|
||||
sendElectronicKeyRequest();
|
||||
});
|
||||
}
|
||||
@ -231,19 +233,20 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
void resetData() {
|
||||
state.emailOrPhoneController.text = "";
|
||||
state.keyNameController.text = "";
|
||||
state.realNameController.text = "";
|
||||
state.idCardController.text = "";
|
||||
state.emailOrPhoneController.text = '';
|
||||
state.keyNameController.text = '';
|
||||
state.realNameController.text = '';
|
||||
state.idCardController.text = '';
|
||||
state.timeLimitBeginTime = DateTool().dateToYMDHNString(
|
||||
DateTime.now().millisecondsSinceEpoch.toString()); // 限时开始时间
|
||||
state.timeLimitEndTime = DateTool().dateToYMDHNString(
|
||||
DateTime.now().millisecondsSinceEpoch.toString()); // 限时结束时间
|
||||
state.cycleBeginTime = ""; // 循环开始时间
|
||||
state.cycleEndTime = ""; // 循环结束时间
|
||||
state.effectiveDateTime = ""; // 生效时间
|
||||
state.failureDateTime = ""; // 失效时间
|
||||
state.cycleBeginTime = ''; // 循环开始时间
|
||||
state.cycleEndTime = ''; // 循环结束时间
|
||||
state.effectiveDateTime = ''; // 生效时间
|
||||
state.failureDateTime = ''; // 失效时间
|
||||
state.weekdaysList = [];
|
||||
state.createUser.value = 0;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_logic.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/NativeInteractionTool.dart';
|
||||
@ -127,7 +128,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
action: () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
final result = await Navigator.pushNamed(
|
||||
context, Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
@ -158,7 +159,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
PDuration selectDate = PDuration.parse(
|
||||
final PDuration selectDate = PDuration.parse(
|
||||
DateTime.parse(logic.state.timeLimitBeginTime));
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
||||
@ -172,7 +173,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
rightTitle: logic.state.timeLimitEndTime,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
PDuration selectDate = PDuration.parse(
|
||||
final PDuration selectDate = PDuration.parse(
|
||||
DateTime.tryParse(logic.state.timeLimitEndTime));
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
||||
@ -194,8 +195,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
leftTitel: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||
rightTitle: '',
|
||||
isTipsImg: true,
|
||||
isHaveLine:
|
||||
logic.state.isRequireAuth.value == true ? true : false,
|
||||
isHaveLine: logic.state.isRequireAuth.value,
|
||||
tipsImgAction: () {
|
||||
ShowTipView().showSureAlertDialog(
|
||||
'人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。'.tr);
|
||||
@ -236,7 +236,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result =
|
||||
final result =
|
||||
await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: {
|
||||
'validityValue': logic.state.weekdaysList,
|
||||
'starDate': logic.state.cycleBeginTime,
|
||||
@ -254,15 +254,16 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
}
|
||||
}),
|
||||
Visibility(
|
||||
visible: logic.state.weekdaysList.isNotEmpty ? true : false,
|
||||
visible: logic.state.weekdaysList.isNotEmpty,
|
||||
child: CommonItem(
|
||||
leftTitel: '有效日'.tr,
|
||||
rightTitle: logic.state.weekdaysList.join(',').toString(),
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||
arguments: {
|
||||
final result = await Get.toNamed(
|
||||
Routers.seletKeyCyclicDatePage,
|
||||
arguments: <String, Object>{
|
||||
'validityValue': logic.state.weekdaysList,
|
||||
'starDate': logic.state.cycleBeginTime,
|
||||
'endDate': logic.state.cycleEndTime,
|
||||
@ -287,7 +288,8 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||
final result = await Get.toNamed(
|
||||
Routers.seletKeyCyclicDatePage,
|
||||
arguments: {
|
||||
'validityValue': logic.state.weekdaysList,
|
||||
'starDate': logic.state.cycleBeginTime,
|
||||
@ -367,7 +369,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
// 发送电子钥匙成功
|
||||
Widget sendElectronicKeySucceed(SendElectronicKeyViewLogic logic) {
|
||||
return Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 250.h,
|
||||
width: 1.sw,
|
||||
@ -428,7 +430,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
|
||||
//标记房间为已入住 isOn:已入住: 1 空闲:2
|
||||
Future<void> updateRoomCheckIn(SendElectronicKeyViewLogic logic) async {
|
||||
var entity = await ApiRepository.to.setRoomStatusData(
|
||||
final LoginEntity entity = await ApiRepository.to.setRoomStatusData(
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId!,
|
||||
roomStatus: 1,
|
||||
);
|
||||
@ -526,7 +528,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
? true
|
||||
: false),
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
||||
rightTitle: '',
|
||||
@ -565,7 +567,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
);
|
||||
}
|
||||
|
||||
Future _openModalBottomSheet() async {
|
||||
Future<void> _openModalBottomSheet() async {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
@ -604,7 +606,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
}
|
||||
|
||||
List<Widget> initBottomSheetList() {
|
||||
List<Widget> widgetList = [];
|
||||
final List<Widget> widgetList = [];
|
||||
widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友'.tr, 0));
|
||||
widgetList.add(buildCenter3('images/icon_message.png', '短信'.tr, 1));
|
||||
widgetList.add(buildCenter3('images/icon_email.png', '邮件'.tr, 2));
|
||||
@ -643,17 +645,17 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
);
|
||||
}
|
||||
|
||||
_jumpSmartDeviceRoute(int itemIndex) {
|
||||
void _jumpSmartDeviceRoute(int itemIndex) {
|
||||
Get.back();
|
||||
switch (itemIndex) {
|
||||
case 0:
|
||||
//微信好友
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
final String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||
break;
|
||||
case 1:
|
||||
//短信
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
final String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||
break;
|
||||
case 2:
|
||||
@ -662,7 +664,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
break;
|
||||
case 3:
|
||||
//更多
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
final String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -13,28 +13,28 @@ class SendElectronicKeyViewState {
|
||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||
late Contact contact;
|
||||
|
||||
var isRemoteUnlock = false.obs; //是否允许远程开锁
|
||||
var isAuthentication = false.obs; //是否可以实名认证
|
||||
RxBool isRemoteUnlock = false.obs; //是否允许远程开锁
|
||||
RxBool isAuthentication = false.obs; //是否可以实名认证
|
||||
|
||||
var timeLimitBeginTime = DateTool().dateToYMDHNString(
|
||||
String timeLimitBeginTime = DateTool().dateToYMDHNString(
|
||||
DateTime.now().millisecondsSinceEpoch.toString()); // 限时开始时间
|
||||
var timeLimitEndTime = DateTool().dateToYMDHNString(
|
||||
String timeLimitEndTime = DateTool().dateToYMDHNString(
|
||||
DateTime.now().millisecondsSinceEpoch.toString()); // 限时结束时间
|
||||
var cycleBeginTime = ""; // 循环开始时间
|
||||
var cycleEndTime = ""; // 循环结束时间
|
||||
var effectiveDateTime = ""; // 生效时间
|
||||
var failureDateTime = ""; // 失效时间
|
||||
var weekdaysList = [];
|
||||
String cycleBeginTime = ''; // 循环开始时间
|
||||
String cycleEndTime = ''; // 循环结束时间
|
||||
String effectiveDateTime = ''; // 生效时间
|
||||
String failureDateTime = ''; // 失效时间
|
||||
List<int> weekdaysList = <int>[];
|
||||
|
||||
var isSendSuccess = false;
|
||||
var countryName = '中国'.tr;
|
||||
var countryCode = '86';
|
||||
var isCreateUser = false; //用户未注册时传1 已注册传0
|
||||
var isDemoMode = false;
|
||||
var isRequireAuth = false.obs; //是否需要实名认证的必填项
|
||||
bool isSendSuccess = false;
|
||||
String countryName = '中国'.tr;
|
||||
String countryCode = '86';
|
||||
RxInt createUser = 0.obs; //用户未注册时传1 已注册传0
|
||||
bool isDemoMode = false;
|
||||
RxBool isRequireAuth = false.obs; //是否需要实名认证的必填项
|
||||
|
||||
final timeLimitTips = '接收者在有效期内可以不限次数使用'; //限时
|
||||
final permanentTips = '接收者可以使用此App开关锁'; //永久
|
||||
final onceLimitTips = '单次钥匙有效期为1小时,只能使用一次'; //单次
|
||||
final cycleLimitTips = '接收者可以在有效期内的固定时间段里,不限次数使用'; //循环
|
||||
final String timeLimitTips = '接收者在有效期内可以不限次数使用'; //限时
|
||||
final String permanentTips = '接收者可以使用此App开关锁'; //永久
|
||||
final String onceLimitTips = '单次钥匙有效期为1小时,只能使用一次'; //单次
|
||||
final String cycleLimitTips = '接收者可以在有效期内的固定时间段里,不限次数使用'; //循环
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesNoteAndEmailDetail/valueAddedServicesNoteAndEmailDetail_logic.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesNoteAndEmailDetail/valueAddedServicesNoteAndEmailDetail_state.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_arg.dart';
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
@ -139,8 +140,13 @@ class _ValueAddedServicesNoteAndEmailDetailPageState
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context,
|
||||
Routers.valueAddedServicesBuyAndUseRecordManagePage);
|
||||
if (type == 1) {
|
||||
Get.toNamed(Routers.valueAddedServicesRecordPage,
|
||||
arguments: UseRecordListArg.sms);
|
||||
} else if (type == 2) {
|
||||
Get.toNamed(Routers.valueAddedServicesRecordPage,
|
||||
arguments: UseRecordListArg.email);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: 90,
|
||||
|
||||
@ -2,6 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_arg.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
@ -58,6 +59,17 @@ class ValueAddedServicesRecordLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
String getBuyRecordListTitle(RecordItem itemData) {
|
||||
if (itemData.type == UseRecordListArg.sms['type']) {
|
||||
return '${itemData.smsCount}条';
|
||||
} else if (itemData.type == UseRecordListArg.email['type']) {
|
||||
return '${itemData.emailCount}封';
|
||||
} else if (itemData.type == UseRecordListArg.cloudauth['type']) {
|
||||
return '实名认证/${itemData.cloudauthCount}次';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
|
||||
@ -89,14 +89,15 @@ class _PurchaseRecords extends StatelessWidget {
|
||||
? ListView.builder(
|
||||
itemCount: buyRecordList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _recordKeyItem(buyRecordList[index]);
|
||||
return _recordKeyItem(buyRecordList[index], logic);
|
||||
})
|
||||
: NoData(),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget _recordKeyItem(RecordItem itemData) {
|
||||
Widget _recordKeyItem(
|
||||
RecordItem itemData, ValueAddedServicesRecordLogic logic) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.symmetric(horizontal: 20.w, vertical: 10.h),
|
||||
@ -122,7 +123,7 @@ class _PurchaseRecords extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8.h),
|
||||
Text('实名认证/${itemData.cloudauthCount}次',
|
||||
Text(logic.getBuyRecordListTitle(itemData),
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor)),
|
||||
],
|
||||
|
||||
@ -124,7 +124,7 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
Future<Response> sendElectronicKey(
|
||||
String createUser,
|
||||
int createUser,
|
||||
String countryCode,
|
||||
String usernameType,
|
||||
int endDate,
|
||||
|
||||
@ -167,7 +167,7 @@ class ApiRepository {
|
||||
|
||||
//发送电子钥匙
|
||||
Future<AuthorizedAdminSendEntity> sendElectronicKey(
|
||||
{required String createUser,
|
||||
{required int createUser,
|
||||
required String countryCode,
|
||||
required String usernameType,
|
||||
required int endDate,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user