Commit 838c246d1afa09c981cdae196d2dc6dc59abdd0d

Authored by wdn127929
1 parent b38710fe

评价管理--部分UI

@@ -61,6 +61,10 @@ class Constant { @@ -61,6 +61,10 @@ class Constant {
61 '店长', 61 '店长',
62 '客户经理', 62 '客户经理',
63 ], 63 ],
  64 + '评价管理': [
  65 + '管理员',
  66 + '店长',
  67 + ],
64 '创建宴会': ['管理员', '店长', '客户经理', '收银员', '服务员', '前台'], 68 '创建宴会': ['管理员', '店长', '客户经理', '收银员', '服务员', '前台'],
65 '编辑宴会': ['管理员', '店长', '客户经理', '收银员', '服务员', '前台'], 69 '编辑宴会': ['管理员', '店长', '客户经理', '收银员', '服务员', '前台'],
66 '丢单': ['管理员', '店长', '客户经理', '收银员', '服务员', '前台'], 70 '丢单': ['管理员', '店长', '客户经理', '收银员', '服务员', '前台'],
@@ -454,4 +454,12 @@ class HttpUrl { @@ -454,4 +454,12 @@ class HttpUrl {
454 static const String wx_send_cancel_sms = 454 static const String wx_send_cancel_sms =
455 "?service=App.SendSMS.WxSendCancelSms"; // 取消订单发送短信 455 "?service=App.SendSMS.WxSendCancelSms"; // 取消订单发送短信
456 456
  457 + static const String get_seller_comments =
  458 + "?service=App.Customer.GetSellerComments"; // 获取评价列表
  459 +
  460 + static const String get_count_comment_label =
  461 + "?service=App.Customer.GetCountCommentLabel"; // 获取标签
  462 +
  463 + static const String set_comment = "?service=App.User.SetComment"; // 用户评论【预订】
  464 +
457 } 465 }
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter/rendering.dart';
  3 +import 'package:one_key/provider/user_model.dart';
  4 +import 'package:one_key/res/colors.dart';
  5 +import 'package:one_key/widgets/h_empty_view.dart';
  6 +import 'package:one_key/widgets/round_button.dart';
  7 +import 'package:one_key/widgets/system_app_bar.dart';
  8 +import 'package:one_key/widgets/v_empty_view.dart';
  9 +import 'package:provider/provider.dart';
  10 +
  11 +import '../../../provider/comment_manage_provider.dart';
  12 +import '../../../utils/event_bus.dart';
  13 +import '../../../utils/screen_util.dart';
  14 +import '../../../utils/utils.dart';
  15 +
  16 +/**
  17 + * 评价管理
  18 + */
  19 +
  20 +class CommentManageHomePage extends StatefulWidget {
  21 + @override
  22 + _CommentManageHomePageState createState() => _CommentManageHomePageState();
  23 +}
  24 +
  25 +class _CommentManageHomePageState extends State<CommentManageHomePage> {
  26 + CommentManageProvider commentManageProvider;
  27 +
  28 + @override
  29 + void initState() {
  30 + super.initState();
  31 +
  32 + WidgetsBinding.instance.addPostFrameCallback((_) {
  33 + _getSellerComments();
  34 + });
  35 + }
  36 +
  37 + @override
  38 + void dispose() {
  39 + bus.emit('changeStatusColor');
  40 +
  41 + super.dispose();
  42 + }
  43 +
  44 + ///我的客户首页
  45 + _getSellerComments({bool isShowLoading = true}) async {
  46 + Map<String, String> pramas = {
  47 + 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
  48 + 'scene': '3',
  49 + 'status': '1'
  50 + };
  51 + // label
  52 + await commentManageProvider.getSellerComments(context, pramas,
  53 + isShowLoading: isShowLoading);
  54 + }
  55 +
  56 + List<Widget> _labelWidget() {
  57 + List<Widget> data = [];
  58 +
  59 + for (int i = 0; i < 10; i++) {
  60 + data.add(Container(
  61 + padding: EdgeInsets.symmetric(horizontal: w(8), vertical: w(3)),
  62 + decoration: BoxDecoration(
  63 + borderRadius: BorderRadius.circular(r(10)),
  64 + color: true ? MyColours.color_33438E93 : MyColours.color_F8F7F3),
  65 + child: Text(
  66 + '全部',
  67 + style: TextStyle(
  68 + fontSize: font(14),
  69 + color: true ? MyColours.color_438E93 : MyColours.color_515151),
  70 + ),
  71 + ));
  72 + }
  73 + return data;
  74 + }
  75 +
  76 + @override
  77 + Widget build(BuildContext context) {
  78 + commentManageProvider =
  79 + Provider.of<CommentManageProvider>(context, listen: true);
  80 + return Scaffold(
  81 + backgroundColor: MyColours.color_ffffff,
  82 + appBar: SystemAppBar('评价管理'),
  83 + body: Padding(
  84 + padding: EdgeInsets.symmetric(horizontal: w(20)),
  85 + child: Column(
  86 + children: [
  87 + Container(
  88 + child: Wrap(
  89 + runSpacing: w(10),
  90 + spacing: w(10),
  91 + children: _labelWidget()),
  92 + ),
  93 + VEmptyView(10),
  94 + Expanded(
  95 + child: ListView.builder(
  96 + itemCount: 10,
  97 + shrinkWrap: true,
  98 + itemBuilder: (context, index) {
  99 + return Container(
  100 + margin: EdgeInsets.only(top: w(10)),
  101 + decoration: BoxDecoration(
  102 + border: Border(
  103 + bottom: BorderSide(
  104 + width: w(0.5),
  105 + color: MyColours.color_DBDBDB))),
  106 + child: Row(
  107 + crossAxisAlignment: CrossAxisAlignment.start,
  108 + children: [
  109 + Container(
  110 + width: w(50),
  111 + height: w(50),
  112 + margin: EdgeInsets.only(
  113 + left: w(8), right: w(8), top: w(20)),
  114 + child: ClipRRect(
  115 + borderRadius:
  116 + BorderRadius.circular(w(50)),
  117 + child: Container(
  118 + width: w(50),
  119 + height: w(50),
  120 + decoration: BoxDecoration(
  121 + color: MyColours.color_d9d9d9,
  122 + borderRadius:
  123 + BorderRadius.circular(r(50))),
  124 + ))),
  125 + HEmptyView(34),
  126 + Expanded(
  127 + child: Padding(
  128 + padding: EdgeInsets.symmetric(
  129 + vertical: w(4)),
  130 + child: Column(
  131 + crossAxisAlignment:
  132 + CrossAxisAlignment.start,
  133 + children: [
  134 + Row(
  135 + children: [
  136 + Container(
  137 + padding:
  138 + EdgeInsets.symmetric(
  139 + vertical: w(4)),
  140 + constraints:
  141 + BoxConstraints(
  142 + maxWidth: w(120)),
  143 + child: Text(
  144 + '四处行走的花',
  145 + maxLines: 10,
  146 + overflow: TextOverflow
  147 + .ellipsis,
  148 + style: TextStyle(
  149 + fontSize: font(14),
  150 + fontWeight:
  151 + FontWeight.bold,
  152 + color: MyColours
  153 + .color_515151),
  154 + )),
  155 + Spacer(),
  156 + Container(
  157 + width: w(75),
  158 + height: w(24),
  159 + child: ListView.builder(
  160 + itemCount: 5,
  161 + shrinkWrap: true,
  162 + scrollDirection:
  163 + Axis.horizontal,
  164 + itemBuilder:
  165 + (context, index) {
  166 + return Image.asset(
  167 + Utils.getImgPath(
  168 + 'zwzp'),
  169 + width: w(15),
  170 + );
  171 + })),
  172 + Container(
  173 + padding:
  174 + EdgeInsets.symmetric(
  175 + vertical: w(4)),
  176 + child: Text(
  177 + '非常满意',
  178 + maxLines: 2,
  179 + overflow: TextOverflow
  180 + .ellipsis,
  181 + style: TextStyle(
  182 + fontSize: font(12),
  183 + color: MyColours
  184 + .color_999999),
  185 + )),
  186 + ],
  187 + ),
  188 + VEmptyView(8),
  189 + Container(
  190 + padding: EdgeInsets.symmetric(
  191 + vertical: w(4)),
  192 + child: Text(
  193 + '就餐于 2023-8-24 午餐 二楼205',
  194 + maxLines: 10,
  195 + overflow:
  196 + TextOverflow.ellipsis,
  197 + style: TextStyle(
  198 + fontSize: font(12),
  199 + color: MyColours
  200 + .color_999999),
  201 + )),
  202 + Container(
  203 + padding: EdgeInsets.symmetric(
  204 + vertical: w(4)),
  205 + child: Text(
  206 + '发表于 2023-8-25',
  207 + maxLines: 10,
  208 + overflow:
  209 + TextOverflow.ellipsis,
  210 + style: TextStyle(
  211 + fontSize: font(12),
  212 + color: MyColours
  213 + .color_999999),
  214 + )),
  215 + VEmptyView(8),
  216 + Container(
  217 + padding: EdgeInsets.symmetric(
  218 + vertical: w(4)),
  219 + child: Text(
  220 + '第二次来了,味道还是一如既往的好吃,包间也很干净整洁,',
  221 + style: TextStyle(
  222 + height: 1.8,
  223 + fontSize: font(12),
  224 + color: MyColours
  225 + .color_515151),
  226 + )),
  227 + Container(
  228 + padding: EdgeInsets.symmetric(
  229 + vertical: w(4)),
  230 + child: Text(
  231 + '#口味佳,服务热情',
  232 + style: TextStyle(
  233 + height: 1.8,
  234 + fontSize: font(12),
  235 + color: MyColours
  236 + .color_438E93),
  237 + )),
  238 + VEmptyView(8),
  239 + Align(
  240 + alignment:
  241 + Alignment.centerRight,
  242 + child: RoundButton(
  243 + text: '回复',
  244 + width: w(54),
  245 + height: w(24),
  246 + gradientStart:
  247 + MyColours.color_ffffff,
  248 + gradientEnd:
  249 + MyColours.color_ffffff,
  250 + textColor:
  251 + MyColours.color_000000,
  252 + fontSize: 24,
  253 + borderColor:
  254 + MyColours.color_999999,
  255 + radius: r(15),
  256 + ),
  257 + ),
  258 + VEmptyView(26),
  259 + ]))),
  260 + ],
  261 + ),
  262 + );
  263 + }))
  264 + ],
  265 + )));
  266 + }
  267 +}
@@ -1305,7 +1305,29 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { @@ -1305,7 +1305,29 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
1305 !Utils.getAuthority( 1305 !Utils.getAuthority(
1306 context, '营销中心'))), 1306 context, '营销中心'))),
1307 InkWell( 1307 InkWell(
1308 - onTap: () {}, child: _item('', '空空空空')), 1308 + onTap: () {
  1309 + if (outDay == '0') {
  1310 + return;
  1311 + }
  1312 + if (Utils.getAuthority(
  1313 + context, '评价管理')) {
  1314 + NavigatorUtil
  1315 + .goCommentManageHomePage(
  1316 + context);
  1317 + }
  1318 + },
  1319 + child: _item(
  1320 + outDay == '0' ||
  1321 + !Utils.getAuthority(
  1322 + context, '评价管理')
  1323 + ? Utils.getImgPath(
  1324 + 'my_comment_un')
  1325 + : Utils.getImgPath(
  1326 + 'my_comment'),
  1327 + '评价管理',
  1328 + isRowLow: outDay == '0' ||
  1329 + !Utils.getAuthority(
  1330 + context, '评价管理'))),
1309 InkWell( 1331 InkWell(
1310 onTap: () {}, child: _item('', '空空空空')), 1332 onTap: () {}, child: _item('', '空空空空')),
1311 ], 1333 ],
  1 +import 'package:flutter/material.dart';
  2 +import 'package:one_key/constant/state.dart';
  3 +
  4 +import '../constant/constant.dart';
  5 +import '../constant/error.dart';
  6 +import '../net/base_resp.dart';
  7 +import '../net/dio_util.dart';
  8 +import '../net/http_url.dart';
  9 +import '../utils/utils.dart';
  10 +
  11 +class CommentManageProvider extends ChangeNotifier {
  12 + PageState pageState = PageState.Loading;
  13 +
  14 + ///获取评价列表
  15 + Future<dynamic> getSellerComments(
  16 + BuildContext context, Map<String, String> params,
  17 + {isShowLoading = true}) async {
  18 + BaseResp<dynamic> baseResp = await DioUtil()
  19 + .request<dynamic>(context, Method.get, HttpUrl.get_seller_comments,
  20 + data: params, showLoading: isShowLoading)
  21 + .catchError((error) {
  22 + print(error.toString());
  23 + if (error is MyError) {
  24 + switch (error.type) {
  25 + case 1:
  26 + pageState = PageState.ConnectivityError;
  27 + break;
  28 + case 2:
  29 + pageState = PageState.ConnectivityTimeOut;
  30 + break;
  31 + default:
  32 + pageState = PageState.ConnectivityError;
  33 + break;
  34 + }
  35 + }
  36 + notifyListeners();
  37 + return false;
  38 + });
  39 + if (baseResp.code == Constant.status_success) {
  40 + // beFollowData =
  41 + // GetBanquetBeFollowModel.fromJson(baseResp.responseData).data;
  42 +
  43 + // if (beFollowData.length == 0) {
  44 + // pageState = PageState.Empty;
  45 + // } else {
  46 + // pageState = PageState.Success;
  47 + // }
  48 +
  49 + notifyListeners();
  50 + return true;
  51 + // } else {
  52 + // return false;
  53 + // }
  54 + } else {
  55 + if (baseResp != null) {
  56 + Utils.showToast(baseResp.msg ?? "");
  57 + }
  58 + pageState = PageState.ConnectivityError;
  59 + notifyListeners();
  60 + return false;
  61 + }
  62 + }
  63 +}
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 2
3 class MyColours { 3 class MyColours {
  4 +
  5 +
  6 +
  7 + static const Color color_F8F7F3 = Color(0xFFF8F7F3);
4 static const Color color_33438E93 = Color(0x33438E93); 8 static const Color color_33438E93 = Color(0x33438E93);
5 static const Color color_E89243 = Color(0xFFE89243); 9 static const Color color_E89243 = Color(0xFFE89243);
6 static const Color color_3E6F51 = Color(0xFF3E6F51); 10 static const Color color_3E6F51 = Color(0xFF3E6F51);
@@ -1497,12 +1497,8 @@ class NavigatorUtil { @@ -1497,12 +1497,8 @@ class NavigatorUtil {
1497 1497
1498 ///我的------存酒详情 1498 ///我的------存酒详情
1499 static Future<dynamic> goWineDetailPage( 1499 static Future<dynamic> goWineDetailPage(
1500 - BuildContext context,  
1501 - String idstr,  
1502 - bool isStoreWine, {  
1503 - replace = false,  
1504 - bool onlyShow = false  
1505 - }) { 1500 + BuildContext context, String idstr, bool isStoreWine,
  1501 + {replace = false, bool onlyShow = false}) {
1506 return _navigateTo(context, 1502 return _navigateTo(context,
1507 "${Routes.wine_detail_page}?idstr=$idstr&isStoreWine=${isStoreWine}&onlyShow=${onlyShow}", 1503 "${Routes.wine_detail_page}?idstr=$idstr&isStoreWine=${isStoreWine}&onlyShow=${onlyShow}",
1508 replace: replace); 1504 replace: replace);
@@ -1801,4 +1797,13 @@ class NavigatorUtil { @@ -1801,4 +1797,13 @@ class NavigatorUtil {
1801 return _navigateTo(context, "${Routes.recharge_setting_page}", 1797 return _navigateTo(context, "${Routes.recharge_setting_page}",
1802 replace: replace); 1798 replace: replace);
1803 } 1799 }
  1800 +
  1801 + /// 评价管理
  1802 + static Future<dynamic> goCommentManageHomePage(
  1803 + BuildContext context, {
  1804 + replace = false,
  1805 + }) {
  1806 + return _navigateTo(context, "${Routes.comment_manage_home_page}",
  1807 + replace: replace);
  1808 + }
1804 } 1809 }
@@ -182,6 +182,7 @@ import '../pages/feast/feast_set_page.dart'; @@ -182,6 +182,7 @@ import '../pages/feast/feast_set_page.dart';
182 import '../pages/feast/feast_setmeal_page.dart'; 182 import '../pages/feast/feast_setmeal_page.dart';
183 import '../pages/feast/feast_wine_page.dart'; 183 import '../pages/feast/feast_wine_page.dart';
184 import '../pages/message/message_recharge_info_page.dart'; 184 import '../pages/message/message_recharge_info_page.dart';
  185 +import '../pages/my/comment_manage/comment_manage_home_page.dart';
185 import '../pages/my/customer_type/my_customer/my_customer_home_page.dart'; 186 import '../pages/my/customer_type/my_customer/my_customer_home_page.dart';
186 import '../pages/my/customer_type/store_customer/day_order_page.dart'; 187 import '../pages/my/customer_type/store_customer/day_order_page.dart';
187 import '../pages/my/customer_type/store_customer/month_order_page.dart'; 188 import '../pages/my/customer_type/store_customer/month_order_page.dart';
@@ -242,6 +243,7 @@ import '../pages/order_advance/order_create_temporary_page.dart'; @@ -242,6 +243,7 @@ import '../pages/order_advance/order_create_temporary_page.dart';
242 import '../pages/order_advance/order_edit_list_show_page.dart'; 243 import '../pages/order_advance/order_edit_list_show_page.dart';
243 import '../pages/order_advance/order_preview_page.dart'; 244 import '../pages/order_advance/order_preview_page.dart';
244 import '../pages/order_advance/order_share_page.dart'; 245 import '../pages/order_advance/order_share_page.dart';
  246 +import '../provider/comment_manage_provider.dart';
245 import '../provider/feast_model.dart'; 247 import '../provider/feast_model.dart';
246 import '../provider/marketing_center_provider.dart'; 248 import '../provider/marketing_center_provider.dart';
247 import '../provider/plan_dish_provider.dart'; 249 import '../provider/plan_dish_provider.dart';
@@ -2550,12 +2552,13 @@ var wineDetailPageHandle = new Handler( @@ -2550,12 +2552,13 @@ var wineDetailPageHandle = new Handler(
2550 String idstr = params["idstr"].first; 2552 String idstr = params["idstr"].first;
2551 2553
2552 bool isStoreWine = FluroConvertUtils.string2bool(params["isStoreWine"].first); 2554 bool isStoreWine = FluroConvertUtils.string2bool(params["isStoreWine"].first);
2553 - bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first); 2555 + bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
2554 return ChangeNotifierProvider<StoreWineProvider>( 2556 return ChangeNotifierProvider<StoreWineProvider>(
2555 create: (_) => StoreWineProvider(), 2557 create: (_) => StoreWineProvider(),
2556 child: ChangeNotifierProvider<CustomerProvider>( 2558 child: ChangeNotifierProvider<CustomerProvider>(
2557 create: (_) => CustomerProvider(), 2559 create: (_) => CustomerProvider(),
2558 - child: WineDetailPage(idstr: idstr, isStoreWine: isStoreWine,onlyShow:onlyShow))); 2560 + child: WineDetailPage(
  2561 + idstr: idstr, isStoreWine: isStoreWine, onlyShow: onlyShow)));
2559 }); 2562 });
2560 2563
2561 ///我的----存酒记录 2564 ///我的----存酒记录
@@ -2997,3 +3000,18 @@ var rechargeSettingPageHandle = new Handler( @@ -2997,3 +3000,18 @@ var rechargeSettingPageHandle = new Handler(
2997 return ChangeNotifierProvider<MarketingCenterProvider>( 3000 return ChangeNotifierProvider<MarketingCenterProvider>(
2998 create: (_) => MarketingCenterProvider(), child: RechargeSettingPage()); 3001 create: (_) => MarketingCenterProvider(), child: RechargeSettingPage());
2999 }); 3002 });
  3003 +
  3004 +//评价管理
  3005 +var commentManageHomePageHandle = new Handler(
  3006 + handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
  3007 + // String year = params["year"].first;
  3008 + // String month = params["month"].first;
  3009 + // String day = params["day"].first;
  3010 + // String uid = params["uid"].first;
  3011 +
  3012 + // DayList daylist = DayList.fromJson(json
  3013 + // .decode(FluroConvertUtils.fluroCnParamsDecode(params["daylist"].first)));
  3014 +
  3015 + return ChangeNotifierProvider<CommentManageProvider>(
  3016 + create: (_) => CommentManageProvider(), child: CommentManageHomePage());
  3017 +});
@@ -287,6 +287,7 @@ class Routes { @@ -287,6 +287,7 @@ class Routes {
287 287
288 static String coupon_setting_page = "/coupon_setting_page"; // 优惠券设置页 288 static String coupon_setting_page = "/coupon_setting_page"; // 优惠券设置页
289 static String recharge_setting_page = "/recharge_setting_page"; // 充值优惠设置页 289 static String recharge_setting_page = "/recharge_setting_page"; // 充值优惠设置页
  290 + static String comment_manage_home_page = "/comment_manage_home_page"; // 评价管理
290 291
291 static void configureRoutes(FluroRouter router) { 292 static void configureRoutes(FluroRouter router) {
292 router.notFoundHandler = new Handler( 293 router.notFoundHandler = new Handler(
@@ -535,5 +536,7 @@ class Routes { @@ -535,5 +536,7 @@ class Routes {
535 router.define(coupon_setting_page, handler: couponSettingPageHandle); 536 router.define(coupon_setting_page, handler: couponSettingPageHandle);
536 537
537 router.define(recharge_setting_page, handler: rechargeSettingPageHandle); 538 router.define(recharge_setting_page, handler: rechargeSettingPageHandle);
  539 + router.define(comment_manage_home_page,
  540 + handler: commentManageHomePageHandle);
538 } 541 }
539 } 542 }