Browse Source

兑换历史,门店充值列表,门店充值页面,会员卡详情页面,新增骨架屏;

订单列表ui更改;
dev
wurong 1 year ago
parent
commit
bd01bdfddb
  1. 141
      lib/mine/mine_shop_page.dart
  2. 625
      lib/mine/mine_shop_recharge.dart
  3. 252
      lib/order/exchange_history_page.dart
  4. 5
      lib/order/order_history_page.dart

141
lib/mine/mine_shop_page.dart

@ -20,6 +20,7 @@ import 'package:huixiang/view_widget/round_button.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 MineShopPage extends StatefulWidget { class MineShopPage extends StatefulWidget {
@override @override
@ -41,6 +42,7 @@ class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
FocusNode _focusNode = FocusNode(); FocusNode _focusNode = FocusNode();
bool hasFocus = true; bool hasFocus = true;
int priceOrder = 0; int priceOrder = 0;
int networkStatus = 0;
@override @override
void initState() { void initState() {
@ -93,12 +95,14 @@ class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
await apiService.vipList({ await apiService.vipList({
"keywords":editingController.text, "keywords":editingController.text,
}).catchError((error) { }).catchError((error) {
networkStatus = -1;
refreshController.refreshFailed(); refreshController.refreshFailed();
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
coupons.clear(); coupons.clear();
coupons.addAll(baseData.data); coupons.addAll(baseData.data);
refreshController.refreshCompleted(); refreshController.refreshCompleted();
networkStatus = 1;
} else { } else {
refreshController.refreshFailed(); refreshController.refreshFailed();
} }
@ -118,7 +122,7 @@ class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: MyAppBar( appBar: MyAppBar(
title: "店铺充值", title: S.of(context).dianpuchongzhi,
titleColor: Colors.black, titleColor: Colors.black,
background: Colors.white, background: Colors.white,
leadingColor: Colors.black, leadingColor: Colors.black,
@ -128,7 +132,7 @@ class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top:10.h,bottom:18.h,), padding: EdgeInsets.only(top:10.h,bottom:18.h,),
child: searchShopItem(), child: searchShop(),
), ),
Expanded(child: SmartRefresher( Expanded(child: SmartRefresher(
enablePullDown: true, enablePullDown: true,
@ -142,7 +146,14 @@ class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
controller: refreshController, controller: refreshController,
onRefresh: queryVipCard, onRefresh: queryVipCard,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: (coupons != null && coupons.length > 0) child: networkStatus == 0 ? ListView.builder(
itemCount: 10,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return shopItemSm();
},
):((coupons != null && coupons.length > 0)
? ListView.builder( ? ListView.builder(
padding: EdgeInsets.symmetric(vertical: 8.h), padding: EdgeInsets.symmetric(vertical: 8.h),
itemBuilder: (context, position) { itemBuilder: (context, position) {
@ -169,7 +180,7 @@ class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
text: "还没有会员卡~", text: "还没有会员卡~",
fontSize: 16.sp, fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h), margin: EdgeInsets.only(top: 120.h),
), )),
),) ),)
], ],
), ),
@ -177,7 +188,7 @@ class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
); );
} }
Widget searchShopItem() { Widget searchShop() {
return Container( return Container(
margin: EdgeInsets.fromLTRB(14.w, 0, 14.w, 0), margin: EdgeInsets.fromLTRB(14.w, 0, 14.w, 0),
padding: EdgeInsets.symmetric(vertical: 6.h), padding: EdgeInsets.symmetric(vertical: 6.h),
@ -237,7 +248,6 @@ class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
Widget shopItem(VipCard vipCard) { Widget shopItem(VipCard vipCard) {
return Container( return Container(
width:double.infinity, width:double.infinity,
// height:140.h,
margin: EdgeInsets.only(bottom: 12.h,top: 14.h,left: 14.w,right: 14.w), margin: EdgeInsets.only(bottom: 12.h,top: 14.h,left: 14.w,right: 14.w),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -350,4 +360,123 @@ class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
); );
} }
Widget shopItemSm(){
return Container(
width:double.infinity,
margin: EdgeInsets.only(bottom: 12.h,top: 14.h,left: 14.w,right: 14.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
borderRadius: new BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),
),
color: Color(0XFFD8D8D8),
),
padding: EdgeInsets.only(left: 12.w),
height: 62.h,
child: Row(
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 38.h,
height: 38.h,
),
),
SizedBox(width: 6,),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 111.w,
height: 21.h,
),
),
],
),
),
Container(
decoration: BoxDecoration(
borderRadius: new BorderRadius.only(
bottomRight: Radius.circular(6),
topRight: Radius.circular(6),
),
color: Colors.white,
),
padding: EdgeInsets.all(12.h),
child: Column(
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,
),
),
Spacer(),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 120.w,
height: 17.h,
),
),
],
),
SizedBox(height:4.h,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 98.w,
height: 33.h,
),
),
Spacer(),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 48.w,
height: 17.h,
),
),
SizedBox(width: 2,),
Image.asset(
"assets/image/icon_right_z.webp",
width: 16,
height: 16,
color: Color(0xFF262626),
)
],
),
],
),
),
],
),
);
}
} }

625
lib/mine/mine_shop_recharge.dart

@ -17,6 +17,7 @@ import 'package:huixiang/view_widget/my_appbar.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';
import '../retrofit/data/member_recharge_list.dart'; import '../retrofit/data/member_recharge_list.dart';
import '../retrofit/data/rechargeActLists.dart'; import '../retrofit/data/rechargeActLists.dart';
@ -55,6 +56,7 @@ class _MineShopRecharge extends State<MineShopRecharge> {
String storeId; String storeId;
String minToken; String minToken;
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
int networkStatus = 0;
@override @override
void dispose() { void dispose() {
@ -87,9 +89,12 @@ class _MineShopRecharge extends State<MineShopRecharge> {
"id": widget.arguments["id"], "id": widget.arguments["id"],
"latitude": "", "latitude": "",
"longitude": "", "longitude": "",
}).catchError((onError) {}); }).catchError((onError) {
networkStatus = -1;
});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
vipCard = baseData.data; vipCard = baseData.data;
networkStatus = 1;
} }
} finally { } finally {
if (isSingle) if (isSingle)
@ -129,9 +134,12 @@ class _MineShopRecharge extends State<MineShopRecharge> {
queryRechargeActList() async { queryRechargeActList() async {
try { try {
BaseData<List<MemberRechargeList>> baseData = BaseData<List<MemberRechargeList>> baseData =
await minService.memberRechargeList().catchError((onError) {}); await minService.memberRechargeList().catchError((onError) {
networkStatus = -1;
});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
memberRechargeList = baseData.data; memberRechargeList = baseData.data;
networkStatus = 1;
} }
} finally { } finally {
addLoadCount(); addLoadCount();
@ -224,7 +232,7 @@ class _MineShopRecharge extends State<MineShopRecharge> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
title: "店铺充值", title: S.of(context).dianpuchongzhi,
titleColor: Colors.black, titleColor: Colors.black,
background: Colors.white, background: Colors.white,
brightness: Brightness.dark, brightness: Brightness.dark,
@ -242,158 +250,163 @@ class _MineShopRecharge extends State<MineShopRecharge> {
controller: refreshController, controller: refreshController,
onRefresh: _onRefresh, onRefresh: _onRefresh,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Column( child: networkStatus == 0
children: [ ? skeletonScreen()
shopRechargeCard(), : Column(
(memberRechargeList != null && children: [
(memberRechargeList?.length ?? 0) > 0) shopRechargeCard(),
? Expanded( (memberRechargeList != null &&
child: ListView.builder( (memberRechargeList?.length ?? 0) > 0)
padding: EdgeInsets.zero, ? Expanded(
itemCount: (memberRechargeList != null && child: ListView.builder(
(memberRechargeList?.length ?? 0) > 0) padding: EdgeInsets.zero,
? memberRechargeList.length itemCount: (memberRechargeList != null &&
: 0, (memberRechargeList?.length ?? 0) > 0)
scrollDirection: Axis.vertical, ? memberRechargeList.length
shrinkWrap: true, : 0,
physics: BouncingScrollPhysics(), scrollDirection: Axis.vertical,
itemBuilder: (context, position) { shrinkWrap: true,
return GestureDetector( physics: BouncingScrollPhysics(),
onTap: () { itemBuilder: (context, position) {
setState(() { return GestureDetector(
selectIndex = position; onTap: () {
}); setState(() {
selectIndex = position;
});
},
child: rechargeItem(
memberRechargeList[position], position));
}, },
child: rechargeItem( ))
memberRechargeList[position], position)); : NoDataView(
}, src: "assets/image/xiao_fei.webp",
)) isShowBtn: false,
: NoDataView( text: "当前店铺暂无充值套餐~",
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "当前店铺暂无充值套餐~",
fontSize: 16.sp,
margin:
EdgeInsets.only(top: 90.h, left: 60.w, right: 60.w),
),
if (memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16, right: 16),
padding: EdgeInsets.only(
top: 20.h,
bottom: 24.h,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 16.h),
child: Text(
S.of(context).zhifufangshi,
style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
color: Colors.black, margin: EdgeInsets.only(
fontWeight: FontWeight.bold, top: 90.h, left: 60.w, right: 60.w),
), ),
if (memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16, right: 16),
padding: EdgeInsets.only(
top: 20.h,
bottom: 24.h,
), ),
), child: Column(
GestureDetector( mainAxisAlignment: MainAxisAlignment.spaceAround,
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 2;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image.asset("assets/image/icon_we_chat.webp"), Padding(
Expanded( padding: EdgeInsets.only(bottom: 16.h),
flex: 1, child: Text(
child: Padding( S.of(context).zhifufangshi,
padding: EdgeInsets.only(left: 8.w), style: TextStyle(
child: Text( fontSize: 16.sp,
S.of(context).weixinzhifu, color: Colors.black,
style: TextStyle( fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xff353535),
),
), ),
), ),
), ),
checkView(2), GestureDetector(
], behavior: HitTestBehavior.opaque,
), onTap: () {
), setState(() {
SizedBox(height: 10.h), checkIndex = 2;
GestureDetector( });
behavior: HitTestBehavior.opaque, },
onTap: () { child: Row(
setState(() { mainAxisAlignment: MainAxisAlignment.start,
checkIndex = 3; crossAxisAlignment: CrossAxisAlignment.start,
}); children: [
}, Image.asset("assets/image/icon_we_chat.webp"),
child: Row( Expanded(
mainAxisAlignment: MainAxisAlignment.start, flex: 1,
crossAxisAlignment: CrossAxisAlignment.start, child: Padding(
children: [ padding: EdgeInsets.only(left: 8.w),
Image.asset("assets/image/icon_alipay.webp"), child: Text(
Expanded( S.of(context).weixinzhifu,
flex: 1, style: TextStyle(
child: Padding( fontSize: 14.sp,
padding: EdgeInsets.only(left: 8.w), color: Color(0xff353535),
child: Text( ),
S.of(context).zhifubao, ),
style: TextStyle( ),
fontSize: 14.sp,
color: Color(0xff353535),
), ),
), checkView(2),
],
),
),
SizedBox(height: 10.h),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 3;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset("assets/image/icon_alipay.webp"),
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).zhifubao,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
),
),
),
),
checkView(3),
],
), ),
), ),
checkView(3),
], ],
), ),
), ),
], if (memberRechargeList != null &&
), (memberRechargeList?.length ?? 0) > 0)
), Align(
if (memberRechargeList != null && alignment: Alignment.bottomCenter,
(memberRechargeList?.length ?? 0) > 0) child: GestureDetector(
Align( behavior: HitTestBehavior.opaque,
alignment: Alignment.bottomCenter, onTap: () {
child: GestureDetector( shopRecharge();
behavior: HitTestBehavior.opaque, },
onTap: () { child: Container(
shopRecharge(); height: 56.h,
}, width: double.infinity,
child: Container( alignment: Alignment.center,
height: 56.h, decoration: BoxDecoration(
width: double.infinity, color: Color(0xFF32A060),
alignment: Alignment.center, borderRadius: BorderRadius.circular(27),
decoration: BoxDecoration( ),
color: Color(0xFF32A060), margin: EdgeInsets.only(
borderRadius: BorderRadius.circular(27), top: 12.h,
), left: 16.w,
margin: EdgeInsets.only( right: 16.w,
top: 12.h, left: 16.w, right: 16.w, bottom: 21.h), bottom: 21.h),
child: Text( child: Text(
S.of(context).querenchongzhi, S.of(context).querenchongzhi,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Colors.white, color: Colors.white,
),
),
),
), ),
), )
), ],
), ),
)
],
),
)); ));
} }
@ -410,6 +423,334 @@ class _MineShopRecharge extends State<MineShopRecharge> {
return 0xFF32A060; return 0xFF32A060;
} }
///
Widget skeletonScreen() {
return Container(
child: Column(
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
borderRadius: new BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),
),
color: Color(0XFFD8D8D8),
),
height: 62.h,
),
Container(
decoration: BoxDecoration(
borderRadius: new 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,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 99.w,
height: 34.h,
),
),
Spacer(),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 48.w,
height: 17.h,
),
),
SizedBox(
width: 2,
),
Image.asset(
"assets/image/icon_right_z.webp",
width: 16,
height: 16,
color: Color(0xFF262626),
)
],
),
],
),
),
],
),
Expanded(
child: ListView.builder(
itemCount: 4,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return Container(
width: double.infinity,
height: 69.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Colors.white),
margin: EdgeInsets.only(bottom: 14.h, left: 14.w, right: 14.w),
padding: EdgeInsets.only(left: 16),
child: Flex(
direction: Axis.horizontal,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 20.w,
height: 15.h,
),
),
SizedBox(
width: 10.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 50.w,
height: 25.h,
),
),
],
),
Container(
width: 1.w,
height: 37.h,
color: Color(0xFF979797),
margin: EdgeInsets.only(right: 16.w, left: 12),
),
Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 50.w,
height: 17.h,
),
),
SizedBox(
width: 10.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 48.w,
height: 25.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: 50.w,
height: 17.h,
),
),
Icon(
Icons.chevron_right,
size: 20,
color: Color(0xFF868686),
),
],
)
],
))
],
));
},
)),
Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 16.h),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 64.w,
height: 21.h,
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 20.h,
height: 20.h,
),
),
Padding(
padding: EdgeInsets.only(left: 8.w),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 51.w,
height: 17.h,
),
),
),
Spacer(),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(100),
),
width: 15.h,
height: 15.h,
),
),
],
),
SizedBox(height: 10.h),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 20.h,
height: 20.h,
),
),
Padding(
padding: EdgeInsets.only(left: 8.w),
child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 51.w,
height: 17.h,
),
),
),
Spacer(),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(100),
),
width: 15.h,
height: 15.h,
),
),
],
),
],
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
height: 56.h,
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(27),
),
margin: EdgeInsets.only(
top: 12.h, left: 16.w, right: 16.w, bottom: 21.h),
),
)
],
));
}
/// ///
Widget shopRechargeCard() { Widget shopRechargeCard() {
return GestureDetector( return GestureDetector(
@ -617,9 +958,7 @@ class _MineShopRecharge extends State<MineShopRecharge> {
), ),
TextSpan( TextSpan(
text: text:
"${((memberRechargeList?.limitNum ?? 0) != 0 && ((memberRechargeList?.limitNum ?? 0) - (memberRechargeList?.useNum ?? 0) <= 0)) ? "${((memberRechargeList?.limitNum ?? 0) != 0 && ((memberRechargeList?.limitNum ?? 0) - (memberRechargeList?.useNum ?? 0) <= 0)) ? (AppUtils.calculateDouble(double.tryParse(memberRechargeList.rechargeMoney) ?? 0)) : (AppUtils.calculateDouble((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) + (double.tryParse(memberRechargeList.giftdMoney) ?? 0) + ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) - ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) * (discount / 100)))))}",
(AppUtils.calculateDouble(double.tryParse(memberRechargeList.rechargeMoney) ?? 0)) :
(AppUtils.calculateDouble((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) + (double.tryParse(memberRechargeList.giftdMoney) ?? 0) + ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) - ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) * (discount / 100)))))}",
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp,
fontFamily: 'JDZhengHT', fontFamily: 'JDZhengHT',
@ -677,7 +1016,7 @@ class _MineShopRecharge extends State<MineShopRecharge> {
checkIndex != index checkIndex != index
? "assets/image/icon_radio_unselected.webp" ? "assets/image/icon_radio_unselected.webp"
: "assets/image/icon_radio_selected.webp", : "assets/image/icon_radio_selected.webp",
width: 15.w, width: 15.h,
height: 15.h, height: 15.h,
), ),
); );

252
lib/order/exchange_history_page.dart

@ -19,6 +19,7 @@ import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:shimmer/shimmer.dart';
class ExchangeHistoryPage extends StatefulWidget { class ExchangeHistoryPage extends StatefulWidget {
@override @override
@ -130,6 +131,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
RefreshController(initialRefresh: false); RefreshController(initialRefresh: false);
int pageNum = 1; int pageNum = 1;
List<ExchangeOrder> orders = []; List<ExchangeOrder> orders = [];
int networkStatus = 0;
@override @override
void initState() { void initState() {
@ -159,6 +161,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
} }
BaseData<PageInfo<ExchangeOrder>> baseData = BaseData<PageInfo<ExchangeOrder>> baseData =
await apiService.creditOrderList(map).catchError((error) { await apiService.creditOrderList(map).catchError((error) {
networkStatus = -1;
_refreshController.loadFailed(); _refreshController.loadFailed();
_refreshController.refreshFailed(); _refreshController.refreshFailed();
}); });
@ -174,6 +177,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
} else { } else {
pageNum += 1; pageNum += 1;
} }
networkStatus = 1;
} else { } else {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
_refreshController.loadFailed(); _refreshController.loadFailed();
@ -205,20 +209,29 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
onLoading: () { onLoading: () {
queryHistory(isLoading: false); queryHistory(isLoading: false);
}, },
child: orders == null || orders.length == 0 child: networkStatus == 0
? NoDataView( ? ListView.builder(
src: "assets/image/ding_dan.webp", itemCount: 10,
isShowBtn: false, physics: BouncingScrollPhysics(),
text: "目前暂无记录,手上那么多积分要赶紧用掉哦~", shrinkWrap: true,
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h, left: 72, right: 72),
)
: ListView.builder(
itemCount: orders == null ? 0 : orders.length,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return buildOrder(orders[position]); return buildOrderSm();
}, },
), )
: (orders == null || orders.length == 0
? NoDataView(
src: "assets/image/ding_dan.webp",
isShowBtn: false,
text: "目前暂无记录,手上那么多积分要赶紧用掉哦~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h, left: 72, right: 72),
)
: ListView.builder(
itemCount: orders == null ? 0 : orders.length,
itemBuilder: (context, position) {
return buildOrder(orders[position]);
},
)),
); );
} }
@ -571,6 +584,221 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
); );
} }
Widget buildOrderSm() {
return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h),
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
]),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 153.w,
height: 20.h,
),
),
Spacer(),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 44.w,
height: 20.h,
),
)
],
),
SizedBox(
height: 16.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 50.w,
height: 17.h,
),
),
SizedBox(
width: 9.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 225.w,
height: 17.h,
),
)
],
),
SizedBox(
height: 10.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 50.w,
height: 17.h,
),
),
SizedBox(
width: 10.w,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 164.w,
height: 17.h,
),
)
],
),
SizedBox(
height: 16.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 66.h,
height: 66.h,
),
),
SizedBox(
width: 12.w,
),
Expanded(
child: Container(
height: 66.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 44.w,
height: 20.h,
),
),
SizedBox(
height: 5.h,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 213.w,
height: 20.h,
),
),
],
),
),
flex: 1,
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 17.w,
height: 20.h,
),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 91.w,
height: 20.h,
),
),
],
),
SizedBox(
height: 12.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
color: Color(0XFFD8D8D8),
width: 135.w,
height: 17.h,
),
),
Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8),
child: Container(
decoration: BoxDecoration(
color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(10),
),
width:72.w,
height: 25.h,
),
)
],
)
],
),
);
}
receive2Card(id) async { receive2Card(id) async {
BaseData baseData = await apiService.creditOrderReceive(id); BaseData baseData = await apiService.creditOrderReceive(id);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {

5
lib/order/order_history_page.dart

@ -350,10 +350,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return orderItemSm();
onTap: () {},
child: orderItemSm(),
);
}, },
) : ((orderInfos != null && orderInfos.length > 0) ) : ((orderInfos != null && orderInfos.length > 0)
? ListView.builder( ? ListView.builder(

Loading…
Cancel
Save