Commit d5a0989f31a9ebb3e3365edcfc9a12b17d47fa24

Authored by wdn127929
1 parent ace849c4

营销中心评价设置

10.6 KB | W: | H:

6.27 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -319,6 +319,10 @@ class MarkMarketingModel {
List<CouponSunModel> couponDataList;
String isComments;
String isCommentsCoupon;
List<CouponSunModel> couponDataListComments;
MarkMarketingModel(
{this.isArrival,
this.isLink,
... ... @@ -328,7 +332,12 @@ class MarkMarketingModel {
this.logo,
this.wecomle,
this.isCoupon,
this.isRecharge});
this.isRecharge,
this.rechargeData,
this.couponDataList,
this.isComments,
this.isCommentsCoupon,
this.couponDataListComments});
MarkMarketingModel.fromJson(Map<String, dynamic> json) {
isTranspond = json['is_transpond'];
... ... @@ -365,6 +374,32 @@ class MarkMarketingModel {
}
}
}
isComments = json['is_comments'];
isCommentsCoupon = json['is_comments_coupon'];
if (json['coupon_data_comments'] != null) {
couponDataListComments = <CouponSunModel>[];
if (json['coupon_data_comments'] is Map) {
//旧数据map
couponDataListComments
.add(CouponSunModel.fromJson(json['coupon_data_comments']));
} else {
var couponData = convert.jsonDecode(json['coupon_data_comments']);
if (couponData is List) {
couponData.forEach((v) {
couponDataListComments.add(CouponSunModel.fromJson(v));
});
} else if (couponData is Map) {
// json['coupon_data'].forEach((v) {
couponDataListComments.add(CouponSunModel.fromJson(couponData));
// });
} else {
couponData.forEach((v) {
couponDataListComments.add(v);
});
}
}
}
}
Map<String, dynamic> toJson() {
... ... @@ -380,6 +415,9 @@ class MarkMarketingModel {
data['is_recharge'] = this.isRecharge;
data['recharge_data'] = this.rechargeData;
data['coupon_data'] = this.couponDataList;
data['is_comments'] = this.isComments;
data['is_comments_coupon'] = this.isCommentsCoupon;
data['coupon_data_comments'] = this.couponDataListComments;
return data;
}
... ...
... ... @@ -48,6 +48,9 @@ class _CouponSettingPageState extends State<CouponSettingPage> {
String rechargeContent = '';
List<CouponSunModel> couponDataList = [];
bool isComments = false; //启用评价设置
bool isCommentsCoupon = false; //启用评价送券
List<CouponSunModel> couponDataListComments = [];
@override
void initState() {
super.initState();
... ... @@ -93,7 +96,18 @@ class _CouponSettingPageState extends State<CouponSettingPage> {
marketingCenterProvider.markDataModel.marketing.rechargeData;
couponDataList =
marketingCenterProvider.markDataModel.marketing.couponDataList ?? [];
couponDataListComments = marketingCenterProvider
.markDataModel.marketing.couponDataListComments ??
[];
isComments =
marketingCenterProvider.markDataModel.marketing.isComments == '1'
? true
: false;
isCommentsCoupon =
marketingCenterProvider.markDataModel.marketing.isCommentsCoupon ==
'1'
? true
: false;
qiniuUrl = marketingCenterProvider.markDataModel.marketing.logo ?? null;
welcome = marketingCenterProvider.markDataModel.marketing.wecomle;
... ... @@ -118,7 +132,10 @@ class _CouponSettingPageState extends State<CouponSettingPage> {
'wecomle': welcome ?? '',
'logo': qiniuUrl,
'recharge_data': rechargeData,
'coupon_data': json.encode(couponDataList)
'coupon_data': json.encode(couponDataList),
'is_comments': isComments ? '1' : '0',
'is_comments_coupon': isCommentsCoupon ? '1' : '0',
'coupon_data_comments': json.encode(couponDataListComments),
};
Map<String, String> params = {
'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
... ...
... ... @@ -372,16 +372,16 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> {
itemBuilder:
(context,
index) {
return Image
.asset(
Utils.getImgPath(index <=
return CachedNetworkImage(
imageUrl: index <=
int.parse(sunModel.grade) - 1
? 'zwzp'
: 'apple'),
? 'http://nosqn.colorcun.com/pinglun/p%20%283%29.png'
: 'http://nosqn.colorcun.com/pinglun/p%20%284%29.png',
width: w(
15),
);
})),
HEmptyView(3),
Container(
padding: EdgeInsets
.symmetric(
... ...
... ... @@ -58,6 +58,9 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
String rechargeContent = '';
List<CouponSunModel> couponDataList = [];
bool isComments = false; //启用评价设置
bool isCommentsCoupon = false; //启用评价送券
List<CouponSunModel> couponDataListComments = [];
List<RechargeListSunModel> rechargeListCanUse = [];
ScrollController controller = ScrollController();
... ... @@ -162,6 +165,18 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
marketingCenterProvider.markDataModel.marketing.rechargeData;
couponDataList =
marketingCenterProvider.markDataModel.marketing.couponDataList ?? [];
couponDataListComments = marketingCenterProvider
.markDataModel.marketing.couponDataListComments ??
[];
isComments =
marketingCenterProvider.markDataModel.marketing.isComments == '1'
? true
: false;
isCommentsCoupon =
marketingCenterProvider.markDataModel.marketing.isCommentsCoupon ==
'1'
? true
: false;
_uploadImageProvider.firstImage.qiniuUrl =
marketingCenterProvider.markDataModel.marketing.logo ?? null;
... ... @@ -1122,7 +1137,10 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
'wecomle': welcomeTextC.text ?? '',
'logo': _uploadImageProvider.firstImage.qiniuUrl,
'recharge_data': rechargeData,
'coupon_data': json.encode(couponDataList)
'coupon_data': json.encode(couponDataList),
'is_comments': isComments ? '1' : '0',
'is_comments_coupon': isCommentsCoupon ? '1' : '0',
'coupon_data_comments': json.encode(couponDataListComments),
};
Map<String, String> params = {
'sid': Provider.of<UserModel>(context, listen: false)
... ...
... ... @@ -451,13 +451,13 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> {
margin: EdgeInsets.symmetric(horizontal: w(20)),
padding: EdgeInsets.symmetric(horizontal: w(15), vertical: w(12)),
decoration: BoxDecoration(
color: MyColours.color_d9d9d9,
color: MyColours.color_F8F9FD,
borderRadius: BorderRadius.circular(r(5))),
child: Row(
children: [
Image.asset(
Utils.getImgPath('location_blue'),
width: w(36),
width: w(30),
),
HEmptyView(28),
Expanded(
... ... @@ -1539,6 +1539,33 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> {
'1')
? _rechargeWiddget()
: SizedBox(),
_marketingCenterProvider.markDataModel.marketing != null &&
(_marketingCenterProvider
.markDataModel.marketing.isComments ==
'1')
? Container(
padding: EdgeInsets.symmetric(
horizontal: w(20), vertical: w(8)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
_marketingCenterProvider.markDataModel
.marketing.isCommentsCoupon ==
'1'
? '想吐槽?戳这里填写意见反馈赢好礼!-->'
: '想吐槽?戳这里填写意见!-->',
style: TextStyle(
color: MyColours.color_000000,
fontSize: font(14)),
),
Image.asset(
Utils.getImgPath('comments'),
width: w(30),
)
],
))
: SizedBox(),
_marketingCenterProvider.markDataModel.marketing != null
? _logoWidget()
: SizedBox()
... ...
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:provider/provider.dart';
import '../../../models/coupon_model.dart';
import '../../../models/recharge_list_model.dart';
import '../../../provider/coupon_provider.dart';
import '../../../provider/marketing_center_provider.dart';
import '../../../provider/user_model.dart';
import '../../../res/colors.dart';
import '../../../route/navigator_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/v_empty_view.dart';
/**
* 优惠券设置页面
* */
class CommentsSettingPage extends StatefulWidget {
CommentsSettingPage({Key key}) : super(key: key);
@override
_CommentsSettingPageState createState() => _CommentsSettingPageState();
}
class _CommentsSettingPageState extends State<CommentsSettingPage> {
ScrollController controller = ScrollController();
CouponProvider couponProvider;
MarketingCenterProvider marketingCenterProvider;
bool isTranspond = false; //转发邀请函
bool isArrival = false; //确认到店
bool isOnlineBook = false; //在线预订
bool isOrder = false; //提前点餐
bool isLink = false; //充值优惠活动链接
bool isCoupon = false; // 代金券
bool isRecharge = false; //充值券
String welcome = '';
String qiniuUrl = '';
RechargeListSunModel rechargeData;
String rechargeContent = '';
List<CouponSunModel> couponDataList = [];
bool isComments = false; //启用评价设置
bool isCommentsCoupon = false; //启用评价送券
List<CouponSunModel> couponDataListComments = [];
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) async {
_couponNetworkData();
getSellerTemplateConf();
});
}
getSellerTemplateConf() async {
bool success = await marketingCenterProvider.getSellerTemplateConf(context);
if (success && marketingCenterProvider.markDataModel.marketing != null) {
isTranspond =
marketingCenterProvider.markDataModel.marketing.isTranspond == '1'
? true
: false;
isArrival =
marketingCenterProvider.markDataModel.marketing.isArrival == '1'
? true
: false;
isOnlineBook =
marketingCenterProvider.markDataModel.marketing.isOnlineBook == '1'
? true
: false;
isOrder = marketingCenterProvider.markDataModel.marketing.isOrder == '1'
? true
: false;
isLink = marketingCenterProvider.markDataModel.marketing.isLink == '1'
? true
: false;
isCoupon = marketingCenterProvider.markDataModel.marketing.isCoupon == '1'
? true
: false;
isRecharge =
marketingCenterProvider.markDataModel.marketing.isRecharge == '1'
? true
: false;
rechargeData =
marketingCenterProvider.markDataModel.marketing.rechargeData;
couponDataList =
marketingCenterProvider.markDataModel.marketing.couponDataList ?? [];
couponDataListComments = marketingCenterProvider
.markDataModel.marketing.couponDataListComments ??
[];
isCommentsCoupon =
marketingCenterProvider.markDataModel.marketing.isCommentsCoupon ==
'1'
? true
: false;
isComments =
marketingCenterProvider.markDataModel.marketing.isComments == '1'
? true
: false;
qiniuUrl = marketingCenterProvider.markDataModel.marketing.logo ?? null;
welcome = marketingCenterProvider.markDataModel.marketing.wecomle;
setState(() {});
}
}
///优惠券设置
_setCouponShow() async {
//接口
Map marketingData = {
// 'isTranspond': isTranspond ? '1' : '0', //转发同行客人
'is_transpond': '1', //转发同行客人
'is_arrival': isArrival ? '1' : '0', //确认到店
'is_online_book': isOnlineBook ? '1' : '0', //在线预订
'is_order': isOrder ? '1' : '0', //去点餐
'is_coupon': isCoupon ? '1' : '0', //代金券暂时
'is_recharge': isRecharge ? '1' : '0', //充值券暂时
'is_link': isLink ? '1' : '0',
'wecomle': welcome ?? '',
'logo': qiniuUrl,
'recharge_data': rechargeData,
'coupon_data': json.encode(couponDataList),
'is_comments': isComments ? '1' : '0',
'is_comments_coupon': isCommentsCoupon ? '1' : '0',
'coupon_data_comments': json.encode(couponDataListComments),
};
Map<String, String> params = {
'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
'marketing': json.encode(marketingData)
};
bool success = await marketingCenterProvider
.setSellerTemplateConf(context, params, showLoading: true);
if (success) {
// bus.emit('refresh_coupon_list_f');
Utils.showToast('保存成功');
Navigator.pop(context);
}
}
///获取优惠券列表数据(status == 1)
_couponNetworkData({bool isShowLoading = true}) async {
Map<String, String> params = {
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
};
params['status'] = '1';
await couponProvider.getCustomerSelectActivityMarking(context, params,
isShowLoading: isShowLoading);
if (couponDataListComments == null || couponDataListComments.length == 0) {
if (couponProvider.couponListSelect != null &&
couponProvider.couponListSelect.length > 0) {
couponDataListComments.add(couponProvider.couponListSelect[0]);
}
}
setState(() {});
}
///标题
Widget _headItem(String title) {
return Container(
width: double.infinity,
alignment: Alignment.centerLeft,
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
margin: EdgeInsets.only(left: w(16)),
padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(16)),
child: Text(
title,
style: TextStyle(
color: MyColours.color_515151, fontSize: ScreenUtil().setWidth(32)),
),
);
}
///优惠券
Widget _markingCupon({
VoidCallback onPressed,
bool select = false,
VoidCallback onPressedSelect,
}) {
return Container(
margin: EdgeInsets.only(left: w(21), top: w(12), right: w(21)),
child: Column(
children: [
InkWell(
onTap: onPressedSelect,
child: Row(
children: [
Image.asset(
Utils.getImgPath(select ? 'f_select' : 'f_select_not'),
width: w(20),
),
HEmptyView(20),
Text(
'顾客点评后赠送优惠券',
style: TextStyle(
fontSize: font(14), color: MyColours.color_515151),
),
Spacer(),
RoundButton(
text: '选择活动',
width: w(72),
height: w(22),
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
radius: r(11),
fontSize: 24,
isBold: true,
onPressed: onPressed,
)
],
)),
VEmptyView(20),
ListView.builder(
shrinkWrap: true,
controller: controller,
itemCount: couponDataListComments.length,
itemBuilder: (BuildContext context, int index) {
CouponSunModel couponData = couponDataListComments[index];
return _markingCuponItem(
couponData.aname,
_getCouponsDesc(couponData),
couponData.price ?? '',
couponData.use != null && couponData.use.isCash
? '${(double.parse(couponData.price) / double.parse(couponData.use.cash)) * 10}折'
: '',
'切换活动',
select: isCommentsCoupon, onPressedSelect: () {
setState(() {
isCommentsCoupon = !isCommentsCoupon;
});
});
})
],
),
);
}
String _getCouponsDesc(couponData) {
String couponsDesc = '';
if (couponData != null) {
if (couponData.expDate == null) {
couponsDesc = couponData.desc;
} else {
if (couponData.expDate.isNone) {
couponsDesc = '无限制,' + couponData.desc ?? '';
} else if (couponData.expDate.isBirthday) {
couponsDesc = '会员生日当天可用,' + couponData.desc ?? '';
} else if (couponData.expDate.isWeek) {
couponsDesc =
'${couponData.expDate.weekShow},' + couponData.desc ?? '';
}
}
}
return couponsDesc;
}
///优惠券
Widget _markingCuponItem(
String title,
String content,
String subtile,
String discount,
String btnTitle, {
VoidCallback onPressed,
bool select = false,
VoidCallback onPressedSelect,
}) {
return Container(
margin: EdgeInsets.only(left: w(21), top: w(12), right: w(21)),
child: Container(
padding: EdgeInsets.all(w(12)),
decoration: BoxDecoration(
borderRadius: BorderRadiusDirectional.circular(r(8)),
border: Border.all(width: w(1), color: MyColours.color_DBDBDB)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
constraints: BoxConstraints(maxWidth: w(150)),
child: Text(
title,
style: TextStyle(
fontSize: font(14),
fontWeight: FontWeight.bold,
color: MyColours.color_515151),
)),
HEmptyView(20),
subtile != ''
? Text(
'¥${subtile}',
style: TextStyle(
fontSize: font(7),
fontWeight: FontWeight.bold,
color: MyColours.color_E34D59),
)
: SizedBox(),
HEmptyView(10),
discount != ''
? Container(
padding: EdgeInsets.symmetric(
horizontal: w(3), vertical: w(2)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(3)),
border: Border.all(
width: w(0.5),
color: MyColours.color_E34D59)),
child: Text(
discount,
style: TextStyle(
color: MyColours.color_E34D59,
fontSize: font(7)),
),
)
: SizedBox(),
],
),
if (content != '') VEmptyView(20),
if (content != '')
Text(
content,
style: TextStyle(
height: 1.2,
fontSize: font(10),
fontWeight: FontWeight.bold,
color: MyColours.color_515151),
)
],
)),
],
),
),
);
}
///营销推广
Widget _markingItem(
String selectTitle,
String title, {
bool select = false,
VoidCallback onPressedSelect,
}) {
return Container(
margin: EdgeInsets.only(left: w(18), top: w(12), right: w(18)),
child: Column(
children: [
InkWell(
onTap: onPressedSelect,
child: Row(
children: [
Image.asset(
Utils.getImgPath(select ? 'f_select' : 'f_select_not'),
width: w(20),
),
HEmptyView(20),
Text(
selectTitle,
style: TextStyle(
fontSize: font(14), color: MyColours.color_515151),
)
],
)),
VEmptyView(20),
Container(
height: w(76),
padding: EdgeInsets.all(w(12)),
decoration: BoxDecoration(
borderRadius: BorderRadiusDirectional.circular(r(8)),
border:
Border.all(width: w(1), color: MyColours.color_DBDBDB)),
child: Text(
title,
maxLines: 2,
style: TextStyle(
fontSize: font(14),
// fontWeight: FontWeight.bold,
color: MyColours.color_515151),
))
],
),
);
}
@override
Widget build(BuildContext context) {
couponProvider = Provider.of<CouponProvider>(context, listen: false);
marketingCenterProvider =
Provider.of<MarketingCenterProvider>(context, listen: false);
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('用户评价设置'),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
controller: controller,
child: Column(
children: [
// _headItem('预订安排启用顾客反馈评价功能'),
InkWell(
onTap: () {
setState(() {
isComments = !isComments;
});
},
child: Padding(
padding: EdgeInsets.only(
left: w(16),
top: w(12),
bottom: w(12),
right: w(12)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
'预订安排启用顾客反馈评价功能',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16)),
),
Spacer(),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(7), vertical: w(4)),
child: Image.asset(
Utils.getImgPath(isComments
? 'swich_on'
: 'swich_off'),
width: w(44),
),
)
// RoundButton(
// text: '预览',
// gradientStart: MyColours.color_ffffff,
// gradientEnd: MyColours.color_ffffff,
// borderColor: MyColours.color_438E93,
// textColor: MyColours.color_438E93,
// radius: ScreenUtil().setWidth(22),
// fontSize: 24,
// width: w(72),
// height: ScreenUtil().setWidth(44),
// isBold: true,
// onPressed: () {
// NavigatorUtil.goMarkingPreviewPage(context);
// },
// ),
]))),
VEmptyView(24),
couponProvider.couponListSelect != null &&
couponProvider.couponListSelect.length > 0
? _markingCupon(
select: isCommentsCoupon,
onPressedSelect: () {
setState(() {
isCommentsCoupon = !isCommentsCoupon;
});
},
onPressed: () async {
//切换活动
Map temp =
await NavigatorUtil.goMarkingCouponSelectPage(
context,
{'object': couponDataListComments});
if (temp['coupon'] != null) {
couponDataListComments = temp['coupon'];
setState(() {});
}
})
: (couponProvider.couponListSelect == null ||
couponProvider.couponListSelect.length == 0)
? _markingItem(
'顾客点评后赠送优惠券',
'当前没有可用优惠券,请创建优惠券后再来尝试。',
select: false,
)
: SizedBox(),
],
),
),
),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.only(
left: w(45), right: w(45), top: w(12), bottom: w(25)),
child: RoundButton(
text: '保存',
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius: r(5),
fontSize: 34,
height: w(40),
isBold: true,
onPressed: () async {
_setCouponShow();
},
),
)
],
));
}
}
... ...
... ... @@ -269,6 +269,41 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
VEmptyView(24),
InkWell(
onTap: () {
NavigatorUtil.goCommentsSettingPage(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.goCustomerNoticeSettingPage(context);
},
child: Padding(
... ...
... ... @@ -27,7 +27,6 @@ class OrderSettingPage extends StatefulWidget {
class _OrderSettingPageState extends State<OrderSettingPage> {
MarketingCenterProvider marketingCenterProvider;
bool isTranspond = false; //转发邀请函
bool isArrival = false; //确认到店
... ... @@ -44,6 +43,9 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
String welcome = '';
List<CouponSunModel> couponDataList = [];
bool isComments = false; //启用评价设置
bool isCommentsCoupon = false; //启用评价送券
List<CouponSunModel> couponDataListComments = [];
@override
void initState() {
... ... @@ -90,6 +92,18 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
marketingCenterProvider.markDataModel.marketing.rechargeData;
couponDataList =
marketingCenterProvider.markDataModel.marketing.couponDataList ?? [];
couponDataListComments = marketingCenterProvider
.markDataModel.marketing.couponDataListComments ??
[];
isComments =
marketingCenterProvider.markDataModel.marketing.isComments == '1'
? true
: false;
isCommentsCoupon =
marketingCenterProvider.markDataModel.marketing.isCommentsCoupon ==
'1'
? true
: false;
qiniuUrl = marketingCenterProvider.markDataModel.marketing.logo ?? null;
... ... @@ -115,7 +129,10 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
'wecomle': welcome ?? '',
'logo': qiniuUrl,
'recharge_data': rechargeData,
'coupon_data': json.encode(couponDataList)
'coupon_data': json.encode(couponDataList),
'is_comments': isComments ? '1' : '0',
'is_comments_coupon': isCommentsCoupon ? '1' : '0',
'coupon_data_comments': json.encode(couponDataListComments),
};
Map<String, String> params = {
'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
... ... @@ -169,9 +186,8 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
padding: EdgeInsets.symmetric(
horizontal: w(7), vertical: w(4)),
child: Image.asset(
Utils.getImgPath(isOrder
? 'swich_on'
: 'swich_off'),
Utils.getImgPath(
isOrder ? 'swich_on' : 'swich_off'),
width: w(44),
),
)
... ...
... ... @@ -48,6 +48,9 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> {
List<CouponSunModel> couponDataList = [];
List<RechargeListSunModel> rechargeListCanUse = [];
bool isComments = false; //启用评价设置
bool isCommentsCoupon = false; //启用评价送券
List<CouponSunModel> couponDataListComments = [];
@override
void initState() {
super.initState();
... ... @@ -93,6 +96,18 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> {
marketingCenterProvider.markDataModel.marketing.rechargeData;
couponDataList =
marketingCenterProvider.markDataModel.marketing.couponDataList ?? [];
couponDataListComments = marketingCenterProvider
.markDataModel.marketing.couponDataListComments ??
[];
isComments =
marketingCenterProvider.markDataModel.marketing.isComments == '1'
? true
: false;
isCommentsCoupon =
marketingCenterProvider.markDataModel.marketing.isCommentsCoupon ==
'1'
? true
: false;
qiniuUrl = marketingCenterProvider.markDataModel.marketing.logo ?? null;
... ... @@ -118,7 +133,10 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> {
'wecomle': welcome ?? '',
'logo': qiniuUrl,
'recharge_data': rechargeData,
'coupon_data': json.encode(couponDataList)
'coupon_data': json.encode(couponDataList),
'is_comments': isComments ? '1' : '0',
'is_comments_coupon': isCommentsCoupon ? '1' : '0',
'coupon_data_comments': json.encode(couponDataListComments),
};
Map<String, String> params = {
'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
... ...
... ... @@ -1806,4 +1806,13 @@ class NavigatorUtil {
return _navigateTo(context, "${Routes.comment_manage_home_page}",
replace: replace);
}
/// 客户通知配置页----评价配置页
static Future<dynamic> goCommentsSettingPage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.comments_setting_page}",
replace: replace);
}
}
... ...
... ... @@ -206,6 +206,7 @@ import '../pages/my/marketing_center/book_notification/marking_coupon_select_pag
import '../pages/my/marketing_center/book_notification/marking_preview_page.dart';
import '../pages/my/marketing_center/book_notification/marking_recharge_select_page.dart';
import '../pages/my/marketing_center/book_notification/store_introduce_page.dart';
import '../pages/my/marketing_center/comments_setting_page.dart';
import '../pages/my/marketing_center/customer_notice_setting_page.dart';
import '../pages/my/marketing_center/marketing_center_home_page.dart';
import '../pages/my/marketing_center/order_setting_manager_page.dart';
... ... @@ -3015,3 +3016,23 @@ var commentManageHomePageHandle = new Handler(
return ChangeNotifierProvider<CommentManageProvider>(
create: (_) => CommentManageProvider(), child: CommentManageHomePage());
});
//客户通知----评价配置页
var commentsSettingPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
// String year = params["year"].first;
// String month = params["month"].first;
// String day = params["day"].first;
// String uid = params["uid"].first;
// DayList daylist = DayList.fromJson(json
// .decode(FluroConvertUtils.fluroCnParamsDecode(params["daylist"].first)));
return ChangeNotifierProvider<MarketingCenterProvider>(
create: (_) => MarketingCenterProvider(),
child: ChangeNotifierProvider<CouponProvider>(
create: (_) => CouponProvider(), child: CommentsSettingPage()));
});
... ...
... ... @@ -289,6 +289,10 @@ class Routes {
static String recharge_setting_page = "/recharge_setting_page"; // 充值优惠设置页
static String comment_manage_home_page = "/comment_manage_home_page"; // 评价管理
static String comments_setting_page = "/comments_setting_page"; // 评价管理设置
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
... ... @@ -538,5 +542,10 @@ class Routes {
router.define(recharge_setting_page, handler: rechargeSettingPageHandle);
router.define(comment_manage_home_page,
handler: commentManageHomePageHandle);
router.define(comments_setting_page,
handler: commentsSettingPageHandle);
}
}
... ...