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 {
@JsonKey(name: 'is_member')
String isMember;
@JsonKey(name: 'con_amount')
dynamic conAmount;
@JsonKey(name: 'store_day')
dynamic storeDay;
bool select = false;
String pinyin;
... ... @@ -110,7 +116,9 @@ class CustomerBySellerSunModel extends Object with ISuspensionBean {
this.nickName,
this.gid,
this.label,
this.isMember);
this.isMember,
this.conAmount,
this.storeDay);
factory CustomerBySellerSunModel.fromJson(Map<String, dynamic> srcJson) =>
_$CustomerBySellerSunModelFromJson(srcJson);
... ...
... ... @@ -44,6 +44,8 @@ CustomerBySellerSunModel _$CustomerBySellerSunModelFromJson(
json['gid'] as String,
json['label'] as String,
json['is_member'] as String,
json['con_amount'] as dynamic,
json['store_day'] as dynamic,
);
}
... ... @@ -63,5 +65,7 @@ Map<String, dynamic> _$CustomerBySellerSunModelToJson(
'nick_name': instance.nickName,
'gid': instance.gid,
'label': instance.label,
'is_member': instance.isMember
'is_member': instance.isMember,
'con_amount': instance.conAmount,
'store_day': instance.storeDay,
};
... ...
... ... @@ -89,6 +89,14 @@ class CustomerListSunModel extends Object with ISuspensionBean {
String gid;
@JsonKey(name: 'is_member')
String isMember;
@JsonKey(name: 'con_amount')
dynamic conAmount;
@JsonKey(name: 'store_day')
dynamic storeDay;
bool select = false;
... ... @@ -143,7 +151,9 @@ class CustomerListSunModel extends Object with ISuspensionBean {
this.label,
this.nickName,
this.gid,
this.isMember
this.isMember,
this.conAmount,
this.storeDay
);
factory CustomerListSunModel.fromJson(Map<String, dynamic> srcJson) =>
... ...
... ... @@ -51,6 +51,8 @@ CustomerListSunModel _$CustomerListSunModelFromJson(Map<String, dynamic> json) {
json['nick_name'] as String,
json['gid'] as String,
json['is_member'] as String,
json['con_amount'] as dynamic,
json['store_day'] as dynamic,
);
}
... ... @@ -80,5 +82,7 @@ Map<String, dynamic> _$CustomerListSunModelToJson(
'label': instance.label,
'nick_name': instance.nickName,
'gid': instance.gid,
'is_member':instance.isMember
'is_member': instance.isMember,
'con_amount': instance.conAmount,
'store_day': instance.storeDay
};
... ...
... ... @@ -42,12 +42,11 @@ class GuestInfoSunModel extends Object {
@JsonKey(name: 'marketing')
List<Marketing> marketing;
@JsonKey(name: 'store')
Store store;
GuestInfoSunModel(
this.guest,
this.last,
this.count,
this.marketing,
);
this.guest, this.last, this.count, this.marketing, this.store);
factory GuestInfoSunModel.fromJson(Map<String, dynamic> srcJson) =>
_$GuestInfoSunModelFromJson(srcJson);
... ... @@ -204,7 +203,7 @@ class Last extends Object {
@JsonKey(name: 'actual_pum')
String actualPum;
@JsonKey(name: 'con_amount')
String conAmount;
dynamic conAmount;
@JsonKey(name: 'account')
String account;
... ... @@ -283,6 +282,21 @@ class Count extends Object {
}
@JsonSerializable()
class Store extends Object {
@JsonKey(name: 'store_day')
dynamic storeDay;
Store(
this.storeDay,
);
factory Store.fromJson(Map<String, dynamic> srcJson) =>
_$StoreFromJson(srcJson);
Map<String, dynamic> toJson() => _$StoreToJson(this);
}
@JsonSerializable()
class Marketing extends Object {
@JsonKey(name: 'id')
String id;
... ...
... ... @@ -38,6 +38,9 @@ GuestInfoSunModel _$GuestInfoSunModelFromJson(Map<String, dynamic> json) {
?.map((e) =>
e == null ? null : Marketing.fromJson(e as Map<String, dynamic>))
?.toList(),
json['store'] == null
? null
: Store.fromJson(json['store'] as Map<String, dynamic>),
);
}
... ... @@ -47,6 +50,7 @@ Map<String, dynamic> _$GuestInfoSunModelToJson(GuestInfoSunModel instance) =>
'last': instance.last,
'count': instance.count,
'marketing': instance.marketing,
'store': instance.store
};
Guest _$GuestFromJson(Map<String, dynamic> json) {
... ... @@ -122,7 +126,7 @@ Last _$LastFromJson(Map<String, dynamic> json) {
json['seller_user_nick_name'] as String,
json['seller_user_phone'] as String,
json['actual_pum'] as String,
json['con_amount'] as String,
json['con_amount'] as dynamic,
json['account'] as String);
}
... ... @@ -153,6 +157,16 @@ Map<String, dynamic> _$CountToJson(Count instance) => <String, dynamic>{
'create_time': instance.createTime,
};
Store _$StoreFromJson(Map<String, dynamic> json) {
return Store(
json['store_day'] as dynamic,
);
}
Map<String, dynamic> _$StoreToJson(Store instance) => <String, dynamic>{
'store_day': instance.storeDay,
};
Marketing _$MarketingFromJson(Map<String, dynamic> json) {
return Marketing(
json['id'] as String,
... ...
... ... @@ -394,4 +394,10 @@ class HttpUrl {
// static const String send_vc_code =
// "?service=App.SendSMS.SendVcCode"; // 向指定手机号码发送验证码
static const String get_is_member_by_phone =
"?service=App.GuestManage.GetIsMemberByPhone"; // 获取手机号是否为商家会员
static const String ins_guest =
"?service=App.GuestManage.InsGuest"; // 新增客户
}
... ...
... ... @@ -164,10 +164,10 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
Navigator.of(context).pop();
},
rightImgName: 'scan.png',
onTapRight: () {
_scan();
},
// rightImgName: 'scan.png',
// onTapRight: () {
// _scan();
// },
),
body: WillPopScope(
onWillPop: () {
... ...
... ... @@ -43,6 +43,7 @@ import 'dart:ui' as ui;
import '../../app.dart';
import '../../provider/customer_provider.dart';
import '../../widgets/special_text/my_extended_text_selection_controls.dart';
class InvicationPage extends StatefulWidget {
... ... @@ -143,7 +144,8 @@ class InvicationPageState extends State<InvicationPage>
bool _showOverlay = false;
List<String> memberList = [];
String memberShow = '会员状态未知';
String isMember = '会员状态未知';
String memberid;
int memberIndex;
List<String> styleList = []; //餐单类型
... ... @@ -260,6 +262,7 @@ class InvicationPageState extends State<InvicationPage>
await _getCustomerActivityBaseinfo();
await _getReserveDetail(showCicle: false);
await _getTablesPhoto();
Map<String, String> params = {
"uid": Provider.of<UserModel>(context, listen: false).user.openid
... ... @@ -336,6 +339,34 @@ class InvicationPageState extends State<InvicationPage>
_timer = Timer.periodic(Duration(seconds: 1), call);
}
///获取手机号是否为商家会员
_getIsMemberByPhone(String phone) async {
CustomerProvider customerProvider =
Provider.of<CustomerProvider>(context, listen: false);
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
'phone': phone
};
Map temp = await customerProvider.getIsMemberByPhone(context, params);
if (temp == null) {
//会员状态未知
isMember = '会员状态未知';
memberIndex = null;
memberid = null;
} else if (temp['is_member'] == '1') {
//会员
isMember = '会员';
memberIndex = 0;
memberid = temp['id'];
} else {
//非会员
isMember = '非会员';
memberIndex = 1;
memberid = temp['id'];
}
setState(() {});
}
_showConfirmWidget(
{needBack = false,
needSex = false,
... ... @@ -893,6 +924,11 @@ class InvicationPageState extends State<InvicationPage>
ddateStr = detailEntity.ddateStr;
reserverPhone = detailEntity.phone;
_baseIndoProvider.phoneController.text = reserverPhone.replaceAll(' ', '');
if (_baseIndoProvider.phoneController.text.length > 0) {
//获取是否是会员
_getIsMemberByPhone(_baseIndoProvider.phoneController.text);
}
dateSolt = detailEntity.ddate_solt;
nameWidget = detailEntity.rname == null ||
detailEntity.rname == '' ||
... ... @@ -1806,6 +1842,7 @@ class InvicationPageState extends State<InvicationPage>
.sellerid,
};
_baseIndoProvider.getUserHistorys(context, params);
_getIsMemberByPhone(value);
},
onEditingComplete: () {
_phoneNode.unfocus();
... ... @@ -1939,6 +1976,13 @@ class InvicationPageState extends State<InvicationPage>
HEmptyView(40),
InkWell(
onTap: () {
if (_baseIndoProvider.phoneController.text
.trim()
.length ==
0) {
Utils.showToast('请先输入电话,再设置会员信息!');
return;
}
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
... ... @@ -1946,18 +1990,76 @@ class InvicationPageState extends State<InvicationPage>
context, memberList, (value) async {
if (value != null) {
memberIndex = value.first;
memberShow = memberList[memberIndex];
isMember = memberList[memberIndex];
setState(() {});
CustomerProvider customerProvider =
Provider.of<CustomerProvider>(context,
listen: false);
if (memberid != null &&
memberIndex != null) {
Map<String, String> pramas = {
'id': memberid,
'is_member':
memberIndex == 0 ? '1' : '0'
};
if (nameStr != null &&
nameStr.trim().length > 0) {
pramas['rname'] = nameStr;
pramas['sex'] =
'${sexList.indexOf(sexStr) + 1}';
}
if (_baseIndoProvider.phoneController.text
.replaceAll(' ', '')
.length >
0) {
pramas['phone'] = _baseIndoProvider
.phoneController.text
.replaceAll(' ', '');
}
await customerProvider.setGuestInfo(
context, pramas);
} else {
Map<String, String> pramas = {
'sellerid': Provider.of<UserModel>(
context,
listen: false)
.user
.sellerid,
'uid': Provider.of<UserModel>(context,
listen: false)
.user
.openid,
'phone': _baseIndoProvider
.phoneController.text
.replaceAll(' ', '')
};
if (memberIndex != null) {
pramas['is_member'] =
memberIndex == 0 ? '1' : '0';
}
if (nameStr != null &&
nameStr.trim().length > 0) {
pramas['rname'] = nameStr;
pramas['sex'] =
'${sexList.indexOf(sexStr) + 1}';
}
await customerProvider.setInsGuest(
context, pramas);
}
}
}, selecteds: [memberIndex ?? 0])
.then((value) {});
},
child: Row(children: [
Text(
memberShow,
isMember,
style: TextStyle(
color: memberShow == '会员状态未知'
color: isMember == '会员状态未知'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
... ... @@ -1972,65 +2074,65 @@ class InvicationPageState extends State<InvicationPage>
))
: SizedBox(),
//餐单类型
enterMore
? Container(
margin: EdgeInsets.only(
// top: ScreenUtil().setWidth(40),
bottom: ScreenUtil().setWidth(40)),
height: ScreenUtil().setWidth(68),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(16)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(12)),
// color: Colors.red,
border: Border.all(
width: ScreenUtil().setWidth(2),
color: MyColours.color_DBDBDB)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'餐单类型',
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_353535),
),
InkWell(
onTap: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
DialogUtil.showSelectCusmanDialog(
context, styleList, (value) async {
if (value != null) {
styleIndex = value.first;
styleShow = styleList[styleIndex];
setState(() {});
}
}, selecteds: [styleIndex ?? 0])
.then((value) {});
},
child: Row(children: [
Text(
styleShow,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
),
),
Image.asset(Utils.getImgPath('quan_down_f'),
width: ScreenUtil().setWidth(28),
height: ScreenUtil().setWidth(28)),
]),
)
],
))
: SizedBox(),
// enterMore
// ? Container(
// margin: EdgeInsets.only(
// // top: ScreenUtil().setWidth(40),
// bottom: ScreenUtil().setWidth(40)),
// height: ScreenUtil().setWidth(68),
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(16)),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(12)),
// // color: Colors.red,
// border: Border.all(
// width: ScreenUtil().setWidth(2),
// color: MyColours.color_DBDBDB)),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text(
// '餐单类型',
// //输入文本的样式
// style: TextStyle(
// fontSize: ScreenUtil().setSp(28),
// color: MyColours.color_353535),
// ),
// InkWell(
// onTap: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //隐藏键盘
// DialogUtil.showSelectCusmanDialog(
// context, styleList, (value) async {
// if (value != null) {
// styleIndex = value.first;
// styleShow = styleList[styleIndex];
// setState(() {});
// }
// }, selecteds: [styleIndex ?? 0])
// .then((value) {});
// },
// child: Row(children: [
// Text(
// styleShow,
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28),
// ),
// ),
// Image.asset(Utils.getImgPath('quan_down_f'),
// width: ScreenUtil().setWidth(28),
// height: ScreenUtil().setWidth(28)),
// ]),
// )
// ],
// ))
// : SizedBox(),
//备注:
Column(
... ... @@ -2205,6 +2307,8 @@ class InvicationPageState extends State<InvicationPage>
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
_getIsMemberByPhone(_baseIndoProvider
.userHistorys[index].phone);
needHistory = true;
_showConfirmWidget(
needHistory: true, index: index);
... ... @@ -3193,6 +3297,7 @@ class InvicationPageState extends State<InvicationPage>
};
_baseIndoProvider.getUserHistorys(
context, params);
_getIsMemberByPhone(value);
},
onEditingComplete: () {
_phoneNode.unfocus();
... ... @@ -3566,6 +3671,7 @@ class InvicationPageState extends State<InvicationPage>
_addNameSuffix(fullName, sexStr);
});
_updateReserve();
_getIsMemberByPhone(_baseIndoProvider.phoneController.text);
// });
}
... ...
... ... @@ -173,7 +173,7 @@
// ///获取微信登录access_token
// _getAccessToken(String code) async {
// Response response = await DioUtil.getInstance().getDio().get(
// "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx85aa3cdd0f791e65&secret=87c9a23c2e6032b2da75af6b0efc5424&code=$code&grant_type=authorization_code");
// "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx85aa3cdd0f791e65&secret=90ba794b30d2fe388309149174874603&code=$code&grant_type=authorization_code");
// LogUtil.v("access_token:${response.toString()}");
// Map<String, dynamic> responseData = json.decode(response.data.toString());
// if (responseData["errcode"] != null) {
... ...
... ... @@ -80,8 +80,7 @@ class _MyContactListPageState extends State<MyContactListPage> {
horizontal: ScreenUtil().setWidth(30),
vertical: ScreenUtil().setWidth(10)),
// height: susItemHeight,
margin: EdgeInsets.only(
bottom: ScreenUtil().setWidth(10)),
margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)),
width: ScreenUtil().screenWidth,
color: MyColours.color_efefef,
alignment: Alignment.centerLeft,
... ... @@ -435,35 +434,40 @@ class _MyContactListPageState extends State<MyContactListPage> {
),
child: Row(
children: [
model.rnameStr != null && model.rnameStr != ''
? Row(
// crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
width: w(72),
child: Text(
model.rnameStr,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(36),
fontWeight: FontWeight.bold),
)),
HEmptyView(10),
Text(
model.sexStr != '' && model.sexStr != null
? '${model.sexStr}'
: '',
style: TextStyle(
Row(
// crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
width: w(72),
child: Text(
model.rnameStr != null && model.rnameStr != ''
? model.rnameStr
: '',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(20),
),
fontSize: ScreenUtil().setSp(36),
fontWeight: FontWeight.bold),
)),
HEmptyView(10),
Container(
width: w(26),
child: Text(
model.rnameStr != null &&
model.rnameStr != '' &&
model.sexStr != '' &&
model.sexStr != null
? '${model.sexStr}'
: '',
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(20),
),
HEmptyView(10),
],
)
: SizedBox(),
)),
HEmptyView(10),
],
),
Spacer(),
Container(
width: w(70),
... ... @@ -527,11 +531,12 @@ class _MyContactListPageState extends State<MyContactListPage> {
model.label != null
? flatBtn(model.label, MyColours.color_B39437)
: SizedBox(),
model.isMember == '1'
? flatBtn('会员', MyColours.color_438E93)
: SizedBox(),
true
? flatBtn('存酒14天', MyColours.color_438E93)
if (model.isMember == '1' || model.isMember == '0')
flatBtn(model.isMember == '1' ? '会员' : '非会员',
MyColours.color_438E93),
'${model.storeDay}' != '0'
? flatBtn('存酒${model.storeDay}天',
MyColours.color_438E93)
: SizedBox()
],
)),
... ... @@ -555,6 +560,19 @@ class _MyContactListPageState extends State<MyContactListPage> {
fontSize: ScreenUtil().setSp(20),
),
),
if (model.conAmount != null &&
'${model.conAmount}' != '0')
HEmptyView(10),
if (model.conAmount != null &&
'${model.conAmount}' != '0')
Text(
'消费${model.conAmount}',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(20),
),
),
Spacer(),
model.monthCount == '0' || model.monthCount == null
? SizedBox()
: HEmptyView(10),
... ... @@ -575,6 +593,7 @@ class _MyContactListPageState extends State<MyContactListPage> {
fontSize: ScreenUtil().setSp(20),
),
),
HEmptyView(140),
],
))
],
... ...
... ... @@ -54,6 +54,17 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> {
void initState() {
super.initState();
memberList = ['是', '否'];
memberShow = widget.guest.isMember == '1'
? '是'
: widget.guest.isMember == '0'
? '否'
: '会员状态未知';
memberIndex = memberShow == '是'
? 0
: memberShow == '否'
? 1
: null;
_initSexList();
nameFocus.addListener(() {
if (nameFocus.hasFocus) {
... ... @@ -155,6 +166,9 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> {
if (fwController.text.trim().length > 0) {
params['serve'] = fwController.text;
}
if (memberShow != '会员状态未知') {
params['is_member'] = memberShow == '是' ? '1' : '0';
}
bool sucess =
await customerProvider.setGuestInfo(context, params, showLoading: true);
if (sucess) {
... ... @@ -196,7 +210,7 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> {
if (name == nameController.text && nameController.text.endsWith(suffix)) {
return;
}
nameController.text = name + suffix ?? "";
nameController.text = name.trim() == '' || name == null ? '' : name + suffix ?? "";
}
//姓名后缀
... ...
... ... @@ -292,30 +292,33 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> {
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Row(
children: [
Container(
constraints: BoxConstraints(
maxWidth: ScreenUtil().setWidth(260)),
child: Text(
customerProvider.guestInfoSunModel.guest.rnameStr,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(36)),
)),
HEmptyView(10),
Container(
child: Text(
customerProvider.guestInfoSunModel.guest.sexStr != ''
? '${customerProvider.guestInfoSunModel.guest.sexStr}'
: '',
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(20),
),
)),
HEmptyView(6),
if (customerProvider.guestInfoSunModel.guest.rnameStr != '')
Container(
constraints: BoxConstraints(
maxWidth: ScreenUtil().setWidth(260)),
child: Text(
customerProvider.guestInfoSunModel.guest.rnameStr,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(36)),
)),
if (customerProvider.guestInfoSunModel.guest.rnameStr != '')
HEmptyView(10),
if (customerProvider.guestInfoSunModel.guest.rnameStr != '')
Container(
child: Text(
customerProvider.guestInfoSunModel.guest.sexStr != ''
? '${customerProvider.guestInfoSunModel.guest.sexStr}'
: '',
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(20),
),
)),
if (customerProvider.guestInfoSunModel.guest.rnameStr != '') HEmptyView(6),
Text(
customerProvider.guestInfoSunModel.guest.phone,
overflow: TextOverflow.ellipsis,
... ... @@ -375,9 +378,20 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> {
flatBtn(customerProvider.guestInfoSunModel.guest.label,
MyColours.color_B39437),
if (customerProvider.guestInfoSunModel.guest.isMember ==
'1')
flatBtn('会员', MyColours.color_438E93),
if (true) flatBtn('存酒14天', MyColours.color_438E93)
'1' ||
customerProvider.guestInfoSunModel.guest.isMember ==
'0')
flatBtn(
customerProvider.guestInfoSunModel.guest.isMember ==
'1'
? '会员'
: '非会员',
MyColours.color_438E93),
if ('${customerProvider.guestInfoSunModel.store.storeDay}' !=
'0')
flatBtn(
'存酒${customerProvider.guestInfoSunModel.store.storeDay}天',
MyColours.color_438E93)
],
),
VEmptyView(20),
... ... @@ -499,9 +513,13 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> {
color: MyColours.color_515151),
),
Text(
customerProvider.guestInfoSunModel.last.conAmount == null
customerProvider.guestInfoSunModel.last.conAmount ==
null ||
customerProvider
.guestInfoSunModel.last.conAmount ==
0
? '未记录'
: customerProvider.guestInfoSunModel.last.conAmount,
: '${customerProvider.guestInfoSunModel.last.conAmount}',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_438E93),
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
... ... @@ -171,7 +169,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
if (customerProvider.controller.text.trim().length > 0) {
params['keyword'] = customerProvider.controller.text; //搜索手机号/姓名
}
String labels = '';
String labels = '';
for (FilterBtnModel item in customerProvider.filterLabelList) {
if (item.select) {
if (item.title == '未标记客户') {
... ... @@ -337,7 +335,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
BorderRadius.circular(ScreenUtil().setWidth(40)),
color: MyColours.color_199095),
child: Text(
'已选[${customerProvider.labels}]${customerProvider.selectCustomer.length}位顾客,下发营销任务',
// '已选[${customerProvider.labels}]${customerProvider.selectCustomer.length}位顾客,下发营销任务',
'已选${customerProvider.selectCustomer.length}位顾客,创建营销计划',
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
... ... @@ -1531,4 +1530,3 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
)));
}
}
... ...
... ... @@ -419,35 +419,40 @@ class _ContactListPageState extends State<ContactListPage> {
),
child: Row(
children: [
model.rnameStr != null && model.rnameStr != ''
? Row(
// crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
width: w(72),
child: Text(
model.rnameStr,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(36),
fontWeight: FontWeight.bold),
)),
HEmptyView(10),
Text(
model.sexStr != '' && model.sexStr != null
? '${model.sexStr}'
: '',
style: TextStyle(
Row(
// crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
width: w(72),
child: Text(
model.rnameStr != null && model.rnameStr != ''
? model.rnameStr
: '',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(20),
),
fontSize: ScreenUtil().setSp(36),
fontWeight: FontWeight.bold),
)),
HEmptyView(10),
Container(
width: w(26),
child: Text(
model.rnameStr != null &&
model.rnameStr != '' &&
model.sexStr != '' &&
model.sexStr != null
? '${model.sexStr}'
: '',
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(20),
),
HEmptyView(10),
],
)
: SizedBox(),
)),
HEmptyView(10),
],
),
HEmptyView(74),
Container(
width: w(70),
... ... @@ -487,7 +492,7 @@ class _ContactListPageState extends State<ContactListPage> {
// ),
decoration: BoxDecoration(
color: model.attr != null && model.attr != ''
?model.attr == '沉睡'
? model.attr == '沉睡'
? MyColours.color_999999
: model.attr == '活跃'
? MyColours.color_00715F
... ... @@ -512,9 +517,12 @@ class _ContactListPageState extends State<ContactListPage> {
: SizedBox(),
model.isMember == '1'
? flatBtn('会员', MyColours.color_438E93)
: SizedBox(),
true
? flatBtn('存酒14天', MyColours.color_438E93)
: model.isMember == '0'
? flatBtn('非会员', MyColours.color_438E93)
: SizedBox(),
'${model.storeDay}' != '0'
? flatBtn('存酒${model.storeDay}天',
MyColours.color_438E93)
: SizedBox()
],
)),
... ... @@ -538,6 +546,19 @@ class _ContactListPageState extends State<ContactListPage> {
fontSize: ScreenUtil().setSp(20),
),
),
if (model.conAmount != null &&
'${model.conAmount}' != '0')
HEmptyView(10),
if (model.conAmount != null &&
'${model.conAmount}' != '0')
Text(
'消费${model.conAmount}',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(20),
),
),
Spacer(),
model.monthCount == '0' || model.monthCount == null
? SizedBox()
: HEmptyView(10),
... ... @@ -558,6 +579,7 @@ class _ContactListPageState extends State<ContactListPage> {
fontSize: ScreenUtil().setSp(20),
),
),
HEmptyView(140),
],
))
],
... ...
... ... @@ -56,6 +56,17 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> {
void initState() {
super.initState();
memberList = ['是', '否'];
memberShow = widget.guest.isMember == '1'
? '是'
: widget.guest.isMember == '0'
? '否'
: '会员状态未知';
memberIndex = memberShow == '是'
? 0
: memberShow == '否'
? 1
: null;
_initSexList();
nameFocus.addListener(() {
if (nameFocus.hasFocus) {
... ... @@ -169,6 +180,11 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> {
if (fwController.text.trim().length > 0) {
params['serve'] = fwController.text;
}
if (memberShow != '会员状态未知') {
params['is_member'] = memberShow == '是' ? '1' : '0';
}
bool sucess =
await customerProvider.setGuestInfo(context, params, showLoading: true);
if (sucess) {
... ...
... ... @@ -392,9 +392,18 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
flatBtn(customerProvider.guestInfoSunModel.guest.label,
MyColours.color_B39437),
if (customerProvider.guestInfoSunModel.guest.isMember ==
'1')
flatBtn('会员', MyColours.color_438E93),
if (true) flatBtn('存酒14天', MyColours.color_438E93)
'1' ||
customerProvider.guestInfoSunModel.guest.isMember ==
'0')
flatBtn(
customerProvider.guestInfoSunModel.guest.isMember ==
'1'
? '会员'
: '非会员',
MyColours.color_438E93),
if ('${customerProvider.guestInfoSunModel.store.storeDay}' !=
'0')
flatBtn('存酒14天', MyColours.color_438E93)
],
),
VEmptyView(20),
... ... @@ -516,9 +525,13 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
color: MyColours.color_515151),
),
Text(
customerProvider.guestInfoSunModel.last.conAmount == null
customerProvider.guestInfoSunModel.last.conAmount ==
null ||
customerProvider
.guestInfoSunModel.last.conAmount ==
0
? '未记录'
: customerProvider.guestInfoSunModel.last.conAmount,
: '${customerProvider.guestInfoSunModel.last.conAmount}',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_438E93),
... ...
... ... @@ -420,7 +420,8 @@ class _CustomerListPageState extends State<CustomerListPage>
BorderRadius.circular(ScreenUtil().setWidth(40)),
color: MyColours.color_199095),
child: Text(
'已选[${customerProvider.labels}]${customerProvider.selectCustomerSeller.length}位顾客,下发营销任务',
// '已选[${customerProvider.labels}]${customerProvider.selectCustomerSeller.length}位顾客,下发营销任务',
'已选${customerProvider.selectCustomerSeller.length}位顾客,创建营销计划',
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
... ...
... ... @@ -273,102 +273,102 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
spacing: ScreenUtil().setWidth(20),
runSpacing: ScreenUtil().setWidth(10),
children: _buildLabelItem(customerProvider.labelList)),
VEmptyView(34),
MyDivider(
double.infinity,
w(1),
color: MyColours.color_DBDBDB,
),
VEmptyView(52),
InkWell(
onTap: () {
setState(() {
swichSync = !swichSync;
});
// _sellerGuestSet();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('是否与会员系统同步',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32))),
Image.asset(
swichSync
? Utils.getImgPath('f_swich_on')
: Utils.getImgPath('f_swich_off'),
width: ScreenUtil().setWidth(70),
// height: ScreenUtil().setWidth(82),
),
],
),
),
VEmptyView(48),
InkWell(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
// DialogUtil.showSelectCusmanDialog(context, memberList,
// (value) {
// if (value != null) {
// setState(() {
// memberIndex = value.first;
// memberShow = memberList[memberIndex];
// });
// }
// }, selecteds: memberIndex == null ? [] : [memberIndex])
// .then((value) {});
},
child: Container(
// height: ScreenUtil().setWidth(60),
padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(50)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
// color: Colors.red,
width: ScreenUtil().setWidth(150),
height: ScreenUtil().setWidth(35),
child: Text(
'会员系统选择',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151),
),
),
Expanded(
child: Text(
memberShow,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(28),
),
)),
HEmptyView(10),
Image.asset(
Utils.getImgPath(
showLabel ? 'c_arrow_up' : 'c_arrow_down'),
width: ScreenUtil().setWidth(24),
// height: ScreenUtil().setWidth(10),
)
],
),
)),
_itemWidget('企业代码或账号', "点击这里输入企业代码或账号", null, null),
VEmptyView(50),
_itemWidget('管理员账号', "点击这里输入管理员账号", null, null),
VEmptyView(50),
_itemWidget('密码', "点击这里输入管理员密码", null, null),
VEmptyView(40),
Center(
child: Text(
'请与纳极客服400-000-9690 联系对接事宜',
style: TextStyle(
color: MyColours.color_999999, fontSize: font(12)),
))
// VEmptyView(34),
// MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_DBDBDB,
// ),
// VEmptyView(52),
// InkWell(
// onTap: () {
// setState(() {
// swichSync = !swichSync;
// });
// // _sellerGuestSet();
// },
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text('是否与会员系统同步',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(32))),
// Image.asset(
// swichSync
// ? Utils.getImgPath('f_swich_on')
// : Utils.getImgPath('f_swich_off'),
// width: ScreenUtil().setWidth(70),
// // height: ScreenUtil().setWidth(82),
// ),
// ],
// ),
// ),
// VEmptyView(48),
// InkWell(
// onTap: () {
// FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
// // DialogUtil.showSelectCusmanDialog(context, memberList,
// // (value) {
// // if (value != null) {
// // setState(() {
// // memberIndex = value.first;
// // memberShow = memberList[memberIndex];
// // });
// // }
// // }, selecteds: memberIndex == null ? [] : [memberIndex])
// // .then((value) {});
// },
// child: Container(
// // height: ScreenUtil().setWidth(60),
// padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(50)),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Container(
// // color: Colors.red,
// width: ScreenUtil().setWidth(150),
// height: ScreenUtil().setWidth(35),
// child: Text(
// '会员系统选择',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_515151),
// ),
// ),
// Expanded(
// child: Text(
// memberShow,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// color: MyColours.color_353535,
// fontSize: ScreenUtil().setSp(28),
// ),
// )),
// HEmptyView(10),
// Image.asset(
// Utils.getImgPath(
// showLabel ? 'c_arrow_up' : 'c_arrow_down'),
// width: ScreenUtil().setWidth(24),
// // height: ScreenUtil().setWidth(10),
// )
// ],
// ),
// )),
// _itemWidget('企业代码或账号', "点击这里输入企业代码或账号", null, null),
// VEmptyView(50),
// _itemWidget('管理员账号', "点击这里输入管理员账号", null, null),
// VEmptyView(50),
// _itemWidget('密码', "点击这里输入管理员密码", null, null),
// VEmptyView(40),
// Center(
// child: Text(
// '请与纳极客服400-000-9690 联系对接事宜',
// style: TextStyle(
// color: MyColours.color_999999, fontSize: font(12)),
// ))
],
),
),
... ...
... ... @@ -107,41 +107,41 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
child: SingleChildScrollView(
child: Column(
children: [
InkWell(
onTap: () {
NavigatorUtil.goRechargeHomePage(context);
},
child: Padding(
padding: EdgeInsets.only(
left: w(16),
top: w(12),
bottom: w(12),
right: w(12)),
child: Row(
children: [
Text(
'会员充值优惠活动',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
Spacer(),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(7), vertical: w(4)),
child: Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(18),
height: ScreenUtil().setWidth(32),
),
)
],
))),
Padding(
padding: EdgeInsets.only(left: w(16)),
child: MyDivider(double.infinity, w(0.5),
color: MyColours.color_E7E7E7)),
VEmptyView(24),
// InkWell(
// onTap: () {
// NavigatorUtil.goRechargeHomePage(context);
// },
// child: Padding(
// padding: EdgeInsets.only(
// left: w(16),
// top: w(12),
// bottom: w(12),
// right: w(12)),
// child: Row(
// children: [
// Text(
// '会员充值优惠活动',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setWidth(32)),
// ),
// Spacer(),
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: w(7), vertical: w(4)),
// child: Image.asset(
// "assets/arrow_right_new.png",
// width: ScreenUtil().setWidth(18),
// height: ScreenUtil().setWidth(32),
// ),
// )
// ],
// ))),
// Padding(
// padding: EdgeInsets.only(left: w(16)),
// child: MyDivider(double.infinity, w(0.5),
// color: MyColours.color_E7E7E7)),
// VEmptyView(24),
InkWell(
onTap: () {
setState(() {
... ...
... ... @@ -282,7 +282,7 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
// Response response = await DioUtil.getInstance().getDio().get(
// "https://xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode?sellerid=$sid&uid=$uid");
// Response response = await DioUtil.getInstance().getDio().get(
// "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx85aa3cdd0f791e65&secret=87c9a23c2e6032b2da75af6b0efc5424&code=$code&grant_type=authorization_code");
// "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx85aa3cdd0f791e65&secret=90ba794b30d2fe388309149174874603&code=$code&grant_type=authorization_code");
LogUtil.v("access_token:${response.toString()}");
Map<String, dynamic> responseData = json.decode(response.toString());
print(responseData);
... ...
... ... @@ -224,7 +224,7 @@
// // Response response = await DioUtil.getInstance().getDio().get(
// // "https://xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode?sellerid=$sid&uid=$uid");
// // Response response = await DioUtil.getInstance().getDio().get(
// // "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx85aa3cdd0f791e65&secret=87c9a23c2e6032b2da75af6b0efc5424&code=$code&grant_type=authorization_code");
// // "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx85aa3cdd0f791e65&secret=90ba794b30d2fe388309149174874603&code=$code&grant_type=authorization_code");
// LogUtil.v("access_token:${response.toString()}");
// Map<String, dynamic> responseData = json.decode(response.toString());
// print(responseData);
... ...
... ... @@ -4,7 +4,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
import '../../../models/wine_manage_model.dart';
import '../../../provider/customer_provider.dart';
import '../../../provider/store_wine_provider.dart';
import '../../../provider/user_model.dart';
import '../../../res/colors.dart';
import '../../../route/navigator_util.dart';
import '../../../utils/screen_util.dart';
... ... @@ -32,6 +34,7 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
StoreWineProvider storeWineProvider;
ScrollController _controller = ScrollController();
String isMember = '';
@override
void initState() {
... ... @@ -42,6 +45,29 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
element.wineNumC.text = element.wineStock; //出库数量初始化剩余库存量
element.checkAmount = element.wineStock; //出库数量初始化剩余库存量
});
_getIsMemberByPhone();
}
///获取手机号是否为商家会员
_getIsMemberByPhone() async {
CustomerProvider customerProvider =
Provider.of<CustomerProvider>(context, listen: false);
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
'phone': widget.wineManageDetail.phone
};
Map temp = await customerProvider.getIsMemberByPhone(context, params);
if (temp == null) {
//会员状态未知
isMember = '会员状态未知';
} else if (temp['is_member'] == '1') {
//会员
isMember = '会员';
} else {
//非会员
isMember = '非会员';
}
setState(() {});
}
Widget _textItemWidget(
... ... @@ -145,17 +171,9 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
width: w(100),
alignment: Alignment.centerRight,
child: Text(
// '会员状态未知',
widget.wineManageDetail.isMember ==
'1'
? '会员'
: '会员状态未知',
isMember,
style: TextStyle(
color: widget.wineManageDetail
.isMember !=
'1'
? MyColours.color_999999
: MyColours.color_515151,
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(32),
),
),
... ...
... ... @@ -11,6 +11,7 @@ import 'package:provider/provider.dart';
import '../../../app.dart';
import '../../../models/upload_img_model.dart';
import '../../../models/wine_manage_model.dart';
import '../../../provider/customer_provider.dart';
import '../../../provider/store_wine_provider.dart';
import '../../../provider/upload_img_provider.dart';
import '../../../provider/user_model.dart';
... ... @@ -51,8 +52,9 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
UploadImageProvider _uploadImageProvider;
List<String> memberList = [];
String memberShow = '会员状态未知';
String isMember = '会员状态未知';
int memberIndex;
String memberid;
@override
void initState() {
... ... @@ -97,6 +99,34 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
Utils.addZeroNumber(dateTime.day);
}
///获取手机号是否为商家会员
_getIsMemberByPhone() async {
CustomerProvider customerProvider =
Provider.of<CustomerProvider>(context, listen: false);
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
'phone': phoneC.text
};
Map temp = await customerProvider.getIsMemberByPhone(context, params);
if (temp == null) {
//会员状态未知
isMember = '会员状态未知';
memberIndex = null;
memberid = null;
} else if (temp['is_member'] == '1') {
//会员
isMember = '会员';
memberIndex = 0;
memberid = temp['id'];
} else {
//非会员
isMember = '非会员';
memberIndex = 1;
memberid = temp['id'];
}
setState(() {});
}
Widget _textFieldWidget(
String title, String hintText, TextEditingController controller) {
return Column(children: [
... ... @@ -158,6 +188,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
// .sellerid,
// };
// _baseIndoProvider.getUserHistorys(context, params);
_getIsMemberByPhone();
},
onEditingComplete: () {
// _phoneNode.unfocus();
... ... @@ -266,6 +297,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
// textAlignVertical:
// TextAlignVertical.center,
decoration: InputDecoration(
isCollapsed: true,
hintText: "点击输入",
hintStyle: TextStyle(
color: MyColours.color_999999,
... ... @@ -353,19 +385,31 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
context, memberList, (value) async {
if (value != null) {
memberIndex = value.first;
memberShow =
memberList[memberIndex];
isMember = memberList[memberIndex];
setState(() {});
// CustomerProvider customerProvider =
// Provider.of<CustomerProvider>(
// context,
// listen: false);
// if (memberid != null &&
// memberIndex != null) {
// await customerProvider
// .setGuestInfo(context, {
// 'id': memberid,
// 'is_member':
// memberIndex == 0 ? '1' : '0'
// });
// }
}
}, selecteds: [memberIndex ?? 0]).then(
(value) {});
},
child: Row(children: [
Text(
memberShow,
isMember,
style: TextStyle(
color: memberShow == '会员状态未知'
color: isMember == '会员状态未知'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32),
... ... @@ -488,6 +532,10 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
Utils.showToast('请输入客人姓名!');
return false;
}
if (isMember == '会员状态未知') {
Utils.showToast('请输入选择会员选项!');
return false;
}
if (dataWine.length == 0) {
Utils.showToast('请输入酒品信息!');
return false;
... ... @@ -561,7 +609,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
.openid,
'rname': nameC.text,
'sex': '${sexSelectIndex + 1}', //性别 1 男 2 女 3 公司
'is_member': null, //会员状态
'is_member': memberIndex == 0 ? '1' : '0', //会员状态
'phone': phoneC.text,
'wine': json.encode(data)
};
... ... @@ -572,6 +620,51 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
bool success = await storeWineProvider
.setStoreWineBySeller(context, pramas,
showLoading: true);
CustomerProvider customerProvider =
Provider.of<CustomerProvider>(context, listen: false);
if (memberid != null && memberIndex != null) {
Map<String, String> pramas = {
'id': memberid,
'is_member': memberIndex == 0 ? '1' : '0'
};
String phone;
if (nameC.text.trim().length > 0) {
pramas['rname'] = nameC.text;
pramas['sex'] = '${sexSelectIndex + 1}';
}
if (phoneC.text.replaceAll(' ', '').length > 0) {
phone = phoneC.text.replaceAll(' ', '');
pramas['phone'] = phone;
}
await customerProvider.setGuestInfo(context, pramas);
} else {
Map<String, String> pramas = {
'sellerid':
Provider.of<UserModel>(context, listen: false)
.user
.sellerid,
'uid': Provider.of<UserModel>(context, listen: false)
.user
.openid,
};
if (phoneC.text.replaceAll(' ', '').length > 0) {
pramas['phone'] = phoneC.text.replaceAll(' ', '');
}
if (memberIndex != null) {
pramas['is_member'] = memberIndex == 0 ? '1' : '0';
}
// if (nameC.text.trim().length > 0) {
// pramas['rname'] = nameC.text;
// pramas['sex'] = '${sexSelectIndex + 1}';
// }
await customerProvider.setInsGuest(context, pramas);
}
if (success) {
App.sp.setInt("wineSerialSub", wineSerialSub + 1);
//存酒成功,返回列表,并刷新
... ...
... ... @@ -8,7 +8,9 @@ import 'package:provider/provider.dart';
import '../../../constant/state.dart';
import '../../../models/wine_manage_model.dart';
import '../../../provider/customer_provider.dart';
import '../../../provider/store_wine_provider.dart';
import '../../../provider/user_model.dart';
import '../../../res/colors.dart';
import '../../../utils/screen_util.dart';
import '../../../widgets/MyDivider.dart';
... ... @@ -37,6 +39,7 @@ class _OutStoreRecordDetailPageState extends State<OutStoreRecordDetailPage> {
ScrollController _controller = ScrollController();
// List dataWine = [];
String isMember = '';
@override
void initState() {
... ... @@ -47,9 +50,32 @@ class _OutStoreRecordDetailPageState extends State<OutStoreRecordDetailPage> {
// dataWine.add(wineManageModel);
WidgetsBinding.instance.addPostFrameCallback((_) {
// _getStoreWineCheckByWid();
_getIsMemberByPhone();
});
}
///获取手机号是否为商家会员
_getIsMemberByPhone() async {
CustomerProvider customerProvider =
Provider.of<CustomerProvider>(context, listen: false);
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
'phone': widget.outWineRecordSunModel.phone
};
Map temp = await customerProvider.getIsMemberByPhone(context, params);
if (temp == null) {
//会员状态未知
isMember = '会员状态未知';
} else if (temp['is_member'] == '1') {
//会员
isMember = '会员';
} else {
//非会员
isMember = '非会员';
}
setState(() {});
}
///根据存酒ID获取取酒记录
// _getStoreWineCheckByWid() async {
... ... @@ -178,18 +204,9 @@ class _OutStoreRecordDetailPageState extends State<OutStoreRecordDetailPage> {
alignment: Alignment.centerRight,
child: Text(
// '会员状态未知',
widget.outWineRecordSunModel
.isMember ==
'1'
? '会员'
: '会员状态未知',
isMember,
style: TextStyle(
color: widget
.outWineRecordSunModel
.isMember !=
'1'
? MyColours.color_999999
: MyColours.color_515151,
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(32),
),
),
... ...
... ... @@ -8,7 +8,9 @@ import 'package:provider/provider.dart';
import '../../../constant/state.dart';
import '../../../models/wine_manage_model.dart';
import '../../../provider/customer_provider.dart';
import '../../../provider/store_wine_provider.dart';
import '../../../provider/user_model.dart';
import '../../../res/colors.dart';
import '../../../utils/screen_util.dart';
import '../../../widgets/MyDivider.dart';
... ... @@ -35,6 +37,7 @@ class _OutStoreRecordPageState extends State<OutStoreRecordPage> {
ScrollController _controller = ScrollController();
// List dataWine = [];
String isMember = '';
@override
void initState() {
... ... @@ -52,8 +55,33 @@ class _OutStoreRecordPageState extends State<OutStoreRecordPage> {
_getStoreWineCheckByWid() async {
Map<String, String> pramas = {'wid': widget.wid};
await storeWineProvider.getStoreWineCheckByWid(context, pramas,
showLoading: true);
bool success = await storeWineProvider
.getStoreWineCheckByWid(context, pramas, showLoading: true);
if (success) {
_getIsMemberByPhone();
}
}
///获取手机号是否为商家会员
_getIsMemberByPhone() async {
CustomerProvider customerProvider =
Provider.of<CustomerProvider>(context, listen: false);
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
'phone': storeWineProvider.outWineRecordData[0].phone
};
Map temp = await customerProvider.getIsMemberByPhone(context, params);
if (temp == null) {
//会员状态未知
isMember = '会员状态未知';
} else if (temp['is_member'] == '1') {
//会员
isMember = '会员';
} else {
//非会员
isMember = '非会员';
}
setState(() {});
}
Widget _textItemWidget(String title, String subTitle,
... ... @@ -176,12 +204,7 @@ class _OutStoreRecordPageState extends State<OutStoreRecordPage> {
alignment: Alignment.centerRight,
child: Text(
// '会员状态未知',
storeWineProvider
.outWineRecordData[0]
.isMember ==
'1'
? '会员'
: '会员状态未知',
isMember,
style: TextStyle(
color: storeWineProvider
.outWineRecordData[0]
... ...
... ... @@ -3,6 +3,8 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/pages/my/store_wine_manage/wine_detail_item_page.dart';
import 'package:one_key/provider/customer_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:provider/provider.dart';
... ... @@ -38,6 +40,7 @@ class _WineDetailPageState extends State<WineDetailPage> {
ScrollController _controller = ScrollController();
// List dataWine = [];
String isMember = '';
@override
void initState() {
... ... @@ -55,6 +58,31 @@ class _WineDetailPageState extends State<WineDetailPage> {
_getStoreWineById() async {
Map<String, String> params = {"id": widget.idstr};
bool success = await storeWineProvider.getStoreWineById(context, params);
if (success && storeWineProvider.pageStateDetail != PageState.Empty) {
_getIsMemberByPhone();
}
}
///获取手机号是否为商家会员
_getIsMemberByPhone() async {
CustomerProvider customerProvider =
Provider.of<CustomerProvider>(context, listen: false);
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
'phone': storeWineProvider.wineManageDetail.phone
};
Map temp = await customerProvider.getIsMemberByPhone(context, params);
if (temp == null) {
//会员状态未知
isMember = '会员状态未知';
} else if (temp['is_member'] == '1') {
//会员
isMember = '会员';
} else {
//非会员
isMember = '非会员';
}
setState(() {});
}
Widget _textItemWidget(
... ... @@ -174,15 +202,9 @@ class _WineDetailPageState extends State<WineDetailPage> {
alignment: Alignment.centerRight,
child: Text(
// ,
model.wineManageDetail.isMember == '1'
? '会员'
: '会员状态未知',
isMember,
style: TextStyle(
color: model.wineManageDetail
.isMember !=
'1'
? MyColours.color_999999
: MyColours.color_515151,
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(32),
),
),
... ...
... ... @@ -174,6 +174,60 @@ class CustomerProvider extends ChangeNotifier {
filterHydList.add(modelhyd4);
}
///新增客户
Future<bool> setInsGuest(BuildContext context, Map<String, String> params,
{isShowLoading = true}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.ins_guest,
data: params, showLoading: false)
.catchError((error) {
print(error.toString());
if (error is MyError) {
switch (error.type) {
}
}
return false;
});
if (baseResp.code == Constant.status_success) {
return true;
} else {
if (baseResp != null) {
Utils.showToast(baseResp.msg ?? "");
}
}
return false;
}
///客户经理获取所创建活动列表(选择优惠券)
Future<Map<String, dynamic>> getIsMemberByPhone(
BuildContext context, Map<String, String> params,
{isShowLoading = true}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.get_is_member_by_phone,
data: params, showLoading: false)
.catchError((error) {
print(error.toString());
if (error is MyError) {
switch (error.type) {
}
}
return null;
});
if (baseResp.code == Constant.status_success) {
if (baseResp.data is bool) {
//系统里没有这个手机号码,会员状态未知
} else {
return baseResp.data;
}
} else {
if (baseResp != null) {
Utils.showToast(baseResp.msg ?? "");
}
}
return null;
}
///客户经理获取所创建活动列表(选择优惠券)
Future<List<CouponSunModel>> getCustomerSelectActivityNew(
BuildContext context, Map<String, String> params,
... ...
... ... @@ -398,7 +398,9 @@ var handleInvicationHandler = new Handler(
return ChangeNotifierProvider<RemarkManagerModel>(
create: (_) => RemarkManagerModel(),
child: ChangeNotifierProvider<BaseIndoProvider>(
create: (_) => BaseIndoProvider(), child: InvicationPage(rid)));
create: (_) => BaseIndoProvider(),
child: ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(), child: InvicationPage(rid))));
});
// 发短信
... ... @@ -2428,7 +2430,10 @@ var createStoreWinePageHandle = new Handler(
return ChangeNotifierProvider<StoreWineProvider>(
create: (_) => StoreWineProvider(),
child: ChangeNotifierProvider<UploadImageProvider>(
create: (_) => UploadImageProvider(), child: CreateStoreWinePage()));
create: (_) => UploadImageProvider(),
child: ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(),
child: CreateStoreWinePage())));
});
///我的----存酒详情
... ... @@ -2440,7 +2445,9 @@ var wineDetailPageHandle = new Handler(
return ChangeNotifierProvider<StoreWineProvider>(
create: (_) => StoreWineProvider(),
child: WineDetailPage(idstr: idstr, isStoreWine: isStoreWine));
child: ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(),
child: WineDetailPage(idstr: idstr, isStoreWine: isStoreWine)));
});
///我的----存酒记录
... ... @@ -2450,7 +2457,9 @@ var outStoreRecordPageHandle = new Handler(
return ChangeNotifierProvider<StoreWineProvider>(
create: (_) => StoreWineProvider(),
child: OutStoreRecordPage(wid: idstr));
child: ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(),
child: OutStoreRecordPage(wid: idstr)));
});
///我的----申请出库
... ... @@ -2461,7 +2470,9 @@ var applyOutStorePageHandle = new Handler(
return ChangeNotifierProvider<StoreWineProvider>(
create: (_) => StoreWineProvider(),
child: ApplyOutStorePage(wineManageDetail: wineManageDetail));
child: ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(),
child: ApplyOutStorePage(wineManageDetail: wineManageDetail)));
});
///我的----申请出库短信验证输入
... ... @@ -2484,8 +2495,10 @@ var outStoreRecordDetailPageHandle = new Handler(
return ChangeNotifierProvider<StoreWineProvider>(
create: (_) => StoreWineProvider(),
child: OutStoreRecordDetailPage(
outWineRecordSunModel: outWineRecordSunModel));
child: ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(),
child: OutStoreRecordDetailPage(
outWineRecordSunModel: outWineRecordSunModel)));
});
///充值优惠-首页
... ...