Browse Source

订单列表,扣款按钮弹窗更改;

wr_2023_business
wurong 1 year ago
parent
commit
d3ef38ee75
  1. BIN
      assets/image/2x/bus_give_yue.webp
  2. BIN
      assets/image/2x/bus_real_recharge.webp
  3. BIN
      assets/image/2x/bus_yue.webp
  4. BIN
      assets/image/3x/bus_give_yue.webp
  5. BIN
      assets/image/3x/bus_real_recharge.webp
  6. BIN
      assets/image/3x/bus_yue.webp
  7. BIN
      assets/image/bus_give_yue.webp
  8. BIN
      assets/image/bus_real_recharge.webp
  9. BIN
      assets/image/bus_yue.webp
  10. 219
      lib/business_system/order/order_list.dart
  11. 5
      lib/retrofit/business_api.dart
  12. 22
      lib/retrofit/business_api.g.dart
  13. 303
      lib/retrofit/data/order_user_detail.dart

BIN
assets/image/2x/bus_give_yue.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/image/2x/bus_real_recharge.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
assets/image/2x/bus_yue.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
assets/image/3x/bus_give_yue.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
assets/image/3x/bus_real_recharge.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
assets/image/3x/bus_yue.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
assets/image/bus_give_yue.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

BIN
assets/image/bus_real_recharge.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B

BIN
assets/image/bus_yue.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 B

219
lib/business_system/order/order_list.dart

@ -14,6 +14,7 @@ import '../../generated/l10n.dart';
import '../../retrofit/business_api.dart'; import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart'; import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/business_order_list.dart'; import '../../retrofit/data/business_order_list.dart';
import '../../retrofit/data/order_user_detail.dart';
import '../../utils/business_instance.dart'; import '../../utils/business_instance.dart';
import '../../utils/flutter_utils.dart'; import '../../utils/flutter_utils.dart';
import '../../view_widget/border_text.dart'; import '../../view_widget/border_text.dart';
@ -47,6 +48,7 @@ class _OrderList extends State<OrderList> {
int _pageIndex = 1; int _pageIndex = 1;
String networkError = ""; String networkError = "";
int networkStatus = 0; int networkStatus = 0;
OrderUserDetail orderUserDetail;
@override @override
void dispose() { void dispose() {
@ -153,7 +155,8 @@ class _OrderList extends State<OrderList> {
BaseData baseData = await businessService.balancePay({ BaseData baseData = await businessService.balancePay({
"orderId": orderId, "orderId": orderId,
"payMoney": payMoney, "payMoney": payMoney,
"payChannel": 1 "payChannel": 1,
"sid":orderUserDetail?.id ?? "",
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
await queryOrderList(queryId: orderCode); await queryOrderList(queryId: orderCode);
@ -173,6 +176,28 @@ class _OrderList extends State<OrderList> {
} }
} }
///
queryOrderUserDetail(String orderId) async {
try {
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
BaseData<OrderUserDetail> baseData = await businessService.getOrderUserDetail(orderId).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
orderUserDetail = baseData.data;
}
} finally {
EasyLoading.dismiss();
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SmartRefresher( return SmartRefresher(
@ -422,7 +447,8 @@ class _OrderList extends State<OrderList> {
adminOrderDtoList.refundStatus == 0 && adminOrderDtoList.orderType == 6) adminOrderDtoList.refundStatus == 0 && adminOrderDtoList.orderType == 6)
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () async{
await queryOrderUserDetail(adminOrderDtoList.id);
showPayDialog(adminOrderDtoList.orderCode,adminOrderDtoList.id,adminOrderDtoList.orderSum); showPayDialog(adminOrderDtoList.orderCode,adminOrderDtoList.id,adminOrderDtoList.orderSum);
}, },
child: Container( child: Container(
@ -515,66 +541,161 @@ class _OrderList extends State<OrderList> {
context: context, context: context,
builder: (context) { builder: (context) {
return AlertDialog( return AlertDialog(
contentPadding:EdgeInsets.all(0),
content: Container( content: Container(
width: MediaQuery.of(context).size.width - 84, width: MediaQuery.of(context).size.width - 84,
height: 120.h, padding: EdgeInsets.only(top: 24.h),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Padding(padding: EdgeInsets.only(bottom: 31.h),child:Text(
" 确定对该订单进行扣款吗?", "确定对该订单进行扣款吗?",
style: TextStyle( style: TextStyle(
color: Color(0xFFF4524D), color: Color(0xFF0D0D0D),
fontSize: 16.sp, fontSize: 18.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.bold,
), ),
), )),
SizedBox( Padding(padding:EdgeInsets.only(bottom: 18.h),
height: 35.h, child: Row(
),
Row(
children: [ children: [
Expanded( Expanded(child:Column(
child: InkWell( children: [
child: BorderText( Image.asset(
text: S.of(context).quxiao, "assets/image/bus_yue.webp",
textColor: Color(0xFF30415B), width: 40.h,
fontSize: 16.sp, height: 40.h,
fontWeight: FontWeight.bold,
borderColor: Color(0xFF30415B),
radius: 4,
padding: EdgeInsets.all(12),
borderWidth: 1,
), ),
onTap: () { Padding(padding:EdgeInsets.symmetric(vertical:8.h),
Navigator.of(context).pop(); child: Text(
}, "余额",
style: TextStyle(
color: Color(0xFF252626),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
)),
Text(
orderUserDetail?.balance ?? "",
style: TextStyle(
color: Color(0xFF252626),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
)
],
)),
Container(
height:46.h,
width: 1.w,
color: Color(0xFFD8D8D8),
),Expanded(child:Column(
children: [
Image.asset(
"assets/image/bus_real_recharge.webp",
width: 40.h,
height: 40.h,
),
Padding(padding:EdgeInsets.symmetric(vertical:8.h),
child: Text(
"实储余额",
style: TextStyle(
color: Color(0xFF252626),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
)),
Text(
orderUserDetail?.realRecharge ?? "",
style: TextStyle(
color: Color(0xFF252626),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
)
],
)),
Container(
height:46.h,
width: 1.w,
color: Color(0xFFD8D8D8),
),Expanded(child:Column(
children: [
Image.asset(
"assets/image/bus_give_yue.webp",
width: 40.h,
height: 40.h,
),
Padding(padding:EdgeInsets.symmetric(vertical:8.h),
child: Text(
"赠送余额",
style: TextStyle(
color: Color(0xFF252626),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
)),
Text(
"${AppUtils.calculateDouble(double.tryParse(orderUserDetail?.balance ?? "0") - double.tryParse(orderUserDetail?.realRecharge ?? "0"))}",
style: TextStyle(
color: Color(0xFF252626),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
)
],
)),
],
),),
Container(
width:double.infinity,
height: 1.h,
color: Color(0xFFD8D8D8),),
Container(
height: 55.h,
child: Row(
children: [
Expanded(
child: InkWell(
child: BorderText(
text: S.of(context).quxiao,
textColor: Colors.black,
fontSize: 16.sp,
fontWeight: FontWeight.bold,
padding: EdgeInsets.all(14),
),
onTap: () {
Navigator.of(context).pop();
},
),
flex: 1,
), ),
flex: 1, Container(
), width: 1.w,
SizedBox( height:double.infinity,
width: 16.w, color: Color(0xFFD8D8D8),
), ),
Expanded( Expanded(
child: InkWell( child: InkWell(
child: RoundButton( child: RoundButton(
text: S.of(context).queren, text: S.of(context).queren,
textColor: Colors.white, textColor: Color(0xFF30415B),
radius: 4, radius: 4,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(14),
backgroup: Color(0xFF30415B), fontSize: 16.sp,
fontSize: 16.sp, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, ),
onTap: () {
Navigator.of(context).pop();
orderBalancePay(orderCode,orderId,payMoney);
},
), ),
onTap: () { flex: 1,
Navigator.of(context).pop();
orderBalancePay(orderCode,orderId,payMoney);
},
), ),
flex: 1, ],
), ),
],
) )
], ],
), ),

5
lib/retrofit/business_api.dart

@ -21,6 +21,7 @@ import 'data/business_store_list.dart';
import 'data/business_vip_list.dart'; import 'data/business_vip_list.dart';
import 'data/day_flow_list.dart'; import 'data/day_flow_list.dart';
import 'data/goods_type_sales_list.dart'; import 'data/goods_type_sales_list.dart';
import 'data/order_user_detail.dart';
import 'data/popular_sales_list.dart'; import 'data/popular_sales_list.dart';
import 'data/product_group_list.dart'; import 'data/product_group_list.dart';
import 'data/recharge_flow_list.dart'; import 'data/recharge_flow_list.dart';
@ -301,4 +302,8 @@ abstract class BusinessApiService {
/// ///
@POST("order/balancePay") @POST("order/balancePay")
Future<BaseData> balancePay(@Body() Map<String, dynamic> param); Future<BaseData> balancePay(@Body() Map<String, dynamic> param);
///
@GET("order/getOrderUserDetail?orderId={orderId}")
Future<BaseData<OrderUserDetail>> getOrderUserDetail(@Path("orderId") String storeId);
} }

22
lib/retrofit/business_api.g.dart

@ -829,4 +829,26 @@ class _BusinessApiService implements BusinessApiService {
return value; return value;
} }
@override
Future<BaseData<OrderUserDetail>> getOrderUserDetail(orderId) async {
ArgumentError.checkNotNull(orderId, 'orderId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'order/getOrderUserDetail?orderId=$orderId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<OrderUserDetail>.fromJson(
_result.data,
(json) => OrderUserDetail.fromJson(json),
);
return value;
}
} }

303
lib/retrofit/data/order_user_detail.dart

@ -0,0 +1,303 @@
/// id : "1732280985187254272"
/// createTime : "2023-12-06 14:09:06"
/// createUser : "0"
/// updateTime : "2023-12-06 14:09:06"
/// updateUser : "0"
/// mid : "1331427732277428224"
/// masterId : "0"
/// openid : ""
/// aliOpenid : null
/// douyinOpenid : null
/// nickname : ""
/// headimg : ""
/// rankId : "0"
/// rankExpireTime : null
/// balance : "0.00"
/// realRecharge : "0.00"
/// sex : "0"
/// status : true
/// onCredit : false
/// loginTime : "2023-12-12 10:20:11"
/// loginNum : 13
/// tenantCode : "1196"
/// source : 1
/// expendAmount : "45.00"
/// buyTimes : 1
/// lastBuyTime : "2023-12-06 18:07:40"
/// vip_no : null
/// expireTime : "2033-12-12 10:20:11"
/// integral : 0
/// level : 1
/// vipRegStore : null
/// certification : false
class OrderUserDetail {
OrderUserDetail({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String mid,
String masterId,
String openid,
dynamic aliOpenid,
dynamic douyinOpenid,
String nickname,
String headimg,
String rankId,
dynamic rankExpireTime,
String balance,
String realRecharge,
String sex,
bool status,
bool onCredit,
String loginTime,
num loginNum,
String tenantCode,
num source,
String expendAmount,
num buyTimes,
String lastBuyTime,
dynamic vipNo,
String expireTime,
num integral,
num level,
dynamic vipRegStore,
bool certification,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_mid = mid;
_masterId = masterId;
_openid = openid;
_aliOpenid = aliOpenid;
_douyinOpenid = douyinOpenid;
_nickname = nickname;
_headimg = headimg;
_rankId = rankId;
_rankExpireTime = rankExpireTime;
_balance = balance;
_realRecharge = realRecharge;
_sex = sex;
_status = status;
_onCredit = onCredit;
_loginTime = loginTime;
_loginNum = loginNum;
_tenantCode = tenantCode;
_source = source;
_expendAmount = expendAmount;
_buyTimes = buyTimes;
_lastBuyTime = lastBuyTime;
_vipNo = vipNo;
_expireTime = expireTime;
_integral = integral;
_level = level;
_vipRegStore = vipRegStore;
_certification = certification;
}
OrderUserDetail.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_mid = json['mid'];
_masterId = json['masterId'];
_openid = json['openid'];
_aliOpenid = json['aliOpenid'];
_douyinOpenid = json['douyinOpenid'];
_nickname = json['nickname'];
_headimg = json['headimg'];
_rankId = json['rankId'];
_rankExpireTime = json['rankExpireTime'];
_balance = json['balance'];
_realRecharge = json['realRecharge'];
_sex = json['sex'];
_status = json['status'];
_onCredit = json['onCredit'];
_loginTime = json['loginTime'];
_loginNum = json['loginNum'];
_tenantCode = json['tenantCode'];
_source = json['source'];
_expendAmount = json['expendAmount'];
_buyTimes = json['buyTimes'];
_lastBuyTime = json['lastBuyTime'];
_vipNo = json['vip_no'];
_expireTime = json['expireTime'];
_integral = json['integral'];
_level = json['level'];
_vipRegStore = json['vipRegStore'];
_certification = json['certification'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _mid;
String _masterId;
String _openid;
dynamic _aliOpenid;
dynamic _douyinOpenid;
String _nickname;
String _headimg;
String _rankId;
dynamic _rankExpireTime;
String _balance;
String _realRecharge;
String _sex;
bool _status;
bool _onCredit;
String _loginTime;
num _loginNum;
String _tenantCode;
num _source;
String _expendAmount;
num _buyTimes;
String _lastBuyTime;
dynamic _vipNo;
String _expireTime;
num _integral;
num _level;
dynamic _vipRegStore;
bool _certification;
OrderUserDetail copyWith({ String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String mid,
String masterId,
String openid,
dynamic aliOpenid,
dynamic douyinOpenid,
String nickname,
String headimg,
String rankId,
dynamic rankExpireTime,
String balance,
String realRecharge,
String sex,
bool status,
bool onCredit,
String loginTime,
num loginNum,
String tenantCode,
num source,
String expendAmount,
num buyTimes,
String lastBuyTime,
dynamic vipNo,
String expireTime,
num integral,
num level,
dynamic vipRegStore,
bool certification,
}) => OrderUserDetail( id: id ?? _id,
createTime: createTime ?? _createTime,
createUser: createUser ?? _createUser,
updateTime: updateTime ?? _updateTime,
updateUser: updateUser ?? _updateUser,
mid: mid ?? _mid,
masterId: masterId ?? _masterId,
openid: openid ?? _openid,
aliOpenid: aliOpenid ?? _aliOpenid,
douyinOpenid: douyinOpenid ?? _douyinOpenid,
nickname: nickname ?? _nickname,
headimg: headimg ?? _headimg,
rankId: rankId ?? _rankId,
rankExpireTime: rankExpireTime ?? _rankExpireTime,
balance: balance ?? _balance,
realRecharge: realRecharge ?? _realRecharge,
sex: sex ?? _sex,
status: status ?? _status,
onCredit: onCredit ?? _onCredit,
loginTime: loginTime ?? _loginTime,
loginNum: loginNum ?? _loginNum,
tenantCode: tenantCode ?? _tenantCode,
source: source ?? _source,
expendAmount: expendAmount ?? _expendAmount,
buyTimes: buyTimes ?? _buyTimes,
lastBuyTime: lastBuyTime ?? _lastBuyTime,
vipNo: vipNo ?? _vipNo,
expireTime: expireTime ?? _expireTime,
integral: integral ?? _integral,
level: level ?? _level,
vipRegStore: vipRegStore ?? _vipRegStore,
certification: certification ?? _certification,
);
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get mid => _mid;
String get masterId => _masterId;
String get openid => _openid;
dynamic get aliOpenid => _aliOpenid;
dynamic get douyinOpenid => _douyinOpenid;
String get nickname => _nickname;
String get headimg => _headimg;
String get rankId => _rankId;
dynamic get rankExpireTime => _rankExpireTime;
String get balance => _balance;
String get realRecharge => _realRecharge;
String get sex => _sex;
bool get status => _status;
bool get onCredit => _onCredit;
String get loginTime => _loginTime;
num get loginNum => _loginNum;
String get tenantCode => _tenantCode;
num get source => _source;
String get expendAmount => _expendAmount;
num get buyTimes => _buyTimes;
String get lastBuyTime => _lastBuyTime;
dynamic get vipNo => _vipNo;
String get expireTime => _expireTime;
num get integral => _integral;
num get level => _level;
dynamic get vipRegStore => _vipRegStore;
bool get certification => _certification;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['mid'] = _mid;
map['masterId'] = _masterId;
map['openid'] = _openid;
map['aliOpenid'] = _aliOpenid;
map['douyinOpenid'] = _douyinOpenid;
map['nickname'] = _nickname;
map['headimg'] = _headimg;
map['rankId'] = _rankId;
map['rankExpireTime'] = _rankExpireTime;
map['balance'] = _balance;
map['realRecharge'] = _realRecharge;
map['sex'] = _sex;
map['status'] = _status;
map['onCredit'] = _onCredit;
map['loginTime'] = _loginTime;
map['loginNum'] = _loginNum;
map['tenantCode'] = _tenantCode;
map['source'] = _source;
map['expendAmount'] = _expendAmount;
map['buyTimes'] = _buyTimes;
map['lastBuyTime'] = _lastBuyTime;
map['vip_no'] = _vipNo;
map['expireTime'] = _expireTime;
map['integral'] = _integral;
map['level'] = _level;
map['vipRegStore'] = _vipRegStore;
map['certification'] = _certification;
return map;
}
}
Loading…
Cancel
Save