|
|
@ -21,6 +21,7 @@ import 'package:huixiang/view_widget/my_footer.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
|
|
|
import 'package:shimmer/shimmer.dart'; |
|
|
|
|
|
|
|
|
|
|
|
class MineShopDetails extends StatefulWidget { |
|
|
|
class MineShopDetails extends StatefulWidget { |
|
|
|
final Map<String, dynamic> arguments; |
|
|
|
final Map<String, dynamic> arguments; |
|
|
@ -37,6 +38,7 @@ class _MineShopDetails extends State<MineShopDetails> { |
|
|
|
ApiService apiService; |
|
|
|
ApiService apiService; |
|
|
|
int selectType = 0; |
|
|
|
int selectType = 0; |
|
|
|
List<UserBill> userBill = []; |
|
|
|
List<UserBill> userBill = []; |
|
|
|
|
|
|
|
int networkStatus = 0; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void dispose() { |
|
|
|
void dispose() { |
|
|
@ -71,10 +73,13 @@ class _MineShopDetails extends State<MineShopDetails> { |
|
|
|
"id": widget.arguments["id"], |
|
|
|
"id": widget.arguments["id"], |
|
|
|
"latitude": "$latitude", |
|
|
|
"latitude": "$latitude", |
|
|
|
"longitude": "$longitude", |
|
|
|
"longitude": "$longitude", |
|
|
|
}).catchError((onError) {}); |
|
|
|
}).catchError((onError) { |
|
|
|
|
|
|
|
networkStatus= -1; |
|
|
|
|
|
|
|
}); |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
vipCard = baseData.data; |
|
|
|
vipCard = baseData.data; |
|
|
|
refreshController.loadComplete(); |
|
|
|
refreshController.loadComplete(); |
|
|
|
|
|
|
|
networkStatus = 1; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
refreshController.loadFailed(); |
|
|
|
refreshController.loadFailed(); |
|
|
|
} |
|
|
|
} |
|
|
@ -113,6 +118,7 @@ class _MineShopDetails extends State<MineShopDetails> { |
|
|
|
"size": 10, |
|
|
|
"size": 10, |
|
|
|
"sort": "id" |
|
|
|
"sort": "id" |
|
|
|
}).catchError((onError) { |
|
|
|
}).catchError((onError) { |
|
|
|
|
|
|
|
networkStatus == -1; |
|
|
|
refreshController.refreshFailed(); |
|
|
|
refreshController.refreshFailed(); |
|
|
|
refreshController.loadFailed(); |
|
|
|
refreshController.loadFailed(); |
|
|
|
consumeRefreshController.refreshFailed(); |
|
|
|
consumeRefreshController.refreshFailed(); |
|
|
@ -133,6 +139,7 @@ class _MineShopDetails extends State<MineShopDetails> { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
current += 1; |
|
|
|
current += 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
networkStatus= 1; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
refreshController.refreshFailed(); |
|
|
|
refreshController.refreshFailed(); |
|
|
|
refreshController.loadFailed(); |
|
|
|
refreshController.loadFailed(); |
|
|
@ -152,7 +159,7 @@ class _MineShopDetails extends State<MineShopDetails> { |
|
|
|
brightness: Brightness.dark, |
|
|
|
brightness: Brightness.dark, |
|
|
|
leadingColor: Colors.black, |
|
|
|
leadingColor: Colors.black, |
|
|
|
), |
|
|
|
), |
|
|
|
body: Column( |
|
|
|
body: networkStatus == 0 ? skeletonScreen():Column( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
buildVipCard(), |
|
|
|
buildVipCard(), |
|
|
|
Container( |
|
|
|
Container( |
|
|
@ -399,6 +406,219 @@ class _MineShopDetails extends State<MineShopDetails> { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///整体骨架屏 |
|
|
|
|
|
|
|
Widget skeletonScreen() { |
|
|
|
|
|
|
|
return Container( |
|
|
|
|
|
|
|
child: Column( |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Container( |
|
|
|
|
|
|
|
margin: EdgeInsets.only(bottom: 24.h, top: 14.h, left: 14.w, right: 14.w), |
|
|
|
|
|
|
|
child:Column( |
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Container( |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
borderRadius:BorderRadius.only( |
|
|
|
|
|
|
|
topLeft: Radius.circular(6), |
|
|
|
|
|
|
|
topRight: Radius.circular(6), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
height: 62.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Container( |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
|
|
|
bottomRight: Radius.circular(6), |
|
|
|
|
|
|
|
topRight: Radius.circular(6), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
padding: EdgeInsets.all(12.h), |
|
|
|
|
|
|
|
child: Column( |
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Row( |
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
width: 68.w, |
|
|
|
|
|
|
|
height: 17.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
width: 120.w, |
|
|
|
|
|
|
|
height: 17.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox( |
|
|
|
|
|
|
|
height: 4.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
width: 99.w, |
|
|
|
|
|
|
|
height: 34.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Padding(padding:EdgeInsets.only(left: 14.w), |
|
|
|
|
|
|
|
child:Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
width: 52.w, |
|
|
|
|
|
|
|
height: 17.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
)), |
|
|
|
|
|
|
|
SizedBox( |
|
|
|
|
|
|
|
height: 8.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Container( |
|
|
|
|
|
|
|
margin: EdgeInsets.only(left: 14.w), |
|
|
|
|
|
|
|
width: 52.w, |
|
|
|
|
|
|
|
height: 2.h, |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
ListView.builder( |
|
|
|
|
|
|
|
itemCount: 4, |
|
|
|
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
|
|
|
shrinkWrap: true, |
|
|
|
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
|
|
|
return Container( |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
borderRadius: new BorderRadius.circular(6), |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
padding: EdgeInsets.all(12), |
|
|
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 8.h), |
|
|
|
|
|
|
|
child: Column( |
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Row( |
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
width: 178.w, |
|
|
|
|
|
|
|
height: 20.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Spacer(), |
|
|
|
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
width: 24.w, |
|
|
|
|
|
|
|
height: 17.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Icon( |
|
|
|
|
|
|
|
Icons.chevron_right, |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
size: 16, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox( |
|
|
|
|
|
|
|
height: 8.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Row( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
width: 28.w, |
|
|
|
|
|
|
|
height: 17.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox(width: 4.w,), |
|
|
|
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
width: 213.w, |
|
|
|
|
|
|
|
height: 17.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox( |
|
|
|
|
|
|
|
height: 4.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Row( |
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
width: 52.w, |
|
|
|
|
|
|
|
height: 17.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
width: 69.w, |
|
|
|
|
|
|
|
height: 17.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Spacer(), |
|
|
|
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
width: 52.w, |
|
|
|
|
|
|
|
height: 17.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Widget shopItem(StoreListBean store) { |
|
|
|
Widget shopItem(StoreListBean store) { |
|
|
|
return Container( |
|
|
|
return Container( |
|
|
|
decoration: BoxDecoration( |
|
|
|
decoration: BoxDecoration( |
|
|
|