Browse Source

砍价更改

zyh
w-R 3 years ago
parent
commit
25e2d920b7
  1. 2
      lib/order/bargain_group_order.dart
  2. 71
      lib/store/shopping/shopping_home/bargain_details.dart

2
lib/order/bargain_group_order.dart

@ -450,7 +450,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
});
}else{
Navigator.of(context)
.popAndPushNamed('/router/bargain_details',arguments: {
.pushNamed('/router/bargain_details',arguments: {
"actRecordId": activityOrderList.actRecordId,
"limitNumber":activityOrderList.successNumber,
});

71
lib/store/shopping/shopping_home/bargain_details.dart

@ -7,7 +7,6 @@ import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/retrofit/data/activity_actRecord_details.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
@ -232,9 +231,7 @@ class _BargainDetails extends State<BargainDetails> {
),
),
Text(
(activityActRecordDetails?.skuName != "")
? (activityActRecordDetails?.skuName ?? "")
: "x1",
(activityActRecordDetails?.skuName ?? "x1"),
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
@ -797,7 +794,7 @@ class _BargainDetails extends State<BargainDetails> {
),
),
Text(
"3分钟前",
handleDate(activityActRecordDetails.actRecordJoinList[index].createTime),
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
@ -842,36 +839,36 @@ class _BargainDetails extends State<BargainDetails> {
));
}
// static handleDate(String oldTime) {
// String nowTime =
// new DateTime.now().toString().split('.')[0].replaceAll('-', '/');
//
// int nowyear = int.parse(nowTime.split(" ")[0].split('/')[0]);
// int nowmonth = int.parse(nowTime.split(" ")[0].split('/')[1]);
// int nowday = int.parse(nowTime.split(" ")[0].split('/')[2]);
// int nowhour = int.parse(nowTime.split(" ")[1].split(':')[0]);
// int nowmin = int.parse(nowTime.split(" ")[1].split(':')[1]);
//
// int oldyear = int.parse(oldTime.split(" ")[0].split('/')[0]);
// int oldmonth = int.parse(oldTime.split(" ")[0].split('/')[1]);
// int oldday = int.parse(oldTime.split(" ")[0].split('/')[2]);
// int oldhour = int.parse(oldTime.split(" ")[1].split(':')[0]);
// int oldmin = int.parse(oldTime.split(" ")[1].split(':')[1]);
//
// var now = new DateTime(nowyear, nowmonth, nowday, nowhour, nowmin);
// var old = new DateTime(oldyear, oldmonth, oldday, oldhour, oldmin);
// var difference = now.difference(old);
//
// if (difference.inDays > 1) {
// return (difference.inDays).toString() + '天前';
// } else if (difference.inDays == 1) {
// return '昨天'.toString();
// } else if (difference.inHours >= 1 && difference.inHours < 24) {
// return (difference.inHours).toString() + '小时前';
// } else if (difference.inMinutes > 5 && difference.inMinutes < 60) {
// return (difference.inMinutes).toString() + '分钟前';
// } else if (difference.inMinutes <= 5) {
// return '刚刚';
// }
// }
static handleDate(String oldTime) {
String nowTime =
new DateTime.now().toString().split('.')[0];
int nowyear = int.parse(nowTime.split(" ")[0].split('-')[0]);
int nowmonth = int.parse(nowTime.split(" ")[0].split('-')[1]);
int nowday = int.parse(nowTime.split(" ")[0].split('-')[2]);
int nowhour = int.parse(nowTime.split(" ")[1].split(':')[0]);
int nowmin = int.parse(nowTime.split(" ")[1].split(':')[1]);
int oldyear = int.parse(oldTime.split(" ")[0].split('-')[0]);
int oldmonth = int.parse(oldTime.split(" ")[0].split('-')[1]);
int oldday = int.parse(oldTime.split(" ")[0].split('-')[2]);
int oldhour = int.parse(oldTime.split(" ")[1].split(':')[0]);
int oldmin = int.parse(oldTime.split(" ")[1].split(':')[1]);
var now = new DateTime(nowyear, nowmonth, nowday, nowhour, nowmin);
var old = new DateTime(oldyear, oldmonth, oldday, oldhour, oldmin);
var difference = now.difference(old);
if (difference.inDays > 1) {
return (difference.inDays).toString() + '天前';
} else if (difference.inDays == 1) {
return '昨天'.toString();
} else if (difference.inHours >= 1 && difference.inHours < 24) {
return (difference.inHours).toString() + '小时前';
} else if (difference.inMinutes > 5 && difference.inMinutes < 60) {
return (difference.inMinutes).toString() + '分钟前';
} else if (difference.inMinutes <= 5) {
return '刚刚';
}
}
}

Loading…
Cancel
Save