From accc2929325ae62ecd20b08315feba133c28a7ec Mon Sep 17 00:00:00 2001 From: laiiihz Date: Tue, 3 Nov 2020 22:29:20 +0800 Subject: [PATCH] update business and fix detail page --- lib/mock_models/fix/fix_model.dart | 4 -- .../business_and_fix_detail_page.dart | 55 +++++++++++++++++++ pubspec.lock | 7 +++ pubspec.yaml | 2 + 4 files changed, 64 insertions(+), 4 deletions(-) diff --git a/lib/mock_models/fix/fix_model.dart b/lib/mock_models/fix/fix_model.dart index 44db53f..333ec11 100644 --- a/lib/mock_models/fix/fix_model.dart +++ b/lib/mock_models/fix/fix_model.dart @@ -90,10 +90,6 @@ class FixModel { material: '无', imgs: [R.ASSETS_STATIC_FIX_FOOD_PNG], ), - review: UserReviewInfo( - rate: 5, - content: '师傅太用心了', - ), ), ), FixModel( diff --git a/lib/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart b/lib/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart index 5f8f4f8..8e43353 100644 --- a/lib/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart +++ b/lib/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart @@ -108,6 +108,7 @@ class _BusinessAndFixDetailPageState extends State { _buildType(widget.model.type == FIX_ENUM.HAND_OUT), _buildProcess(), detailModel.result == null ? SizedBox() : _buildResult(), + detailModel.review == null ? SizedBox() : _buildRating(), ], ), bottom: Builder( @@ -405,6 +406,45 @@ class _BusinessAndFixDetailPageState extends State { ); } + _buildRating() { + return _buildRawBox( + title: '评价信息', + spacing: 24, + children: [ + Row( + children: [ + Text( + '综合评分', + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 28.w, + ), + ), + Spacer(), + _buildStar(detailModel.review.rate), + ], + ), + AkuBox.h(24), + Text( + '评价内容', + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 28.w, + ), + ), + AkuBox.h(8), + Text( + detailModel.review.content, + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.w, + fontWeight: FontWeight.bold, + ), + ), + ], + ); + } + Widget _buildTile(String asset, String title, String subTitle) { return Row( children: [ @@ -498,6 +538,21 @@ class _BusinessAndFixDetailPageState extends State { ); } + _buildStar(double count) { + List children = []; + for (int i = 0; i < count; i++) { + children.add(Icon( + Icons.star, + color: AppStyle.primaryColor, + size: 32.w, + )); + children.add(AkuBox.w(16)); + } + return Row( + children: children..removeLast(), + ); + } + _buildRawBox({ String title, List children, diff --git a/pubspec.lock b/pubspec.lock index 47462f2..55bb1a6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -141,6 +141,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.11" + flutter_rating_bar: + dependency: "direct main" + description: + name: flutter_rating_bar + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.1+1" flutter_screenutil: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 7aef2b0..1d99d92 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -50,6 +50,8 @@ dependencies: image_picker: ^0.6.7+12 + flutter_rating_bar: ^3.0.1+1 + aku_ui: git: url: http://test.akuhotel.com:8099/aku_fe/aku_ui.git