Commit 263d6e0f56a4f4071d45fcecbd7578c9d201d296

Authored by weixin_45529955
1 parent 9addc90f

客情优质客户标记 (客情设置)

... ... @@ -20,19 +20,19 @@ if (flutterRoot == null) {
def flutterVersionCode = "561"
def flutterVersionCode = "562"
if (flutterVersionCode == null) {
flutterVersionCode = '561'
flutterVersionCode = '562'
}
def flutterVersionName = "5.6.1"
def flutterVersionName = "5.6.2"
if (flutterVersionName == null) {
flutterVersionName = '5.6.1'
flutterVersionName = '5.6.2'
}
... ...
class SellerGuestModel {
final int? ret;
final SellerGuestSunModel? data;
final String? msg;
const SellerGuestModel({this.ret, this.data, this.msg});
SellerGuestModel copyWith({int? ret, SellerGuestSunModel? data, String? msg}) {
SellerGuestModel copyWith(
{int? ret, SellerGuestSunModel? data, String? msg}) {
return SellerGuestModel(
ret: ret ?? this.ret, data: data ?? this.data, msg: msg ?? this.msg);
}
... ... @@ -57,28 +57,47 @@ class SellerGuestSunModel {
final dynamic birthdayNoticeDay;
final dynamic commemorationDay;
final dynamic commemorationNotice;
const SellerGuestSunModel(
{this.id,
this.sellerid,
this.isAdditional,
this.isEnterSelf,
this.birthdayAdvNotice,
this.birthdayAdvNoticeSms,
this.birthdayNotice,
this.birthdayNoticeDay,
this.commemorationDay,
this.commemorationNotice});
SellerGuestSunModel copyWith(
{String? id,
String? sellerid,
String? isAdditional,
String? isEnterSelf,
dynamic birthdayAdvNotice,
dynamic birthdayAdvNoticeSms,
dynamic birthdayNotice,
dynamic birthdayNoticeDay,
dynamic commemorationDay,
dynamic commemorationNotice}) {
final String? isHighFrequency;
final String? highFrequencyDay;
final String? highFrequencyReserve;
final String? isHighConsumption;
final String? isHighMoney;
const SellerGuestSunModel({
this.id,
this.sellerid,
this.isAdditional,
this.isEnterSelf,
this.birthdayAdvNotice,
this.birthdayAdvNoticeSms,
this.birthdayNotice,
this.birthdayNoticeDay,
this.commemorationDay,
this.commemorationNotice,
this.isHighFrequency,
this.highFrequencyDay,
this.highFrequencyReserve,
this.isHighConsumption,
this.isHighMoney,
});
SellerGuestSunModel copyWith({
String? id,
String? sellerid,
String? isAdditional,
String? isEnterSelf,
dynamic birthdayAdvNotice,
dynamic birthdayAdvNoticeSms,
dynamic birthdayNotice,
dynamic birthdayNoticeDay,
dynamic commemorationDay,
dynamic commemorationNotice,
String? isHighFrequency,
String? highFrequencyDay,
String? highFrequencyReserve,
String? isHighConsumption,
String? isHighMoney,
}) {
return SellerGuestSunModel(
id: id ?? this.id,
sellerid: sellerid ?? this.sellerid,
... ... @@ -89,10 +108,15 @@ class SellerGuestSunModel {
birthdayNotice: birthdayNotice ?? this.birthdayNotice,
birthdayNoticeDay: birthdayNoticeDay ?? this.birthdayNoticeDay,
commemorationDay: commemorationDay ?? this.commemorationDay,
commemorationNotice: commemorationNotice ?? this.commemorationNotice);
commemorationNotice: commemorationNotice ?? this.commemorationNotice,
isHighFrequency: isHighFrequency ?? this.isHighFrequency,
highFrequencyDay: highFrequencyDay ?? this.highFrequencyDay,
highFrequencyReserve: highFrequencyReserve ?? this.highFrequencyReserve,
isHighConsumption: isHighConsumption ?? this.isHighConsumption,
isHighMoney: isHighMoney ?? this.isHighMoney);
}
Map<String, dynamic?> toJson() {
Map<String, dynamic> toJson() {
return {
'id': id,
'sellerid': sellerid,
... ... @@ -103,26 +127,47 @@ class SellerGuestSunModel {
'birthday_notice': birthdayNotice,
'birthday_notice_day': birthdayNoticeDay,
'commemoration_day': commemorationDay,
'commemoration_notice': commemorationNotice
'commemoration_notice': commemorationNotice,
"is_high_frequency": isHighFrequency,
"high_frequency_day": highFrequencyDay,
"high_frequency_reserve": highFrequencyReserve,
"is_high_consumption": isHighConsumption,
"is_high_money": isHighMoney
};
}
static SellerGuestSunModel fromJson(Map<dynamic, dynamic> json) {
return SellerGuestSunModel(
id: json['id'] == null ? null : json['id'] as String?,
sellerid: json['sellerid'] == null ? null : json['sellerid'] as String?,
isAdditional: json['is_additional'] == null
? null
: json['is_additional'] as String?,
isEnterSelf: json['is_enter_self'] == null
? null
: json['is_enter_self'] as String?,
birthdayAdvNotice: json['birthday_adv_notice'] as dynamic,
birthdayAdvNoticeSms: json['birthday_adv_notice_sms'] as dynamic,
birthdayNotice: json['birthday_notice'] as dynamic,
birthdayNoticeDay: json['birthday_notice_day'] as dynamic,
commemorationDay: json['commemoration_day'] as dynamic,
commemorationNotice: json['commemoration_notice'] as dynamic);
id: json['id'] == null ? null : json['id'] as String?,
sellerid: json['sellerid'] == null ? null : json['sellerid'] as String?,
isAdditional: json['is_additional'] == null
? null
: json['is_additional'] as String?,
isEnterSelf: json['is_enter_self'] == null
? null
: json['is_enter_self'] as String?,
birthdayAdvNotice: json['birthday_adv_notice'] as dynamic,
birthdayAdvNoticeSms: json['birthday_adv_notice_sms'] as dynamic,
birthdayNotice: json['birthday_notice'] as dynamic,
birthdayNoticeDay: json['birthday_notice_day'] as dynamic,
commemorationDay: json['commemoration_day'] as dynamic,
commemorationNotice: json['commemoration_notice'] as dynamic,
isHighFrequency: json['is_high_frequency'] == null
? null
: json['is_high_frequency'] as String?,
highFrequencyDay: json['high_frequency_day'] == null
? null
: json['high_frequency_day'] as String?,
highFrequencyReserve: json['high_frequency_reserve'] == null
? null
: json['high_frequency_reserve'] as String?,
isHighConsumption: json['is_high_consumption'] == null
? null
: json['is_high_consumption'] as String?,
isHighMoney: json['is_high_money'] == null
? null
: json['is_high_money'] as String?,
);
}
@override
... ...
... ... @@ -154,7 +154,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage>
bool isback = false;
List<dynamic> couponTypes = ['仅预订人', '所有人', '被请客人', '不赠送']; //赠券对象
String couponType = '所有人';
String couponType = '';
@override
void initState() {
... ...
... ... @@ -38,6 +38,10 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
late MarketingCenterProvider marketingCenterProvider;
TextEditingController controllerDay = TextEditingController();
TextEditingController controllerDeadline = TextEditingController();
TextEditingController controllerConsumptionTimes = TextEditingController();
TextEditingController controllerHighValue = TextEditingController();
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) async {
... ... @@ -101,7 +105,12 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
Map<String, String?> params = {
"sellerid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
'is_additional': customerProvider.isrepair ? "1" : "0",
'is_enter_self': customerProvider.isselfphone ? '1' : '0'
'is_enter_self': customerProvider.isselfphone ? '1' : '0',
'is_high_frequency': customerProvider.isHighFrequency ? '1' : '0',
'high_frequency_day': controllerDeadline.text,
'high_frequency_reserve': controllerConsumptionTimes.text,
'is_high_consumption': customerProvider.isHighConsumption ? '1' : '0',
'is_high_money': controllerHighValue.text
};
bool success = await customerProvider.setSellerGuest(context, params,
showLoading: true);
... ... @@ -153,6 +162,14 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
///获取客情配置
_sellerGuestGet() async {
bool success = await customerProvider.getSellerGuest(context);
if (success) {
controllerDeadline.text =
customerProvider.sellerGuestData?.highFrequencyDay ?? '';
controllerConsumptionTimes.text =
customerProvider.sellerGuestData?.highFrequencyReserve ?? '';
controllerHighValue.text =
customerProvider.sellerGuestData?.isHighMoney ?? '';
}
// if (success) {
// customerProvider.isrepair = true;
... ... @@ -829,6 +846,311 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
color: MyColours.color_E7E7E7,
)),
VEmptyView(48),
Container(
padding: EdgeInsets.symmetric(vertical: w(8)),
child: Text('优质客户标记',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)))),
VEmptyView(22),
MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.isHighFrequency =
!customerProvider.isHighFrequency;
});
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('高频客户标记',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.isHighFrequency
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
),
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
Container(
padding:
EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),
child: Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.symmetric(vertical: w(8)),
child: Text('指定期限',
overflow: TextOverflow.ellipsis,
maxLines: 10,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))))),
HEmptyView(2),
Container(
width: w(40),
child: TextField(
controller: controllerDeadline,
textAlign: TextAlign.right,
textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
),
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.allow(
RegExp(r'[0-9]')), //设置只允许输入数字
],
decoration: InputDecoration(
isCollapsed: true,
border: OutlineInputBorder(
borderSide: BorderSide.none),
hintText: '输入',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.number),
),
HEmptyView(5),
Text('天',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28))),
// HEmptyView(24),
],
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
Container(
padding:
EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),
child: Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.symmetric(vertical: w(8)),
child: Text('消费次数',
overflow: TextOverflow.ellipsis,
maxLines: 10,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))))),
HEmptyView(2),
Container(
width: w(40),
child: TextField(
controller: controllerConsumptionTimes,
textAlign: TextAlign.right,
textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
),
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.allow(
RegExp(r'[0-9]')), //设置只允许输入数字
],
decoration: InputDecoration(
isCollapsed: true,
border: OutlineInputBorder(
borderSide: BorderSide.none),
hintText: '输入',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.number),
),
HEmptyView(5),
Text('次',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28))),
// HEmptyView(24),
],
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.isHighConsumption =
!customerProvider.isHighConsumption;
});
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('高消费客户标记',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.isHighConsumption
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
),
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
Container(
padding:
EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),
child: Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.symmetric(vertical: w(8)),
child: Text('客户人均消费到达设置金额标记为高单值',
overflow: TextOverflow.ellipsis,
maxLines: 10,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))))),
HEmptyView(2),
Container(
width: w(40),
child: TextField(
controller: controllerHighValue,
textAlign: TextAlign.right,
textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
),
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.allow(
RegExp("[0-9.]")),
],
decoration: InputDecoration(
isCollapsed: true,
border: OutlineInputBorder(
borderSide: BorderSide.none),
hintText: '输入',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.number),
),
HEmptyView(5),
Text('元',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28))),
// HEmptyView(24),
],
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
VEmptyView(48),
Text('店内自定义标签',
style: TextStyle(
color: MyColours.color_515151,
... ... @@ -872,6 +1194,24 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
textColor: MyColours.color_ffffff,
onPressed: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
//前置条件判断
if (customerProvider.isHighFrequency) {
if (controllerDeadline.text.trim().length == 0) {
Utils.showToast('请输入指定期限');
return;
}
if (controllerConsumptionTimes.text.trim().length == 0) {
Utils.showToast('请输入消费次数');
return;
}
}
if (customerProvider.isHighConsumption) {
if (controllerHighValue.text.trim().length == 0) {
Utils.showToast('请设置客户人均消费到达金额');
return;
}
}
_saveData();
},
),
... ...
... ... @@ -104,7 +104,7 @@ class CustomerProvider extends ChangeNotifier {
List<FilterBtnModel> filterHydList = []; //活跃度
List<FilterBtnModel> filterLabelList = []; //自定义标签
List<FilterBtnModel> filterDayList = []; //高级筛选---天数 7、30、60、120
List<FilterBtnModel> filterMoneyList = []; //0-100 100-200 200-300 300以上
List<FilterBtnModel> filterMoneyList = []; //0-100 100-200 200-300 300以上
bool hydSelAll = false;
bool labelSelAll = false;
bool manageSelAll = false;
... ... @@ -135,12 +135,14 @@ class CustomerProvider extends ChangeNotifier {
bool isSetOver = true;
bool isReserveOver = true;
bool isReserveCancel = true;
bool cancelOrderdayShopowner = true;
bool cancelOrderdayManager = true;
bool cancelOrderdayOther = true;
bool isHighFrequency = false; // 高频客户标记开关 1 开 0 关
bool isHighConsumption = false; // 高消费客户标记开关 1 开 0 关
List<MarketingSmsTemplateSunModel>? marketingSmsData = [];
List<GetReportFieldSunModel>? reportFieldModelData = []; //导出数据字段
... ... @@ -396,10 +398,7 @@ class CustomerProvider extends ChangeNotifier {
model3.select = false;
filterDayList.add(model3);
filterMoneyList = [];
filterMoneyList = [];
FilterBtnModel modelm = FilterBtnModel();
modelm.id = '0-100';
modelm.title = '0-100';
... ... @@ -421,16 +420,6 @@ class CustomerProvider extends ChangeNotifier {
model3m.select = false;
filterMoneyList.add(model3m);
filterHydList = [];
// FilterBtnModel modelhyd1 = FilterBtnModel();
// modelhyd1.id = '0';
... ... @@ -2263,12 +2252,13 @@ class CustomerProvider extends ChangeNotifier {
context, Method.post, HttpUrl.seller_guest_get,
data: params, showLoading: showLoading, selfDismiss: selfDismiss);
if (baseResp != null && baseResp.code == Constant.status_success) {
sellerGuestData =
SellerGuestModel.fromJson(baseResp.responseData!).data;
if (sellerGuestData != null) {
isrepair = sellerGuestData!.isAdditional == '1' ? true : false;
isselfphone = sellerGuestData!.isEnterSelf == '1' ? true : false;
isHighFrequency = sellerGuestData!.isHighFrequency == '1'?true:false;
isHighConsumption = sellerGuestData!.isHighConsumption == '1'?true:false;
pageStateBirthdaySetting = PageState.Success;
return true;
}
... ...