|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/constant/state.dart';
|
|
|
|
import 'package:one_key/models/marketing_by_id_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/utils.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/page_exception.dart';
|
|
|
|
import 'package:one_key/widgets/round_button.dart';
|
|
|
|
import 'package:one_key/widgets/row_multi_text.dart';
|
|
|
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
class MarketingRecordsDetailPage extends StatefulWidget {
|
|
|
|
MarketingRecordsDetailPage({Key key}) : super(key: key);
|
|
|
|
final String idstr;
|
|
|
|
MarketingRecordsDetailPage({Key key, this.idstr}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_MarketingRecordsDetailPageState createState() =>
|
|
...
|
...
|
@@ -19,12 +26,63 @@ class MarketingRecordsDetailPage extends StatefulWidget { |
|
|
|
|
|
|
|
class _MarketingRecordsDetailPageState
|
|
|
|
extends State<MarketingRecordsDetailPage> {
|
|
|
|
CustomerProvider customerProvider;
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
|
|
// if (widget.fromPage == FromPage.FromPageStoreCustomer) {
|
|
|
|
// _getMarketingBySeller();
|
|
|
|
// }
|
|
|
|
_getMarketingById();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
_getMarketingById() async {
|
|
|
|
Map<String, String> params = {"id": widget.idstr};
|
|
|
|
await customerProvider.getMarketingById(context, params);
|
|
|
|
if (customerProvider.pageStateMarketingRecordDetail == PageState.Success) {
|
|
|
|
_couponNetworkData();
|
|
|
|
}
|
|
|
|
// await customerProvider.searchData(customerProvider.controller.text);
|
|
|
|
}
|
|
|
|
|
|
|
|
///消费券
|
|
|
|
_couponNetworkData({bool isShowLoading = true}) async {
|
|
|
|
// customerMakingProvider.couponSelectIndex = 0;
|
|
|
|
Map<String, String> params = {
|
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
};
|
|
|
|
await customerProvider.getCustomerSelectActivityNew(context, params,
|
|
|
|
isShowLoading: isShowLoading);
|
|
|
|
//此人已经新建好券
|
|
|
|
if (customerProvider.couponListSelect.length > 0) {
|
|
|
|
for (int i = 0; i < customerProvider.couponListSelect.length; i++) {
|
|
|
|
if (customerProvider.marketingByIdSunModel.aid ==
|
|
|
|
customerProvider.couponListSelect[i].id) {
|
|
|
|
customerProvider.marketingByIdSunModel.aidStr =
|
|
|
|
customerProvider.couponListSelect[i].aname;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
customerProvider.notifyListeners();
|
|
|
|
} else {
|
|
|
|
//没有新建的优惠券
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//构建经理btn
|
|
|
|
List<Widget> _buildLabelItem(List<String> data,
|
|
|
|
List<Widget> _buildLabelItem(List<SellerUser> data,
|
|
|
|
{Color bgColor = MyColours.color_199095}) {
|
|
|
|
List<Widget> items = [];
|
|
|
|
|
|
|
|
for (String item in data) {
|
|
|
|
for (SellerUser item in data) {
|
|
|
|
String title = '${item.nickName}经理';
|
|
|
|
title += item.finishedStatus == 0 ? '(未完成)' : '(已完成)';
|
|
|
|
|
|
|
|
items.add(InkWell(
|
|
|
|
onTap: () {},
|
|
|
|
child: Container(
|
|
...
|
...
|
@@ -33,12 +91,12 @@ class _MarketingRecordsDetailPageState |
|
|
|
horizontal: ScreenUtil().setWidth(20),
|
|
|
|
vertical: ScreenUtil().setWidth(6)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: item.contains('未完成')
|
|
|
|
color: title.contains('未完成')
|
|
|
|
? Color.fromRGBO(207, 29, 35, 1)
|
|
|
|
: MyColours.color_199095,
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))),
|
|
|
|
child: Text(
|
|
|
|
item,
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize: ScreenUtil().setSp(26),
|
|
...
|
...
|
@@ -51,6 +109,7 @@ class _MarketingRecordsDetailPageState |
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
customerProvider = Provider.of<CustomerProvider>(context, listen: true);
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: Color.fromRGBO(246, 248, 250, 1),
|
|
|
|
appBar: SystemAppBar(
|
|
...
|
...
|
@@ -59,175 +118,215 @@ class _MarketingRecordsDetailPageState |
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(30),
|
|
|
|
// vertical: ScreenUtil().setWidth(40)
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Stack(
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
body: Consumer<CustomerProvider>(builder: (context, model, _) {
|
|
|
|
if (model.pageStateMarketingRecordDetail != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageStateMarketingRecordDetail,
|
|
|
|
callback: () {
|
|
|
|
model.pageStateMarketingRecordDetail = PageState.Loading;
|
|
|
|
model.notifyListeners();
|
|
|
|
// _getContantData();
|
|
|
|
_getMarketingById();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有营销详情哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(30),
|
|
|
|
// vertical: ScreenUtil().setWidth(40)
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Stack(
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
children: [
|
|
|
|
RowMultiText(
|
|
|
|
'创建日期',
|
|
|
|
'2021-12-22',
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
bgColor: Color.fromRGBO(246, 248, 250, 1),
|
|
|
|
),
|
|
|
|
RowMultiText(
|
|
|
|
'创建人',
|
|
|
|
'管理员',
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
bgColor: Color.fromRGBO(246, 248, 250, 1),
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
RowMultiText(
|
|
|
|
'创建日期',
|
|
|
|
model.marketingByIdSunModel.cdateStr,
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
bgColor: Color.fromRGBO(246, 248, 250, 1),
|
|
|
|
),
|
|
|
|
RowMultiText(
|
|
|
|
'创建人',
|
|
|
|
'管理员(未返回)',
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
bgColor: Color.fromRGBO(246, 248, 250, 1),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('c_state_ing'),
|
|
|
|
width: ScreenUtil().setWidth(140),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('c_state_ing'),
|
|
|
|
width: ScreenUtil().setWidth(140),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
RowMultiText(
|
|
|
|
'完成期限',
|
|
|
|
'2021-12-22 23:59:59',
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
bgColor: Color.fromRGBO(246, 248, 250, 1),
|
|
|
|
),
|
|
|
|
RowMultiText(
|
|
|
|
'修改短信内容',
|
|
|
|
'可修改',
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
bgColor: Color.fromRGBO(246, 248, 250, 1),
|
|
|
|
),
|
|
|
|
RowMultiText(
|
|
|
|
'优惠信息',
|
|
|
|
'98折(仅限菜品堂食)',
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
bgColor: Color.fromRGBO(246, 248, 250, 1),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setWidth(25),
|
|
|
|
bottom: ScreenUtil().setWidth(20)),
|
|
|
|
child: Text(
|
|
|
|
'短信内容',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(30)),
|
|
|
|
)),
|
|
|
|
Padding(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.only(bottom: ScreenUtil().setWidth(25)),
|
|
|
|
child: Text(
|
|
|
|
'dfdsgdfgdksgsdkghjksdhgjskdhgjsdhgsjkhdgfjksdhgsdjfdgg\nhsdfgjgsjgdhsddhfghdgjsgjdg',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(30)),
|
|
|
|
)),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: ScreenUtil().setWidth(25),
|
|
|
|
RowMultiText(
|
|
|
|
'完成期限',
|
|
|
|
model.marketingByIdSunModel.edate,
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
bgColor: Color.fromRGBO(246, 248, 250, 1),
|
|
|
|
),
|
|
|
|
RowMultiText(
|
|
|
|
'修改短信内容',
|
|
|
|
model.marketingByIdSunModel.isUpdate == '1'
|
|
|
|
? '可修改'
|
|
|
|
: '不可修改',
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
bgColor: Color.fromRGBO(246, 248, 250, 1),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'总客户人数',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(30)),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Text('55人',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(30))),
|
|
|
|
HEmptyView(10),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// NavigatorUtil.goMarketingRecordsDetailPage(context);
|
|
|
|
},
|
|
|
|
child: Text('查看',
|
|
|
|
RowMultiText(
|
|
|
|
'优惠信息',
|
|
|
|
customerProvider.marketingByIdSunModel.aidStr,
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
bgColor: Color.fromRGBO(246, 248, 250, 1),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setWidth(25),
|
|
|
|
bottom: ScreenUtil().setWidth(20)),
|
|
|
|
child: Text(
|
|
|
|
'短信内容',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(30)),
|
|
|
|
)),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
bottom: ScreenUtil().setWidth(25)),
|
|
|
|
child: Text(
|
|
|
|
model.marketingByIdSunModel.content,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(30)),
|
|
|
|
)),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: ScreenUtil().setWidth(25),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'总客户人数',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(30)),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Text(
|
|
|
|
'${model.marketingByIdSunModel.guestCount}人',
|
|
|
|
style: TextStyle(
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
fontSize: ScreenUtil().setSp(30)))),
|
|
|
|
])),
|
|
|
|
RowMultiText(
|
|
|
|
'参与经理',
|
|
|
|
'5人',
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
bgColor: Color.fromRGBO(246, 248, 250, 1),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
bottom: ScreenUtil().setWidth(25),
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(30))),
|
|
|
|
HEmptyView(10),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// NavigatorUtil.goMarketingRecordsDetailPage(context);
|
|
|
|
},
|
|
|
|
child: Text('查看',
|
|
|
|
style: TextStyle(
|
|
|
|
decoration:
|
|
|
|
TextDecoration.underline,
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(30)))),
|
|
|
|
])),
|
|
|
|
RowMultiText(
|
|
|
|
'参与经理',
|
|
|
|
'${model.marketingByIdSunModel.sellerUserCount}人',
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
bgColor: Color.fromRGBO(246, 248, 250, 1),
|
|
|
|
),
|
|
|
|
child: Wrap(
|
|
|
|
spacing: ScreenUtil().setWidth(20),
|
|
|
|
runSpacing: ScreenUtil().setWidth(10),
|
|
|
|
children: _buildLabelItem([
|
|
|
|
'xx经理已完成',
|
|
|
|
'xx经理未完成',
|
|
|
|
'dfsdfsf',
|
|
|
|
'ff',
|
|
|
|
'ff',
|
|
|
|
'sfsuhfsuhfiuhfuaihuf'
|
|
|
|
]))),
|
|
|
|
]))),
|
|
|
|
RoundButton(
|
|
|
|
text: '催促未完成经理',
|
|
|
|
gradientStart: MyColours.color_199095,
|
|
|
|
gradientEnd: MyColours.color_199095,
|
|
|
|
// borderColor: MyColours.color_999999,
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
fontSize: 26,
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(200)),
|
|
|
|
isBold: false,
|
|
|
|
onPressed: () {
|
|
|
|
// NavigatorUtil.goEnterStoreEnvironmentPage(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
VEmptyView(10),
|
|
|
|
RoundButton(
|
|
|
|
text: '取消任务',
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
textColor: MyColours.color_199095,
|
|
|
|
// borderColor: MyColours.color_999999,
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
fontSize: 26,
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(200)),
|
|
|
|
isBold: false,
|
|
|
|
onPressed: () {
|
|
|
|
DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
title: "取消任务",
|
|
|
|
content: "点击确定立即取消任务,已完成的客户经理继续生效",
|
|
|
|
lTitle: "返回",
|
|
|
|
rTitle: "确定取消", lCallback: () {
|
|
|
|
print("返回");
|
|
|
|
}, rCallback: () {
|
|
|
|
print("确定取消任务");
|
|
|
|
});
|
|
|
|
},
|
|
|
|
),
|
|
|
|
VEmptyView(30),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
bottom: ScreenUtil().setWidth(25),
|
|
|
|
),
|
|
|
|
child: Wrap(
|
|
|
|
spacing: ScreenUtil().setWidth(20),
|
|
|
|
runSpacing: ScreenUtil().setWidth(10),
|
|
|
|
children: _buildLabelItem(
|
|
|
|
model.marketingByIdSunModel.sellerUser))),
|
|
|
|
]))),
|
|
|
|
model.marketingByIdSunModel.notFinished == 0
|
|
|
|
? Column(
|
|
|
|
children: [
|
|
|
|
RoundButton(
|
|
|
|
text: '催促未完成经理',
|
|
|
|
gradientStart: MyColours.color_199095,
|
|
|
|
gradientEnd: MyColours.color_199095,
|
|
|
|
// borderColor: MyColours.color_999999,
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
fontSize: 26,
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(200)),
|
|
|
|
isBold: false,
|
|
|
|
onPressed: () {
|
|
|
|
// NavigatorUtil.goEnterStoreEnvironmentPage(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
VEmptyView(10),
|
|
|
|
RoundButton(
|
|
|
|
text: '取消任务',
|
|
|
|
gradientStart: Colors.transparent,
|
|
|
|
gradientEnd: Colors.transparent,
|
|
|
|
textColor: MyColours.color_199095,
|
|
|
|
// borderColor: MyColours.color_999999,
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
fontSize: 26,
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(200)),
|
|
|
|
isBold: false,
|
|
|
|
onPressed: () {
|
|
|
|
DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
title: "取消任务",
|
|
|
|
content: "点击确定立即取消任务,已完成的客户经理继续生效",
|
|
|
|
lTitle: "返回",
|
|
|
|
rTitle: "确定取消", lCallback: () {
|
|
|
|
print("返回");
|
|
|
|
}, rCallback: () {
|
|
|
|
print("确定取消任务");
|
|
|
|
});
|
|
|
|
},
|
|
|
|
),
|
|
|
|
VEmptyView(30),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
: Column(
|
|
|
|
children: [
|
|
|
|
RoundButton(
|
|
|
|
text: '再次创建',
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
textColor: MyColours.color_199095,
|
|
|
|
// borderColor: MyColours.color_999999,
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
fontSize: 26,
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(200)),
|
|
|
|
isBold: false,
|
|
|
|
onPressed: () {},
|
|
|
|
),
|
|
|
|
VEmptyView(30),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|