2025-07-21 15:46:30 +08:00
|
|
|
|
library;
|
|
|
|
|
import 'package:flutter/material.dart';
|
2025-08-26 17:38:59 +08:00
|
|
|
|
import 'package:get/get.dart';
|
2025-09-01 18:18:26 +08:00
|
|
|
|
import 'package:loopin/service/http.dart';
|
|
|
|
|
import 'package:loopin/api/shop_api.dart';
|
2025-07-21 15:46:30 +08:00
|
|
|
|
import 'package:shirne_dialog/shirne_dialog.dart';
|
2025-08-26 17:38:59 +08:00
|
|
|
|
import 'package:timer_count_down/timer_count_down.dart';
|
2025-09-01 18:18:26 +08:00
|
|
|
|
import 'package:loopin/utils/wxsdk.dart';
|
2025-09-03 10:39:38 +08:00
|
|
|
|
import 'package:loopin/utils/index.dart';
|
2025-07-21 15:46:30 +08:00
|
|
|
|
|
|
|
|
|
import '../../behavior/custom_scroll_behavior.dart';
|
|
|
|
|
|
|
|
|
|
class OrderDetail extends StatefulWidget {
|
|
|
|
|
const OrderDetail({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<OrderDetail> createState() => _OrderDetailState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStateMixin {
|
2025-08-26 17:38:59 +08:00
|
|
|
|
late String _orderId;
|
2025-09-01 18:18:26 +08:00
|
|
|
|
dynamic orderGoodsInfo;
|
2025-09-03 17:36:45 +08:00
|
|
|
|
int _initialSeconds = 30 * 60;// 存储初始秒数
|
|
|
|
|
bool _countdownFinished = false; // 新增标志位,用于跟踪倒计时是否结束
|
|
|
|
|
|
2025-08-26 17:38:59 +08:00
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
_orderId = Get.arguments;
|
|
|
|
|
getOrderDetail(orderId: _orderId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取订单详情信息,包含商品参数
|
|
|
|
|
void getOrderDetail({required String orderId}) async {
|
2025-09-01 18:18:26 +08:00
|
|
|
|
try {
|
|
|
|
|
final res = await Http.get('${ShopApi.goodsOrderDetail}/$orderId');
|
|
|
|
|
print('订单详情-------------->${res['data']}');
|
|
|
|
|
setState(() {
|
|
|
|
|
orderGoodsInfo = res['data']; // 注意取 data 部分
|
|
|
|
|
});
|
|
|
|
|
} catch (e) {
|
|
|
|
|
Get.back();
|
|
|
|
|
}
|
2025-08-26 17:38:59 +08:00
|
|
|
|
}
|
2025-09-03 17:36:45 +08:00
|
|
|
|
|
|
|
|
|
// 显示支付结果弹框
|
|
|
|
|
void _showPaymentResultDialog() {
|
|
|
|
|
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
barrierColor: Colors.black54,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return Dialog(
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(16.0),
|
|
|
|
|
),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(20.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
// 图标
|
|
|
|
|
Container(
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 60,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Color(0xFFFFF8E6),
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
),
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.payment,
|
|
|
|
|
size: 32,
|
|
|
|
|
color: Color(0xFFFFA500),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 16),
|
|
|
|
|
|
|
|
|
|
// 标题
|
|
|
|
|
Text(
|
|
|
|
|
'支付确认',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black87,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 8),
|
|
|
|
|
|
|
|
|
|
// 描述
|
|
|
|
|
Text(
|
|
|
|
|
'请确认您的支付状态',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.grey[600],
|
|
|
|
|
),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 24),
|
|
|
|
|
|
|
|
|
|
// 按钮区域
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
// 支付遇到问题按钮
|
|
|
|
|
Expanded(
|
|
|
|
|
child: OutlinedButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
_checkOrderStatus();
|
|
|
|
|
},
|
|
|
|
|
style: OutlinedButton.styleFrom(
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
foregroundColor: Colors.grey[700],
|
|
|
|
|
side: BorderSide(color: Colors.grey[300]!),
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 12),
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Text('支付遇到问题'),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 12),
|
|
|
|
|
|
|
|
|
|
// 支付完成按钮
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ElevatedButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
_checkOrderStatus();
|
|
|
|
|
},
|
|
|
|
|
style: ElevatedButton.styleFrom(
|
|
|
|
|
backgroundColor: Color(0xFFFF5000),
|
|
|
|
|
foregroundColor: Colors.white,
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 12),
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Text('支付完成'),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
).then((value) {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查订单状态
|
|
|
|
|
void _checkOrderStatus() async {
|
|
|
|
|
try {
|
|
|
|
|
// 调用接口查询订单状态
|
|
|
|
|
final res = await Http.get('${ShopApi.goodsOrderDetail}/$_orderId');
|
|
|
|
|
if (res['data'] != null) {
|
|
|
|
|
setState(() {
|
|
|
|
|
orderGoodsInfo = res['data'];
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// todo 根据状态进行不同的操作
|
|
|
|
|
int status = orderGoodsInfo?['orderStatus'] ?? 0;
|
|
|
|
|
if (status == 2) { // 已支付
|
|
|
|
|
MyDialog.toast('支付成功');
|
|
|
|
|
} else {
|
|
|
|
|
MyDialog.toast('支付尚未完成,请稍后查看');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
print('查询订单状态失败: $e');
|
|
|
|
|
MyDialog.toast('查询订单状态失败,请稍后重试');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取订单状态文本
|
|
|
|
|
String getOrderStatusText(int status) {
|
|
|
|
|
switch (status) {
|
|
|
|
|
case 0:
|
|
|
|
|
return '待支付';
|
|
|
|
|
case 1:
|
|
|
|
|
return '支付中';
|
|
|
|
|
case 2:
|
|
|
|
|
return '已支付';
|
|
|
|
|
case 3:
|
|
|
|
|
return '已取消';
|
|
|
|
|
case 4:
|
|
|
|
|
return '已退款';
|
|
|
|
|
case 10:
|
|
|
|
|
return '无效订单';
|
|
|
|
|
default:
|
|
|
|
|
return '未知状态';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取订单状态颜色
|
|
|
|
|
Color getOrderStatusColor(int status) {
|
|
|
|
|
switch (status) {
|
|
|
|
|
case 0:
|
|
|
|
|
return Colors.orange;
|
|
|
|
|
case 1:
|
|
|
|
|
return Colors.blue;
|
|
|
|
|
case 2:
|
|
|
|
|
return Colors.green;
|
|
|
|
|
case 3:
|
|
|
|
|
case 4:
|
|
|
|
|
case 10:
|
|
|
|
|
return Colors.grey;
|
|
|
|
|
default:
|
|
|
|
|
return Colors.black;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 构建底部按钮
|
|
|
|
|
Widget buildBottomButtons() {
|
|
|
|
|
if (orderGoodsInfo == null) return SizedBox.shrink();
|
|
|
|
|
|
|
|
|
|
int orderStatus = orderGoodsInfo?['orderStatus'] ?? 0;
|
|
|
|
|
|
|
|
|
|
switch (orderStatus) {
|
|
|
|
|
case 0: // 待支付
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
ElevatedButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// 取消订单逻辑
|
|
|
|
|
_cancelOrder();
|
|
|
|
|
},
|
|
|
|
|
style: ButtonStyle(
|
|
|
|
|
backgroundColor: WidgetStateProperty.all(Colors.white),
|
|
|
|
|
foregroundColor: WidgetStateProperty.all(Colors.black87),
|
|
|
|
|
),
|
|
|
|
|
child: const Text('取消订单'),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(width: 10.0),
|
|
|
|
|
ElevatedButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// 打开微信小程序的某个页面地址,如pages/index/index
|
|
|
|
|
Wxsdk.openMiniApp(orderId: _orderId);
|
|
|
|
|
// 拉起支付后显示支付结果弹框
|
|
|
|
|
Future.delayed(Duration(milliseconds: 1500), () {
|
|
|
|
|
_showPaymentResultDialog();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
style: ButtonStyle(
|
|
|
|
|
backgroundColor: WidgetStateProperty.all(Color(0xff07c160)),
|
|
|
|
|
foregroundColor: WidgetStateProperty.all(Colors.white),
|
|
|
|
|
),
|
|
|
|
|
child: const Text('去支付'),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
case 1: // 支付中
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
ElevatedButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// 刷新订单状态
|
|
|
|
|
getOrderDetail(orderId: _orderId);
|
|
|
|
|
},
|
|
|
|
|
style: ButtonStyle(
|
|
|
|
|
backgroundColor: WidgetStateProperty.all(Colors.blue),
|
|
|
|
|
foregroundColor: WidgetStateProperty.all(Colors.white),
|
|
|
|
|
),
|
|
|
|
|
child: const Text('支付中'),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
case 2: // 已支付
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
const SizedBox(width: 10.0),
|
|
|
|
|
ElevatedButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
},
|
|
|
|
|
style: ButtonStyle(
|
|
|
|
|
backgroundColor: WidgetStateProperty.all(Color(0xFFFF5000)),
|
|
|
|
|
foregroundColor: WidgetStateProperty.all(Colors.white),
|
|
|
|
|
),
|
|
|
|
|
child: const Text('已支付'),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
case 3: // 已取消
|
|
|
|
|
case 10: // 无效订单
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
const SizedBox(width: 10.0),
|
|
|
|
|
ElevatedButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
style: ButtonStyle(
|
|
|
|
|
backgroundColor: WidgetStateProperty.all(Color(0xFFFF5000)),
|
|
|
|
|
foregroundColor: WidgetStateProperty.all(Colors.white),
|
|
|
|
|
),
|
|
|
|
|
child: const Text('已取消'),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
case 4: // 已退款
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
const SizedBox(width: 10.0),
|
|
|
|
|
ElevatedButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
},
|
|
|
|
|
style: ButtonStyle(
|
|
|
|
|
backgroundColor: WidgetStateProperty.all(Color(0xFFFF5000)),
|
|
|
|
|
foregroundColor: WidgetStateProperty.all(Colors.white),
|
|
|
|
|
),
|
|
|
|
|
child: const Text('已退款'),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return SizedBox.shrink();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 取消订单
|
|
|
|
|
void _cancelOrder() {
|
|
|
|
|
print('取消订单: $_orderId');
|
|
|
|
|
// 实现取消订单的逻辑
|
2025-08-26 17:38:59 +08:00
|
|
|
|
}
|
2025-09-03 17:36:45 +08:00
|
|
|
|
|
|
|
|
|
|
2025-07-21 15:46:30 +08:00
|
|
|
|
Widget emptyTip() {
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
spacing: 5.0,
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
'assets/images/empty.png',
|
|
|
|
|
width: 100.0,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'还没有订单信息~',
|
|
|
|
|
style: TextStyle(color: Colors.grey, fontSize: 12.0),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2025-09-03 17:36:45 +08:00
|
|
|
|
if (orderGoodsInfo == null) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
backgroundColor: Colors.grey[50],
|
|
|
|
|
appBar: AppBar(
|
|
|
|
|
backgroundColor: Color(0xFFFF5000),
|
|
|
|
|
foregroundColor: Colors.white,
|
|
|
|
|
title: Text('订单详情'),
|
|
|
|
|
titleSpacing: 1.0,
|
|
|
|
|
),
|
|
|
|
|
body: Center(child: CircularProgressIndicator()),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int orderStatus = orderGoodsInfo?['orderStatus'] ?? 0;
|
|
|
|
|
bool showCountdown = orderStatus == 0; // 只有待支付状态显示倒计时
|
|
|
|
|
|
2025-07-21 15:46:30 +08:00
|
|
|
|
return Scaffold(
|
|
|
|
|
backgroundColor: Colors.grey[50],
|
|
|
|
|
appBar: AppBar(
|
|
|
|
|
backgroundColor: Color(0xFFFF5000),
|
|
|
|
|
foregroundColor: Colors.white,
|
|
|
|
|
title: Text('订单详情'),
|
|
|
|
|
titleSpacing: 1.0,
|
|
|
|
|
),
|
|
|
|
|
body: ScrollConfiguration(
|
|
|
|
|
behavior: CustomScrollBehavior().copyWith(scrollbars: false),
|
|
|
|
|
child: ListView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.all(10.0),
|
|
|
|
|
children: [
|
2025-09-03 17:36:45 +08:00
|
|
|
|
if (showCountdown)
|
2025-07-21 15:46:30 +08:00
|
|
|
|
Column(
|
|
|
|
|
spacing: 5.0,
|
|
|
|
|
children: [
|
|
|
|
|
Text.rich(
|
|
|
|
|
TextSpan(style: TextStyle(fontFamily: 'Arial'), children: [
|
|
|
|
|
WidgetSpan(
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.info,
|
|
|
|
|
size: 16.0,
|
|
|
|
|
)),
|
2025-09-03 17:36:45 +08:00
|
|
|
|
TextSpan(text: '待支付, '),
|
|
|
|
|
TextSpan(text: _countdownFinished ? '倒计时已结束' : ' 剩余 '),
|
|
|
|
|
if (!_countdownFinished)
|
2025-08-26 17:38:59 +08:00
|
|
|
|
WidgetSpan(
|
|
|
|
|
alignment: PlaceholderAlignment.middle,
|
|
|
|
|
child: Countdown(
|
2025-09-03 17:36:45 +08:00
|
|
|
|
seconds: _initialSeconds, // 直接使用30分钟的秒数
|
2025-08-26 17:38:59 +08:00
|
|
|
|
build: (_, double time) {
|
|
|
|
|
int m = ((time % 3600) ~/ 60).toInt();
|
|
|
|
|
int s = (time % 60).toInt();
|
|
|
|
|
String formatted = "${m.toString().padLeft(2, '0')} : ${s.toString().padLeft(2, '0')}";
|
|
|
|
|
|
|
|
|
|
return Text(
|
|
|
|
|
formatted,
|
|
|
|
|
style: const TextStyle(color: Colors.red),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
interval: const Duration(seconds: 1),
|
|
|
|
|
onFinished: () {
|
|
|
|
|
print("倒计时结束");
|
2025-09-03 17:36:45 +08:00
|
|
|
|
setState(() {
|
|
|
|
|
_countdownFinished = true; // 倒计时结束时更新标志位
|
|
|
|
|
});
|
2025-08-26 17:38:59 +08:00
|
|
|
|
},
|
|
|
|
|
),
|
2025-07-21 15:46:30 +08:00
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
2025-09-03 17:36:45 +08:00
|
|
|
|
_countdownFinished
|
|
|
|
|
? '订单已自动取消'
|
|
|
|
|
: '超过30分钟未支付,订单将自动取消',
|
2025-07-21 15:46:30 +08:00
|
|
|
|
style: TextStyle(color: Colors.grey, fontSize: 12.0),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10.0,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// 商品信息
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(bottom: 10.0),
|
|
|
|
|
padding: EdgeInsets.all(10.0),
|
|
|
|
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(15.0), boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.black.withAlpha(10),
|
|
|
|
|
offset: Offset(0.0, 1.0),
|
|
|
|
|
blurRadius: 1.0,
|
|
|
|
|
spreadRadius: 0.0,
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
child: Column(
|
|
|
|
|
spacing: 10.0,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
2025-09-03 17:36:45 +08:00
|
|
|
|
getOrderStatusText(orderStatus),
|
|
|
|
|
style: TextStyle(color: getOrderStatusColor(orderStatus)),
|
2025-07-21 15:46:30 +08:00
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
spacing: 10.0,
|
|
|
|
|
children: [
|
|
|
|
|
Image.network(
|
2025-09-03 17:36:45 +08:00
|
|
|
|
'${orderGoodsInfo?['productInfo'][0]['pic']}',
|
2025-07-21 15:46:30 +08:00
|
|
|
|
width: 80.0,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
spacing: 5.0,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
2025-09-03 17:36:45 +08:00
|
|
|
|
'${orderGoodsInfo?['productInfo'][0]['productName']}',
|
2025-07-21 15:46:30 +08:00
|
|
|
|
maxLines: 2,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
2025-09-03 17:36:45 +08:00
|
|
|
|
'¥${orderGoodsInfo?['productInfo'][0]['salePrice']}',
|
2025-07-21 15:46:30 +08:00
|
|
|
|
style: TextStyle(color: Colors.red),
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
2025-09-03 17:36:45 +08:00
|
|
|
|
'x${orderGoodsInfo?['productInfo'][0]['buyNum'] ?? 1}',
|
2025-07-21 15:46:30 +08:00
|
|
|
|
style: TextStyle(color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// 订单信息
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(bottom: 10.0),
|
|
|
|
|
padding: EdgeInsets.all(10.0),
|
|
|
|
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(15.0), boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.black.withAlpha(10),
|
|
|
|
|
offset: Offset(0.0, 1.0),
|
|
|
|
|
blurRadius: 1.0,
|
|
|
|
|
spreadRadius: 0.0,
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
child: Column(
|
|
|
|
|
spacing: 10.0,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'订单信息',
|
|
|
|
|
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.copy,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
size: 14.0,
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
MyDialog.toast('复制订单信息', icon: Icon(Icons.check_circle));
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
spacing: 5.0,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'订单号',
|
|
|
|
|
style: TextStyle(color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
2025-09-03 17:36:45 +08:00
|
|
|
|
Text(orderGoodsInfo?['orderId'] ?? '', style: TextStyle(fontSize: 12.0)),
|
2025-07-21 15:46:30 +08:00
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'下单时间',
|
|
|
|
|
style: TextStyle(color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
2025-09-03 17:36:45 +08:00
|
|
|
|
Text(orderGoodsInfo?['createTime'] ?? '', style: TextStyle(fontSize: 12.0)),
|
2025-07-21 15:46:30 +08:00
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'购买数量',
|
|
|
|
|
style: TextStyle(color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
2025-09-03 17:36:45 +08:00
|
|
|
|
Text((orderGoodsInfo?['productInfo'][0]['buyNum'] ?? 0).toString(),
|
2025-09-03 10:39:38 +08:00
|
|
|
|
style: TextStyle(fontSize: 12.0)),
|
2025-07-21 15:46:30 +08:00
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'订单金额',
|
|
|
|
|
style: TextStyle(color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
2025-09-03 17:36:45 +08:00
|
|
|
|
Text('¥${orderGoodsInfo?['totalAmount']??'0.00'}', style: TextStyle(fontSize: 12.0)),
|
2025-07-21 15:46:30 +08:00
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'实付金额',
|
|
|
|
|
style: TextStyle(color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
2025-09-03 17:36:45 +08:00
|
|
|
|
Text('¥${orderGoodsInfo?['payAmount']??'0.00'}', style: TextStyle(fontSize: 12.0)),
|
2025-07-21 15:46:30 +08:00
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// 底部固定按钮
|
|
|
|
|
bottomNavigationBar: SafeArea(
|
|
|
|
|
minimum: const EdgeInsets.all(10),
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 50.0,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 5.0),
|
2025-09-03 17:36:45 +08:00
|
|
|
|
child: buildBottomButtons(),
|
2025-07-21 15:46:30 +08:00
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
2025-09-03 17:36:45 +08:00
|
|
|
|
}
|