Commit 851b226663a0c737706b02b1674bcaace0174385

Authored by wdn127929
1 parent 6d85073f

短信

/**
* 页面状态
*/
enum PageState{
Loading,//加载中
ConnectivityTimeOut,//请求超时
ConnectivityError,//请求错误
Empty,//空页面
NoPermission,//没有权限
enum PageState {
Loading, //加载中
ConnectivityTimeOut, //请求超时
ConnectivityError, //请求错误
Empty, //空页面
NoPermission, //没有权限
First,
Success//成功
Statics,//统计页
Success //成功
}
... ...
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/provider/statistics_provider.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/page_exception.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
typedef ClickCallback = void Function(String value);
enum TimeType { TimeTypeStart, TimeTypeEnd, TimeTypeDefalt }
... ... @@ -153,101 +158,186 @@ class _StatisticsPageState extends State<StatisticsPage> {
),
body: Stack(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VEmptyView(100),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
color: MyColours.color_f5f5f5,
// width: double.infinity,
height: ScreenUtil().setWidth(80),
child: Row(
children: [
Text(
'显示前 ',
style: TextStyle(
fontSize: ScreenUtil().setSp(26),
color: MyColours.color_333333),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(20)),
// alignment: Alignment.centerLeft,
// height: ScreenUtil().setWidth(80),
constraints: BoxConstraints(
maxWidth: ScreenUtil().setWidth(50 * 2)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color: MyColours.color_199095))),
child: IntrinsicWidth(
child: TextField(
controller: controller,
maxLines: 1,
// inputFormatters: [
// LengthLimitingTextInputFormatter(9),
// WhitelistingTextInputFormatter.digitsOnly
// ],
// inputFormatters: [
// NumLengthInputFormatter(
// decimalLength: 2, integerLength: 6),
// ],
// focusNode: numberFocusNode,
//光标颜色
cursorColor: MyColours.color_199095,
//输入文本的样式
Consumer<StatisticsProvider>(builder: (context, model, _) {
if (model.pageState != PageState.Success) {
return Column(
children: [
VEmptyView(100),
Expanded(
child: ExceptionPage(
pageState: model.pageState,
callback: () {
// offset = 0;
// getMessage(showLoading: true);
},
emptyMsg: model.pageState == PageState.Statics
? "请选择日期和排序条件"
: "暂时没有列表信息哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
))
],
);
} else {
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
VEmptyView(100),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
color: MyColours.color_f5f5f5,
// width: double.infinity,
height: ScreenUtil().setWidth(80),
child: Row(
children: [
Text(
'显示前 ',
style: TextStyle(
fontSize: ScreenUtil().setSp(26),
color: MyColours.color_199095),
textAlign: TextAlign.center,
textInputAction: TextInputAction.done,
decoration: InputDecoration(
isDense: true,
hintText: "输入",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(26),
),
color: MyColours.color_333333),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(20)),
// alignment: Alignment.centerLeft,
// height: ScreenUtil().setWidth(80),
constraints: BoxConstraints(
maxWidth: ScreenUtil().setWidth(50 * 2)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color: MyColours.color_199095))),
child: IntrinsicWidth(
child: TextField(
controller: controller,
maxLines: 1,
// inputFormatters: [
// LengthLimitingTextInputFormatter(9),
// WhitelistingTextInputFormatter.digitsOnly
// ],
// inputFormatters: [
// NumLengthInputFormatter(
// decimalLength: 2, integerLength: 6),
// ],
// focusNode: numberFocusNode,
contentPadding: EdgeInsets.zero, //ios 17
border: InputBorder.none,
//光标颜色
cursorColor: MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(26),
color: MyColours.color_199095),
textAlign: TextAlign.center,
textInputAction: TextInputAction.done,
decoration: InputDecoration(
isDense: true,
hintText: "输入",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(26),
),
contentPadding: EdgeInsets.zero, //ios 17
border: InputBorder.none,
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
// _updateMoney();
},
keyboardType: TextInputType.numberWithOptions(
decimal: true),
)))
],
)),
//表头
_tableItem(
tableHeaderModel, 3, TableItemType.TableItemTypeHeader),
Expanded(
child: ListView.builder(
itemCount: 100,
itemBuilder: (BuildContext context, int index) {
StaticsModel tableHeaderModel1 = StaticsModel();
tableHeaderModel1.select = true;
tableHeaderModel1.numstr = '$index';
tableHeaderModel1.name = '某某';
tableHeaderModel1.phone = '1879097890';
tableHeaderModel1.count = '${index}次';
return _tableItem(tableHeaderModel1, index,
TableItemType.TableItemTypeBody);
})),
Container(
alignment: Alignment.centerRight,
height: ScreenUtil().setWidth(42 * 2),
width: ScreenUtil().setWidth(110 * 4 + 4),
margin: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(16),
horizontal: ScreenUtil().setWidth(40)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(42)),
border: Border.all(
width: ScreenUtil().setWidth(2),
color: MyColours.color_199095)),
child: Row(
children: [
Container(
width: ScreenUtil().setWidth(110 * 2),
height: ScreenUtil().setWidth(42 * 2),
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(
ScreenUtil().setWidth(42)),
bottomLeft: Radius.circular(
ScreenUtil().setWidth(42))),
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
// _updateMoney();
},
keyboardType:
TextInputType.numberWithOptions(decimal: true),
)))
],
)),
//表头
_tableItem(
tableHeaderModel, 3, TableItemType.TableItemTypeHeader),
Expanded(
child: ListView.builder(
itemCount: 100,
itemBuilder: (BuildContext context, int index) {
StaticsModel tableHeaderModel1 = StaticsModel();
tableHeaderModel1.select = true;
tableHeaderModel1.numstr = '$index';
tableHeaderModel1.name = '某某';
tableHeaderModel1.phone = '1879097890';
tableHeaderModel1.count = '${index}次';
return _tableItem(tableHeaderModel1, index,
TableItemType.TableItemTypeBody);
}))
],
),
child: Text(
'发优惠券',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_199095),
)),
InkWell(
onTap: () {
NavigatorUtil.goStatisticsSmsPage(context);
},
child: Container(
width: ScreenUtil().setWidth(110 * 2),
height: ScreenUtil().setWidth(42 * 2),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_199095,
borderRadius: BorderRadius.only(
topRight: Radius.circular(
ScreenUtil().setWidth(42)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(42))),
),
child: Text(
'发短信',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_ffffff),
)),
)
],
),
)
],
);
}
}),
Padding(
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
class StatisticsSmsPage extends StatefulWidget {
StatisticsSmsPage({Key key}) : super(key: key);
@override
_StatisticsSmsPageState createState() => _StatisticsSmsPageState();
}
class _StatisticsSmsPageState extends State<StatisticsSmsPage> {
///文本
Widget _textWidget(String title, {Color textColor = MyColours.color_333333}) {
return Container(
// alignment: Alignment.center,
height: ScreenUtil().setWidth(40),
child: Text(
title,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(28),
color: textColor),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_f5f5f5,
appBar: SystemAppBar(
'短信营销',
onTap: () {
Navigator.pop(context);
},
),
body: Column(children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30),
vertical: ScreenUtil().setWidth(20)),
child: Column(children: [
Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: MyColours.color_e5e5e5,
blurRadius: ScreenUtil().setWidth(30))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(20)),
)),
child: Column(
children: [
Container(
height: ScreenUtil().setWidth(100),
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(30),
left: ScreenUtil().setWidth(30),
right: ScreenUtil().setWidth(30),
bottom: ScreenUtil().setWidth(20)),
decoration: BoxDecoration(
color: MyColours.color_F9F9F9,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(
ScreenUtil().setWidth(20)),
topRight: Radius.circular(
ScreenUtil().setWidth(20)),
)),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
_textWidget('当前已选择'),
_textWidget('33',
textColor: MyColours.color_199095),
_textWidget('人/短信剩余条数'),
_textWidget('33',
textColor: MyColours.color_199095),
_textWidget('条')
]),
),
Container(
// height: ScreenUtil().setWidth(140 * 2),
padding: EdgeInsets.all(
ScreenUtil().setWidth(30),
),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(
ScreenUtil().setWidth(20)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(20)),
)),
child: TextField(
// controller: controller,
maxLines: 5,
// inputFormatters: [
// LengthLimitingTextInputFormatter(9),
// WhitelistingTextInputFormatter.digitsOnly
// ],
// inputFormatters: [
// NumLengthInputFormatter(
// decimalLength: 2, integerLength: 6),
// ],
// focusNode: numberFocusNode,
//光标颜色
cursorColor: MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_333333),
textAlign: TextAlign.left,
textInputAction: TextInputAction.done,
decoration: InputDecoration(
isDense: true,
hintText: "请输入要发送的短信内容",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(32),
),
contentPadding: EdgeInsets.zero, //ios 17
border: InputBorder.none,
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
// _updateMoney();
},
keyboardType: TextInputType.text,
))
],
)),
VEmptyView(20),
Container(
// height: ScreenUtil().setWidth(146 * 2),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: MyColours.color_e5e5e5,
blurRadius: ScreenUtil().setWidth(30))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(20)),
)),
child: Column(
children: [
Container(
width: double.infinity,
height: ScreenUtil().setWidth(100),
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(30),
left: ScreenUtil().setWidth(30),
right: ScreenUtil().setWidth(30),
bottom: ScreenUtil().setWidth(20)),
decoration: BoxDecoration(
color: MyColours.color_F9F9F9,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(
ScreenUtil().setWidth(20)),
topRight: Radius.circular(
ScreenUtil().setWidth(20)),
)),
child: _textWidget('店铺名称名称'),
),
Container(
// height: ScreenUtil().setWidth(140 * 2),
padding: EdgeInsets.all(
ScreenUtil().setWidth(30),
),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(
ScreenUtil().setWidth(20)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(20)),
)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Row(
children: [
Image.asset(
Utils.getImgPath('phonesms'),
width: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(40),
),
HEmptyView(60),
Expanded(
child: TextField(
// controller: controller,
maxLines: 1,
// inputFormatters: [
// LengthLimitingTextInputFormatter(9),
// WhitelistingTextInputFormatter.digitsOnly
// ],
// inputFormatters: [
// NumLengthInputFormatter(
// decimalLength: 2, integerLength: 6),
// ],
// focusNode: numberFocusNode,
//光标颜色
cursorColor: MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize:
ScreenUtil().setSp(32),
color: MyColours.color_333333),
textAlign: TextAlign.left,
textInputAction:
TextInputAction.done,
decoration: InputDecoration(
isDense: true,
hintText: "请输入电话",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize:
ScreenUtil().setSp(32),
),
contentPadding:
EdgeInsets.zero, //ios 17
border: InputBorder.none,
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(
FocusNode()); //隐藏键盘
// _updateMoney();
},
keyboardType: TextInputType.text,
))
],
),
VEmptyView(30),
MyDivider(
ScreenUtil().setWidth(264 * 2),
ScreenUtil().setWidth(2),
color: MyColours.color_F0F0F0,
),
VEmptyView(20),
Text(
'审核结果会以电话/短信的方式通知',
style: TextStyle(
fontSize: ScreenUtil().setSp(26),
color: MyColours.color_199095),
),
],
))
],
)),
])))),
Padding(
padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
child: RoundButton(
height: ScreenUtil().setWidth(80),
text: '提交审核',
radius: ScreenUtil().setWidth(10),
fontSize: 34,
isBold: false,
),
),
VEmptyView(40)
]),
);
}
}
... ...
import 'package:flutter/material.dart';
import 'package:one_key/constant/state.dart';
class StatisticsProvider with ChangeNotifier {}
class StatisticsProvider with ChangeNotifier {
PageState pageState = PageState.Success;
}
... ...
... ... @@ -325,4 +325,11 @@ class NavigatorUtil {
{replace = false}) {
return _navigateTo(context, "${Routes.statistics_page}", replace: replace);
}
/// 统计发短信
static Future<dynamic> goStatisticsSmsPage(BuildContext context,
{replace = false}) {
return _navigateTo(context, "${Routes.statistics_sms_page}",
replace: replace);
}
}
... ...
... ... @@ -39,6 +39,7 @@ import 'package:one_key/pages/my/my_integral_page.dart';
import 'package:one_key/pages/my/receive_orders_time_set.dart';
import 'package:one_key/pages/my/remark_manager_page.dart';
import 'package:one_key/pages/notebook/statistics_page.dart';
import 'package:one_key/pages/notebook/statistics_sms_page.dart';
import 'package:one_key/pages/online_check/invoice_detail_page.dart';
import 'package:one_key/pages/online_check/online_check_detail_page.dart';
import 'package:one_key/pages/online_check/online_check_edit_page.dart';
... ... @@ -485,3 +486,16 @@ var statisticsPageHandler = new Handler(
// return ChangeNotifierProvider<UploadImageProvider>(
// create: (_) => UploadImageProvider(), child: EnterStoreFrontPhotoPage());
});
///统计
var statisticsSmsPageHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
// CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode(
// FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first)));
// String tid = params["tid"].first;
// String tname = params["tname"].first;
return ChangeNotifierProvider<StatisticsProvider>(
create: (_) => StatisticsProvider(), child: StatisticsSmsPage());
// return ChangeNotifierProvider<UploadImageProvider>(
// create: (_) => UploadImageProvider(), child: EnterStoreFrontPhotoPage());
});
... ...
... ... @@ -45,6 +45,7 @@ class Routes {
static String my_contant_page = "/my_contant_page"; //我的联系人
static String table_photo_manager = "/table_photo_manager"; //桌位照片管理
static String statistics_page = "/statistics_page"; //统计页
static String statistics_sms_page = "/statistics_sms_page"; //统计页发短信
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
... ... @@ -97,5 +98,6 @@ class Routes {
router.define(my_contant_page, handler: myContantPageHandler);
router.define(table_photo_manager, handler: tablePhotoManagerHandler);
router.define(statistics_page, handler: statisticsPageHandler);
router.define(statistics_sms_page, handler: statisticsSmsPageHandler);
}
}
... ...
... ... @@ -7,8 +7,14 @@ import 'package:one_key/widgets/v_empty_view.dart';
class EmptyPage extends StatefulWidget {
final String content;
final String imgname;
final Color bgcolor;
const EmptyPage({Key key, this.content, this.imgname = "bg_error"}) : super(key: key);
const EmptyPage(
{Key key,
this.content,
this.imgname = "bg_error",
this.bgcolor = MyColours.color_ffffff})
: super(key: key);
@override
State<StatefulWidget> createState() {
... ... @@ -22,36 +28,36 @@ class EmptyPageState extends State<EmptyPage> {
Widget build(BuildContext context) {
// TODO: implement build
return Container(
width: double.infinity,
height: double.infinity,
child: Stack(
children: <Widget>[
Container(
width: double.infinity,
height: double.infinity,
margin: EdgeInsets.only(top: ScreenUtil().setWidth(132)),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Image.asset(
Utils.getImgPath(widget.imgname),
width: ScreenUtil().setWidth(520),
height: ScreenUtil().setWidth(384),
),
VEmptyView(40),
Text(
widget.content ?? "数据为空",
textAlign: TextAlign.center,
strutStyle: StrutStyle(leading: ScreenUtil().setWidth(1)),
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_353535),
)
],
width: double.infinity,
height: double.infinity,
color: widget.bgcolor,
child: Stack(
children: <Widget>[
Container(
width: double.infinity,
height: double.infinity,
margin: EdgeInsets.only(top: ScreenUtil().setWidth(132)),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Image.asset(
Utils.getImgPath(widget.imgname),
width: ScreenUtil().setWidth(520),
height: ScreenUtil().setWidth(384),
),
VEmptyView(40),
Text(
widget.content ?? "数据为空",
textAlign: TextAlign.center,
strutStyle: StrutStyle(leading: ScreenUtil().setWidth(1)),
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_353535),
)
],
),
),
),
],
)
);
],
));
}
}
... ...
... ... @@ -76,6 +76,13 @@ class ExceptionPageState extends State<ExceptionPage> {
btnTitle: '开启权限',
);
break;
case PageState.Statics:
page = EmptyPage(
content: widget.emptyMsg,
imgname: widget.emptyImg,
bgcolor: MyColours.color_f5f5f5,
);
break;
default:
page = ErrorPage(
content: "哎呀~网络好像走失了呢",
... ...