|
|
@@ -13,9 +13,11 @@ import 'package:location/utils/common_expand.dart';
|
|
|
import 'package:location/utils/project_expand.dart';
|
|
|
import 'package:location/widget/auto_scroll_list_view.dart';
|
|
|
import '../../data/bean/member_status_info.dart';
|
|
|
+import '../../data/bean/pay_item_bean.dart';
|
|
|
import '../../resource/fonts.gen.dart';
|
|
|
import '../../resource/string.gen.dart';
|
|
|
import '../../router/app_pages.dart';
|
|
|
+import '../../utils/common_util.dart';
|
|
|
import '../../utils/date_util.dart';
|
|
|
import '../../widget/animated_switcher_widget.dart';
|
|
|
import 'member_evaluate_bean.dart';
|
|
|
@@ -39,83 +41,90 @@ class MemberPage extends BasePage<MemberController> {
|
|
|
|
|
|
@override
|
|
|
Widget buildBody(BuildContext context) {
|
|
|
- return Stack(
|
|
|
- children: [
|
|
|
- SingleChildScrollView(
|
|
|
- controller: controller.scrollController,
|
|
|
- child: Stack(
|
|
|
- children: [
|
|
|
- Assets.images.bgMemberHeader.image(width: double.infinity),
|
|
|
- SafeArea(
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- SizedBox(height: 62.w),
|
|
|
- buildUserInfoView(),
|
|
|
- SizedBox(height: 26.w),
|
|
|
- Container(
|
|
|
- width: double.infinity,
|
|
|
- decoration: BoxDecoration(
|
|
|
- borderRadius: BorderRadius.only(
|
|
|
- topLeft: Radius.circular(14.w),
|
|
|
- topRight: Radius.circular(14.w)),
|
|
|
- gradient: LinearGradient(
|
|
|
- begin: Alignment.topCenter,
|
|
|
- end: Alignment.bottomCenter,
|
|
|
- stops: [0.0, 0.1],
|
|
|
- colors: ['#EFE9FF'.color, Colors.white])),
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- SizedBox(height: 23.w),
|
|
|
- buildGoodsList(),
|
|
|
- SizedBox(height: 12.w),
|
|
|
- buildPrivacyPolicyView(),
|
|
|
- SizedBox(height: 30.w),
|
|
|
- Padding(
|
|
|
- padding: EdgeInsets.only(left: 12.w),
|
|
|
- child: Text(StringName.memberEquityIntroduction,
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 16.sp,
|
|
|
- color: ColorName.black90,
|
|
|
- fontWeight: FontWeight.bold)),
|
|
|
- ),
|
|
|
- SizedBox(height: 19.w),
|
|
|
- buildFunctionList(),
|
|
|
- SizedBox(height: 40.w),
|
|
|
- Padding(
|
|
|
- padding: EdgeInsets.only(left: 12.w),
|
|
|
- child: Text(StringName.memberUserEvaluate,
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 16.sp,
|
|
|
- color: ColorName.black90,
|
|
|
- fontWeight: FontWeight.bold)),
|
|
|
- ),
|
|
|
- SizedBox(height: 8.w),
|
|
|
- buildUserEvaluateList(),
|
|
|
- SizedBox(height: 20.w),
|
|
|
- Container(
|
|
|
- padding: EdgeInsets.all(12.w),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: '#F7F7F7'.color,
|
|
|
- borderRadius: BorderRadius.circular(6.w)),
|
|
|
- margin: EdgeInsets.symmetric(horizontal: 12.w),
|
|
|
- child: Text(StringName.memberTips,
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 12.sp, color: '#A7A7A7'.color)),
|
|
|
- ),
|
|
|
- SizedBox(height: 100.w)
|
|
|
- ],
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
+ return PopScope(
|
|
|
+ canPop: false,
|
|
|
+ onPopInvokedWithResult: (bool didPop, dynamic result) async {
|
|
|
+ controller.onPopBack();
|
|
|
+ },
|
|
|
+ child: Stack(
|
|
|
+ children: [
|
|
|
+ SingleChildScrollView(
|
|
|
+ controller: controller.scrollController,
|
|
|
+ child: Stack(
|
|
|
+ children: [
|
|
|
+ Assets.images.bgMemberHeader.image(width: double.infinity),
|
|
|
+ SafeArea(
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ SizedBox(height: 62.w),
|
|
|
+ buildUserInfoView(),
|
|
|
+ SizedBox(height: 26.w),
|
|
|
+ Container(
|
|
|
+ width: double.infinity,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
+ topLeft: Radius.circular(14.w),
|
|
|
+ topRight: Radius.circular(14.w)),
|
|
|
+ gradient: LinearGradient(
|
|
|
+ begin: Alignment.topCenter,
|
|
|
+ end: Alignment.bottomCenter,
|
|
|
+ stops: [0.0, 0.1],
|
|
|
+ colors: ['#EFE9FF'.color, Colors.white])),
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ SizedBox(height: 23.w),
|
|
|
+ buildGoodsList(),
|
|
|
+ SizedBox(height: 12.w),
|
|
|
+ buildPrivacyPolicyView(),
|
|
|
+ buildPayWayView(),
|
|
|
+ SizedBox(height: 30.w),
|
|
|
+ Padding(
|
|
|
+ padding: EdgeInsets.only(left: 12.w),
|
|
|
+ child: Text(StringName.memberEquityIntroduction,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 16.sp,
|
|
|
+ color: ColorName.black90,
|
|
|
+ fontWeight: FontWeight.bold)),
|
|
|
+ ),
|
|
|
+ SizedBox(height: 19.w),
|
|
|
+ buildFunctionList(),
|
|
|
+ SizedBox(height: 40.w),
|
|
|
+ Padding(
|
|
|
+ padding: EdgeInsets.only(left: 12.w),
|
|
|
+ child: Text(StringName.memberUserEvaluate,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 16.sp,
|
|
|
+ color: ColorName.black90,
|
|
|
+ fontWeight: FontWeight.bold)),
|
|
|
+ ),
|
|
|
+ SizedBox(height: 8.w),
|
|
|
+ buildUserEvaluateList(),
|
|
|
+ SizedBox(height: 20.w),
|
|
|
+ Container(
|
|
|
+ padding: EdgeInsets.all(12.w),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: '#F7F7F7'.color,
|
|
|
+ borderRadius: BorderRadius.circular(6.w)),
|
|
|
+ margin: EdgeInsets.symmetric(horizontal: 12.w),
|
|
|
+ child: Text(StringName.memberTips,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 12.sp, color: '#A7A7A7'.color)),
|
|
|
+ ),
|
|
|
+ SizedBox(height: 100.w)
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- buildHeadBar(),
|
|
|
- buildMemberBottomView()
|
|
|
- ],
|
|
|
+ buildHeadBar(),
|
|
|
+ buildMemberBottomView()
|
|
|
+ ],
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@@ -246,7 +255,8 @@ class MemberPage extends BasePage<MemberController> {
|
|
|
child: Align(
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
child: Container(
|
|
|
- padding: EdgeInsets.only(left: 12.w, right: 12.w, top: 13.w, bottom: 20.w),
|
|
|
+ padding: EdgeInsets.only(
|
|
|
+ left: 12.w, right: 12.w, top: 13.w, bottom: 20.w),
|
|
|
decoration: BoxDecoration(
|
|
|
color: Colors.white,
|
|
|
boxShadow: [
|
|
|
@@ -279,21 +289,24 @@ class MemberPage extends BasePage<MemberController> {
|
|
|
style: TextStyle(fontSize: 12.sp, color: '#000000'.color),
|
|
|
),
|
|
|
Spacer(),
|
|
|
- Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: ColorName.colorPrimary,
|
|
|
- borderRadius: BorderRadius.circular(100.w)),
|
|
|
- width: 164.w,
|
|
|
- height: 44.w,
|
|
|
- child: Center(
|
|
|
- child: Text(
|
|
|
- controller.memberStatusInfo?.expired == false
|
|
|
- ? StringName.memberVipRenew
|
|
|
- : StringName.memberVipUnlock,
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 15.sp,
|
|
|
- color: Colors.white,
|
|
|
- fontWeight: FontWeight.bold),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: controller.onBuyClick,
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: ColorName.colorPrimary,
|
|
|
+ borderRadius: BorderRadius.circular(100.w)),
|
|
|
+ width: 164.w,
|
|
|
+ height: 44.w,
|
|
|
+ child: Center(
|
|
|
+ child: Text(
|
|
|
+ controller.memberStatusInfo?.expired == false
|
|
|
+ ? StringName.memberVipRenew
|
|
|
+ : StringName.memberVipUnlock,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 15.sp,
|
|
|
+ color: Colors.white,
|
|
|
+ fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
)
|
|
|
@@ -381,7 +394,7 @@ class MemberPage extends BasePage<MemberController> {
|
|
|
Positioned(
|
|
|
left: 12.w,
|
|
|
child: GestureDetector(
|
|
|
- onTap: controller.back,
|
|
|
+ onTap: () => controller.onPopBack(),
|
|
|
child: Assets.images.iconWhiteBack
|
|
|
.image(width: 24.w, height: 24.w),
|
|
|
)),
|
|
|
@@ -414,27 +427,27 @@ class MemberPage extends BasePage<MemberController> {
|
|
|
text: TextSpan(
|
|
|
style: TextStyle(fontSize: 12.sp, color: ColorName.black40),
|
|
|
children: [
|
|
|
- TextSpan(text: '购买前请先阅读'),
|
|
|
- TextSpan(
|
|
|
- recognizer: TapGestureRecognizer()
|
|
|
- ..onTap = () {
|
|
|
- controller.onPrivacyPolicyClick();
|
|
|
- },
|
|
|
- text: '隐私政策',
|
|
|
- style: TextStyle(
|
|
|
- color: ColorName.black60,
|
|
|
- decoration: TextDecoration.underline)),
|
|
|
- TextSpan(text: '&'),
|
|
|
- TextSpan(
|
|
|
- recognizer: TapGestureRecognizer()
|
|
|
- ..onTap = () {
|
|
|
- controller.onTermOfServiceClick();
|
|
|
- },
|
|
|
- text: '服务条款',
|
|
|
- style: TextStyle(
|
|
|
- color: ColorName.black60,
|
|
|
- decoration: TextDecoration.underline)),
|
|
|
- ])),
|
|
|
+ TextSpan(text: '购买前请先阅读'),
|
|
|
+ TextSpan(
|
|
|
+ recognizer: TapGestureRecognizer()
|
|
|
+ ..onTap = () {
|
|
|
+ controller.onPrivacyPolicyClick();
|
|
|
+ },
|
|
|
+ text: '隐私政策',
|
|
|
+ style: TextStyle(
|
|
|
+ color: ColorName.black60,
|
|
|
+ decoration: TextDecoration.underline)),
|
|
|
+ TextSpan(text: '&'),
|
|
|
+ TextSpan(
|
|
|
+ recognizer: TapGestureRecognizer()
|
|
|
+ ..onTap = () {
|
|
|
+ controller.onTermOfServiceClick();
|
|
|
+ },
|
|
|
+ text: '服务条款',
|
|
|
+ style: TextStyle(
|
|
|
+ color: ColorName.black60,
|
|
|
+ decoration: TextDecoration.underline)),
|
|
|
+ ])),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@@ -513,4 +526,55 @@ class MemberPage extends BasePage<MemberController> {
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+ Widget buildPayWayView() {
|
|
|
+ return Obx(() {
|
|
|
+ return Visibility(
|
|
|
+ visible: controller.payItemList.isNotEmpty,
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(top: 7.w),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ for (PayItemBean item in controller.payItemList)
|
|
|
+ buildPayWayItem(item)
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget buildPayWayItem(PayItemBean item) {
|
|
|
+ return GestureDetector(
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ onTap: () => controller.onPayWayItemClick(item),
|
|
|
+ child: Obx(() {
|
|
|
+ bool isSelected = controller.selectedPayWay?.id == item.id;
|
|
|
+ return Container(
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 10.w),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ SizedBox(width: 12.w),
|
|
|
+ Image.asset(
|
|
|
+ getPaymentIconPath(
|
|
|
+ payMethod: item.payMethod, payPlatform: item.payPlatform),
|
|
|
+ width: 24.w,
|
|
|
+ height: 24.w),
|
|
|
+ SizedBox(width: 6.w),
|
|
|
+ Text(item.title,
|
|
|
+ style: TextStyle(fontSize: 14.sp, color: ColorName.black90)),
|
|
|
+ Spacer(),
|
|
|
+ Image.asset(
|
|
|
+ isSelected
|
|
|
+ ? Assets.images.iconCbSelected.path
|
|
|
+ : Assets.images.iconCbUnSelect.path,
|
|
|
+ width: 20.w,
|
|
|
+ height: 20.w),
|
|
|
+ SizedBox(width: 20.w),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|