You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
571 lines
20 KiB
571 lines
20 KiB
3 years ago
|
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,
|
||
|
// ),
|
||
|
// ),
|
||
|
// ],
|
||
|
// ),
|
||
|
// ),
|
||
|
);
|
||
|
}
|
||
|
}
|