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.

269 lines
7.0 KiB

2 years ago
import 'package:flutter/material.dart';
2 years ago
import 'package:flutter/services.dart';
import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/widget/plone_bottom.dart';
2 years ago
import 'package:project_telephony/utils/headers.dart';
2 years ago
import 'package:project_telephony/utils/user_tool.dart';
2 years ago
import '../../constants/api.dart';
import '../../model/network/api_client.dart';
import '../../utils/toast/cloud_toast.dart';
class AppDialog extends Dialog {
final String title;
final String confirm; //按钮文字
2 years ago
const AppDialog({
2 years ago
Key? key,
this.title = "恭喜您获得会员体验卡",
this.confirm = "立即领取",
}) : super(key: key);
@override
Widget build(BuildContext context) {
2 years ago
return Center(
child: Container(
margin: EdgeInsets.only(
left: 100.w,
right: 100.w,
),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.images.bouncedbg.path,
2 years ago
),
),
2 years ago
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
title,
style: TextStyle(
fontSize: 36.sp,
),
),
60.hb,
_getVip(),
200.hb,
Row(
2 years ago
mainAxisAlignment: MainAxisAlignment.center,
2 years ago
children: [
_getText("接听发送"),
2 years ago
60.wb,
2 years ago
_getText("拒接发送"),
2 years ago
60.wb,
2 years ago
_getText("提升形象"),
],
),
50.hb,
_getBotton(confirm, context),
],
),
2 years ago
),
);
}
}
_getBotton(String bContent, context) {
return GestureDetector(
2 years ago
onTap: () async {
var res = await apiClient.request(API.app.trialVip);
if (res.code == 0) {
2 years ago
CloudToast.show(res.msg);
2 years ago
UserTool.userProvider.updateUserInfo();
Navigator.pop(context);
2 years ago
} else {
2 years ago
CloudToast.show(res.msg);
}
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 64.w),
2 years ago
width: 500.w,
2 years ago
height: 88.w,
2 years ago
alignment: Alignment.center,
2 years ago
decoration: BoxDecoration(
2 years ago
borderRadius: BorderRadius.circular(12.w),
gradient: const LinearGradient(
colors: [Color(0xFFFFEAB0), Color(0xFFFFF6D8)],
end: Alignment.centerLeft,
begin: Alignment.centerRight,
),
),
2 years ago
child: Text(
bContent,
2 years ago
style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.bold),
2 years ago
),
),
);
}
_getText(String content) {
return Text(
content,
style: TextStyle(color: const Color(0xFF1890FF), fontSize: 24.w),
);
}
_getVip() {
return SizedBox(
width: 370.w,
2 years ago
height: 110.w,
2 years ago
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
2 years ago
Text.rich(
2 years ago
TextSpan(
2 years ago
children: [
TextSpan(
text: "03",
style: TextStyle(
color: const Color(0xFFFFEAB0),
fontSize: 56.sp,
fontFamily: "BlackItalic",
fontWeight: FontWeight.bold)),
TextSpan(
text: "",
style: TextStyle(
2 years ago
color: const Color(0xFFFFEAB0),
2 years ago
fontSize: 24.sp,
),
),
],
),
),
2 years ago
const Spacer(),
Column(
children: [
Text(
"VIP",
style: TextStyle(
2 years ago
color: const Color(0xFFE7F3FF),
fontSize: 32.sp,
fontFamily: "BlackItalic",
fontWeight: FontWeight.bold,
),
),
2 years ago
],
2 years ago
),
2 years ago
],
),
Text(
"短信帮手会员体验卡",
style: TextStyle(
color: const Color(0xFFFFEAB0),
fontSize: 24.sp,
),
2 years ago
),
2 years ago
],
),
);
}
2 years ago
// class FindDialog extends StatefulWidget{
// final String title;
//
// // final Widget widget;
// final VoidCallback ontap;
// final String name;
// final String phone;
//
// const FindDialog(
// {Key? key,
// required this.title,
// required this.ontap,
// // required this.widget,
// required this.name,
// required this.phone})
// : super(key: key);
//
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// body:Container(
// margin: EdgeInsets.only(
// left: 100.w,
// right: 100.w,
// ),
// height: 720.w,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text(
// title,
// style: TextStyle(
// fontSize: 36.sp,
// ),
// ),
// _getUpdate(name, phone),
// PloneBottom(
// onTap: ontap,
// text: "保存",
// )
// ],
// ),
// ),
// );
// }
//
// _getUpdate(String name, String phone) {
// return Container(
// height: 400.w,
// padding: EdgeInsets.zero,
// child: Column(
// children: [
// Text(
// "名称",
// style: TextStyle(
// fontSize: 28.sp,
// color: BaseStyle.color999999,
// ),
// ),
// 24.hb,
// SizedBox(
// height: 96.w,
// child: TextField(
// decoration: InputDecoration.collapsed(
// hintText: name,
// hintStyle:
// TextStyle(fontSize: 28.sp, color: BaseStyle.color333333),
// fillColor: Colors.transparent,
// // contentPadding: EdgeInsets.zero,
// ),
// ),
// ),
// 48.hb,
// Text(
// "名称",
// style: TextStyle(
// fontSize: 28.sp,
// color: BaseStyle.color999999,
// ),
// ),
// 24.hb,
// SizedBox(
// height: 96.w,
// child: TextField(
// decoration: InputDecoration.collapsed(
// hintText: phone,
// hintStyle:
// TextStyle(fontSize: 28.sp, color: BaseStyle.color333333),
// fillColor: Colors.transparent,
// // contentPadding: EdgeInsets.zero,
// ),
// ),
// )
// ],
// ),
// );
// }
//
// @override
// State<StatefulWidget> createState() {
// throw UnimplementedError();
// }
// }