Showing
23 changed files
with
586 additions
and
92 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 | } |
| @@ -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 | + 'id': 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), |
| @@ -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 |
| @@ -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, |
| @@ -527,11 +526,12 @@ class _MyContactListPageState extends State<MyContactListPage> { | @@ -527,11 +526,12 @@ class _MyContactListPageState extends State<MyContactListPage> { | ||
| 527 | model.label != null | 526 | model.label != null |
| 528 | ? flatBtn(model.label, MyColours.color_B39437) | 527 | ? flatBtn(model.label, MyColours.color_B39437) |
| 529 | : SizedBox(), | 528 | : SizedBox(), |
| 530 | - model.isMember == '1' | ||
| 531 | - ? flatBtn('会员', MyColours.color_438E93) | ||
| 532 | - : SizedBox(), | ||
| 533 | - true | ||
| 534 | - ? flatBtn('存酒14天', MyColours.color_438E93) | 529 | + if (model.isMember == '1' || model.isMember == '0') |
| 530 | + flatBtn(model.isMember == '1' ? '会员' : '非会员', | ||
| 531 | + MyColours.color_438E93), | ||
| 532 | + '${model.storeDay}' != '0' | ||
| 533 | + ? flatBtn('存酒${model.storeDay}天', | ||
| 534 | + MyColours.color_438E93) | ||
| 535 | : SizedBox() | 535 | : SizedBox() |
| 536 | ], | 536 | ], |
| 537 | )), | 537 | )), |
| @@ -555,6 +555,19 @@ class _MyContactListPageState extends State<MyContactListPage> { | @@ -555,6 +555,19 @@ class _MyContactListPageState extends State<MyContactListPage> { | ||
| 555 | fontSize: ScreenUtil().setSp(20), | 555 | fontSize: ScreenUtil().setSp(20), |
| 556 | ), | 556 | ), |
| 557 | ), | 557 | ), |
| 558 | + if (model.conAmount != null && | ||
| 559 | + '${model.conAmount}' != '0') | ||
| 560 | + HEmptyView(10), | ||
| 561 | + if (model.conAmount != null && | ||
| 562 | + '${model.conAmount}' != '0') | ||
| 563 | + Text( | ||
| 564 | + '消费${model.conAmount}', | ||
| 565 | + style: TextStyle( | ||
| 566 | + color: MyColours.color_515151, | ||
| 567 | + fontSize: ScreenUtil().setSp(20), | ||
| 568 | + ), | ||
| 569 | + ), | ||
| 570 | + Spacer(), | ||
| 558 | model.monthCount == '0' || model.monthCount == null | 571 | model.monthCount == '0' || model.monthCount == null |
| 559 | ? SizedBox() | 572 | ? SizedBox() |
| 560 | : HEmptyView(10), | 573 | : HEmptyView(10), |
| @@ -575,6 +588,7 @@ class _MyContactListPageState extends State<MyContactListPage> { | @@ -575,6 +588,7 @@ class _MyContactListPageState extends State<MyContactListPage> { | ||
| 575 | fontSize: ScreenUtil().setSp(20), | 588 | fontSize: ScreenUtil().setSp(20), |
| 576 | ), | 589 | ), |
| 577 | ), | 590 | ), |
| 591 | + HEmptyView(140), | ||
| 578 | ], | 592 | ], |
| 579 | )) | 593 | )) |
| 580 | ], | 594 | ], |
| @@ -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) { |
| @@ -375,9 +375,20 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | @@ -375,9 +375,20 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | ||
| 375 | flatBtn(customerProvider.guestInfoSunModel.guest.label, | 375 | flatBtn(customerProvider.guestInfoSunModel.guest.label, |
| 376 | MyColours.color_B39437), | 376 | MyColours.color_B39437), |
| 377 | if (customerProvider.guestInfoSunModel.guest.isMember == | 377 | if (customerProvider.guestInfoSunModel.guest.isMember == |
| 378 | - '1') | ||
| 379 | - flatBtn('会员', MyColours.color_438E93), | ||
| 380 | - if (true) flatBtn('存酒14天', MyColours.color_438E93) | 378 | + '1' || |
| 379 | + customerProvider.guestInfoSunModel.guest.isMember == | ||
| 380 | + '0') | ||
| 381 | + flatBtn( | ||
| 382 | + customerProvider.guestInfoSunModel.guest.isMember == | ||
| 383 | + '1' | ||
| 384 | + ? '会员' | ||
| 385 | + : '非会员', | ||
| 386 | + MyColours.color_438E93), | ||
| 387 | + if ('${customerProvider.guestInfoSunModel.store.storeDay}' != | ||
| 388 | + '0') | ||
| 389 | + flatBtn( | ||
| 390 | + '存酒${customerProvider.guestInfoSunModel.store.storeDay}天', | ||
| 391 | + MyColours.color_438E93) | ||
| 381 | ], | 392 | ], |
| 382 | ), | 393 | ), |
| 383 | VEmptyView(20), | 394 | VEmptyView(20), |
| @@ -499,9 +510,13 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | @@ -499,9 +510,13 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | ||
| 499 | color: MyColours.color_515151), | 510 | color: MyColours.color_515151), |
| 500 | ), | 511 | ), |
| 501 | Text( | 512 | Text( |
| 502 | - customerProvider.guestInfoSunModel.last.conAmount == null | 513 | + customerProvider.guestInfoSunModel.last.conAmount == |
| 514 | + null || | ||
| 515 | + customerProvider | ||
| 516 | + .guestInfoSunModel.last.conAmount == | ||
| 517 | + 0 | ||
| 503 | ? '未记录' | 518 | ? '未记录' |
| 504 | - : customerProvider.guestInfoSunModel.last.conAmount, | 519 | + : '${customerProvider.guestInfoSunModel.last.conAmount}', |
| 505 | style: TextStyle( | 520 | style: TextStyle( |
| 506 | fontSize: ScreenUtil().setSp(20), | 521 | fontSize: ScreenUtil().setSp(20), |
| 507 | color: MyColours.color_438E93), | 522 | 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 | - |
| @@ -487,7 +487,7 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -487,7 +487,7 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 487 | // ), | 487 | // ), |
| 488 | decoration: BoxDecoration( | 488 | decoration: BoxDecoration( |
| 489 | color: model.attr != null && model.attr != '' | 489 | color: model.attr != null && model.attr != '' |
| 490 | - ?model.attr == '沉睡' | 490 | + ? model.attr == '沉睡' |
| 491 | ? MyColours.color_999999 | 491 | ? MyColours.color_999999 |
| 492 | : model.attr == '活跃' | 492 | : model.attr == '活跃' |
| 493 | ? MyColours.color_00715F | 493 | ? MyColours.color_00715F |
| @@ -512,9 +512,12 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -512,9 +512,12 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 512 | : SizedBox(), | 512 | : SizedBox(), |
| 513 | model.isMember == '1' | 513 | model.isMember == '1' |
| 514 | ? flatBtn('会员', MyColours.color_438E93) | 514 | ? flatBtn('会员', MyColours.color_438E93) |
| 515 | - : SizedBox(), | ||
| 516 | - true | ||
| 517 | - ? flatBtn('存酒14天', MyColours.color_438E93) | 515 | + : model.isMember == '0' |
| 516 | + ? flatBtn('非会员', MyColours.color_438E93) | ||
| 517 | + : SizedBox(), | ||
| 518 | + '${model.storeDay}' != '0' | ||
| 519 | + ? flatBtn('存酒${model.storeDay}天', | ||
| 520 | + MyColours.color_438E93) | ||
| 518 | : SizedBox() | 521 | : SizedBox() |
| 519 | ], | 522 | ], |
| 520 | )), | 523 | )), |
| @@ -538,6 +541,19 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -538,6 +541,19 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 538 | fontSize: ScreenUtil().setSp(20), | 541 | fontSize: ScreenUtil().setSp(20), |
| 539 | ), | 542 | ), |
| 540 | ), | 543 | ), |
| 544 | + if (model.conAmount != null && | ||
| 545 | + '${model.conAmount}' != '0') | ||
| 546 | + HEmptyView(10), | ||
| 547 | + if (model.conAmount != null && | ||
| 548 | + '${model.conAmount}' != '0') | ||
| 549 | + Text( | ||
| 550 | + '消费${model.conAmount}', | ||
| 551 | + style: TextStyle( | ||
| 552 | + color: MyColours.color_515151, | ||
| 553 | + fontSize: ScreenUtil().setSp(20), | ||
| 554 | + ), | ||
| 555 | + ), | ||
| 556 | + Spacer(), | ||
| 541 | model.monthCount == '0' || model.monthCount == null | 557 | model.monthCount == '0' || model.monthCount == null |
| 542 | ? SizedBox() | 558 | ? SizedBox() |
| 543 | : HEmptyView(10), | 559 | : HEmptyView(10), |
| @@ -558,6 +574,7 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -558,6 +574,7 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 558 | fontSize: ScreenUtil().setSp(20), | 574 | fontSize: ScreenUtil().setSp(20), |
| 559 | ), | 575 | ), |
| 560 | ), | 576 | ), |
| 577 | + HEmptyView(140), | ||
| 561 | ], | 578 | ], |
| 562 | )) | 579 | )) |
| 563 | ], | 580 | ], |
| @@ -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( |
| @@ -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 | + 'id': 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, |
| @@ -397,7 +397,9 @@ var handleInvicationHandler = new Handler( | @@ -397,7 +397,9 @@ var handleInvicationHandler = new Handler( | ||
| 397 | return ChangeNotifierProvider<RemarkManagerModel>( | 397 | return ChangeNotifierProvider<RemarkManagerModel>( |
| 398 | create: (_) => RemarkManagerModel(), | 398 | create: (_) => RemarkManagerModel(), |
| 399 | child: ChangeNotifierProvider<BaseIndoProvider>( | 399 | child: ChangeNotifierProvider<BaseIndoProvider>( |
| 400 | - create: (_) => BaseIndoProvider(), child: InvicationPage(rid))); | 400 | + create: (_) => BaseIndoProvider(), |
| 401 | + child: ChangeNotifierProvider<CustomerProvider>( | ||
| 402 | + create: (_) => CustomerProvider(), child: InvicationPage(rid)))); | ||
| 401 | }); | 403 | }); |
| 402 | 404 | ||
| 403 | // 发短信 | 405 | // 发短信 |
| @@ -2427,7 +2429,10 @@ var createStoreWinePageHandle = new Handler( | @@ -2427,7 +2429,10 @@ var createStoreWinePageHandle = new Handler( | ||
| 2427 | return ChangeNotifierProvider<StoreWineProvider>( | 2429 | return ChangeNotifierProvider<StoreWineProvider>( |
| 2428 | create: (_) => StoreWineProvider(), | 2430 | create: (_) => StoreWineProvider(), |
| 2429 | child: ChangeNotifierProvider<UploadImageProvider>( | 2431 | child: ChangeNotifierProvider<UploadImageProvider>( |
| 2430 | - create: (_) => UploadImageProvider(), child: CreateStoreWinePage())); | 2432 | + create: (_) => UploadImageProvider(), |
| 2433 | + child: ChangeNotifierProvider<CustomerProvider>( | ||
| 2434 | + create: (_) => CustomerProvider(), | ||
| 2435 | + child: CreateStoreWinePage()))); | ||
| 2431 | }); | 2436 | }); |
| 2432 | 2437 | ||
| 2433 | ///我的----存酒详情 | 2438 | ///我的----存酒详情 |
| @@ -2439,7 +2444,9 @@ var wineDetailPageHandle = new Handler( | @@ -2439,7 +2444,9 @@ var wineDetailPageHandle = new Handler( | ||
| 2439 | 2444 | ||
| 2440 | return ChangeNotifierProvider<StoreWineProvider>( | 2445 | return ChangeNotifierProvider<StoreWineProvider>( |
| 2441 | create: (_) => StoreWineProvider(), | 2446 | create: (_) => StoreWineProvider(), |
| 2442 | - child: WineDetailPage(idstr: idstr, isStoreWine: isStoreWine)); | 2447 | + child: ChangeNotifierProvider<CustomerProvider>( |
| 2448 | + create: (_) => CustomerProvider(), | ||
| 2449 | + child: WineDetailPage(idstr: idstr, isStoreWine: isStoreWine))); | ||
| 2443 | }); | 2450 | }); |
| 2444 | 2451 | ||
| 2445 | ///我的----存酒记录 | 2452 | ///我的----存酒记录 |
| @@ -2449,7 +2456,9 @@ var outStoreRecordPageHandle = new Handler( | @@ -2449,7 +2456,9 @@ var outStoreRecordPageHandle = new Handler( | ||
| 2449 | 2456 | ||
| 2450 | return ChangeNotifierProvider<StoreWineProvider>( | 2457 | return ChangeNotifierProvider<StoreWineProvider>( |
| 2451 | create: (_) => StoreWineProvider(), | 2458 | create: (_) => StoreWineProvider(), |
| 2452 | - child: OutStoreRecordPage(wid: idstr)); | 2459 | + child: ChangeNotifierProvider<CustomerProvider>( |
| 2460 | + create: (_) => CustomerProvider(), | ||
| 2461 | + child: OutStoreRecordPage(wid: idstr))); | ||
| 2453 | }); | 2462 | }); |
| 2454 | 2463 | ||
| 2455 | ///我的----申请出库 | 2464 | ///我的----申请出库 |
| @@ -2460,7 +2469,9 @@ var applyOutStorePageHandle = new Handler( | @@ -2460,7 +2469,9 @@ var applyOutStorePageHandle = new Handler( | ||
| 2460 | 2469 | ||
| 2461 | return ChangeNotifierProvider<StoreWineProvider>( | 2470 | return ChangeNotifierProvider<StoreWineProvider>( |
| 2462 | create: (_) => StoreWineProvider(), | 2471 | create: (_) => StoreWineProvider(), |
| 2463 | - child: ApplyOutStorePage(wineManageDetail: wineManageDetail)); | 2472 | + child: ChangeNotifierProvider<CustomerProvider>( |
| 2473 | + create: (_) => CustomerProvider(), | ||
| 2474 | + child: ApplyOutStorePage(wineManageDetail: wineManageDetail))); | ||
| 2464 | }); | 2475 | }); |
| 2465 | 2476 | ||
| 2466 | ///我的----申请出库短信验证输入 | 2477 | ///我的----申请出库短信验证输入 |
| @@ -2483,8 +2494,10 @@ var outStoreRecordDetailPageHandle = new Handler( | @@ -2483,8 +2494,10 @@ var outStoreRecordDetailPageHandle = new Handler( | ||
| 2483 | 2494 | ||
| 2484 | return ChangeNotifierProvider<StoreWineProvider>( | 2495 | return ChangeNotifierProvider<StoreWineProvider>( |
| 2485 | create: (_) => StoreWineProvider(), | 2496 | create: (_) => StoreWineProvider(), |
| 2486 | - child: OutStoreRecordDetailPage( | ||
| 2487 | - outWineRecordSunModel: outWineRecordSunModel)); | 2497 | + child: ChangeNotifierProvider<CustomerProvider>( |
| 2498 | + create: (_) => CustomerProvider(), | ||
| 2499 | + child: OutStoreRecordDetailPage( | ||
| 2500 | + outWineRecordSunModel: outWineRecordSunModel))); | ||
| 2488 | }); | 2501 | }); |
| 2489 | 2502 | ||
| 2490 | ///充值优惠-首页 | 2503 | ///充值优惠-首页 |
-
Please register or login to post a comment