Commit f053b1e3501d673a082f0d35dab98c8d06bf0793

Authored by weixin_45529955
1 parent 808e5e85

我的页面 店铺首次微信登陆编辑个人昵称后显示null && 全店客情 分经理 请求接口页面清空转圈

1 class HttpUrl { 1 class HttpUrl {
2 static const String qiniu_address = "http://rs.qiniuapi.com/"; //七牛云服务端请求地址 2 static const String qiniu_address = "http://rs.qiniuapi.com/"; //七牛云服务端请求地址
3 static const String server_address = "http://xt04.colorcun.com/"; //服务端请求地址 3 static const String server_address = "http://xt04.colorcun.com/"; //服务端请求地址
  4 +
  5 +// static const String server_address = "http://192.168.5.90:8000/public/"; //服务端请求地址
  6 +
4 static const String app_user_login = 7 static const String app_user_login =
5 "?service=Android.User.AppUserLogin"; //登录地址 8 "?service=Android.User.AppUserLogin"; //登录地址
6 static const String user_token_init = 9 static const String user_token_init =
@@ -2580,7 +2580,7 @@ class InvicationPageState extends State<InvicationPage> @@ -2580,7 +2580,7 @@ class InvicationPageState extends State<InvicationPage>
2580 2580
2581 DialogUtil.showSelectCusmanDialog( 2581 DialogUtil.showSelectCusmanDialog(
2582 context, dailyList, (value) async { 2582 context, dailyList, (value) async {
2583 - if (value != null) { 2583 + if (value != null) {
2584 ddateIndex = value.first; 2584 ddateIndex = value.first;
2585 ddateHm = dailyList[value.first]; 2585 ddateHm = dailyList[value.first];
2586 setState(() {}); 2586 setState(() {});
@@ -275,6 +275,10 @@ class _BaseInfoPageState extends State<BaseInfoPage> { @@ -275,6 +275,10 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
275 "morning": "", 275 "morning": "",
276 "noon": "", 276 "noon": "",
277 "night": "", 277 "night": "",
  278 +
  279 + // 'userphone': user['phone'],
  280 +
  281 + 'nickname': nameStr,
278 }; 282 };
279 UserModel userModel = Provider.of<UserModel>(context, listen: false); 283 UserModel userModel = Provider.of<UserModel>(context, listen: false);
280 userModel.saveUserInfo(User.fromJson(userMap)); 284 userModel.saveUserInfo(User.fromJson(userMap));
1 -  
2 import 'package:flutter/cupertino.dart'; 1 import 'package:flutter/cupertino.dart';
3 import 'package:flutter/material.dart'; 2 import 'package:flutter/material.dart';
4 import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -30,7 +29,8 @@ import '../month_item.dart'; @@ -30,7 +29,8 @@ import '../month_item.dart';
30 29
31 class StoreCustomerHomeLeftPage extends StatefulWidget { 30 class StoreCustomerHomeLeftPage extends StatefulWidget {
32 final CustomerProvider? customerProvider; 31 final CustomerProvider? customerProvider;
33 - StoreCustomerHomeLeftPage({Key? key, this.customerProvider}) : super(key: key); 32 + StoreCustomerHomeLeftPage({Key? key, this.customerProvider})
  33 + : super(key: key);
34 34
35 @override 35 @override
36 _StoreCustomerHomeLeftPageState createState() => 36 _StoreCustomerHomeLeftPageState createState() =>
@@ -74,9 +74,10 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { @@ -74,9 +74,10 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
74 } 74 }
75 75
76 getSellerVersion() async { 76 getSellerVersion() async {
77 - await collectStoreProvider.getSellerVersion(context,showLoading:false);  
78 -  
79 - setState(() {}); 77 + await collectStoreProvider.getSellerVersion(context, showLoading: false);
  78 + if (mounted) {
  79 + setState(() {});
  80 + }
80 } 81 }
81 82
82 ///全店客情首页 83 ///全店客情首页
@@ -96,9 +97,11 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { @@ -96,9 +97,11 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
96 bool temp = list.any((value) { 97 bool temp = list.any((value) {
97 return value.finishedStatus == '0'; 98 return value.finishedStatus == '0';
98 }); 99 });
99 - setState(() {  
100 - showWarning = temp;  
101 - }); 100 + if (mounted) {
  101 + setState(() {
  102 + showWarning = temp;
  103 + });
  104 + }
102 } 105 }
103 // await widget.customerProvider.searchData(widget.customerProvider.controller.text); 106 // await widget.customerProvider.searchData(widget.customerProvider.controller.text);
104 } 107 }
@@ -111,7 +114,10 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { @@ -111,7 +114,10 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
111 await widget.customerProvider! 114 await widget.customerProvider!
112 .getSellerCountsList(context, params, isShowLoading: isShowLoading); 115 .getSellerCountsList(context, params, isShowLoading: isShowLoading);
113 widget.customerProvider!.pageStateStoreHome = PageState.Success; 116 widget.customerProvider!.pageStateStoreHome = PageState.Success;
114 - setState(() {}); 117 + if (mounted) {
  118 + setState(() {});
  119 + }
  120 +
115 if ((widget.customerProvider!.homeStatisticsList == null || 121 if ((widget.customerProvider!.homeStatisticsList == null ||
116 widget.customerProvider!.homeStatisticsList!.length == 0) && 122 widget.customerProvider!.homeStatisticsList!.length == 0) &&
117 callback != null) { 123 callback != null) {
@@ -1131,8 +1137,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { @@ -1131,8 +1137,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
1131 widget.customerProvider!.storeSunmodel! 1137 widget.customerProvider!.storeSunmodel!
1132 .sellerUser![index - 1]!.uid, 1138 .sellerUser![index - 1]!.uid,
1133 { 1139 {
1134 - 'object': widget  
1135 - .customerProvider!.storeSunmodel!.sellerUser 1140 + 'object': widget.customerProvider!
  1141 + .storeSunmodel!.sellerUser
1136 }, 1142 },
1137 index: '0', 1143 index: '0',
1138 ); 1144 );
@@ -1191,8 +1197,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { @@ -1191,8 +1197,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
1191 // _monthWidget(), 1197 // _monthWidget(),
1192 1198
1193 ListView.builder( 1199 ListView.builder(
1194 - itemCount:  
1195 - widget.customerProvider!.homeStatisticsList!.length, 1200 + itemCount: widget
  1201 + .customerProvider!.homeStatisticsList!.length,
1196 shrinkWrap: true, 1202 shrinkWrap: true,
1197 controller: _controller, 1203 controller: _controller,
1198 padding: EdgeInsets.symmetric(horizontal: w(10)), 1204 padding: EdgeInsets.symmetric(horizontal: w(10)),
@@ -1633,8 +1639,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { @@ -1633,8 +1639,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
1633 onPressed: () { 1639 onPressed: () {
1634 NavigatorUtil.goMarketingRecordsPage( 1640 NavigatorUtil.goMarketingRecordsPage(
1635 context, FromPage.FromPageStoreCustomer, { 1641 context, FromPage.FromPageStoreCustomer, {
1636 - 'object': widget  
1637 - .customerProvider!.storeSunmodel!.sellerUser 1642 + 'object': widget.customerProvider!
  1643 + .storeSunmodel!.sellerUser
1638 }); 1644 });
1639 }, 1645 },
1640 text: '历史营销记录', 1646 text: '历史营销记录',
@@ -411,101 +411,106 @@ class _StoreCustomerHomeRightPageState @@ -411,101 +411,106 @@ class _StoreCustomerHomeRightPageState
411 // Navigator.pop(context); 411 // Navigator.pop(context);
412 // }), 412 // }),
413 body: Column(children: [ 413 body: Column(children: [
414 - Container(  
415 - color: MyColours.color_ffffff,  
416 - height: ScreenUtil().setWidth(70),  
417 - padding: EdgeInsets.only(bottom: w(12)),  
418 - margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)),  
419 - child: Row(  
420 - children: [  
421 - HEmptyView(48),  
422 - Expanded(  
423 - child: SizedBox(  
424 - // height: ScreenUtil().setWidth(30),  
425 - child: ListView.builder(  
426 - itemCount: menuTitle.length,  
427 - shrinkWrap: true,  
428 - controller: _controller,  
429 - scrollDirection: Axis.horizontal,  
430 - itemBuilder: (BuildContext contxt, int index) {  
431 - return InkWell(  
432 - onTap: () {  
433 - for (MessageMenuModel item in menuTitle) {  
434 - item.select = false;  
435 - }  
436 - menuTitle[index].select = true;  
437 - setState(() {});  
438 - // _getMarketingByUid();  
439 - // _getSellerCountsList();  
440 - _getSellerCountsList(  
441 - isShowLoading: true, callback: () {});  
442 - // _couponNetworkData(isShowLoading: false);  
443 - _getGuestManageData(isShowLoading: false); 414 + Consumer<CustomerProvider>(builder: (context, model, _) {
  415 + return Container(
  416 + color: MyColours.color_ffffff,
  417 + height: ScreenUtil().setWidth(70),
  418 + padding: EdgeInsets.only(bottom: w(12)),
  419 + margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)),
  420 + child: Row(
  421 + children: [
  422 + HEmptyView(48),
  423 + Expanded(
  424 + child: SizedBox(
  425 + // height: ScreenUtil().setWidth(30),
  426 + child: ListView.builder(
  427 + itemCount: menuTitle.length,
  428 + shrinkWrap: true,
  429 + controller: _controller,
  430 + scrollDirection: Axis.horizontal,
  431 + itemBuilder: (BuildContext contxt, int index) {
  432 + return InkWell(
  433 + onTap: () {
  434 + for (MessageMenuModel item in menuTitle) {
  435 + item.select = false;
  436 + }
  437 + menuTitle[index].select = true;
444 438
445 - // offset = 0;  
446 - // 1提前点餐/2内部预订/10在线预订/15店内消息传/12在线买单 439 + model.pageStateMyHome = PageState.Loading;
447 440
448 - // if (index == 0) {  
449 - // typeid = '';  
450 - // } else if (index == 1) {  
451 - // //店内消息  
452 - // typeid = '15';  
453 - // } else if (index == 2) {  
454 - // //在线预订  
455 - // typeid = '10';  
456 - // } else if (index == 3) {  
457 - // //提前点餐  
458 - // typeid = '1';  
459 - // } else if (index == 4) {  
460 - // //在线买单  
461 - // typeid = '12';  
462 - // } else if (index == 5) {  
463 - // //会员充值  
464 - // typeid = '17';  
465 - // } else if (index == 6) {  
466 - // //存酒超期  
467 - // typeid = '18';  
468 - // }  
469 - // getMessage(typeid, showLoading: true);  
470 - },  
471 - child: Container(  
472 - // width: ScreenUtil().setWidth(104 * 2), 441 + setState(() {});
  442 + // _getMarketingByUid();
  443 + // _getSellerCountsList();
  444 + _getSellerCountsList(
  445 + isShowLoading: false, callback: () {});
  446 + // _couponNetworkData(isShowLoading: false);
  447 + _getGuestManageData(isShowLoading: false);
473 448
474 - margin: EdgeInsets.only(  
475 - right: ScreenUtil().setWidth(30),  
476 - ),  
477 - padding: EdgeInsets.symmetric(  
478 - horizontal: ScreenUtil().setWidth(10),  
479 - vertical: ScreenUtil().setWidth(4)),  
480 - alignment: Alignment.center,  
481 - decoration: BoxDecoration(  
482 - borderRadius: BorderRadius.circular(  
483 - ScreenUtil().setWidth(10)),  
484 - // color: menuTitle[index].select  
485 - // ? MyColours.color_438E93  
486 - // : MyColours.color_999999,  
487 - border: Border.all( 449 + // offset = 0;
  450 + // 1提前点餐/2内部预订/10在线预订/15店内消息传/12在线买单
  451 +
  452 + // if (index == 0) {
  453 + // typeid = '';
  454 + // } else if (index == 1) {
  455 + // //店内消息
  456 + // typeid = '15';
  457 + // } else if (index == 2) {
  458 + // //在线预订
  459 + // typeid = '10';
  460 + // } else if (index == 3) {
  461 + // //提前点餐
  462 + // typeid = '1';
  463 + // } else if (index == 4) {
  464 + // //在线买单
  465 + // typeid = '12';
  466 + // } else if (index == 5) {
  467 + // //会员充值
  468 + // typeid = '17';
  469 + // } else if (index == 6) {
  470 + // //存酒超期
  471 + // typeid = '18';
  472 + // }
  473 + // getMessage(typeid, showLoading: true);
  474 + },
  475 + child: Container(
  476 + // width: ScreenUtil().setWidth(104 * 2),
  477 +
  478 + margin: EdgeInsets.only(
  479 + right: ScreenUtil().setWidth(30),
  480 + ),
  481 + padding: EdgeInsets.symmetric(
  482 + horizontal: ScreenUtil().setWidth(10),
  483 + vertical: ScreenUtil().setWidth(4)),
  484 + alignment: Alignment.center,
  485 + decoration: BoxDecoration(
  486 + borderRadius: BorderRadius.circular(
  487 + ScreenUtil().setWidth(10)),
  488 + // color: menuTitle[index].select
  489 + // ? MyColours.color_438E93
  490 + // : MyColours.color_999999,
  491 + border: Border.all(
  492 + color: menuTitle[index].select
  493 + ? MyColours.color_438E93
  494 + : MyColours.color_999999,
  495 + width: ScreenUtil().setWidth(2))),
  496 + child: Text(
  497 + menuTitle[index].title!,
  498 + overflow: TextOverflow.ellipsis,
  499 + style: TextStyle(
488 color: menuTitle[index].select 500 color: menuTitle[index].select
489 ? MyColours.color_438E93 501 ? MyColours.color_438E93
490 : MyColours.color_999999, 502 : MyColours.color_999999,
491 - width: ScreenUtil().setWidth(2))),  
492 - child: Text(  
493 - menuTitle[index].title!,  
494 - overflow: TextOverflow.ellipsis,  
495 - style: TextStyle(  
496 - color: menuTitle[index].select  
497 - ? MyColours.color_438E93  
498 - : MyColours.color_999999,  
499 - fontSize: ScreenUtil().setSp(24),  
500 - decoration: TextDecoration.none,  
501 - fontWeight: FontWeight.normal), 503 + fontSize: ScreenUtil().setSp(24),
  504 + decoration: TextDecoration.none,
  505 + fontWeight: FontWeight.normal),
  506 + ),
502 ), 507 ),
503 - ),  
504 - );  
505 - })))  
506 - ],  
507 - ),  
508 - ), 508 + );
  509 + })))
  510 + ],
  511 + ),
  512 + );
  513 + }),
509 Consumer<CustomerProvider>(builder: (context, model, _) { 514 Consumer<CustomerProvider>(builder: (context, model, _) {
510 if (model.pageStateMyHome != PageState.Success) { 515 if (model.pageStateMyHome != PageState.Success) {
511 if (model.pageStateMyHome == PageState.Loading) { 516 if (model.pageStateMyHome == PageState.Loading) {