Browse Source

Merge remote-tracking branch 'origin/new_revision_app' into new_revision_app

dart3_last
fmk 2 years ago
parent
commit
f0ba191dcb
  1. 6
      lib/community/community_view/community_dynamic.dart
  2. 401
      lib/vip/vip_view/vip_top.dart

6
lib/community/community_view/community_dynamic.dart

@ -518,7 +518,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
} }
String buildShareUrl() { String buildShareUrl() {
return "https://hx.lotus-wallet.com/index.html?id=${widget.article.id}&type="; return "https://hx.lotus-wallet.com/communityShare.html?id=${widget.article.id}";
} }
/// ///
@ -801,8 +801,8 @@ class _CommunityDynamic extends State<CommunityDynamic> {
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
// Navigator.of(context).pop(); Navigator.of(context).pop();
// share(); share();
}); });
}, },
child: Container( child: Container(

401
lib/vip/vip_view/vip_top.dart

@ -22,8 +22,7 @@ class VipTop extends StatefulWidget {
final VipCardHome vipCardHome; final VipCardHome vipCardHome;
final Function onRefresh; final Function onRefresh;
VipTop(this.vipCardHome, this.onRefresh);
VipTop(this.vipCardHome,this.onRefresh);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -98,7 +97,8 @@ class _VipTop extends State<VipTop> {
if (payRes['resultStatus'] == 9000 || if (payRes['resultStatus'] == 9000 ||
payRes['resultStatus'] == '9000') { payRes['resultStatus'] == '9000') {
widget.onRefresh(); widget.onRefresh();
SmartDialog.showToast("支付成功", alignment: Alignment.center); SmartDialog.showToast("支付成功",
alignment: Alignment.center);
} else { } else {
SmartDialog.showToast(payRes['memo'], SmartDialog.showToast(payRes['memo'],
alignment: Alignment.center); alignment: Alignment.center);
@ -121,116 +121,121 @@ class _VipTop extends State<VipTop> {
SizedBox( SizedBox(
height: 15.h, height: 15.h,
), ),
(!(widget?.vipCardHome?.member?.isVip ?? false))? (!(widget?.vipCardHome?.member?.isVip ?? false))
vipCardList(): ? vipCardList()
Padding( : Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w), padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 10.w, vertical: 15.h), horizontal: 10.w, vertical: 15.h),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w), borderRadius: BorderRadius.circular(4.w),
color: Color(0xffffffff), color: Color(0xffffffff),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withAlpha(12), color: Colors.black.withAlpha(12),
offset: Offset(0, 3), offset: Offset(0, 3),
blurRadius: 14, blurRadius: 14,
spreadRadius: 0, spreadRadius: 0,
) )
], ],
), ),
child: Text.rich( child: Text.rich(
TextSpan(
children: [
TextSpan(
text: S.of(context).yixianghuiyuanquanyi,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 15.sp,
color: Color(0xff32A060),
),
),
TextSpan( TextSpan(
text: widget?.vipCardHome?.member?.vipDuration children: [
.toString() ?? TextSpan(
"0", text: S.of(context).yixianghuiyuanquanyi,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp, fontSize: 15.sp,
color: Color(0xffF96519), color: Color(0xff32A060),
), ),
),
TextSpan(
text: widget
?.vipCardHome?.member?.vipDuration
.toString() ??
"0",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
color: Color(0xffF96519),
),
),
TextSpan(
text: "",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 15.sp,
color: Color(0xff32A060),
),
),
],
), ),
TextSpan( textDirection: TextDirection.ltr,
text: "", ))),
style: TextStyle( SizedBox(
fontWeight: MyFontWeight.semi_bold, width: 10.w,
fontSize: 15.sp, ),
color: Color(0xff32A060), Expanded(
), child: GestureDetector(
onTap: () {
setState(() {
vipRenewShowBottomSheet();
});
},
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: 10.w, vertical: 15.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
color: Color(0xffffffff),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
), ),
], child: Row(
), mainAxisAlignment: MainAxisAlignment.center,
textDirection: TextDirection.ltr, crossAxisAlignment: CrossAxisAlignment.center,
))), children: [
SizedBox( Text(
width: 10.w, "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "已开通自动续费" : "续费回乡VIP"}",
style: TextStyle(
color: Color((widget?.vipCardHome
?.member?.isVipSubscribe ??
false)
? 0xff3A3936
: 0xff32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
width: 6.w,
),
Image.asset(
"${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "assets/image/vip_xf.webp" : "assets/image/icon_right.webp"}",
width: 16,
height: 16,
fit: BoxFit.fill,
color: Color(0xff32A060),
),
],
))),
)
],
), ),
Expanded( ),
child: GestureDetector(
onTap: () {
setState(() {
vipRenewShowBottomSheet();
});
},
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: 10.w, vertical: 15.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
color: Color(0xffffffff),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"${(widget?.vipCardHome?.member?.isVipSubscribe ??false) ?"已开通自动续费":"续费回乡VIP"}",
style: TextStyle(
color: Color((widget?.vipCardHome?.member?.isVipSubscribe ??false)?0xff3A3936:0xff32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
width: 6.w,
),
Image.asset(
"${(widget?.vipCardHome?.member?.isVipSubscribe ??false) ? "assets/image/vip_xf.webp":"assets/image/icon_right.webp"}",
width: 16,
height: 16,
fit: BoxFit.fill,
color: Color(0xff32A060),
),
],
))),
)
],
),
),
], ],
), ),
); );
@ -290,7 +295,7 @@ class _VipTop extends State<VipTop> {
), ),
if (widget?.vipCardHome?.member?.isVip ?? false) if (widget?.vipCardHome?.member?.isVip ?? false)
Text( Text(
"有效期至 ${(widget?.vipCardHome?.member?.vipExpire ?? "").substring(0,( widget?.vipCardHome?.member?.vipExpire ?? "").indexOf(" "))}", "有效期至 ${(widget?.vipCardHome?.member?.vipExpire ?? "").substring(0, (widget?.vipCardHome?.member?.vipExpire ?? "").indexOf(" "))}",
style: TextStyle( style: TextStyle(
color: Color(0xffFFFFFF), color: Color(0xffFFFFFF),
fontSize: 13.sp, fontSize: 13.sp,
@ -319,9 +324,9 @@ class _VipTop extends State<VipTop> {
onTap: () { onTap: () {
setState(() { setState(() {
selectIndex = position; selectIndex = position;
if(widget?.vipCardHome?.member?.isVip ?? false){ if (widget?.vipCardHome?.member?.isVip ?? false) {
vipShowBottomSheet(); vipShowBottomSheet();
} else{ } else {
vipTreatyShowBottomSheet(); vipTreatyShowBottomSheet();
} }
}); });
@ -433,9 +438,9 @@ class _VipTop extends State<VipTop> {
showModalBottomSheet( showModalBottomSheet(
builder: (BuildContext context) { builder: (BuildContext context) {
return StatefulBuilder(builder: ( return StatefulBuilder(builder: (
context, context,
state, state,
) { ) {
return renewBuildBottomSheetWidget(context, state); return renewBuildBottomSheetWidget(context, state);
}); });
}, },
@ -445,7 +450,9 @@ class _VipTop extends State<VipTop> {
Widget renewBuildBottomSheetWidget(BuildContext context, state) { Widget renewBuildBottomSheetWidget(BuildContext context, state) {
return Container( return Container(
padding: EdgeInsets.only(top: 10.h,), padding: EdgeInsets.only(
top: 10.h,
),
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: new BorderRadius.only( borderRadius: new BorderRadius.only(
@ -457,13 +464,13 @@ class _VipTop extends State<VipTop> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Padding(padding:EdgeInsets.only(right:14.w), Padding(
child: padding: EdgeInsets.only(right: 14.w),
Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
S.of(context).xuefeihuiyuan , S.of(context).xuefeihuiyuan,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
@ -471,18 +478,20 @@ class _VipTop extends State<VipTop> {
color: Color(0xff0D0D0D), color: Color(0xff0D0D0D),
), ),
)), )),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
child: Icon( child: Icon(
Icons.clear, Icons.clear,
color: Colors.black, color: Colors.black,
), ),
), ),
], ],
)), )),
SizedBox(height:11.h,), SizedBox(
height: 11.h,
),
Container( Container(
height: 132.h, height: 132.h,
margin: EdgeInsets.symmetric(horizontal: 14.w), margin: EdgeInsets.symmetric(horizontal: 14.w),
@ -497,7 +506,8 @@ class _VipTop extends State<VipTop> {
selectIndex = position; selectIndex = position;
}); });
}, },
child: vipCardItem(widget?.vipCardHome?.cards[position], position), child: vipCardItem(
widget?.vipCardHome?.cards[position], position),
); );
}, },
), ),
@ -505,7 +515,8 @@ class _VipTop extends State<VipTop> {
Container( Container(
width: double.infinity, width: double.infinity,
height: 40.h, height: 40.h,
margin: EdgeInsets.only(top: 14.h,left: 14.w,right: 14.w,bottom:5.h), margin: EdgeInsets.only(
top: 14.h, left: 14.w, right: 14.w, bottom: 5.h),
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Color(0xff383A38), color: Color(0xff383A38),
borderRadius: BorderRadius.circular(24)), borderRadius: BorderRadius.circular(24)),
@ -534,12 +545,12 @@ class _VipTop extends State<VipTop> {
), ),
), ),
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context)
'/router/user_vip_service_page'); .pushNamed('/router/user_vip_service_page');
}, },
child: Padding( child: Padding(
padding: EdgeInsets.only(left:14.w,bottom: 15.h), padding: EdgeInsets.only(left: 14.w, bottom: 15.h),
child: Text.rich( child: Text.rich(
TextSpan( TextSpan(
children: [ children: [
@ -594,9 +605,9 @@ class _VipTop extends State<VipTop> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context)
'/router/user_vip_service_page'); .pushNamed('/router/user_vip_service_page');
}, },
child: Padding( child: Padding(
padding: EdgeInsets.only(left: 4.w), padding: EdgeInsets.only(left: 4.w),
@ -686,7 +697,7 @@ class _VipTop extends State<VipTop> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
S.of(context).zhifufangshi, S.of(context).zhifufangshi,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -705,58 +716,60 @@ class _VipTop extends State<VipTop> {
), ),
], ],
), ),
GestureDetector( if (!(widget?.vipCardHome?.cards[selectIndex]?.autoSubscribe ??
onTap: () { false))
state(() { GestureDetector(
payType = 1; onTap: () {
}); state(() {
}, payType = 1;
child: Container( });
padding: EdgeInsets.only( },
left: 14.w, right: 32.w, top: 11.h, bottom: 11.h), child: Container(
margin: EdgeInsets.only(top: 17.h), padding: EdgeInsets.only(
decoration: BoxDecoration( left: 14.w, right: 32.w, top: 11.h, bottom: 11.h),
borderRadius: BorderRadius.circular(4.w), margin: EdgeInsets.only(top: 17.h),
color: Color(payType == 1 ? 0xFFF0FAF4 : 0xffF9F9F9), decoration: BoxDecoration(
border: Border.all( borderRadius: BorderRadius.circular(4.w),
color: Color(payType == 1 ? 0xFF32A060 : 0xFFFAFAFA), color: Color(payType == 1 ? 0xFFF0FAF4 : 0xffF9F9F9),
width: payType == 1 ? 2 : 0, border: Border.all(
), color: Color(payType == 1 ? 0xFF32A060 : 0xFFFAFAFA),
boxShadow: [ width: payType == 1 ? 2 : 0,
BoxShadow(
color: Color(0xffF9F9F9).withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Row(
children: [
Image.asset(
"assets/image/icon_we_chat.webp",
width: 20,
fit: BoxFit.fill,
height: 20,
),
SizedBox(
width: 8.w,
), ),
Text( boxShadow: [
S.of(context).weixinzhifu, BoxShadow(
style: TextStyle( color: Color(0xffF9F9F9).withAlpha(12),
fontWeight: MyFontWeight.regular, offset: Offset(0, 3),
fontSize: 15.sp, blurRadius: 14,
color: Color(0xff0D0D0D), spreadRadius: 0,
)
],
),
child: Row(
children: [
Image.asset(
"assets/image/icon_we_chat.webp",
width: 20,
fit: BoxFit.fill,
height: 20,
), ),
), SizedBox(
SizedBox( width: 8.w,
width: 20.w, ),
), Text(
], S.of(context).weixinzhifu,
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 15.sp,
color: Color(0xff0D0D0D),
),
),
SizedBox(
width: 20.w,
),
],
),
), ),
), ),
),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
state(() { state(() {
@ -809,10 +822,10 @@ class _VipTop extends State<VipTop> {
), ),
), ),
), ),
Spacer(),
Container( Container(
width: double.infinity, width: double.infinity,
height: 40.h, height: 40.h,
margin: EdgeInsets.only(top: 30.h),
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Color(0xff383A38), color: Color(0xff383A38),
borderRadius: BorderRadius.circular(24)), borderRadius: BorderRadius.circular(24)),

Loading…
Cancel
Save