Commit 41d9fb99548f026204fefac14b7b80a0b3394274

Authored by wdn127929
2 parents cbccc635 a8fbe793

Merge branch 'v4.7.0+' into v4.8.0+

Showing 29 changed files with 875 additions and 368 deletions
@@ -70,6 +70,12 @@ class CustomerBySellerSunModel extends Object with ISuspensionBean { @@ -70,6 +70,12 @@ class CustomerBySellerSunModel extends Object with ISuspensionBean {
70 @JsonKey(name: 'is_member') 70 @JsonKey(name: 'is_member')
71 String isMember; 71 String isMember;
72 72
  73 + @JsonKey(name: 'con_amount')
  74 + dynamic conAmount;
  75 +
  76 + @JsonKey(name: 'store_day')
  77 + dynamic storeDay;
  78 +
73 bool select = false; 79 bool select = false;
74 80
75 String pinyin; 81 String pinyin;
@@ -110,7 +116,9 @@ class CustomerBySellerSunModel extends Object with ISuspensionBean { @@ -110,7 +116,9 @@ class CustomerBySellerSunModel extends Object with ISuspensionBean {
110 this.nickName, 116 this.nickName,
111 this.gid, 117 this.gid,
112 this.label, 118 this.label,
113 - this.isMember); 119 + this.isMember,
  120 + this.conAmount,
  121 + this.storeDay);
114 122
115 factory CustomerBySellerSunModel.fromJson(Map<String, dynamic> srcJson) => 123 factory CustomerBySellerSunModel.fromJson(Map<String, dynamic> srcJson) =>
116 _$CustomerBySellerSunModelFromJson(srcJson); 124 _$CustomerBySellerSunModelFromJson(srcJson);
@@ -44,6 +44,8 @@ CustomerBySellerSunModel _$CustomerBySellerSunModelFromJson( @@ -44,6 +44,8 @@ CustomerBySellerSunModel _$CustomerBySellerSunModelFromJson(
44 json['gid'] as String, 44 json['gid'] as String,
45 json['label'] as String, 45 json['label'] as String,
46 json['is_member'] as String, 46 json['is_member'] as String,
  47 + json['con_amount'] as dynamic,
  48 + json['store_day'] as dynamic,
47 ); 49 );
48 } 50 }
49 51
@@ -63,5 +65,7 @@ Map<String, dynamic> _$CustomerBySellerSunModelToJson( @@ -63,5 +65,7 @@ Map<String, dynamic> _$CustomerBySellerSunModelToJson(
63 'nick_name': instance.nickName, 65 'nick_name': instance.nickName,
64 'gid': instance.gid, 66 'gid': instance.gid,
65 'label': instance.label, 67 'label': instance.label,
66 - 'is_member': instance.isMember 68 + 'is_member': instance.isMember,
  69 + 'con_amount': instance.conAmount,
  70 + 'store_day': instance.storeDay,
67 }; 71 };
@@ -89,6 +89,14 @@ class CustomerListSunModel extends Object with ISuspensionBean { @@ -89,6 +89,14 @@ class CustomerListSunModel extends Object with ISuspensionBean {
89 String gid; 89 String gid;
90 @JsonKey(name: 'is_member') 90 @JsonKey(name: 'is_member')
91 String isMember; 91 String isMember;
  92 +
  93 + @JsonKey(name: 'con_amount')
  94 + dynamic conAmount;
  95 +
  96 + @JsonKey(name: 'store_day')
  97 + dynamic storeDay;
  98 +
  99 +
92 100
93 101
94 bool select = false; 102 bool select = false;
@@ -143,7 +151,9 @@ class CustomerListSunModel extends Object with ISuspensionBean { @@ -143,7 +151,9 @@ class CustomerListSunModel extends Object with ISuspensionBean {
143 this.label, 151 this.label,
144 this.nickName, 152 this.nickName,
145 this.gid, 153 this.gid,
146 - this.isMember 154 + this.isMember,
  155 + this.conAmount,
  156 + this.storeDay
147 ); 157 );
148 158
149 factory CustomerListSunModel.fromJson(Map<String, dynamic> srcJson) => 159 factory CustomerListSunModel.fromJson(Map<String, dynamic> srcJson) =>
@@ -51,6 +51,8 @@ CustomerListSunModel _$CustomerListSunModelFromJson(Map<String, dynamic> json) { @@ -51,6 +51,8 @@ CustomerListSunModel _$CustomerListSunModelFromJson(Map<String, dynamic> json) {
51 json['nick_name'] as String, 51 json['nick_name'] as String,
52 json['gid'] as String, 52 json['gid'] as String,
53 json['is_member'] as String, 53 json['is_member'] as String,
  54 + json['con_amount'] as dynamic,
  55 + json['store_day'] as dynamic,
54 ); 56 );
55 } 57 }
56 58
@@ -80,5 +82,7 @@ Map<String, dynamic> _$CustomerListSunModelToJson( @@ -80,5 +82,7 @@ Map<String, dynamic> _$CustomerListSunModelToJson(
80 'label': instance.label, 82 'label': instance.label,
81 'nick_name': instance.nickName, 83 'nick_name': instance.nickName,
82 'gid': instance.gid, 84 'gid': instance.gid,
83 - 'is_member':instance.isMember 85 + 'is_member': instance.isMember,
  86 + 'con_amount': instance.conAmount,
  87 + 'store_day': instance.storeDay
84 }; 88 };
@@ -42,12 +42,11 @@ class GuestInfoSunModel extends Object { @@ -42,12 +42,11 @@ class GuestInfoSunModel extends Object {
42 @JsonKey(name: 'marketing') 42 @JsonKey(name: 'marketing')
43 List<Marketing> marketing; 43 List<Marketing> marketing;
44 44
  45 + @JsonKey(name: 'store')
  46 + Store store;
  47 +
45 GuestInfoSunModel( 48 GuestInfoSunModel(
46 - this.guest,  
47 - this.last,  
48 - this.count,  
49 - this.marketing,  
50 - ); 49 + this.guest, this.last, this.count, this.marketing, this.store);
51 50
52 factory GuestInfoSunModel.fromJson(Map<String, dynamic> srcJson) => 51 factory GuestInfoSunModel.fromJson(Map<String, dynamic> srcJson) =>
53 _$GuestInfoSunModelFromJson(srcJson); 52 _$GuestInfoSunModelFromJson(srcJson);
@@ -204,7 +203,7 @@ class Last extends Object { @@ -204,7 +203,7 @@ class Last extends Object {
204 @JsonKey(name: 'actual_pum') 203 @JsonKey(name: 'actual_pum')
205 String actualPum; 204 String actualPum;
206 @JsonKey(name: 'con_amount') 205 @JsonKey(name: 'con_amount')
207 - String conAmount; 206 + dynamic conAmount;
208 207
209 @JsonKey(name: 'account') 208 @JsonKey(name: 'account')
210 String account; 209 String account;
@@ -283,6 +282,21 @@ class Count extends Object { @@ -283,6 +282,21 @@ class Count extends Object {
283 } 282 }
284 283
285 @JsonSerializable() 284 @JsonSerializable()
  285 +class Store extends Object {
  286 + @JsonKey(name: 'store_day')
  287 + dynamic storeDay;
  288 +
  289 + Store(
  290 + this.storeDay,
  291 + );
  292 +
  293 + factory Store.fromJson(Map<String, dynamic> srcJson) =>
  294 + _$StoreFromJson(srcJson);
  295 +
  296 + Map<String, dynamic> toJson() => _$StoreToJson(this);
  297 +}
  298 +
  299 +@JsonSerializable()
286 class Marketing extends Object { 300 class Marketing extends Object {
287 @JsonKey(name: 'id') 301 @JsonKey(name: 'id')
288 String id; 302 String id;
@@ -38,6 +38,9 @@ GuestInfoSunModel _$GuestInfoSunModelFromJson(Map<String, dynamic> json) { @@ -38,6 +38,9 @@ GuestInfoSunModel _$GuestInfoSunModelFromJson(Map<String, dynamic> json) {
38 ?.map((e) => 38 ?.map((e) =>
39 e == null ? null : Marketing.fromJson(e as Map<String, dynamic>)) 39 e == null ? null : Marketing.fromJson(e as Map<String, dynamic>))
40 ?.toList(), 40 ?.toList(),
  41 + json['store'] == null
  42 + ? null
  43 + : Store.fromJson(json['store'] as Map<String, dynamic>),
41 ); 44 );
42 } 45 }
43 46
@@ -47,6 +50,7 @@ Map<String, dynamic> _$GuestInfoSunModelToJson(GuestInfoSunModel instance) => @@ -47,6 +50,7 @@ Map<String, dynamic> _$GuestInfoSunModelToJson(GuestInfoSunModel instance) =>
47 'last': instance.last, 50 'last': instance.last,
48 'count': instance.count, 51 'count': instance.count,
49 'marketing': instance.marketing, 52 'marketing': instance.marketing,
  53 + 'store': instance.store
50 }; 54 };
51 55
52 Guest _$GuestFromJson(Map<String, dynamic> json) { 56 Guest _$GuestFromJson(Map<String, dynamic> json) {
@@ -122,7 +126,7 @@ Last _$LastFromJson(Map<String, dynamic> json) { @@ -122,7 +126,7 @@ Last _$LastFromJson(Map<String, dynamic> json) {
122 json['seller_user_nick_name'] as String, 126 json['seller_user_nick_name'] as String,
123 json['seller_user_phone'] as String, 127 json['seller_user_phone'] as String,
124 json['actual_pum'] as String, 128 json['actual_pum'] as String,
125 - json['con_amount'] as String, 129 + json['con_amount'] as dynamic,
126 json['account'] as String); 130 json['account'] as String);
127 } 131 }
128 132
@@ -153,6 +157,16 @@ Map<String, dynamic> _$CountToJson(Count instance) => <String, dynamic>{ @@ -153,6 +157,16 @@ Map<String, dynamic> _$CountToJson(Count instance) => <String, dynamic>{
153 'create_time': instance.createTime, 157 'create_time': instance.createTime,
154 }; 158 };
155 159
  160 +Store _$StoreFromJson(Map<String, dynamic> json) {
  161 + return Store(
  162 + json['store_day'] as dynamic,
  163 + );
  164 +}
  165 +
  166 +Map<String, dynamic> _$StoreToJson(Store instance) => <String, dynamic>{
  167 + 'store_day': instance.storeDay,
  168 + };
  169 +
156 Marketing _$MarketingFromJson(Map<String, dynamic> json) { 170 Marketing _$MarketingFromJson(Map<String, dynamic> json) {
157 return Marketing( 171 return Marketing(
158 json['id'] as String, 172 json['id'] as String,
@@ -394,4 +394,10 @@ class HttpUrl { @@ -394,4 +394,10 @@ class HttpUrl {
394 // static const String send_vc_code = 394 // static const String send_vc_code =
395 // "?service=App.SendSMS.SendVcCode"; // 向指定手机号码发送验证码 395 // "?service=App.SendSMS.SendVcCode"; // 向指定手机号码发送验证码
396 396
  397 + static const String get_is_member_by_phone =
  398 + "?service=App.GuestManage.GetIsMemberByPhone"; // 获取手机号是否为商家会员
  399 +
  400 + static const String ins_guest =
  401 + "?service=App.GuestManage.InsGuest"; // 新增客户
  402 +
397 } 403 }
@@ -164,10 +164,10 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -164,10 +164,10 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
164 164
165 Navigator.of(context).pop(); 165 Navigator.of(context).pop();
166 }, 166 },
167 - rightImgName: 'scan.png',  
168 - onTapRight: () {  
169 - _scan();  
170 - }, 167 + // rightImgName: 'scan.png',
  168 + // onTapRight: () {
  169 + // _scan();
  170 + // },
171 ), 171 ),
172 body: WillPopScope( 172 body: WillPopScope(
173 onWillPop: () { 173 onWillPop: () {
@@ -43,6 +43,7 @@ import 'dart:ui' as ui; @@ -43,6 +43,7 @@ import 'dart:ui' as ui;
43 43
44 import '../../app.dart'; 44 import '../../app.dart';
45 45
  46 +import '../../provider/customer_provider.dart';
46 import '../../widgets/special_text/my_extended_text_selection_controls.dart'; 47 import '../../widgets/special_text/my_extended_text_selection_controls.dart';
47 48
48 class InvicationPage extends StatefulWidget { 49 class InvicationPage extends StatefulWidget {
@@ -143,7 +144,8 @@ class InvicationPageState extends State<InvicationPage> @@ -143,7 +144,8 @@ class InvicationPageState extends State<InvicationPage>
143 bool _showOverlay = false; 144 bool _showOverlay = false;
144 145
145 List<String> memberList = []; 146 List<String> memberList = [];
146 - String memberShow = '会员状态未知'; 147 + String isMember = '会员状态未知';
  148 + String memberid;
147 int memberIndex; 149 int memberIndex;
148 150
149 List<String> styleList = []; //餐单类型 151 List<String> styleList = []; //餐单类型
@@ -260,6 +262,7 @@ class InvicationPageState extends State<InvicationPage> @@ -260,6 +262,7 @@ class InvicationPageState extends State<InvicationPage>
260 await _getCustomerActivityBaseinfo(); 262 await _getCustomerActivityBaseinfo();
261 263
262 await _getReserveDetail(showCicle: false); 264 await _getReserveDetail(showCicle: false);
  265 +
263 await _getTablesPhoto(); 266 await _getTablesPhoto();
264 Map<String, String> params = { 267 Map<String, String> params = {
265 "uid": Provider.of<UserModel>(context, listen: false).user.openid 268 "uid": Provider.of<UserModel>(context, listen: false).user.openid
@@ -336,6 +339,34 @@ class InvicationPageState extends State<InvicationPage> @@ -336,6 +339,34 @@ class InvicationPageState extends State<InvicationPage>
336 _timer = Timer.periodic(Duration(seconds: 1), call); 339 _timer = Timer.periodic(Duration(seconds: 1), call);
337 } 340 }
338 341
  342 + ///获取手机号是否为商家会员
  343 + _getIsMemberByPhone(String phone) async {
  344 + CustomerProvider customerProvider =
  345 + Provider.of<CustomerProvider>(context, listen: false);
  346 + Map<String, String> params = {
  347 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  348 + 'phone': phone
  349 + };
  350 + Map temp = await customerProvider.getIsMemberByPhone(context, params);
  351 + if (temp == null) {
  352 + //会员状态未知
  353 + isMember = '会员状态未知';
  354 + memberIndex = null;
  355 + memberid = null;
  356 + } else if (temp['is_member'] == '1') {
  357 + //会员
  358 + isMember = '会员';
  359 + memberIndex = 0;
  360 + memberid = temp['id'];
  361 + } else {
  362 + //非会员
  363 + isMember = '非会员';
  364 + memberIndex = 1;
  365 + memberid = temp['id'];
  366 + }
  367 + setState(() {});
  368 + }
  369 +
339 _showConfirmWidget( 370 _showConfirmWidget(
340 {needBack = false, 371 {needBack = false,
341 needSex = false, 372 needSex = false,
@@ -893,6 +924,11 @@ class InvicationPageState extends State<InvicationPage> @@ -893,6 +924,11 @@ class InvicationPageState extends State<InvicationPage>
893 ddateStr = detailEntity.ddateStr; 924 ddateStr = detailEntity.ddateStr;
894 reserverPhone = detailEntity.phone; 925 reserverPhone = detailEntity.phone;
895 _baseIndoProvider.phoneController.text = reserverPhone.replaceAll(' ', ''); 926 _baseIndoProvider.phoneController.text = reserverPhone.replaceAll(' ', '');
  927 +
  928 + if (_baseIndoProvider.phoneController.text.length > 0) {
  929 + //获取是否是会员
  930 + _getIsMemberByPhone(_baseIndoProvider.phoneController.text);
  931 + }
896 dateSolt = detailEntity.ddate_solt; 932 dateSolt = detailEntity.ddate_solt;
897 nameWidget = detailEntity.rname == null || 933 nameWidget = detailEntity.rname == null ||
898 detailEntity.rname == '' || 934 detailEntity.rname == '' ||
@@ -1806,6 +1842,7 @@ class InvicationPageState extends State<InvicationPage> @@ -1806,6 +1842,7 @@ class InvicationPageState extends State<InvicationPage>
1806 .sellerid, 1842 .sellerid,
1807 }; 1843 };
1808 _baseIndoProvider.getUserHistorys(context, params); 1844 _baseIndoProvider.getUserHistorys(context, params);
  1845 + _getIsMemberByPhone(value);
1809 }, 1846 },
1810 onEditingComplete: () { 1847 onEditingComplete: () {
1811 _phoneNode.unfocus(); 1848 _phoneNode.unfocus();
@@ -1939,6 +1976,13 @@ class InvicationPageState extends State<InvicationPage> @@ -1939,6 +1976,13 @@ class InvicationPageState extends State<InvicationPage>
1939 HEmptyView(40), 1976 HEmptyView(40),
1940 InkWell( 1977 InkWell(
1941 onTap: () { 1978 onTap: () {
  1979 + if (_baseIndoProvider.phoneController.text
  1980 + .trim()
  1981 + .length ==
  1982 + 0) {
  1983 + Utils.showToast('请先输入电话,再设置会员信息!');
  1984 + return;
  1985 + }
1942 FocusScope.of(context) 1986 FocusScope.of(context)
1943 .requestFocus(FocusNode()); //隐藏键盘 1987 .requestFocus(FocusNode()); //隐藏键盘
1944 1988
@@ -1946,18 +1990,76 @@ class InvicationPageState extends State<InvicationPage> @@ -1946,18 +1990,76 @@ class InvicationPageState extends State<InvicationPage>
1946 context, memberList, (value) async { 1990 context, memberList, (value) async {
1947 if (value != null) { 1991 if (value != null) {
1948 memberIndex = value.first; 1992 memberIndex = value.first;
1949 - memberShow = memberList[memberIndex]; 1993 + isMember = memberList[memberIndex];
1950 1994
1951 setState(() {}); 1995 setState(() {});
  1996 + CustomerProvider customerProvider =
  1997 + Provider.of<CustomerProvider>(context,
  1998 + listen: false);
  1999 + if (memberid != null &&
  2000 + memberIndex != null) {
  2001 + Map<String, String> pramas = {
  2002 + 'id': memberid,
  2003 + 'is_member':
  2004 + memberIndex == 0 ? '1' : '0'
  2005 + };
  2006 +
  2007 + if (nameStr != null &&
  2008 + nameStr.trim().length > 0) {
  2009 + pramas['rname'] = nameStr;
  2010 + pramas['sex'] =
  2011 + '${sexList.indexOf(sexStr) + 1}';
  2012 + }
  2013 + if (_baseIndoProvider.phoneController.text
  2014 + .replaceAll(' ', '')
  2015 + .length >
  2016 + 0) {
  2017 + pramas['phone'] = _baseIndoProvider
  2018 + .phoneController.text
  2019 + .replaceAll(' ', '');
  2020 + }
  2021 +
  2022 + await customerProvider.setGuestInfo(
  2023 + context, pramas);
  2024 + } else {
  2025 + Map<String, String> pramas = {
  2026 + 'sellerid': Provider.of<UserModel>(
  2027 + context,
  2028 + listen: false)
  2029 + .user
  2030 + .sellerid,
  2031 + 'uid': Provider.of<UserModel>(context,
  2032 + listen: false)
  2033 + .user
  2034 + .openid,
  2035 + 'phone': _baseIndoProvider
  2036 + .phoneController.text
  2037 + .replaceAll(' ', '')
  2038 + };
  2039 + if (memberIndex != null) {
  2040 + pramas['is_member'] =
  2041 + memberIndex == 0 ? '1' : '0';
  2042 + }
  2043 +
  2044 + if (nameStr != null &&
  2045 + nameStr.trim().length > 0) {
  2046 + pramas['rname'] = nameStr;
  2047 + pramas['sex'] =
  2048 + '${sexList.indexOf(sexStr) + 1}';
  2049 + }
  2050 +
  2051 + await customerProvider.setInsGuest(
  2052 + context, pramas);
  2053 + }
1952 } 2054 }
1953 }, selecteds: [memberIndex ?? 0]) 2055 }, selecteds: [memberIndex ?? 0])
1954 .then((value) {}); 2056 .then((value) {});
1955 }, 2057 },
1956 child: Row(children: [ 2058 child: Row(children: [
1957 Text( 2059 Text(
1958 - memberShow, 2060 + isMember,
1959 style: TextStyle( 2061 style: TextStyle(
1960 - color: memberShow == '会员状态未知' 2062 + color: isMember == '会员状态未知'
1961 ? MyColours.color_999999 2063 ? MyColours.color_999999
1962 : MyColours.color_515151, 2064 : MyColours.color_515151,
1963 fontSize: ScreenUtil().setSp(28), 2065 fontSize: ScreenUtil().setSp(28),
@@ -1972,65 +2074,65 @@ class InvicationPageState extends State<InvicationPage> @@ -1972,65 +2074,65 @@ class InvicationPageState extends State<InvicationPage>
1972 )) 2074 ))
1973 : SizedBox(), 2075 : SizedBox(),
1974 //餐单类型 2076 //餐单类型
1975 - enterMore  
1976 - ? Container(  
1977 - margin: EdgeInsets.only(  
1978 - // top: ScreenUtil().setWidth(40),  
1979 - bottom: ScreenUtil().setWidth(40)),  
1980 - height: ScreenUtil().setWidth(68),  
1981 - padding: EdgeInsets.symmetric(  
1982 - horizontal: ScreenUtil().setWidth(16)),  
1983 - decoration: BoxDecoration(  
1984 - borderRadius: BorderRadius.circular(  
1985 - ScreenUtil().setWidth(12)),  
1986 - // color: Colors.red,  
1987 - border: Border.all(  
1988 - width: ScreenUtil().setWidth(2),  
1989 - color: MyColours.color_DBDBDB)),  
1990 - child: Row(  
1991 - mainAxisAlignment: MainAxisAlignment.spaceBetween,  
1992 - crossAxisAlignment: CrossAxisAlignment.center,  
1993 - children: [  
1994 - Text(  
1995 - '餐单类型',  
1996 -  
1997 - //输入文本的样式  
1998 - style: TextStyle(  
1999 - fontSize: ScreenUtil().setSp(28),  
2000 - color: MyColours.color_353535),  
2001 - ),  
2002 - InkWell(  
2003 - onTap: () {  
2004 - FocusScope.of(context)  
2005 - .requestFocus(FocusNode()); //隐藏键盘  
2006 -  
2007 - DialogUtil.showSelectCusmanDialog(  
2008 - context, styleList, (value) async {  
2009 - if (value != null) {  
2010 - styleIndex = value.first;  
2011 - styleShow = styleList[styleIndex];  
2012 -  
2013 - setState(() {});  
2014 - }  
2015 - }, selecteds: [styleIndex ?? 0])  
2016 - .then((value) {});  
2017 - },  
2018 - child: Row(children: [  
2019 - Text(  
2020 - styleShow,  
2021 - style: TextStyle(  
2022 - color: MyColours.color_515151,  
2023 - fontSize: ScreenUtil().setSp(28),  
2024 - ),  
2025 - ),  
2026 - Image.asset(Utils.getImgPath('quan_down_f'),  
2027 - width: ScreenUtil().setWidth(28),  
2028 - height: ScreenUtil().setWidth(28)),  
2029 - ]),  
2030 - )  
2031 - ],  
2032 - ))  
2033 - : SizedBox(), 2077 + // enterMore
  2078 + // ? Container(
  2079 + // margin: EdgeInsets.only(
  2080 + // // top: ScreenUtil().setWidth(40),
  2081 + // bottom: ScreenUtil().setWidth(40)),
  2082 + // height: ScreenUtil().setWidth(68),
  2083 + // padding: EdgeInsets.symmetric(
  2084 + // horizontal: ScreenUtil().setWidth(16)),
  2085 + // decoration: BoxDecoration(
  2086 + // borderRadius: BorderRadius.circular(
  2087 + // ScreenUtil().setWidth(12)),
  2088 + // // color: Colors.red,
  2089 + // border: Border.all(
  2090 + // width: ScreenUtil().setWidth(2),
  2091 + // color: MyColours.color_DBDBDB)),
  2092 + // child: Row(
  2093 + // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2094 + // crossAxisAlignment: CrossAxisAlignment.center,
  2095 + // children: [
  2096 + // Text(
  2097 + // '餐单类型',
  2098 +
  2099 + // //输入文本的样式
  2100 + // style: TextStyle(
  2101 + // fontSize: ScreenUtil().setSp(28),
  2102 + // color: MyColours.color_353535),
  2103 + // ),
  2104 + // InkWell(
  2105 + // onTap: () {
  2106 + // FocusScope.of(context)
  2107 + // .requestFocus(FocusNode()); //隐藏键盘
  2108 +
  2109 + // DialogUtil.showSelectCusmanDialog(
  2110 + // context, styleList, (value) async {
  2111 + // if (value != null) {
  2112 + // styleIndex = value.first;
  2113 + // styleShow = styleList[styleIndex];
  2114 +
  2115 + // setState(() {});
  2116 + // }
  2117 + // }, selecteds: [styleIndex ?? 0])
  2118 + // .then((value) {});
  2119 + // },
  2120 + // child: Row(children: [
  2121 + // Text(
  2122 + // styleShow,
  2123 + // style: TextStyle(
  2124 + // color: MyColours.color_515151,
  2125 + // fontSize: ScreenUtil().setSp(28),
  2126 + // ),
  2127 + // ),
  2128 + // Image.asset(Utils.getImgPath('quan_down_f'),
  2129 + // width: ScreenUtil().setWidth(28),
  2130 + // height: ScreenUtil().setWidth(28)),
  2131 + // ]),
  2132 + // )
  2133 + // ],
  2134 + // ))
  2135 + // : SizedBox(),
2034 2136
2035 //备注: 2137 //备注:
2036 Column( 2138 Column(
@@ -2205,6 +2307,8 @@ class InvicationPageState extends State<InvicationPage> @@ -2205,6 +2307,8 @@ class InvicationPageState extends State<InvicationPage>
2205 itemBuilder: (context, index) { 2307 itemBuilder: (context, index) {
2206 return GestureDetector( 2308 return GestureDetector(
2207 onTap: () { 2309 onTap: () {
  2310 + _getIsMemberByPhone(_baseIndoProvider
  2311 + .userHistorys[index].phone);
2208 needHistory = true; 2312 needHistory = true;
2209 _showConfirmWidget( 2313 _showConfirmWidget(
2210 needHistory: true, index: index); 2314 needHistory: true, index: index);
@@ -3193,6 +3297,7 @@ class InvicationPageState extends State<InvicationPage> @@ -3193,6 +3297,7 @@ class InvicationPageState extends State<InvicationPage>
3193 }; 3297 };
3194 _baseIndoProvider.getUserHistorys( 3298 _baseIndoProvider.getUserHistorys(
3195 context, params); 3299 context, params);
  3300 + _getIsMemberByPhone(value);
3196 }, 3301 },
3197 onEditingComplete: () { 3302 onEditingComplete: () {
3198 _phoneNode.unfocus(); 3303 _phoneNode.unfocus();
@@ -3566,6 +3671,7 @@ class InvicationPageState extends State<InvicationPage> @@ -3566,6 +3671,7 @@ class InvicationPageState extends State<InvicationPage>
3566 _addNameSuffix(fullName, sexStr); 3671 _addNameSuffix(fullName, sexStr);
3567 }); 3672 });
3568 _updateReserve(); 3673 _updateReserve();
  3674 + _getIsMemberByPhone(_baseIndoProvider.phoneController.text);
3569 // }); 3675 // });
3570 } 3676 }
3571 3677
@@ -173,7 +173,7 @@ @@ -173,7 +173,7 @@
173 // ///获取微信登录access_token 173 // ///获取微信登录access_token
174 // _getAccessToken(String code) async { 174 // _getAccessToken(String code) async {
175 // Response response = await DioUtil.getInstance().getDio().get( 175 // Response response = await DioUtil.getInstance().getDio().get(
176 -// "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx85aa3cdd0f791e65&secret=87c9a23c2e6032b2da75af6b0efc5424&code=$code&grant_type=authorization_code"); 176 +// "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx85aa3cdd0f791e65&secret=90ba794b30d2fe388309149174874603&code=$code&grant_type=authorization_code");
177 // LogUtil.v("access_token:${response.toString()}"); 177 // LogUtil.v("access_token:${response.toString()}");
178 // Map<String, dynamic> responseData = json.decode(response.data.toString()); 178 // Map<String, dynamic> responseData = json.decode(response.data.toString());
179 // if (responseData["errcode"] != null) { 179 // if (responseData["errcode"] != null) {
@@ -80,8 +80,7 @@ class _MyContactListPageState extends State<MyContactListPage> { @@ -80,8 +80,7 @@ class _MyContactListPageState extends State<MyContactListPage> {
80 horizontal: ScreenUtil().setWidth(30), 80 horizontal: ScreenUtil().setWidth(30),
81 vertical: ScreenUtil().setWidth(10)), 81 vertical: ScreenUtil().setWidth(10)),
82 // height: susItemHeight, 82 // height: susItemHeight,
83 - margin: EdgeInsets.only(  
84 - bottom: ScreenUtil().setWidth(10)), 83 + margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)),
85 width: ScreenUtil().screenWidth, 84 width: ScreenUtil().screenWidth,
86 color: MyColours.color_efefef, 85 color: MyColours.color_efefef,
87 alignment: Alignment.centerLeft, 86 alignment: Alignment.centerLeft,
@@ -435,35 +434,40 @@ class _MyContactListPageState extends State<MyContactListPage> { @@ -435,35 +434,40 @@ class _MyContactListPageState extends State<MyContactListPage> {
435 ), 434 ),
436 child: Row( 435 child: Row(
437 children: [ 436 children: [
438 - model.rnameStr != null && model.rnameStr != ''  
439 - ? Row(  
440 - // crossAxisAlignment: CrossAxisAlignment.end,  
441 - children: [  
442 - Container(  
443 - width: w(72),  
444 - child: Text(  
445 - model.rnameStr,  
446 - overflow: TextOverflow.ellipsis,  
447 - style: TextStyle(  
448 - color: MyColours.color_515151,  
449 - fontSize: ScreenUtil().setSp(36),  
450 - fontWeight: FontWeight.bold),  
451 - )),  
452 - HEmptyView(10),  
453 - Text(  
454 - model.sexStr != '' && model.sexStr != null  
455 - ? '${model.sexStr}'  
456 - : '',  
457 - style: TextStyle( 437 + Row(
  438 + // crossAxisAlignment: CrossAxisAlignment.end,
  439 + children: [
  440 + Container(
  441 + width: w(72),
  442 + child: Text(
  443 + model.rnameStr != null && model.rnameStr != ''
  444 + ? model.rnameStr
  445 + : '',
  446 + overflow: TextOverflow.ellipsis,
  447 + style: TextStyle(
458 color: MyColours.color_515151, 448 color: MyColours.color_515151,
459 - fontWeight: FontWeight.bold,  
460 - fontSize: ScreenUtil().setSp(20),  
461 - ), 449 + fontSize: ScreenUtil().setSp(36),
  450 + fontWeight: FontWeight.bold),
  451 + )),
  452 + HEmptyView(10),
  453 + Container(
  454 + width: w(26),
  455 + child: Text(
  456 + model.rnameStr != null &&
  457 + model.rnameStr != '' &&
  458 + model.sexStr != '' &&
  459 + model.sexStr != null
  460 + ? '${model.sexStr}'
  461 + : '',
  462 + style: TextStyle(
  463 + color: MyColours.color_515151,
  464 + fontWeight: FontWeight.bold,
  465 + fontSize: ScreenUtil().setSp(20),
462 ), 466 ),
463 - HEmptyView(10),  
464 - ],  
465 - )  
466 - : SizedBox(), 467 + )),
  468 + HEmptyView(10),
  469 + ],
  470 + ),
467 Spacer(), 471 Spacer(),
468 Container( 472 Container(
469 width: w(70), 473 width: w(70),
@@ -527,11 +531,12 @@ class _MyContactListPageState extends State<MyContactListPage> { @@ -527,11 +531,12 @@ class _MyContactListPageState extends State<MyContactListPage> {
527 model.label != null 531 model.label != null
528 ? flatBtn(model.label, MyColours.color_B39437) 532 ? flatBtn(model.label, MyColours.color_B39437)
529 : SizedBox(), 533 : SizedBox(),
530 - model.isMember == '1'  
531 - ? flatBtn('会员', MyColours.color_438E93)  
532 - : SizedBox(),  
533 - true  
534 - ? flatBtn('存酒14天', MyColours.color_438E93) 534 + if (model.isMember == '1' || model.isMember == '0')
  535 + flatBtn(model.isMember == '1' ? '会员' : '非会员',
  536 + MyColours.color_438E93),
  537 + '${model.storeDay}' != '0'
  538 + ? flatBtn('存酒${model.storeDay}天',
  539 + MyColours.color_438E93)
535 : SizedBox() 540 : SizedBox()
536 ], 541 ],
537 )), 542 )),
@@ -555,6 +560,19 @@ class _MyContactListPageState extends State<MyContactListPage> { @@ -555,6 +560,19 @@ class _MyContactListPageState extends State<MyContactListPage> {
555 fontSize: ScreenUtil().setSp(20), 560 fontSize: ScreenUtil().setSp(20),
556 ), 561 ),
557 ), 562 ),
  563 + if (model.conAmount != null &&
  564 + '${model.conAmount}' != '0')
  565 + HEmptyView(10),
  566 + if (model.conAmount != null &&
  567 + '${model.conAmount}' != '0')
  568 + Text(
  569 + '消费${model.conAmount}',
  570 + style: TextStyle(
  571 + color: MyColours.color_515151,
  572 + fontSize: ScreenUtil().setSp(20),
  573 + ),
  574 + ),
  575 + Spacer(),
558 model.monthCount == '0' || model.monthCount == null 576 model.monthCount == '0' || model.monthCount == null
559 ? SizedBox() 577 ? SizedBox()
560 : HEmptyView(10), 578 : HEmptyView(10),
@@ -575,6 +593,7 @@ class _MyContactListPageState extends State<MyContactListPage> { @@ -575,6 +593,7 @@ class _MyContactListPageState extends State<MyContactListPage> {
575 fontSize: ScreenUtil().setSp(20), 593 fontSize: ScreenUtil().setSp(20),
576 ), 594 ),
577 ), 595 ),
  596 + HEmptyView(140),
578 ], 597 ],
579 )) 598 ))
580 ], 599 ],
@@ -54,6 +54,17 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { @@ -54,6 +54,17 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> {
54 void initState() { 54 void initState() {
55 super.initState(); 55 super.initState();
56 memberList = ['是', '否']; 56 memberList = ['是', '否'];
  57 + memberShow = widget.guest.isMember == '1'
  58 + ? '是'
  59 + : widget.guest.isMember == '0'
  60 + ? '否'
  61 + : '会员状态未知';
  62 +
  63 + memberIndex = memberShow == '是'
  64 + ? 0
  65 + : memberShow == '否'
  66 + ? 1
  67 + : null;
57 _initSexList(); 68 _initSexList();
58 nameFocus.addListener(() { 69 nameFocus.addListener(() {
59 if (nameFocus.hasFocus) { 70 if (nameFocus.hasFocus) {
@@ -155,6 +166,9 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { @@ -155,6 +166,9 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> {
155 if (fwController.text.trim().length > 0) { 166 if (fwController.text.trim().length > 0) {
156 params['serve'] = fwController.text; 167 params['serve'] = fwController.text;
157 } 168 }
  169 + if (memberShow != '会员状态未知') {
  170 + params['is_member'] = memberShow == '是' ? '1' : '0';
  171 + }
158 bool sucess = 172 bool sucess =
159 await customerProvider.setGuestInfo(context, params, showLoading: true); 173 await customerProvider.setGuestInfo(context, params, showLoading: true);
160 if (sucess) { 174 if (sucess) {
@@ -196,7 +210,7 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { @@ -196,7 +210,7 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> {
196 if (name == nameController.text && nameController.text.endsWith(suffix)) { 210 if (name == nameController.text && nameController.text.endsWith(suffix)) {
197 return; 211 return;
198 } 212 }
199 - nameController.text = name + suffix ?? ""; 213 + nameController.text = name.trim() == '' || name == null ? '' : name + suffix ?? "";
200 } 214 }
201 215
202 //姓名后缀 216 //姓名后缀
@@ -292,30 +292,33 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { @@ -292,30 +292,33 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> {
292 Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ 292 Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
293 Row( 293 Row(
294 children: [ 294 children: [
295 - Container(  
296 - constraints: BoxConstraints(  
297 - maxWidth: ScreenUtil().setWidth(260)),  
298 - child: Text(  
299 - customerProvider.guestInfoSunModel.guest.rnameStr,  
300 - overflow: TextOverflow.ellipsis,  
301 - style: TextStyle(  
302 - color: MyColours.color_515151,  
303 - fontWeight: FontWeight.bold,  
304 - fontSize: ScreenUtil().setSp(36)),  
305 - )),  
306 - HEmptyView(10),  
307 - Container(  
308 - child: Text(  
309 - customerProvider.guestInfoSunModel.guest.sexStr != ''  
310 - ? '${customerProvider.guestInfoSunModel.guest.sexStr}'  
311 - : '',  
312 - style: TextStyle(  
313 - color: MyColours.color_515151,  
314 - fontWeight: FontWeight.bold,  
315 - fontSize: ScreenUtil().setSp(20),  
316 - ),  
317 - )),  
318 - HEmptyView(6), 295 + if (customerProvider.guestInfoSunModel.guest.rnameStr != '')
  296 + Container(
  297 + constraints: BoxConstraints(
  298 + maxWidth: ScreenUtil().setWidth(260)),
  299 + child: Text(
  300 + customerProvider.guestInfoSunModel.guest.rnameStr,
  301 + overflow: TextOverflow.ellipsis,
  302 + style: TextStyle(
  303 + color: MyColours.color_515151,
  304 + fontWeight: FontWeight.bold,
  305 + fontSize: ScreenUtil().setSp(36)),
  306 + )),
  307 + if (customerProvider.guestInfoSunModel.guest.rnameStr != '')
  308 + HEmptyView(10),
  309 + if (customerProvider.guestInfoSunModel.guest.rnameStr != '')
  310 + Container(
  311 + child: Text(
  312 + customerProvider.guestInfoSunModel.guest.sexStr != ''
  313 + ? '${customerProvider.guestInfoSunModel.guest.sexStr}'
  314 + : '',
  315 + style: TextStyle(
  316 + color: MyColours.color_515151,
  317 + fontWeight: FontWeight.bold,
  318 + fontSize: ScreenUtil().setSp(20),
  319 + ),
  320 + )),
  321 + if (customerProvider.guestInfoSunModel.guest.rnameStr != '') HEmptyView(6),
319 Text( 322 Text(
320 customerProvider.guestInfoSunModel.guest.phone, 323 customerProvider.guestInfoSunModel.guest.phone,
321 overflow: TextOverflow.ellipsis, 324 overflow: TextOverflow.ellipsis,
@@ -375,9 +378,20 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { @@ -375,9 +378,20 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> {
375 flatBtn(customerProvider.guestInfoSunModel.guest.label, 378 flatBtn(customerProvider.guestInfoSunModel.guest.label,
376 MyColours.color_B39437), 379 MyColours.color_B39437),
377 if (customerProvider.guestInfoSunModel.guest.isMember == 380 if (customerProvider.guestInfoSunModel.guest.isMember ==
378 - '1')  
379 - flatBtn('会员', MyColours.color_438E93),  
380 - if (true) flatBtn('存酒14天', MyColours.color_438E93) 381 + '1' ||
  382 + customerProvider.guestInfoSunModel.guest.isMember ==
  383 + '0')
  384 + flatBtn(
  385 + customerProvider.guestInfoSunModel.guest.isMember ==
  386 + '1'
  387 + ? '会员'
  388 + : '非会员',
  389 + MyColours.color_438E93),
  390 + if ('${customerProvider.guestInfoSunModel.store.storeDay}' !=
  391 + '0')
  392 + flatBtn(
  393 + '存酒${customerProvider.guestInfoSunModel.store.storeDay}天',
  394 + MyColours.color_438E93)
381 ], 395 ],
382 ), 396 ),
383 VEmptyView(20), 397 VEmptyView(20),
@@ -499,9 +513,13 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { @@ -499,9 +513,13 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> {
499 color: MyColours.color_515151), 513 color: MyColours.color_515151),
500 ), 514 ),
501 Text( 515 Text(
502 - customerProvider.guestInfoSunModel.last.conAmount == null 516 + customerProvider.guestInfoSunModel.last.conAmount ==
  517 + null ||
  518 + customerProvider
  519 + .guestInfoSunModel.last.conAmount ==
  520 + 0
503 ? '未记录' 521 ? '未记录'
504 - : customerProvider.guestInfoSunModel.last.conAmount, 522 + : '${customerProvider.guestInfoSunModel.last.conAmount}',
505 style: TextStyle( 523 style: TextStyle(
506 fontSize: ScreenUtil().setSp(20), 524 fontSize: ScreenUtil().setSp(20),
507 color: MyColours.color_438E93), 525 color: MyColours.color_438E93),
1 -  
2 -  
3 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
4 2
5 import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -171,7 +169,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -171,7 +169,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
171 if (customerProvider.controller.text.trim().length > 0) { 169 if (customerProvider.controller.text.trim().length > 0) {
172 params['keyword'] = customerProvider.controller.text; //搜索手机号/姓名 170 params['keyword'] = customerProvider.controller.text; //搜索手机号/姓名
173 } 171 }
174 - String labels = ''; 172 + String labels = '';
175 for (FilterBtnModel item in customerProvider.filterLabelList) { 173 for (FilterBtnModel item in customerProvider.filterLabelList) {
176 if (item.select) { 174 if (item.select) {
177 if (item.title == '未标记客户') { 175 if (item.title == '未标记客户') {
@@ -337,7 +335,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -337,7 +335,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
337 BorderRadius.circular(ScreenUtil().setWidth(40)), 335 BorderRadius.circular(ScreenUtil().setWidth(40)),
338 color: MyColours.color_199095), 336 color: MyColours.color_199095),
339 child: Text( 337 child: Text(
340 - '已选[${customerProvider.labels}]${customerProvider.selectCustomer.length}位顾客,下发营销任务', 338 + // '已选[${customerProvider.labels}]${customerProvider.selectCustomer.length}位顾客,下发营销任务',
  339 + '已选${customerProvider.selectCustomer.length}位顾客,创建营销计划',
341 overflow: TextOverflow.ellipsis, 340 overflow: TextOverflow.ellipsis,
342 maxLines: 1, 341 maxLines: 1,
343 style: TextStyle( 342 style: TextStyle(
@@ -1531,4 +1530,3 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -1531,4 +1530,3 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
1531 ))); 1530 )));
1532 } 1531 }
1533 } 1532 }
1534 -  
@@ -419,35 +419,40 @@ class _ContactListPageState extends State<ContactListPage> { @@ -419,35 +419,40 @@ class _ContactListPageState extends State<ContactListPage> {
419 ), 419 ),
420 child: Row( 420 child: Row(
421 children: [ 421 children: [
422 - model.rnameStr != null && model.rnameStr != ''  
423 - ? Row(  
424 - // crossAxisAlignment: CrossAxisAlignment.end,  
425 - children: [  
426 - Container(  
427 - width: w(72),  
428 - child: Text(  
429 - model.rnameStr,  
430 - overflow: TextOverflow.ellipsis,  
431 - style: TextStyle(  
432 - color: MyColours.color_515151,  
433 - fontSize: ScreenUtil().setSp(36),  
434 - fontWeight: FontWeight.bold),  
435 - )),  
436 - HEmptyView(10),  
437 - Text(  
438 - model.sexStr != '' && model.sexStr != null  
439 - ? '${model.sexStr}'  
440 - : '',  
441 - style: TextStyle( 422 + Row(
  423 + // crossAxisAlignment: CrossAxisAlignment.end,
  424 + children: [
  425 + Container(
  426 + width: w(72),
  427 + child: Text(
  428 + model.rnameStr != null && model.rnameStr != ''
  429 + ? model.rnameStr
  430 + : '',
  431 + overflow: TextOverflow.ellipsis,
  432 + style: TextStyle(
442 color: MyColours.color_515151, 433 color: MyColours.color_515151,
443 - fontWeight: FontWeight.bold,  
444 - fontSize: ScreenUtil().setSp(20),  
445 - ), 434 + fontSize: ScreenUtil().setSp(36),
  435 + fontWeight: FontWeight.bold),
  436 + )),
  437 + HEmptyView(10),
  438 + Container(
  439 + width: w(26),
  440 + child: Text(
  441 + model.rnameStr != null &&
  442 + model.rnameStr != '' &&
  443 + model.sexStr != '' &&
  444 + model.sexStr != null
  445 + ? '${model.sexStr}'
  446 + : '',
  447 + style: TextStyle(
  448 + color: MyColours.color_515151,
  449 + fontWeight: FontWeight.bold,
  450 + fontSize: ScreenUtil().setSp(20),
446 ), 451 ),
447 - HEmptyView(10),  
448 - ],  
449 - )  
450 - : SizedBox(), 452 + )),
  453 + HEmptyView(10),
  454 + ],
  455 + ),
451 HEmptyView(74), 456 HEmptyView(74),
452 Container( 457 Container(
453 width: w(70), 458 width: w(70),
@@ -487,7 +492,7 @@ class _ContactListPageState extends State<ContactListPage> { @@ -487,7 +492,7 @@ class _ContactListPageState extends State<ContactListPage> {
487 // ), 492 // ),
488 decoration: BoxDecoration( 493 decoration: BoxDecoration(
489 color: model.attr != null && model.attr != '' 494 color: model.attr != null && model.attr != ''
490 - ?model.attr == '沉睡' 495 + ? model.attr == '沉睡'
491 ? MyColours.color_999999 496 ? MyColours.color_999999
492 : model.attr == '活跃' 497 : model.attr == '活跃'
493 ? MyColours.color_00715F 498 ? MyColours.color_00715F
@@ -512,9 +517,12 @@ class _ContactListPageState extends State<ContactListPage> { @@ -512,9 +517,12 @@ class _ContactListPageState extends State<ContactListPage> {
512 : SizedBox(), 517 : SizedBox(),
513 model.isMember == '1' 518 model.isMember == '1'
514 ? flatBtn('会员', MyColours.color_438E93) 519 ? flatBtn('会员', MyColours.color_438E93)
515 - : SizedBox(),  
516 - true  
517 - ? flatBtn('存酒14天', MyColours.color_438E93) 520 + : model.isMember == '0'
  521 + ? flatBtn('非会员', MyColours.color_438E93)
  522 + : SizedBox(),
  523 + '${model.storeDay}' != '0'
  524 + ? flatBtn('存酒${model.storeDay}天',
  525 + MyColours.color_438E93)
518 : SizedBox() 526 : SizedBox()
519 ], 527 ],
520 )), 528 )),
@@ -538,6 +546,19 @@ class _ContactListPageState extends State<ContactListPage> { @@ -538,6 +546,19 @@ class _ContactListPageState extends State<ContactListPage> {
538 fontSize: ScreenUtil().setSp(20), 546 fontSize: ScreenUtil().setSp(20),
539 ), 547 ),
540 ), 548 ),
  549 + if (model.conAmount != null &&
  550 + '${model.conAmount}' != '0')
  551 + HEmptyView(10),
  552 + if (model.conAmount != null &&
  553 + '${model.conAmount}' != '0')
  554 + Text(
  555 + '消费${model.conAmount}',
  556 + style: TextStyle(
  557 + color: MyColours.color_515151,
  558 + fontSize: ScreenUtil().setSp(20),
  559 + ),
  560 + ),
  561 + Spacer(),
541 model.monthCount == '0' || model.monthCount == null 562 model.monthCount == '0' || model.monthCount == null
542 ? SizedBox() 563 ? SizedBox()
543 : HEmptyView(10), 564 : HEmptyView(10),
@@ -558,6 +579,7 @@ class _ContactListPageState extends State<ContactListPage> { @@ -558,6 +579,7 @@ class _ContactListPageState extends State<ContactListPage> {
558 fontSize: ScreenUtil().setSp(20), 579 fontSize: ScreenUtil().setSp(20),
559 ), 580 ),
560 ), 581 ),
  582 + HEmptyView(140),
561 ], 583 ],
562 )) 584 ))
563 ], 585 ],
@@ -56,6 +56,17 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { @@ -56,6 +56,17 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> {
56 void initState() { 56 void initState() {
57 super.initState(); 57 super.initState();
58 memberList = ['是', '否']; 58 memberList = ['是', '否'];
  59 + memberShow = widget.guest.isMember == '1'
  60 + ? '是'
  61 + : widget.guest.isMember == '0'
  62 + ? '否'
  63 + : '会员状态未知';
  64 +
  65 + memberIndex = memberShow == '是'
  66 + ? 0
  67 + : memberShow == '否'
  68 + ? 1
  69 + : null;
59 _initSexList(); 70 _initSexList();
60 nameFocus.addListener(() { 71 nameFocus.addListener(() {
61 if (nameFocus.hasFocus) { 72 if (nameFocus.hasFocus) {
@@ -169,6 +180,11 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { @@ -169,6 +180,11 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> {
169 if (fwController.text.trim().length > 0) { 180 if (fwController.text.trim().length > 0) {
170 params['serve'] = fwController.text; 181 params['serve'] = fwController.text;
171 } 182 }
  183 +
  184 + if (memberShow != '会员状态未知') {
  185 + params['is_member'] = memberShow == '是' ? '1' : '0';
  186 + }
  187 +
172 bool sucess = 188 bool sucess =
173 await customerProvider.setGuestInfo(context, params, showLoading: true); 189 await customerProvider.setGuestInfo(context, params, showLoading: true);
174 if (sucess) { 190 if (sucess) {
@@ -392,9 +392,18 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { @@ -392,9 +392,18 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
392 flatBtn(customerProvider.guestInfoSunModel.guest.label, 392 flatBtn(customerProvider.guestInfoSunModel.guest.label,
393 MyColours.color_B39437), 393 MyColours.color_B39437),
394 if (customerProvider.guestInfoSunModel.guest.isMember == 394 if (customerProvider.guestInfoSunModel.guest.isMember ==
395 - '1')  
396 - flatBtn('会员', MyColours.color_438E93),  
397 - if (true) flatBtn('存酒14天', MyColours.color_438E93) 395 + '1' ||
  396 + customerProvider.guestInfoSunModel.guest.isMember ==
  397 + '0')
  398 + flatBtn(
  399 + customerProvider.guestInfoSunModel.guest.isMember ==
  400 + '1'
  401 + ? '会员'
  402 + : '非会员',
  403 + MyColours.color_438E93),
  404 + if ('${customerProvider.guestInfoSunModel.store.storeDay}' !=
  405 + '0')
  406 + flatBtn('存酒14天', MyColours.color_438E93)
398 ], 407 ],
399 ), 408 ),
400 VEmptyView(20), 409 VEmptyView(20),
@@ -516,9 +525,13 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { @@ -516,9 +525,13 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
516 color: MyColours.color_515151), 525 color: MyColours.color_515151),
517 ), 526 ),
518 Text( 527 Text(
519 - customerProvider.guestInfoSunModel.last.conAmount == null 528 + customerProvider.guestInfoSunModel.last.conAmount ==
  529 + null ||
  530 + customerProvider
  531 + .guestInfoSunModel.last.conAmount ==
  532 + 0
520 ? '未记录' 533 ? '未记录'
521 - : customerProvider.guestInfoSunModel.last.conAmount, 534 + : '${customerProvider.guestInfoSunModel.last.conAmount}',
522 style: TextStyle( 535 style: TextStyle(
523 fontSize: ScreenUtil().setSp(20), 536 fontSize: ScreenUtil().setSp(20),
524 color: MyColours.color_438E93), 537 color: MyColours.color_438E93),
@@ -420,7 +420,8 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -420,7 +420,8 @@ class _CustomerListPageState extends State<CustomerListPage>
420 BorderRadius.circular(ScreenUtil().setWidth(40)), 420 BorderRadius.circular(ScreenUtil().setWidth(40)),
421 color: MyColours.color_199095), 421 color: MyColours.color_199095),
422 child: Text( 422 child: Text(
423 - '已选[${customerProvider.labels}]${customerProvider.selectCustomerSeller.length}位顾客,下发营销任务', 423 + // '已选[${customerProvider.labels}]${customerProvider.selectCustomerSeller.length}位顾客,下发营销任务',
  424 + '已选${customerProvider.selectCustomerSeller.length}位顾客,创建营销计划',
424 overflow: TextOverflow.ellipsis, 425 overflow: TextOverflow.ellipsis,
425 maxLines: 1, 426 maxLines: 1,
426 style: TextStyle( 427 style: TextStyle(
@@ -273,102 +273,102 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { @@ -273,102 +273,102 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
273 spacing: ScreenUtil().setWidth(20), 273 spacing: ScreenUtil().setWidth(20),
274 runSpacing: ScreenUtil().setWidth(10), 274 runSpacing: ScreenUtil().setWidth(10),
275 children: _buildLabelItem(customerProvider.labelList)), 275 children: _buildLabelItem(customerProvider.labelList)),
276 - VEmptyView(34),  
277 - MyDivider(  
278 - double.infinity,  
279 - w(1),  
280 - color: MyColours.color_DBDBDB,  
281 - ),  
282 - VEmptyView(52),  
283 - InkWell(  
284 - onTap: () {  
285 - setState(() {  
286 - swichSync = !swichSync;  
287 - });  
288 - // _sellerGuestSet();  
289 - },  
290 - child: Row(  
291 - mainAxisAlignment: MainAxisAlignment.spaceBetween,  
292 - crossAxisAlignment: CrossAxisAlignment.center,  
293 - children: [  
294 - Text('是否与会员系统同步',  
295 - style: TextStyle(  
296 - color: MyColours.color_515151,  
297 - fontSize: ScreenUtil().setSp(32))),  
298 - Image.asset(  
299 - swichSync  
300 - ? Utils.getImgPath('f_swich_on')  
301 - : Utils.getImgPath('f_swich_off'),  
302 - width: ScreenUtil().setWidth(70),  
303 - // height: ScreenUtil().setWidth(82),  
304 - ),  
305 - ],  
306 - ),  
307 - ),  
308 - VEmptyView(48),  
309 - InkWell(  
310 - onTap: () {  
311 - FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘  
312 - // DialogUtil.showSelectCusmanDialog(context, memberList,  
313 - // (value) {  
314 - // if (value != null) {  
315 - // setState(() {  
316 - // memberIndex = value.first;  
317 - // memberShow = memberList[memberIndex];  
318 - // });  
319 - // }  
320 - // }, selecteds: memberIndex == null ? [] : [memberIndex])  
321 - // .then((value) {});  
322 - },  
323 - child: Container(  
324 - // height: ScreenUtil().setWidth(60),  
325 - padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(50)),  
326 - child: Row(  
327 - mainAxisAlignment: MainAxisAlignment.spaceBetween,  
328 - crossAxisAlignment: CrossAxisAlignment.center,  
329 - children: [  
330 - Container(  
331 - // color: Colors.red,  
332 - width: ScreenUtil().setWidth(150),  
333 - height: ScreenUtil().setWidth(35),  
334 - child: Text(  
335 - '会员系统选择',  
336 - style: TextStyle(  
337 - fontSize: ScreenUtil().setSp(32),  
338 - color: MyColours.color_515151),  
339 - ),  
340 - ),  
341 - Expanded(  
342 - child: Text(  
343 - memberShow,  
344 - overflow: TextOverflow.ellipsis,  
345 - style: TextStyle(  
346 - color: MyColours.color_353535,  
347 - fontSize: ScreenUtil().setSp(28),  
348 - ),  
349 - )),  
350 - HEmptyView(10),  
351 - Image.asset(  
352 - Utils.getImgPath(  
353 - showLabel ? 'c_arrow_up' : 'c_arrow_down'),  
354 - width: ScreenUtil().setWidth(24),  
355 - // height: ScreenUtil().setWidth(10),  
356 - )  
357 - ],  
358 - ),  
359 - )),  
360 - _itemWidget('企业代码或账号', "点击这里输入企业代码或账号", null, null),  
361 - VEmptyView(50),  
362 - _itemWidget('管理员账号', "点击这里输入管理员账号", null, null),  
363 - VEmptyView(50),  
364 - _itemWidget('密码', "点击这里输入管理员密码", null, null),  
365 - VEmptyView(40),  
366 - Center(  
367 - child: Text(  
368 - '请与纳极客服400-000-9690 联系对接事宜',  
369 - style: TextStyle(  
370 - color: MyColours.color_999999, fontSize: font(12)),  
371 - )) 276 + // VEmptyView(34),
  277 + // MyDivider(
  278 + // double.infinity,
  279 + // w(1),
  280 + // color: MyColours.color_DBDBDB,
  281 + // ),
  282 + // VEmptyView(52),
  283 + // InkWell(
  284 + // onTap: () {
  285 + // setState(() {
  286 + // swichSync = !swichSync;
  287 + // });
  288 + // // _sellerGuestSet();
  289 + // },
  290 + // child: Row(
  291 + // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  292 + // crossAxisAlignment: CrossAxisAlignment.center,
  293 + // children: [
  294 + // Text('是否与会员系统同步',
  295 + // style: TextStyle(
  296 + // color: MyColours.color_515151,
  297 + // fontSize: ScreenUtil().setSp(32))),
  298 + // Image.asset(
  299 + // swichSync
  300 + // ? Utils.getImgPath('f_swich_on')
  301 + // : Utils.getImgPath('f_swich_off'),
  302 + // width: ScreenUtil().setWidth(70),
  303 + // // height: ScreenUtil().setWidth(82),
  304 + // ),
  305 + // ],
  306 + // ),
  307 + // ),
  308 + // VEmptyView(48),
  309 + // InkWell(
  310 + // onTap: () {
  311 + // FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
  312 + // // DialogUtil.showSelectCusmanDialog(context, memberList,
  313 + // // (value) {
  314 + // // if (value != null) {
  315 + // // setState(() {
  316 + // // memberIndex = value.first;
  317 + // // memberShow = memberList[memberIndex];
  318 + // // });
  319 + // // }
  320 + // // }, selecteds: memberIndex == null ? [] : [memberIndex])
  321 + // // .then((value) {});
  322 + // },
  323 + // child: Container(
  324 + // // height: ScreenUtil().setWidth(60),
  325 + // padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(50)),
  326 + // child: Row(
  327 + // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  328 + // crossAxisAlignment: CrossAxisAlignment.center,
  329 + // children: [
  330 + // Container(
  331 + // // color: Colors.red,
  332 + // width: ScreenUtil().setWidth(150),
  333 + // height: ScreenUtil().setWidth(35),
  334 + // child: Text(
  335 + // '会员系统选择',
  336 + // style: TextStyle(
  337 + // fontSize: ScreenUtil().setSp(32),
  338 + // color: MyColours.color_515151),
  339 + // ),
  340 + // ),
  341 + // Expanded(
  342 + // child: Text(
  343 + // memberShow,
  344 + // overflow: TextOverflow.ellipsis,
  345 + // style: TextStyle(
  346 + // color: MyColours.color_353535,
  347 + // fontSize: ScreenUtil().setSp(28),
  348 + // ),
  349 + // )),
  350 + // HEmptyView(10),
  351 + // Image.asset(
  352 + // Utils.getImgPath(
  353 + // showLabel ? 'c_arrow_up' : 'c_arrow_down'),
  354 + // width: ScreenUtil().setWidth(24),
  355 + // // height: ScreenUtil().setWidth(10),
  356 + // )
  357 + // ],
  358 + // ),
  359 + // )),
  360 + // _itemWidget('企业代码或账号', "点击这里输入企业代码或账号", null, null),
  361 + // VEmptyView(50),
  362 + // _itemWidget('管理员账号', "点击这里输入管理员账号", null, null),
  363 + // VEmptyView(50),
  364 + // _itemWidget('密码', "点击这里输入管理员密码", null, null),
  365 + // VEmptyView(40),
  366 + // Center(
  367 + // child: Text(
  368 + // '请与纳极客服400-000-9690 联系对接事宜',
  369 + // style: TextStyle(
  370 + // color: MyColours.color_999999, fontSize: font(12)),
  371 + // ))
372 ], 372 ],
373 ), 373 ),
374 ), 374 ),
@@ -107,41 +107,41 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { @@ -107,41 +107,41 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
107 child: SingleChildScrollView( 107 child: SingleChildScrollView(
108 child: Column( 108 child: Column(
109 children: [ 109 children: [
110 - InkWell(  
111 - onTap: () {  
112 - NavigatorUtil.goRechargeHomePage(context);  
113 - },  
114 - child: Padding(  
115 - padding: EdgeInsets.only(  
116 - left: w(16),  
117 - top: w(12),  
118 - bottom: w(12),  
119 - right: w(12)),  
120 - child: Row(  
121 - children: [  
122 - Text(  
123 - '会员充值优惠活动',  
124 - style: TextStyle(  
125 - color: MyColours.color_515151,  
126 - fontSize: ScreenUtil().setWidth(32)),  
127 - ),  
128 - Spacer(),  
129 - Container(  
130 - padding: EdgeInsets.symmetric(  
131 - horizontal: w(7), vertical: w(4)),  
132 - child: Image.asset(  
133 - "assets/arrow_right_new.png",  
134 - width: ScreenUtil().setWidth(18),  
135 - height: ScreenUtil().setWidth(32),  
136 - ),  
137 - )  
138 - ],  
139 - ))),  
140 - Padding(  
141 - padding: EdgeInsets.only(left: w(16)),  
142 - child: MyDivider(double.infinity, w(0.5),  
143 - color: MyColours.color_E7E7E7)),  
144 - VEmptyView(24), 110 + // InkWell(
  111 + // onTap: () {
  112 + // NavigatorUtil.goRechargeHomePage(context);
  113 + // },
  114 + // child: Padding(
  115 + // padding: EdgeInsets.only(
  116 + // left: w(16),
  117 + // top: w(12),
  118 + // bottom: w(12),
  119 + // right: w(12)),
  120 + // child: Row(
  121 + // children: [
  122 + // Text(
  123 + // '会员充值优惠活动',
  124 + // style: TextStyle(
  125 + // color: MyColours.color_515151,
  126 + // fontSize: ScreenUtil().setWidth(32)),
  127 + // ),
  128 + // Spacer(),
  129 + // Container(
  130 + // padding: EdgeInsets.symmetric(
  131 + // horizontal: w(7), vertical: w(4)),
  132 + // child: Image.asset(
  133 + // "assets/arrow_right_new.png",
  134 + // width: ScreenUtil().setWidth(18),
  135 + // height: ScreenUtil().setWidth(32),
  136 + // ),
  137 + // )
  138 + // ],
  139 + // ))),
  140 + // Padding(
  141 + // padding: EdgeInsets.only(left: w(16)),
  142 + // child: MyDivider(double.infinity, w(0.5),
  143 + // color: MyColours.color_E7E7E7)),
  144 + // VEmptyView(24),
145 InkWell( 145 InkWell(
146 onTap: () { 146 onTap: () {
147 setState(() { 147 setState(() {
@@ -282,7 +282,7 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { @@ -282,7 +282,7 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
282 // Response response = await DioUtil.getInstance().getDio().get( 282 // Response response = await DioUtil.getInstance().getDio().get(
283 // "https://xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode?sellerid=$sid&uid=$uid"); 283 // "https://xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode?sellerid=$sid&uid=$uid");
284 // Response response = await DioUtil.getInstance().getDio().get( 284 // Response response = await DioUtil.getInstance().getDio().get(
285 - // "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx85aa3cdd0f791e65&secret=87c9a23c2e6032b2da75af6b0efc5424&code=$code&grant_type=authorization_code"); 285 + // "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx85aa3cdd0f791e65&secret=90ba794b30d2fe388309149174874603&code=$code&grant_type=authorization_code");
286 LogUtil.v("access_token:${response.toString()}"); 286 LogUtil.v("access_token:${response.toString()}");
287 Map<String, dynamic> responseData = json.decode(response.toString()); 287 Map<String, dynamic> responseData = json.decode(response.toString());
288 print(responseData); 288 print(responseData);
@@ -224,7 +224,7 @@ @@ -224,7 +224,7 @@
224 // // Response response = await DioUtil.getInstance().getDio().get( 224 // // Response response = await DioUtil.getInstance().getDio().get(
225 // // "https://xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode?sellerid=$sid&uid=$uid"); 225 // // "https://xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode?sellerid=$sid&uid=$uid");
226 // // Response response = await DioUtil.getInstance().getDio().get( 226 // // Response response = await DioUtil.getInstance().getDio().get(
227 -// // "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx85aa3cdd0f791e65&secret=87c9a23c2e6032b2da75af6b0efc5424&code=$code&grant_type=authorization_code"); 227 +// // "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx85aa3cdd0f791e65&secret=90ba794b30d2fe388309149174874603&code=$code&grant_type=authorization_code");
228 // LogUtil.v("access_token:${response.toString()}"); 228 // LogUtil.v("access_token:${response.toString()}");
229 // Map<String, dynamic> responseData = json.decode(response.toString()); 229 // Map<String, dynamic> responseData = json.decode(response.toString());
230 // print(responseData); 230 // print(responseData);
@@ -4,7 +4,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -4,7 +4,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
4 import 'package:provider/provider.dart'; 4 import 'package:provider/provider.dart';
5 5
6 import '../../../models/wine_manage_model.dart'; 6 import '../../../models/wine_manage_model.dart';
  7 +import '../../../provider/customer_provider.dart';
7 import '../../../provider/store_wine_provider.dart'; 8 import '../../../provider/store_wine_provider.dart';
  9 +import '../../../provider/user_model.dart';
8 import '../../../res/colors.dart'; 10 import '../../../res/colors.dart';
9 import '../../../route/navigator_util.dart'; 11 import '../../../route/navigator_util.dart';
10 import '../../../utils/screen_util.dart'; 12 import '../../../utils/screen_util.dart';
@@ -32,6 +34,7 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> { @@ -32,6 +34,7 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
32 StoreWineProvider storeWineProvider; 34 StoreWineProvider storeWineProvider;
33 35
34 ScrollController _controller = ScrollController(); 36 ScrollController _controller = ScrollController();
  37 + String isMember = '';
35 38
36 @override 39 @override
37 void initState() { 40 void initState() {
@@ -42,6 +45,29 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> { @@ -42,6 +45,29 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
42 element.wineNumC.text = element.wineStock; //出库数量初始化剩余库存量 45 element.wineNumC.text = element.wineStock; //出库数量初始化剩余库存量
43 element.checkAmount = element.wineStock; //出库数量初始化剩余库存量 46 element.checkAmount = element.wineStock; //出库数量初始化剩余库存量
44 }); 47 });
  48 + _getIsMemberByPhone();
  49 + }
  50 +
  51 + ///获取手机号是否为商家会员
  52 + _getIsMemberByPhone() async {
  53 + CustomerProvider customerProvider =
  54 + Provider.of<CustomerProvider>(context, listen: false);
  55 + Map<String, String> params = {
  56 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  57 + 'phone': widget.wineManageDetail.phone
  58 + };
  59 + Map temp = await customerProvider.getIsMemberByPhone(context, params);
  60 + if (temp == null) {
  61 + //会员状态未知
  62 + isMember = '会员状态未知';
  63 + } else if (temp['is_member'] == '1') {
  64 + //会员
  65 + isMember = '会员';
  66 + } else {
  67 + //非会员
  68 + isMember = '非会员';
  69 + }
  70 + setState(() {});
45 } 71 }
46 72
47 Widget _textItemWidget( 73 Widget _textItemWidget(
@@ -145,17 +171,9 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> { @@ -145,17 +171,9 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
145 width: w(100), 171 width: w(100),
146 alignment: Alignment.centerRight, 172 alignment: Alignment.centerRight,
147 child: Text( 173 child: Text(
148 - // '会员状态未知',  
149 - widget.wineManageDetail.isMember ==  
150 - '1'  
151 - ? '会员'  
152 - : '会员状态未知', 174 + isMember,
153 style: TextStyle( 175 style: TextStyle(
154 - color: widget.wineManageDetail  
155 - .isMember !=  
156 - '1'  
157 - ? MyColours.color_999999  
158 - : MyColours.color_515151, 176 + color: MyColours.color_999999,
159 fontSize: ScreenUtil().setSp(32), 177 fontSize: ScreenUtil().setSp(32),
160 ), 178 ),
161 ), 179 ),
@@ -11,6 +11,7 @@ import 'package:provider/provider.dart'; @@ -11,6 +11,7 @@ import 'package:provider/provider.dart';
11 import '../../../app.dart'; 11 import '../../../app.dart';
12 import '../../../models/upload_img_model.dart'; 12 import '../../../models/upload_img_model.dart';
13 import '../../../models/wine_manage_model.dart'; 13 import '../../../models/wine_manage_model.dart';
  14 +import '../../../provider/customer_provider.dart';
14 import '../../../provider/store_wine_provider.dart'; 15 import '../../../provider/store_wine_provider.dart';
15 import '../../../provider/upload_img_provider.dart'; 16 import '../../../provider/upload_img_provider.dart';
16 import '../../../provider/user_model.dart'; 17 import '../../../provider/user_model.dart';
@@ -51,8 +52,9 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -51,8 +52,9 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
51 UploadImageProvider _uploadImageProvider; 52 UploadImageProvider _uploadImageProvider;
52 53
53 List<String> memberList = []; 54 List<String> memberList = [];
54 - String memberShow = '会员状态未知'; 55 + String isMember = '会员状态未知';
55 int memberIndex; 56 int memberIndex;
  57 + String memberid;
56 58
57 @override 59 @override
58 void initState() { 60 void initState() {
@@ -97,6 +99,34 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -97,6 +99,34 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
97 Utils.addZeroNumber(dateTime.day); 99 Utils.addZeroNumber(dateTime.day);
98 } 100 }
99 101
  102 + ///获取手机号是否为商家会员
  103 + _getIsMemberByPhone() async {
  104 + CustomerProvider customerProvider =
  105 + Provider.of<CustomerProvider>(context, listen: false);
  106 + Map<String, String> params = {
  107 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  108 + 'phone': phoneC.text
  109 + };
  110 + Map temp = await customerProvider.getIsMemberByPhone(context, params);
  111 + if (temp == null) {
  112 + //会员状态未知
  113 + isMember = '会员状态未知';
  114 + memberIndex = null;
  115 + memberid = null;
  116 + } else if (temp['is_member'] == '1') {
  117 + //会员
  118 + isMember = '会员';
  119 + memberIndex = 0;
  120 + memberid = temp['id'];
  121 + } else {
  122 + //非会员
  123 + isMember = '非会员';
  124 + memberIndex = 1;
  125 + memberid = temp['id'];
  126 + }
  127 + setState(() {});
  128 + }
  129 +
100 Widget _textFieldWidget( 130 Widget _textFieldWidget(
101 String title, String hintText, TextEditingController controller) { 131 String title, String hintText, TextEditingController controller) {
102 return Column(children: [ 132 return Column(children: [
@@ -158,6 +188,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -158,6 +188,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
158 // .sellerid, 188 // .sellerid,
159 // }; 189 // };
160 // _baseIndoProvider.getUserHistorys(context, params); 190 // _baseIndoProvider.getUserHistorys(context, params);
  191 + _getIsMemberByPhone();
161 }, 192 },
162 onEditingComplete: () { 193 onEditingComplete: () {
163 // _phoneNode.unfocus(); 194 // _phoneNode.unfocus();
@@ -266,6 +297,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -266,6 +297,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
266 // textAlignVertical: 297 // textAlignVertical:
267 // TextAlignVertical.center, 298 // TextAlignVertical.center,
268 decoration: InputDecoration( 299 decoration: InputDecoration(
  300 + isCollapsed: true,
269 hintText: "点击输入", 301 hintText: "点击输入",
270 hintStyle: TextStyle( 302 hintStyle: TextStyle(
271 color: MyColours.color_999999, 303 color: MyColours.color_999999,
@@ -353,19 +385,31 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -353,19 +385,31 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
353 context, memberList, (value) async { 385 context, memberList, (value) async {
354 if (value != null) { 386 if (value != null) {
355 memberIndex = value.first; 387 memberIndex = value.first;
356 - memberShow =  
357 - memberList[memberIndex]; 388 + isMember = memberList[memberIndex];
358 389
359 setState(() {}); 390 setState(() {});
  391 + // CustomerProvider customerProvider =
  392 + // Provider.of<CustomerProvider>(
  393 + // context,
  394 + // listen: false);
  395 + // if (memberid != null &&
  396 + // memberIndex != null) {
  397 + // await customerProvider
  398 + // .setGuestInfo(context, {
  399 + // 'id': memberid,
  400 + // 'is_member':
  401 + // memberIndex == 0 ? '1' : '0'
  402 + // });
  403 + // }
360 } 404 }
361 }, selecteds: [memberIndex ?? 0]).then( 405 }, selecteds: [memberIndex ?? 0]).then(
362 (value) {}); 406 (value) {});
363 }, 407 },
364 child: Row(children: [ 408 child: Row(children: [
365 Text( 409 Text(
366 - memberShow, 410 + isMember,
367 style: TextStyle( 411 style: TextStyle(
368 - color: memberShow == '会员状态未知' 412 + color: isMember == '会员状态未知'
369 ? MyColours.color_999999 413 ? MyColours.color_999999
370 : MyColours.color_515151, 414 : MyColours.color_515151,
371 fontSize: ScreenUtil().setSp(32), 415 fontSize: ScreenUtil().setSp(32),
@@ -488,6 +532,10 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -488,6 +532,10 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
488 Utils.showToast('请输入客人姓名!'); 532 Utils.showToast('请输入客人姓名!');
489 return false; 533 return false;
490 } 534 }
  535 + if (isMember == '会员状态未知') {
  536 + Utils.showToast('请输入选择会员选项!');
  537 + return false;
  538 + }
491 if (dataWine.length == 0) { 539 if (dataWine.length == 0) {
492 Utils.showToast('请输入酒品信息!'); 540 Utils.showToast('请输入酒品信息!');
493 return false; 541 return false;
@@ -561,7 +609,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -561,7 +609,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
561 .openid, 609 .openid,
562 'rname': nameC.text, 610 'rname': nameC.text,
563 'sex': '${sexSelectIndex + 1}', //性别 1 男 2 女 3 公司 611 'sex': '${sexSelectIndex + 1}', //性别 1 男 2 女 3 公司
564 - 'is_member': null, //会员状态 612 + 'is_member': memberIndex == 0 ? '1' : '0', //会员状态
565 'phone': phoneC.text, 613 'phone': phoneC.text,
566 'wine': json.encode(data) 614 'wine': json.encode(data)
567 }; 615 };
@@ -572,6 +620,51 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -572,6 +620,51 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
572 bool success = await storeWineProvider 620 bool success = await storeWineProvider
573 .setStoreWineBySeller(context, pramas, 621 .setStoreWineBySeller(context, pramas,
574 showLoading: true); 622 showLoading: true);
  623 +
  624 + CustomerProvider customerProvider =
  625 + Provider.of<CustomerProvider>(context, listen: false);
  626 + if (memberid != null && memberIndex != null) {
  627 + Map<String, String> pramas = {
  628 + 'id': memberid,
  629 + 'is_member': memberIndex == 0 ? '1' : '0'
  630 + };
  631 +
  632 + String phone;
  633 + if (nameC.text.trim().length > 0) {
  634 + pramas['rname'] = nameC.text;
  635 + pramas['sex'] = '${sexSelectIndex + 1}';
  636 + }
  637 + if (phoneC.text.replaceAll(' ', '').length > 0) {
  638 + phone = phoneC.text.replaceAll(' ', '');
  639 + pramas['phone'] = phone;
  640 + }
  641 +
  642 + await customerProvider.setGuestInfo(context, pramas);
  643 + } else {
  644 + Map<String, String> pramas = {
  645 + 'sellerid':
  646 + Provider.of<UserModel>(context, listen: false)
  647 + .user
  648 + .sellerid,
  649 + 'uid': Provider.of<UserModel>(context, listen: false)
  650 + .user
  651 + .openid,
  652 + };
  653 + if (phoneC.text.replaceAll(' ', '').length > 0) {
  654 + pramas['phone'] = phoneC.text.replaceAll(' ', '');
  655 + }
  656 + if (memberIndex != null) {
  657 + pramas['is_member'] = memberIndex == 0 ? '1' : '0';
  658 + }
  659 +
  660 + // if (nameC.text.trim().length > 0) {
  661 + // pramas['rname'] = nameC.text;
  662 + // pramas['sex'] = '${sexSelectIndex + 1}';
  663 + // }
  664 +
  665 + await customerProvider.setInsGuest(context, pramas);
  666 + }
  667 +
575 if (success) { 668 if (success) {
576 App.sp.setInt("wineSerialSub", wineSerialSub + 1); 669 App.sp.setInt("wineSerialSub", wineSerialSub + 1);
577 //存酒成功,返回列表,并刷新 670 //存酒成功,返回列表,并刷新
@@ -8,7 +8,9 @@ import 'package:provider/provider.dart'; @@ -8,7 +8,9 @@ import 'package:provider/provider.dart';
8 8
9 import '../../../constant/state.dart'; 9 import '../../../constant/state.dart';
10 import '../../../models/wine_manage_model.dart'; 10 import '../../../models/wine_manage_model.dart';
  11 +import '../../../provider/customer_provider.dart';
11 import '../../../provider/store_wine_provider.dart'; 12 import '../../../provider/store_wine_provider.dart';
  13 +import '../../../provider/user_model.dart';
12 import '../../../res/colors.dart'; 14 import '../../../res/colors.dart';
13 import '../../../utils/screen_util.dart'; 15 import '../../../utils/screen_util.dart';
14 import '../../../widgets/MyDivider.dart'; 16 import '../../../widgets/MyDivider.dart';
@@ -37,6 +39,7 @@ class _OutStoreRecordDetailPageState extends State<OutStoreRecordDetailPage> { @@ -37,6 +39,7 @@ class _OutStoreRecordDetailPageState extends State<OutStoreRecordDetailPage> {
37 ScrollController _controller = ScrollController(); 39 ScrollController _controller = ScrollController();
38 40
39 // List dataWine = []; 41 // List dataWine = [];
  42 + String isMember = '';
40 43
41 @override 44 @override
42 void initState() { 45 void initState() {
@@ -47,9 +50,32 @@ class _OutStoreRecordDetailPageState extends State<OutStoreRecordDetailPage> { @@ -47,9 +50,32 @@ class _OutStoreRecordDetailPageState extends State<OutStoreRecordDetailPage> {
47 // dataWine.add(wineManageModel); 50 // dataWine.add(wineManageModel);
48 WidgetsBinding.instance.addPostFrameCallback((_) { 51 WidgetsBinding.instance.addPostFrameCallback((_) {
49 // _getStoreWineCheckByWid(); 52 // _getStoreWineCheckByWid();
  53 + _getIsMemberByPhone();
50 }); 54 });
51 } 55 }
52 56
  57 + ///获取手机号是否为商家会员
  58 + _getIsMemberByPhone() async {
  59 + CustomerProvider customerProvider =
  60 + Provider.of<CustomerProvider>(context, listen: false);
  61 + Map<String, String> params = {
  62 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  63 + 'phone': widget.outWineRecordSunModel.phone
  64 + };
  65 + Map temp = await customerProvider.getIsMemberByPhone(context, params);
  66 + if (temp == null) {
  67 + //会员状态未知
  68 + isMember = '会员状态未知';
  69 + } else if (temp['is_member'] == '1') {
  70 + //会员
  71 + isMember = '会员';
  72 + } else {
  73 + //非会员
  74 + isMember = '非会员';
  75 + }
  76 + setState(() {});
  77 + }
  78 +
53 ///根据存酒ID获取取酒记录 79 ///根据存酒ID获取取酒记录
54 80
55 // _getStoreWineCheckByWid() async { 81 // _getStoreWineCheckByWid() async {
@@ -178,18 +204,9 @@ class _OutStoreRecordDetailPageState extends State<OutStoreRecordDetailPage> { @@ -178,18 +204,9 @@ class _OutStoreRecordDetailPageState extends State<OutStoreRecordDetailPage> {
178 alignment: Alignment.centerRight, 204 alignment: Alignment.centerRight,
179 child: Text( 205 child: Text(
180 // '会员状态未知', 206 // '会员状态未知',
181 - widget.outWineRecordSunModel  
182 - .isMember ==  
183 - '1'  
184 - ? '会员'  
185 - : '会员状态未知', 207 + isMember,
186 style: TextStyle( 208 style: TextStyle(
187 - color: widget  
188 - .outWineRecordSunModel  
189 - .isMember !=  
190 - '1'  
191 - ? MyColours.color_999999  
192 - : MyColours.color_515151, 209 + color: MyColours.color_999999,
193 fontSize: ScreenUtil().setSp(32), 210 fontSize: ScreenUtil().setSp(32),
194 ), 211 ),
195 ), 212 ),
@@ -8,7 +8,9 @@ import 'package:provider/provider.dart'; @@ -8,7 +8,9 @@ import 'package:provider/provider.dart';
8 8
9 import '../../../constant/state.dart'; 9 import '../../../constant/state.dart';
10 import '../../../models/wine_manage_model.dart'; 10 import '../../../models/wine_manage_model.dart';
  11 +import '../../../provider/customer_provider.dart';
11 import '../../../provider/store_wine_provider.dart'; 12 import '../../../provider/store_wine_provider.dart';
  13 +import '../../../provider/user_model.dart';
12 import '../../../res/colors.dart'; 14 import '../../../res/colors.dart';
13 import '../../../utils/screen_util.dart'; 15 import '../../../utils/screen_util.dart';
14 import '../../../widgets/MyDivider.dart'; 16 import '../../../widgets/MyDivider.dart';
@@ -35,6 +37,7 @@ class _OutStoreRecordPageState extends State<OutStoreRecordPage> { @@ -35,6 +37,7 @@ class _OutStoreRecordPageState extends State<OutStoreRecordPage> {
35 ScrollController _controller = ScrollController(); 37 ScrollController _controller = ScrollController();
36 38
37 // List dataWine = []; 39 // List dataWine = [];
  40 + String isMember = '';
38 41
39 @override 42 @override
40 void initState() { 43 void initState() {
@@ -52,8 +55,33 @@ class _OutStoreRecordPageState extends State<OutStoreRecordPage> { @@ -52,8 +55,33 @@ class _OutStoreRecordPageState extends State<OutStoreRecordPage> {
52 55
53 _getStoreWineCheckByWid() async { 56 _getStoreWineCheckByWid() async {
54 Map<String, String> pramas = {'wid': widget.wid}; 57 Map<String, String> pramas = {'wid': widget.wid};
55 - await storeWineProvider.getStoreWineCheckByWid(context, pramas,  
56 - showLoading: true); 58 + bool success = await storeWineProvider
  59 + .getStoreWineCheckByWid(context, pramas, showLoading: true);
  60 + if (success) {
  61 + _getIsMemberByPhone();
  62 + }
  63 + }
  64 +
  65 + ///获取手机号是否为商家会员
  66 + _getIsMemberByPhone() async {
  67 + CustomerProvider customerProvider =
  68 + Provider.of<CustomerProvider>(context, listen: false);
  69 + Map<String, String> params = {
  70 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  71 + 'phone': storeWineProvider.outWineRecordData[0].phone
  72 + };
  73 + Map temp = await customerProvider.getIsMemberByPhone(context, params);
  74 + if (temp == null) {
  75 + //会员状态未知
  76 + isMember = '会员状态未知';
  77 + } else if (temp['is_member'] == '1') {
  78 + //会员
  79 + isMember = '会员';
  80 + } else {
  81 + //非会员
  82 + isMember = '非会员';
  83 + }
  84 + setState(() {});
57 } 85 }
58 86
59 Widget _textItemWidget(String title, String subTitle, 87 Widget _textItemWidget(String title, String subTitle,
@@ -176,12 +204,7 @@ class _OutStoreRecordPageState extends State<OutStoreRecordPage> { @@ -176,12 +204,7 @@ class _OutStoreRecordPageState extends State<OutStoreRecordPage> {
176 alignment: Alignment.centerRight, 204 alignment: Alignment.centerRight,
177 child: Text( 205 child: Text(
178 // '会员状态未知', 206 // '会员状态未知',
179 - storeWineProvider  
180 - .outWineRecordData[0]  
181 - .isMember ==  
182 - '1'  
183 - ? '会员'  
184 - : '会员状态未知', 207 + isMember,
185 style: TextStyle( 208 style: TextStyle(
186 color: storeWineProvider 209 color: storeWineProvider
187 .outWineRecordData[0] 210 .outWineRecordData[0]
@@ -3,6 +3,8 @@ import 'dart:convert'; @@ -3,6 +3,8 @@ import 'dart:convert';
3 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
4 import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 import 'package:flutter_screenutil/flutter_screenutil.dart';
5 import 'package:one_key/pages/my/store_wine_manage/wine_detail_item_page.dart'; 5 import 'package:one_key/pages/my/store_wine_manage/wine_detail_item_page.dart';
  6 +import 'package:one_key/provider/customer_provider.dart';
  7 +import 'package:one_key/provider/user_model.dart';
6 import 'package:one_key/utils/utils.dart'; 8 import 'package:one_key/utils/utils.dart';
7 import 'package:one_key/widgets/system_app_bar.dart'; 9 import 'package:one_key/widgets/system_app_bar.dart';
8 import 'package:provider/provider.dart'; 10 import 'package:provider/provider.dart';
@@ -38,6 +40,7 @@ class _WineDetailPageState extends State<WineDetailPage> { @@ -38,6 +40,7 @@ class _WineDetailPageState extends State<WineDetailPage> {
38 ScrollController _controller = ScrollController(); 40 ScrollController _controller = ScrollController();
39 41
40 // List dataWine = []; 42 // List dataWine = [];
  43 + String isMember = '';
41 44
42 @override 45 @override
43 void initState() { 46 void initState() {
@@ -55,6 +58,31 @@ class _WineDetailPageState extends State<WineDetailPage> { @@ -55,6 +58,31 @@ class _WineDetailPageState extends State<WineDetailPage> {
55 _getStoreWineById() async { 58 _getStoreWineById() async {
56 Map<String, String> params = {"id": widget.idstr}; 59 Map<String, String> params = {"id": widget.idstr};
57 bool success = await storeWineProvider.getStoreWineById(context, params); 60 bool success = await storeWineProvider.getStoreWineById(context, params);
  61 + if (success && storeWineProvider.pageStateDetail != PageState.Empty) {
  62 + _getIsMemberByPhone();
  63 + }
  64 + }
  65 +
  66 + ///获取手机号是否为商家会员
  67 + _getIsMemberByPhone() async {
  68 + CustomerProvider customerProvider =
  69 + Provider.of<CustomerProvider>(context, listen: false);
  70 + Map<String, String> params = {
  71 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  72 + 'phone': storeWineProvider.wineManageDetail.phone
  73 + };
  74 + Map temp = await customerProvider.getIsMemberByPhone(context, params);
  75 + if (temp == null) {
  76 + //会员状态未知
  77 + isMember = '会员状态未知';
  78 + } else if (temp['is_member'] == '1') {
  79 + //会员
  80 + isMember = '会员';
  81 + } else {
  82 + //非会员
  83 + isMember = '非会员';
  84 + }
  85 + setState(() {});
58 } 86 }
59 87
60 Widget _textItemWidget( 88 Widget _textItemWidget(
@@ -174,15 +202,9 @@ class _WineDetailPageState extends State<WineDetailPage> { @@ -174,15 +202,9 @@ class _WineDetailPageState extends State<WineDetailPage> {
174 alignment: Alignment.centerRight, 202 alignment: Alignment.centerRight,
175 child: Text( 203 child: Text(
176 // , 204 // ,
177 - model.wineManageDetail.isMember == '1'  
178 - ? '会员'  
179 - : '会员状态未知', 205 + isMember,
180 style: TextStyle( 206 style: TextStyle(
181 - color: model.wineManageDetail  
182 - .isMember !=  
183 - '1'  
184 - ? MyColours.color_999999  
185 - : MyColours.color_515151, 207 + color: MyColours.color_999999,
186 fontSize: ScreenUtil().setSp(32), 208 fontSize: ScreenUtil().setSp(32),
187 ), 209 ),
188 ), 210 ),
@@ -174,6 +174,60 @@ class CustomerProvider extends ChangeNotifier { @@ -174,6 +174,60 @@ class CustomerProvider extends ChangeNotifier {
174 filterHydList.add(modelhyd4); 174 filterHydList.add(modelhyd4);
175 } 175 }
176 176
  177 + ///新增客户
  178 + Future<bool> setInsGuest(BuildContext context, Map<String, String> params,
  179 + {isShowLoading = true}) async {
  180 + BaseResp<dynamic> baseResp = await DioUtil()
  181 + .request<dynamic>(context, Method.get, HttpUrl.ins_guest,
  182 + data: params, showLoading: false)
  183 + .catchError((error) {
  184 + print(error.toString());
  185 + if (error is MyError) {
  186 + switch (error.type) {
  187 + }
  188 + }
  189 + return false;
  190 + });
  191 + if (baseResp.code == Constant.status_success) {
  192 + return true;
  193 + } else {
  194 + if (baseResp != null) {
  195 + Utils.showToast(baseResp.msg ?? "");
  196 + }
  197 + }
  198 + return false;
  199 + }
  200 +
  201 + ///客户经理获取所创建活动列表(选择优惠券)
  202 + Future<Map<String, dynamic>> getIsMemberByPhone(
  203 + BuildContext context, Map<String, String> params,
  204 + {isShowLoading = true}) async {
  205 + BaseResp<dynamic> baseResp = await DioUtil()
  206 + .request<dynamic>(context, Method.get, HttpUrl.get_is_member_by_phone,
  207 + data: params, showLoading: false)
  208 + .catchError((error) {
  209 + print(error.toString());
  210 + if (error is MyError) {
  211 + switch (error.type) {
  212 + }
  213 + }
  214 + return null;
  215 + });
  216 + if (baseResp.code == Constant.status_success) {
  217 + if (baseResp.data is bool) {
  218 + //系统里没有这个手机号码,会员状态未知
  219 +
  220 + } else {
  221 + return baseResp.data;
  222 + }
  223 + } else {
  224 + if (baseResp != null) {
  225 + Utils.showToast(baseResp.msg ?? "");
  226 + }
  227 + }
  228 + return null;
  229 + }
  230 +
177 ///客户经理获取所创建活动列表(选择优惠券) 231 ///客户经理获取所创建活动列表(选择优惠券)
178 Future<List<CouponSunModel>> getCustomerSelectActivityNew( 232 Future<List<CouponSunModel>> getCustomerSelectActivityNew(
179 BuildContext context, Map<String, String> params, 233 BuildContext context, Map<String, String> params,
@@ -398,7 +398,9 @@ var handleInvicationHandler = new Handler( @@ -398,7 +398,9 @@ var handleInvicationHandler = new Handler(
398 return ChangeNotifierProvider<RemarkManagerModel>( 398 return ChangeNotifierProvider<RemarkManagerModel>(
399 create: (_) => RemarkManagerModel(), 399 create: (_) => RemarkManagerModel(),
400 child: ChangeNotifierProvider<BaseIndoProvider>( 400 child: ChangeNotifierProvider<BaseIndoProvider>(
401 - create: (_) => BaseIndoProvider(), child: InvicationPage(rid))); 401 + create: (_) => BaseIndoProvider(),
  402 + child: ChangeNotifierProvider<CustomerProvider>(
  403 + create: (_) => CustomerProvider(), child: InvicationPage(rid))));
402 }); 404 });
403 405
404 // 发短信 406 // 发短信
@@ -2428,7 +2430,10 @@ var createStoreWinePageHandle = new Handler( @@ -2428,7 +2430,10 @@ var createStoreWinePageHandle = new Handler(
2428 return ChangeNotifierProvider<StoreWineProvider>( 2430 return ChangeNotifierProvider<StoreWineProvider>(
2429 create: (_) => StoreWineProvider(), 2431 create: (_) => StoreWineProvider(),
2430 child: ChangeNotifierProvider<UploadImageProvider>( 2432 child: ChangeNotifierProvider<UploadImageProvider>(
2431 - create: (_) => UploadImageProvider(), child: CreateStoreWinePage())); 2433 + create: (_) => UploadImageProvider(),
  2434 + child: ChangeNotifierProvider<CustomerProvider>(
  2435 + create: (_) => CustomerProvider(),
  2436 + child: CreateStoreWinePage())));
2432 }); 2437 });
2433 2438
2434 ///我的----存酒详情 2439 ///我的----存酒详情
@@ -2440,7 +2445,9 @@ var wineDetailPageHandle = new Handler( @@ -2440,7 +2445,9 @@ var wineDetailPageHandle = new Handler(
2440 2445
2441 return ChangeNotifierProvider<StoreWineProvider>( 2446 return ChangeNotifierProvider<StoreWineProvider>(
2442 create: (_) => StoreWineProvider(), 2447 create: (_) => StoreWineProvider(),
2443 - child: WineDetailPage(idstr: idstr, isStoreWine: isStoreWine)); 2448 + child: ChangeNotifierProvider<CustomerProvider>(
  2449 + create: (_) => CustomerProvider(),
  2450 + child: WineDetailPage(idstr: idstr, isStoreWine: isStoreWine)));
2444 }); 2451 });
2445 2452
2446 ///我的----存酒记录 2453 ///我的----存酒记录
@@ -2450,7 +2457,9 @@ var outStoreRecordPageHandle = new Handler( @@ -2450,7 +2457,9 @@ var outStoreRecordPageHandle = new Handler(
2450 2457
2451 return ChangeNotifierProvider<StoreWineProvider>( 2458 return ChangeNotifierProvider<StoreWineProvider>(
2452 create: (_) => StoreWineProvider(), 2459 create: (_) => StoreWineProvider(),
2453 - child: OutStoreRecordPage(wid: idstr)); 2460 + child: ChangeNotifierProvider<CustomerProvider>(
  2461 + create: (_) => CustomerProvider(),
  2462 + child: OutStoreRecordPage(wid: idstr)));
2454 }); 2463 });
2455 2464
2456 ///我的----申请出库 2465 ///我的----申请出库
@@ -2461,7 +2470,9 @@ var applyOutStorePageHandle = new Handler( @@ -2461,7 +2470,9 @@ var applyOutStorePageHandle = new Handler(
2461 2470
2462 return ChangeNotifierProvider<StoreWineProvider>( 2471 return ChangeNotifierProvider<StoreWineProvider>(
2463 create: (_) => StoreWineProvider(), 2472 create: (_) => StoreWineProvider(),
2464 - child: ApplyOutStorePage(wineManageDetail: wineManageDetail)); 2473 + child: ChangeNotifierProvider<CustomerProvider>(
  2474 + create: (_) => CustomerProvider(),
  2475 + child: ApplyOutStorePage(wineManageDetail: wineManageDetail)));
2465 }); 2476 });
2466 2477
2467 ///我的----申请出库短信验证输入 2478 ///我的----申请出库短信验证输入
@@ -2484,8 +2495,10 @@ var outStoreRecordDetailPageHandle = new Handler( @@ -2484,8 +2495,10 @@ var outStoreRecordDetailPageHandle = new Handler(
2484 2495
2485 return ChangeNotifierProvider<StoreWineProvider>( 2496 return ChangeNotifierProvider<StoreWineProvider>(
2486 create: (_) => StoreWineProvider(), 2497 create: (_) => StoreWineProvider(),
2487 - child: OutStoreRecordDetailPage(  
2488 - outWineRecordSunModel: outWineRecordSunModel)); 2498 + child: ChangeNotifierProvider<CustomerProvider>(
  2499 + create: (_) => CustomerProvider(),
  2500 + child: OutStoreRecordDetailPage(
  2501 + outWineRecordSunModel: outWineRecordSunModel)));
2489 }); 2502 });
2490 2503
2491 ///充值优惠-首页 2504 ///充值优惠-首页