|
|
|
@ -32,8 +32,7 @@ class _VipCardPage extends State<VipCardPage> {
|
|
|
|
|
_refreshController = RefreshController(); |
|
|
|
|
|
|
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
|
apiService = |
|
|
|
|
ApiService(Dio(), context: context, token: value.getString("token")); |
|
|
|
|
apiService = ApiService(Dio(), context: context, token: value.getString("token")); |
|
|
|
|
queryVipCard(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -41,8 +40,7 @@ class _VipCardPage extends State<VipCardPage> {
|
|
|
|
|
List<VipCard> coupons = []; |
|
|
|
|
|
|
|
|
|
queryVipCard() async { |
|
|
|
|
BaseData<List<VipCard>> baseData = |
|
|
|
|
await apiService.vipList({}).catchError((error) { |
|
|
|
|
BaseData<List<VipCard>> baseData = await apiService.vipList({}).catchError((error) { |
|
|
|
|
_refreshController.refreshFailed(); |
|
|
|
|
}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
@ -72,27 +70,24 @@ class _VipCardPage extends State<VipCardPage> {
|
|
|
|
|
controller: _refreshController, |
|
|
|
|
onRefresh: queryVipCard, |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
child: (coupons != null && coupons.length > 0) |
|
|
|
|
? ListView.builder( |
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 8.h), |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
'/router/vip_details_page', |
|
|
|
|
arguments: {"id": coupons[position].id}); |
|
|
|
|
}, |
|
|
|
|
child: vipCardItem(coupons[position]), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
itemCount: coupons != null ? coupons.length : 0, |
|
|
|
|
) |
|
|
|
|
: NoDataView( |
|
|
|
|
isShowBtn: false, |
|
|
|
|
text: "还没有会员卡~", |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
margin: EdgeInsets.only(top: 120.h), |
|
|
|
|
), |
|
|
|
|
child: (coupons != null && coupons.length > 0) ? ListView.builder( |
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 8.h), |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pushNamed('/router/vip_details_page', |
|
|
|
|
arguments: {"id": coupons[position].id}); |
|
|
|
|
}, |
|
|
|
|
child: vipCardItem(coupons[position]), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
itemCount: coupons != null ? coupons.length : 0, |
|
|
|
|
) : NoDataView( |
|
|
|
|
isShowBtn: false, |
|
|
|
|
text: "还没有会员卡~", |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
margin: EdgeInsets.only(top: 120.h), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
@ -234,8 +229,8 @@ class _VipCardPage extends State<VipCardPage> {
|
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
],), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|