# Conflicts:
#	lib/constants/api.dart
#	lib/model/user_info_model.g.dart
#	lib/ui/home/content_connect_page.dart
master
戴余标 2 years ago
commit c1ce6b68ae

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

@ -51,6 +51,9 @@ class _App {
///VIP
String get updateVip => '/app/user/updateVip';
///
String get trialVip => '/app/user/trialVip';
}
class _Content{

@ -73,6 +73,10 @@ class $AssetsImagesGen {
/// File path: assets/images/bg.png
AssetGenImage get bg => const AssetGenImage('assets/images/bg.png');
/// File path: assets/images/bouncedbg.png
AssetGenImage get bouncedbg =>
const AssetGenImage('assets/images/bouncedbg.png');
/// File path: assets/images/emptylist.png
AssetGenImage get emptylist =>
const AssetGenImage('assets/images/emptylist.png');

@ -76,6 +76,7 @@ class ApiClient {
return baseModel;
}
// ///
// Future<String> uploadImage(File file) async {
// var response = await _dio.post(

@ -1,6 +1,5 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:equatable/equatable.dart';
import 'package:project_telephony/ui/user/content_details_page.dart';
part 'user_info_model.g.dart';

@ -1,3 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:project_telephony/base/base_style.dart';
@ -42,74 +43,70 @@ class _ContentConnectPageState extends State<ContentConnectPage>
Widget build(BuildContext context) {
super.build(context);
return Scaffold(
appBar: AppBar(
elevation: 0,
title: Text(
'选择短信内容',
style: Theme.of(context).textTheme.headline6,
appBar: AppBar(
elevation: 0,
title: Text(
'选择短信内容',
style: Theme.of(context).textTheme.headline6,
),
leading: const CloudBackButton(isSpecial: true),
backgroundColor: kForeGroundColor,
),
leading: const CloudBackButton(isSpecial: true),
backgroundColor: kForeGroundColor,
),
backgroundColor: Colors.white,
body: Column(
children: [
Container(
width: double.infinity,
height: 88.w,
margin: EdgeInsets.symmetric(horizontal: 66.w),
padding: EdgeInsets.all(8.w),
decoration: BoxDecoration(
color: const Color(0xFFF9F9F9),
borderRadius: BorderRadius.all(Radius.circular(44.w))),
child: TabBar(
controller: _tabController,
labelColor: const Color(0xFF1890FF),
unselectedLabelColor: const Color(0xFF999999),
unselectedLabelStyle:
const TextStyle(fontWeight: FontWeight.bold),
labelStyle: const TextStyle(fontWeight: FontWeight.bold),
onTap: (num) {
if (num == 0) {
_answerRefreshController.callRefresh();
} else {
_wasAnswerRefreshController.callRefresh();
}
},
indicator: RectangularIndicator(
color: Colors.white,
bottomLeftRadius: 44.w,
bottomRightRadius: 44.w,
topLeftRadius: 44.w,
topRightRadius: 44.w,
),
tabs: const [
Tab(
text: "被叫接听",
backgroundColor: Colors.white,
body: Column(
children: [
Container(
width:double.infinity,
height: 88.w,
margin: EdgeInsets.symmetric(horizontal: 66.w),
padding: EdgeInsets.all(8.w),
decoration:BoxDecoration(color: const Color(0xFFF9F9F9),borderRadius: BorderRadius.all(Radius.circular(44.w))),
child: TabBar(
// indicator: Decoration(),
controller: _tabController,
labelColor:const Color(0xFF1890FF),
unselectedLabelColor:const Color(0xFF999999),
unselectedLabelStyle:const TextStyle(fontWeight:FontWeight.bold),
labelStyle:const TextStyle(fontWeight:FontWeight.bold),
onTap: (num) {
if(num==0){
_answerRefreshController.callRefresh();
}else{
_wasAnswerRefreshController.callRefresh();
}
},
indicator: RectangularIndicator(
color: Colors.white,
bottomLeftRadius: 44.w,
bottomRightRadius: 44.w,
topLeftRadius: 44.w,
topRightRadius: 44.w,
// paintingStyle: PaintingStyle.fill,
),
Tab(
text: "主叫接听",
)
]),
),
Expanded(
child: TabBarView(
controller: _tabController,
children: [
AnswerIdleList(
refreshController: _answerRefreshController,
isIdle: false,
),
AnswerIdleList(
refreshController: _wasAnswerRefreshController,
isIdle: true,
),
],
// indicatorSize: TabBarIndicatorSize.label,
// isScrollable: true,
tabs: const [
// _tab(0, "被叫接听"),_tab(1, "主叫接听"),
Tab(text: "被叫接听",),Tab(text: "主叫接听",)
]),
),
),
],
),
);
Expanded(
child: TabBarView(controller: _tabController, children: [
// _getBox(),
AnswerIdleList(
// contant: const [],
refreshController: _answerRefreshController, isIdle: false,
),
AnswerIdleList(
// contant: const [],
refreshController: _wasAnswerRefreshController, isIdle: true,
)
]))
],
));
}
@override

@ -3,11 +3,14 @@ import 'dart:async';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter_background_service/flutter_background_service.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:project_telephony/ui/home/content_connect_page.dart';
import 'package:project_telephony/ui/home/content_refuse_page.dart';
import 'package:project_telephony/ui/user/privacy_rights_page.dart';
import 'package:project_telephony/ui/user/privacy_rights_page.dart';
import 'package:project_telephony/ui/widget/appdialog.dart';
import 'package:project_telephony/ui/widget/plone_bottom.dart';
import 'package:project_telephony/utils/headers.dart';
@ -28,6 +31,8 @@ bool kg=false;
final service = FlutterBackgroundService();
@override
class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
@override
void initState() {
super.initState();
@ -77,6 +82,12 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
),
),
Positioned(top: 48.w, child: _warning()),
// Positioned(child: PloneBottom(onTap: (){
// showDialog(context: context, builder: (context){
// return const AppDialog();
// });
//
// })),
Positioned(bottom: 64.w, child: _getBody()),
Align(
child: SizedBox(

@ -79,9 +79,9 @@ class _TabNavigatorState extends State<TabNavigator>
return true;
},
child: TabBarView(
children: _pages,
controller: _tabController,
physics: const NeverScrollableScrollPhysics(),
children: _pages,
),
),
bottomNavigationBar: BottomNavigationBar(

@ -24,6 +24,7 @@ import '../../utils/hive_store.dart';
import '../../utils/toast/cloud_toast.dart';
import '../../utils/user_tool.dart';
import '../home/call.dart';
import '../widget/appdialog.dart';
import 'content_details_page.dart';
import '../home/home_page.dart';
@ -49,6 +50,7 @@ class _UserPageState extends State<UserPage> {
final service = FlutterBackgroundService();
final EasyRefreshController _easyRefreshController = EasyRefreshController();
String? endDate;
@override
void dispose() {
_easyRefreshController.dispose();
@ -61,28 +63,39 @@ class _UserPageState extends State<UserPage> {
@override
void initState() {
super.initState();
// showDialog(context: context, builder: (context){
// return const AppDialog();
// });
// _easyRefreshController.callRefresh();
// UserTool.userProvider.updateUserInfo();
// if (UserTool.userProvider.isLogin) {
//
// // print(UserTool.userProvider.userInfo.end * 1000);
// // print(DateTime.now().millisecondsSinceEpoch);
// if (UserTool.userProvider.userInfo.isVip != 1) {
// isVip = false;
// vle = false;
// } else {
// isVip = true;
// vle = await service.isRunning();
// }
// // if (UserTool.userProvider.userInfo.isVip != 1) {
// // isVip = false;
// // vle = false;
// // } else {
// // isVip = true;
// // vle = await service.isRunning();
// // }
// //service.isRunning() as bool;
// // endDate = DateUtil.formatDateMs(
// // UserTool.userProvider.userInfo.end * 1000,
// // format: DateFormats.y_mo_d);
// } else {
// }
// else {
// vle = false;
// }
}
// getRes() async{
// var res=await apiClient.request(API.app.trialVip);
// if(res.code==0){
// showDialog(context: context, builder: (context){
// return const AppDialog();
// });
// }
// }
@override
Widget build(BuildContext context) {
@ -105,8 +118,15 @@ class _UserPageState extends State<UserPage> {
_getRequests();
// await UserTool.userProvider.updateUserInfo();
if (UserTool.userProvider.isLogin) {
// var res=await apiClient.request(API.app.trialVip);
if(UserTool.userProvider.userInfo.isTrial==0){
showDialog(context: context, builder: (context){
return const AppDialog();
});
}
// print(UserTool.userProvider.userInfo.end * 1000);
// print(DateTime.now().millisecondsSinceEpoch);
if (UserTool.userProvider.userInfo.isVip != 1) {
isVip = false;
vle = false;

@ -0,0 +1,193 @@
import 'package:flutter/material.dart';
import 'package:project_telephony/utils/headers.dart';
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; //
// final String content; //
// final bool? showCancel;
// final OnDialogClickListener? clickListener;
const AppDialog( // this.showCancel,
// this.clickListener,
{
Key? key,
this.title = "恭喜您获得会员体验卡",
this.confirm = "立即领取",
// this.content = "内容",
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(horizontal: 95.w,vertical: 452.w),
decoration: BoxDecoration(
image:
DecorationImage(image: AssetImage(Assets.images.bouncedbg.path))),
child: Column(
children: [
32.hb,
Text(
title,
style: TextStyle(
fontSize: 36.sp,
),
),
80.hb,
_getVip(),
218.hb,
Row(
children: [
72.wb,
_getText("接听发送"),
64.wb,
_getText("拒接发送"),
64.wb,
_getText("提升形象"),
],
),
50.hb,
_getBotton(confirm, context),
],
),
);
/**/
//
// Stack(
// children: [
// Align(
// child: Image.asset(
// Assets.images.bouncedbg.path,
// width: 560.w,
// height: 720.w,
// fit: BoxFit.fill,
// ),
// ),
// Positioned(
// top: 64.w,
// left: 100.w,
// child: Text(
// title,
// style: TextStyle(
// fontSize: 36.sp,
// ),
// )),
// Positioned(top: 108.w, left: 96.w, child: _getVip()),
// Positioned(
// child: Row(
// children: [
// _getText("接听发送"),
// 64.wb,
// _getText("拒接发送"),
// 64.wb,
// _getText("提升形象"),
// ],
// )),
// Positioned(child: _getBotton(confirm, context)),
// ],
// );
}
}
_getBotton(String bContent, context) {
return GestureDetector(
onTap: () async{
var res=await apiClient.request(API.app.trialVip);
if(res.code==0){
// showDialog(context: context, builder: (context){
// return const AppDialog();
// });
CloudToast.show(res.msg);
// BoxShadow.show(res.msg);
}else{
CloudToast.show(res.msg);
Navigator.pop(context);
}
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 64.w),
padding: EdgeInsets.symmetric(horizontal: 155.w,vertical: 28.w),
height: 88.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12.w),
gradient: const LinearGradient(
colors: [Color(0xFFFFEAB0), Color(0xFFFFF6D8)],
end: Alignment.centerLeft,
begin: Alignment.centerRight)),
child: Text(
bContent,
style: TextStyle(fontSize: 28.sp,fontWeight:FontWeight.bold),
),
),
);
}
_getText(String content) {
return Text(
content,
style: TextStyle(color: const Color(0xFF1890FF), fontSize: 24.w),
);
}
_getVip() {
return SizedBox(
width: 370.w,
height: 100.w,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text.rich(TextSpan(children: [
TextSpan(
text: "03",
style: TextStyle(
color: const Color(0xFFFFEAB0),
fontSize: 56.sp,
fontFamily: "BlackItalic",
fontWeight: FontWeight.bold)),
TextSpan(
text: "",
style: TextStyle(
color: const Color(0xFFFFEAB0),
fontSize: 24.sp,
// height: 1.0,
))
])),
const Spacer(),
Column(
children: [
Text(
"VIP",
style: TextStyle(
color: const Color(0xFFE7F3FF),
fontSize: 32.sp,
fontFamily: "BlackItalic",
fontWeight: FontWeight.bold),
)
],
)
],
),
Text(
"短信帮手会员体验卡",
style: TextStyle(
color: const Color(0xFFFFEAB0),
fontSize: 24.sp,
),
)
],
),
);
}
// abstract class OnDialogClickListener {
// void onConfirm();
//
// void onCancel();
// }

@ -93,6 +93,7 @@ dependencies:
url_launcher: ^6.1.5
#tabBar样式切换
tab_indicator_styler: ^2.0.0
# # jdk
# jverify: ^2.2.5
## pub 集成

Loading…
Cancel
Save