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.

331 lines
9.2 KiB

2 years ago
import 'package:bot_toast/bot_toast.dart';
2 years ago
import 'package:flutter/material.dart';
import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/widget/check_radio.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/ui/widget/plone_bottom.dart';
import 'package:project_telephony/ui/widget/putup_widget.dart';
import 'package:project_telephony/utils/headers.dart';
2 years ago
class MembersPage extends StatefulWidget {
const MembersPage({Key? key}) : super(key: key);
@override
_MembersPageState createState() => _MembersPageState();
}
ChooseItems? _chooseItem;
List<dynamic>? data;
final List<ChooseItems> _piceList = [
ChooseItems(
month: 12,
pice: 10,
),
ChooseItems(
month: 1,
pice: 1,
),
];
int _selectIndex = 0;
List payWay = [
{
'payName': '微信支付',
'payUrl': Assets.icons.weixin.path,
},
{'payName': '支付宝支付', 'payUrl': Assets.icons.zhifubao.path}
];
2 years ago
Map a = {};
2 years ago
class _MembersPageState extends State<MembersPage> {
2 years ago
@override
Widget build(BuildContext context) {
return Scaffold(
2 years ago
body: Stack(
children: [
Align(
child: SizedBox(
2 years ago
width: 750.w,
2 years ago
height: 1624.w,
),
),
Positioned(
child: Image.asset(
Assets.images.vipbg.path,
)),
Positioned(top: 256.w, left: 32.w, child: _getBanner()),
Positioned(
top: 480.w,
child: Container(
height: 1208.w,
width: 750.w,
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20))),
child: Column(children: [
_getRecharge(),
_getSpay(payWay),
PloneBottom(
border: true,
2 years ago
onTap: () async {
if (_selectIndex == 0) {}
},
2 years ago
textColor: const Color(0xFF333333),
text: "立即开通",
color1: const Color(0xFFFFF6D8),
color2: const Color(0xFFFFEAB0),
)
]),
)),
Positioned(
top: 68.w,
child: Row(
children: [
const CloudBackButton(
isSpecial: true,
),
154.wb,
Text('会员中心', style: Theme.of(context).textTheme.headline6),
],
)),
],
),
);
2 years ago
}
//banner
_getBanner() {
return SizedBox(
// margin: EdgeInsets.symmetric(horizontal: 32.w),
child: Stack(children: [
Align(
child: SizedBox(
width: 686.w,
child: Image.asset(
Assets.images.vipbanner.path,
width: 622.w,
height: 244.w,
fit: BoxFit.fill,
),
)),
Positioned(
child: Container(
2 years ago
margin: EdgeInsets.symmetric(horizontal: 64.w, vertical: 50.w),
2 years ago
child: _getText()))
]),
);
}
//banner 文字
_getText() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_getVip(),
18.hb,
Text(
"解锁全部功能",
style: TextStyle(
color: Colors.white,
fontSize: BaseStyle.fontSize32,
fontWeight: FontWeight.bold),
),
16.hb,
Text(
2 years ago
"暂未开通会员",
2 years ago
style: TextStyle(color: Colors.white, fontSize: BaseStyle.fontSize24),
2 years ago
),
2 years ago
],
);
}
_getVip() {
return Row(
children: [
2 years ago
Text(
"VIP",
style: TextStyle(
color: const Color(0xFFFFEAB0),
fontFamily: "BlackItalic",
fontSize: 32.sp),
2 years ago
),
Container(
width: 8.w,
height: 8.w,
2 years ago
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 8.w),
2 years ago
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: const Color(0xFFFFEAB0),
),
),
const Text(
"未开通会员",
2 years ago
style: TextStyle(
color: Color(
0xFFFFEAB0,
),
fontWeight: FontWeight.w700),
2 years ago
)
],
);
}
2 years ago
// Future _wxPayFunc() async {
// var base = await apiClient.request(API.user.wallet.assessRecharge, data: {
// 'count': widget.count,
// 'payType': 2,
// });
// if (base.code == 0) {
// var wxPayModel = WxPayModel.fromJson(base.data['content']);
// await PayUtil().callWxPay(
// payModel: wxPayModel,
// );
// } else {
// BotToast.showText(text: "${base.msg}");
// }
// }
// Future _aliPayFunc() async {
// var base = await apiClient.request(API.user.wallet.assessRecharge, data: {
// 'count': widget.count,
// 'payType': 1,
// });
// if (base.code == 0) {
// var re = await PayUtil().callAliPay(base.data['content']);
// if (re) {
// _paySuccess();
// } else {
// BotToast.closeAllLoading();
// }
// } else {
// CloudToast.show(base.msg);
// }
// }
2 years ago
//充值金额
_getRecharge() {
return Container(
width: double.infinity,
decoration: const BoxDecoration(),
clipBehavior: Clip.antiAlias,
child: ListView(
shrinkWrap: true,
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 80.w, vertical: 32.w),
child: SortWidget(
crossAxisSpacing: 24.w,
itemList: _piceList,
childAspectRatio: 288 / 216,
crossAxisCount: 2,
mainAxisSpacing: 20.w,
callback: (item, index) {
_chooseItem = item;
2 years ago
// print(_piceList[index].pice);
setState(() {});
2 years ago
},
pickItem: _chooseItem,
),
),
// 762.hb,
//40.hb,
],
),
);
}
_getSpay(List item) {
return Container(
// color: Colors.red,
width: double.infinity,
height: 500.w,
margin: EdgeInsets.symmetric(horizontal: 64.w),
child: ListView.builder(
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
_selectIndex = index;
2 years ago
// print(_selectIndex);
setState(() {});
2 years ago
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 40.w),
color: Colors.white,
child: Row(
children: [
SizedBox(
child: Image.asset(
item[index]['payUrl'],
width: 40.w,
height: 40.h,
),
),
20.wb,
SizedBox(
width: 200.w,
child: Text(
item[index]['payName'],
style: TextStyle(
2 years ago
fontWeight: FontWeight.w700,
2 years ago
color: BaseStyle.color333333,
fontSize: BaseStyle.fontSize28),
),
),
const Spacer(),
BeeCheckRadio(
value: index,
groupValue: [_selectIndex],
),
],
)),
);
},
itemCount: item.length,
),
);
// ListView.builder(
// itemBuilder: (context, index) {
// return GestureDetector(
// onTap: () {
// _selectIndex = index;
// // setState(() {});
// },
// child: Container(
// padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 40.w),
// color: Colors.white,
// child: Row(
// children: [
// SizedBox(
// child: Image.asset(
// item[index]['payUrl'],
// width: 40.w,
// height: 40.h,
// ),
// ),
// 20.wb,
// SizedBox(
// width: 200.w,
// child: Text(
// item[index]['payName'],
// style: TextStyle(
// color: BaseStyle.color333333,
// fontSize: BaseStyle.fontSize28),
// ),
// ),
// const Spacer(),
// BeeCheckRadio(
// value: index,
// groupValue: [_selectIndex],
// ),
// ],
// )),
// );
// },
// itemCount: item.length,
// );
}
}