feat: 更新代码仓库全部修改
Build Android APK / 编译 libcore.aar (push) Has been cancelled
Build Android APK / 编译 Android APK (release) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Windows / build (push) Has been cancelled
Build Android APK / 编译 libcore.aar (push) Has been cancelled
Build Android APK / 编译 Android APK (release) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Windows / build (push) Has been cancelled
This commit is contained in:
@@ -11,7 +11,7 @@ class KRAlreadySubscribe {
|
||||
factory KRAlreadySubscribe.fromJson(Map<String, dynamic> json) {
|
||||
return KRAlreadySubscribe(
|
||||
subscribeId: json['subscribe_id'] ?? 0,
|
||||
userSubscribeId: json['user_subscribe_id'] ?? 0,
|
||||
userSubscribeId: json['id'] ?? 0,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ class KRAlreadySubscribeList {
|
||||
KRAlreadySubscribeList({required this.list});
|
||||
|
||||
factory KRAlreadySubscribeList.fromJson(Map<String, dynamic> json) {
|
||||
final List<dynamic> data = json['data'] ?? [];
|
||||
final List<dynamic> data = json['list'] ?? [];
|
||||
return KRAlreadySubscribeList(
|
||||
list: data.map((item) => KRAlreadySubscribe.fromJson(item)).toList(),
|
||||
);
|
||||
|
||||
@@ -185,9 +185,9 @@ class KRPackageListItem {
|
||||
|
||||
// 创建完整的折扣列表,确保基础选项在最后
|
||||
final List<KRDiscount> discounts = List.from(originalDiscounts);
|
||||
if (!discounts.any((discount) => discount.kr_quantity == 1)) {
|
||||
discounts.add(baseDiscount);
|
||||
}
|
||||
// if (!discounts.any((discount) => discount.kr_quantity == 1)) {
|
||||
// discounts.add(baseDiscount);
|
||||
// }
|
||||
|
||||
// 解析描述信息
|
||||
final descriptionJson = json['description'];
|
||||
@@ -252,18 +252,18 @@ class KRPackageListItem {
|
||||
}
|
||||
|
||||
// 检查是否已存在数量为1的折扣
|
||||
final bool hasBaseDiscount = kr_discount.any((discount) => discount.kr_quantity == 1);
|
||||
// final bool hasBaseDiscount = kr_discount.any((discount) => discount.kr_quantity == 1);
|
||||
|
||||
// 创建新的列表,包含所有原始折扣
|
||||
final List<KRDiscount> completeList = List.from(kr_discount);
|
||||
|
||||
// 如果没有数量为1的折扣,添加基础选项到列表末尾
|
||||
if (!hasBaseDiscount) {
|
||||
completeList.add(baseDiscount);
|
||||
}
|
||||
// if (!hasBaseDiscount) {
|
||||
// completeList.add(baseDiscount);
|
||||
// }
|
||||
|
||||
// 按数量排序
|
||||
completeList.sort((a, b) => a.kr_quantity.compareTo(b.kr_quantity));
|
||||
// completeList.sort((a, b) => a.kr_quantity.compareTo(b.kr_quantity));
|
||||
|
||||
return completeList;
|
||||
}
|
||||
@@ -310,7 +310,7 @@ class KRDiscount {
|
||||
// 折扣数量
|
||||
final int kr_quantity;
|
||||
// 折扣百分比
|
||||
final int kr_discount;
|
||||
final double kr_discount;
|
||||
|
||||
KRDiscount({
|
||||
required this.kr_quantity,
|
||||
@@ -320,7 +320,7 @@ class KRDiscount {
|
||||
// 从JSON数据创建KRDiscount实例
|
||||
factory KRDiscount.fromJson(Map<String, dynamic> json) {
|
||||
// 确保折扣值在 0-100 之间
|
||||
int discount = json['discount'] ?? 100;
|
||||
double discount = json['discount'] ?? 100.00;
|
||||
if (discount < 0) discount = 0;
|
||||
if (discount > 100) discount = 100;
|
||||
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
class KRAuthMethod {
|
||||
final String authIdentifier;
|
||||
final String authType;
|
||||
final bool verified;
|
||||
|
||||
KRAuthMethod({
|
||||
required this.authIdentifier,
|
||||
required this.authType,
|
||||
required this.verified,
|
||||
});
|
||||
|
||||
factory KRAuthMethod.fromJson(Map<String, dynamic> json) {
|
||||
return KRAuthMethod(
|
||||
authIdentifier: json['auth_identifier'] ?? '',
|
||||
authType: json['auth_type'] ?? '',
|
||||
verified: json['verified'] ?? false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class KRUserInfo {
|
||||
final int id;
|
||||
final String email;
|
||||
@@ -12,6 +32,9 @@ class KRUserInfo {
|
||||
final bool onlyFirstPurchase;
|
||||
final int giftAmount;
|
||||
|
||||
// 新增 auth_methods 列表
|
||||
final List<KRAuthMethod> authMethods;
|
||||
|
||||
KRUserInfo({
|
||||
required this.id,
|
||||
required this.email,
|
||||
@@ -25,6 +48,7 @@ class KRUserInfo {
|
||||
this.referralPercentage = 0,
|
||||
this.onlyFirstPurchase = false,
|
||||
this.giftAmount = 0,
|
||||
this.authMethods = const [],
|
||||
});
|
||||
|
||||
factory KRUserInfo.fromJson(Map<String, dynamic> json) {
|
||||
@@ -41,6 +65,10 @@ class KRUserInfo {
|
||||
referralPercentage: json['referral_percentage'] ?? 0,
|
||||
onlyFirstPurchase: json['only_first_purchase'] ?? false,
|
||||
giftAmount: json['gift_amount'] ?? 0,
|
||||
authMethods: (json['auth_methods'] as List<dynamic>?)
|
||||
?.map((e) => KRAuthMethod.fromJson(e))
|
||||
.toList() ??
|
||||
[],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user