Commit 097c175797865dad6e356dda63e852e7d381605d

Authored by wdn127929
1 parent 889a13b3

部分接口

import 'package:json_annotation/json_annotation.dart';
part 'customer_label_model.g.dart';
@JsonSerializable()
class CustomerLabelModel extends Object {
@JsonKey(name: 'ret')
int ret;
@JsonKey(name: 'data')
List<CustomerLabelSunModel> data;
@JsonKey(name: 'msg')
String msg;
CustomerLabelModel(
this.ret,
this.data,
this.msg,
);
factory CustomerLabelModel.fromJson(Map<String, dynamic> srcJson) =>
_$CustomerLabelModelFromJson(srcJson);
Map<String, dynamic> toJson() => _$CustomerLabelModelToJson(this);
}
@JsonSerializable()
class CustomerLabelSunModel extends Object {
@JsonKey(name: 'id')
String id;
@JsonKey(name: 'sellerid')
String sellerid;
@JsonKey(name: 'label')
String label;
@JsonKey(name: 'cdate')
String cdate;
CustomerLabelSunModel(
this.id,
this.sellerid,
this.label,
this.cdate,
);
factory CustomerLabelSunModel.fromJson(Map<String, dynamic> srcJson) =>
_$CustomerLabelSunModelFromJson(srcJson);
Map<String, dynamic> toJson() => _$CustomerLabelSunModelToJson(this);
}
... ...
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'customer_label_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CustomerLabelModel _$CustomerLabelModelFromJson(Map<String, dynamic> json) {
return CustomerLabelModel(
json['ret'] as int,
(json['data'] as List)
?.map((e) => e == null
? null
: CustomerLabelSunModel.fromJson(e as Map<String, dynamic>))
?.toList(),
json['msg'] as String,
);
}
Map<String, dynamic> _$CustomerLabelModelToJson(CustomerLabelModel instance) =>
<String, dynamic>{
'ret': instance.ret,
'data': instance.data,
'msg': instance.msg,
};
CustomerLabelSunModel _$CustomerLabelSunModelFromJson(
Map<String, dynamic> json) {
return CustomerLabelSunModel(
json['id'] as String,
json['sellerid'] as String,
json['label'] as String,
json['cdate'] as String,
);
}
Map<String, dynamic> _$CustomerLabelSunModelToJson(
CustomerLabelSunModel instance) =>
<String, dynamic>{
'id': instance.id,
'sellerid': instance.sellerid,
'label': instance.label,
'cdate': instance.cdate,
};
... ...
... ... @@ -194,5 +194,11 @@ class HttpUrl {
"?service=App.GuestManage.GetMarketingById"; // 商家营销详情
static const String set_guest_info_cday =
"?service=App.GuestManage.SetGuestCday"; // 设置客户纪念日
static const String seller_guest_get =
"?service=App.GuestManage.SellerGuestGet"; // 获取商家客情设置
static const String get_label_by_sellerid =
"?service=App.GuestManage.GetLabelBySellerid"; // 获取商家标签
static const String set_label_by_sellerid =
"?service=App.GuestManage.SetLabelBySellerid"; // 商家修改标签
}
... ...
... ... @@ -193,6 +193,7 @@ class _ContactListPageState extends State<ContactListPage> {
children: [
model.rnameStr != null && model.rnameStr != ''
? Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
constraints: BoxConstraints(
... ... @@ -206,19 +207,26 @@ class _ContactListPageState extends State<ContactListPage> {
fontWeight: FontWeight.bold),
)),
HEmptyView(10),
Text(
model.sexStr != '' ? '[${model.sexStr}]' : '',
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(22),
),
),
Padding(
padding: EdgeInsets.only(
bottom: ScreenUtil().setWidth(4)),
child: Text(
model.sexStr != ''
? '[${model.sexStr}]'
: '',
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(22),
),
)),
HEmptyView(10),
],
)
: SizedBox(),
model.label != null
? Container(
padding: EdgeInsets.only(
bottom: ScreenUtil().setWidth(4)),
constraints: BoxConstraints(
maxWidth: ScreenUtil().setWidth(150)),
child: Text(
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/customer_label_model.dart';
import 'package:one_key/models/guest_info_model.dart';
import 'package:one_key/provider/customer_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/event_bus.dart';
... ... @@ -43,6 +45,7 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> {
CustomerProvider customerProvider;
String labelShow = '';
ScrollController scrollController = ScrollController();
@override
void initState() {
super.initState();
... ... @@ -80,9 +83,28 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> {
fwController.text = widget.guest.serve ?? '';
labelShow = widget.guest.label ?? '';
setState(() {});
_getLabelBySellerid();
// scrollController.jumpTo(scrollController.position.minScrollExtent);
});
}
///获取商家标签
_getLabelBySellerid() async {
Map<String, String> params = {
"sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
};
List<CustomerLabelSunModel> modelLabel =
await customerProvider.getLabelBySellerid(context, params);
if (modelLabel.length > 0) {
for (int i = 0; i < customerProvider.labelList.length; i++) {
if (labelShow == customerProvider.labelList[i].label) {
customerProvider.labelSelIndex = i;
}
}
}
}
_setGuestInfo() async {
if (nameStr.trim().length == 0) {
Utils.showToast('请填写客户姓名');
... ... @@ -115,7 +137,7 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> {
params['position'] = positionController.text;
}
if (labelShow != '') {
// params['label'] =
params['label'] = labelShow;
}
if (jkController.text.trim().length > 0) {
params['taboos'] = jkController.text;
... ... @@ -365,251 +387,260 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> {
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(50)),
child: SingleChildScrollView(
child: Column(
children: [
// VEmptyView(30),
Container(
// height: ScreenUtil().setWidth(60),
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(10)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color:
Color.fromRGBO(220, 220, 220, 1)))),
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(28),
color: MyColours.color_333333),
),
child: ListView(
controller: scrollController,
children: [
// VEmptyView(30),
Container(
// height: ScreenUtil().setWidth(60),
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(10)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color:
Color.fromRGBO(220, 220, 220, 1)))),
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(28),
color: MyColours.color_333333),
),
Expanded(
child: TextField(
maxLines: 1,
),
Expanded(
child: TextField(
maxLines: 1,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535),
controller: nameController,
focusNode: nameFocus,
// textAlignVertical: TextAlignVertical.top,
decoration: InputDecoration(
hintText: "填写姓名",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(30),
),
// contentPadding:
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
contentPadding: EdgeInsets.zero,
border: OutlineInputBorder(
borderSide: BorderSide.none),
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535),
controller: nameController,
focusNode: nameFocus,
// textAlignVertical: TextAlignVertical.top,
decoration: InputDecoration(
hintText: "填写姓名",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(30),
),
onChanged: (value) {
print('ggg');
if (value.endsWith('先生') ||
value.endsWith('女士') ||
value.endsWith('公司')) {
nameStr = value.substring(
0, value.length - 2);
} else {
nameStr = value;
}
},
onEditingComplete: () {
print('fff');
nameFocus.unfocus();
// _homeEnterModel.nameController.text =
// nameStr + _nameSuffix();
_addNameSuffix(nameStr, _nameSuffix());
},
keyboardType: TextInputType.text,
// contentPadding:
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
contentPadding: EdgeInsets.zero,
border: OutlineInputBorder(
borderSide: BorderSide.none),
),
onChanged: (value) {
print('ggg');
if (value.endsWith('先生') ||
value.endsWith('女士') ||
value.endsWith('公司')) {
nameStr =
value.substring(0, value.length - 2);
} else {
nameStr = value;
}
},
onEditingComplete: () {
print('fff');
nameFocus.unfocus();
// _homeEnterModel.nameController.text =
// nameStr + _nameSuffix();
_addNameSuffix(nameStr, _nameSuffix());
},
keyboardType: TextInputType.text,
),
// HEmptyView(40),
Row(
children: sexList.map((value) {
return _callButton(
onPress: () {
for (var item in sexList) {
item['select'] = false;
if (item['title'] == value['title']) {
item['select'] = true;
// _homeEnterModel.nameController.text =
// nameStr + item['title'];
if (nameStr != null &&
nameStr != '') {
_addNameSuffix(
nameStr, item['title']);
}
),
// HEmptyView(40),
Row(
children: sexList.map((value) {
return _callButton(
onPress: () {
for (var item in sexList) {
item['select'] = false;
if (item['title'] == value['title']) {
item['select'] = true;
// _homeEnterModel.nameController.text =
// nameStr + item['title'];
if (nameStr != null &&
nameStr != '') {
_addNameSuffix(
nameStr, item['title']);
}
}
setState(() {});
},
content: value['title'],
hasLeftBorder: value['hasLeftBorder'],
isSelect: value['select']);
}).toList()),
],
),
}
setState(() {});
},
content: value['title'],
hasLeftBorder: value['hasLeftBorder'],
isSelect: value['select']);
}).toList()),
],
),
_textfieldWidget(
'电话', '填写电话', phoneController, phoneFocus),
_textfieldWidget(
'工作单位', '填写工作单位', adressController, adressFocus),
_textfieldWidget('部门', '填写部门', departmentController,
departmentFocus),
_textfieldWidget(
'职位', '填写职位', positionController, positionFocus),
InkWell(
onTap: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
// DialogUtil.showSelectCusmanDialog(
// context, couponList, (value) {
// if (value != null) {
// setState(() {
// couponSelectIndex = value.first;
// });
// }
// },
// selecteds: couponSelectIndex == null
// ? []
// : [couponSelectIndex])
// .then((value) {});
),
_textfieldWidget(
'电话', '填写电话', phoneController, phoneFocus),
_textfieldWidget(
'工作单位', '填写工作单位', adressController, adressFocus),
_textfieldWidget('部门', '填写部门', departmentController,
departmentFocus),
_textfieldWidget(
'职位', '填写职位', positionController, positionFocus),
InkWell(
onTap: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
DialogUtil.showSelectCusmanDialog(
context,
customerProvider.labelList.map((item) {
return item.label;
}).toList(), (value) {
if (value != null) {
setState(() {
customerProvider.labelSelIndex =
value.first;
labelShow = customerProvider
.labelList[
customerProvider.labelSelIndex]
.label;
});
}
},
child: Container(
// height: ScreenUtil().setWidth(60),
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(50)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color: Color.fromRGBO(
220, 220, 220, 1)))),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
// color: Colors.red,
width: ScreenUtil().setWidth(150),
height: ScreenUtil().setWidth(35),
selecteds:
customerProvider.labelSelIndex == null
? []
: [
customerProvider.labelSelIndex
])
.then((value) {});
},
child: Container(
// height: ScreenUtil().setWidth(60),
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(50)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color: Color.fromRGBO(
220, 220, 220, 1)))),
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(28),
color: MyColours.color_333333),
),
),
Expanded(
child: Text(
'自定义标签',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_333333),
),
labelShow,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color.fromRGBO(193, 194, 63, 1),
fontSize: ScreenUtil().setSp(28),
),
Expanded(
)),
HEmptyView(10),
Image.asset(
Utils.getImgPath(showLabel
? 'c_arrow_up'
: 'c_arrow_down'),
width: ScreenUtil().setWidth(24),
// height: ScreenUtil().setWidth(10),
)
],
),
)),
widget.fromPage == FromPage.FromPageMyCustomer
? SizedBox()
: InkWell(
onTap: () {
// DialogUtil.showSelectCusmanDialog(
// context, couponList, (value) {
// if (value != null) {
// setState(() {
// couponSelectIndex = value.first;
// });
// }
// },
// selecteds: couponSelectIndex == null
// ? []
// : [couponSelectIndex])
// .then((value) {});
},
child: Container(
// height: ScreenUtil().setWidth(60),
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(50)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color: Color.fromRGBO(
220, 220, 220, 1)))),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Container(
// color: Colors.red,
width: ScreenUtil().setWidth(150),
height: ScreenUtil().setWidth(35),
child: Text(
labelShow,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color.fromRGBO(193, 194, 63, 1),
fontSize: ScreenUtil().setSp(28),
'客户经理',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_333333),
),
),
)),
HEmptyView(10),
Image.asset(
Utils.getImgPath(showLabel
? 'c_arrow_up'
: 'c_arrow_down'),
width: ScreenUtil().setWidth(24),
// height: ScreenUtil().setWidth(10),
)
],
),
)),
widget.fromPage == FromPage.FromPageMyCustomer
? SizedBox()
: InkWell(
onTap: () {
// DialogUtil.showSelectCusmanDialog(
// context, couponList, (value) {
// if (value != null) {
// setState(() {
// couponSelectIndex = value.first;
// });
// }
// },
// selecteds: couponSelectIndex == null
// ? []
// : [couponSelectIndex])
// .then((value) {});
},
child: Container(
// height: ScreenUtil().setWidth(60),
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(50)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color: Color.fromRGBO(
220, 220, 220, 1)))),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Container(
// color: Colors.red,
width: ScreenUtil().setWidth(150),
height: ScreenUtil().setWidth(35),
Expanded(
child: Text(
'客户经理',
style: TextStyle(
fontSize:
ScreenUtil().setSp(28),
color: MyColours.color_333333),
),
'xxxj',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(28),
),
Expanded(
child: Text(
'xxxj',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_333333,
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),
)
],
),
)),
VEmptyView(60),
_textMulLine('忌口', '输入忌口的东西', jkController),
VEmptyView(30),
_textMulLine('喜好', '输入喜好', xhController),
VEmptyView(30),
_textMulLine('服务', '输入服务', fwController),
],
),
)),
HEmptyView(10),
Image.asset(
Utils.getImgPath(showLabel
? 'c_arrow_up'
: 'c_arrow_down'),
width: ScreenUtil().setWidth(24),
// height: ScreenUtil().setWidth(10),
)
],
),
)),
VEmptyView(60),
_textMulLine('忌口', '输入忌口的东西', jkController),
VEmptyView(30),
_textMulLine('喜好', '输入喜好', xhController),
VEmptyView(30),
_textMulLine('服务', '输入服务', fwController),
],
))),
RoundButton(
text: '保存',
... ...
... ... @@ -172,6 +172,7 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
height: ScreenUtil().setWidth(80),
constraints:
BoxConstraints(maxWidth: ScreenUtil().setWidth(260)),
child: Text(
... ... @@ -182,15 +183,20 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
fontSize: ScreenUtil().setSp(64)),
)),
HEmptyView(10),
Text(
customerProvider.guestInfoSunModel.guest.sexStr != ''
? '[${customerProvider.guestInfoSunModel.guest.sexStr}]'
: '',
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(22),
),
),
Container(
height: ScreenUtil().setWidth(80),
padding:
EdgeInsets.only(bottom: ScreenUtil().setWidth(8)),
alignment: Alignment.bottomLeft,
child: Text(
customerProvider.guestInfoSunModel.guest.sexStr != ''
? '[${customerProvider.guestInfoSunModel.guest.sexStr}]'
: '',
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(22),
),
)),
],
),
customerProvider.guestInfoSunModel.guest.label != null
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/customer_label_model.dart';
import 'package:one_key/provider/customer_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
... ... @@ -17,13 +18,15 @@ class CustomerSettingPage extends StatefulWidget {
}
class _CustomerSettingPageState extends State<CustomerSettingPage> {
bool swichState = true;
bool swichState = false;
CustomerProvider customerProvider;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) async {
// _getContantData();
_sellerGuestGet();
_getLabelBySellerid();
});
}
... ... @@ -34,9 +37,30 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
'is_additional': swichState ? "1" : "0"
};
bool success = await customerProvider.setSellerGuest(context, params);
if (success) {}
}
///获取客情配置
_sellerGuestGet() async {
Map<String, String> params = {
"sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
};
bool success = await customerProvider.getSellerGuest(context, params);
if (success) {
swichState = true;
} else {
swichState = false;
}
setState(() {});
}
///获取商家标签
_getLabelBySellerid() async {
Map<String, String> params = {
"sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
};
await customerProvider.getLabelBySellerid(context, params);
}
///商家创建商家标签
... ... @@ -52,30 +76,45 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
Utils.showToast('标签添加成功');
//调用获取标签接口
// 。。。。。。
_getLabelBySellerid();
}
}
///商家修改标签
_setLabelBySellerid(String id, String name) async {
Map<String, String> params = {"id": id, 'label': name};
bool success = await customerProvider.setLabelBySellerid(context, params);
if (success) {
//刷新当前标签列表
Utils.showToast('标签修改成功');
//调用获取标签接口
// 。。。。。。
_getLabelBySellerid();
}
}
//构建标签
List<Widget> _buildLabelItem(List<String> data) {
List<Widget> _buildLabelItem(List<CustomerLabelSunModel> data) {
List<Widget> items = [];
for (String item in data) {
for (CustomerLabelSunModel item in data) {
items.add(InkWell(
onTap: () {
DialogUtil.textfeildAlertDialog(context,
title: '自定义标签名称',
hintText: '例:高频客户',
text: item,
text: item.label,
lenghtLimit: false,
toast: '请输入标签名称', rCallback: (name) {
print(name);
_setLabelBySellerid(item.id, name);
// _addCookbookClass(name, showLoading: true);
});
},
child: Container(
height: ScreenUtil().setWidth(40),
child: Text(
item,
item.label,
style: TextStyle(
color: Color.fromRGBO(193, 194, 63, 1),
fontSize: ScreenUtil().setSp(26),
... ... @@ -166,14 +205,7 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
Wrap(
spacing: ScreenUtil().setWidth(20),
runSpacing: ScreenUtil().setWidth(10),
children: _buildLabelItem([
'低频高消费',
'fdsfsdf',
'dfsdfsf',
'ff',
'ff',
'sfsuhfsuhfiuhfuaihuf'
])),
children: _buildLabelItem(customerProvider.labelList)),
],
)),
),
... ...
... ... @@ -5,6 +5,7 @@ import 'package:one_key/constant/constant.dart';
import 'package:one_key/constant/error.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/coupon_model.dart';
import 'package:one_key/models/customer_label_model.dart';
import 'package:one_key/models/customer_list_model.dart';
import 'package:one_key/models/guest_info_model.dart';
import 'package:one_key/models/guest_manage_model.dart';
... ... @@ -53,6 +54,9 @@ class CustomerProvider extends ChangeNotifier {
List<MarketingBySellerSunModel> marketingBySellerSunModel;
MarketingByIdSunModel marketingByIdSunModel;
List<CustomerLabelSunModel> labelList = []; //标签数据
int labelSelIndex;
///客户经理获取所创建活动列表(选择优惠券)
Future<List<CouponSunModel>> getCustomerSelectActivityNew(
... ... @@ -732,6 +736,32 @@ class CustomerProvider extends ChangeNotifier {
}
}
//获取商家客情设置
Future<bool> getSellerGuest(BuildContext context, Map<String, String> params,
{bool showLoading = false}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.seller_guest_get,
data: params, showLoading: showLoading)
.catchError((error) {
print(error.toString());
if (error is MyError) {}
notifyListeners();
});
if (baseResp != null && baseResp.code == Constant.status_success) {
// guestReserveSunModel =
// GuestReserveModel.fromJson(baseResp.responseData).data;
if (baseResp.responseData['data']['is_additional'] == '1') {
return true;
}
return false;
} else {
if (baseResp != null) {
Utils.showToast(baseResp.msg ?? "");
}
return false;
}
}
// 商家创建商家标签
Future<bool> createLabelBySellerid(
BuildContext context, Map<String, String> params,
... ... @@ -760,6 +790,58 @@ class CustomerProvider extends ChangeNotifier {
}
}
// 商家修改标签
Future<bool> setLabelBySellerid(
BuildContext context, Map<String, String> params,
{bool showLoading = false}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.set_label_by_sellerid,
data: params, showLoading: showLoading)
.catchError((error) {
print(error.toString());
if (error is MyError) {}
notifyListeners();
});
if (baseResp != null && baseResp.code == Constant.status_success) {
// guestReserveSunModel =
// GuestReserveModel.fromJson(baseResp.responseData).data;
if (baseResp.responseData['data'] != null &&
baseResp.responseData['data'] == 1) {
return true;
}
return false;
} else {
if (baseResp != null) {
Utils.showToast(baseResp.msg ?? "");
}
return false;
}
}
// 商家获取商家标签
Future<List<CustomerLabelSunModel>> getLabelBySellerid(
BuildContext context, Map<String, String> params,
{bool showLoading = false}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.get_label_by_sellerid,
data: params, showLoading: showLoading)
.catchError((error) {
print(error.toString());
if (error is MyError) {}
notifyListeners();
});
if (baseResp != null && baseResp.code == Constant.status_success) {
labelList = CustomerLabelModel.fromJson(baseResp.responseData).data;
} else {
if (baseResp != null) {
Utils.showToast(baseResp.msg ?? "");
}
}
notifyListeners();
return labelList;
}
// 商家创建营销
createMarketingBySeller(BuildContext context, Map<String, String> params,
{bool showLoading = false}) async {
... ...