|
|
@ -1,9 +1,17 @@
|
|
|
|
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
import 'package:get/get_core/src/get_main.dart';
|
|
|
|
import 'package:project_telephony/ui/widget/scaffold_theme_widget.dart';
|
|
|
|
import 'package:project_telephony/ui/widget/scaffold_theme_widget.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import '../../constants/api.dart';
|
|
|
|
|
|
|
|
import '../../model/exclude_phone_model.dart';
|
|
|
|
|
|
|
|
import '../../model/network/api_client.dart';
|
|
|
|
|
|
|
|
import '../../model/network/base_model.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class ExcludeSinglePage extends StatefulWidget {
|
|
|
|
class ExcludeSinglePage extends StatefulWidget {
|
|
|
|
const ExcludeSinglePage({Key? key}) : super(key: key);
|
|
|
|
const ExcludeSinglePage({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
@ -35,13 +43,27 @@ class _ExcludeSinglePageState extends State<ExcludeSinglePage> {
|
|
|
|
wid: 110,
|
|
|
|
wid: 110,
|
|
|
|
title: '添加单个或批量号码',
|
|
|
|
title: '添加单个或批量号码',
|
|
|
|
bottom: "添加",
|
|
|
|
bottom: "添加",
|
|
|
|
onTap: () {
|
|
|
|
onTap: () async {
|
|
|
|
|
|
|
|
if (_phoneController.text.isEmpty) {
|
|
|
|
|
|
|
|
BotToast.showText(text: "未输入手机号");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
BaseModel res = await apiClient.request(
|
|
|
|
|
|
|
|
API.exclude.add,
|
|
|
|
|
|
|
|
data: {
|
|
|
|
|
|
|
|
'exclude': [Exclude(
|
|
|
|
|
|
|
|
phone: _phoneController.text,
|
|
|
|
|
|
|
|
remark: _nameController.text,
|
|
|
|
|
|
|
|
)],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
BotToast.showText(text: res.msg);
|
|
|
|
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
|
|
|
Get.back();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isOpacity:
|
|
|
|
isOpacity:
|
|
|
|
_phoneController.text.isNotEmpty && _nameController.text.isNotEmpty,
|
|
|
|
_phoneController.text.isNotEmpty || _nameController.text.isNotEmpty,
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(top: 25.h, left: 50.w, right: 50.w),
|
|
|
|
padding: EdgeInsets.only(top: 25.h, left: 50.w, right: 50.w),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
@ -62,7 +84,6 @@ class _ExcludeSinglePageState extends State<ExcludeSinglePage> {
|
|
|
|
color: Colors.black38,
|
|
|
|
color: Colors.black38,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
TextSpan(
|
|
|
|
TextSpan(
|
|
|
|
text: "如输入000*,可屏蔽所有000开头的号码",
|
|
|
|
text: "如输入000*,可屏蔽所有000开头的号码",
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
@ -84,7 +105,7 @@ class _ExcludeSinglePageState extends State<ExcludeSinglePage> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 28.sp,
|
|
|
|
fontSize: 28.sp,
|
|
|
|
color: const Color(0xFF999999),
|
|
|
|
color: const Color(0xFF999999),
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
@ -99,7 +120,7 @@ class _ExcludeSinglePageState extends State<ExcludeSinglePage> {
|
|
|
|
decoration: InputDecoration(
|
|
|
|
decoration: InputDecoration(
|
|
|
|
contentPadding: EdgeInsets.all(30.w),
|
|
|
|
contentPadding: EdgeInsets.all(30.w),
|
|
|
|
hintText: content,
|
|
|
|
hintText: content,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
fontSize: 28.sp,
|
|
|
|
fontSize: 28.sp,
|
|
|
|
// fontWeight: FontWeight.w600,
|
|
|
|
// fontWeight: FontWeight.w600,
|
|
|
|
color: const Color(0xFF999999),
|
|
|
|
color: const Color(0xFF999999),
|
|
|
|