|
|
@ -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]},";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},));
|
|
|
|
},
|
|
|
|
|
|
|
|
));
|
|
|
|
}, "请输入收信号码,多个号码请用逗号隔开
例如:136xxxx6666,132xxxx8888", _phoneController),
|
|
|
|
}, "请输入收信号码,多个号码请用逗号隔开
例如:136xxxx6666,132xxxx8888", _phoneController),
|
|
|
|
32.hb,
|
|
|
|
32.hb,
|
|
|
|
_getBox2(),
|
|
|
|
_getBox2(),
|
|
|
@ -80,33 +92,37 @@ class _TextMePageState extends State<TextMePage> {
|
|
|
|
PloneBottom(
|
|
|
|
PloneBottom(
|
|
|
|
onTap: () async {
|
|
|
|
onTap: () async {
|
|
|
|
// final Telephony telephony = Telephony.instance;
|
|
|
|
// final Telephony telephony = Telephony.instance;
|
|
|
|
if (_controller.text.isEmpty &&
|
|
|
|
if(UserTool.userProvider.userInfo.isVip ==1){
|
|
|
|
_phoneController.text.isEmpty &&
|
|
|
|
if (_controller.text.isEmpty &&
|
|
|
|
signatureText.isEmpty) {
|
|
|
|
_phoneController.text.isEmpty &&
|
|
|
|
CloudToast.show("内容不可为空");
|
|
|
|
signatureText.isEmpty) {
|
|
|
|
} else {
|
|
|
|
CloudToast.show("内容不可为空");
|
|
|
|
print(_controller.text);
|
|
|
|
} else {
|
|
|
|
print(_phoneController.text);
|
|
|
|
print(_controller.text);
|
|
|
|
print(signatureText);
|
|
|
|
print(_phoneController.text);
|
|
|
|
await sendSMS(
|
|
|
|
print(signatureText);
|
|
|
|
message: "【$signatureText】${_controller.text}",
|
|
|
|
await sendSMS(
|
|
|
|
recipients: _phoneController.text.split(","),
|
|
|
|
message: "【$signatureText】${_controller.text}",
|
|
|
|
sendDirect: true);
|
|
|
|
recipients: _phoneController.text.split(","),
|
|
|
|
// print("asd${_phoneController.text.split(",")}");
|
|
|
|
sendDirect: true);
|
|
|
|
// await telephony.sendSms(
|
|
|
|
// print("asd${_phoneController.text.split(",")}");
|
|
|
|
// to: "13486828191;13395740386;18815060992;18294841148",
|
|
|
|
// await telephony.sendSms(
|
|
|
|
// message: "【$signatureText】${_controller.text}"
|
|
|
|
// to: "13486828191;13395740386;18815060992;18294841148",
|
|
|
|
// );
|
|
|
|
// message: "【$signatureText】${_controller.text}"
|
|
|
|
CloudToast.show("发送成功");
|
|
|
|
// );
|
|
|
|
// Telephony.sendSms(to: phoneNum!, message: idle);
|
|
|
|
CloudToast.show("发送成功");
|
|
|
|
|
|
|
|
// Telephony.sendSms(to: phoneNum!, message: idle);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
CloudToast.show("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
border: _controller.text.isEmpty ||
|
|
|
|
border: _controller.text.isEmpty ||
|
|
|
|
_phoneController.text.isEmpty ||
|
|
|
|
_phoneController.text.isEmpty ||
|
|
|
|
signatureText.isEmpty,
|
|
|
|
signatureText.isEmpty,
|
|
|
|
opacity: _controller.text.isEmpty ||
|
|
|
|
opacity: _controller.text.isEmpty ||
|
|
|
|
_phoneController.text.isEmpty ||
|
|
|
|
_phoneController.text.isEmpty ||
|
|
|
|
signatureText.isEmpty
|
|
|
|
signatureText.isEmpty
|
|
|
|
? 0.4
|
|
|
|
? 0.4
|
|
|
|
: 1,
|
|
|
|
: 1,
|
|
|
|
text: "发送",
|
|
|
|
text: "发送",
|
|
|
@ -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(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|