|
...
|
...
|
@@ -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();
|
|
|
|
},
|
|
|
|
),
|
...
|
...
|
|