提交 dbf88eac authored 作者: yueweilu's avatar yueweilu

消息跳转具体订单

上级 9cdbe140
......@@ -34,39 +34,51 @@ class MsgPage extends StatelessWidget {
controller.read(model.id.toString());
if(model.type == 1){
final result = await context.pushNamed(Routes.order);
if (result == true){
controller.onRefresh();
}
// final orderInfo = await controller.getOrderInfo(model.urlId?.orderNum??'');
// // 待支付
// if (orderInfo.status == 1){
// // 书籍订单
// if (orderInfo.types ==1){
// final result = await context.pushNamed(Routes.orderAwaiting,
// queryParameters: {'orderNum': model.urlId?.orderNum.toString()});
// final result = await context.pushNamed(Routes.order);
// if (result == true){
// controller.onRefresh();
// }
// }
// // 充值订单
// else {
// final result = await context.pushNamed(Routes.orderCoinAwaiting,
// queryParameters: {'orderNum': model.urlId?.orderNum.toString()});
// if (result == true){
// controller.onRefresh();
// }
// }
//
// }
// // 已支付
// else if (orderInfo.status ==3){
//
// }
// // 已退款
// else if (orderInfo.status == 4){
//
// }
final orderInfo = await controller.getOrderInfo(model.urlId?.orderNum??'');
// 待支付
if (orderInfo.status == 1){
// 书籍订单
if (orderInfo.types ==1){
final result = await context.pushNamed(Routes.orderAwaiting,
queryParameters: {'orderNum': model.urlId?.orderNum.toString()});
if (result == true){
controller.onRefresh();
}
}
// 充值订单
else {
final result = await context.pushNamed(Routes.orderCoinAwaiting,
queryParameters: {'orderNum': model.urlId?.orderNum.toString()});
if (result == true){
controller.onRefresh();
}
}
}
// 已支付
else if (orderInfo.status ==3){
if (orderInfo.types == 1){
final result = await context.pushNamed(Routes.orderCompleted,
queryParameters: {'orderNum': model.urlId?.orderNum.toString()});
if (result == true){
controller.onRefresh();
}
}
}
// 已退款
else if (orderInfo.status == 4){
if (orderInfo.types == 1){
final result = await context.pushNamed(Routes.orderRefunded,
queryParameters: {'orderNum': model.urlId?.orderNum.toString()});
if (result == true){
controller.onRefresh();
}
}
}
///TODO:
}else if (model.type == 2){
......@@ -109,4 +121,6 @@ class MsgPage extends StatelessWidget {
),
);
}
}
......@@ -340,6 +340,7 @@ class _CacheInterceptor extends Interceptor {
// 在发起请求之前,检查缓存是否存在有效数据
final cachedFile = await DefaultCacheManager().getFileFromCache(options.uri.toString());
if (cachedFile != null && cachedFile.validTill.isAfter(DateTime.now())) {
Console.log('--------------使用缓存数据------------------');
// 如果缓存有效,直接返回缓存数据
final cachedData = await cachedFile.file.readAsBytes();
final decodedData = utf8.decode(cachedData); // 将字节列表解码为字符串
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论