移除**文件,添加问卷调查详情页

hmxc
张萌 4 years ago
parent 1829b3f929
commit bba0d4e52c

@ -1,282 +0,0 @@
// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_html/flutter_html.dart';
// Project imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/cached_image_wrapper.dart';
class QuestionnaireDetailsPage extends StatefulWidget {
final Bundle bundle;
QuestionnaireDetailsPage({Key key, this.bundle}) : super(key: key);
@override
_QuestionnaireDetailsPageState createState() =>
_QuestionnaireDetailsPageState();
}
const htmlData = '''
<p>
<br/>
</p>
''';
class _QuestionnaireDetailsPageState extends State<QuestionnaireDetailsPage> {
TextEditingController _ideaContent = new TextEditingController();
String hintText = '您的宝贵意见是我们前进的明灯';
List<Map<String, dynamic>> _listQuestion = [
{
'title': '您的身份是?',
'option': <Map<String, dynamic>>[
{'title': '学员', 'isCheck': false},
{'title': '家长', 'isCheck': false}
]
},
{
'title': '您所学习的课程是?',
'option': <Map<String, dynamic>>[
{'title': '儿童美术', 'isCheck': false},
{'title': '素描', 'isCheck': false},
{'title': '国画', 'isCheck': false},
{'title': '漫画', 'isCheck': false},
{'title': '书法', 'isCheck': false},
{'title': '陶艺', 'isCheck': false}
]
},
{
'title': '您选择我们的原因是?',
'option': <Map<String, dynamic>>[
{'title': '师资力量', 'isCheck': false},
{'title': '教学口碑', 'isCheck': false},
{'title': '地理位置', 'isCheck': false},
{'title': '其他人介绍', 'isCheck': false}
]
},
{
'title': '学习后孩子的成绩是否有所提升?',
'option': <Map<String, dynamic>>[
{'title': '有很大变化有很大变化有很大变化有很大变化有很大变化有很大变化', 'isCheck': false},
{'title': '变化一般', 'isCheck': false},
{'title': '没变化', 'isCheck': false}
]
}
];
Widget _questionCard(String title, List<Map<String, dynamic>> optionList) {
return Container(
margin: EdgeInsets.only(top: 64.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: BaseStyle.fontSize32,
color: BaseStyle.color4a4b51,
),
),
Container(
margin: EdgeInsets.only(top: 64.w),
child: Wrap(
runSpacing: 48.w,
children: optionList
.map((item) => InkWell(
onTap: () {
setState(() {
item['isCheck'] = !item['isCheck'];
});
},
child: Container(
margin: EdgeInsets.only(left: 15.w),
width: MediaQuery.of(context).size.width / 2.35,
child: Row(
children: [
Icon(
item['isCheck']
? Icons.radio_button_checked
: Icons.radio_button_unchecked,
color: item['isCheck']
? BaseStyle.colorffc40c
: BaseStyle.color979797,
size: 32.w,
),
Container(
margin: EdgeInsets.only(left: 16.w),
width: MediaQuery.of(context).size.width / 3.2,
child: Text(
item['title'],
maxLines: 2,
style: TextStyle(
fontWeight: item['isCheck']
? FontWeight.w600
: FontWeight.normal,
fontSize: BaseStyle.fontSize28,
color: BaseStyle.color4a4b51,
),
),
),
],
),
),
))
.toList(),
),
),
],
),
);
}
Widget _containerTextField() {
return Container(
padding: EdgeInsets.only(top: 24.w, left: 24.w, right: 32.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.all(color: Color(0xffd4cfbe), width: 1.0),
),
child: TextFormField(
cursorColor: Color(0xffffc40c),
style: TextStyle(
fontSize: BaseStyle.fontSize28,
fontWeight: FontWeight.w600,
),
controller: _ideaContent,
onChanged: (String value) {},
maxLines: 10,
decoration: InputDecoration(
isDense: true,
contentPadding: EdgeInsets.only(
top: 0,
bottom: 0,
),
hintText: hintText,
border: InputBorder.none, //线
fillColor: Colors.white,
filled: true,
hintStyle: TextStyle(
color: BaseStyle.color999999,
fontSize: BaseStyle.fontSize28,
fontWeight: FontWeight.normal,
),
),
),
);
}
Widget _positionedBottomBar() {
return Positioned(
bottom: 0,
child: Container(
alignment: Alignment.center,
height: 98.w,
width: MediaQuery.of(context).size.width,
child: InkWell(
onTap: () {},
child: Container(
alignment: Alignment.center,
color: BaseStyle.colorffc40c,
padding: EdgeInsets.symmetric(
vertical: 26.5.w,
),
child: Text(
'确认提交',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: BaseStyle.fontSize32,
color: ktextPrimary,
),
),
),
),
),
);
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '问卷调查',
body: Container(
color: Colors.white,
child: Stack(
children: [
Container(
padding: EdgeInsets.only(
left: 32.w,
right: 32.w,
bottom: 155.w,
),
child: ListView(
children: [
Container(
margin: EdgeInsets.only(top: 24.w),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(4.w)),
child: CachedImageWrapper(
url: widget.bundle.getMap('details')['imagePath'],
width: 686.w,
height: 228.w,
),
),
),
Container(
margin: EdgeInsets.only(top: 40.w),
alignment: Alignment.center,
child: Text(
widget.bundle.getMap('details')['title'],
style: TextStyle(
fontSize: BaseStyle.fontSize32,
color: BaseStyle.color4a4b51,
fontWeight: FontWeight.w600,
),
),
),
Container(
margin: EdgeInsets.only(top: 35.w),
alignment: Alignment.center,
width: 672.w,
child: Html(data: htmlData),
),
Container(
margin: EdgeInsets.only(top: 129.w),
child: Column(
children: _listQuestion
.map((item) => _questionCard(
item['title'],
item['option'],
))
.toList(),
),
),
Container(
margin: EdgeInsets.only(top: 80.w, bottom: 24.w),
child: Text(
'您的觉得我们需要改进的地方',
style: TextStyle(
fontSize: BaseStyle.fontSize28, color: ktextPrimary),
),
),
_containerTextField(),
],
),
),
_positionedBottomBar(),
],
),
),
);
}
}

@ -0,0 +1,72 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/manager/questionnaire_detail_model.dart';
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/buttons/bottom_button.dart';
import 'package:flutter/material.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
class QuestionnaireDetailPage extends StatefulWidget {
final int id;
QuestionnaireDetailPage({Key key, this.id}) : super(key: key);
@override
_QuestionnaireDetailPageState createState() =>
_QuestionnaireDetailPageState();
}
class _QuestionnaireDetailPageState extends State<QuestionnaireDetailPage> {
QuestionnaireDetialModel _model;
bool _onload = true;
Widget _emptyWidget() {
return Container();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '问卷调查',
body: EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),
onRefresh: () async {
_model = await ManagerFunc.questionnairefindById(widget.id);
_onload = false;
},
child: _onload
? _emptyWidget()
: ListView(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
),
width: double.infinity,
height: 228.w,
clipBehavior: Clip.antiAlias,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_LOGO_PNG,
image: API.image(_model.voResourcesImgList.first.url)),
),
40.w.heightBox,
_model.title.text.color(ktextPrimary).size(32.sp).bold.make(),
36.w.heightBox,
_model.description.text
.color(ktextPrimary)
.size(28.sp)
.make(),
130.w.heightBox,
],
),
),
bottomNavi: BottomButton(
child: '确认提交'.text.black.size(32.sp).bold.make(),
onPressed: () {},
),
);
}
}

@ -2,6 +2,7 @@ import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/constants/api.dart'; import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/manager/questinnaire_model.dart'; import 'package:akuCommunity/model/manager/questinnaire_model.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart'; import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/ui/manager/questionnaire/questionnaire_detail_page.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/others/stack_avatar.dart'; import 'package:akuCommunity/widget/others/stack_avatar.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -111,7 +112,9 @@ class _QuestionnairePageState extends State<QuestionnairePage> {
// padding: // padding:
// EdgeInsets.symmetric(horizontal: 30.w, vertical: 8.w), // EdgeInsets.symmetric(horizontal: 30.w, vertical: 8.w),
elevation: 0, elevation: 0,
onPressed: () {}, onPressed: () {
QuestionnaireDetailPage(id: model.id,).to();
},
child: (_getButtonText(model.status)) child: (_getButtonText(model.status))
.text .text
.black .black
Loading…
Cancel
Save