master
王亚玲 2 years ago
parent 339034f3c8
commit e2063d83d5

@ -58,6 +58,11 @@ class UserProvider extends ChangeNotifier {
prefs.setInt("numIndex", 0); prefs.setInt("numIndex", 0);
_viewLoading(); _viewLoading();
UserTool.phoneNumProvider.init(); UserTool.phoneNumProvider.init();
prefs.setStringList("dxText", [
"祝你万事顺心",
"欢迎你的来电,祝你生活愉快",
"感谢您的来电,我们会尽快处理",
]);
// prefs.setStringList("dxText",["祝你万事顺心","欢迎你的来电,祝你生活愉快","感谢您的来电,我们会尽快处理",]); // prefs.setStringList("dxText",["祝你万事顺心","欢迎你的来电,祝你生活愉快","感谢您的来电,我们会尽快处理",]);
updateConSms(); updateConSms();
updateRefSms(); updateRefSms();

@ -33,20 +33,6 @@ class _CallListPageState extends State<CallListPage> {
super.dispose(); super.dispose();
} }
@override
void initState() {
if (UserTool.userProvider.isLogin) {
if (UserTool.userProvider.userInfo.isVip != 1) {
//service.isRunning() as bool;
// endDate = DateUtil.formatDateMs(
// UserTool.userProvider.userInfo.end * 1000,
// format: DateFormats.y_mo_d);
} else {
Get.to(() => const LoginPage());
}
super.initState();
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(

@ -8,6 +8,8 @@ import 'package:project_telephony/utils/headers.dart';
import 'package:project_telephony/utils/toast/cloud_toast.dart'; import 'package:project_telephony/utils/toast/cloud_toast.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import '../../utils/user_tool.dart';
import '../login/login_page.dart';
import '../widget/plone_back_button.dart'; import '../widget/plone_back_button.dart';
import 'address_book.dart'; import 'address_book.dart';
@ -32,6 +34,16 @@ class _TextMePageState extends State<TextMePage> {
_phoneController = TextEditingController(); _phoneController = TextEditingController();
_controller.text = ""; _controller.text = "";
_phoneController.text = ""; _phoneController.text = "";
/* Future.delayed(const Duration(seconds: 0),(){
if (UserTool.userProvider.isLogin) {
_controller = TextEditingController();
_phoneController = TextEditingController();
_controller.text = "";
_phoneController.text = "";
} else {
Get.to(() => const LoginPage());
}
});*/
super.initState(); super.initState();
} }
@ -58,8 +70,7 @@ class _TextMePageState extends State<TextMePage> {
body: ListView( body: ListView(
children: [ children: [
_getBox('短信内容', "选择短信模版", () { _getBox('短信内容', "选择短信模版", () {
Get.to(() => Get.to(() => TextTemplate(
TextTemplate(
callback: (String content) { callback: (String content) {
_controller.text = content; _controller.text = content;
}, },
@ -67,12 +78,13 @@ class _TextMePageState extends State<TextMePage> {
}, "请输入短信内容...", _controller), }, "请输入短信内容...", _controller),
32.hb, 32.hb,
_getBox('收信号码', "通讯录中选择", () { _getBox('收信号码', "通讯录中选择", () {
Get.to(() => Get.to(() => AddressBook(
AddressBook(number: (List<String> content) { number: (List<String> content) {
for(int i=0;i<content.length;i++){ for (int i = 0; i < content.length; i++) {
_phoneController.text +="${content[i]},"; _phoneController.text += "${content[i]},";
} }
},)); },
));
}, "请输入收信号码多个号码请用逗号隔开例如136xxxx6666132xxxx8888", _phoneController), }, "请输入收信号码多个号码请用逗号隔开例如136xxxx6666132xxxx8888", _phoneController),
32.hb, 32.hb,
_getBox2(), _getBox2(),
@ -80,6 +92,7 @@ class _TextMePageState extends State<TextMePage> {
PloneBottom( PloneBottom(
onTap: () async { onTap: () async {
// final Telephony telephony = Telephony.instance; // final Telephony telephony = Telephony.instance;
if(UserTool.userProvider.userInfo.isVip ==1){
if (_controller.text.isEmpty && if (_controller.text.isEmpty &&
_phoneController.text.isEmpty && _phoneController.text.isEmpty &&
signatureText.isEmpty) { signatureText.isEmpty) {
@ -100,6 +113,9 @@ class _TextMePageState extends State<TextMePage> {
CloudToast.show("发送成功"); CloudToast.show("发送成功");
// Telephony.sendSms(to: phoneNum!, message: idle); // Telephony.sendSms(to: phoneNum!, message: idle);
} }
}else{
CloudToast.show("");
}
}, },
border: _controller.text.isEmpty || border: _controller.text.isEmpty ||
_phoneController.text.isEmpty || _phoneController.text.isEmpty ||
@ -176,7 +192,6 @@ class _TextMePageState extends State<TextMePage> {
_controller.text = text; _controller.text = text;
} else { } else {
_phoneController.text = text; _phoneController.text = text;
} }
setState(() {}); setState(() {});
}, },

@ -26,6 +26,7 @@ class _TextTemplateState extends State<TextTemplate> {
List<String> textList = []; List<String> textList = [];
@override
void initState() { void initState() {
addText(); addText();
super.initState(); super.initState();

@ -96,7 +96,6 @@ class _AddSmsPageState extends State<AddSmsPage> {
border: _controller.text.isEmpty, border: _controller.text.isEmpty,
opacity: contant.isEmpty ? 0.4 : 1, opacity: contant.isEmpty ? 0.4 : 1,
onTap: () async { onTap: () async {
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
List<String>? contentList=prefs.getStringList("dxText"); List<String>? contentList=prefs.getStringList("dxText");
if(widget.qfBool){ if(widget.qfBool){

@ -1,5 +1,6 @@
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:project_telephony/ui/login/login_page.dart';
import 'package:project_telephony/ui/tab_navigator.dart'; import 'package:project_telephony/ui/tab_navigator.dart';
import 'dart:async'; import 'dart:async';
@ -25,18 +26,10 @@ class _LoadingState extends State<Loading> {
void initState() { void initState() {
super.initState(); super.initState();
final userProvider = Provider.of<UserProvider>(context, listen: false); final userProvider = Provider.of<UserProvider>(context, listen: false);
// var env = const String.fromEnvironment('ENV', defaultValue: 'dev');
// if (kDebugMode) {
// print('env :$env');
// }
// DevEV.instance.setEnvironment(
// context,
// environment: env == 'dev',
// );
Future.delayed(const Duration(milliseconds: 1000), () async { Future.delayed(const Duration(milliseconds: 1000), () async {
// await initialAll(); // await initialAll();
if (!await userProvider.init()) { if (!await userProvider.init()) {
await Get.offAll(() => const TabNavigator()); await Get.offAll(() => const LoginPage());
// await Get.offAll(() => const LoginPage()); // await Get.offAll(() => const LoginPage());
} else { } else {
Navigator.of(context).pushReplacementNamed("/TabNavigator"); Navigator.of(context).pushReplacementNamed("/TabNavigator");

Loading…
Cancel
Save