|
|
|
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)),
|
...
|
...
|
|