You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

376 lines
12 KiB

import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
class ReportAssess extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _ReportAssess();
}
}
class _ReportAssess extends State<ReportAssess> {
ApiService? apiService;
TextEditingController editingController = TextEditingController();
int textLength = 0;
final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) {
apiService = ApiService(Dio(),
context: context, token: value.getString("token") ?? "", pay: true);
});
}
@override
Widget build(BuildContext context) {
return Container(
color: Color(0xFFF9FAF7),
child: Scaffold(
appBar: MyAppBar(
title: "发布评价",
titleColor: Colors.black,
titleSize: 17.sp,
background: Color(0xFFFFFFFF),
leadingColor: Colors.black,
actions: [
Container(
width: 46.w,
margin: EdgeInsets.only(right: 14,top: 14,bottom: 14),
decoration: BoxDecoration(
color: Color(0xFFB3B3B3),
borderRadius: BorderRadius.circular(4),
),
alignment: Alignment.center,
child: Text(
S.of(context).fabu,
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 14.sp,
color: Color(0xFFFFFFFF),
),
),
)
],
),
body: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {},
physics: BouncingScrollPhysics(),
scrollController: scrollController,
child: Container(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
height: 1,
color: Color(0xFFF2F2F2),
),
goodsAssessList(),
],
),
),
],
),
),
),
),
),
);
// Scaffold(
// appBar: MyAppBar(
// title: "发布评价",
// titleColor: Colors.black,
// titleSize: 17.sp,
// background: Color(0xFFFFFFFF),
// leadingColor: Colors.black,
// actions: [
// Container(
// width: 46.w,
// margin: EdgeInsets.only(right: 14,top: 14,bottom: 14),
// decoration: BoxDecoration(
// color: Color(0xFFB3B3B3),
// borderRadius: BorderRadius.circular(4),
// ),
// alignment: Alignment.center,
// child: Text(
// S.of(context).fabu,
// style: TextStyle(
// fontWeight: MyFontWeight.bold,
// fontSize: 14.sp,
// color: Color(0xFFFFFFFF),
// ),
// ),
// )
// ],
// ),
// body: Container(
// height: double.infinity,
// color: Color(0xFFFFFFFF),
// child: Stack(
// children: [
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Container(
// width: double.infinity,
// height: 1.h,
// color: Color(0xFFF2F2F2),
// ),
// SingleChildScrollView(
// physics: BouncingScrollPhysics(),
// child: Container(
// // margin: EdgeInsets.only(left: 14, right: 14, top: 13.h),
// child:Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// goodsAssessList(),
// ],
// ),
// ),
// )
// ],
// ),
// ],
// ),
// ),
// );
}
///评价列表
Widget goodsAssessList() {
return Container(
// margin: EdgeInsets.only(right:14.w,bottom:20.h),
child:Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ListView.builder(
padding: EdgeInsets.zero,
itemCount:6,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: goodsAssessItem(),
);
},
),
],
),
);
}
Widget goodsAssessItem(){
return Container(
color: Colors.white,
padding: EdgeInsets.all(14),
margin: EdgeInsets.only(bottom: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
child: Image.asset(
"assets/image/icon_story_td.webp",
fit: BoxFit.fill,
height: 51,
width: 51,
),
borderRadius: BorderRadius.circular(2),
),
SizedBox(width: 8.w,),
Expanded(child:Container(
height: 51,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"商品名称[生态小农]山林放养鸡蛋30枚/盒",
style: TextStyle(
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
Text(
"规格名称:套盒装",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
],
),
)),
],
),
goodsAssess(),
Container(
width: 80,
height: 80,
margin: EdgeInsets.only(bottom: 28.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
border: Border.all(
color: Color(0xFFB3B3B3),
width: 1,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
"assets/image/icon_upload.webp",
width:20,
height:20,
),
SizedBox(height: 4,),
Text(
"上传照片",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFFB3B3B3),
),
),
],
),
),
Text(
"满意度",
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 15.sp,
color: Color(0xFF000000),
),
),
SizedBox(height: 16.h),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
Image.asset(
"assets/image/report_un.webp",
width:45,
height:45,
),
SizedBox(height: 4,),
Text(
"不满意",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFF262626),
),
),
],
)),
Expanded(
child: Column(
children: [
Image.asset(
"assets/image/report_h.webp",
width:45,
height:45,
),
Text(
"很满意",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFF262626),
),
),
],
)),
],
)
],
),
);
}
///商品评价
Widget goodsAssess() {
return Container(
width: double.infinity,
height: 186.h,
margin: EdgeInsets.symmetric(vertical: 16.h),
color: Color(0xFFF7F7F7),
child: Column(
children: [
Container(
margin: EdgeInsets.fromLTRB(12.w, 5.h, 12.w, 0),
alignment: Alignment.topLeft,
child: TextField(
maxLines: 6,
controller: editingController,
onChanged: (value) {
setState(() {
textLength = value.length;
});
},
decoration: InputDecoration(
border: InputBorder.none,
hintText: "您的评价,会使我们变得更好",
hintStyle: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFB3B3B3),
),
),
),
),
],
),
);
}
}