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

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

@ -33,20 +33,6 @@ class _CallListPageState extends State<CallListPage> {
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
Widget build(BuildContext context) {
return Scaffold(

@ -8,6 +8,8 @@ import 'package:project_telephony/utils/headers.dart';
import 'package:project_telephony/utils/toast/cloud_toast.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 'address_book.dart';
@ -32,6 +34,16 @@ class _TextMePageState extends State<TextMePage> {
_phoneController = TextEditingController();
_controller.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();
}
@ -58,8 +70,7 @@ class _TextMePageState extends State<TextMePage> {
body: ListView(
children: [
_getBox('短信内容', "选择短信模版", () {
Get.to(() =>
TextTemplate(
Get.to(() => TextTemplate(
callback: (String content) {
_controller.text = content;
},
@ -67,12 +78,13 @@ class _TextMePageState extends State<TextMePage> {
}, "请输入短信内容...", _controller),
32.hb,
_getBox('收信号码', "通讯录中选择", () {
Get.to(() =>
AddressBook(number: (List<String> content) {
for(int i=0;i<content.length;i++){
_phoneController.text +="${content[i]},";
}
},));
Get.to(() => AddressBook(
number: (List<String> content) {
for (int i = 0; i < content.length; i++) {
_phoneController.text += "${content[i]},";
}
},
));
}, "请输入收信号码多个号码请用逗号隔开例如136xxxx6666132xxxx8888", _phoneController),
32.hb,
_getBox2(),
@ -80,33 +92,37 @@ class _TextMePageState extends State<TextMePage> {
PloneBottom(
onTap: () async {
// final Telephony telephony = Telephony.instance;
if (_controller.text.isEmpty &&
_phoneController.text.isEmpty &&
signatureText.isEmpty) {
CloudToast.show("内容不可为空");
} else {
print(_controller.text);
print(_phoneController.text);
print(signatureText);
await sendSMS(
message: "$signatureText${_controller.text}",
recipients: _phoneController.text.split(","),
sendDirect: true);
// print("asd${_phoneController.text.split(",")}");
// await telephony.sendSms(
// to: "13486828191;13395740386;18815060992;18294841148",
// message: "$signatureText${_controller.text}"
// );
CloudToast.show("发送成功");
// Telephony.sendSms(to: phoneNum!, message: idle);
if(UserTool.userProvider.userInfo.isVip ==1){
if (_controller.text.isEmpty &&
_phoneController.text.isEmpty &&
signatureText.isEmpty) {
CloudToast.show("内容不可为空");
} else {
print(_controller.text);
print(_phoneController.text);
print(signatureText);
await sendSMS(
message: "$signatureText${_controller.text}",
recipients: _phoneController.text.split(","),
sendDirect: true);
// print("asd${_phoneController.text.split(",")}");
// await telephony.sendSms(
// to: "13486828191;13395740386;18815060992;18294841148",
// message: "$signatureText${_controller.text}"
// );
CloudToast.show("发送成功");
// Telephony.sendSms(to: phoneNum!, message: idle);
}
}else{
CloudToast.show("");
}
},
border: _controller.text.isEmpty ||
_phoneController.text.isEmpty ||
signatureText.isEmpty,
opacity: _controller.text.isEmpty ||
_phoneController.text.isEmpty ||
signatureText.isEmpty
_phoneController.text.isEmpty ||
signatureText.isEmpty
? 0.4
: 1,
text: "发送",
@ -176,7 +192,6 @@ class _TextMePageState extends State<TextMePage> {
_controller.text = text;
} else {
_phoneController.text = text;
}
setState(() {});
},

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

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

@ -1,5 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:project_telephony/ui/login/login_page.dart';
import 'package:project_telephony/ui/tab_navigator.dart';
import 'dart:async';
@ -25,18 +26,10 @@ class _LoadingState extends State<Loading> {
void initState() {
super.initState();
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 {
// await initialAll();
if (!await userProvider.init()) {
await Get.offAll(() => const TabNavigator());
await Get.offAll(() => const LoginPage());
// await Get.offAll(() => const LoginPage());
} else {
Navigator.of(context).pushReplacementNamed("/TabNavigator");

Loading…
Cancel
Save