After Width: | Height: | Size: 196 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 853 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 106 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 791 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 4.7 KiB |
@ -0,0 +1,199 @@
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/retrofit/data/address.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:shared_preferences/shared_preferences.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
class BindingAssistantCard extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _BindingAssistantCard(); |
||||
} |
||||
} |
||||
|
||||
class _BindingAssistantCard extends State<BindingAssistantCard> { |
||||
TextEditingController nameController = TextEditingController(); |
||||
TextEditingController mobileController = TextEditingController(); |
||||
TextEditingController addressController = TextEditingController(); |
||||
TextEditingController houseNumberController = TextEditingController(); |
||||
|
||||
ApiService apiService; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
|
||||
SharedPreferences.getInstance().then((value) => { |
||||
apiService = ApiService(Dio(), |
||||
context: context, token: value.getString('token')), |
||||
}); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
appBar: MyAppBar( |
||||
title: S.of(context).bangdingfuka, |
||||
titleColor: Colors.black, |
||||
leadingColor: Colors.black, |
||||
background: Colors.transparent, |
||||
), |
||||
body: Stack( |
||||
children: [ |
||||
Expanded( |
||||
child: Column( |
||||
children: [ |
||||
Container( |
||||
margin: EdgeInsets.only(bottom: 26.h), |
||||
padding: EdgeInsets.only(top: 16.h, bottom: 16.h), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
children: [ |
||||
Padding( |
||||
padding: EdgeInsets.only(left: 16, right: 16), |
||||
child: Text( |
||||
"进行副卡绑定", |
||||
style: TextStyle( |
||||
color: Colors.black, |
||||
fontWeight: MyFontWeight.medium, |
||||
fontSize: 21.sp, |
||||
), |
||||
), |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only( |
||||
left: 16, right: 16, top: 8, bottom: 32), |
||||
child: Text( |
||||
"主卡最多只能绑定5位副卡,只能解绑3次", |
||||
style: TextStyle( |
||||
color: Color(0xFFFF7A1A), |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
), |
||||
), |
||||
), |
||||
editItem( |
||||
S.of(context).fukashoujihao, |
||||
"", |
||||
S.of(context).qingshurushoujihao, |
||||
mobileController, |
||||
false), |
||||
Container( |
||||
margin: |
||||
EdgeInsets.symmetric(horizontal: 16, vertical: 5), |
||||
width: double.infinity, |
||||
height: 1, |
||||
color: Color(0xFFF4F4F4), |
||||
), |
||||
Row( |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
children: [ |
||||
Expanded( |
||||
child: InkWell( |
||||
onTap: () {}, |
||||
child: editItem( |
||||
"验证码", |
||||
"", |
||||
S.of(context).qingshuruyanzhengma, |
||||
addressController, |
||||
false), |
||||
)), |
||||
Padding( |
||||
padding: EdgeInsets.only(right: 16, top: 10), |
||||
child: GestureDetector( |
||||
onTap: () {}, |
||||
child: Text( |
||||
"发送验证", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: FontWeight.bold, |
||||
color: Color(0xFF32A060), |
||||
), |
||||
), |
||||
)), |
||||
], |
||||
), |
||||
Container( |
||||
margin: |
||||
EdgeInsets.symmetric(horizontal: 16, vertical: 5), |
||||
width: double.infinity, |
||||
height: 1, |
||||
color: Color(0xFFF4F4F4), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
Align( |
||||
alignment: Alignment.bottomCenter, |
||||
child: InkWell( |
||||
onTap: () { |
||||
|
||||
}, |
||||
child: Container( |
||||
color: Color(0xFF32A060), |
||||
width: MediaQuery.of(context).size.width, |
||||
padding: EdgeInsets.all(16), |
||||
height: 54, |
||||
alignment: Alignment.center, |
||||
child: Text( |
||||
S.of(context).querenbangding, |
||||
style: TextStyle( |
||||
fontWeight: FontWeight.bold, |
||||
fontSize: 16.sp, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
), |
||||
)), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget editItem(start, text, hide, controller, isClick) { |
||||
return Container( |
||||
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 5), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
children: [ |
||||
Text( |
||||
start, |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.bold, |
||||
color: Color(0xFF353535), |
||||
), |
||||
), |
||||
TextField( |
||||
controller: controller, |
||||
enabled: start != "地址", |
||||
keyboardType: |
||||
start == "电话" ? TextInputType.phone : TextInputType.text, |
||||
decoration: InputDecoration( |
||||
border: InputBorder.none, |
||||
hintText: hide, |
||||
hintStyle: TextStyle( |
||||
color: Color(0xFFA29E9E), |
||||
fontSize: 14.sp, |
||||
), |
||||
contentPadding: EdgeInsets.all(0), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,570 @@
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.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/retrofit/data/base_data.dart'; |
||||
import 'package:huixiang/retrofit/data/rank.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/utils/flutter_utils.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/border_text.dart'; |
||||
import 'package:huixiang/view_widget/mine_vip_view.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:huixiang/view_widget/round_button.dart'; |
||||
import 'package:shared_preferences/shared_preferences.dart'; |
||||
|
||||
class LegalRightDetails extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _LegalRightDetails(); |
||||
} |
||||
} |
||||
|
||||
class _LegalRightDetails extends State<LegalRightDetails> { |
||||
ApiService apiService; |
||||
|
||||
final SwiperController controller = SwiperController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
|
||||
SharedPreferences.getInstance().then((value) { |
||||
apiService = |
||||
ApiService(Dio(), context: context, token: value.getString("token")); |
||||
}); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
backgroundColor: Color(0xFF131416), |
||||
appBar: MyAppBar( |
||||
title: S.of(context).quanyixiangqing, |
||||
titleColor: Colors.white, |
||||
titleSize: 18.sp, |
||||
background: Colors.transparent, |
||||
leadingColor: Colors.white, |
||||
), |
||||
body: SingleChildScrollView( |
||||
physics: BouncingScrollPhysics(), |
||||
child: Column( |
||||
children: [ |
||||
Container( |
||||
height: 130, |
||||
margin: EdgeInsets.only(top: 24), |
||||
child: ListView.builder( |
||||
scrollDirection: Axis.horizontal, |
||||
physics: BouncingScrollPhysics(), |
||||
padding: EdgeInsets.symmetric(horizontal: 10), |
||||
itemCount: 15, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
setState(() {}); |
||||
}, |
||||
child: legalRightItem(), |
||||
); |
||||
}, |
||||
), |
||||
), |
||||
Container( |
||||
alignment: Alignment.center, |
||||
width: 33, |
||||
height: 16, |
||||
decoration: BoxDecoration( |
||||
border: Border( |
||||
bottom: BorderSide( |
||||
width: 0, |
||||
color: Color(0xFFFFF6E9), |
||||
), |
||||
), |
||||
), |
||||
child: Image.asset( |
||||
"assets/image/jian_j.png", |
||||
width: 33, |
||||
height: 16, |
||||
color: Color(0xFFFFF6E9), |
||||
fit: BoxFit.fill, |
||||
), |
||||
), |
||||
Container( |
||||
padding: EdgeInsets.only(left: 16, right: 49), |
||||
decoration: BoxDecoration( |
||||
border: Border.all( |
||||
width: 0, |
||||
color: Color(0xFFFFF6E9), |
||||
), |
||||
color: Color(0xFFFFF6E9), |
||||
borderRadius: new BorderRadius.only( |
||||
topLeft: Radius.circular(8.0), |
||||
topRight: Radius.circular(8.0), |
||||
), |
||||
), |
||||
child: SingleChildScrollView( |
||||
physics: BouncingScrollPhysics(), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
SizedBox( |
||||
height: 20, |
||||
), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Column( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.end, |
||||
children: [ |
||||
Container( |
||||
width: 13.w, |
||||
height: 2.h, |
||||
color: Color(0xFF674119), |
||||
), |
||||
SizedBox(height: 5.h), |
||||
Container( |
||||
width: 9.w, |
||||
height: 2.h, |
||||
color: Color(0xFF674119), |
||||
), |
||||
SizedBox(height: 5.h), |
||||
Container( |
||||
width: 6.5.w, |
||||
height: 2.h, |
||||
color: Color(0xFF674119), |
||||
), |
||||
], |
||||
), |
||||
SizedBox(width: 6.w), |
||||
Text( |
||||
"可绑定5位副卡", |
||||
style: TextStyle( |
||||
fontSize: 17.sp, |
||||
fontWeight: FontWeight.bold, |
||||
color: Color(0xFF674119), |
||||
), |
||||
), |
||||
SizedBox(width: 6.w), |
||||
Column( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Container( |
||||
width: 13.w, |
||||
height: 2.h, |
||||
color: Color(0xFF674119), |
||||
), |
||||
SizedBox(height: 5.h), |
||||
Container( |
||||
width: 9.w, |
||||
height: 2.h, |
||||
color: Color(0xFF674119), |
||||
), |
||||
SizedBox(height: 5.h), |
||||
Container( |
||||
width: 6.5.w, |
||||
height: 2.h, |
||||
color: Color(0xFF674119), |
||||
), |
||||
], |
||||
), |
||||
], |
||||
), |
||||
Text( |
||||
S.of(context).quanyijishao, |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF674119), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 8.h, |
||||
), |
||||
Text( |
||||
"用户在成为金卡会员/共创会员之后,即可进行副卡绑定。点击添加新副卡,输入需要绑定用户的手机号,输入验证码," |
||||
"验证通过后,即可绑定成功。点击头像右下方的解除,出现提示弹窗,点击确认即可解除绑定。", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
height: 1.5, |
||||
color: Color(0xFF674119), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 20, |
||||
), |
||||
Text( |
||||
S.of(context).quanyishuoming, |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF674119), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 8, |
||||
), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Container( |
||||
width: 6.w, |
||||
height: 6.h, |
||||
margin: EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h), |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(3), |
||||
color: Color(0xFF79572D), |
||||
), |
||||
), |
||||
Text( |
||||
"副卡用户必须为平台注册用户", |
||||
style: TextStyle( |
||||
textBaseline: TextBaseline.alphabetic, |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF674119), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 6, |
||||
), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Container( |
||||
width: 6.w, |
||||
height: 6.h, |
||||
margin: EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h), |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(3), |
||||
color: Color(0xFF79572D), |
||||
), |
||||
), |
||||
Text( |
||||
"每位主卡用户只可绑定5位副卡用户,同时,只能解绑3次", |
||||
style: TextStyle( |
||||
textBaseline: TextBaseline.alphabetic, |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF674119), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 6, |
||||
), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Container( |
||||
width: 6.w, |
||||
height: 6.h, |
||||
margin: EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h), |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(3), |
||||
color: Color(0xFF79572D), |
||||
), |
||||
), |
||||
Text( |
||||
"副卡享受主卡的部分权益,主卡会员失效后,副卡也失效", |
||||
style: TextStyle( |
||||
textBaseline: TextBaseline.alphabetic, |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF674119), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 6, |
||||
), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Container( |
||||
width: 6.w, |
||||
height: 6.h, |
||||
margin: EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h), |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(3), |
||||
color: Color(0xFF79572D), |
||||
), |
||||
), |
||||
Text( |
||||
"副卡成为金卡会员后,自动与主卡解绑", |
||||
style: TextStyle( |
||||
textBaseline: TextBaseline.alphabetic, |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF674119), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 20, |
||||
), |
||||
Text( |
||||
"${S.of(context).yibangfuka}(0/5)", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF674119), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 8, |
||||
), |
||||
assistant(), |
||||
], |
||||
), |
||||
), |
||||
) |
||||
], |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
///解除绑定弹窗 |
||||
unbindShowDeleteDialog() { |
||||
showDialog( |
||||
context: context, |
||||
builder: (context) { |
||||
return AlertDialog( |
||||
content: Container( |
||||
width: MediaQuery.of(context).size.width - 84, |
||||
height: 146.h, |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Text( |
||||
"确认要跟当前用户解除绑定?", |
||||
style: TextStyle( |
||||
fontSize: 17.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF353535), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 6.h, |
||||
), |
||||
Text( |
||||
"剩余解绑次数:3次", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFFA29E9E), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 16.h, |
||||
), |
||||
Row( |
||||
children: [ |
||||
Expanded( |
||||
child: InkWell( |
||||
child: BorderText( |
||||
text: "取消", |
||||
textColor: Color(0xFF32A060), |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.bold, |
||||
borderColor: Color(0xFF32A060), |
||||
radius: 4, |
||||
padding: EdgeInsets.all(12), |
||||
borderWidth: 1, |
||||
), |
||||
onTap: () { |
||||
Navigator.of(context).pop(); |
||||
}, |
||||
), |
||||
flex: 1, |
||||
), |
||||
SizedBox( |
||||
width: 16.w, |
||||
), |
||||
Expanded( |
||||
child: InkWell( |
||||
child: RoundButton( |
||||
text: "确定", |
||||
textColor: Colors.white, |
||||
radius: 4, |
||||
padding: EdgeInsets.all(12), |
||||
backgroup: Color(0xFF32A060), |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
onTap: () { |
||||
Navigator.of(context).pop(); |
||||
}, |
||||
), |
||||
flex: 1, |
||||
), |
||||
], |
||||
) |
||||
], |
||||
), |
||||
), |
||||
); |
||||
}, |
||||
); |
||||
} |
||||
|
||||
///权益列表 |
||||
Widget legalRightItem() { |
||||
return Container( |
||||
margin: EdgeInsets.only(left: 20), |
||||
alignment: Alignment.center, |
||||
child: Column( |
||||
children: [ |
||||
Opacity( |
||||
opacity: 1, |
||||
// MImage( |
||||
// "assets/image/badge_img.png", |
||||
// width: 80, |
||||
// height: 80, |
||||
// fit: BoxFit.cover, |
||||
// errorSrc: "assets/image/default_1.png", |
||||
// fadeSrc: "assets/image/default_1.png", |
||||
// ), |
||||
child: Image.asset( |
||||
"assets/image/vip_qy.png", |
||||
width: 50, |
||||
height: 50, |
||||
fit: BoxFit.cover, |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 8.h, |
||||
), |
||||
Text( |
||||
"储值优惠", |
||||
maxLines: 2, |
||||
overflow: TextOverflow.ellipsis, |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
color: Colors.white, |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///副卡列表 |
||||
Widget assistant() { |
||||
return Column( |
||||
children: [ |
||||
GridView.builder( |
||||
itemCount: 4, |
||||
shrinkWrap: true, |
||||
physics: NeverScrollableScrollPhysics(), |
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( |
||||
//一行的Widget数量 |
||||
crossAxisCount: 3, |
||||
//水平子Widget之间间距 |
||||
crossAxisSpacing: 12, |
||||
//垂直子Widget之间间距 |
||||
mainAxisSpacing: 5, |
||||
//子Widget宽高比例 |
||||
// childAspectRatio: AppUtils.textScale(context) > 1 |
||||
// ? (1 - ((AppUtils.textScale(context) - 1))) |
||||
// : 0.48, |
||||
), |
||||
itemBuilder: (context, index) { |
||||
return GestureDetector( |
||||
onTap: () {}, |
||||
child: assistantItem(), |
||||
); |
||||
}, |
||||
), |
||||
], |
||||
); |
||||
} |
||||
|
||||
Widget assistantItem() { |
||||
return Container( |
||||
alignment: Alignment.center, |
||||
child: |
||||
Column( |
||||
children: [ |
||||
Stack( |
||||
alignment: Alignment.bottomRight, |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/icon_idea_ya.png", |
||||
width: 50, |
||||
height: 50, |
||||
fit: BoxFit.cover, |
||||
), |
||||
GestureDetector( |
||||
onTap: () { |
||||
setState(() { |
||||
unbindShowDeleteDialog(); |
||||
}); |
||||
}, |
||||
child: Image.asset( |
||||
"assets/image/fuka_j.png", |
||||
width: 24, |
||||
height: 24, |
||||
fit: BoxFit.cover, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 5.h, |
||||
), |
||||
Text( |
||||
"123****6789", |
||||
style: TextStyle( |
||||
color: Color(0xFF79572D), |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
// GestureDetector( |
||||
// onTap: (){ |
||||
// Navigator.of(context).pushNamed('/router/binding_assistant_card'); |
||||
// }, |
||||
// child:Column( |
||||
// children: [ |
||||
// Image.asset( |
||||
// "assets/image/fuka_zj.png", |
||||
// width:50, |
||||
// height:50, |
||||
// fit: BoxFit.cover, |
||||
// ), |
||||
// Text( |
||||
// "添加新副卡", |
||||
// style: TextStyle( |
||||
// color: Color(0xFF79572D), |
||||
// fontWeight: MyFontWeight.regular, |
||||
// fontSize: 12.sp, |
||||
// ), |
||||
// ), |
||||
// ], |
||||
// ), |
||||
// ), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,438 @@
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/foundation.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/generated/l10n.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:huixiang/view_widget/border_text.dart'; |
||||
import 'package:huixiang/view_widget/custom_image.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:huixiang/view_widget/round_button.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
class MineAttainmentPage extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
MineAttainmentPage({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _MineAttainmentPage(); |
||||
} |
||||
} |
||||
|
||||
class _MineAttainmentPage extends State<MineAttainmentPage> { |
||||
ApiService apiService; |
||||
final RefreshController _refreshController = RefreshController(); |
||||
UserInfo userInfo; |
||||
var checkIndex = 1; |
||||
|
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
if (_refreshController != null) _refreshController.dispose(); |
||||
} |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
userInfo = widget.arguments["userInfo"]; |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Container(decoration: BoxDecoration( |
||||
image: DecorationImage( |
||||
fit: BoxFit.fill, |
||||
image: AssetImage("assets/image/attainment_bj.png"), |
||||
), |
||||
),child:Scaffold( |
||||
backgroundColor: Colors.transparent, |
||||
appBar: MyAppBar( |
||||
title: "我的成就", |
||||
titleColor: Colors.black, |
||||
titleSize: 18.sp, |
||||
background: Colors.transparent, |
||||
leadingColor: Colors.black, |
||||
), |
||||
body: SingleChildScrollView( |
||||
physics: BouncingScrollPhysics(), |
||||
child: Column( |
||||
children: [ |
||||
SizedBox(height: 24), |
||||
MImage( |
||||
userInfo?.headimg ?? "", |
||||
isCircle: true, |
||||
width: 58, |
||||
height: 58, |
||||
fit: BoxFit.cover, |
||||
errorSrc: "assets/image/default_user.png", |
||||
fadeSrc: "assets/image/default_user.png", |
||||
), |
||||
SizedBox(height: 8), |
||||
Text( |
||||
userInfo?.nickname ?? S.of(context).denglu, |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.bold, |
||||
color: Color(0xFF353535), |
||||
), |
||||
), |
||||
SizedBox(height: 28), |
||||
Container( |
||||
margin: EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8), |
||||
padding: EdgeInsets.all(20), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Colors.black.withAlpha(12), |
||||
offset: Offset(0, 3), |
||||
blurRadius: 14, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
borderRadius: BorderRadius.all(Radius.circular(8)), |
||||
), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.spaceAround, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Text( |
||||
"成就徽章", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.medium, |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF353535)), |
||||
), |
||||
SizedBox(width: 4), |
||||
Text( |
||||
"(", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.medium, |
||||
fontSize: 14, |
||||
color: Color(0xFF353535)), |
||||
), |
||||
Text( |
||||
"0", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.medium, |
||||
fontSize: 14, |
||||
color: Color(0xFF32A060)), |
||||
), |
||||
Text( |
||||
"/8)", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.medium, |
||||
fontSize: 14, |
||||
color: Color(0xFF353535)), |
||||
), |
||||
], |
||||
), |
||||
SizedBox(height: 12), |
||||
attainmentBadge(), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
); |
||||
} |
||||
|
||||
///成就徽章列表 |
||||
Widget attainmentBadge() { |
||||
return GridView.builder( |
||||
itemCount: 8, |
||||
shrinkWrap: true, |
||||
physics: NeverScrollableScrollPhysics(), |
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( |
||||
//一行的Widget数量 |
||||
crossAxisCount: 3, |
||||
//水平子Widget之间间距 |
||||
crossAxisSpacing: 13, |
||||
//垂直子Widget之间间距 |
||||
mainAxisSpacing: 12, |
||||
//子Widget宽高比例 |
||||
childAspectRatio: AppUtils.textScale(context) > 1 |
||||
? (1 - ((AppUtils.textScale(context) - 1))) |
||||
: 0.85, |
||||
), |
||||
itemBuilder: (context, index) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
showDeleteDialog(); |
||||
}, |
||||
child: badgeItem(), |
||||
); |
||||
}, |
||||
); |
||||
} |
||||
|
||||
Widget badgeItem() { |
||||
return Container( |
||||
alignment: Alignment.center, |
||||
child: Column( |
||||
children: [ |
||||
// MImage( |
||||
// "assets/image/badge_img.png", |
||||
// width: 80, |
||||
// height: 80, |
||||
// fit: BoxFit.cover, |
||||
// errorSrc: "assets/image/default_1.png", |
||||
// fadeSrc: "assets/image/default_1.png", |
||||
// ), |
||||
Image.asset( |
||||
"assets/image/badge_img.png", |
||||
width: 80, |
||||
height: 80, |
||||
fit: BoxFit.cover, |
||||
), |
||||
SizedBox( |
||||
height: 4.h, |
||||
), |
||||
Text( |
||||
"签到", |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
color: Color(0xFF181818), |
||||
fontWeight: MyFontWeight.medium, |
||||
fontSize: 12.sp, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///徽章成就弹窗 |
||||
showDeleteDialog() { |
||||
showDialog( |
||||
context: context, |
||||
builder: (context) { |
||||
return StatefulBuilder(builder: (context, state) { |
||||
return AlertDialog( |
||||
content: Container( |
||||
width: MediaQuery.of(context).size.width - 84, |
||||
height: 385.h, |
||||
child: Column( |
||||
// mainAxisAlignment: MainAxisAlignment.spaceAround, |
||||
// crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
GestureDetector( |
||||
onTap: () { |
||||
Navigator.of(context).pop(); |
||||
}, |
||||
child: Row( |
||||
children: [ |
||||
Spacer(), |
||||
Image.asset( |
||||
"assets/image/icon_order_cancel.png", |
||||
width: 24, |
||||
height: 24, |
||||
), |
||||
], |
||||
), |
||||
), |
||||
Image.asset( |
||||
"assets/image/badge_img.png", |
||||
width: 150, |
||||
height: 150, |
||||
fit: BoxFit.cover, |
||||
), |
||||
Text( |
||||
"消费白银徽章", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF181818), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 6.h, |
||||
), |
||||
Text( |
||||
"再消费268.4元即可升级", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFFA3A3A3), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 4.h, |
||||
), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Text( |
||||
"奖励:", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF515151)), |
||||
), |
||||
SizedBox(width: 8), |
||||
Image.asset( |
||||
"assets/image/icon_gold_coin.png", |
||||
width: 14, |
||||
height: 14, |
||||
fit: BoxFit.cover, |
||||
), |
||||
SizedBox(width: 4), |
||||
Text( |
||||
"+ 10", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF515151)), |
||||
), |
||||
], |
||||
), |
||||
SizedBox(height: 5), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
GestureDetector( |
||||
onTap: () { |
||||
state(() { |
||||
checkIndex = 1; |
||||
}); |
||||
}, |
||||
child: Column( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/qt_badge.png", |
||||
width: checkIndex != 1 ? 30 : 55, |
||||
height: checkIndex != 1 ? 30 : 55, |
||||
fit: BoxFit.cover, |
||||
), |
||||
SizedBox(height: 10), |
||||
Text( |
||||
"青铜", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFFA3A3A3), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
Container( |
||||
width: 35.w, |
||||
height: 2.h, |
||||
decoration: new BoxDecoration( |
||||
color: Color(0xFFE1F2F7), |
||||
), |
||||
), |
||||
GestureDetector( |
||||
onTap: () { |
||||
state(() { |
||||
checkIndex = 2; |
||||
}); |
||||
}, |
||||
child: Column( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/by_badge.png", |
||||
width: checkIndex != 2 ? 35 : 65, |
||||
height: checkIndex != 2 ? 35 : 65, |
||||
fit: BoxFit.cover, |
||||
), |
||||
SizedBox(height: 10), |
||||
Text( |
||||
"白银", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFFA3A3A3), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
Container( |
||||
width: 35.w, |
||||
height: 2.h, |
||||
decoration: new BoxDecoration( |
||||
color: Color(0xFFE1F2F7), |
||||
), |
||||
), |
||||
GestureDetector( |
||||
onTap: () { |
||||
state(() { |
||||
checkIndex = 3; |
||||
}); |
||||
}, |
||||
child: Column( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/hj_badge.png", |
||||
width: checkIndex != 3 ? 35 : 65, |
||||
height: checkIndex != 3 ? 35 : 65, |
||||
fit: BoxFit.cover, |
||||
), |
||||
SizedBox(height: 10), |
||||
Text( |
||||
"黄金", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFFA3A3A3), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
Container( |
||||
width: 35.w, |
||||
height: 2.h, |
||||
decoration: new BoxDecoration( |
||||
color: Color(0xFFE1F2F7), |
||||
), |
||||
), |
||||
GestureDetector( |
||||
onTap: () { |
||||
state(() { |
||||
checkIndex = 4; |
||||
}); |
||||
}, |
||||
child: Column( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/qt_badge.png", |
||||
width: checkIndex != 4 ? 35 : 65, |
||||
height: checkIndex != 4 ? 35 : 65, |
||||
fit: BoxFit.cover, |
||||
), |
||||
SizedBox(height: 10), |
||||
Text( |
||||
"铂金", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFFA3A3A3), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
], |
||||
), |
||||
), |
||||
); |
||||
}); |
||||
}, |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,558 @@
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.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/retrofit/data/base_data.dart'; |
||||
import 'package:huixiang/retrofit/data/rank.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/utils/flutter_utils.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/mine_vip_view.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:huixiang/view_widget/vip_dialog.dart'; |
||||
import 'package:shared_preferences/shared_preferences.dart'; |
||||
|
||||
class MineVipCore extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
MineVipCore({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _MineVipCore(); |
||||
} |
||||
} |
||||
|
||||
class _MineVipCore extends State<MineVipCore> { |
||||
ApiService apiService; |
||||
List<Rank> ranks = []; |
||||
|
||||
final SwiperController controller = SwiperController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
|
||||
SharedPreferences.getInstance().then((value) { |
||||
apiService = |
||||
ApiService(Dio(), context: context, token: value.getString("token")); |
||||
queryVipLevel(); |
||||
}); |
||||
} |
||||
|
||||
queryVipLevel() async { |
||||
BaseData<List<Rank>> rankData = await apiService.rankList(); |
||||
if (rankData != null && rankData.isSuccess) { |
||||
ranks.clear(); |
||||
ranks.addAll(rankData.data); |
||||
setState(() { |
||||
controller.move((widget.arguments["rankLevel"] - 1), animation: false); |
||||
}); |
||||
} else { |
||||
SmartDialog.showToast(rankData.msg, alignment: Alignment.center); |
||||
} |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
appBar: MyAppBar( |
||||
title: S.of(context).huiyuanzhongxin, |
||||
titleColor: Colors.black, |
||||
titleSize: 18.sp, |
||||
background: Colors.transparent, |
||||
leadingColor: Colors.black, |
||||
), |
||||
body: SingleChildScrollView( |
||||
physics: BouncingScrollPhysics(), |
||||
child: Column( |
||||
children: [ |
||||
///会员卡 |
||||
Container( |
||||
height: (MediaQuery.of(context).size.width) / |
||||
1.78 * |
||||
AppUtils.textScale(context), |
||||
child: Swiper( |
||||
viewportFraction: 0.95, |
||||
loop: false, |
||||
physics: BouncingScrollPhysics(), |
||||
controller: controller, |
||||
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["points"], |
||||
rankMax: !(ranks != null && ranks.isNotEmpty) |
||||
? 0 |
||||
: (position < (ranks.length - 1)) |
||||
? ranks[position + 1].rankOrigin |
||||
: ranks[position].rankOrigin, |
||||
createTime: widget.arguments["createTime"], |
||||
); |
||||
}, |
||||
itemCount: |
||||
(ranks != null && ranks.isNotEmpty) ? ranks.length : 1, |
||||
), |
||||
), |
||||
|
||||
///会员权益 |
||||
Container( |
||||
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), |
||||
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.only( |
||||
topLeft: Radius.circular(8), |
||||
topRight: Radius.circular(8), |
||||
), |
||||
), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Container( |
||||
width: 4, |
||||
height: 18, |
||||
decoration: BoxDecoration( |
||||
gradient: new LinearGradient( |
||||
begin: Alignment.bottomCenter, |
||||
end: Alignment.topCenter, |
||||
colors: [ |
||||
Color(0xFF000000), |
||||
Color(0xFF585858), |
||||
]), |
||||
), |
||||
), |
||||
SizedBox( |
||||
width: 4.w, |
||||
), |
||||
Text( |
||||
S.of(context).huiyuanquanyi, |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.medium, |
||||
fontSize: 16.sp, |
||||
color: Colors.black, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 12.h, |
||||
), |
||||
vipLegalRight(), |
||||
], |
||||
), |
||||
), |
||||
|
||||
///会员规则说明 |
||||
Container( |
||||
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), |
||||
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.only( |
||||
topLeft: Radius.circular(8), |
||||
topRight: Radius.circular(8), |
||||
), |
||||
), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Container( |
||||
width: 4, |
||||
height: 18, |
||||
decoration: BoxDecoration( |
||||
gradient: new LinearGradient( |
||||
begin: Alignment.bottomCenter, |
||||
end: Alignment.topCenter, |
||||
colors: [ |
||||
Color(0xFF000000), |
||||
Color(0xFF585858), |
||||
]), |
||||
), |
||||
), |
||||
SizedBox( |
||||
width: 4.w, |
||||
), |
||||
Text( |
||||
S.of(context).huiyuanguize, |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.medium, |
||||
fontSize: 16.sp, |
||||
color: Colors.black, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 12.h, |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(left: 8), |
||||
child: Text( |
||||
"会员共分为3个等级,分别是银卡会员、金卡会员、共创会员。其中,银卡会员和金卡会员由用户的消费金额决定," |
||||
"消费金额越高,会员等级越高,享受到的会员权益也越多。而共创会员需要直接购买,但是它的权益包含银卡和金卡的,属于最高等级会员。", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
height: 1.5, |
||||
color: Color(0xFF4C4C4C), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
|
||||
///会员级别对照表 |
||||
Container( |
||||
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), |
||||
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.only( |
||||
topLeft: Radius.circular(8), |
||||
topRight: Radius.circular(8), |
||||
), |
||||
), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Container( |
||||
width: 4, |
||||
height: 18, |
||||
decoration: BoxDecoration( |
||||
gradient: new LinearGradient( |
||||
begin: Alignment.bottomCenter, |
||||
end: Alignment.topCenter, |
||||
colors: [ |
||||
Color(0xFF000000), |
||||
Color(0xFF585858), |
||||
]), |
||||
), |
||||
), |
||||
SizedBox( |
||||
width: 4.w, |
||||
), |
||||
Text( |
||||
S.of(context).huiyuanjibieduizhao, |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.medium, |
||||
fontSize: 16.sp, |
||||
color: Colors.black, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 12.h, |
||||
), |
||||
Image.asset( |
||||
"assets/image/vip_contrastive_table.png", |
||||
width: double.infinity, |
||||
height: 281, |
||||
), |
||||
SizedBox( |
||||
height: 16.h, |
||||
), |
||||
], |
||||
), |
||||
), |
||||
|
||||
///会员如何获得积分 |
||||
Container( |
||||
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.only( |
||||
topLeft: Radius.circular(8), |
||||
topRight: Radius.circular(8), |
||||
), |
||||
), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Container( |
||||
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Container( |
||||
width: 4, |
||||
height: 18, |
||||
decoration: BoxDecoration( |
||||
gradient: new LinearGradient( |
||||
begin: Alignment.bottomCenter, |
||||
end: Alignment.topCenter, |
||||
colors: [ |
||||
Color(0xFF000000), |
||||
Color(0xFF585858), |
||||
]), |
||||
), |
||||
), |
||||
SizedBox( |
||||
width: 4.w, |
||||
), |
||||
Text( |
||||
S.of(context).huiyuanhuodejifen, |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.medium, |
||||
fontSize: 16.sp, |
||||
color: Colors.black, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 12.h, |
||||
), |
||||
Text( |
||||
"1.用户每消费1元可获得1个积分。", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF4C4C4C), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 8.h, |
||||
), |
||||
Text( |
||||
"2.通过完成积分详情-做任务得积分来获得积分。", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF4C4C4C), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 8.h, |
||||
), |
||||
Text( |
||||
"3.优惠金额无法累积积分,订单撤销或其他原因造成的未成功支付的订单,无法获得对应的积分。", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
height: 1.5, |
||||
color: Color(0xFF4C4C4C), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 8.h, |
||||
), |
||||
], |
||||
), |
||||
), |
||||
InkWell( |
||||
onTap: () { |
||||
setState(() { |
||||
showAlertDialog(); |
||||
}); |
||||
}, |
||||
child: Container( |
||||
decoration: BoxDecoration( |
||||
gradient: new LinearGradient( |
||||
begin: Alignment.centerLeft, |
||||
end: Alignment.centerRight, |
||||
colors: [ |
||||
Color(0xFFFFDCA1), |
||||
Color(0xFFFAE4C0), |
||||
]), |
||||
), |
||||
width: MediaQuery.of(context).size.width, |
||||
padding: EdgeInsets.all(16), |
||||
height: 54, |
||||
alignment: Alignment.center, |
||||
child: Text( |
||||
"${S.of(context).lijikaitong}¥20000/永久", |
||||
style: TextStyle( |
||||
fontWeight: FontWeight.bold, |
||||
fontSize: 16.sp, |
||||
color: Color(0xFF4A4748), |
||||
), |
||||
), |
||||
), |
||||
) |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget levelItem(Rank rank, rankOrigin, rankOriginMax) { |
||||
return Container( |
||||
margin: EdgeInsets.symmetric(vertical: 8.h), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Expanded( |
||||
child: Text( |
||||
rank?.rankName ?? "", |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF353535), |
||||
), |
||||
), |
||||
flex: 1, |
||||
), |
||||
Expanded( |
||||
child: Text( |
||||
"$rankOrigin - ${rankOriginMax == 0 ? "无限" : rankOriginMax}", |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF353535), |
||||
), |
||||
), |
||||
flex: 1, |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///会员权益列表 |
||||
Widget vipLegalRight() { |
||||
return GridView.builder( |
||||
itemCount: 13, |
||||
shrinkWrap: true, |
||||
physics: NeverScrollableScrollPhysics(), |
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( |
||||
//一行的Widget数量 |
||||
crossAxisCount: 4, |
||||
//水平子Widget之间间距 |
||||
crossAxisSpacing: 35, |
||||
//垂直子Widget之间间距 |
||||
mainAxisSpacing: 10, |
||||
//子Widget宽高比例 |
||||
childAspectRatio: AppUtils.textScale(context) > 1 |
||||
? (1 - ((AppUtils.textScale(context) - 1))) |
||||
: 0.85, |
||||
), |
||||
itemBuilder: (context, index) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
Navigator.of(context) |
||||
.pushNamed('/router/legal_right_details', arguments: {}); |
||||
}, |
||||
child: vipLegalRightItem(), |
||||
); |
||||
}, |
||||
); |
||||
} |
||||
|
||||
Widget vipLegalRightItem() { |
||||
return Container( |
||||
alignment: Alignment.center, |
||||
child: Column( |
||||
children: [ |
||||
Stack( |
||||
alignment: Alignment.bottomCenter, |
||||
children: [ |
||||
Opacity( |
||||
opacity: 0.3, |
||||
// MImage( |
||||
// "assets/image/badge_img.png", |
||||
// width: 80, |
||||
// height: 80, |
||||
// fit: BoxFit.cover, |
||||
// errorSrc: "assets/image/default_1.png", |
||||
// fadeSrc: "assets/image/default_1.png", |
||||
// ), |
||||
child: Image.asset( |
||||
"assets/image/vip_qy.png", |
||||
width: 36, |
||||
height: 36, |
||||
fit: BoxFit.cover, |
||||
), |
||||
), |
||||
Container( |
||||
decoration: new BoxDecoration( |
||||
color: Color(0xFFA29E9E), |
||||
borderRadius: BorderRadius.circular(7.0), |
||||
), |
||||
width: 52.w, |
||||
height: 15.h, |
||||
child: Row( |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Icon( |
||||
Icons.lock, |
||||
color: Color(0xFFFFDCA1), |
||||
size: 10, |
||||
), |
||||
Text( |
||||
"暂未开放", |
||||
style: TextStyle( |
||||
color: Color(0xFF181818), |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 9.sp, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
) |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 5.h, |
||||
), |
||||
Text( |
||||
"储值优惠", |
||||
maxLines: 2, |
||||
overflow: TextOverflow.ellipsis, |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
color: Color(0xFF181818), |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///会员升级弹窗 |
||||
showAlertDialog() { |
||||
//显示对话框 |
||||
showDialog( |
||||
context: context, |
||||
builder: (BuildContext context) { |
||||
return VipDialog(); |
||||
}, |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,206 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
class VipDialog extends StatelessWidget { |
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return SimpleDialog( |
||||
titlePadding: EdgeInsets.all(10), |
||||
backgroundColor: Colors.transparent, |
||||
elevation: 0, |
||||
shape: RoundedRectangleBorder( |
||||
borderRadius: BorderRadius.circular(6), |
||||
), |
||||
children: <Widget>[ |
||||
Stack( |
||||
alignment: Alignment.topCenter, |
||||
children: [ |
||||
Container( |
||||
margin: EdgeInsets.only(top: 40.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(8),), |
||||
child:SingleChildScrollView( |
||||
physics: BouncingScrollPhysics(), |
||||
child: Column( |
||||
children: [ |
||||
Container( |
||||
alignment: Alignment.center, |
||||
width:double.infinity, |
||||
height: 92, |
||||
padding: EdgeInsets.only(top: 50.h, bottom: 19.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.black, |
||||
borderRadius: BorderRadius.only( |
||||
topLeft: Radius.circular(8), |
||||
topRight: Radius.circular(8), |
||||
),), |
||||
child:Text( |
||||
"${S.of(context).gongxinchengwei}银卡会员", |
||||
style: TextStyle( |
||||
color: Colors.white, |
||||
fontSize: 18.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
), |
||||
), |
||||
Container( |
||||
child: Column( |
||||
children: [ |
||||
Padding( |
||||
padding: EdgeInsets.only(top:16.h, bottom: 19.h), |
||||
child: Text( |
||||
S.of(context).huodequanyi, |
||||
style: TextStyle( |
||||
color: Colors.black, |
||||
fontSize: 14.sp, |
||||
fontWeight:MyFontWeight.medium, |
||||
), |
||||
), |
||||
), |
||||
// vipUpgrade(), |
||||
Container( |
||||
margin: EdgeInsets.only(left: 32,right: 32,bottom: 20), |
||||
decoration: BoxDecoration( |
||||
gradient: new LinearGradient( |
||||
begin: Alignment.centerLeft, |
||||
end: Alignment.centerRight, |
||||
colors: [ |
||||
Color(0xFFFFDCA1), |
||||
Color(0xFFFAE4C0), |
||||
]), |
||||
borderRadius: BorderRadius.circular(22.5), |
||||
), |
||||
width: MediaQuery.of(context).size.width, |
||||
height: 40, |
||||
alignment: Alignment.center, |
||||
child: Text( |
||||
S.of(context).chakanquanyi, |
||||
style: TextStyle( |
||||
fontWeight: FontWeight.bold, |
||||
fontSize: 16.sp, |
||||
color: Color(0xFF4A4748), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
Image.asset( |
||||
"assets/image/vip_yk.png", |
||||
fit: BoxFit.cover, |
||||
width: 76, |
||||
height: 76, |
||||
), |
||||
], |
||||
), |
||||
], |
||||
); |
||||
} |
||||
|
||||
///会员升级权益列表 |
||||
Widget vipUpgrade() { |
||||
return GridView.builder( |
||||
itemCount:9, |
||||
shrinkWrap: true, |
||||
physics: NeverScrollableScrollPhysics(), |
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( |
||||
//一行的Widget数量 |
||||
crossAxisCount:3, |
||||
//水平子Widget之间间距 |
||||
crossAxisSpacing:10, |
||||
//垂直子Widget之间间距 |
||||
mainAxisSpacing: 10, |
||||
), |
||||
itemBuilder: (context, index) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
Navigator.of(context) |
||||
.pushNamed('/router/legal_right_details', arguments: {}); |
||||
}, |
||||
child: vipUpgradeItem(), |
||||
); |
||||
}, |
||||
); |
||||
} |
||||
|
||||
Widget vipUpgradeItem() { |
||||
return Container( |
||||
alignment: Alignment.center, |
||||
child: Column( |
||||
children: [ |
||||
Stack( |
||||
alignment: Alignment.bottomCenter, |
||||
children: [ |
||||
Opacity( |
||||
opacity: 0.3, |
||||
// MImage( |
||||
// "assets/image/badge_img.png", |
||||
// width: 80, |
||||
// height: 80, |
||||
// fit: BoxFit.cover, |
||||
// errorSrc: "assets/image/default_1.png", |
||||
// fadeSrc: "assets/image/default_1.png", |
||||
// ), |
||||
child: Image.asset( |
||||
"assets/image/vip_qy.png", |
||||
width: 36, |
||||
height: 36, |
||||
fit: BoxFit.cover, |
||||
), |
||||
), |
||||
Container( |
||||
decoration: new BoxDecoration( |
||||
color: Color(0xFFA29E9E), |
||||
borderRadius: BorderRadius.circular(7.0), |
||||
), |
||||
width: 52.w, |
||||
height: 15.h, |
||||
child: Row( |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Icon( |
||||
Icons.lock, |
||||
color: Color(0xFFFFDCA1), |
||||
size: 10, |
||||
), |
||||
Text( |
||||
"暂未开放", |
||||
style: TextStyle( |
||||
color: Color(0xFF181818), |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 9.sp, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
) |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 5.h, |
||||
), |
||||
Text( |
||||
"储值优惠", |
||||
maxLines: 2, |
||||
overflow: TextOverflow.ellipsis, |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
color: Color(0xFF181818), |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
} |