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() {
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(
onTap: () {
setState(() {
// Navigator.of(context).pop();
// share();
Navigator.of(context).pop();
share();
});
},
child: Container(

401
lib/vip/vip_view/vip_top.dart

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

Loading…
Cancel
Save