Commit 0e723987aee9dbf75cd2c7eb225611b8f79aa48a

Authored by wdn127929
1 parent 5a21b984

交易记录

... ... @@ -214,11 +214,11 @@ class Arule extends Object {
@JsonKey(name: 'is_share_have')
bool isShareHave;
@JsonKey(name: 'is_commission')
bool isCommission;
// @JsonKey(name: 'is_commission')
// bool isCommission;
@JsonKey(name: 'commission')
String commission;
// @JsonKey(name: 'commission')
// String commission;
Arule(
this.isSameDay,
... ... @@ -229,8 +229,9 @@ class Arule extends Object {
this.isAppointment,
this.isShareLose,
this.isShareHave,
this.isCommission,
this.commission);
// this.isCommission,
// this.commission
);
factory Arule.fromJson(Map<String, dynamic> srcJson) =>
_$AruleFromJson(srcJson);
... ...
... ... @@ -215,12 +215,12 @@ Arule _$AruleFromJson(Map<String, dynamic> json) {
isShareHave = json['is_share_have'] ? true : false;
}
bool isCommission = false;
if (json['is_commission'] is String) {
isCommission = json['is_commission'] == '1' ? true : false;
} else if (json['is_commission'] is bool) {
isCommission = json['is_commission'] ? true : false;
}
// bool isCommission = false;
// if (json['is_commission'] is String) {
// isCommission = json['is_commission'] == '1' ? true : false;
// } else if (json['is_commission'] is bool) {
// isCommission = json['is_commission'] ? true : false;
// }
return Arule(
isSameDay,
... ... @@ -231,8 +231,9 @@ Arule _$AruleFromJson(Map<String, dynamic> json) {
isAppointment,
isShareLose,
isShareHave,
isCommission,
json['commission']);
// isCommission,
// json['commission']
);
}
Map<String, dynamic> _$AruleToJson(Arule instance) => <String, dynamic>{
... ... @@ -244,8 +245,8 @@ Map<String, dynamic> _$AruleToJson(Arule instance) => <String, dynamic>{
'is_appointment': instance.isAppointment,
'is_share_lose': instance.isShareLose,
'is_share_have': instance.isShareHave,
'is_commission': instance.isCommission,
'commission': instance.commission,
// 'is_commission': instance.isCommission,
// 'commission': instance.commission,
};
ExpDate _$ExpDateFromJson(Map<String, dynamic> json) {
... ...
... ... @@ -50,7 +50,7 @@ class DiscountOrderInfoModelData {
String? cdate;
String? sellername;
String? applymentSubMchid;
List<String?>? activityList;
List<DiscountOrderInfoModelDataActivityList?>? activityList;
DiscountOrderInfoModelData({
this.id,
... ... @@ -96,13 +96,13 @@ class DiscountOrderInfoModelData {
cdate = json['cdate']?.toString();
sellername = json['sellername']?.toString();
applymentSubMchid = json['applyment_sub_mchid']?.toString();
if (json['activity_list'] != null) {
final v = json['activity_list'];
final arr0 = <String>[];
v.forEach((v) {
arr0.add(v.toString());
});
activityList = arr0;
if (json['activity_list'] != null) {
final v = json['activity_list'];
final arr0 = <DiscountOrderInfoModelDataActivityList>[];
v.forEach((v) {
arr0.add(DiscountOrderInfoModelDataActivityList.fromJson(v));
});
activityList = arr0;
}
}
Map<String, dynamic> toJson() {
... ... @@ -130,11 +130,34 @@ class DiscountOrderInfoModelData {
if (activityList != null) {
final v = activityList;
final arr0 = [];
v!.forEach((v) {
arr0.add(v);
});
v!.forEach((v) {
arr0.add(v!.toJson());
});
data['activity_list'] = arr0;
}
return data;
}
}
class DiscountOrderInfoModelDataActivityList {
/*
{
"price": null
}
*/
String? price;
DiscountOrderInfoModelDataActivityList({
this.price,
});
DiscountOrderInfoModelDataActivityList.fromJson(Map<String, dynamic> json) {
price = json['price']?.toString();
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['price'] = price;
return data;
}
}
... ... @@ -181,9 +204,11 @@ class DiscountOrderInfoModel {
this.data,
this.msg,
});
DiscountOrderInfoModel.fromJson(Map< dynamic, dynamic> json) {
DiscountOrderInfoModel.fromJson(Map<dynamic, dynamic> json) {
ret = json['ret']?.toInt();
data = (json['data'] != null) ? DiscountOrderInfoModelData.fromJson(json['data']) : null;
data = (json['data'] != null)
? DiscountOrderInfoModelData.fromJson(json['data'])
: null;
msg = json['msg']?.toString();
}
Map<String, dynamic> toJson() {
... ...
... ... @@ -689,12 +689,12 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
couponProvider
.couponSunModel!.arule!.isShareHave,
),
_canUse(
'分享核销后,分享用户获得佣金',
couponProvider.couponSunModel!.arule!
.isCommission),
_item('分享佣金',
'${couponProvider.couponSunModel!.arule!.commission}%'),
// _canUse(
// '分享核销后,分享用户获得佣金',
// couponProvider.couponSunModel!.arule!
// .isCommission),
// _item('分享佣金',
// '${couponProvider.couponSunModel!.arule!.commission}%'),
],
),
),
... ...
... ... @@ -1633,18 +1633,18 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
return;
}
if (!Utils.isInteger(_priceControl.text.trim())) {
Utils.showToast('券金额请输入数字');
_priceControl.text = '';
return;
}
// if (!Utils.isInteger(_priceControl.text.trim())) {
// Utils.showToast('券金额请输入数字');
// _priceControl.text = '';
// return;
// }
if (!Utils.isInteger(
_couponRequireEditControl.text.trim())) {
Utils.showToast('消费要求请输入数字');
_couponRequireEditControl.text = '';
return;
}
// if (!Utils.isInteger(
// _couponRequireEditControl.text.trim())) {
// Utils.showToast('消费要求请输入数字');
// _couponRequireEditControl.text = '';
// return;
// }
// if (!Utils.isInteger(_commissionControl.text.trim())) {
// Utils.showToast('分享佣金请输入数字');
// _commissionControl.text = '';
... ...
... ... @@ -1326,12 +1326,12 @@ class _CouponEidtPayPageState extends State<CouponEidtPayPage> {
Utils.showToast('请输入销售价,且必须大于0');
return;
}
if (!Utils.isInteger(
_priceControl.text.trim())) {
Utils.showToast('销售价请输入数字');
_priceControl.text = '';
return;
}
// if (!Utils.isInteger(
// _priceControl.text.trim())) {
// Utils.showToast('销售价请输入数字');
// _priceControl.text = '';
// return;
// }
if (!widget.isMine) {
if (money && moneyControl.text.trim().length == 0) {
Utils.showToast('请输入代金券金额!');
... ...
... ... @@ -8,6 +8,7 @@ import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../../constant/state.dart';
import '../../../models/discount_order_info_model.dart';
import '../../../provider/finance_provider.dart';
import '../../../provider/user_model.dart';
import '../../../res/colors.dart';
... ... @@ -65,6 +66,12 @@ class _TransactionRecordDetailPageState
if (result is bool) {
if (result) {
//成功,刷新页面,是否给提示,申请退款成功,请等待退款
DialogUtil.cupertinoAlertDialogOnly(context,
title: '提示',
// isBoldContent: true,
contentColor: MyColours.color_000000,
content: '退款已申请!请稍后查看交易记录');
bus.emit("refresh_discount_order_list");
_getDiscountOrderInfo(isShowLoading: true);
} else {
... ... @@ -183,15 +190,17 @@ class _TransactionRecordDetailPageState
// //这笔数据是退款
// isPay = true;
// }
String couponUse = '无';
String couponUse = '';
if (model.discountOrderInfoModelData!.activityList!.length > 0) {
for (var element
for (DiscountOrderInfoModelDataActivityList? element
in model.discountOrderInfoModelData!.activityList!) {
couponUse += '¥${element}*1\n';
if (element!.price != null) {
couponUse += '¥${element.price}*1\n';
}
}
}
if (couponUse.length > 0 && couponUse.endsWith('\n')) {
couponUse = couponUse.substring(0, couponUse.length - 2);
couponUse = couponUse.substring(0, couponUse.length - 1);
}
return Column(
... ... @@ -258,7 +267,7 @@ class _TransactionRecordDetailPageState
: '退款失败'),
_item('订单金额',
'¥${model.discountOrderInfoModelData?.price}'),
_item('优惠券使用', couponUse),
_item('优惠券使用', couponUse == '' ? '无' : couponUse),
_item('变更后余额',
'${model.discountOrderInfoModelData?.balance ?? '0'}'),
_item(
... ...
... ... @@ -32,7 +32,7 @@ class FinanceProvider extends ChangeNotifier {
};
BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>(
context, Method.post, HttpUrl.create_pay_qrcode,
data: params, showLoading: isShowLoading );
data: params, showLoading: isShowLoading);
if (baseResp.code == Constant.status_success) {
if (baseResp.data.isEmpty) {
// if (isShowLoading) {
... ... @@ -84,7 +84,7 @@ class FinanceProvider extends ChangeNotifier {
try {
BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>(
context, Method.post, HttpUrl.get_discount_orderlist,
data: params, showLoading: isShowLoading );
data: params, showLoading: isShowLoading);
if (baseResp.code == Constant.status_success) {
if (baseResp.data.isEmpty) {
// if (isShowLoading) {
... ... @@ -221,7 +221,7 @@ class FinanceProvider extends ChangeNotifier {
data: params, showLoading: false);
if (baseResp.code == Constant.status_success) {
if (baseResp.data is Map) {
if (baseResp.data.containKeys('code')) {
if (baseResp.data['code'] != null) {
//错误了
if (baseResp.data['code'] == 'NOT_ENOUGH') {
return '您的账户余额不足,无法支付本次退款,请往账户中充值后,再进行退款操作!';
... ...