Commit 410726bc9655c9e2b2a03e4073456c5b2c377f06

Authored by wdn127929
1 parent e020519b

全店客情首页骨架屏

1 import 'dart:convert'; 1 import 'dart:convert';
2 import 'dart:ui'; 2 import 'dart:ui';
3 3
  4 +import 'package:flutter/cupertino.dart';
4 import 'package:flutter/material.dart'; 5 import 'package:flutter/material.dart';
5 import 'package:flutter_screenutil/flutter_screenutil.dart'; 6 import 'package:flutter_screenutil/flutter_screenutil.dart';
6 import 'package:one_key/constant/state.dart'; 7 import 'package:one_key/constant/state.dart';
@@ -286,9 +287,13 @@ class _StoreCustomerHomeRightPageState @@ -286,9 +287,13 @@ class _StoreCustomerHomeRightPageState
286 } 287 }
287 288
288 ///活跃客户、沉睡客户、流失客户 289 ///活跃客户、沉睡客户、流失客户
289 - Widget _percentWidget(String pnum, String btnTitle, String percent) { 290 + Widget _percentWidget(String pnum, String btnTitle, String percent,
  291 + {bool tap = true}) {
290 return InkWell( 292 return InkWell(
291 onTap: () async { 293 onTap: () async {
  294 + if (!tap) {
  295 + return;
  296 + }
292 String index = '0'; 297 String index = '0';
293 if (btnTitle == '活跃') { 298 if (btnTitle == '活跃') {
294 index = '1'; 299 index = '1';
@@ -493,6 +498,97 @@ class _StoreCustomerHomeRightPageState @@ -493,6 +498,97 @@ class _StoreCustomerHomeRightPageState
493 ), 498 ),
494 Consumer<CustomerProvider>(builder: (context, model, _) { 499 Consumer<CustomerProvider>(builder: (context, model, _) {
495 if (model.pageStateMyHome != PageState.Success) { 500 if (model.pageStateMyHome != PageState.Success) {
  501 + if (model.pageStateMyHome == PageState.Loading) {
  502 + return SingleChildScrollView(
  503 + controller: _controller,
  504 + child: Stack(alignment: Alignment.center, children: [
  505 + Column(children: [
  506 + VEmptyView(10),
  507 + // Stack(
  508 + // children: [
  509 + Container(
  510 + height: w(80),
  511 + color: MyColours.color_ffffff,
  512 + child: Row(
  513 + mainAxisAlignment: MainAxisAlignment.center,
  514 + children: [
  515 + Text(
  516 + '',
  517 + style: TextStyle(
  518 + color: MyColours.color_438E93,
  519 + fontSize: ScreenUtil().setSp(64),
  520 + fontWeight: FontWeight.bold),
  521 + ),
  522 + Text(
  523 + '位',
  524 + style: TextStyle(
  525 + color: MyColours.color_515151,
  526 + // fontWeight: FontWeight.bold,
  527 + fontSize: ScreenUtil().setSp(32)),
  528 + )
  529 + ],
  530 + ),
  531 + ),
  532 + VEmptyView(10),
  533 + Row(
  534 + children: [
  535 + _percentWidget('', '活跃', '', tap: false),
  536 + HEmptyView(10),
  537 + _percentWidget('', '60天未到店', '', tap: false),
  538 + HEmptyView(10),
  539 + _percentWidget('', '120天未到店', '', tap: false),
  540 + ],
  541 + ),
  542 +
  543 + // VEmptyView(10),
  544 + // GridView.builder(
  545 + // controller: _controller,
  546 + // shrinkWrap: true,
  547 + // cacheExtent: ScreenUtil().setWidth(0),
  548 + // itemCount: 6,
  549 + // gridDelegate:
  550 + // SliverGridDelegateWithFixedCrossAxisCount(
  551 + // crossAxisCount: 3,
  552 + // childAspectRatio: 1.05,
  553 + // mainAxisSpacing:
  554 + // ScreenUtil().setWidth(10),
  555 + // crossAxisSpacing:
  556 + // ScreenUtil().setWidth(10)),
  557 + // itemBuilder: (BuildContext context, int index) {
  558 + // return _managerWidget('', '', null, '',
  559 + // uid: '', onTap: () {});
  560 + // })
  561 + ]),
  562 + Align(
  563 + alignment: Alignment.center,
  564 + child: Center(
  565 + child: Column(
  566 + mainAxisAlignment: MainAxisAlignment.center,
  567 + crossAxisAlignment: CrossAxisAlignment.center,
  568 + children: <Widget>[
  569 + ClipRRect(
  570 + borderRadius: BorderRadius.circular(10),
  571 + child: Container(
  572 + width: 200,
  573 + height: 200,
  574 + color: Colors.transparent,
  575 + child: CupertinoActivityIndicator(
  576 + color: MyColours.color_000000,
  577 + radius: 30,
  578 + ),
  579 + ))
  580 + // VEmptyView(30),
  581 + // Text(
  582 + // '加载中,请稍后...',
  583 + // style: TextStyle(
  584 + // color: MyColours.color_666666,
  585 + // fontSize: ScreenUtil().setSp(24)),
  586 + // )
  587 + ],
  588 + ),
  589 + ))
  590 + ]));
  591 + }
496 return Expanded( 592 return Expanded(
497 child: ExceptionPage( 593 child: ExceptionPage(
498 pageState: model.pageStateMyHome, 594 pageState: model.pageStateMyHome,
  1 +// import 'dart:convert';
  2 +// import 'dart:ui';
  3 +
  4 +// import 'package:flutter/material.dart';
  5 +// import 'package:flutter_screenutil/flutter_screenutil.dart';
  6 +// import 'package:one_key/constant/state.dart';
  7 +// import 'package:one_key/models/guest_manage_model.dart';
  8 +// import 'package:one_key/models/marketing_by_uid_model.dart';
  9 +// import 'package:one_key/provider/customer_provider.dart';
  10 +// import 'package:one_key/provider/user_model.dart';
  11 +// import 'package:one_key/res/colors.dart';
  12 +// import 'package:one_key/route/navigator_util.dart';
  13 +// import 'package:one_key/utils/event_bus.dart';
  14 +// import 'package:one_key/utils/utils.dart';
  15 +// import 'package:one_key/widgets/h_empty_view.dart';
  16 +// import 'package:one_key/widgets/page_exception.dart';
  17 +// import 'package:one_key/widgets/round_button.dart';
  18 +// import 'package:one_key/widgets/system_app_bar.dart';
  19 +// import 'package:one_key/widgets/v_empty_view.dart';
  20 +// import 'package:provider/provider.dart';
  21 +
  22 +// import '../../../../models/message_menu_model.dart';
  23 +// import '../../../../models/seller_counts_list.dart';
  24 +// import '../../../../models/store_customer_home_model.dart';
  25 +// import '../../../../utils/screen_util.dart';
  26 +// import '../../../../widgets/MyDivider.dart';
  27 +// import '../month_item.dart';
  28 +// import '../store_customer/bar_chart_page.dart';
  29 +
  30 +// /**
  31 +// *
  32 +// */
  33 +// class StoreCustomerHomeRightPage extends StatefulWidget {
  34 +// final CustomerProvider customerProvider;
  35 +// StoreCustomerHomeRightPage({Key key, this.customerProvider})
  36 +// : super(key: key);
  37 +
  38 +// @override
  39 +// _StoreCustomerHomeRightPageState createState() =>
  40 +// _StoreCustomerHomeRightPageState();
  41 +// }
  42 +
  43 +// class _StoreCustomerHomeRightPageState
  44 +// extends State<StoreCustomerHomeRightPage> {
  45 +// ScrollController _controller = ScrollController();
  46 +// // widget.customerProvider widget.customerProvider;
  47 +// bool showWarning = false;
  48 +
  49 +// int year;
  50 +
  51 +// List<MessageMenuModel> menuTitle = [];
  52 +// @override
  53 +// void initState() {
  54 +// super.initState();
  55 +// year = DateTime.now().year;
  56 +
  57 +// // for (int i = 0; i < 15; i++) {
  58 +// // MessageMenuModel messageMenuModel = MessageMenuModel();
  59 +// // messageMenuModel.title = '${i}经理';
  60 +// // messageMenuModel.select = i == 0 ? true : false;
  61 +// // menuTitle.add(messageMenuModel);
  62 +// // }
  63 +// WidgetsBinding.instance.addPostFrameCallback((_) {
  64 +// if (widget.customerProvider.storeSunmodel == null) {
  65 +// _getSellerGuestManage();
  66 +// } else {
  67 +// widget.customerProvider.storeSunmodel.sellerUser.forEach((element) {
  68 +// MessageMenuModel messageMenuModel = MessageMenuModel();
  69 +// messageMenuModel.uid = element.uid;
  70 +// messageMenuModel.title = element.nickName ?? element.account;
  71 +// messageMenuModel.select = false;
  72 +// menuTitle.add(messageMenuModel);
  73 +// });
  74 +// if (menuTitle.length > 0) {
  75 +// menuTitle[0].select = true;
  76 +// }
  77 +// _couponNetworkData();
  78 +
  79 +// _getMarketingByUid();
  80 +// _getSellerCountsList();
  81 +// }
  82 +// });
  83 +// bus.on("refresh_my_customer_home", (arg) {
  84 +// // _getGuestManageData(isShowLoading: false);
  85 +// _getMarketingByUid();
  86 +// _getSellerCountsList();
  87 +// });
  88 +// }
  89 +
  90 +// @override
  91 +// void dispose() {
  92 +// bus.off('refresh_my_customer_home');
  93 +// // bus.off("refresh_coupon_list");
  94 +// super.dispose();
  95 +// }
  96 +
  97 +// ///全店客情首页
  98 +// _getSellerGuestManage() async {
  99 +// StoreCustomerHomeSunModel model =
  100 +// await widget.customerProvider.getSellerGuestManage(context);
  101 +// // setState(() {});
  102 +// widget.customerProvider.storeSunmodel.sellerUser.forEach((element) {
  103 +// MessageMenuModel messageMenuModel = MessageMenuModel();
  104 +// messageMenuModel.uid = element.uid;
  105 +// messageMenuModel.title = element.nickName ?? element.account;
  106 +// messageMenuModel.select = false;
  107 +// menuTitle.add(messageMenuModel);
  108 +// });
  109 +// if (menuTitle.length > 0) {
  110 +// menuTitle[0].select = true;
  111 +// }
  112 +// _couponNetworkData();
  113 +
  114 +// _getMarketingByUid();
  115 +// _getSellerCountsList();
  116 +// }
  117 +
  118 +// _getSellerCountsList({isShowLoading = false, VoidCallback callback}) async {
  119 +// String uid = '';
  120 +// menuTitle.forEach((element) {
  121 +// if (element.select) {
  122 +// uid = element.uid;
  123 +// }
  124 +// });
  125 +// Map<String, String> params = {
  126 +// 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
  127 +// 'year': year.toString(),
  128 +// 'uid': uid
  129 +// };
  130 +// await widget.customerProvider
  131 +// .getSellerCountsList(context, params, isShowLoading: isShowLoading);
  132 +// if ((widget.customerProvider.managerStatisticsList == null ||
  133 +// widget.customerProvider.managerStatisticsList.length == 0) &&
  134 +// callback != null) {
  135 +// callback();
  136 +// }
  137 +// }
  138 +
  139 +// ///我的客户首页
  140 +// _getGuestManageData({bool isShowLoading = true}) async {
  141 +// String uid = '';
  142 +// menuTitle.forEach((element) {
  143 +// if (element.select) {
  144 +// uid = element.uid;
  145 +// }
  146 +// });
  147 +// GuestManageSunModel model = await widget.customerProvider
  148 +// .getGuestManageData(context, uid, isShowLoading: isShowLoading);
  149 +// // setState(() {});
  150 +// }
  151 +
  152 +// ///消费券
  153 +// _couponNetworkData({bool isShowLoading = true}) async {
  154 +// // customerMakingProvider.couponSelectIndex = 0;
  155 +// String uid = '';
  156 +// menuTitle.forEach((element) {
  157 +// if (element.select) {
  158 +// uid = element.uid;
  159 +// }
  160 +// });
  161 +// Map<String, String> params = {
  162 +// "uid": uid,
  163 +// };
  164 +// await widget.customerProvider.getCustomerSelectActivityNew(context, params,
  165 +// isShowLoading: isShowLoading);
  166 +// //此人已经新建好券
  167 +// // if (widget.customerProvider.couponListSelect.length > 0) {
  168 +// // for (int i = 0; i < widget.customerProvider.couponListSelect.length; i++) {
  169 +// // if (widget.sellerList.aid == widget.customerProvider.couponListSelect[i].id) {
  170 +// // aidStr = widget.customerProvider.couponListSelect[i].aname;
  171 +// // }
  172 +// // }
  173 +// // widget.customerProvider.notifyListeners();
  174 +// // } else {
  175 +// // //没有新建的优惠券
  176 +// // }
  177 +// _getGuestManageData(isShowLoading: isShowLoading);
  178 +// }
  179 +
  180 +// _getMarketingByUid() async {
  181 +// String uid = '';
  182 +// menuTitle.forEach((element) {
  183 +// if (element.select) {
  184 +// uid = element.uid;
  185 +// }
  186 +// });
  187 +// Map<String, String> params = {"uid": uid};
  188 +// // await widget.customerProvider.getMarketingByUid(context, params);
  189 +
  190 +// MarketingByUidsSunModel myRecordData =
  191 +// await widget.customerProvider.getMarketingByUid(context, params);
  192 +// if (myRecordData != null && myRecordData.sellerList.length > 0) {
  193 +// bool temp = myRecordData.sellerList.any((value) {
  194 +// return value.finishedStatus == '0';
  195 +// });
  196 +// setState(() {
  197 +// showWarning = temp;
  198 +// });
  199 +// }
  200 +// // await widget.customerProvider.searchData(widget.customerProvider.controller.text);
  201 +// }
  202 +
  203 +// Widget _chart() {
  204 +// return Container(
  205 +// // height: w(216),
  206 +// padding: EdgeInsets.only(top: w(16), left: w(16), right: w(16)),
  207 +// margin: EdgeInsets.all(w(10)),
  208 +// decoration: BoxDecoration(
  209 +// color: MyColours.color_ffffff,
  210 +// borderRadius: BorderRadius.circular(r(8))),
  211 +// child: Column(
  212 +// children: [
  213 +// Row(
  214 +// mainAxisAlignment: MainAxisAlignment.spaceBetween,
  215 +// children: [
  216 +// InkWell(
  217 +// onTap: () {
  218 +// if (year == 2018) {
  219 +// return;
  220 +// }
  221 +// setState(() {
  222 +// year--;
  223 +// });
  224 +// _getSellerCountsList(
  225 +// isShowLoading: true,
  226 +// callback: () {
  227 +// setState(() {
  228 +// year++;
  229 +// });
  230 +// });
  231 +// },
  232 +// child: Padding(
  233 +// padding:
  234 +// EdgeInsets.only(right: ScreenUtil().setWidth(20)),
  235 +// child: Image.asset(
  236 +// Utils.getImgPath(year == 2018
  237 +// ? 'c_arrow_left_gray'
  238 +// : 'c_arrow_left'),
  239 +// width: ScreenUtil().setWidth(24),
  240 +// ))),
  241 +// Text(
  242 +// '${year}年',
  243 +// style: TextStyle(
  244 +// fontSize: ScreenUtil().setSp(32),
  245 +// color: MyColours.color_000000),
  246 +// ),
  247 +// InkWell(
  248 +// onTap: () {
  249 +// if (year >= DateTime.now().year) {
  250 +// return;
  251 +// }
  252 +// setState(() {
  253 +// year++;
  254 +// });
  255 +// _getSellerCountsList(
  256 +// isShowLoading: true,
  257 +// callback: () {
  258 +// setState(() {
  259 +// year--;
  260 +// });
  261 +// });
  262 +// },
  263 +// child: Padding(
  264 +// padding: EdgeInsets.only(
  265 +// left: ScreenUtil().setWidth(20),
  266 +// ),
  267 +// child: Image.asset(
  268 +// Utils.getImgPath(year != DateTime.now().year
  269 +// ? 'c_arrow_right'
  270 +// : 'c_arrow_right_gray'),
  271 +// width: ScreenUtil().setWidth(24),
  272 +// )))
  273 +// ],
  274 +// ),
  275 +// VEmptyView(80),
  276 +// Container(
  277 +// width: double.infinity,
  278 +// height: w(177),
  279 +// child: LayoutBuilder(builder: (context, constraints) {
  280 +// return BarChartWidget(
  281 +// dataList: widget.customerProvider.chartManagerDataList);
  282 +// }))
  283 +// ],
  284 +// ),
  285 +// );
  286 +// }
  287 +
  288 +// ///活跃客户、沉睡客户、流失客户
  289 +// Widget _percentWidget(String pnum, String btnTitle, String percent) {
  290 +// return InkWell(
  291 +// onTap: () async {
  292 +// String index = '0';
  293 +// if (btnTitle == '活跃') {
  294 +// index = '1';
  295 +// } else if (btnTitle == '60天未到店') {
  296 +// index = '2';
  297 +// } else if (btnTitle == '120天未到店') {
  298 +// index = '3';
  299 +// }
  300 +// String uid = '';
  301 +// menuTitle.forEach((element) {
  302 +// if (element.select) {
  303 +// uid = element.uid;
  304 +// }
  305 +// });
  306 +// NavigatorUtil.goMyCustomerListPage(
  307 +// context, FromPage.FromPageMyCustomer, uid,
  308 +// index: index);
  309 +// },
  310 +// child: Container(
  311 +// color: MyColours.color_ffffff,
  312 +// height: w(90),
  313 +// width: (ScreenUtil().screenWidth - ScreenUtil().setWidth(20)) / 3,
  314 +// // height: (ScreenUtil().screenWidth - ScreenUtil().setWidth(20)) / 3,
  315 +// child: Column(
  316 +// mainAxisAlignment: MainAxisAlignment.center,
  317 +// children: [
  318 +// VEmptyView(30),
  319 +// Container(
  320 +// // height: w(24),
  321 +// child: Row(
  322 +// mainAxisAlignment: MainAxisAlignment.center,
  323 +// children: [
  324 +// Text(pnum,
  325 +// style: TextStyle(
  326 +// color: btnTitle == '活跃'
  327 +// ? MyColours.color_199095
  328 +// : btnTitle == '60天未到店'
  329 +// ? MyColours.color_E89243
  330 +// : MyColours.color_E34D59,
  331 +// fontSize: ScreenUtil().setSp(48),
  332 +// fontWeight: FontWeight.bold)),
  333 +// Text('位',
  334 +// style: TextStyle(
  335 +// color: MyColours.color_515151,
  336 +// fontSize: ScreenUtil().setSp(28),
  337 +// ))
  338 +// ],
  339 +// )),
  340 +// VEmptyView(20),
  341 +// RoundButton(
  342 +// onPressed: () async {
  343 +// String index = '0';
  344 +// if (btnTitle == '活跃') {
  345 +// index = '1';
  346 +// } else if (btnTitle == '60天未到店') {
  347 +// index = '2';
  348 +// } else if (btnTitle == '120天未到店') {
  349 +// index = '3';
  350 +// }
  351 +// String uid = '';
  352 +// menuTitle.forEach((element) {
  353 +// if (element.select) {
  354 +// uid = element.uid;
  355 +// }
  356 +// });
  357 +// NavigatorUtil.goMyCustomerListPage(
  358 +// context, FromPage.FromPageMyCustomer, uid,
  359 +// index: index);
  360 +// },
  361 +// text: btnTitle,
  362 +// fontSize: 24,
  363 +// isBold: false,
  364 +// textColor: MyColours.color_999999,
  365 +// gradientStart: MyColours.color_ffffff,
  366 +// gradientEnd: MyColours.color_ffffff,
  367 +// borderColor: MyColours.color_ffffff,
  368 +// height: ScreenUtil().setWidth(48),
  369 +// // width: ScreenUtil().setWidth(160),
  370 +// radius: ScreenUtil().setWidth(30),
  371 +// ),
  372 +// // VEmptyView(16),
  373 +// // percent == null
  374 +// // ? SizedBox()
  375 +// // : Text('${percent}%',
  376 +// // style: TextStyle(
  377 +// // color: MyColours.color_199095,
  378 +// // fontSize: ScreenUtil().setSp(24),
  379 +// // )),
  380 +// ],
  381 +// ),
  382 +// ));
  383 +// }
  384 +
  385 +// @override
  386 +// Widget build(BuildContext context) {
  387 +// // widget.customerProvider = Provider.of<widget.customerProvider>(context, listen: true);
  388 +// return Scaffold(
  389 +// // backgroundColor: MyColours.color_f3f3f3,
  390 +// // appBar: SystemAppBar('我的客情', onTap: () {
  391 +// // EventBus().emit('changeStatusColor');
  392 +// // Navigator.pop(context);
  393 +// // }),
  394 +// body: WillPopScope(
  395 +// onWillPop: () async {
  396 +// EventBus().emit('changeStatusColor');
  397 +// return true;
  398 +// },
  399 +// child: Column(children: [
  400 +// Container(
  401 +// color: MyColours.color_ffffff,
  402 +// height: ScreenUtil().setWidth(70),
  403 +// padding: EdgeInsets.only(bottom: w(12)),
  404 +// margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)),
  405 +// child: Row(
  406 +// children: [
  407 +// HEmptyView(48),
  408 +// Expanded(
  409 +// child: SizedBox(
  410 +// // height: ScreenUtil().setWidth(30),
  411 +// child: ListView.builder(
  412 +// itemCount: menuTitle.length,
  413 +// shrinkWrap: true,
  414 +// controller: _controller,
  415 +// scrollDirection: Axis.horizontal,
  416 +// itemBuilder: (BuildContext contxt, int index) {
  417 +// return InkWell(
  418 +// onTap: () {
  419 +// for (MessageMenuModel item in menuTitle) {
  420 +// item.select = false;
  421 +// }
  422 +// menuTitle[index].select = true;
  423 +// setState(() {});
  424 +// _getMarketingByUid();
  425 +// // _getSellerCountsList();
  426 +// _getSellerCountsList(
  427 +// isShowLoading: true, callback: () {});
  428 +// _couponNetworkData(isShowLoading: false);
  429 +
  430 +// // offset = 0;
  431 +// // 1提前点餐/2内部预订/10在线预订/15店内消息传/12在线买单
  432 +
  433 +// // if (index == 0) {
  434 +// // typeid = '';
  435 +// // } else if (index == 1) {
  436 +// // //店内消息
  437 +// // typeid = '15';
  438 +// // } else if (index == 2) {
  439 +// // //在线预订
  440 +// // typeid = '10';
  441 +// // } else if (index == 3) {
  442 +// // //提前点餐
  443 +// // typeid = '1';
  444 +// // } else if (index == 4) {
  445 +// // //在线买单
  446 +// // typeid = '12';
  447 +// // } else if (index == 5) {
  448 +// // //会员充值
  449 +// // typeid = '17';
  450 +// // } else if (index == 6) {
  451 +// // //存酒超期
  452 +// // typeid = '18';
  453 +// // }
  454 +// // getMessage(typeid, showLoading: true);
  455 +// },
  456 +// child: Container(
  457 +// // width: ScreenUtil().setWidth(104 * 2),
  458 +
  459 +// margin: EdgeInsets.only(
  460 +// right: ScreenUtil().setWidth(30),
  461 +// ),
  462 +// padding: EdgeInsets.symmetric(
  463 +// horizontal: ScreenUtil().setWidth(10),
  464 +// vertical: ScreenUtil().setWidth(4)),
  465 +// alignment: Alignment.center,
  466 +// decoration: BoxDecoration(
  467 +// borderRadius: BorderRadius.circular(
  468 +// ScreenUtil().setWidth(10)),
  469 +// // color: menuTitle[index].select
  470 +// // ? MyColours.color_438E93
  471 +// // : MyColours.color_999999,
  472 +// border: Border.all(
  473 +// color: menuTitle[index].select
  474 +// ? MyColours.color_438E93
  475 +// : MyColours.color_999999,
  476 +// width: ScreenUtil().setWidth(2))),
  477 +// child: Text(
  478 +// menuTitle[index].title,
  479 +// overflow: TextOverflow.ellipsis,
  480 +// style: TextStyle(
  481 +// color: menuTitle[index].select
  482 +// ? MyColours.color_438E93
  483 +// : MyColours.color_999999,
  484 +// fontSize: ScreenUtil().setSp(24),
  485 +// decoration: TextDecoration.none,
  486 +// fontWeight: FontWeight.normal),
  487 +// ),
  488 +// ),
  489 +// );
  490 +// })))
  491 +// ],
  492 +// ),
  493 +// ),
  494 +// Consumer<CustomerProvider>(builder: (context, model, _) {
  495 +// if (model.pageStateMyHome != PageState.Success) {
  496 +// return Expanded(
  497 +// child: ExceptionPage(
  498 +// pageState: model.pageStateMyHome,
  499 +// callback: () {
  500 +// _couponNetworkData();
  501 +
  502 +// _getMarketingByUid();
  503 +// _getSellerCountsList();
  504 +// },
  505 +// emptyMsg: "暂时没有我的客情哦",
  506 +// emptyImg: "empty_search",
  507 +// showMsg: "加载中,请稍后...",
  508 +// ));
  509 +// } else {
  510 +// return Expanded(
  511 +// child: SingleChildScrollView(
  512 +// controller: _controller,
  513 +// child: Column(
  514 +// children: [
  515 +// // VEmptyView(10),
  516 +// InkWell(
  517 +// onTap: () {
  518 +// String uid = '';
  519 +// menuTitle.forEach((element) {
  520 +// if (element.select) {
  521 +// uid = element.uid;
  522 +// }
  523 +// });
  524 +// NavigatorUtil.goMyCustomerListPage(
  525 +// context, FromPage.FromPageMyCustomer, uid);
  526 +// },
  527 +// child: Container(
  528 +// height: w(80),
  529 +// color: MyColours.color_ffffff,
  530 +// child: Row(
  531 +// mainAxisAlignment: MainAxisAlignment.center,
  532 +// children: [
  533 +// // Text(
  534 +// // '累计',
  535 +// // style: TextStyle(
  536 +// // color: MyColours.color_515151,
  537 +// // fontWeight: FontWeight.bold,
  538 +// // fontSize: ScreenUtil().setSp(32)),
  539 +// // ),
  540 +// Text(
  541 +// '${widget.customerProvider.guestSunmodel.myCustomer}',
  542 +// style: TextStyle(
  543 +// color: MyColours.color_199095,
  544 +// fontSize: ScreenUtil().setSp(64),
  545 +// fontWeight: FontWeight.bold),
  546 +// ),
  547 +// Text(
  548 +// '位',
  549 +// style: TextStyle(
  550 +// color: MyColours.color_515151,
  551 +// fontWeight: FontWeight.bold,
  552 +// fontSize: ScreenUtil().setSp(32)),
  553 +// )
  554 +// ],
  555 +// ),
  556 +// )),
  557 +// VEmptyView(10),
  558 +// // GridView.builder(
  559 +// // controller: _controller,
  560 +// // shrinkWrap: true,
  561 +// // cacheExtent: ScreenUtil().setWidth(0),
  562 +// // itemCount: 3,
  563 +// // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  564 +// // crossAxisCount: 3,
  565 +// // childAspectRatio: 1,
  566 +// // mainAxisSpacing: ScreenUtil().setWidth(10),
  567 +// // crossAxisSpacing: ScreenUtil().setWidth(10)),
  568 +// // itemBuilder: (BuildContext context, int index) {
  569 +// // // locationState = state;
  570 +// // return _percentWidget(
  571 +// // '${widget.customerProvider.guestSunmodel.active.count}',
  572 +// // '活跃客户',
  573 +// // '${widget.customerProvider.guestSunmodel.active.scale}');
  574 +// // }),
  575 +// Row(
  576 +// children: [
  577 +// _percentWidget(
  578 +// '${widget.customerProvider.guestSunmodel.active.count}',
  579 +// '活跃',
  580 +// '${widget.customerProvider.guestSunmodel.active.scale}'),
  581 +// HEmptyView(10),
  582 +// _percentWidget(
  583 +// '${widget.customerProvider.guestSunmodel.sleep.count}',
  584 +// '60天未到店',
  585 +// '${widget.customerProvider.guestSunmodel.sleep.scale}'),
  586 +// HEmptyView(10),
  587 +// _percentWidget(
  588 +// '${widget.customerProvider.guestSunmodel.drain.count}',
  589 +// '120天未到店',
  590 +// '${widget.customerProvider.guestSunmodel.drain.scale}'),
  591 +// ],
  592 +// ),
  593 +// ListView.builder(
  594 +// controller: _controller,
  595 +// shrinkWrap: true,
  596 +// cacheExtent: ScreenUtil().setWidth(0),
  597 +// itemCount: widget.customerProvider.guestSunmodel
  598 +// .tips.task ==
  599 +// null ||
  600 +// widget.customerProvider.guestSunmodel.tips
  601 +// .task.length ==
  602 +// 0
  603 +// ? 0
  604 +// : widget.customerProvider.guestSunmodel.tips
  605 +// .task.length,
  606 +// itemBuilder: (BuildContext context, int index) {
  607 +// // locationState = state;
  608 +// Task data = widget.customerProvider.guestSunmodel
  609 +// .tips.task[index];
  610 +// return Column(
  611 +// children: [
  612 +// VEmptyView(10),
  613 +// Container(
  614 +// color: MyColours.color_ffffff,
  615 +// padding: EdgeInsets.symmetric(
  616 +// horizontal: ScreenUtil().setWidth(20),
  617 +// vertical: ScreenUtil().setWidth(30)),
  618 +// child: Row(
  619 +// children: [
  620 +// Image.asset(
  621 +// Utils.getImgPath('warning'),
  622 +// width: ScreenUtil().setWidth(42),
  623 +// ),
  624 +// HEmptyView(15),
  625 +// Expanded(
  626 +// child: Column(
  627 +// crossAxisAlignment:
  628 +// CrossAxisAlignment.start,
  629 +// children: [
  630 +// Text(
  631 +// '店内任务:${data.content}',
  632 +// maxLines: 1,
  633 +// overflow: TextOverflow.ellipsis,
  634 +// style: TextStyle(
  635 +// color: MyColours.color_333333,
  636 +// fontSize:
  637 +// ScreenUtil().setSp(32)),
  638 +// ),
  639 +// data.aid != null &&
  640 +// data.aidStr != null
  641 +// ? Padding(
  642 +// padding: EdgeInsets.only(
  643 +// top: ScreenUtil()
  644 +// .setWidth(8)),
  645 +// child: Text(
  646 +// '优惠内容:${data.aidStr}',
  647 +// maxLines: 1,
  648 +// overflow:
  649 +// TextOverflow.ellipsis,
  650 +// style: TextStyle(
  651 +// color: MyColours
  652 +// .color_333333,
  653 +// fontSize: ScreenUtil()
  654 +// .setSp(24)),
  655 +// ),
  656 +// )
  657 +// : SizedBox(),
  658 +// VEmptyView(8),
  659 +// Text(
  660 +// '创建人:${data.createUser}',
  661 +// maxLines: 1,
  662 +// overflow: TextOverflow.ellipsis,
  663 +// style: TextStyle(
  664 +// color: MyColours.color_333333,
  665 +// fontSize:
  666 +// ScreenUtil().setSp(26)),
  667 +// )
  668 +// ],
  669 +// )),
  670 +// HEmptyView(20),
  671 +// Column(children: [
  672 +// RoundButton(
  673 +// text: '立即完成',
  674 +
  675 +// padding: EdgeInsets.symmetric(
  676 +// horizontal:
  677 +// ScreenUtil().setWidth(26)),
  678 +// gradientStart:
  679 +// MyColours.color_199095,
  680 +// gradientEnd: MyColours.color_199095,
  681 +// // borderColor: MyColours.color_999999,
  682 +// radius: ScreenUtil().setWidth(40),
  683 +// height: ScreenUtil().setWidth(64),
  684 +// width: ScreenUtil().setWidth(180),
  685 +// fontSize: 26,
  686 +// isBold: false,
  687 +// onPressed: () {
  688 +// SellerList sellerList =
  689 +// SellerList.fromJson(
  690 +// json.decode(
  691 +// json.encode(data)));
  692 +// NavigatorUtil
  693 +// .goMyMakeMarkingPageOnlyShow(
  694 +// context, sellerList);
  695 +// },
  696 +// ),
  697 +// data.remainingTime != null
  698 +// ? Padding(
  699 +// padding: EdgeInsets.only(
  700 +// top: ScreenUtil()
  701 +// .setWidth(6)),
  702 +// child: Text(
  703 +// '${data.remainingTime}天内',
  704 +// maxLines: 1,
  705 +// overflow:
  706 +// TextOverflow.ellipsis,
  707 +// style: TextStyle(
  708 +// color: Color.fromRGBO(
  709 +// 215, 30, 40, 1),
  710 +// fontSize: ScreenUtil()
  711 +// .setSp(26)),
  712 +// ))
  713 +// : SizedBox()
  714 +// ])
  715 +// ],
  716 +// ),
  717 +// ),
  718 +// ],
  719 +// );
  720 +// }),
  721 +// ListView.builder(
  722 +// controller: _controller,
  723 +// shrinkWrap: true,
  724 +// cacheExtent: ScreenUtil().setWidth(0),
  725 +// itemCount: widget.customerProvider.guestSunmodel
  726 +// .tips.recover ==
  727 +// null ||
  728 +// widget.customerProvider.guestSunmodel.tips
  729 +// .recover.length ==
  730 +// 0
  731 +// ? 0
  732 +// : 1,
  733 +// itemBuilder: (BuildContext context, int index) {
  734 +// // locationState = state;
  735 +
  736 +// return Column(
  737 +// children: [
  738 +// VEmptyView(10),
  739 +// Container(
  740 +// color: MyColours.color_ffffff,
  741 +// padding: EdgeInsets.symmetric(
  742 +// horizontal: ScreenUtil().setWidth(20),
  743 +// vertical: ScreenUtil().setWidth(30)),
  744 +// child: Row(
  745 +// children: [
  746 +// Image.asset(
  747 +// Utils.getImgPath('warning'),
  748 +// width: ScreenUtil().setWidth(42),
  749 +// ),
  750 +// HEmptyView(15),
  751 +// Expanded(
  752 +// child: Text(
  753 +// '${widget.customerProvider.guestSunmodel.tips.recover[0]}',
  754 +// maxLines: 10,
  755 +// overflow: TextOverflow.ellipsis,
  756 +// style: TextStyle(
  757 +// color: MyColours.color_333333,
  758 +// fontSize: ScreenUtil().setSp(32)),
  759 +// )),
  760 +// HEmptyView(20),
  761 +// RoundButton(
  762 +// text: '一键追回',
  763 +// padding: EdgeInsets.symmetric(
  764 +// horizontal:
  765 +// ScreenUtil().setWidth(26)),
  766 +// gradientStart: MyColours.color_199095,
  767 +// gradientEnd: MyColours.color_199095,
  768 +// // borderColor: MyColours.color_999999,
  769 +// radius: ScreenUtil().setWidth(40),
  770 +// height: ScreenUtil().setWidth(64),
  771 +// width: ScreenUtil().setWidth(180),
  772 +// fontSize: 26,
  773 +// isBold: false,
  774 +// onPressed: () {
  775 +// String uid = '';
  776 +// menuTitle.forEach((element) {
  777 +// if (element.select) {
  778 +// uid = element.uid;
  779 +// }
  780 +// });
  781 +// NavigatorUtil.goMyMakeMarkingPage(
  782 +// context, uid,
  783 +// fromPage: FromPage
  784 +// .FromPageMyCustomer,
  785 +// homeGid:
  786 +// Utils.listToStringEnglish1(
  787 +// widget
  788 +// .customerProvider
  789 +// .guestSunmodel
  790 +// .tips
  791 +// .recover[1]));
  792 +// },
  793 +// ),
  794 +// ],
  795 +// ),
  796 +// ),
  797 +// ],
  798 +// );
  799 +// }),
  800 +// ListView.builder(
  801 +// controller: _controller,
  802 +// shrinkWrap: true,
  803 +// cacheExtent: ScreenUtil().setWidth(0),
  804 +// itemCount: widget.customerProvider.guestSunmodel
  805 +// .tips.awaken ==
  806 +// null ||
  807 +// widget.customerProvider.guestSunmodel.tips
  808 +// .awaken.length ==
  809 +// 0
  810 +// ? 0
  811 +// : 1,
  812 +// itemBuilder: (BuildContext context, int index) {
  813 +// // locationState = state;
  814 +
  815 +// return Column(
  816 +// children: [
  817 +// VEmptyView(10),
  818 +// Container(
  819 +// color: MyColours.color_ffffff,
  820 +// padding: EdgeInsets.symmetric(
  821 +// horizontal: ScreenUtil().setWidth(20),
  822 +// vertical: ScreenUtil().setWidth(30)),
  823 +// child: Row(
  824 +// children: [
  825 +// Image.asset(
  826 +// Utils.getImgPath('warning'),
  827 +// width: ScreenUtil().setWidth(42),
  828 +// ),
  829 +// HEmptyView(15),
  830 +// Expanded(
  831 +// child: Text(
  832 +// '${widget.customerProvider.guestSunmodel.tips.awaken[0]}',
  833 +// maxLines: 10,
  834 +// overflow: TextOverflow.ellipsis,
  835 +// style: TextStyle(
  836 +// color: MyColours.color_333333,
  837 +// fontSize: ScreenUtil().setSp(32)),
  838 +// )),
  839 +// HEmptyView(20),
  840 +// RoundButton(
  841 +// text: '一键唤醒',
  842 +// padding: EdgeInsets.symmetric(
  843 +// horizontal:
  844 +// ScreenUtil().setWidth(26)),
  845 +// gradientStart: MyColours.color_199095,
  846 +// gradientEnd: MyColours.color_199095,
  847 +// // borderColor: MyColours.color_999999,
  848 +// radius: ScreenUtil().setWidth(40),
  849 +// height: ScreenUtil().setWidth(64),
  850 +// width: ScreenUtil().setWidth(180),
  851 +// fontSize: 26,
  852 +// isBold: false,
  853 +// onPressed: () {
  854 +// String uid = '';
  855 +// menuTitle.forEach((element) {
  856 +// if (element.select) {
  857 +// uid = element.uid;
  858 +// }
  859 +// });
  860 +// NavigatorUtil.goMyMakeMarkingPage(
  861 +// context, uid,
  862 +// fromPage: FromPage
  863 +// .FromPageMyCustomer,
  864 +// homeGid:
  865 +// Utils.listToStringEnglish1(
  866 +// widget
  867 +// .customerProvider
  868 +// .guestSunmodel
  869 +// .tips
  870 +// .awaken[1]));
  871 +// },
  872 +// ),
  873 +// ],
  874 +// ),
  875 +// ),
  876 +// ],
  877 +// );
  878 +// }),
  879 +// _chart(),
  880 +// ListView.builder(
  881 +// itemCount: widget
  882 +// .customerProvider.managerStatisticsList.length,
  883 +// shrinkWrap: true,
  884 +// controller: _controller,
  885 +// padding: EdgeInsets.symmetric(horizontal: w(10)),
  886 +// itemBuilder: (context, index) {
  887 +// SellerCountsListSunModel countsListSunModel =
  888 +// widget.customerProvider
  889 +// .managerStatisticsList[index];
  890 +// return InkWell(
  891 +// onTap: () {
  892 +// String uid = '';
  893 +// menuTitle.forEach((element) {
  894 +// if (element.select) {
  895 +// uid = element.uid;
  896 +// }
  897 +// });
  898 +// NavigatorUtil.goMonthOrderPage(
  899 +// context,
  900 +// year.toString(),
  901 +// countsListSunModel.monthss.toString(),
  902 +// uid: uid);
  903 +// },
  904 +// child: MonthItem(
  905 +// countsListSunModel: countsListSunModel));
  906 +// })
  907 +// ],
  908 +// ),
  909 +// ));
  910 +// }
  911 +// })
  912 +// // Container(
  913 +// // color: MyColours.color_FAFAFA,
  914 +// // padding: EdgeInsets.only(
  915 +// // top: w(13), bottom: w(26), left: w(45), right: (45)),
  916 +// // child: Stack(
  917 +// // children: [
  918 +// // RoundButton(
  919 +// // onPressed: () {
  920 +// // NavigatorUtil.goMyMarketingRecordsPage(
  921 +// // context, FromPage.FromPageMyCustomer);
  922 +// // },
  923 +// // text: '历史营销记录',
  924 +// // fontSize: 32,
  925 +// // isBold: true,
  926 +// // // margin: EdgeInsets.only(
  927 +// // // top: w(13),
  928 +// // // bottom: w(26),
  929 +// // // left: w(45),
  930 +// // // right: (45)),
  931 +// // textColor: MyColours.color_F8F9FD,
  932 +// // gradientStart: MyColours.color_199095,
  933 +// // gradientEnd: MyColours.color_199095,
  934 +// // borderColor: MyColours.color_199095,
  935 +// // height: ScreenUtil().setWidth(86),
  936 +// // // width: ScreenUtil().setWidth(260),
  937 +// // radius: ScreenUtil().setWidth(10),
  938 +// // ),
  939 +// // showWarning
  940 +// // ? Positioned(
  941 +// // right: ScreenUtil().setWidth(30),
  942 +// // top: ScreenUtil().setWidth(45 / 2),
  943 +// // child: Image.asset(
  944 +// // Utils.getImgPath('warning'),
  945 +// // width: ScreenUtil().setWidth(35),
  946 +// // ))
  947 +// // : SizedBox()
  948 +// // ],
  949 +// // ))
  950 +// ])));
  951 +// }
  952 +// }
@@ -193,6 +193,8 @@ dependencies: @@ -193,6 +193,8 @@ dependencies:
193 barcode_scan2: ^4.2.4 193 barcode_scan2: ^4.2.4
194 # 柱形图 194 # 柱形图
195 fl_chart: ^0.62.0 195 fl_chart: ^0.62.0
  196 +
  197 + # shimmer: ^3.0.0
196 198
197 # ai_barcode 3.2.4 199 # ai_barcode 3.2.4
198 # qr_code_scanner: ^1.0.1 200 # qr_code_scanner: ^1.0.1