|
|
|
@ -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]},";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
));
|
|
|
|
|
}, "请输入收信号码,多个号码请用逗号隔开
例如:136xxxx6666,132xxxx8888", _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(() {});
|
|
|
|
|
},
|
|
|
|
|