添加查看评论接口

master
laiiihz 5 years ago
parent e3b2718b57
commit 959da98cf7

@ -261,12 +261,14 @@ class OrderApi {
static const String evaluation_add = "/v1/order/evaluation/create";
///
static const String orderReview =
"/v1/order/evaluation/orderEvaluationList";
static const String orderReview = "/v1/order/evaluation/orderEvaluationList";
///
static const String addReview =
"/v1/order/evaluation/createOrderEvaluationOne";
///
static const String checkReview = "/v1/order/evaluation/evaluationDea";
}
class HomeApi {

@ -959,11 +959,12 @@ class _HomePageState extends BaseStoreState<HomePage>
// AppRouter.push(context, RouteName.NEW_USER_DISCOUNT_PAGE);
}),
_buttonTitleRow(
// R.ASSETS_LOTTERY_REDEEM_LOTTERY_ICON_PNG,
AppConfig.getShowCommission()
? R.ASSETS_HOME_MENU_BB_PNG
: R.ASSETS_LISTTEMP_HOMELIFE_ICON_PNG,
AppConfig.getShowCommission() ? "我的店铺" : "家居生活",
R.ASSETS_LOTTERY_REDEEM_LOTTERY_ICON_PNG,
// AppConfig.getShowCommission()
// ? R.ASSETS_HOME_MENU_BB_PNG
// : R.ASSETS_LISTTEMP_HOMELIFE_ICON_PNG,
// AppConfig.getShowCommission() ? "我的店铺" : "家居生活",
'彩票兑换',
onPressed:
//TODO
() {

@ -3,6 +3,7 @@ import 'package:recook/constants/api.dart';
import 'package:recook/constants/constants.dart';
import 'package:recook/pages/user/review/models/order_review_list_model.dart';
import 'package:recook/pages/user/review/presenter/review_presenter.dart';
import 'package:recook/pages/user/review/widgets/review_card.dart';
import 'package:recook/widgets/refresh_widget.dart';
class AlreadyReviewPage extends StatefulWidget {
@ -51,141 +52,17 @@ class _AlreadyReviewPageState extends State<AlreadyReviewPage>
);
},
itemBuilder: (context, index) {
return _buildReviewCard(reviewModels[index]);
return ReviewCard(
onBack: () {},
model: reviewModels[index],
reviewStatusAdd: false,
);
},
itemCount: reviewModels.length,
),
);
}
_buildReviewCard(OrderReviewListModel model) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(rSize(8)),
),
padding: EdgeInsets.all(rSize(10)),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.network(
Api.getImgUrl(model.mainPhotoUrl),
height: rSize(80),
width: rSize(80),
),
SizedBox(width: rSize(10)),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
model.goodsName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
softWrap: false,
style: TextStyle(
color: Color(0xFF333333),
fontWeight: FontWeight.bold,
fontSize: rSP(14),
),
),
SizedBox(height: rSize(6)),
Text(
'型号规格 ${model.skuName}',
style: TextStyle(
color: Color(0xFF666666),
fontSize: rSP(13),
),
),
SizedBox(height: rSize(16)),
Row(
children: [
Expanded(
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: '订单金额 ',
),
TextSpan(
text:
'¥ ${model.goodsAmount.toStringAsFixed(0)}',
style: TextStyle(
color: Color(0xFF333333),
),
),
],
style: TextStyle(
color: Color(0xFF666666),
fontSize: rSP(14),
),
),
),
),
Expanded(
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: '购买数量 ',
),
TextSpan(
text: '${model.quantity}',
style: TextStyle(
color: Color(0xFF333333),
),
),
],
style: TextStyle(
color: Color(0xFF666666),
fontSize: rSP(14),
),
),
),
),
],
),
],
),
),
],
),
SizedBox(height: rSize(20)),
Align(
alignment: Alignment.centerRight,
child: SizedBox(
height: rSize(28),
width: rSize(76),
child: OutlineButton(
padding: EdgeInsets.all(1),
onPressed: () {},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(rSize(14)),
),
child: Text(
'评价',
style: TextStyle(
color: Color(0xFFDB2D2D),
),
),
splashColor: Colors.red.withOpacity(0.3),
highlightedBorderColor: Colors.red,
borderSide: BorderSide(
color: Colors.red,
),
),
),
),
],
),
);
}
@override
bool get wantKeepAlive => true;
}

@ -0,0 +1,179 @@
// import 'package:flutter/material.dart';
// import 'package:recook/const/resource.dart';
// import 'package:recook/constants/constants.dart';
// import 'package:recook/constants/styles.dart';
// import 'package:recook/widgets/recook_back_button.dart';
// class ReviewDetailPage extends StatefulWidget {
// final int id;
// ReviewDetailPage({Key key, this.id}) : super(key: key);
// @override
// _ReviewDetailPageState createState() => _ReviewDetailPageState();
// }
// class _ReviewDetailPageState extends State<ReviewDetailPage> {
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// backgroundColor: AppColor.frenchColor,
// appBar: AppBar(
// brightness: Brightness.light,
// backgroundColor: Colors.white,
// elevation: 0,
// leading: RecookBackButton(),
// centerTitle: true,
// title: Text(
// '我的评价',
// style: TextStyle(
// color: Color(0xFF333333),
// fontWeight: FontWeight.w600,
// ),
// ),
// ),
// body: SingleChildScrollView(
// padding: EdgeInsets.all(rSize(15)),
// child: Container(
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(rSize(8)),
// ),
// padding: EdgeInsets.all(rSize(10)),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.stretch,
// children: [
// Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// FadeInImage.assetNetwork(
// placeholder: R.ASSETS_PLACEHOLDER_NEW_1X1_A_PNG,
// //TODO
// // image: Api.getImgUrl(widget.model.mainPhotoUrl),
// height: rSize(56),
// width: rSize(56),
// ),
// SizedBox(width: rSize(10)),
// Expanded(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// Text(
// //todo
// // widget.model.goodsName,
// '',
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// softWrap: false,
// style: TextStyle(
// color: Color(0xFF333333),
// fontWeight: FontWeight.bold,
// fontSize: rSP(14),
// ),
// ),
// SizedBox(height: rSize(6)),
// Text(
// '型号规格 ${widget.model.skuName}',
// style: TextStyle(
// color: Color(0xFF666666),
// fontSize: rSP(13),
// ),
// ),
// ],
// ),
// ),
// ],
// ),
// TextField(
// onChanged: (value) {
// setState(() {});
// },
// controller: _controller,
// minLines: 5,
// maxLines: 100,
// style: TextStyle(
// color: Color(0xFF333333),
// fontSize: rSP(14),
// ),
// decoration: InputDecoration(
// border: InputBorder.none,
// hintText: '宝贝满足你的期待吗?说说你的使用心得,和大家分享吧',
// hintStyle: TextStyle(
// color: Color(0xFF999999),
// fontSize: rSP(14),
// ),
// ),
// ),
// GridView.builder(
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// crossAxisSpacing: rSize(8),
// mainAxisSpacing: rSize(8),
// ),
// itemBuilder: (context, index) {
// if (index == _mediaModels.length) {
// return Material(
// color: Colors.transparent,
// borderRadius: BorderRadius.circular(rSize(4)),
// child: Ink.image(
// image: AssetImage(R.ASSETS_USER_UPLOAD_IMAGES_WEBP),
// child: InkWell(
// onTap: () {
// ActionSheet.show(
// context,
// items: ['拍照', '从手机相册选择'],
// listener: (index) {
// if (index == 0) {
// ImagePicker.builder()
// .pickImage(
// source:
// flutterImagePicker.ImageSource.camera,
// )
// .then(
// (model) {
// if (model != null)
// _mediaModels.add(model);
// setState(() {});
// },
// );
// } else if (index == 1) {
// ImagePicker.builder(
// maxSelected: 6 - _mediaModels.length,
// pickType: PickType.onlyImage,
// ).pickAsset(context).then(
// (models) {
// if (models != null && models.isNotEmpty)
// _mediaModels.addAll(models);
// setState(() {});
// },
// );
// }
// Navigator.pop(context);
// },
// );
// },
// ),
// ),
// );
// } else {
// return ClipRRect(
// borderRadius: BorderRadius.circular(rSize(4)),
// child: Image.file(
// _mediaModels[index].file,
// fit: BoxFit.cover,
// ),
// );
// }
// },
// shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
// itemCount:
// _mediaModels.length == 6 ? 6 : _mediaModels.length + 1,
// ),
// ],
// ),
// ),
// ),
// );
// }
// }

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:recook/constants/api.dart';
import 'package:recook/constants/constants.dart';
import 'package:recook/constants/header.dart';
import 'package:recook/manager/http_manager.dart';
import 'package:recook/pages/user/review/add_review_page.dart';
import 'package:recook/pages/user/review/models/order_review_list_model.dart';
import 'package:recook/utils/custom_route.dart';
@ -9,7 +10,12 @@ import 'package:recook/utils/custom_route.dart';
class ReviewCard extends StatelessWidget {
final OrderReviewListModel model;
final VoidCallback onBack;
const ReviewCard({Key key, @required this.model, @required this.onBack})
final bool reviewStatusAdd;
const ReviewCard(
{Key key,
@required this.model,
@required this.onBack,
this.reviewStatusAdd = true})
: super(key: key);
@override
@ -120,21 +126,29 @@ class ReviewCard extends StatelessWidget {
child: OutlineButton(
padding: EdgeInsets.all(1),
onPressed: () {
CRoute.push(
context,
AddReviewPage(
goodsDetailId: model.goodsDetailId,
model: model,
),
).then((value) {
onBack();
});
if (reviewStatusAdd) {
CRoute.push(
context,
AddReviewPage(
goodsDetailId: model.goodsDetailId,
model: model,
),
).then((value) {
onBack();
});
} else {
HttpManager.post(OrderApi.checkReview, {
"id": model.evaluatedId,
}).then((value) {
print(value);
});
}
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(rSize(14)),
),
child: Text(
'评价',
reviewStatusAdd ? '评价' : '查看评价',
style: TextStyle(
color: Color(0xFFDB2D2D),
),

Loading…
Cancel
Save