|
|
|
@ -23,9 +23,12 @@ import 'package:huixiang/view_widget/mine_vip_view.dart';
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/my_appbar.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/vip_dialog.dart'; |
|
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
|
|
|
|
|
import '../../retrofit/data/user_info.dart'; |
|
|
|
|
import '../../view_widget/classic_header.dart'; |
|
|
|
|
import '../../view_widget/my_footer.dart'; |
|
|
|
|
|
|
|
|
|
class MineVipCore extends StatefulWidget { |
|
|
|
|
final Map<String, dynamic> arguments; |
|
|
|
@ -46,6 +49,7 @@ class _MineVipCore extends State<MineVipCore> {
|
|
|
|
|
int checkIndex = 0; |
|
|
|
|
UserInfo userInfo; |
|
|
|
|
int rankNameIndex; |
|
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
|
|
|
|
|
|
|
final SwiperController controller = SwiperController(); |
|
|
|
|
|
|
|
|
@ -104,7 +108,9 @@ class _MineVipCore extends State<MineVipCore> {
|
|
|
|
|
|
|
|
|
|
///会员等级列表 |
|
|
|
|
queryVipLevel() async { |
|
|
|
|
BaseData<List<Rank>> rankData = await apiService.rankList().catchError((onError) {}); |
|
|
|
|
BaseData<List<Rank>> rankData = await apiService.rankList().catchError((onError) { |
|
|
|
|
refreshController.refreshFailed(); |
|
|
|
|
refreshController.loadFailed();}); |
|
|
|
|
if (rankData != null && rankData.isSuccess) { |
|
|
|
|
ranks.clear(); |
|
|
|
|
ranks.addAll(rankData.data); |
|
|
|
@ -114,21 +120,29 @@ class _MineVipCore extends State<MineVipCore> {
|
|
|
|
|
setState(() { |
|
|
|
|
controller.move((widget.arguments["rankLevel"] - 1), animation: false); |
|
|
|
|
}); |
|
|
|
|
refreshController.refreshCompleted(); |
|
|
|
|
refreshController.loadComplete(); |
|
|
|
|
} else { |
|
|
|
|
SmartDialog.showToast(rankData?.msg??"", alignment: Alignment.center); |
|
|
|
|
refreshController.refreshFailed(); |
|
|
|
|
refreshController.loadFailed(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///会员权益列表 |
|
|
|
|
queryBenefitList() async { |
|
|
|
|
BaseData<List<VipBenefitList>> baseData = |
|
|
|
|
await apiService.benefitList().catchError((onError) {}); |
|
|
|
|
await apiService.benefitList().catchError((onError) { |
|
|
|
|
refreshController.refreshFailed(); |
|
|
|
|
refreshController.loadFailed();}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
setState(() { |
|
|
|
|
vipBenefitList.clear(); |
|
|
|
|
vipBenefitList.addAll(baseData.data); |
|
|
|
|
vipBenefitList.sort((a, b) => (a.sort).compareTo(b.sort)); |
|
|
|
|
}); |
|
|
|
|
refreshController.refreshCompleted(); |
|
|
|
|
refreshController.loadComplete(); |
|
|
|
|
} |
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
} |
|
|
|
@ -136,11 +150,15 @@ class _MineVipCore extends State<MineVipCore> {
|
|
|
|
|
///会员权益介绍/规则/说明/储值说明 |
|
|
|
|
queryRuleDetails() async { |
|
|
|
|
BaseData<VipRuleDetails> baseData = |
|
|
|
|
await apiService.vipBenefit().catchError((onError) {}); |
|
|
|
|
await apiService.vipBenefit().catchError((onError) { |
|
|
|
|
refreshController.refreshFailed(); |
|
|
|
|
refreshController.loadFailed();}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
setState(() { |
|
|
|
|
vipRuleDetails = baseData.data; |
|
|
|
|
}); |
|
|
|
|
refreshController.refreshCompleted(); |
|
|
|
|
refreshController.loadComplete(); |
|
|
|
|
} |
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
} |
|
|
|
@ -180,6 +198,13 @@ class _MineVipCore extends State<MineVipCore> {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_onRefresh() async { |
|
|
|
|
await queryVipLevel(); |
|
|
|
|
await queryBenefitList(); |
|
|
|
|
await queryRuleDetails(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return Container( |
|
|
|
@ -259,310 +284,328 @@ class _MineVipCore extends State<MineVipCore> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Expanded(child: |
|
|
|
|
SingleChildScrollView( |
|
|
|
|
SmartRefresher( |
|
|
|
|
controller: refreshController, |
|
|
|
|
enablePullDown: true, |
|
|
|
|
enablePullUp: false, |
|
|
|
|
header: MyHeader( |
|
|
|
|
color: Colors.white, |
|
|
|
|
), |
|
|
|
|
footer: CustomFooter( |
|
|
|
|
builder: (context, mode) { |
|
|
|
|
return MyFooter(mode); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
onRefresh: () { |
|
|
|
|
_onRefresh(); |
|
|
|
|
}, |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
///会员卡 |
|
|
|
|
if(ranks.length > 0) |
|
|
|
|
Container( |
|
|
|
|
height: (MediaQuery.of(context).size.width) / |
|
|
|
|
1.78 * |
|
|
|
|
AppUtils.textScale(context), |
|
|
|
|
child: Swiper( |
|
|
|
|
viewportFraction: 0.95, |
|
|
|
|
loop: false, |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
index: checkIndex, |
|
|
|
|
controller: controller, |
|
|
|
|
onIndexChanged: (index) { |
|
|
|
|
setState(() { |
|
|
|
|
checkIndex = index; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return vipCar(position); |
|
|
|
|
// MineVipView( |
|
|
|
|
// vipLevel: !(ranks != null && ranks.isNotEmpty) |
|
|
|
|
// ? widget.arguments["rankLevel"] |
|
|
|
|
// : position + 1, |
|
|
|
|
// curLevel: widget.arguments["rankLevel"], |
|
|
|
|
// tag: (widget.arguments["rankLevel"] == (position + 1) || |
|
|
|
|
// !(ranks != null && ranks.isNotEmpty)) |
|
|
|
|
// ? "vip" |
|
|
|
|
// : "", |
|
|
|
|
// padding: 6.w, |
|
|
|
|
// // rank: !(ranks != null && ranks.isNotEmpty) |
|
|
|
|
// // ? 0 |
|
|
|
|
// // : widget.arguments["expendAmount"] ?? 0, |
|
|
|
|
// rankMax: !(ranks != null && ranks.isNotEmpty) |
|
|
|
|
// ? 0 |
|
|
|
|
// : ranks[position].rankOrigin, |
|
|
|
|
// createTime: widget.arguments["createTime"], |
|
|
|
|
// showRank: false, |
|
|
|
|
// price: !(ranks != null && ranks.isNotEmpty) |
|
|
|
|
// ? "0" |
|
|
|
|
// : ranks[position].price, |
|
|
|
|
// ); |
|
|
|
|
}, |
|
|
|
|
itemCount: |
|
|
|
|
(ranks != null && ranks.isNotEmpty) ? ranks.length : 1, |
|
|
|
|
scrollController: ScrollController(), |
|
|
|
|
child: SingleChildScrollView( |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
///会员卡 |
|
|
|
|
if(ranks.length > 0) |
|
|
|
|
Container( |
|
|
|
|
height: (MediaQuery.of(context).size.width) / |
|
|
|
|
1.78 * |
|
|
|
|
AppUtils.textScale(context), |
|
|
|
|
child: Swiper( |
|
|
|
|
viewportFraction: 0.95, |
|
|
|
|
loop: false, |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
index: checkIndex, |
|
|
|
|
controller: controller, |
|
|
|
|
onIndexChanged: (index) { |
|
|
|
|
setState(() { |
|
|
|
|
checkIndex = index; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return vipCar(position); |
|
|
|
|
// MineVipView( |
|
|
|
|
// vipLevel: !(ranks != null && ranks.isNotEmpty) |
|
|
|
|
// ? widget.arguments["rankLevel"] |
|
|
|
|
// : position + 1, |
|
|
|
|
// curLevel: widget.arguments["rankLevel"], |
|
|
|
|
// tag: (widget.arguments["rankLevel"] == (position + 1) || |
|
|
|
|
// !(ranks != null && ranks.isNotEmpty)) |
|
|
|
|
// ? "vip" |
|
|
|
|
// : "", |
|
|
|
|
// padding: 6.w, |
|
|
|
|
// // rank: !(ranks != null && ranks.isNotEmpty) |
|
|
|
|
// // ? 0 |
|
|
|
|
// // : widget.arguments["expendAmount"] ?? 0, |
|
|
|
|
// rankMax: !(ranks != null && ranks.isNotEmpty) |
|
|
|
|
// ? 0 |
|
|
|
|
// : ranks[position].rankOrigin, |
|
|
|
|
// createTime: widget.arguments["createTime"], |
|
|
|
|
// showRank: false, |
|
|
|
|
// price: !(ranks != null && ranks.isNotEmpty) |
|
|
|
|
// ? "0" |
|
|
|
|
// : ranks[position].price, |
|
|
|
|
// ); |
|
|
|
|
}, |
|
|
|
|
itemCount: |
|
|
|
|
(ranks != null && ranks.isNotEmpty) ? ranks.length : 1, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
///会员权益 |
|
|
|
|
if(vipBenefitList != null) |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), |
|
|
|
|
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), |
|
|
|
|
topRight: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
///会员权益 |
|
|
|
|
if(vipBenefitList != null) |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), |
|
|
|
|
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), |
|
|
|
|
topRight: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
width: 4.w, |
|
|
|
|
height: 18.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
gradient: new LinearGradient( |
|
|
|
|
begin: Alignment.bottomCenter, |
|
|
|
|
end: Alignment.topCenter, |
|
|
|
|
colors: [ |
|
|
|
|
Color(0xFF000000), |
|
|
|
|
Color(0xFF585858), |
|
|
|
|
]), |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
width: 4.w, |
|
|
|
|
height: 18.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
gradient: new LinearGradient( |
|
|
|
|
begin: Alignment.bottomCenter, |
|
|
|
|
end: Alignment.topCenter, |
|
|
|
|
colors: [ |
|
|
|
|
Color(0xFF000000), |
|
|
|
|
Color(0xFF585858), |
|
|
|
|
]), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 4.w, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).huiyuanquanyi, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 4.w, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).huiyuanquanyi, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
vipLegalRight(), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
vipLegalRight(), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
///会员规则说明 |
|
|
|
|
if(vipRuleDetails != null) |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), |
|
|
|
|
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), |
|
|
|
|
topRight: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
|
|
|
|
|
///会员规则说明 |
|
|
|
|
if(vipRuleDetails != null) |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), |
|
|
|
|
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), |
|
|
|
|
topRight: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
width: 4.w, |
|
|
|
|
height: 18.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
gradient: new LinearGradient( |
|
|
|
|
begin: Alignment.bottomCenter, |
|
|
|
|
end: Alignment.topCenter, |
|
|
|
|
colors: [ |
|
|
|
|
Color(0xFF000000), |
|
|
|
|
Color(0xFF585858), |
|
|
|
|
]), |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
width: 4.w, |
|
|
|
|
height: 18.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
gradient: new LinearGradient( |
|
|
|
|
begin: Alignment.bottomCenter, |
|
|
|
|
end: Alignment.topCenter, |
|
|
|
|
colors: [ |
|
|
|
|
Color(0xFF000000), |
|
|
|
|
Color(0xFF585858), |
|
|
|
|
]), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 4.w, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).huiyuanguize, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 4.w, |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).huiyuanguize, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
color: Colors.black, |
|
|
|
|
if (vipRuleDetails?.qa != null && vipRuleDetails.qa != "") |
|
|
|
|
Container( |
|
|
|
|
color: Colors.white, |
|
|
|
|
padding: EdgeInsets.only(left: 8.w), |
|
|
|
|
child: Html( |
|
|
|
|
data: vipRuleDetails?.qa ?? "", |
|
|
|
|
customImageRenders: { |
|
|
|
|
networkSourceMatcher(): networkImageRender( |
|
|
|
|
loadingWidget: () { |
|
|
|
|
return Container(); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
if (vipRuleDetails?.qa != null && vipRuleDetails.qa != "") |
|
|
|
|
Container( |
|
|
|
|
color: Colors.white, |
|
|
|
|
padding: EdgeInsets.only(left: 8.w), |
|
|
|
|
child: Html( |
|
|
|
|
data: vipRuleDetails?.qa ?? "", |
|
|
|
|
customImageRenders: { |
|
|
|
|
networkSourceMatcher(): networkImageRender( |
|
|
|
|
loadingWidget: () { |
|
|
|
|
return Container(); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
///会员级别对照表 |
|
|
|
|
if(vipRuleDetails != null) |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), |
|
|
|
|
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), |
|
|
|
|
topRight: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
|
|
|
|
|
///会员级别对照表 |
|
|
|
|
if(vipRuleDetails != null) |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), |
|
|
|
|
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), |
|
|
|
|
topRight: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
width: 4.w, |
|
|
|
|
height: 18.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
gradient: new LinearGradient( |
|
|
|
|
begin: Alignment.bottomCenter, |
|
|
|
|
end: Alignment.topCenter, |
|
|
|
|
colors: [ |
|
|
|
|
Color(0xFF000000), |
|
|
|
|
Color(0xFF585858), |
|
|
|
|
]), |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
width: 4.w, |
|
|
|
|
height: 18.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
gradient: new LinearGradient( |
|
|
|
|
begin: Alignment.bottomCenter, |
|
|
|
|
end: Alignment.topCenter, |
|
|
|
|
colors: [ |
|
|
|
|
Color(0xFF000000), |
|
|
|
|
Color(0xFF585858), |
|
|
|
|
]), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 4.w, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).huiyuanjibieduizhao, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 4.w, |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).huiyuanjibieduizhao, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
MImage( |
|
|
|
|
vipRuleDetails?.contrast ?? "", |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: 281.h, |
|
|
|
|
errorSrc: "assets/image/default_1.webp", |
|
|
|
|
fadeSrc: "assets/image/default_1.webp", |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 16.h, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
MImage( |
|
|
|
|
vipRuleDetails?.contrast ?? "", |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: 281.h, |
|
|
|
|
errorSrc: "assets/image/default_1.webp", |
|
|
|
|
fadeSrc: "assets/image/default_1.webp", |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 16.h, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
///会员如何获得积分 |
|
|
|
|
if(vipRuleDetails != null) |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), |
|
|
|
|
topRight: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
|
|
|
|
|
///会员如何获得积分 |
|
|
|
|
if(vipRuleDetails != null) |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), |
|
|
|
|
topRight: Radius.circular(8), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
width: 4.w, |
|
|
|
|
height: 18.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
gradient: new LinearGradient( |
|
|
|
|
begin: Alignment.bottomCenter, |
|
|
|
|
end: Alignment.topCenter, |
|
|
|
|
colors: [ |
|
|
|
|
Color(0xFF000000), |
|
|
|
|
Color(0xFF585858), |
|
|
|
|
]), |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
width: 4.w, |
|
|
|
|
height: 18.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
gradient: new LinearGradient( |
|
|
|
|
begin: Alignment.bottomCenter, |
|
|
|
|
end: Alignment.topCenter, |
|
|
|
|
colors: [ |
|
|
|
|
Color(0xFF000000), |
|
|
|
|
Color(0xFF585858), |
|
|
|
|
]), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 4.w, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).huiyuanhuodejifen, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 4.w, |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).huiyuanhuodejifen, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
color: Colors.black, |
|
|
|
|
if (vipRuleDetails?.rule != null && |
|
|
|
|
vipRuleDetails.rule != "") |
|
|
|
|
Container( |
|
|
|
|
color: Colors.white, |
|
|
|
|
child: Html( |
|
|
|
|
data: vipRuleDetails?.rule ?? "", |
|
|
|
|
customImageRenders: { |
|
|
|
|
networkSourceMatcher(): networkImageRender( |
|
|
|
|
loadingWidget: () { |
|
|
|
|
return Container(); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
if (vipRuleDetails?.rule != null && |
|
|
|
|
vipRuleDetails.rule != "") |
|
|
|
|
Container( |
|
|
|
|
color: Colors.white, |
|
|
|
|
child: Html( |
|
|
|
|
data: vipRuleDetails?.rule ?? "", |
|
|
|
|
customImageRenders: { |
|
|
|
|
networkSourceMatcher(): networkImageRender( |
|
|
|
|
loadingWidget: () { |
|
|
|
|
return Container(); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
], |
|
|
|
@ -618,8 +661,8 @@ class _MineVipCore extends State<MineVipCore> {
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
gradient: LinearGradient( |
|
|
|
|
colors: [ |
|
|
|
|
AppUtils.getLighterColor(ranks[position]?.color ?? ""), |
|
|
|
|
Color(int.parse((ranks[position]?.color ?? "").replaceAll("#", "FF"), radix: 16)), |
|
|
|
|
AppUtils.getLighterColor(ranks[position]?.color ?? "#85C9DD"), |
|
|
|
|
Color(int.parse((ranks[position]?.color ?? "#85C9DD").replaceAll("#", "FF"), radix: 16)), |
|
|
|
|
], |
|
|
|
|
begin: Alignment.topLeft, |
|
|
|
|
end: Alignment.bottomRight, |
|
|
|
@ -698,14 +741,12 @@ class _MineVipCore extends State<MineVipCore> {
|
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: |
|
|
|
|
(userInfo?.memberRankVo?.rankName != ranks[position].rankName || (userInfo?.memberRankVo?.rankName == "共创会员" && ranks[position].rankName == "共创会员"))? |
|
|
|
|
MainAxisAlignment.spaceAround: |
|
|
|
|
MainAxisAlignment.end, |
|
|
|
|
MainAxisAlignment.spaceAround, |
|
|
|
|
children: [ |
|
|
|
|
if(userInfo?.memberRankVo?.rankName != ranks[position].rankName || (userInfo?.memberRankVo?.rankName == "共创会员" && ranks[position].rankName == "共创会员")) |
|
|
|
|
Align(alignment: Alignment.centerRight, |
|
|
|
|
child: Text( |
|
|
|
|
(ranks[position].rankName == "共创会员") ? "¥${AppUtils.calculateDouble(double.tryParse(ranks[position].price??""))}/永久" : (ranks[position]?.originScore ?? 0).toString(), |
|
|
|
|
(ranks[position].rankName == "共创会员") ? "永久VIP" : (ranks[position]?.originScore ?? 0).toString(), |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color:Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)), |
|
|
|
@ -734,7 +775,7 @@ class _MineVipCore extends State<MineVipCore> {
|
|
|
|
|
TextSpan( |
|
|
|
|
text:"${AppUtils.calculateDouble(double.tryParse(userInfo.expendAmount??"0"))}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 26.sp, |
|
|
|
|
fontSize: 24.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
color: Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)), |
|
|
|
|
), |
|
|
|
@ -752,19 +793,19 @@ class _MineVipCore extends State<MineVipCore> {
|
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
),), |
|
|
|
|
// if(userInfo?.memberRankVo?.rankName == ranks[position].rankName && (userInfo?.memberRankVo?.rankName != "共创会员" && ranks[position].rankName != "共创会员")) |
|
|
|
|
// Container( |
|
|
|
|
// height: 8.h, |
|
|
|
|
// child: ClipRRect( |
|
|
|
|
// borderRadius: BorderRadius.circular(6.5), |
|
|
|
|
// child: LinearProgressIndicator( |
|
|
|
|
// value: (userInfo?.memberRankVo?.nextOrigin ?? 0) > (double.tryParse(userInfo?.expendAmount ?? "0").toInt())? ((checkIndex < rankNameIndex) ? |
|
|
|
|
// (userInfo?.memberRankVo?.nextOrigin ?? 0)/(userInfo?.memberRankVo?.nextOrigin ?? 0): (double.tryParse(userInfo?.expendAmount ?? "0").toInt()) / (userInfo?.memberRankVo?.nextOrigin ?? 0)) : 0, |
|
|
|
|
// backgroundColor: Colors.white, |
|
|
|
|
// color: AppUtils.getLighterColor(ranks[position]?.color ?? ""), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
if(userInfo?.memberRankVo?.rankName == ranks[position].rankName && (userInfo?.memberRankVo?.rankName != "共创会员" && ranks[position].rankName != "共创会员")) |
|
|
|
|
Container( |
|
|
|
|
height: 8.h, |
|
|
|
|
child: ClipRRect( |
|
|
|
|
borderRadius: BorderRadius.circular(6.5), |
|
|
|
|
child: LinearProgressIndicator( |
|
|
|
|
value: (userInfo?.memberRankVo?.nextOrigin ?? 0) > (double.tryParse(userInfo?.expendAmount ?? "0").toInt())? ((checkIndex < rankNameIndex) ? |
|
|
|
|
(userInfo?.memberRankVo?.nextOrigin ?? 0)/(userInfo?.memberRankVo?.nextOrigin ?? 0): (double.tryParse(userInfo?.expendAmount ?? "0").toInt()) / (userInfo?.memberRankVo?.nextOrigin ?? 0)) : 0, |
|
|
|
|
backgroundColor: Colors.white, |
|
|
|
|
color: AppUtils.getLighterColor(ranks[position]?.color ?? ""), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|