Showing
8 changed files
with
96 additions
and
60 deletions
| @@ -214,11 +214,11 @@ class Arule extends Object { | @@ -214,11 +214,11 @@ class Arule extends Object { | ||
| 214 | @JsonKey(name: 'is_share_have') | 214 | @JsonKey(name: 'is_share_have') |
| 215 | bool isShareHave; | 215 | bool isShareHave; |
| 216 | 216 | ||
| 217 | - @JsonKey(name: 'is_commission') | ||
| 218 | - bool isCommission; | 217 | + // @JsonKey(name: 'is_commission') |
| 218 | + // bool isCommission; | ||
| 219 | 219 | ||
| 220 | - @JsonKey(name: 'commission') | ||
| 221 | - String commission; | 220 | + // @JsonKey(name: 'commission') |
| 221 | + // String commission; | ||
| 222 | 222 | ||
| 223 | Arule( | 223 | Arule( |
| 224 | this.isSameDay, | 224 | this.isSameDay, |
| @@ -229,8 +229,9 @@ class Arule extends Object { | @@ -229,8 +229,9 @@ class Arule extends Object { | ||
| 229 | this.isAppointment, | 229 | this.isAppointment, |
| 230 | this.isShareLose, | 230 | this.isShareLose, |
| 231 | this.isShareHave, | 231 | this.isShareHave, |
| 232 | - this.isCommission, | ||
| 233 | - this.commission); | 232 | + // this.isCommission, |
| 233 | + // this.commission | ||
| 234 | + ); | ||
| 234 | 235 | ||
| 235 | factory Arule.fromJson(Map<String, dynamic> srcJson) => | 236 | factory Arule.fromJson(Map<String, dynamic> srcJson) => |
| 236 | _$AruleFromJson(srcJson); | 237 | _$AruleFromJson(srcJson); |
| @@ -215,12 +215,12 @@ Arule _$AruleFromJson(Map<String, dynamic> json) { | @@ -215,12 +215,12 @@ Arule _$AruleFromJson(Map<String, dynamic> json) { | ||
| 215 | isShareHave = json['is_share_have'] ? true : false; | 215 | isShareHave = json['is_share_have'] ? true : false; |
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | - bool isCommission = false; | ||
| 219 | - if (json['is_commission'] is String) { | ||
| 220 | - isCommission = json['is_commission'] == '1' ? true : false; | ||
| 221 | - } else if (json['is_commission'] is bool) { | ||
| 222 | - isCommission = json['is_commission'] ? true : false; | ||
| 223 | - } | 218 | + // bool isCommission = false; |
| 219 | + // if (json['is_commission'] is String) { | ||
| 220 | + // isCommission = json['is_commission'] == '1' ? true : false; | ||
| 221 | + // } else if (json['is_commission'] is bool) { | ||
| 222 | + // isCommission = json['is_commission'] ? true : false; | ||
| 223 | + // } | ||
| 224 | 224 | ||
| 225 | return Arule( | 225 | return Arule( |
| 226 | isSameDay, | 226 | isSameDay, |
| @@ -231,8 +231,9 @@ Arule _$AruleFromJson(Map<String, dynamic> json) { | @@ -231,8 +231,9 @@ Arule _$AruleFromJson(Map<String, dynamic> json) { | ||
| 231 | isAppointment, | 231 | isAppointment, |
| 232 | isShareLose, | 232 | isShareLose, |
| 233 | isShareHave, | 233 | isShareHave, |
| 234 | - isCommission, | ||
| 235 | - json['commission']); | 234 | + // isCommission, |
| 235 | + // json['commission'] | ||
| 236 | + ); | ||
| 236 | } | 237 | } |
| 237 | 238 | ||
| 238 | Map<String, dynamic> _$AruleToJson(Arule instance) => <String, dynamic>{ | 239 | Map<String, dynamic> _$AruleToJson(Arule instance) => <String, dynamic>{ |
| @@ -244,8 +245,8 @@ Map<String, dynamic> _$AruleToJson(Arule instance) => <String, dynamic>{ | @@ -244,8 +245,8 @@ Map<String, dynamic> _$AruleToJson(Arule instance) => <String, dynamic>{ | ||
| 244 | 'is_appointment': instance.isAppointment, | 245 | 'is_appointment': instance.isAppointment, |
| 245 | 'is_share_lose': instance.isShareLose, | 246 | 'is_share_lose': instance.isShareLose, |
| 246 | 'is_share_have': instance.isShareHave, | 247 | 'is_share_have': instance.isShareHave, |
| 247 | - 'is_commission': instance.isCommission, | ||
| 248 | - 'commission': instance.commission, | 248 | + // 'is_commission': instance.isCommission, |
| 249 | + // 'commission': instance.commission, | ||
| 249 | }; | 250 | }; |
| 250 | 251 | ||
| 251 | ExpDate _$ExpDateFromJson(Map<String, dynamic> json) { | 252 | ExpDate _$ExpDateFromJson(Map<String, dynamic> json) { |
| @@ -50,7 +50,7 @@ class DiscountOrderInfoModelData { | @@ -50,7 +50,7 @@ class DiscountOrderInfoModelData { | ||
| 50 | String? cdate; | 50 | String? cdate; |
| 51 | String? sellername; | 51 | String? sellername; |
| 52 | String? applymentSubMchid; | 52 | String? applymentSubMchid; |
| 53 | - List<String?>? activityList; | 53 | + List<DiscountOrderInfoModelDataActivityList?>? activityList; |
| 54 | 54 | ||
| 55 | DiscountOrderInfoModelData({ | 55 | DiscountOrderInfoModelData({ |
| 56 | this.id, | 56 | this.id, |
| @@ -96,13 +96,13 @@ class DiscountOrderInfoModelData { | @@ -96,13 +96,13 @@ class DiscountOrderInfoModelData { | ||
| 96 | cdate = json['cdate']?.toString(); | 96 | cdate = json['cdate']?.toString(); |
| 97 | sellername = json['sellername']?.toString(); | 97 | sellername = json['sellername']?.toString(); |
| 98 | applymentSubMchid = json['applyment_sub_mchid']?.toString(); | 98 | applymentSubMchid = json['applyment_sub_mchid']?.toString(); |
| 99 | - if (json['activity_list'] != null) { | ||
| 100 | - final v = json['activity_list']; | ||
| 101 | - final arr0 = <String>[]; | ||
| 102 | - v.forEach((v) { | ||
| 103 | - arr0.add(v.toString()); | ||
| 104 | - }); | ||
| 105 | - activityList = arr0; | 99 | + if (json['activity_list'] != null) { |
| 100 | + final v = json['activity_list']; | ||
| 101 | + final arr0 = <DiscountOrderInfoModelDataActivityList>[]; | ||
| 102 | + v.forEach((v) { | ||
| 103 | + arr0.add(DiscountOrderInfoModelDataActivityList.fromJson(v)); | ||
| 104 | + }); | ||
| 105 | + activityList = arr0; | ||
| 106 | } | 106 | } |
| 107 | } | 107 | } |
| 108 | Map<String, dynamic> toJson() { | 108 | Map<String, dynamic> toJson() { |
| @@ -130,11 +130,34 @@ class DiscountOrderInfoModelData { | @@ -130,11 +130,34 @@ class DiscountOrderInfoModelData { | ||
| 130 | if (activityList != null) { | 130 | if (activityList != null) { |
| 131 | final v = activityList; | 131 | final v = activityList; |
| 132 | final arr0 = []; | 132 | final arr0 = []; |
| 133 | - v!.forEach((v) { | ||
| 134 | - arr0.add(v); | ||
| 135 | - }); | 133 | + v!.forEach((v) { |
| 134 | + arr0.add(v!.toJson()); | ||
| 135 | + }); | ||
| 136 | data['activity_list'] = arr0; | 136 | data['activity_list'] = arr0; |
| 137 | } | 137 | } |
| 138 | + | ||
| 139 | + return data; | ||
| 140 | + } | ||
| 141 | +} | ||
| 142 | + | ||
| 143 | +class DiscountOrderInfoModelDataActivityList { | ||
| 144 | +/* | ||
| 145 | +{ | ||
| 146 | + "price": null | ||
| 147 | +} | ||
| 148 | +*/ | ||
| 149 | + | ||
| 150 | + String? price; | ||
| 151 | + | ||
| 152 | + DiscountOrderInfoModelDataActivityList({ | ||
| 153 | + this.price, | ||
| 154 | + }); | ||
| 155 | + DiscountOrderInfoModelDataActivityList.fromJson(Map<String, dynamic> json) { | ||
| 156 | + price = json['price']?.toString(); | ||
| 157 | + } | ||
| 158 | + Map<String, dynamic> toJson() { | ||
| 159 | + final data = <String, dynamic>{}; | ||
| 160 | + data['price'] = price; | ||
| 138 | return data; | 161 | return data; |
| 139 | } | 162 | } |
| 140 | } | 163 | } |
| @@ -181,9 +204,11 @@ class DiscountOrderInfoModel { | @@ -181,9 +204,11 @@ class DiscountOrderInfoModel { | ||
| 181 | this.data, | 204 | this.data, |
| 182 | this.msg, | 205 | this.msg, |
| 183 | }); | 206 | }); |
| 184 | - DiscountOrderInfoModel.fromJson(Map< dynamic, dynamic> json) { | 207 | + DiscountOrderInfoModel.fromJson(Map<dynamic, dynamic> json) { |
| 185 | ret = json['ret']?.toInt(); | 208 | ret = json['ret']?.toInt(); |
| 186 | - data = (json['data'] != null) ? DiscountOrderInfoModelData.fromJson(json['data']) : null; | 209 | + data = (json['data'] != null) |
| 210 | + ? DiscountOrderInfoModelData.fromJson(json['data']) | ||
| 211 | + : null; | ||
| 187 | msg = json['msg']?.toString(); | 212 | msg = json['msg']?.toString(); |
| 188 | } | 213 | } |
| 189 | Map<String, dynamic> toJson() { | 214 | Map<String, dynamic> toJson() { |
| @@ -689,12 +689,12 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -689,12 +689,12 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 689 | couponProvider | 689 | couponProvider |
| 690 | .couponSunModel!.arule!.isShareHave, | 690 | .couponSunModel!.arule!.isShareHave, |
| 691 | ), | 691 | ), |
| 692 | - _canUse( | ||
| 693 | - '分享核销后,分享用户获得佣金', | ||
| 694 | - couponProvider.couponSunModel!.arule! | ||
| 695 | - .isCommission), | ||
| 696 | - _item('分享佣金', | ||
| 697 | - '${couponProvider.couponSunModel!.arule!.commission}%'), | 692 | + // _canUse( |
| 693 | + // '分享核销后,分享用户获得佣金', | ||
| 694 | + // couponProvider.couponSunModel!.arule! | ||
| 695 | + // .isCommission), | ||
| 696 | + // _item('分享佣金', | ||
| 697 | + // '${couponProvider.couponSunModel!.arule!.commission}%'), | ||
| 698 | ], | 698 | ], |
| 699 | ), | 699 | ), |
| 700 | ), | 700 | ), |
| @@ -1633,18 +1633,18 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | @@ -1633,18 +1633,18 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | ||
| 1633 | return; | 1633 | return; |
| 1634 | } | 1634 | } |
| 1635 | 1635 | ||
| 1636 | - if (!Utils.isInteger(_priceControl.text.trim())) { | ||
| 1637 | - Utils.showToast('券金额请输入数字'); | ||
| 1638 | - _priceControl.text = ''; | ||
| 1639 | - return; | ||
| 1640 | - } | 1636 | + // if (!Utils.isInteger(_priceControl.text.trim())) { |
| 1637 | + // Utils.showToast('券金额请输入数字'); | ||
| 1638 | + // _priceControl.text = ''; | ||
| 1639 | + // return; | ||
| 1640 | + // } | ||
| 1641 | 1641 | ||
| 1642 | - if (!Utils.isInteger( | ||
| 1643 | - _couponRequireEditControl.text.trim())) { | ||
| 1644 | - Utils.showToast('消费要求请输入数字'); | ||
| 1645 | - _couponRequireEditControl.text = ''; | ||
| 1646 | - return; | ||
| 1647 | - } | 1642 | + // if (!Utils.isInteger( |
| 1643 | + // _couponRequireEditControl.text.trim())) { | ||
| 1644 | + // Utils.showToast('消费要求请输入数字'); | ||
| 1645 | + // _couponRequireEditControl.text = ''; | ||
| 1646 | + // return; | ||
| 1647 | + // } | ||
| 1648 | // if (!Utils.isInteger(_commissionControl.text.trim())) { | 1648 | // if (!Utils.isInteger(_commissionControl.text.trim())) { |
| 1649 | // Utils.showToast('分享佣金请输入数字'); | 1649 | // Utils.showToast('分享佣金请输入数字'); |
| 1650 | // _commissionControl.text = ''; | 1650 | // _commissionControl.text = ''; |
| @@ -1326,12 +1326,12 @@ class _CouponEidtPayPageState extends State<CouponEidtPayPage> { | @@ -1326,12 +1326,12 @@ class _CouponEidtPayPageState extends State<CouponEidtPayPage> { | ||
| 1326 | Utils.showToast('请输入销售价,且必须大于0'); | 1326 | Utils.showToast('请输入销售价,且必须大于0'); |
| 1327 | return; | 1327 | return; |
| 1328 | } | 1328 | } |
| 1329 | - if (!Utils.isInteger( | ||
| 1330 | - _priceControl.text.trim())) { | ||
| 1331 | - Utils.showToast('销售价请输入数字'); | ||
| 1332 | - _priceControl.text = ''; | ||
| 1333 | - return; | ||
| 1334 | - } | 1329 | + // if (!Utils.isInteger( |
| 1330 | + // _priceControl.text.trim())) { | ||
| 1331 | + // Utils.showToast('销售价请输入数字'); | ||
| 1332 | + // _priceControl.text = ''; | ||
| 1333 | + // return; | ||
| 1334 | + // } | ||
| 1335 | if (!widget.isMine) { | 1335 | if (!widget.isMine) { |
| 1336 | if (money && moneyControl.text.trim().length == 0) { | 1336 | if (money && moneyControl.text.trim().length == 0) { |
| 1337 | Utils.showToast('请输入代金券金额!'); | 1337 | Utils.showToast('请输入代金券金额!'); |
| @@ -8,6 +8,7 @@ import 'package:one_key/widgets/v_empty_view.dart'; | @@ -8,6 +8,7 @@ import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 8 | import 'package:provider/provider.dart'; | 8 | import 'package:provider/provider.dart'; |
| 9 | 9 | ||
| 10 | import '../../../constant/state.dart'; | 10 | import '../../../constant/state.dart'; |
| 11 | +import '../../../models/discount_order_info_model.dart'; | ||
| 11 | import '../../../provider/finance_provider.dart'; | 12 | import '../../../provider/finance_provider.dart'; |
| 12 | import '../../../provider/user_model.dart'; | 13 | import '../../../provider/user_model.dart'; |
| 13 | import '../../../res/colors.dart'; | 14 | import '../../../res/colors.dart'; |
| @@ -65,6 +66,12 @@ class _TransactionRecordDetailPageState | @@ -65,6 +66,12 @@ class _TransactionRecordDetailPageState | ||
| 65 | if (result is bool) { | 66 | if (result is bool) { |
| 66 | if (result) { | 67 | if (result) { |
| 67 | //成功,刷新页面,是否给提示,申请退款成功,请等待退款 | 68 | //成功,刷新页面,是否给提示,申请退款成功,请等待退款 |
| 69 | + | ||
| 70 | + DialogUtil.cupertinoAlertDialogOnly(context, | ||
| 71 | + title: '提示', | ||
| 72 | + // isBoldContent: true, | ||
| 73 | + contentColor: MyColours.color_000000, | ||
| 74 | + content: '退款已申请!请稍后查看交易记录'); | ||
| 68 | bus.emit("refresh_discount_order_list"); | 75 | bus.emit("refresh_discount_order_list"); |
| 69 | _getDiscountOrderInfo(isShowLoading: true); | 76 | _getDiscountOrderInfo(isShowLoading: true); |
| 70 | } else { | 77 | } else { |
| @@ -183,15 +190,17 @@ class _TransactionRecordDetailPageState | @@ -183,15 +190,17 @@ class _TransactionRecordDetailPageState | ||
| 183 | // //这笔数据是退款 | 190 | // //这笔数据是退款 |
| 184 | // isPay = true; | 191 | // isPay = true; |
| 185 | // } | 192 | // } |
| 186 | - String couponUse = '无'; | 193 | + String couponUse = ''; |
| 187 | if (model.discountOrderInfoModelData!.activityList!.length > 0) { | 194 | if (model.discountOrderInfoModelData!.activityList!.length > 0) { |
| 188 | - for (var element | 195 | + for (DiscountOrderInfoModelDataActivityList? element |
| 189 | in model.discountOrderInfoModelData!.activityList!) { | 196 | in model.discountOrderInfoModelData!.activityList!) { |
| 190 | - couponUse += '¥${element}*1\n'; | 197 | + if (element!.price != null) { |
| 198 | + couponUse += '¥${element.price}*1\n'; | ||
| 199 | + } | ||
| 191 | } | 200 | } |
| 192 | } | 201 | } |
| 193 | if (couponUse.length > 0 && couponUse.endsWith('\n')) { | 202 | if (couponUse.length > 0 && couponUse.endsWith('\n')) { |
| 194 | - couponUse = couponUse.substring(0, couponUse.length - 2); | 203 | + couponUse = couponUse.substring(0, couponUse.length - 1); |
| 195 | } | 204 | } |
| 196 | 205 | ||
| 197 | return Column( | 206 | return Column( |
| @@ -258,7 +267,7 @@ class _TransactionRecordDetailPageState | @@ -258,7 +267,7 @@ class _TransactionRecordDetailPageState | ||
| 258 | : '退款失败'), | 267 | : '退款失败'), |
| 259 | _item('订单金额', | 268 | _item('订单金额', |
| 260 | '¥${model.discountOrderInfoModelData?.price}'), | 269 | '¥${model.discountOrderInfoModelData?.price}'), |
| 261 | - _item('优惠券使用', couponUse), | 270 | + _item('优惠券使用', couponUse == '' ? '无' : couponUse), |
| 262 | _item('变更后余额', | 271 | _item('变更后余额', |
| 263 | '${model.discountOrderInfoModelData?.balance ?? '0'}'), | 272 | '${model.discountOrderInfoModelData?.balance ?? '0'}'), |
| 264 | _item( | 273 | _item( |
| @@ -32,7 +32,7 @@ class FinanceProvider extends ChangeNotifier { | @@ -32,7 +32,7 @@ class FinanceProvider extends ChangeNotifier { | ||
| 32 | }; | 32 | }; |
| 33 | BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>( | 33 | BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>( |
| 34 | context, Method.post, HttpUrl.create_pay_qrcode, | 34 | context, Method.post, HttpUrl.create_pay_qrcode, |
| 35 | - data: params, showLoading: isShowLoading ); | 35 | + data: params, showLoading: isShowLoading); |
| 36 | if (baseResp.code == Constant.status_success) { | 36 | if (baseResp.code == Constant.status_success) { |
| 37 | if (baseResp.data.isEmpty) { | 37 | if (baseResp.data.isEmpty) { |
| 38 | // if (isShowLoading) { | 38 | // if (isShowLoading) { |
| @@ -84,7 +84,7 @@ class FinanceProvider extends ChangeNotifier { | @@ -84,7 +84,7 @@ class FinanceProvider extends ChangeNotifier { | ||
| 84 | try { | 84 | try { |
| 85 | BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>( | 85 | BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>( |
| 86 | context, Method.post, HttpUrl.get_discount_orderlist, | 86 | context, Method.post, HttpUrl.get_discount_orderlist, |
| 87 | - data: params, showLoading: isShowLoading ); | 87 | + data: params, showLoading: isShowLoading); |
| 88 | if (baseResp.code == Constant.status_success) { | 88 | if (baseResp.code == Constant.status_success) { |
| 89 | if (baseResp.data.isEmpty) { | 89 | if (baseResp.data.isEmpty) { |
| 90 | // if (isShowLoading) { | 90 | // if (isShowLoading) { |
| @@ -221,7 +221,7 @@ class FinanceProvider extends ChangeNotifier { | @@ -221,7 +221,7 @@ class FinanceProvider extends ChangeNotifier { | ||
| 221 | data: params, showLoading: false); | 221 | data: params, showLoading: false); |
| 222 | if (baseResp.code == Constant.status_success) { | 222 | if (baseResp.code == Constant.status_success) { |
| 223 | if (baseResp.data is Map) { | 223 | if (baseResp.data is Map) { |
| 224 | - if (baseResp.data.containKeys('code')) { | 224 | + if (baseResp.data['code'] != null) { |
| 225 | //错误了 | 225 | //错误了 |
| 226 | if (baseResp.data['code'] == 'NOT_ENOUGH') { | 226 | if (baseResp.data['code'] == 'NOT_ENOUGH') { |
| 227 | return '您的账户余额不足,无法支付本次退款,请往账户中充值后,再进行退款操作!'; | 227 | return '您的账户余额不足,无法支付本次退款,请往账户中充值后,再进行退款操作!'; |
-
Please register or login to post a comment