Browse Source

1.动态详情,评论-已显示全部—修改;

2.新增加集换卡详情页面;
3.语言-增加部分文本语言并更改;
4.回乡VIP板块更改;原本的VIP卡逻辑暂时不用,换成用户充值200即成为会员,该页面ui调整;(原来逻辑未删减,暂保留不使用)
5.16进制渐变色值的方法,改变亮度暂定统一为95;
6.首页ui调整;邀请好友图片处,原单一图片现更改为轮播效果,新增集换卡引导也放在此处;
7.积分明细页面更改;共用一个页面根据积分跟集换卡的入口,传对应的值,查看对应的数据;
8.积分明细跳转路径更改,新增一个类型带入路径中跳转传入;
9.更改测试版本服务地址;
10.我的页面跟首页更改一致,单一图片改轮播效果;
11.会员中心,会员卡部分更改;将原有写法去掉,重写了会员卡的使用显示,并优化了该页面数据的显示;
12.我的页面,vip等级显示更改;
13.会员卡列表等级接口,实体类新增部分字段;(原定位分数已不用,更改为originScore,后期若用的原字段,需要修改)
14.订单结算页,支付类型更换时queryOrderInfo()接口中。优惠类型做了调整更改;(改修改需要多测试下,尝试多种情况看下,是否有问题;有可能部分情况没有预判到)
15.点单页结算跳转,vipLevelName,vipLevelName字段做了非空判断;
16.UserInfo实体类新增isVip字段;(主要用于查看用户数据是查询该用户是否已是vip卡状态)
17.福利兑换中心页面,我的信息部分ui做调整,新增集换卡数量的显示;
new_revision_app
wurong 2 years ago
parent
commit
1fedcb3e6a
  1. BIN
      assets/image/2x/my_trading.webp
  2. BIN
      assets/image/2x/trading_detail.webp
  3. BIN
      assets/image/2x/trading_history.webp
  4. BIN
      assets/image/2x/trading_logo.webp
  5. BIN
      assets/image/2x/trading_text.webp
  6. BIN
      assets/image/2x/vip_cz.webp
  7. BIN
      assets/image/2x/welfare_yz.webp
  8. BIN
      assets/image/3x/my_trading.webp
  9. BIN
      assets/image/3x/trading_detail.webp
  10. BIN
      assets/image/3x/trading_history.webp
  11. BIN
      assets/image/3x/trading_logo.webp
  12. BIN
      assets/image/3x/trading_text.webp
  13. BIN
      assets/image/3x/vip_cz.webp
  14. BIN
      assets/image/3x/welfare_yz.webp
  15. BIN
      assets/image/my_trading.webp
  16. BIN
      assets/image/trading_detail.webp
  17. BIN
      assets/image/trading_history.webp
  18. BIN
      assets/image/trading_logo.webp
  19. BIN
      assets/image/trading_text.webp
  20. BIN
      assets/image/vip_cz.webp
  21. BIN
      assets/image/welfare_yz.webp
  22. 1
      lib/generated/intl/messages_en.dart
  23. 1
      lib/generated/intl/messages_en_US.dart
  24. 1
      lib/generated/intl/messages_zh_CN.dart
  25. 1
      lib/generated/intl/messages_zh_Hans_CN.dart
  26. 1
      lib/generated/intl/messages_zh_Hant_CN.dart
  27. 1
      lib/generated/intl/messages_zh_TW.dart
  28. 10
      lib/generated/l10n.dart
  29. 57
      lib/home/home_page.dart
  30. 316
      lib/home/trading_card_page.dart
  31. 86
      lib/home/welfare_exchange.dart
  32. 213
      lib/integral/integral_detailed_page.dart
  33. 2
      lib/integral/integral_page.dart
  34. 1
      lib/l10n/intl_en.arb
  35. 1
      lib/l10n/intl_en_US.arb
  36. 1
      lib/l10n/intl_zh_CN.arb
  37. 1
      lib/l10n/intl_zh_Hans_CN.arb
  38. 1
      lib/l10n/intl_zh_Hant_CN.arb
  39. 1
      lib/l10n/intl_zh_TW.arb
  40. 5
      lib/main.dart
  41. 58
      lib/mine/mine_page.dart
  42. 255
      lib/mine/mine_vip/mine_vip_core.dart
  43. 20
      lib/retrofit/data/rank.dart
  44. 3
      lib/retrofit/data/user_info.dart
  45. 2
      lib/retrofit/min_api.dart
  46. 2
      lib/retrofit/retrofit_api.dart
  47. 3
      lib/setting/binding_phone_page.dart
  48. 35
      lib/settlement/settlement.dart
  49. 4
      lib/store/store_order.dart
  50. 8
      lib/utils/flutter_utils.dart
  51. 469
      lib/view_widget/mine_vip_entry.dart
  52. 133
      lib/vip/vip_page.dart
  53. 600
      lib/vip/vip_view/exclusive_coupon.dart
  54. 407
      lib/vip/vip_view/vip_top.dart
  55. 2
      lib/web/web_view/comment_list.dart

BIN
assets/image/2x/my_trading.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
assets/image/2x/trading_detail.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

BIN
assets/image/2x/trading_history.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 B

BIN
assets/image/2x/trading_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
assets/image/2x/trading_text.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
assets/image/2x/vip_cz.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
assets/image/2x/welfare_yz.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
assets/image/3x/my_trading.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

BIN
assets/image/3x/trading_detail.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

BIN
assets/image/3x/trading_history.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/image/3x/trading_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
assets/image/3x/trading_text.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
assets/image/3x/vip_cz.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
assets/image/3x/welfare_yz.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
assets/image/my_trading.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/image/trading_detail.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

BIN
assets/image/trading_history.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

BIN
assets/image/trading_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
assets/image/trading_text.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
assets/image/vip_cz.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/welfare_yz.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

1
lib/generated/intl/messages_en.dart

@ -260,6 +260,7 @@ class MessageLookup extends MessageLookupByLibrary {
"gengduo" : MessageLookupByLibrary.simpleMessage("更多"),
"gengduohaoquan" : MessageLookupByLibrary.simpleMessage("更多好券"),
"gengduoyouhuiquan" : MessageLookupByLibrary.simpleMessage("更多优惠券"),
"genggaibangdingshoujihao" : MessageLookupByLibrary.simpleMessage("更改绑定手机号"),
"genghuanbeijing" : MessageLookupByLibrary.simpleMessage("更换背景"),
"genghuantouxiang" : MessageLookupByLibrary.simpleMessage("更换头像"),
"gengyouhui" : MessageLookupByLibrary.simpleMessage("更优惠"),

1
lib/generated/intl/messages_en_US.dart

@ -260,6 +260,7 @@ class MessageLookup extends MessageLookupByLibrary {
"gengduo" : MessageLookupByLibrary.simpleMessage("more"),
"gengduohaoquan" : MessageLookupByLibrary.simpleMessage("more good coupons"),
"gengduoyouhuiquan" : MessageLookupByLibrary.simpleMessage("more coupons"),
"genggaibangdingshoujihao" : MessageLookupByLibrary.simpleMessage("modify bind phone"),
"genghuanbeijing" : MessageLookupByLibrary.simpleMessage("Changing the background"),
"genghuantouxiang" : MessageLookupByLibrary.simpleMessage("Changing the avatar"),
"gengyouhui" : MessageLookupByLibrary.simpleMessage("More preferential"),

1
lib/generated/intl/messages_zh_CN.dart

@ -260,6 +260,7 @@ class MessageLookup extends MessageLookupByLibrary {
"gengduo" : MessageLookupByLibrary.simpleMessage("更多"),
"gengduohaoquan" : MessageLookupByLibrary.simpleMessage("更多好券"),
"gengduoyouhuiquan" : MessageLookupByLibrary.simpleMessage("更多优惠券"),
"genggaibangdingshoujihao" : MessageLookupByLibrary.simpleMessage("更改绑定手机号"),
"genghuanbeijing" : MessageLookupByLibrary.simpleMessage("更换背景"),
"genghuantouxiang" : MessageLookupByLibrary.simpleMessage("更换头像"),
"gengyouhui" : MessageLookupByLibrary.simpleMessage("更优惠"),

1
lib/generated/intl/messages_zh_Hans_CN.dart

@ -260,6 +260,7 @@ class MessageLookup extends MessageLookupByLibrary {
"gengduo" : MessageLookupByLibrary.simpleMessage("更多"),
"gengduohaoquan" : MessageLookupByLibrary.simpleMessage("更多好券"),
"gengduoyouhuiquan" : MessageLookupByLibrary.simpleMessage("更多优惠券"),
"genggaibangdingshoujihao" : MessageLookupByLibrary.simpleMessage("更改绑定手机号"),
"genghuanbeijing" : MessageLookupByLibrary.simpleMessage("更换背景"),
"genghuantouxiang" : MessageLookupByLibrary.simpleMessage("更换头像"),
"gengyouhui" : MessageLookupByLibrary.simpleMessage("更优惠"),

1
lib/generated/intl/messages_zh_Hant_CN.dart

@ -256,6 +256,7 @@ class MessageLookup extends MessageLookupByLibrary {
"gengduo" : MessageLookupByLibrary.simpleMessage("更多"),
"gengduohaoquan" : MessageLookupByLibrary.simpleMessage("更多好券"),
"gengduoyouhuiquan" : MessageLookupByLibrary.simpleMessage("更多優惠券"),
"genggaibangdingshoujihao" : MessageLookupByLibrary.simpleMessage("更改綁定手機號"),
"genghuanbeijing" : MessageLookupByLibrary.simpleMessage("更換背景"),
"genghuantouxiang" : MessageLookupByLibrary.simpleMessage("更换头像"),
"gengyouhui" : MessageLookupByLibrary.simpleMessage("更優惠"),

1
lib/generated/intl/messages_zh_TW.dart

@ -258,6 +258,7 @@ class MessageLookup extends MessageLookupByLibrary {
"gengduo" : MessageLookupByLibrary.simpleMessage("更多"),
"gengduohaoquan" : MessageLookupByLibrary.simpleMessage("更多好券"),
"gengduoyouhuiquan" : MessageLookupByLibrary.simpleMessage("更多優惠券"),
"genggaibangdingshoujihao" : MessageLookupByLibrary.simpleMessage("更改綁定手機號"),
"genghuanbeijing" : MessageLookupByLibrary.simpleMessage("更換背景"),
"genghuantouxiang" : MessageLookupByLibrary.simpleMessage("更換頭像"),
"gengyouhui" : MessageLookupByLibrary.simpleMessage("更優惠"),

10
lib/generated/l10n.dart

@ -7135,6 +7135,16 @@ class S {
);
}
/// ``
String get genggaibangdingshoujihao {
return Intl.message(
'更改绑定手机号',
name: 'genggaibangdingshoujihao',
desc: '',
args: [],
);
}
/// `使`
String get privacy_policy4 {
return Intl.message(

57
lib/home/home_page.dart

@ -602,26 +602,55 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
Widget spread(){
return Container(
width: double.infinity,
height: 80.h,
margin: EdgeInsets.symmetric(horizontal: 14.w),
child: GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/invite_friends');
// Navigator.of(context).pushNamed('/router/mine_greenery');
},
child: ClipRRect(
child:Image.asset(
"assets/image/welfare_spread.webp",
width:double.infinity,
fit: BoxFit.fill,
height:double.infinity,
height: 85.h,
child: Swiper(
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 5.h),
builder: DotSwiperPaginationBuilder(
size: 8.w,
activeSize: 8.w,
space: 5.w,
activeColor: Colors.white,
color: Colors.white.withAlpha(76),
),
borderRadius: BorderRadius.circular(6.w),
),
autoplay:true,
duration: 1000,
autoplayDelay: 2000,
itemBuilder: (context, position) {
return GestureDetector(
onTap: (){
if(position == 0){
Navigator.of(context).pushNamed('/router/invite_friends');
}else if(position == 1){
Navigator.of(context).pushNamed('/router/trading_card_page');
}
},
child:Container(
margin: EdgeInsets.symmetric(horizontal:14.w),
child: ClipRRect(
child:Image.asset(
spreadItem[position],
width:double.infinity,
fit: BoxFit.fill,
height:double.infinity,
),
borderRadius: BorderRadius.circular(6.w),
),
),
);
},
itemCount:2,
),
);
}
final List<String> spreadItem = [
"assets/image/welfare_spread.webp",
"assets/image/welfare_yz.webp",
];
///
toScan() async {
if (await Permission.camera.isPermanentlyDenied) {

316
lib/home/trading_card_page.dart

@ -0,0 +1,316 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/user_info.dart';
import '../view_widget/classic_header.dart';
import '../view_widget/my_footer.dart';
class TradingCardPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _TradingCardPage();
}
}
class _TradingCardPage extends State<TradingCardPage> {
ApiService apiService;
final RefreshController refreshController = RefreshController();
UserInfo userInfo;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) {
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
queryUserBalance();
});
}
///
queryUserBalance() async {
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {
refreshController.refreshFailed();
refreshController.loadFailed();});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
if (mounted) setState(() {});
refreshController.refreshCompleted();
refreshController.loadComplete();
}else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
refreshController.refreshFailed();
refreshController.loadFailed();
}
}
@override
Widget build(BuildContext context) {
return Container(
color: Colors.white,
child: Stack(
children: [
Container(
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
image: AssetImage("assets/image/settlement_bg.webp"),
),
),
width: double.infinity,
height: 306.h,
),
Scaffold(
backgroundColor: Colors.transparent,
appBar: MyAppBar(
title: "",
titleColor: Colors.white,
background: Colors.transparent,
leadingColor: Colors.white,
brightness: Brightness.dark,
),
body: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(
color: Colors.white,
),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
queryUserBalance();
},
physics: BouncingScrollPhysics(),
scrollController: ScrollController(),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child:Container(
margin: EdgeInsets.symmetric(horizontal:14.w),
child:Column(
children: [
Container(
width: double.infinity,
padding:EdgeInsets.only(top:24.h,bottom: 27.h) ,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 4),
blurRadius: 8,
spreadRadius: 8,
)
],
),
child: Column(
children:[
Image.asset(
"assets/image/my_trading.webp",
width:200.w,
fit: BoxFit.fill,
height:22.h,
),
SizedBox(height:28.h),
Image.asset(
"assets/image/trading_logo.webp",
width:196.w,
fit: BoxFit.fill,
height:150.h,
),
Padding(padding:EdgeInsets.only(top: 21.h,bottom: 17.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"我已收集",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.regular),
),
SizedBox(width: 12.w,),
Text(
(userInfo?.happyBean ?? 0).toString(),
style: TextStyle(
color: Color(0xFF32A060),
fontSize: 18.sp,
fontWeight: MyFontWeight.regular),
)
],
),),
Padding(padding:EdgeInsets.only(bottom:31.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(padding:EdgeInsets.only(right:1.w),
child: GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/welfare_exchange');
},
child: Text(
"兑换区逛逛",
style: TextStyle(
color: Color(0xFF32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.regular),
),
)),
Image.asset(
"assets/image/icon_right_z.webp",
width:16,
fit: BoxFit.fill,
height:16,
color: Color(0xFF32A060),
)
],
),),
Image.asset(
"assets/image/trading_text.webp",
width:314.w,
fit: BoxFit.cover,
height:98.h,
),
]
),
),
Container(
width: double.infinity,
padding:EdgeInsets.symmetric(vertical: 17.h,horizontal: 32.w) ,
margin: EdgeInsets.only(top:16.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 4),
blurRadius: 8,
spreadRadius: 8,
)
],
),
child: Row(
children: [
Image.asset(
"assets/image/trading_history.webp",
width:16.h,
fit: BoxFit.fill,
height:16.h,
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap:(){
Navigator.of(context)
.pushNamed('/router/exchange_history_page');
},
child: Padding(padding:EdgeInsets.only(left: 4.w),
child: Text(
"兑换记录",
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular),
)),
),
Spacer(),
Container(
width: 1.w,
height: 35.5.h,
margin: EdgeInsets.symmetric(),
color:Color(0xFFD8D8D8)),
Spacer(),
Image.asset(
"assets/image/trading_detail.webp",
width:16.h,
fit: BoxFit.fill,
height:16.h,
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
Navigator.of(context).pushNamed('/router/integral_detailed_page',arguments:{"titleType":1});
},
child: Padding(padding:EdgeInsets.only(left: 4.w),
child: Text(
"印章明细",
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular),
)),)
],
),
),
Container(
width: double.infinity,
padding:EdgeInsets.symmetric(vertical:12.h,horizontal: 11.w) ,
margin: EdgeInsets.only(top:16.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 4),
blurRadius: 8,
spreadRadius: 8,
)
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding:EdgeInsets.only(bottom:14.h),
child: Text(
"规则介绍",
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold),
),),
Padding(padding:EdgeInsets.only(bottom:12.h),
child: Text(
"(1) 商品中所要求的印章达到方可兑换",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular),
),),
Text(
"(2) 印章卡仅兑换商城指定商品,不能折算现金或兑换其他非指定商品项目",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
height: 1.5.h,
fontWeight: MyFontWeight.regular),
),
],
),
)
],
),
),
),
),
)
],
),
);
}
}

86
lib/home/welfare_exchange.dart

@ -323,7 +323,7 @@ class _WelfareExchange extends State<WelfareExchange>
userInfo.nickname,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
fontWeight: MyFontWeight.bold,
color: Color(0xFF353535),
),
),
@ -365,65 +365,71 @@ class _WelfareExchange extends State<WelfareExchange>
height: 50.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
onTap: () {
Navigator.of(context)
.pushNamed('/router/integral_detailed_page');
},
child: Row(
children: [
Text(
S.of(context).jifenmingxi,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),
Row(
children: [
Text(
"总积分",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),
Container(
width: 20,
height: 20,
margin: EdgeInsets.only(left: 4),
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(10),
),
child: Icon(
Icons.keyboard_arrow_right,
size: 20,
color: Colors.white,
),
),
Padding(padding:EdgeInsets.only(left:2.w),
child: Text(
(userInfo != null) ? "${userInfo.points}" : "",
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF32A060),
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.medium,
),
],
),
),),
SizedBox(
width: 4.w,
),
Image.asset(
"assets/image/icon_gold_coin.webp",
width: 18,
height: 18,
)
],
),
SizedBox(
height: 4.h,
),
Expanded(
child: Row(
Row(
children: [
Text(
(userInfo != null) ? "${userInfo.points}" : "",
"总印章",
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF32A060),
fontFamily: 'JDZhengHT',
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),
),
Padding(padding:EdgeInsets.only(left:2.w),
child: Text(
(userInfo != null) ? "${userInfo?.happyBean ?? 0}" : "",
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF32A060),
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.medium,
),
),),
SizedBox(
width: 6.w,
width:4.w,
),
Image.asset(
"assets/image/icon_gold_coin.webp",
"assets/image/trading_logo.webp",
width: 18,
height: 18,
)
],
))
),
],
),
)

213
lib/integral/integral_detailed_page.dart

@ -10,14 +10,18 @@ import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/my_tab.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../view_widget/no_data_view.dart';
class IntegralDetailedPage extends StatefulWidget {
final arguments;
IntegralDetailedPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _IntegralDetailedPage();
@ -34,19 +38,19 @@ class _IntegralDetailedPage extends State<IntegralDetailedPage>
super.didChangeDependencies();
_tabs = [
MyTab(
text: S.of(context).huode,
text: widget.arguments["titleType"] == 1 ? "印章获得" : S.of(context).huode,
),
MyTab(
text: S.of(context).xiaofei,
text: widget.arguments["titleType"] == 1 ? "印章使用" : S.of(context).xiaofei,
),
];
tabController = TabController(length: 2, vsync: this)
..addListener(() {
current = 1;
if (tabController.index == 0) {
queryDetail("bill_cate_point_get");
queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_get",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_ADD" :"");
} else {
queryDetail("bill_cate_point_sub");
queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_sub",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_SUB" :"");
}
});
}
@ -67,17 +71,17 @@ class _IntegralDetailedPage extends State<IntegralDetailedPage>
apiService = ApiService(Dio(),
context: context, token: value.getString("token")),
userInfo = UserInfo.fromJson(jsonDecode(value.getString('user'))),
queryDetail("bill_cate_point_get"),
queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_get",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_ADD" :""),
});
}
int current = 1;
List<UserBill> userBill = [];
queryDetail(category) async {
queryDetail(category,type) async {
BaseData<PageInfo<UserBill>> baseData = await apiService.queryBillInfo({
"current": current,
"model": {"category": category, "title": "bill_title_point", "type": ""},
"model": {"category": category, "title": widget.arguments["titleType"] == 1 ? "":"bill_title_point", "type": type},
"order": "descending",
"size": 10,
"sort": "id"
@ -107,17 +111,17 @@ class _IntegralDetailedPage extends State<IntegralDetailedPage>
_onRefresh() {
current = 1;
if (tabController.index == 0) {
queryDetail("bill_cate_point_get");
queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_get",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_ADD" :"");
} else {
queryDetail("bill_cate_point_sub");
queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_sub",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_SUB" :"");
}
}
_loadMore() {
if (tabController.index == 0) {
queryDetail("bill_cate_point_get");
queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_get",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_SUB" :"");
} else {
queryDetail("bill_cate_point_sub");
queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_sub",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_SUB" :"");
}
}
@ -155,29 +159,39 @@ class _IntegralDetailedPage extends State<IntegralDetailedPage>
titleSpacing: 2,
leadingWidth: 56,
flexibleSpace: FlexibleSpaceBar(
background: Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 56.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
userInfo != null ? userInfo.points : "0",
style: TextStyle(
color: Colors.white,
fontWeight: MyFontWeight.medium,
fontSize: 48.sp),
),
Text(
S.of(context).wodejifenzhi,
style: TextStyle(
color: Color(0xFFF2F2F2),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular),
background: Stack(
children: [
Image.asset(
"assets/image/ming_xi.webp",
width:double.infinity,
fit: BoxFit.fill,
height:259.h,
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 56.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
userInfo != null ? (widget.arguments["titleType"] == 1 ? (userInfo?.happyBean ?? 0) : userInfo.points) : "0",
style: TextStyle(
color: Colors.white,
fontWeight: MyFontWeight.medium,
fontSize: 48.sp),
),
Text(
widget.arguments["titleType"] == 1 ? "我的集卡券" : S.of(context).wodejifenzhi,
style: TextStyle(
color: Color(0xFFF2F2F2),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular),
),
],
),
],
),
)
],
),
),
expandedHeight: 228,
@ -220,74 +234,125 @@ class _IntegralDetailedPage extends State<IntegralDetailedPage>
),
onRefresh: _onRefresh,
onLoading: _loadMore,
child: ListView.builder(
child: (userBill == null || userBill.length == 0)
? NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "当前暂无记录哦~",
fontSize: 16.sp,
margin: EdgeInsets.all(60.h),
):ListView.builder(
itemCount: userBill != null ? userBill.length : 0,
padding: EdgeInsets.only(top: 8, bottom: 8),
itemBuilder: (context, position) {
return Container(
margin: EdgeInsets.fromLTRB(16, 8, 16, 8),
padding: EdgeInsets.fromLTRB(14, 7, 16, 7),
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(2)),
borderRadius: BorderRadius.all(Radius.circular(6)),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12,
offset: Offset(0, 2),
blurRadius: 3,
spreadRadius: 0,
)
]),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/icon_intergral_sign.webp",
width: 36.w,
height: 34.h,
),
SizedBox(
width: 15,
),
Expanded(
child: Container(
// height: 34.h,
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
userBill[position].name ?? "",
// S.of(context).qiandao,
style: TextStyle(
color: Colors.black,
fontSize: 12.sp,
fontWeight: FontWeight.w400),
// height: 34.h,
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding: EdgeInsets.only(bottom: 8.h),
child: Text(
userBill[position].type ?? "",
// S.of(context).qiandao,
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: FontWeight.bold),
),),
Text(
userBill[position].createTime ?? "",
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular),
)
],
),
Text(
userBill[position].createTime ?? "",
style: TextStyle(
color: Color(0xFF727272),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular),
)
],
),
)),
)),
Container(
margin: EdgeInsets.only(top: 2.h),
child: Text(
"${tabController.index == 0 ? "+" : "-"}${double.tryParse(userBill[position].number ?? "0").toInt().toString()}",
style: TextStyle(
color: Color(0xFF727272),
fontSize: 12.sp,
color: Color(0xFF4D4D4D),
fontSize: 14.sp,
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.regular),
),
)
],
),
)
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Image.asset(
// "assets/image/icon_intergral_sign.webp",
// width: 36.w,
// height: 34.h,
// ),
// SizedBox(
// width: 15,
// ),
// Expanded(
// child: Container(
// // height: 34.h,
// alignment: Alignment.centerLeft,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// userBill[position].type ?? "",
// // S.of(context).qiandao,
// style: TextStyle(
// color: Colors.black,
// fontSize: 12.sp,
// fontWeight: FontWeight.w400),
// ),
// Text(
// userBill[position].createTime ?? "",
// style: TextStyle(
// color: Color(0xFF727272),
// fontSize: 10.sp,
// fontWeight: MyFontWeight.regular),
// )
// ],
// ),
// )),
// Container(
// margin: EdgeInsets.only(top: 2.h),
// child: Text(
// "${tabController.index == 0 ? "+" : "-"}${double.tryParse(userBill[position].number ?? "0").toInt().toString()}",
// style: TextStyle(
// color: Color(0xFF727272),
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular),
// ),
// )
// ],
// ),
);
}),
),

2
lib/integral/integral_page.dart

@ -124,7 +124,7 @@ class _IntegralPage extends State<IntegralPage> {
margin: EdgeInsets.only(right: 16.w),
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/integral_detailed_page');
Navigator.of(context).pushNamed('/router/integral_detailed_page',arguments:{"titleType":2});
},
child: Text(
S.of(context).mingxi,

1
lib/l10n/intl_en.arb

@ -742,6 +742,7 @@
"pingtaizhifumima":"平台支付密码",
"xiugai":"修改",
"bangdingshouji":"绑定手机",
"genggaibangdingshoujihao":"更改绑定手机号",

1
lib/l10n/intl_en_US.arb

@ -743,6 +743,7 @@
"pingtaizhifumima":"Platform payment password",
"xiugai":"modify",
"bangdingshouji":"bind phone",
"genggaibangdingshoujihao":"modify bind phone",

1
lib/l10n/intl_zh_CN.arb

@ -743,6 +743,7 @@
"pingtaizhifumima":"平台支付密码",
"xiugai":"修改",
"bangdingshouji":"绑定手机",
"genggaibangdingshoujihao":"更改绑定手机号",

1
lib/l10n/intl_zh_Hans_CN.arb

@ -743,6 +743,7 @@
"pingtaizhifumima":"平台支付密码",
"xiugai":"修改",
"bangdingshouji":"绑定手机",
"genggaibangdingshoujihao":"更改绑定手机号",

1
lib/l10n/intl_zh_Hant_CN.arb

@ -734,6 +734,7 @@
"pingtaizhifumima":"平臺支付密碼",
"xiugai":"修改",
"bangdingshouji":"綁定手機",
"genggaibangdingshoujihao":"更改綁定手機號",

1
lib/l10n/intl_zh_TW.arb

@ -736,6 +736,7 @@
"pingtaizhifumima":"平臺支付密碼",
"xiugai":"修改",
"bangdingshouji":"綁定手機",
"genggaibangdingshoujihao":"更改綁定手機號",

5
lib/main.dart

@ -95,6 +95,7 @@ import 'home/guide_page.dart';
import 'home/help_farmers/help_farmers_page.dart';
import 'home/home_view/activity_list.dart';
import 'home/start_page.dart';
import 'home/trading_card_page.dart';
import 'home/welfare_exchange.dart';
import 'home/welfare_page.dart';
import 'login/login_store_select.dart';
@ -310,7 +311,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/settlement': (context, {arguments}) =>
Settlement(arguments: arguments),
'/router/integral_detailed_page': (context, {arguments}) =>
IntegralDetailedPage(),
IntegralDetailedPage(arguments:arguments),
'/router/write_off_success_page': (context, {arguments}) =>
WriteOffSuccessPage(),
'/router/exchange_history_page': (context, {arguments}) =>
@ -437,4 +438,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
LoginStoreSelect(arguments:arguments),
'/router/binding_phone_page': (context, {arguments}) =>
BindingPhonePage(arguments:arguments),
'/router/trading_card_page': (context, {arguments}) =>
TradingCardPage(),
};

58
lib/mine/mine_page.dart

@ -5,6 +5,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart';
import 'package:huixiang/mine/mine_view/mine_calendar.dart';
@ -427,24 +428,57 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
///广
Widget spreadImage() {
return Container(
margin: EdgeInsets.only(right: 14.w, bottom: 30.h, left: 14.w),
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/invite_friends');
},
child: ClipRRect(
child: Image.asset(
"assets/image/welfare_spread.webp",
width: double.infinity,
fit: BoxFit.fill,
height: 80.h,
margin: EdgeInsets.only(bottom: 30.h,),
width: double.infinity,
height: 85.h,
child: Swiper(
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 5.h),
builder: DotSwiperPaginationBuilder(
size: 8.w,
activeSize: 8.w,
space: 5.w,
activeColor: Colors.white,
color: Colors.white.withAlpha(76),
),
borderRadius: BorderRadius.circular(6.w),
),
autoplay:true,
duration: 1000,
autoplayDelay: 2000,
itemBuilder: (context, position) {
return GestureDetector(
onTap: (){
if(position == 0){
Navigator.of(context).pushNamed('/router/invite_friends');
}else if(position == 1){
Navigator.of(context).pushNamed('/router/trading_card_page');
}
},
child:Container(
margin: EdgeInsets.symmetric(horizontal:14.w),
child: ClipRRect(
child:Image.asset(
spreadItem[position],
width:double.infinity,
fit: BoxFit.fill,
height:double.infinity,
),
borderRadius: BorderRadius.circular(6.w),
),
),
);
},
itemCount:2,
),
);
}
final List<String> spreadItem = [
"assets/image/welfare_spread.webp",
"assets/image/welfare_yz.webp",
];
///
Widget buildNotice() {
return Container(

255
lib/mine/mine_vip/mine_vip_core.dart

@ -25,6 +25,8 @@ import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/vip_dialog.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../retrofit/data/user_info.dart';
class MineVipCore extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -42,27 +44,29 @@ class _MineVipCore extends State<MineVipCore> {
List<VipBenefitList> vipBenefitList = [];
VipRuleDetails vipRuleDetails;
int checkIndex = 0;
UserInfo userInfo;
int rankNameIndex;
final SwiperController controller = SwiperController();
@override
void initState() {
super.initState();
userInfo = widget.arguments["userInfo"];
SharedPreferences.getInstance().then((value) {
if (widget.arguments["rankLevel"] == 1 &&
!(value.getBool("FirstYinKa") ?? false)) {
showAlertDialog("银卡会员");
value.setBool("FirstYinKa", true);
} else if (widget.arguments["rankLevel"] == 2 &&
!(value.getBool("FirstJinKa") ?? false)) {
showAlertDialog("金卡会员");
value.setBool("FirstJinKa", true);
} else if (widget.arguments["rankLevel"] == 3 &&
!(value.getBool("FirstGongC") ?? false)) {
showAlertDialog("共创会员");
value.setBool("FirstGongC", true);
}
// if (widget.arguments["rankLevel"] == 1 &&
// !(value.getBool("FirstYinKa") ?? false)) {
// showAlertDialog("银卡会员");
// value.setBool("FirstYinKa", true);
// } else if (widget.arguments["rankLevel"] == 2 &&
// !(value.getBool("FirstJinKa") ?? false)) {
// showAlertDialog("金卡会员");
// value.setBool("FirstJinKa", true);
// } else if (widget.arguments["rankLevel"] == 3 &&
// !(value.getBool("FirstGongC") ?? false)) {
// showAlertDialog("共创会员");
// value.setBool("FirstGongC", true);
// }
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
queryVipLevel();
@ -82,17 +86,36 @@ class _MineVipCore extends State<MineVipCore> {
});
}
String levelTipsName(int position){
if(userInfo.memberRankVo.rankName == ranks[position].rankName)
return S.of(context).dangqiandengji;
else {
int userLevelIndex = ranks.indexWhere((element) => element.rankName == userInfo.memberRankVo.rankName);
if(userLevelIndex+1 == position)
return "下一等级";
else if(userLevelIndex-1 > position)
return "已达到";
else if(userLevelIndex-1 == position)
return "上一等级";
else
return S.of(context).zanweikaitong;
}
}
///
queryVipLevel() async {
BaseData<List<Rank>> rankData = await apiService.rankList().catchError((onError) {});
if (rankData != null && rankData.isSuccess) {
ranks.clear();
ranks.addAll(rankData.data);
rankNameIndex = ranks.indexWhere((element) => element.rankName == userInfo.memberRankVo.rankName);
if(rankNameIndex != -1)
checkIndex = rankNameIndex;
setState(() {
controller.move((widget.arguments["rankLevel"] - 1), animation: false);
});
} else {
SmartDialog.showToast(rankData.msg, alignment: Alignment.center);
SmartDialog.showToast(rankData?.msg??"", alignment: Alignment.center);
}
}
@ -214,7 +237,7 @@ class _MineVipCore extends State<MineVipCore> {
),
)),
),
if(widget?.arguments["userInfo"] != null)
if(userInfo.masterCardRankName != null)
Container(
alignment: Alignment.center,
margin: EdgeInsets.only(right: 16.w),
@ -223,7 +246,7 @@ class _MineVipCore extends State<MineVipCore> {
// Navigator.of(context).pushNamed('/router/integral_detailed_page');
},
child: Text(
"${S.of(context).dangqianzhukadengji} : ${widget?.arguments["userInfo"]??""}",
"${S.of(context).dangqianzhukadengji} : ${userInfo.masterCardRankName??""}",
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
@ -250,6 +273,7 @@ class _MineVipCore extends State<MineVipCore> {
viewportFraction: 0.95,
loop: false,
physics: BouncingScrollPhysics(),
index: checkIndex,
controller: controller,
onIndexChanged: (index) {
setState(() {
@ -257,28 +281,29 @@ class _MineVipCore extends State<MineVipCore> {
});
},
itemBuilder: (context, position) {
return 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,
);
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,
@ -286,6 +311,7 @@ class _MineVipCore extends State<MineVipCore> {
),
///
if(vipBenefitList != null)
Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
@ -337,6 +363,7 @@ class _MineVipCore extends State<MineVipCore> {
),
///
if(vipRuleDetails != null)
Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
@ -402,6 +429,7 @@ class _MineVipCore extends State<MineVipCore> {
),
///
if(vipRuleDetails != null)
Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
@ -462,6 +490,7 @@ class _MineVipCore extends State<MineVipCore> {
),
///
if(vipRuleDetails != null)
Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
decoration: BoxDecoration(
@ -560,7 +589,6 @@ class _MineVipCore extends State<MineVipCore> {
]),
),
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(16),
height: 54.h,
alignment: Alignment.center,
child: Text(
@ -580,7 +608,7 @@ class _MineVipCore extends State<MineVipCore> {
);
}
Widget vipCar(){
Widget vipCar(int position){
return Container(
margin:EdgeInsets.fromLTRB(16.w, 16.h, 8.w, 8.h),
width: MediaQuery.of(context).size.width - 32.w,
@ -588,7 +616,15 @@ class _MineVipCore extends State<MineVipCore> {
2.11 *
AppUtils.textScale(context)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
gradient: LinearGradient(
colors: [
AppUtils.getLighterColor(ranks[position]?.color ?? ""),
Color(int.parse((ranks[position]?.color ?? "").replaceAll("#", "FF"), radix: 16)),
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius:BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
@ -601,46 +637,6 @@ class _MineVipCore extends State<MineVipCore> {
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h),
// decoration: BoxDecoration(
// color: levelColor,
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(8),
// bottomRight: Radius.circular(8),
// ),
// ),
// child: Text(
// topLeft,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Colors.white,
// ),
// ),
// ),
// Container(
// padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h),
// margin: EdgeInsets.only(top: 10,right: 10),
// decoration: BoxDecoration(
// color: levelColor,
// borderRadius: BorderRadius.circular(10),
// ),
// child: Text(
// S.of(context).chakanquanyi,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFFF5EEE9),
// ),
// ),
// )
// ],
// ),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
@ -654,27 +650,26 @@ class _MineVipCore extends State<MineVipCore> {
Container(
padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h),
decoration: BoxDecoration(
color: Colors.red,
color: Color(int.parse((ranks[position]?.color ?? "").replaceAll("#", "FF"), radix: 16)),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomRight: Radius.circular(8),
),
),
child: Text(
"111",
child: Text(levelTipsName(position),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.white,
color: Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)),
),
),
),
Container(
margin: EdgeInsets.only(left: 13.w),
child: Text(
"hhh",
"VIP ${ranks[position].rankName ?? ""}",
style: TextStyle(
color: Colors.grey,
color: Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)),
fontWeight: MyFontWeight.semi_bold,
fontSize:22.sp,
),
@ -702,61 +697,97 @@ class _MineVipCore extends State<MineVipCore> {
bottom: 12.h,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisAlignment:
(userInfo?.memberRankVo?.rankName != ranks[position].rankName || (userInfo?.memberRankVo?.rankName == "共创会员" && ranks[position].rankName == "共创会员"))?
MainAxisAlignment.spaceAround:
MainAxisAlignment.end,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
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(),
overflow: TextOverflow.ellipsis,
style: TextStyle(
color:Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)),
fontWeight: ranks[position].rankName == "共创会员" ? MyFontWeight.regular : MyFontWeight.bold,
fontSize: ranks[position].rankName == "共创会员" ? 14.sp : 20.sp,
),
),),
if(userInfo?.memberRankVo?.rankName == ranks[position].rankName && (userInfo?.memberRankVo?.rankName != "共创会员" && ranks[position].rankName != "共创会员"))
Padding(padding:EdgeInsets.only(bottom: 12.h),
child: Row(
children: [
Expanded(
child: Text(
"消费¥",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.black,
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
Expanded(child:
Text(
"消费满 ¥${userInfo.memberRankVo.nextOrigin ?? "0"} 升级为 ${userInfo?.memberRankVo?.nextName ?? ""}",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color:Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)),
fontWeight:MyFontWeight.regular,
fontSize: 14.sp,
),
flex: 1,
)
),
Text.rich(
TextSpan(
children: [
TextSpan(
text:"555",
text:"${AppUtils.calculateDouble(double.tryParse(userInfo.expendAmount??"0"))}",
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.semi_bold,
fontSize: 26.sp,
fontWeight: MyFontWeight.medium,
color: Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)),
),
),
TextSpan(
text: "/${userInfo.memberRankVo.nextOrigin ?? "0"}",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)),
),
),
],
),
),
],
),
// if (isUserVip)
Expanded(child: Row(
),),
// 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,
children: [
Text(
S.of(context).kaitongriqi(
"2021-01-01"
(widget.arguments["createTime"] != null && widget.arguments["createTime"] != "")
? widget.arguments["createTime"].split(" ")[0]
: widget.arguments["createTime"]
),
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16))
),
),
Icon(
Icons.qr_code,
size: 24,
color: Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)),
),
],
),),
),
],
),
),

20
lib/retrofit/data/rank.dart

@ -22,6 +22,10 @@ class Rank {
bool _status;
String _updateTime;
String _updateUser;
String _color;
String _textColor;
int _originScore;
int _demotionScore;
String get createTime => _createTime;
String get createUser => _createUser;
@ -35,6 +39,10 @@ class Rank {
bool get status => _status;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get color => _color;
String get textColor => _textColor;
int get originScore => _originScore;
int get demotionScore => _demotionScore;
Rank({
String createTime,
@ -60,6 +68,10 @@ class Rank {
_status = status;
_updateTime = updateTime;
_updateUser = updateUser;
_color = color;
_textColor = textColor;
_originScore = originScore;
_demotionScore = demotionScore;
}
Rank.fromJson(dynamic json) {
@ -75,6 +87,10 @@ class Rank {
_status = json["status"];
_updateTime = json["updateTime"];
_updateUser = json["updateUser"];
_color = json["color"];
_textColor = json["textColor"];
_originScore = json["originScore"];
_demotionScore = json["demotionScore"];
}
Map<String, dynamic> toJson() {
@ -91,6 +107,10 @@ class Rank {
map["status"] = _status;
map["updateTime"] = _updateTime;
map["updateUser"] = _updateUser;
map["color"] = _color;
map["textColor"] = _textColor;
map["originScore"] = _originScore;
map["demotionScore"] = _demotionScore;
return map;
}

3
lib/retrofit/data/user_info.dart

@ -50,6 +50,7 @@ class UserInfo {
String background;
bool hasPayPassword;
String happyBean;
bool isVip;
factory UserInfo.fromJson(Map<String, dynamic> json) =>
UserInfo()
@ -83,6 +84,7 @@ class UserInfo {
..background = json['background'] as String
..hasPayPassword = json['hasPayPassword'] as bool
..happyBean = json['happyBean'] as String
..isVip = json['isVip'] as bool
..memberRankVo = json['memberRankVo'] == null
? null
: MemberRank.fromJson(json['memberRankVo'] as Map<String, dynamic>);
@ -118,6 +120,7 @@ class UserInfo {
'background' : this.background,
'hasPayPassword' : this.hasPayPassword,
'happyBean':this.happyBean,
'isVip':this.isVip,
'memberRankVo': this.memberRankVo == null ? "" : this.memberRankVo.toJson(),
};
}

2
lib/retrofit/min_api.dart

@ -27,7 +27,7 @@ import 'data/shopping_home_config.dart';
part 'min_api.g.dart';
const localBaseUrl = "http://192.168.10.78:8765/app/";///
// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///
// const localBaseUrl = "http://pos-test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线

2
lib/retrofit/retrofit_api.dart

@ -67,7 +67,7 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart';
const localBaseUrl = "http://192.168.10.78:8766/app/";///
// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///
// const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线
@RestApi(baseUrl: localBaseUrl)

3
lib/setting/binding_phone_page.dart

@ -10,7 +10,6 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
@ -182,7 +181,7 @@ class _BindingPhonePage extends State<BindingPhonePage> {
Navigator.of(context).pop();
}),
title: Text(
"更换绑定手机号",
S.of(context).genggaibangdingshoujihao,
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 17.sp,

35
lib/settlement/settlement.dart

@ -1275,15 +1275,16 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
(settleOrderInfo.isRaise || payChannel == 5)
? "NONE"
: ((useVipPriceSelect == false &&
couponListBean?.id != "" &&
((promotion?.id ?? productId) != ""))
? "MEMBER_RANK"
: (isVips == false && vipLevelName == "黄金会员")
? "MEMBER_RANK"
: "AUTO"),
// (settleOrderInfo.isRaise || payChannel == 5)
// ? "NONE"
// : ((useVipPriceSelect == false &&
// couponListBean?.id != "" &&
// ((promotion?.id ?? productId) != ""))
// ? "MEMBER_RANK"
// : (isVips == false && vipLevelName == "黄金会员")
// ? "MEMBER_RANK"
// : "AUTO"),
preferentialType(),
// (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? false :useVipPriceSelect,
// (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false)) || useVipPriceSelect == true) ? false :useBenefitSelect,
count1,
@ -1292,6 +1293,22 @@ class _Settlement extends State<Settlement> {
}
}
String preferentialType(){
if(settleOrderInfo.isRaise || payChannel == 5)
return "NONE";
if((((promotion?.id ?? productId) ?? "") != "")){
return "ACTIVITY";
}else if((couponListBean?.id ?? "") != ""){
return "COUPON";
}else if(useVipPriceSelect == true && couponListBean?.id == "" && ((promotion?.id ?? productId) == "")){
return "VIP";
}if(useVipPriceSelect == false && couponListBean?.id == "" && ((promotion?.id ?? productId) == "")){
return "MEMBER_RANK";
}else {
return "AUTO";
}
}
vipPriceSelect(bool useVipPriceSelect) {
this.useVipPriceSelect = useVipPriceSelect;
if (tableId > 0) {

4
lib/store/store_order.dart

@ -657,8 +657,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
"shoppingCart": shopCarGoods,
"numberOfPeople": numberOfPeople,
"distance": widget.arguments["distance"],
"vipLevelName": memberVo.memberRankVo.rankName,
"isVips": memberVo.isVip,
"vipLevelName": memberVo?.memberRankVo?.rankName ??"",
"isVips": memberVo?.isVip ?? false,
"distance": widget.arguments["distance"],
"subscribeParam": miNiDetail?.subscribeParam,
},

8
lib/utils/flutter_utils.dart

@ -31,12 +31,12 @@ class AppUtils {
///使16
static Color getLighterColor(String hexColor) {
// 16Color对象
Color color = Color(int.parse(hexColor.replaceAll("#", ""), radix: 16));
Color color = Color(int.parse(hexColor.replaceAll("#", "FF"), radix: 16));
// RGB值
int red = color.red + 39;
int green = color.green + 52;
int blue = color.blue + 86;
int red = color.red + 95;
int green = color.green + 95;
int blue = color.blue + 95;
// RGB值不超过255
red = red > 255 ? 255 : red;

469
lib/view_widget/mine_vip_entry.dart

@ -39,206 +39,315 @@ class MineVipEntry extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (userInfo != null &&
userInfo.memberRankVo != null &&
ranks != null &&
ranks.length > 0) {
curLevel = (ranks.indexWhere((element) => element.id == userInfo.memberRankVo.id) + 1);
vipLevel = curLevel;
}
userInfo.memberRankVo != null &&
ranks != null &&
ranks.length > 0) {
curLevel = (ranks
.indexWhere((element) => element.id == userInfo.memberRankVo.id) +
1);
vipLevel = curLevel;
}
if (curLevel == vipLevel) {
topLeft = S.of(context).dangqiandengji;
} else if (vipLevel < curLevel) {
topLeft = S.of(context).shangyidengji;
} else {
topLeft = S.of(context).zanweikaitong;
}
if (curLevel == vipLevel) {
topLeft = S.of(context).dangqiandengji;
} else if (vipLevel < curLevel) {
topLeft = S.of(context).shangyidengji;
} else {
topLeft = S.of(context).zanweikaitong;
}
switch (vipLevel) {
case 1:
case 2:
{
levelText = "${S.of(context).yinkahuiyuan}";
logoColor = Color(0xFFA0C4E7);
levelTextColor = Color(0xFF61ABF3);
levelTextBackdrop = Color(0xFFC1DBF4);
levelText = ranks[1].rankName;
logoColor = Color(int.parse(
(ranks[1].textColor ?? "").replaceAll("#", "FF"),
radix: 16));
levelTextColor = Color(int.parse(
(ranks[1].textColor ?? "").replaceAll("#", "FF"),
radix: 16));
levelTextBackdrop = Color(int.parse(
(ranks[1].color ?? "").replaceAll("#", "FF"),
radix: 16));
break;
}
case 2:
case 3:
{
levelText = "${S.of(context).jinkahuiyuan}";
logoColor = Color(0xFFFBB43A);
levelTextColor = Color(0xFFFBB43A);
levelTextBackdrop = Color(0xFFFFECD2);
levelText = ranks[2].rankName;
logoColor = Color(int.parse(
(ranks[2].textColor ?? "").replaceAll("#", "FF"),
radix: 16));
levelTextColor = Color(int.parse(
(ranks[2].textColor ?? "").replaceAll("#", "FF"),
radix: 16));
levelTextBackdrop = Color(int.parse(
(ranks[2].color ?? "").replaceAll("#", "FF"),
radix: 16));
break;
}
case 3:
case 4:
{
levelText = ranks[3].rankName;
logoColor = Color(int.parse(
(ranks[3].textColor ?? "").replaceAll("#", "FF"),
radix: 16));
levelTextColor = Color(int.parse(
(ranks[3].textColor ?? "").replaceAll("#", "FF"),
radix: 16));
levelTextBackdrop = Color(int.parse(
(ranks[3].color ?? "").replaceAll("#", "FF"),
radix: 16));
break;
}
case 5:
{
levelText = "${S.of(context).gongchuanghuiyuan}";
logoColor = Color(0xFF352822);
levelTextColor = Color(0xFF92755D);
levelTextBackdrop = Color(0xFFFFECD2);
levelText = ranks[4].rankName;
logoColor = Color(int.parse(
(ranks[4].textColor ?? "").replaceAll("#", "FF"),
radix: 16));
levelTextColor = Color(int.parse(
(ranks[4].textColor ?? "").replaceAll("#", "FF"),
radix: 16));
levelTextBackdrop = Color(int.parse(
(ranks[4].color ?? "").replaceAll("#", "FF"),
radix: 16));
break;
}
}
Widget widget = Container(
height:20.h,
width: double.infinity,
child: Row(
children: [
Container(
height: double.infinity,
padding: EdgeInsets.symmetric(horizontal:3.w,vertical:4.h),
decoration: BoxDecoration(
color: logoColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(4),
bottomLeft: Radius.circular(4),),
boxShadow: [
BoxShadow(
color: Color(0x08213303).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
),
],
),
child: Image.asset(
"assets/image/mine_vip_logo.webp",
fit: BoxFit.cover,
// width: 13.w,
// height: 11.h,
),
),
Container(
height: double.infinity,
padding: EdgeInsets.symmetric(horizontal:3.w,vertical:3.h),
decoration: BoxDecoration(
color: levelTextBackdrop,
borderRadius: BorderRadius.only(
topRight: Radius.circular(4),
bottomRight: Radius.circular(4),),
boxShadow: [
BoxShadow(
color: Color(0x08213303).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
Widget widget = userInfo.memberRankVo.rankName != null
? Container(
height: 20.h,
width: double.infinity,
child: Row(
children: [
Container(
height: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 4.h),
decoration: BoxDecoration(
color: logoColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(4),
bottomLeft: Radius.circular(4),
),
boxShadow: [
BoxShadow(
color: Color(0x08213303).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
),
],
),
child: Image.asset(
"assets/image/mine_vip_logo.webp",
fit: BoxFit.cover,
// width: 13.w,
// height: 11.h,
),
),
Container(
height: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 3.h),
decoration: BoxDecoration(
color: levelTextBackdrop,
borderRadius: BorderRadius.only(
topRight: Radius.circular(4),
bottomRight: Radius.circular(4),
),
boxShadow: [
BoxShadow(
color: Color(0x08213303).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
),
],
),
child: Row(
children: [
Text(
levelText,
textAlign: TextAlign.center,
style: TextStyle(
color: levelTextColor,
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
Image.asset(
"assets/image/icon_right.webp",
fit: BoxFit.cover,
width: 8,
height: 8,
color: levelTextColor,
),
],
),
)
],
),
child:Row(
)
: Container(
height: 20.h,
width: double.infinity,
child: Row(
children: [
Text(
levelText,
textAlign: TextAlign.center,
style: TextStyle(
color: levelTextColor,
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
Container(
height: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 4.h),
decoration: BoxDecoration(
color: Color(0xFFCACACA),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(4),
bottomLeft: Radius.circular(4),
),
boxShadow: [
BoxShadow(
color: Color(0x08213303).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
),
],
),
child: Image.asset(
"assets/image/mine_vip_logo.webp",
fit: BoxFit.cover,
// width: 13.w,
// height: 11.h,
),
),
Image.asset(
"assets/image/icon_right.webp",
fit: BoxFit.cover,
width: 8,
height: 8,
color: levelTextColor,
),
Container(
height: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 3.h),
decoration: BoxDecoration(
color: Color(0xFFFFF8EC),
borderRadius: BorderRadius.only(
topRight: Radius.circular(4),
bottomRight: Radius.circular(4),
),
boxShadow: [
BoxShadow(
color: Color(0x08213303).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
),
],
),
child: Row(
children: [
Text(
"开通会员",
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFFCACACA),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
Image.asset(
"assets/image/icon_right.webp",
fit: BoxFit.cover,
width: 8,
height: 8,
color: Color(0xFFCACACA),
),
],
),
)
],
),
)
],
),
);
// Container(
// width: double.infinity,
// padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w),
// margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h),
// decoration: BoxDecoration(
// color: Color(0xFF3D3D5D),
// borderRadius: BorderRadius.circular(6),
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// )
// ],
// ),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// children: [
// Image.asset(
// "assets/image/vip_logo.webp",
// width: 24,
// height: 24,
// ),
// SizedBox(
// width: 5.w,
// ),
// Expanded(
// child: Text(
// levelText,
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFFFFEAD2)),
// )),
// Container(
// padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h),
// decoration: BoxDecoration(
// color: Color(0xFFFFECD2),
// borderRadius: BorderRadius.circular(10),
// ),
// child: Text(
// S.of(context).chakanquanyi,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFF92755D),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 16.h,
// ),
// Container(
// height: 4.h,
// child: ClipRRect(
// borderRadius: BorderRadius.circular(6.5),
// child: LinearProgressIndicator(
// value: rankMax > (rank ?? 0)
// ? ((vipLevel < curLevel)
// ? rankMax / rankMax
// : (rank ?? 0) / rankMax)
// : 0,
// backgroundColor: Color(0xFF222233),
// color: Color(0xFFFFECD2),
// ),
// ),
// ),
// SizedBox(
// height: 8.h,
// ),
// Text(
// rank > rankMax
// ? S.of(context).dangqiandengji
// : "消费金额¥${rank.toStringAsFixed(2).toString()}${S.of(context).xiayidengji}还需¥${(rankMax - (rank ?? 0)).toStringAsFixed(2)}",
// style: TextStyle(
// color: Color(0xFFFFEAD2),
// fontWeight: MyFontWeight.light,
// fontFamily: 'JDZhengHT',
// fontSize: 14.sp,
// ),
// )
// ],
// ));
);
// Container(
// width: double.infinity,
// padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w),
// margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h),
// decoration: BoxDecoration(
// color: Color(0xFF3D3D5D),
// borderRadius: BorderRadius.circular(6),
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// )
// ],
// ),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// children: [
// Image.asset(
// "assets/image/vip_logo.webp",
// width: 24,
// height: 24,
// ),
// SizedBox(
// width: 5.w,
// ),
// Expanded(
// child: Text(
// levelText,
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFFFFEAD2)),
// )),
// Container(
// padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h),
// decoration: BoxDecoration(
// color: Color(0xFFFFECD2),
// borderRadius: BorderRadius.circular(10),
// ),
// child: Text(
// S.of(context).chakanquanyi,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFF92755D),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 16.h,
// ),
// Container(
// height: 4.h,
// child: ClipRRect(
// borderRadius: BorderRadius.circular(6.5),
// child: LinearProgressIndicator(
// value: rankMax > (rank ?? 0)
// ? ((vipLevel < curLevel)
// ? rankMax / rankMax
// : (rank ?? 0) / rankMax)
// : 0,
// backgroundColor: Color(0xFF222233),
// color: Color(0xFFFFECD2),
// ),
// ),
// ),
// SizedBox(
// height: 8.h,
// ),
// Text(
// rank > rankMax
// ? S.of(context).dangqiandengji
// : "消费金额¥${rank.toStringAsFixed(2).toString()}${S.of(context).xiayidengji}还需¥${(rankMax - (rank ?? 0)).toStringAsFixed(2)}",
// style: TextStyle(
// color: Color(0xFFFFEAD2),
// fontWeight: MyFontWeight.light,
// fontFamily: 'JDZhengHT',
// fontSize: 14.sp,
// ),
// )
// ],
// ));
return GestureDetector(
onTap: () {
@ -258,7 +367,7 @@ class MineVipEntry extends StatelessWidget {
Navigator.of(context)
.pushNamed('/router/mine_vip_core', arguments: {
"rankLevel": curLevel,
"userInfo": userInfo.masterCardRankName,
"userInfo": userInfo,
"createTime": (userInfo != null) ? "${userInfo.createTime}" : "",
"expendAmount":
double.tryParse(userInfo?.expendAmount ?? "0").toInt(),

133
lib/vip/vip_page.dart

@ -11,9 +11,12 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../generated/l10n.dart';
import '../retrofit/data/base_data.dart';
import '../retrofit/data/user_info.dart';
import '../retrofit/retrofit_api.dart';
import '../utils/flutter_utils.dart';
import '../utils/font_weight.dart';
import '../view_widget/my_appbar.dart';
@ -30,6 +33,7 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
final RefreshController _refreshController = RefreshController();
ApiService apiService;
VipCardHome vipHome;
UserInfo userInfo;
@override
@ -41,9 +45,41 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
@override
void initState() {
super.initState();
queryVipHome();
// queryVipHome();
queryUserBalance();
}
///
queryUserBalance() async {
try{
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
}
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {
_refreshController.refreshFailed();
_refreshController.loadFailed();});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
if (mounted) setState(() {});
_refreshController.refreshCompleted();
_refreshController.loadComplete();
}else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
_refreshController.refreshFailed();
_refreshController.loadFailed();
}
}finally{
setState((){});
}
}
///Vip季卡
queryVipHome() async {
try{
if (apiService == null) {
@ -68,6 +104,8 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
_refreshController.loadComplete();
}else{
SmartDialog.showToast(baseData.msg ?? "", alignment: Alignment.center);
_refreshController.loadFailed();
_refreshController.refreshFailed();
}
}finally{
setState((){});
@ -88,7 +126,7 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
queryVipHome();
queryUserBalance();
},
child: SingleChildScrollView(
child: Container(
@ -96,14 +134,16 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VipTop(vipHome,(){
queryVipHome();
}),
VipTop(vipHome,
// (){queryVipHome();}
),
// if(vipHome !=null)
// VipGoodsDiscount(vipHome),
if(vipHome !=null)
VipGoodsDiscount(vipHome),
ExclusiveCoupon(userInfo),
ExclusiveCoupon(),
vipRule(),
SizedBox(height: 24.h,)
],
@ -115,6 +155,83 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
);
}
///
Widget vipRule(){
return Container(
margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom:40.h,top:8.h),
width: double.infinity,
padding: EdgeInsets.only(top:14.h, left:20.h, bottom:8.h, right:20.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.w),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Image.asset(
"assets/image/vip_title.webp",
fit: BoxFit.fill, //
height: 13.h,
width: 27.w,
),
SizedBox(
width: 4.w,
),
Text(
"会员卡说明",
style: TextStyle(
color: Colors.black,
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
SizedBox(height: 12.h,),
Padding(padding:EdgeInsets.symmetric(vertical: 12.h),
child:Text(
"1.仅限使用储值金额消费时享受VIP权益(使用优惠券及其他支付方式均不享受VIP权益);",
style: TextStyle(
color: Color(0xFF6A6A6A),
fontSize: 13.sp,
height: 1.5.h,
fontWeight: MyFontWeight.regular,
),
)),
Padding(padding:EdgeInsets.symmetric(vertical:6.h),
child:Text(
"2.储值余额不足时不享受VIP权益;",
style: TextStyle(
color: Color(0xFF6A6A6A),
fontSize: 13.sp,
height: 1.5.h,
fontWeight: MyFontWeight.regular,
),
)),
Padding(padding:EdgeInsets.symmetric(vertical: 12.h),
child:Text(
"3.2023年6月1日前储值余额不享受VIP价格;",
style: TextStyle(
color: Color(0xFF6A6A6A),
fontSize: 13.sp,
height: 1.5.h,
fontWeight: MyFontWeight.regular,
),
)),
],
),);
}
@override
bool get wantKeepAlive => true;
}

600
lib/vip/vip_view/exclusive_coupon.dart

@ -4,9 +4,13 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../generated/l10n.dart';
import '../../retrofit/data/user_info.dart';
import '../../view_widget/my_appbar.dart';
class ExclusiveCoupon extends StatefulWidget {
final UserInfo userInfo;
ExclusiveCoupon(this.userInfo);
@override
State<StatefulWidget> createState() {
return _ExclusiveCoupon();
@ -16,291 +20,351 @@ class ExclusiveCoupon extends StatefulWidget {
class _ExclusiveCoupon extends State<ExclusiveCoupon> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom: 40.h),
width: double.infinity,
padding:
EdgeInsets.only(top: 20.h, left: 20.h, bottom: 10.h, right: 20.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.w),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
SizedBox(
width: 7.w,
),
Image.asset(
"assets/image/vip_title.webp",
fit: BoxFit.fill, //
height: 13.h,
width: 27.w,
),
SizedBox(
width: 4.w,
return Column(
children: [
(widget?.userInfo?.isVip ?? false)
? Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/vip_discount_left.webp",
width: 21.w,
height: 39.h,
fit: BoxFit.fill,
),
SizedBox(
width: 11.w,
),
Text(
S.of(context).huixiangvipkazhuanxiang,
style: TextStyle(
color: Color(0xff32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
Text(
S.of(context).zhuanxiangyouhuiquan,
style: TextStyle(
color: Colors.black,
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
width: 11.w,
),
Image.asset(
"assets/image/vip_discount_right.webp",
width: 21.w,
height: 39.h,
fit: BoxFit.fill,
),
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/vip_lock.webp",
width: 20,
height: 20,
fit: BoxFit.cover,
),
SizedBox(
width: 2.w,
),
Text(
"解锁回乡VIP卡获取更多权益",
style: TextStyle(
color: Colors.black,
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
showAlertDialog();
},
child: Container(
padding: EdgeInsets.only(
left: 8.w, right: 30.w, top: 3.h, bottom: 3.h),
child: Image.asset(
"assets/image/vip_tips.webp",
),
],
),
Container(
margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom:16.h,top: 17.h),
width: double.infinity,
padding:
EdgeInsets.only(top: 20.h, left: 20.h, bottom: 10.h, right: 20.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.w),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
SizedBox(
width: 7.w,
),
Image.asset(
"assets/image/vip_title.webp",
fit: BoxFit.fill, //
height: 14,
width: 14,
height: 13.h,
width: 27.w,
),
),
SizedBox(
width: 4.w,
),
Text(
"会员卡专享",
style: TextStyle(
color: Colors.black,
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
// GestureDetector(
// behavior: HitTestBehavior.translucent,
// onTap: () {
// showAlertDialog();
// },
// child: Container(
// padding: EdgeInsets.only(
// left: 8.w, right: 30.w, top: 3.h, bottom: 3.h),
// child: Image.asset(
// "assets/image/vip_tips.webp",
// fit: BoxFit.fill, //
// height: 14,
// width: 14,
// ),
// ),
// ),
],
),
],
),
SizedBox(
height: 10.h,
),
Container(
height: 124.h,
margin: EdgeInsets.only(bottom: 16.h),
child: Stack(
children: [
Image.asset(
"assets/image/vip_shop_bj.webp",
fit: BoxFit.fill, //
height: double.infinity,
width: double.infinity,
),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Padding(
padding: EdgeInsets.only(top: 25.h, left: 19.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"海峡姐妹饮品券",
style: TextStyle(
color: Color(0xff32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 5.h,
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "6",
style: TextStyle(
fontWeight: MyFontWeight.extra_bold,
fontSize: 36.sp,
fontFamily: 'JDZhengHT',
color: Color(0xffFF7E12),
SizedBox(
height: 10.h,
),
Container(
height: 124.h,
margin: EdgeInsets.only(bottom: 16.h),
child: Stack(
children: [
Image.asset(
"assets/image/vip_shop_bj.webp",
fit: BoxFit.fill, //
height: double.infinity,
width: double.infinity,
),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Padding(
padding: EdgeInsets.only(top: 25.h, left: 19.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"海峡姐妹饮品券",
style: TextStyle(
color: Color(0xff32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 24.sp,
color: Color(0xffFF7E12),
fontWeight: MyFontWeight.semi_bold,
SizedBox(
height: 5.h,
),
),
],
),
textDirection: TextDirection.ltr,
),
],
),
)),
Image.asset(
"assets/image/vip_shop_hx.webp",
fit: BoxFit.fill, //
height: 85,
width: 85,
Text.rich(
TextSpan(
children: [
TextSpan(
text: "6",
style: TextStyle(
fontWeight: MyFontWeight.extra_bold,
fontSize: 36.sp,
fontFamily: 'JDZhengHT',
color: Color(0xffFF7E12),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 24.sp,
color: Color(0xffFF7E12),
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
textDirection: TextDirection.ltr,
),
],
),
)),
Image.asset(
"assets/image/vip_shop_hx.webp",
fit: BoxFit.fill, //
height: 85,
width: 85,
),
],
),
],
),
)
],
),
),
Container(
height: 124.h,
margin: EdgeInsets.only(bottom: 16.h),
child: Stack(
children: [
Image.asset(
"assets/image/vip_shop_bj.webp",
fit: BoxFit.fill, //
height: double.infinity,
width: double.infinity,
)
],
),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Padding(
padding: EdgeInsets.only(top: 25.h, left: 19.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"前进麦味烘焙券",
style: TextStyle(
color: Color(0xff32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 5.h,
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "7",
style: TextStyle(
fontWeight: MyFontWeight.extra_bold,
fontSize: 36.sp,
fontFamily: 'JDZhengHT',
color: Color(0xffFF7E12),
),
Container(
height: 124.h,
margin: EdgeInsets.only(bottom: 16.h),
child: Stack(
children: [
Image.asset(
"assets/image/vip_shop_bj.webp",
fit: BoxFit.fill, //
height: double.infinity,
width: double.infinity,
),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Padding(
padding: EdgeInsets.only(top: 25.h, left: 19.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"前进麦味烘焙券",
style: TextStyle(
color: Color(0xff32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 24.sp,
color: Color(0xffFF7E12),
fontWeight: MyFontWeight.semi_bold,
SizedBox(
height: 5.h,
),
),
],
),
textDirection: TextDirection.ltr,
),
],
),
)),
Image.asset(
"assets/image/vip_shop_qj.webp",
fit: BoxFit.fill, //
height: 85,
width: 85,
Text.rich(
TextSpan(
children: [
TextSpan(
text: "7",
style: TextStyle(
fontWeight: MyFontWeight.extra_bold,
fontSize: 36.sp,
fontFamily: 'JDZhengHT',
color: Color(0xffFF7E12),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 24.sp,
color: Color(0xffFF7E12),
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
textDirection: TextDirection.ltr,
),
],
),
)),
Image.asset(
"assets/image/vip_shop_qj.webp",
fit: BoxFit.fill, //
height: 85,
width: 85,
),
],
),
],
),
)
],
),
),
Container(
height: 124.h,
margin: EdgeInsets.only(bottom: 22.h),
child: Stack(
children: [
Image.asset(
"assets/image/vip_shop_bj.webp",
fit: BoxFit.fill, //
height: double.infinity,
width: double.infinity,
)
],
),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Padding(
padding: EdgeInsets.only(top: 25.h, left: 19.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"门店火锅券",
style: TextStyle(
color: Color(0xff32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 5.h,
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "8",
style: TextStyle(
fontWeight: MyFontWeight.extra_bold,
fontSize: 36.sp,
fontFamily: 'JDZhengHT',
color: Color(0xffFF7E12),
),
Container(
height: 124.h,
margin: EdgeInsets.only(bottom: 22.h),
child: Stack(
children: [
Image.asset(
"assets/image/vip_shop_bj.webp",
fit: BoxFit.fill, //
height: double.infinity,
width: double.infinity,
),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Padding(
padding: EdgeInsets.only(top: 25.h, left: 19.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"门店火锅券",
style: TextStyle(
color: Color(0xff32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 24.sp,
color: Color(0xffFF7E12),
fontWeight: MyFontWeight.semi_bold,
SizedBox(
height: 5.h,
),
),
],
),
textDirection: TextDirection.ltr,
),
],
),
)),
Image.asset(
"assets/image/vip_shop_hg.webp",
fit: BoxFit.fill, //
height: 85,
width: 85,
Text.rich(
TextSpan(
children: [
TextSpan(
text: "8",
style: TextStyle(
fontWeight: MyFontWeight.extra_bold,
fontSize: 36.sp,
fontFamily: 'JDZhengHT',
color: Color(0xffFF7E12),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 24.sp,
color: Color(0xffFF7E12),
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
textDirection: TextDirection.ltr,
),
],
),
)),
Image.asset(
"assets/image/vip_shop_hg.webp",
fit: BoxFit.fill, //
height: 85,
width: 85,
),
],
),
],
),
)
],
),
)
],
),
),
],
),
],
),
)
],
);
}

407
lib/vip/vip_view/vip_top.dart

@ -20,9 +20,9 @@ import 'package:tobias/tobias.dart' as tobias;
class VipTop extends StatefulWidget {
final VipCardHome vipCardHome;
final Function queryVipHome;
// final Function queryVipHome;
VipTop(this.vipCardHome, this.queryVipHome);
VipTop(this.vipCardHome);
@override
State<StatefulWidget> createState() {
@ -39,16 +39,16 @@ class _VipTop extends State<VipTop> {
@override
void initState() {
super.initState();
payListen = weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
if (event.errCode == 0) {
widget.queryVipHome();
SmartDialog.showToast("支付成功", alignment: Alignment.center);
} else {
SmartDialog.showToast("支付失败", alignment: Alignment.center);
return;
}
});
// payListen = weChatResponseEventHandler.listen((event) async {
// print("payCallback: ${event.errCode}");
// if (event.errCode == 0) {
// widget.queryVipHome();
// SmartDialog.showToast("支付成功", alignment: Alignment.center);
// } else {
// SmartDialog.showToast("支付失败", alignment: Alignment.center);
// return;
// }
// });
}
rechargeVIP() async {
@ -96,7 +96,7 @@ class _VipTop extends State<VipTop> {
tobias.aliPay(baseData.data["body"]).then((payRes) {
if (payRes['resultStatus'] == 9000 ||
payRes['resultStatus'] == '9000') {
widget.queryVipHome();
// widget.queryVipHome();
SmartDialog.showToast("支付成功",
alignment: Alignment.center);
} else {
@ -129,131 +129,132 @@ class _VipTop extends State<VipTop> {
child: Column(
children: [
vipCard(),
if(widget?.vipCardHome?.cards?.length != 0)
SizedBox(
height: 15.h,
),
(!(widget?.vipCardHome?.member?.isVip ?? false))
? (widget?.vipCardHome?.cards?.length == 0 ? Container():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),
),
),
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),
),
),
],
),
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,
)
],
),
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),
),
],
))),
)
],
),
),
// if(widget?.vipCardHome?.cards?.length != 0)
// SizedBox(
// height: 15.h,
// ),
// (!(widget?.vipCardHome?.member?.isVip ?? false))
// ? (widget?.vipCardHome?.cards?.length == 0 ? Container():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),
// ),
// ),
// 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),
// ),
// ),
// ],
// ),
// 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,
// )
// ],
// ),
// 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),
// ),
// ],
// ))),
// )
// ],
// ),
// ),
rechargeGuide(),
],
),
)
@ -261,6 +262,136 @@ class _VipTop extends State<VipTop> {
);
}
///
Widget rechargeGuide() {
return Container(
margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom:21.h,top:16.h),
width: double.infinity,
padding: EdgeInsets.only(top:14.h, left:12.h, bottom:8.h, right:14.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.w),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "充值",
style: TextStyle(
fontWeight: MyFontWeight.extra_bold,
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
color: Color(0xFF262626),
),
),
TextSpan(
text: "¥200以上",
style: TextStyle(
fontSize: 18.sp,
color: Color(0xffFF7E12),
fontWeight: MyFontWeight.semi_bold,
),
),
TextSpan(
text: "即开通回乡VIP卡",
style: TextStyle(
fontSize: 18.sp,
color: Color(0xFF262626),
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
textDirection: TextDirection.ltr,
),
Padding(
padding: EdgeInsets.only(top: 6.h, bottom: 10.h),
child: Text(
"享受多门店商品9.2折优惠价!",
style: TextStyle(
color: Color(0xFF32A060),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
)),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"*活动一切解释权归海峡姐妹品牌公司所有",
style: TextStyle(
color: Color(0xFF151515),
fontSize: 8.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
Navigator.of(context).pushNamed('/router/recharge_page');
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(100)),
border: Border.all(
width: 1.w,
color: Color(0xFF32A060),
style: BorderStyle.solid,
),
color: Color(0xFFFFFFFF),
),
padding: EdgeInsets.symmetric(vertical: 4.h,horizontal: 12.w),
child: Row(children: [
Text(
"去储值",
style: TextStyle(
color: Color(0xFF32A060),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
Image.asset(
"assets/image/icon_right.webp",
width:13,
fit: BoxFit.fill,
height:13,
color: Color(0xFF32A060),
)
]),
),
)
],
)
],
)),
SizedBox(width: 11.h,),
Padding(padding:EdgeInsets.only(top:4.h),
child: Image.asset(
"assets/image/vip_cz.webp",
fit: BoxFit.fill, //
height:50.w,
width: 54.h,
),)
],
),
);
}
///vip卡
Widget vipCard() {
return Container(

2
lib/web/web_view/comment_list.dart

@ -128,7 +128,7 @@ class CommentListState extends State<CommentList> {
);
},
),
if (memberList != null && memberList.length > 10)
// if (memberList != null && memberList.length > 10)
Container(
decoration: BoxDecoration(
color: Color(0xFFF2F2F2),

Loading…
Cancel
Save