Commit 18dc71fb6bc10397523aa110e1633a7a2f5d7342

Authored by wdn127929
1 parent 42f05758

UI 3

@@ -5,6 +5,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -5,6 +5,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
5 import 'package:one_key/models/user_history_entity.dart'; 5 import 'package:one_key/models/user_history_entity.dart';
6 import 'package:one_key/provider/customer_provider.dart'; 6 import 'package:one_key/provider/customer_provider.dart';
7 import 'package:one_key/res/colors.dart'; 7 import 'package:one_key/res/colors.dart';
  8 +import 'package:one_key/route/navigator_util.dart';
8 import 'package:one_key/utils/utils.dart'; 9 import 'package:one_key/utils/utils.dart';
9 import 'package:one_key/widgets/h_empty_view.dart'; 10 import 'package:one_key/widgets/h_empty_view.dart';
10 import 'package:one_key/widgets/v_empty_view.dart'; 11 import 'package:one_key/widgets/v_empty_view.dart';
@@ -273,7 +274,12 @@ class _ContactListPageState extends State<ContactListPage> { @@ -273,7 +274,12 @@ class _ContactListPageState extends State<ContactListPage> {
273 itemBuilder: (BuildContext context, int index) { 274 itemBuilder: (BuildContext context, int index) {
274 // if (index == 0) return _buildHeader(); 275 // if (index == 0) return _buildHeader();
275 UserHistoryEntity model = widget.contacts[index]; 276 UserHistoryEntity model = widget.contacts[index];
276 - return _buildListItem(model); 277 + return InkWell(
  278 + onTap: () {
  279 + NavigatorUtil.goCustomerDetailPage(context, model);
  280 + },
  281 + child: _buildListItem(model),
  282 + );
277 }, 283 },
278 physics: BouncingScrollPhysics(), 284 physics: BouncingScrollPhysics(),
279 indexBarData: SuspensionUtil.getTagIndexList(widget.contacts), 285 indexBarData: SuspensionUtil.getTagIndexList(widget.contacts),
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/screenutil.dart';
  3 +import 'package:one_key/res/colors.dart';
  4 +import 'package:one_key/utils/dialog_util.dart';
  5 +import 'package:one_key/utils/utils.dart';
  6 +import 'package:one_key/widgets/h_empty_view.dart';
  7 +import 'package:one_key/widgets/round_button.dart';
  8 +import 'package:one_key/widgets/system_app_bar.dart';
  9 +import 'package:one_key/widgets/v_empty_view.dart';
  10 +
  11 +class CustomerDetailEditPage extends StatefulWidget {
  12 + CustomerDetailEditPage({Key key}) : super(key: key);
  13 +
  14 + @override
  15 + _CustomerDetailEditPageState createState() => _CustomerDetailEditPageState();
  16 +}
  17 +
  18 +class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> {
  19 + List sexList = []; // 先生、女士、公司
  20 + TextEditingController nameController = TextEditingController();
  21 + FocusNode nameFocus = FocusNode();
  22 + String nameStr;
  23 + TextEditingController phoneController = TextEditingController();
  24 + FocusNode phoneFocus = FocusNode();
  25 + TextEditingController adressController = TextEditingController();
  26 + FocusNode adressFocus = FocusNode();
  27 + TextEditingController departmentController = TextEditingController();
  28 + FocusNode departmentFocus = FocusNode();
  29 + TextEditingController positionController = TextEditingController();
  30 + FocusNode positionFocus = FocusNode();
  31 + TextEditingController jkController = TextEditingController();
  32 + TextEditingController xhController = TextEditingController();
  33 + TextEditingController fwController = TextEditingController();
  34 + bool showLabel = false;
  35 + @override
  36 + void initState() {
  37 + super.initState();
  38 + _initSexList();
  39 + nameFocus.addListener(() {
  40 + if (nameFocus.hasFocus) {
  41 + print('得到焦点');
  42 + } else {
  43 + print('失去焦点');
  44 + // _homeEnterModel.nameController.text = nameStr + _nameSuffix();
  45 + _addNameSuffix(nameStr, _nameSuffix());
  46 + }
  47 + setState(() {});
  48 + });
  49 + WidgetsBinding.instance.addPostFrameCallback((_) {
  50 + // if (widget.name != '' &&
  51 + // widget.name != null &&
  52 + // widget.sex != '' &&
  53 + // widget.sex != null) {
  54 + // nameStr = widget.name;
  55 + // for (var item in detailModel.sexList) {
  56 + // item['select'] = false;
  57 + // if (item['code'] == widget.sex) {
  58 + // item['select'] = true;
  59 + // }
  60 + // }
  61 + // _addNameSuffix(nameStr, _nameSuffix());
  62 + // setState(() {});
  63 + // }
  64 + });
  65 + }
  66 +
  67 + ///称谓
  68 + _initSexList() {
  69 + // String sexStr = detailEntity.sex;
  70 + String sexStr = '1';
  71 + sexList = [
  72 + {
  73 + 'title': '先生',
  74 + 'select': sexStr == '1' ? true : false,
  75 + 'code': '1',
  76 + 'hasLeftBorder': true
  77 + },
  78 + {
  79 + 'title': '女士',
  80 + 'select': sexStr == '2' ? true : false,
  81 + 'code': '2',
  82 + 'hasLeftBorder': false
  83 + },
  84 + {
  85 + 'title': '公司',
  86 + 'select': sexStr == '3' ? true : false,
  87 + 'code': '3',
  88 + 'hasLeftBorder': false
  89 + }
  90 + ];
  91 + }
  92 +
  93 + _addNameSuffix(String name, String suffix) {
  94 + if (name == nameController.text && nameController.text.endsWith(suffix)) {
  95 + return;
  96 + }
  97 + nameController.text = name + suffix;
  98 + }
  99 +
  100 + //姓名后缀
  101 + _nameSuffix() {
  102 + for (var item in sexList) {
  103 + if (item['select'] == true) {
  104 + return item['title'];
  105 + }
  106 + }
  107 + }
  108 +
  109 + Widget _callButton(
  110 + {GestureTapCallback onPress,
  111 + content,
  112 + hasLeftBorder = true,
  113 + isSelect = false}) {
  114 + return InkWell(
  115 + onTap: onPress,
  116 + child: Container(
  117 + width: ScreenUtil().setWidth(84),
  118 + height: ScreenUtil().setHeight(48),
  119 + decoration: BoxDecoration(
  120 + color: isSelect ? MyColours.color_199095 : MyColours.color_fefefe,
  121 + border: Border(
  122 + bottom: BorderSide(
  123 + color: MyColours.color_6AB6B9,
  124 + width: ScreenUtil().setWidth(2)),
  125 + top: BorderSide(
  126 + color: MyColours.color_6AB6B9,
  127 + width: ScreenUtil().setWidth(2)),
  128 + left: hasLeftBorder
  129 + ? BorderSide(
  130 + color: MyColours.color_6AB6B9,
  131 + width: ScreenUtil().setWidth(2))
  132 + : BorderSide.none,
  133 + right: BorderSide(
  134 + color: MyColours.color_6AB6B9,
  135 + width: ScreenUtil().setWidth(2)))),
  136 + child: Align(
  137 + alignment: Alignment.center,
  138 + child: Text(
  139 + content,
  140 + style: TextStyle(
  141 + color: isSelect ? Colors.white : MyColours.color_353535,
  142 + fontSize: ScreenUtil().setSp(28)),
  143 + ),
  144 + ),
  145 + ),
  146 + );
  147 + }
  148 +
  149 + Widget _textfieldWidget(String title, String hint,
  150 + TextEditingController controller, FocusNode focusNode) {
  151 + return Container(
  152 + // height: ScreenUtil().setWidth(60),
  153 + padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(10)),
  154 + decoration: BoxDecoration(
  155 + border: Border(
  156 + bottom: BorderSide(
  157 + width: ScreenUtil().setWidth(2),
  158 + color: Color.fromRGBO(220, 220, 220, 1)))),
  159 + child: Row(
  160 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  161 + crossAxisAlignment: CrossAxisAlignment.center,
  162 + children: [
  163 + Container(
  164 + width: ScreenUtil().setWidth(150),
  165 + height: ScreenUtil().setWidth(35),
  166 + child: Text(
  167 + title,
  168 + style: TextStyle(
  169 + fontSize: ScreenUtil().setSp(28),
  170 + color: MyColours.color_333333),
  171 + ),
  172 + ),
  173 + Expanded(
  174 + child: TextField(
  175 + maxLines: 1,
  176 +
  177 + //输入文本的样式
  178 + style: TextStyle(
  179 + fontSize: ScreenUtil().setSp(30),
  180 + color: MyColours.color_353535),
  181 + controller: controller,
  182 + focusNode: focusNode,
  183 + // textAlignVertical: TextAlignVertical.top,
  184 + decoration: InputDecoration(
  185 + hintText: hint,
  186 + hintStyle: TextStyle(
  187 + color: MyColours.color_999999,
  188 + fontSize: ScreenUtil().setSp(30),
  189 + ),
  190 + // contentPadding:
  191 + // EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
  192 + contentPadding: EdgeInsets.zero,
  193 + border: OutlineInputBorder(borderSide: BorderSide.none),
  194 + ),
  195 + onChanged: (value) {
  196 + print('ggg');
  197 +
  198 + nameStr = value;
  199 + },
  200 + onEditingComplete: () {
  201 + print('fff');
  202 + nameFocus.unfocus();
  203 + // _homeEnterModel.nameController.text =
  204 + // nameStr + _nameSuffix();
  205 + _addNameSuffix(nameStr, _nameSuffix());
  206 + },
  207 + keyboardType: TextInputType.text,
  208 + ),
  209 + ),
  210 + ],
  211 + ),
  212 + );
  213 + }
  214 +
  215 + ///忌口和喜好
  216 + Widget _textMulLine(
  217 + String title, String hintText, TextEditingController controller) {
  218 + return Container(
  219 + // height: ScreenUtil().setWidth(380),
  220 + child: Column(
  221 + crossAxisAlignment: CrossAxisAlignment.start,
  222 + children: [
  223 + Align(
  224 + alignment: Alignment.centerLeft,
  225 + child: Text(
  226 + title,
  227 + textAlign: TextAlign.left,
  228 + style: TextStyle(
  229 + color: MyColours.color_333333,
  230 + fontSize: ScreenUtil().setSp(28)),
  231 + )),
  232 + VEmptyView(20),
  233 + TextField(
  234 + controller: controller,
  235 + // keyboardType: TextInputType.number, //键盘类型,数字键盘
  236 + maxLines: 4,
  237 + // maxLength: 50,
  238 +
  239 + // maxLengthEnforced: true,
  240 + style: TextStyle(
  241 + fontSize: ScreenUtil().setSp(30),
  242 + color: MyColours.color_333333), //输入文本的样式
  243 + decoration: InputDecoration(
  244 + contentPadding: EdgeInsets.all(ScreenUtil().setWidth(30)),
  245 + hintText: hintText,
  246 + hintStyle: TextStyle(
  247 + color: MyColours.color_999999,
  248 + fontSize: ScreenUtil().setSp(30),
  249 + ),
  250 + // fillColor: MyColours.color_F9F9F9,
  251 + // fillColor: Colors.red,
  252 + // filled: true,
  253 + enabledBorder: OutlineInputBorder(
  254 + //未选中时候的颜色
  255 + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
  256 + borderSide: BorderSide(
  257 + color: MyColours.color_cccccc,
  258 + width: ScreenUtil().setWidth(2)),
  259 + ),
  260 + focusedBorder: OutlineInputBorder(
  261 + //选中时外边框颜色
  262 + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
  263 + borderSide: BorderSide(
  264 + color: MyColours.app_main,
  265 + ),
  266 + ),
  267 + // border: OutlineInputBorder(
  268 + // borderRadius:
  269 + // BorderRadius.circular(ScreenUtil().setWidth(20)),
  270 + // borderSide: BorderSide(
  271 + // color: Colors.red, width: ScreenUtil().setWidth(2))),
  272 + ),
  273 + onChanged: (value) {},
  274 + ),
  275 + ],
  276 + ),
  277 + );
  278 + }
  279 +
  280 + @override
  281 + Widget build(BuildContext context) {
  282 + return Scaffold(
  283 + backgroundColor: MyColours.color_ffffff,
  284 + appBar: SystemAppBar(
  285 + '编辑客户详情',
  286 + onTap: () {
  287 + Navigator.of(context).pop();
  288 + },
  289 + ),
  290 + body: Column(
  291 + children: [
  292 + Expanded(
  293 + child: Padding(
  294 + padding: EdgeInsets.symmetric(
  295 + horizontal: ScreenUtil().setWidth(50)),
  296 + child: SingleChildScrollView(
  297 + child: Column(
  298 + children: [
  299 + // VEmptyView(30),
  300 + Container(
  301 + // height: ScreenUtil().setWidth(60),
  302 + padding: EdgeInsets.symmetric(
  303 + vertical: ScreenUtil().setWidth(10)),
  304 + decoration: BoxDecoration(
  305 + border: Border(
  306 + bottom: BorderSide(
  307 + width: ScreenUtil().setWidth(2),
  308 + color:
  309 + Color.fromRGBO(220, 220, 220, 1)))),
  310 + child: Row(
  311 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  312 + crossAxisAlignment: CrossAxisAlignment.center,
  313 + children: [
  314 + Container(
  315 + // color: Colors.red,
  316 + width: ScreenUtil().setWidth(150),
  317 + height: ScreenUtil().setWidth(35),
  318 + child: Text(
  319 + '姓名',
  320 + style: TextStyle(
  321 + fontSize: ScreenUtil().setSp(28),
  322 + color: MyColours.color_333333),
  323 + ),
  324 + ),
  325 + Expanded(
  326 + child: TextField(
  327 + maxLines: 1,
  328 +
  329 + //输入文本的样式
  330 + style: TextStyle(
  331 + fontSize: ScreenUtil().setSp(30),
  332 + color: MyColours.color_353535),
  333 + controller: nameController,
  334 + focusNode: nameFocus,
  335 + // textAlignVertical: TextAlignVertical.top,
  336 + decoration: InputDecoration(
  337 + hintText: "填写姓名",
  338 + hintStyle: TextStyle(
  339 + color: MyColours.color_999999,
  340 + fontSize: ScreenUtil().setSp(30),
  341 + ),
  342 + // contentPadding:
  343 + // EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
  344 + contentPadding: EdgeInsets.zero,
  345 + border: OutlineInputBorder(
  346 + borderSide: BorderSide.none),
  347 + ),
  348 + onChanged: (value) {
  349 + print('ggg');
  350 +
  351 + nameStr = value;
  352 + },
  353 + onEditingComplete: () {
  354 + print('fff');
  355 + nameFocus.unfocus();
  356 + // _homeEnterModel.nameController.text =
  357 + // nameStr + _nameSuffix();
  358 + _addNameSuffix(nameStr, _nameSuffix());
  359 + },
  360 + keyboardType: TextInputType.text,
  361 + ),
  362 + ),
  363 + // HEmptyView(40),
  364 + Row(
  365 + children: sexList.map((value) {
  366 + return _callButton(
  367 + onPress: () {
  368 + for (var item in sexList) {
  369 + item['select'] = false;
  370 + if (item['title'] == value['title']) {
  371 + item['select'] = true;
  372 + // _homeEnterModel.nameController.text =
  373 + // nameStr + item['title'];
  374 + if (nameStr != null &&
  375 + nameStr != '') {
  376 + _addNameSuffix(
  377 + nameStr, item['title']);
  378 + }
  379 + }
  380 + }
  381 + setState(() {});
  382 + },
  383 + content: value['title'],
  384 + hasLeftBorder: value['hasLeftBorder'],
  385 + isSelect: value['select']);
  386 + }).toList()),
  387 + ],
  388 + ),
  389 + ),
  390 + _textfieldWidget(
  391 + '电话', '填写电话', phoneController, phoneFocus),
  392 + _textfieldWidget(
  393 + '工作单位', '填写工作单位', adressController, adressFocus),
  394 + _textfieldWidget('部门', '填写部门', departmentController,
  395 + departmentFocus),
  396 + _textfieldWidget(
  397 + '职位', '填写职位', positionController, positionFocus),
  398 + InkWell(
  399 + onTap: () {
  400 + FocusScope.of(context)
  401 + .requestFocus(FocusNode()); //隐藏键盘
  402 + // DialogUtil.showSelectCusmanDialog(
  403 + // context, couponList, (value) {
  404 + // if (value != null) {
  405 + // setState(() {
  406 + // couponSelectIndex = value.first;
  407 + // });
  408 + // }
  409 + // },
  410 + // selecteds: couponSelectIndex == null
  411 + // ? []
  412 + // : [couponSelectIndex])
  413 + // .then((value) {});
  414 + },
  415 + child: Container(
  416 + // height: ScreenUtil().setWidth(60),
  417 + padding: EdgeInsets.symmetric(
  418 + vertical: ScreenUtil().setWidth(50)),
  419 + decoration: BoxDecoration(
  420 + border: Border(
  421 + bottom: BorderSide(
  422 + width: ScreenUtil().setWidth(2),
  423 + color: Color.fromRGBO(
  424 + 220, 220, 220, 1)))),
  425 + child: Row(
  426 + mainAxisAlignment:
  427 + MainAxisAlignment.spaceBetween,
  428 + crossAxisAlignment: CrossAxisAlignment.center,
  429 + children: [
  430 + Container(
  431 + // color: Colors.red,
  432 + width: ScreenUtil().setWidth(150),
  433 + height: ScreenUtil().setWidth(35),
  434 + child: Text(
  435 + '自定义标签',
  436 + style: TextStyle(
  437 + fontSize: ScreenUtil().setSp(28),
  438 + color: MyColours.color_333333),
  439 + ),
  440 + ),
  441 + Expanded(
  442 + child: Text(
  443 + '低频高消费',
  444 + overflow: TextOverflow.ellipsis,
  445 + style: TextStyle(
  446 + color: Color.fromRGBO(193, 194, 63, 1),
  447 + fontSize: ScreenUtil().setSp(28),
  448 + ),
  449 + )),
  450 + HEmptyView(10),
  451 + Image.asset(
  452 + Utils.getImgPath(showLabel
  453 + ? 'c_arrow_up'
  454 + : 'c_arrow_down'),
  455 + width: ScreenUtil().setWidth(24),
  456 + // height: ScreenUtil().setWidth(10),
  457 + )
  458 + ],
  459 + ),
  460 + )),
  461 + InkWell(
  462 + onTap: () {
  463 + // DialogUtil.showSelectCusmanDialog(
  464 + // context, couponList, (value) {
  465 + // if (value != null) {
  466 + // setState(() {
  467 + // couponSelectIndex = value.first;
  468 + // });
  469 + // }
  470 + // },
  471 + // selecteds: couponSelectIndex == null
  472 + // ? []
  473 + // : [couponSelectIndex])
  474 + // .then((value) {});
  475 + },
  476 + child: Container(
  477 + // height: ScreenUtil().setWidth(60),
  478 + padding: EdgeInsets.symmetric(
  479 + vertical: ScreenUtil().setWidth(50)),
  480 + decoration: BoxDecoration(
  481 + border: Border(
  482 + bottom: BorderSide(
  483 + width: ScreenUtil().setWidth(2),
  484 + color: Color.fromRGBO(
  485 + 220, 220, 220, 1)))),
  486 + child: Row(
  487 + mainAxisAlignment:
  488 + MainAxisAlignment.spaceBetween,
  489 + crossAxisAlignment: CrossAxisAlignment.center,
  490 + children: [
  491 + Container(
  492 + // color: Colors.red,
  493 + width: ScreenUtil().setWidth(150),
  494 + height: ScreenUtil().setWidth(35),
  495 + child: Text(
  496 + '客户经理',
  497 + style: TextStyle(
  498 + fontSize: ScreenUtil().setSp(28),
  499 + color: MyColours.color_333333),
  500 + ),
  501 + ),
  502 + Expanded(
  503 + child: Text(
  504 + 'xxxj',
  505 + overflow: TextOverflow.ellipsis,
  506 + style: TextStyle(
  507 + color: MyColours.color_333333,
  508 + fontSize: ScreenUtil().setSp(28),
  509 + ),
  510 + )),
  511 + HEmptyView(10),
  512 + Image.asset(
  513 + Utils.getImgPath(showLabel
  514 + ? 'c_arrow_up'
  515 + : 'c_arrow_down'),
  516 + width: ScreenUtil().setWidth(24),
  517 + // height: ScreenUtil().setWidth(10),
  518 + )
  519 + ],
  520 + ),
  521 + )),
  522 + VEmptyView(60),
  523 + _textMulLine('忌口', '输入忌口的东西', jkController),
  524 + VEmptyView(30),
  525 + _textMulLine('喜好', '输入喜好', xhController),
  526 + VEmptyView(30),
  527 + _textMulLine('服务', '输入服务', fwController),
  528 + ],
  529 + ),
  530 + ))),
  531 + RoundButton(
  532 + text: '保存',
  533 + radius: ScreenUtil().setWidth(10),
  534 + margin:
  535 + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(90)),
  536 + height: ScreenUtil().setWidth(80),
  537 + fontSize: 26,
  538 + isBold: false,
  539 + onPressed: () {},
  540 + ),
  541 + VEmptyView(30)
  542 + ],
  543 + ));
  544 + }
  545 +}
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/screenutil.dart';
  3 +import 'package:one_key/models/user_history_entity.dart';
  4 +import 'package:one_key/res/colors.dart';
  5 +import 'package:one_key/route/navigator_util.dart';
  6 +import 'package:one_key/utils/dialog_util.dart';
  7 +import 'package:one_key/utils/utils.dart';
  8 +import 'package:one_key/widgets/h_empty_view.dart';
  9 +import 'package:one_key/widgets/round_button.dart';
  10 +import 'package:one_key/widgets/system_app_bar.dart';
  11 +import 'package:one_key/widgets/v_empty_view.dart';
  12 +
  13 +class CustomerDetailPage extends StatefulWidget {
  14 + final UserHistoryEntity userHistoryEntity;
  15 + CustomerDetailPage({Key key, this.userHistoryEntity}) : super(key: key);
  16 +
  17 + @override
  18 + _CustomerDetailPageState createState() => _CustomerDetailPageState();
  19 +}
  20 +
  21 +class _CustomerDetailPageState extends State<CustomerDetailPage> {
  22 + ScrollController controller = ScrollController();
  23 + Widget _headerWidget() {
  24 + return Container(
  25 + padding: EdgeInsets.symmetric(
  26 + horizontal: ScreenUtil().setWidth(40),
  27 + vertical: ScreenUtil().setWidth(40),
  28 + ),
  29 + decoration: BoxDecoration(color: MyColours.color_ffffff, boxShadow: [
  30 + BoxShadow(
  31 + color: MyColours.color_E0E0E0,
  32 + offset: Offset(2, -2), //x,y轴
  33 + blurRadius: ScreenUtil().setWidth(6), //阴影模糊程度
  34 + spreadRadius: 0 //阴影扩散程度
  35 + )
  36 + ]),
  37 + child: Row(
  38 + children: [
  39 + Column(
  40 + children: [
  41 + Stack(
  42 + alignment: Alignment.bottomCenter,
  43 + clipBehavior: Clip.none,
  44 + children: [
  45 + Container(
  46 + width: ScreenUtil().setWidth(120),
  47 + height: ScreenUtil().setWidth(120),
  48 + alignment: Alignment.center,
  49 + decoration: BoxDecoration(
  50 + color: Color.fromRGBO(239, 239, 239, 1),
  51 + borderRadius:
  52 + BorderRadius.circular(ScreenUtil().setWidth(20))),
  53 + child: Text(
  54 + widget.userHistoryEntity.rnameStr != ''
  55 + ? widget.userHistoryEntity.rnameStr.substring(0, 1)
  56 + : '',
  57 + style: TextStyle(
  58 + color: Color.fromRGBO(206, 206, 206, 1),
  59 + fontSize: ScreenUtil().setSp(78)),
  60 + ),
  61 + ),
  62 + Positioned(
  63 + bottom: ScreenUtil().setWidth(-20),
  64 + child: Container(
  65 + padding: EdgeInsets.symmetric(
  66 + horizontal: ScreenUtil().setWidth(10),
  67 + vertical: ScreenUtil().setWidth(2),
  68 + ),
  69 + decoration: BoxDecoration(
  70 + color: Color.fromRGBO(223, 33, 81, 1),
  71 + borderRadius: BorderRadius.circular(
  72 + ScreenUtil().setWidth(10),
  73 + ),
  74 + ),
  75 + child: Text('沉睡',
  76 + style: TextStyle(
  77 + color: MyColours.color_ffffff,
  78 + fontSize: ScreenUtil().setSp(28)))))
  79 + ],
  80 + ),
  81 + VEmptyView(40),
  82 + Container(
  83 + padding:
  84 + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(10)),
  85 + decoration: BoxDecoration(
  86 + border: Border.all(
  87 + color: MyColours.color_199095,
  88 + width: ScreenUtil().setWidth(2)),
  89 + borderRadius:
  90 + BorderRadius.circular(ScreenUtil().setWidth(10))),
  91 + child: Text(
  92 + // widget.userHistoryEntity.rnameStr == ''
  93 + // ? '未指派经理'
  94 + // : widget.userHistoryEntity.rnameStr,
  95 + 'xxx经理',
  96 + style: TextStyle(
  97 + color: MyColours.color_333333,
  98 + fontSize: ScreenUtil().setSp(26)),
  99 + ),
  100 + )
  101 + ],
  102 + ),
  103 + HEmptyView(30),
  104 + Column(
  105 + crossAxisAlignment: CrossAxisAlignment.start,
  106 + children: [
  107 + Row(
  108 + crossAxisAlignment: CrossAxisAlignment.end,
  109 + children: [
  110 + Container(
  111 + constraints:
  112 + BoxConstraints(maxWidth: ScreenUtil().setWidth(260)),
  113 + child: Text(
  114 + widget.userHistoryEntity.rnameStr,
  115 + overflow: TextOverflow.ellipsis,
  116 + style: TextStyle(
  117 + color: MyColours.color_333333,
  118 + fontSize: ScreenUtil().setSp(68)),
  119 + )),
  120 + HEmptyView(10),
  121 + Text(
  122 + widget.userHistoryEntity.sexStr != ''
  123 + ? '[${widget.userHistoryEntity.sexStr}]'
  124 + : '',
  125 + style: TextStyle(
  126 + color: MyColours.color_333333,
  127 + fontSize: ScreenUtil().setSp(22),
  128 + ),
  129 + ),
  130 + ],
  131 + ),
  132 + VEmptyView(10),
  133 + Container(
  134 + constraints:
  135 + BoxConstraints(maxWidth: ScreenUtil().setWidth(200)),
  136 + child: Text(
  137 + '低频高消费',
  138 + overflow: TextOverflow.ellipsis,
  139 + style: TextStyle(
  140 + color: Color.fromRGBO(193, 194, 63, 1),
  141 + fontSize: ScreenUtil().setSp(22),
  142 + ),
  143 + )),
  144 + VEmptyView(20),
  145 + InkWell(
  146 + onTap: () {
  147 + DialogUtil.goPhone(widget.userHistoryEntity.phone);
  148 + },
  149 + child: Container(
  150 + padding: EdgeInsets.symmetric(
  151 + horizontal: ScreenUtil().setWidth(20),
  152 + vertical: ScreenUtil().setWidth(10)),
  153 + decoration: BoxDecoration(
  154 + color: MyColours.color_199095,
  155 + borderRadius:
  156 + BorderRadius.circular(ScreenUtil().setWidth(20))),
  157 + child: Row(
  158 + children: [
  159 + Image.asset(
  160 + Utils.getImgPath('c_phone'),
  161 + width: ScreenUtil().setWidth(30),
  162 + ),
  163 + HEmptyView(10),
  164 + Text(
  165 + widget.userHistoryEntity.phone,
  166 + overflow: TextOverflow.ellipsis,
  167 + style: TextStyle(
  168 + color: MyColours.color_ffffff,
  169 + fontWeight: FontWeight.bold,
  170 + fontSize: ScreenUtil().setSp(36),
  171 + ),
  172 + )
  173 + ],
  174 + )))
  175 + ],
  176 + ),
  177 + Spacer(),
  178 + RoundButton(
  179 + text: '编辑',
  180 + radius: ScreenUtil().setWidth(20),
  181 + width: ScreenUtil().setWidth(90),
  182 + height: ScreenUtil().setWidth(50),
  183 + fontSize: 26,
  184 + isBold: false,
  185 + onPressed: () {
  186 + NavigatorUtil.goCustomerDetailEditPage(context);
  187 + },
  188 + ),
  189 + ],
  190 + ),
  191 + );
  192 + }
  193 +
  194 + Widget _lineItemWidget(String title, String content) {
  195 + return Container(
  196 + padding: EdgeInsets.symmetric(
  197 + horizontal: ScreenUtil().setWidth(40),
  198 + vertical: ScreenUtil().setWidth(30)),
  199 + color: MyColours.color_ffffff,
  200 + child: Row(
  201 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  202 + children: [
  203 + Text(
  204 + title,
  205 + style: TextStyle(
  206 + fontSize: ScreenUtil().setSp(36),
  207 + color: MyColours.color_333333),
  208 + ),
  209 + Text(
  210 + content,
  211 + style: TextStyle(
  212 + fontSize: ScreenUtil().setSp(26),
  213 + color: title == '忌口' ? Colors.red : MyColours.color_199095),
  214 + )
  215 + ],
  216 + ));
  217 + }
  218 +
  219 + @override
  220 + Widget build(BuildContext context) {
  221 + return Scaffold(
  222 + backgroundColor: Color.fromRGBO(246, 248, 250, 1),
  223 + appBar: SystemAppBar(
  224 + '客户详情',
  225 + onTap: () {
  226 + Navigator.of(context).pop();
  227 + },
  228 + ),
  229 + body: Column(
  230 + children: [
  231 + Expanded(
  232 + child: SingleChildScrollView(
  233 + controller: controller,
  234 + child: Column(
  235 + children: [
  236 + Container(
  237 + width: double.infinity,
  238 + height: ScreenUtil().setWidth(20),
  239 + color: MyColours.color_ffffff,
  240 + ),
  241 + _headerWidget(),
  242 + VEmptyView(20),
  243 + Container(
  244 + padding: EdgeInsets.symmetric(
  245 + horizontal: ScreenUtil().setWidth(40),
  246 + vertical: ScreenUtil().setWidth(20)),
  247 + decoration: BoxDecoration(
  248 + color: MyColours.color_199095,
  249 + borderRadius: BorderRadius.only(
  250 + topRight: Radius.circular(ScreenUtil().setWidth(20)),
  251 + topLeft: Radius.circular(ScreenUtil().setWidth(20)))),
  252 + child: Row(
  253 + children: [
  254 + Expanded(
  255 + child: Text(
  256 + '已创建 97 天 累计 2 单',
  257 + overflow: TextOverflow.ellipsis,
  258 + style: TextStyle(
  259 + color: MyColours.color_ffffff,
  260 + fontSize: ScreenUtil().setSp(32)),
  261 + )),
  262 + InkWell(
  263 + onTap: () {
  264 + // NavigatorUtil.goMarketingRecordsDetailPage(context);
  265 + },
  266 + child: Text('更多',
  267 + style: TextStyle(
  268 + decoration: TextDecoration.underline,
  269 + color: MyColours.color_ffffff,
  270 + fontSize: ScreenUtil().setSp(26)))),
  271 + ],
  272 + ),
  273 + ),
  274 + Container(
  275 + color: MyColours.color_ffffff,
  276 + padding: EdgeInsets.symmetric(
  277 + horizontal: ScreenUtil().setWidth(20),
  278 + vertical: ScreenUtil().setWidth(20)),
  279 + child: Column(
  280 + children: [
  281 + Wrap(
  282 + children: [
  283 + Text(
  284 + '最近一次:',
  285 + style: TextStyle(
  286 + fontSize: ScreenUtil().setSp(26),
  287 + color: MyColours.color_333333),
  288 + ),
  289 + Text(
  290 + '3天后 ',
  291 + overflow: TextOverflow.ellipsis,
  292 + style: TextStyle(
  293 + fontSize: ScreenUtil().setSp(26),
  294 + color: Color.fromRGBO(193, 194, 63, 1)),
  295 + ),
  296 + Text(
  297 + '午餐',
  298 + style: TextStyle(
  299 + fontSize: ScreenUtil().setSp(26),
  300 + color: MyColours.color_199095),
  301 + ),
  302 + Text(
  303 + ' 桌位:',
  304 + style: TextStyle(
  305 + fontSize: ScreenUtil().setSp(26),
  306 + color: MyColours.color_333333),
  307 + ),
  308 + Text(
  309 + 'vip5',
  310 + style: TextStyle(
  311 + fontSize: ScreenUtil().setSp(26),
  312 + color: MyColours.color_199095),
  313 + ),
  314 + Text(
  315 + ' 人数:',
  316 + style: TextStyle(
  317 + fontSize: ScreenUtil().setSp(26),
  318 + color: MyColours.color_333333),
  319 + ),
  320 + Text(
  321 + '未记录',
  322 + style: TextStyle(
  323 + fontSize: ScreenUtil().setSp(26),
  324 + color: MyColours.color_199095),
  325 + ),
  326 + Text(
  327 + ' 消费:',
  328 + style: TextStyle(
  329 + fontSize: ScreenUtil().setSp(26),
  330 + color: MyColours.color_333333),
  331 + ),
  332 + Text(
  333 + '未记录',
  334 + style: TextStyle(
  335 + fontSize: ScreenUtil().setSp(26),
  336 + color: MyColours.color_199095),
  337 + )
  338 + ],
  339 + ),
  340 + Row(
  341 + mainAxisAlignment: MainAxisAlignment.center,
  342 + children: [
  343 + Text(
  344 + '客户经理:',
  345 + style: TextStyle(
  346 + fontSize: ScreenUtil().setSp(26),
  347 + color: MyColours.color_333333),
  348 + ),
  349 + Text(
  350 + 'xxx 18799999999',
  351 + style: TextStyle(
  352 + fontSize: ScreenUtil().setSp(26),
  353 + color: MyColours.color_199095),
  354 + )
  355 + ],
  356 + )
  357 + ],
  358 + ),
  359 + ),
  360 + VEmptyView(20),
  361 + _lineItemWidget('工作单位', '政府部门 办公室主任'),
  362 + VEmptyView(20),
  363 + _lineItemWidget('忌口', '葱姜蒜'),
  364 + VEmptyView(20),
  365 + _lineItemWidget('喜好', '酸甜苦辣'),
  366 + VEmptyView(20),
  367 + _lineItemWidget('服务', '湿巾、茶水'),
  368 + VEmptyView(20),
  369 + Container(
  370 + padding: EdgeInsets.symmetric(
  371 + horizontal: ScreenUtil().setWidth(40),
  372 + vertical: ScreenUtil().setWidth(30)),
  373 + color: MyColours.color_ffffff,
  374 + child: Column(children: [
  375 + Row(
  376 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  377 + children: [
  378 + Text(
  379 + '纪念日',
  380 + style: TextStyle(
  381 + fontSize: ScreenUtil().setSp(36),
  382 + color: MyColours.color_333333),
  383 + ),
  384 + RoundButton(
  385 + text: '编辑',
  386 + radius: ScreenUtil().setWidth(20),
  387 + width: ScreenUtil().setWidth(90),
  388 + height: ScreenUtil().setWidth(50),
  389 + fontSize: 26,
  390 + isBold: false,
  391 + onPressed: () {},
  392 + ),
  393 + ],
  394 + ),
  395 + ListView.builder(
  396 + shrinkWrap: true,
  397 + itemCount: 10,
  398 + controller: controller,
  399 + itemBuilder: (BuildContext context, int index) {
  400 + return Center(
  401 + child: Padding(
  402 + padding: EdgeInsets.symmetric(
  403 + vertical: ScreenUtil().setWidth(10)),
  404 + child: Text(
  405 + '本人生日:12月18日(公历)',
  406 + style: TextStyle(
  407 + fontSize: ScreenUtil().setSp(26),
  408 + color: MyColours.color_333333),
  409 + ),
  410 + ));
  411 + },
  412 + )
  413 + ])),
  414 + VEmptyView(20),
  415 + Container(
  416 + padding: EdgeInsets.symmetric(
  417 + horizontal: ScreenUtil().setWidth(40),
  418 + vertical: ScreenUtil().setWidth(30)),
  419 + color: MyColours.color_ffffff,
  420 + child: Column(
  421 + children: [
  422 + Row(
  423 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  424 + children: [
  425 + Text(
  426 + '营销记录',
  427 + style: TextStyle(
  428 + fontSize: ScreenUtil().setSp(36),
  429 + color: MyColours.color_333333),
  430 + ),
  431 + Text(
  432 + '共 1 个',
  433 + style: TextStyle(
  434 + fontSize: ScreenUtil().setSp(26),
  435 + color: MyColours.color_199095),
  436 + )
  437 + ],
  438 + ),
  439 + ListView.builder(
  440 + shrinkWrap: true,
  441 + itemCount: 10,
  442 + controller: controller,
  443 + itemBuilder: (BuildContext context, int index) {
  444 + return Center(
  445 + child: Padding(
  446 + padding: EdgeInsets.symmetric(
  447 + vertical: ScreenUtil().setWidth(10)),
  448 + child: Text(
  449 + '2021-12-12 短信营销 承诺优惠98折',
  450 + style: TextStyle(
  451 + fontSize: ScreenUtil().setSp(26),
  452 + color: MyColours.color_333333),
  453 + ),
  454 + ));
  455 + },
  456 + )
  457 + ],
  458 + ))
  459 + ],
  460 + ),
  461 + )),
  462 + RoundButton(
  463 + text: '创建预订',
  464 + radius: ScreenUtil().setWidth(10),
  465 + margin: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(90)),
  466 + height: ScreenUtil().setWidth(80),
  467 + fontSize: 26,
  468 + isBold: false,
  469 + onPressed: () {},
  470 + ),
  471 + VEmptyView(30)
  472 + ],
  473 + ),
  474 + );
  475 + }
  476 +}
@@ -9,6 +9,7 @@ import 'package:one_key/models/personnel_manage_model.dart'; @@ -9,6 +9,7 @@ import 'package:one_key/models/personnel_manage_model.dart';
9 import 'package:one_key/models/sms_info.dart'; 9 import 'package:one_key/models/sms_info.dart';
10 import 'package:one_key/models/statics_model.dart'; 10 import 'package:one_key/models/statics_model.dart';
11 import 'package:one_key/models/table_list.dart'; 11 import 'package:one_key/models/table_list.dart';
  12 +import 'package:one_key/models/user_history_entity.dart';
12 import 'package:one_key/res/colors.dart'; 13 import 'package:one_key/res/colors.dart';
13 import 'package:one_key/route/routes.dart'; 14 import 'package:one_key/route/routes.dart';
14 import 'package:one_key/utils/fluro_convert_utils.dart'; 15 import 'package:one_key/utils/fluro_convert_utils.dart';
@@ -554,4 +555,24 @@ class NavigatorUtil { @@ -554,4 +555,24 @@ class NavigatorUtil {
554 return _navigateTo(context, "${Routes.make_marketing_page}", 555 return _navigateTo(context, "${Routes.make_marketing_page}",
555 replace: replace); 556 replace: replace);
556 } 557 }
  558 +
  559 + /// 客户详情
  560 + static Future<dynamic> goCustomerDetailPage(
  561 + BuildContext context,
  562 + UserHistoryEntity userHistoryEntity, {
  563 + replace = false,
  564 + }) {
  565 + return _navigateTo(context,
  566 + "${Routes.customer_detail_page}?userHistoryEntity=${FluroConvertUtils.object2string(userHistoryEntity)}",
  567 + replace: replace);
  568 + }
  569 +
  570 + ///编辑客户详情
  571 + static Future<dynamic> goCustomerDetailEditPage(
  572 + BuildContext context, {
  573 + replace = false,
  574 + }) {
  575 + return _navigateTo(context, "${Routes.customer_edit_detail_page}",
  576 + replace: replace);
  577 + }
557 } 578 }
@@ -10,6 +10,7 @@ import 'package:one_key/models/personnel_manage_model.dart'; @@ -10,6 +10,7 @@ import 'package:one_key/models/personnel_manage_model.dart';
10 import 'package:one_key/models/sms_info.dart'; 10 import 'package:one_key/models/sms_info.dart';
11 import 'package:one_key/models/statics_model.dart'; 11 import 'package:one_key/models/statics_model.dart';
12 import 'package:one_key/models/table_list.dart'; 12 import 'package:one_key/models/table_list.dart';
  13 +import 'package:one_key/models/user_history_entity.dart';
13 import 'package:one_key/pages/coupon/coupon_detail_page.dart'; 14 import 'package:one_key/pages/coupon/coupon_detail_page.dart';
14 import 'package:one_key/pages/coupon/coupon_edit_page.dart'; 15 import 'package:one_key/pages/coupon/coupon_edit_page.dart';
15 import 'package:one_key/pages/coupon/coupon_history_page.dart'; 16 import 'package:one_key/pages/coupon/coupon_history_page.dart';
@@ -39,6 +40,8 @@ import 'package:one_key/pages/detail/handle_online_page.dart'; @@ -39,6 +40,8 @@ import 'package:one_key/pages/detail/handle_online_page.dart';
39 import 'package:one_key/pages/detail/notebook_detail_page.dart'; 40 import 'package:one_key/pages/detail/notebook_detail_page.dart';
40 import 'package:one_key/pages/login/web_page.dart'; 41 import 'package:one_key/pages/login/web_page.dart';
41 import 'package:one_key/pages/message/message_order_menu.dart'; 42 import 'package:one_key/pages/message/message_order_menu.dart';
  43 +import 'package:one_key/pages/my/customer_type/customer_detail_edit_page.dart';
  44 +import 'package:one_key/pages/my/customer_type/customer_detail_page.dart';
42 import 'package:one_key/pages/my/customer_type/customer_list_page.dart'; 45 import 'package:one_key/pages/my/customer_type/customer_list_page.dart';
43 import 'package:one_key/pages/my/customer_type/customer_setting_page.dart'; 46 import 'package:one_key/pages/my/customer_type/customer_setting_page.dart';
44 import 'package:one_key/pages/my/customer_type/make_marking_page.dart'; 47 import 'package:one_key/pages/my/customer_type/make_marking_page.dart';
@@ -869,3 +872,28 @@ var makeMarkingPageHandle = new Handler( @@ -869,3 +872,28 @@ var makeMarkingPageHandle = new Handler(
869 return ChangeNotifierProvider<CustomerProvider>( 872 return ChangeNotifierProvider<CustomerProvider>(
870 create: (_) => CustomerProvider(), child: MakeMarkingPage()); 873 create: (_) => CustomerProvider(), child: MakeMarkingPage());
871 }); 874 });
  875 +
  876 +///客户详情
  877 +var customerDetailPageHandle = new Handler(
  878 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  879 + // String idstr = params["idstr"].first;
  880 + UserHistoryEntity userHistoryEntity = UserHistoryEntity.fromJson(json.decode(
  881 + FluroConvertUtils.fluroCnParamsDecode(
  882 + params["userHistoryEntity"].first)));
  883 + return ChangeNotifierProvider<CustomerProvider>(
  884 + create: (_) => CustomerProvider(),
  885 + child: CustomerDetailPage(
  886 + userHistoryEntity: userHistoryEntity,
  887 + ));
  888 +});
  889 +
  890 +///编辑客户详情
  891 +var customerDetailEditPageHandle = new Handler(
  892 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  893 + // String idstr = params["idstr"].first;
  894 + // UserHistoryEntity userHistoryEntity = UserHistoryEntity.fromJson(json.decode(
  895 + // FluroConvertUtils.fluroCnParamsDecode(
  896 + // params["userHistoryEntity"].first)));
  897 + return ChangeNotifierProvider<CustomerProvider>(
  898 + create: (_) => CustomerProvider(), child: CustomerDetailEditPage());
  899 +});
@@ -73,9 +73,10 @@ class Routes { @@ -73,9 +73,10 @@ class Routes {
73 static String marketing_records_page = "/marketing_records_page"; //全店营销记录 73 static String marketing_records_page = "/marketing_records_page"; //全店营销记录
74 static String marketing_records_detail_page = 74 static String marketing_records_detail_page =
75 "/marketing_records_detail_page"; //全店营销记录详情 75 "/marketing_records_detail_page"; //全店营销记录详情
76 - static String make_marketing_page =  
77 - "/make_marketing_page"; //创建营销  
78 - 76 + static String make_marketing_page = "/make_marketing_page"; //创建营销
  77 + static String customer_detail_page = "/customer_detail_page"; //客户详情
  78 + static String customer_edit_detail_page =
  79 + "/customer_edit_detail_page"; //编辑客户详情
79 80
80 static void configureRoutes(FluroRouter router) { 81 static void configureRoutes(FluroRouter router) {
81 router.notFoundHandler = new Handler( 82 router.notFoundHandler = new Handler(
@@ -157,9 +158,9 @@ class Routes { @@ -157,9 +158,9 @@ class Routes {
157 router.define(marketing_records_page, handler: marketingRecordsPageHandle); 158 router.define(marketing_records_page, handler: marketingRecordsPageHandle);
158 router.define(marketing_records_detail_page, 159 router.define(marketing_records_detail_page,
159 handler: marketingRecordsDetailPageHandle); 160 handler: marketingRecordsDetailPageHandle);
160 - router.define(make_marketing_page,  
161 - handler: makeMarkingPageHandle);  
162 -  
163 - 161 + router.define(make_marketing_page, handler: makeMarkingPageHandle);
  162 + router.define(customer_detail_page, handler: customerDetailPageHandle);
  163 + router.define(customer_edit_detail_page, handler: customerDetailEditPageHandle);
  164 +
164 } 165 }
165 } 166 }