|
|
@@ -104,30 +104,36 @@ class MainPage extends BasePage<MainController> {
|
|
|
final visibleFraction = info.visibleFraction;
|
|
|
controller.onFriendVisibleFraction(visibleFraction);
|
|
|
},
|
|
|
- child: Container(
|
|
|
- margin: EdgeInsets.only(left: 12.w, right: 12.w, bottom: 12.w),
|
|
|
- padding:
|
|
|
- EdgeInsets.only(left: 12.w, right: 12.w, top: 12.w, bottom: 9.w),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Colors.white, borderRadius: BorderRadius.circular(20.r)),
|
|
|
- child: AspectRatio(
|
|
|
- aspectRatio: 336 / 134,
|
|
|
- child: Obx(() {
|
|
|
- final todayTrack = controller.selectedFriend?.id == null
|
|
|
- ? null
|
|
|
- : controller.todayTrackReportMap[controller.selectedFriend?.id];
|
|
|
- if (todayTrack == null ||
|
|
|
- todayTrack.isRequestSuccess.value == false) {
|
|
|
- return buildTodayTrackLoadingView();
|
|
|
- } else {
|
|
|
- return buildTodayTrackDetailView(todayTrack);
|
|
|
- }
|
|
|
- }),
|
|
|
- ),
|
|
|
+ child: AspectRatio(
|
|
|
+ aspectRatio: 336 / 134,
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(left: 12.w, right: 12.w, bottom: 12.w),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Colors.white, borderRadius: BorderRadius.circular(20.r)),
|
|
|
+ child: Obx(() {
|
|
|
+ final todayTrack = controller.selectedFriend?.id == null
|
|
|
+ ? null
|
|
|
+ : controller
|
|
|
+ .todayTrackReportMap[controller.selectedFriend?.id];
|
|
|
+ if (todayTrack?.noMember.value == true) {
|
|
|
+ return buildNoMemberView();
|
|
|
+ } else if (todayTrack == null ||
|
|
|
+ todayTrack.isRequestSuccess.value == false) {
|
|
|
+ return buildTodayTrackLoadingView();
|
|
|
+ } else {
|
|
|
+ return buildTodayTrackDetailView(todayTrack);
|
|
|
+ }
|
|
|
+ })),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ Widget buildNoMemberView() {
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: controller.onTrackNoMemberClick,
|
|
|
+ child: Assets.images.imgTrackNoMemberTips.image(fit: BoxFit.fill));
|
|
|
+ }
|
|
|
+
|
|
|
Widget buildTodayTrackLoadingView() {
|
|
|
return Column(
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
@@ -148,22 +154,27 @@ class MainPage extends BasePage<MainController> {
|
|
|
return GestureDetector(
|
|
|
behavior: HitTestBehavior.opaque,
|
|
|
onTap: controller.onTodayTraceClick,
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- Text(StringName.todaySimpleTrack,
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 13.sp,
|
|
|
- color: '#333333'.color,
|
|
|
- fontWeight: FontWeight.bold)),
|
|
|
- Spacer(),
|
|
|
- Assets.images.iconMainTrackArrow.image(width: 10.w, height: 10.w),
|
|
|
- ],
|
|
|
- ),
|
|
|
- SizedBox(height: 7.w),
|
|
|
- buildSelectedFriendTodayTrackDetailView(todayTrackReportBean),
|
|
|
- ],
|
|
|
+ child: Padding(
|
|
|
+ padding:
|
|
|
+ EdgeInsets.only(left: 12.w, right: 12.w, top: 12.w, bottom: 9.w),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Text(StringName.todaySimpleTrack,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 13.sp,
|
|
|
+ color: '#333333'.color,
|
|
|
+ fontWeight: FontWeight.bold)),
|
|
|
+ Spacer(),
|
|
|
+ Assets.images.iconMainTrackArrow
|
|
|
+ .image(width: 10.w, height: 10.w),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ SizedBox(height: 7.w),
|
|
|
+ buildSelectedFriendTodayTrackDetailView(todayTrackReportBean),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
);
|
|
|
}
|