添加 访谈管理

对接访谈管理相关接口
hmxc
张萌 4 years ago
parent 59581ad737
commit 8f511b0c53

@ -246,6 +246,12 @@ class _Manage {
///app /
String get clockApply => '/user/attendance/apply';
///app 访访
String get interviewList => '/user/interview/list';
///app 访访
String get interviewFeedBack => '/user/interview/feedBack';
}
class _Upload {

@ -0,0 +1,77 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:flutter/material.dart';
class InterviewListModel {
int id;
String name;
String tel;
String content;
int status;
String interviewDate;
String feedbackContent;
String feedbackDate;
String createName;
String createDate;
InterviewListModel(
{this.id,
this.name,
this.tel,
this.content,
this.status,
this.interviewDate,
this.feedbackContent,
this.feedbackDate,
this.createName,
this.createDate});
InterviewListModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
tel = json['tel'];
content = json['content'];
status = json['status'];
interviewDate = json['interviewDate'];
feedbackContent = json['feedbackContent'];
feedbackDate = json['feedbackDate'];
createName = json['createName'];
createDate = json['createDate'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['tel'] = this.tel;
data['content'] = this.content;
data['status'] = this.status;
data['interviewDate'] = this.interviewDate;
data['feedbackContent'] = this.feedbackContent;
data['feedbackDate'] = this.feedbackDate;
data['createName'] = this.createName;
data['createDate'] = this.createDate;
return data;
}
String get statusString {
switch (this.status) {
case 1:
return '待回复';
case 2:
return '已回复';
default:
return '未知';
}
}
Color get statusColor {
switch (this.status) {
case 1:
return kPrimaryColor;
case 2:
return kTextSubColor;
default:
return kTextPrimaryColor;
}
}
}

@ -1,6 +1,7 @@
// Flutter imports:
import 'package:aku_community_manager/ui/manage_pages/clock_in_out/clock_in_out_page.dart';
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_select_page.dart';
import 'package:aku_community_manager/ui/manage_pages/interview/interview_page.dart';
import 'package:flutter/material.dart';
// Package imports:
@ -89,7 +90,8 @@ class _ApplicationPageState extends State<ApplicationPage>
AppApplication('规程管理', R.ASSETS_HOME_RULES_PNG, () => RulesManagePage()),
AppApplication(
'卫生管理', R.ASSETS_PLACEHOLDER_WEBP, () => HygienceManagePage()),
AppApplication('考勤管理', R.ASSETS_PLACEHOLDER_WEBP, () => ClockInOutPage())
AppApplication('考勤管理', R.ASSETS_PLACEHOLDER_WEBP, () => ClockInOutPage()),
AppApplication('访谈管理', R.ASSETS_PLACEHOLDER_WEBP, () => InterviewPage())
];
@override

@ -1,6 +1,7 @@
// Flutter imports:
import 'package:aku_community_manager/ui/manage_pages/clock_in_out/clock_in_out_page.dart';
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_select_page.dart';
import 'package:aku_community_manager/ui/manage_pages/interview/interview_page.dart';
import 'package:flutter/material.dart';
// Package imports:
@ -60,7 +61,8 @@ class _SearchWorkOrderpageState extends State<SearchWorkOrderPage> {
AppApplication('规程管理', R.ASSETS_HOME_RULES_PNG, () => RulesManagePage()),
AppApplication(
'卫生管理', R.ASSETS_PLACEHOLDER_WEBP, () => HygienceManagePage()),
AppApplication('考勤管理', R.ASSETS_PLACEHOLDER_WEBP, () => ClockInOutPage())
AppApplication('考勤管理', R.ASSETS_PLACEHOLDER_WEBP, () => ClockInOutPage()),
AppApplication('访谈管理', R.ASSETS_PLACEHOLDER_WEBP, () => InterviewPage())
];
List<AppApplication> _displayApps = [];

@ -0,0 +1,169 @@
import 'package:aku_community_manager/models/manager/interview/interview_list_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/aku_divider.dart';
import 'package:aku_community_manager/ui/manage_pages/interview/interview_detail_page.dart';
import 'package:aku_community_manager/ui/manage_pages/interview/interview_feedback_page.dart';
import 'package:aku_ui/aku_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart';
class InterviewCard extends StatefulWidget {
final InterviewListModel model;
InterviewCard({Key key, this.model}) : super(key: key);
@override
_InterviewCardState createState() => _InterviewCardState();
}
class _InterviewCardState extends State<InterviewCard> {
@override
Widget build(BuildContext context) {
return AkuButton(
onPressed: () {
Get.to(() => InterviewDetailPage(
model: widget.model,
));
},
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
padding: EdgeInsets.all(24.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
'访谈信息'.text.size(32.sp).color(kTextPrimaryColor).bold.make(),
Spacer(),
widget.model.statusString.text
.size(28.sp)
.bold
.color(widget.model.statusColor)
.make()
],
),
16.w.heightBox,
AkuDivider.horizontal(),
24.w.heightBox,
...<Widget>[
_rowTile(
R.ASSETS_MANAGE_IC_RENWU_PNG,
'客户姓名',
'${widget.model.name}'
.text
.size(24.sp)
.color(kTextSubColor)
.make()),
_rowTile(
R.ASSETS_MANAGE_IC_RENWU_PNG,
'客户电话',
widget.model.tel.text
.size(24.sp)
.color(kTextSubColor)
.make()),
_rowTile(
R.ASSETS_MANAGE_IC_TIME_PNG,
'创建时间',
widget.model.createDate.text
.size(24.sp)
.color(kTextSubColor)
.make()),
...widget.model.interviewDate == null
? []
: [
_rowTile(
R.ASSETS_MANAGE_IC_TIME_PNG,
'访谈时间',
widget.model.interviewDate.text
.size(24.sp)
.color(kTextSubColor)
.make()),
],
...widget.model.feedbackDate == null
? []
: [
_rowTile(
R.ASSETS_MANAGE_IC_TIME_PNG,
'回复时间',
widget.model.feedbackDate.text
.size(24.sp)
.color(kTextSubColor)
.make()),
],
].sepWidget(separate: 12.w.heightBox),
_getBottomButtons(widget.model.status),
],
),
),
);
}
Widget _getBottomButtons(int status) {
MaterialButton button;
switch (status) {
case 1:
button = _bottomButton('访谈回复', () async {
await Get.to(() => InterviewFeedBackPage(
model: widget.model,
));
}, Color(0xFFFFC40C), Colors.black);
break;
case 2:
button = null;
break;
default:
return null;
}
return button == null
? SizedBox()
: Padding(
padding: EdgeInsets.only(top: 40.w),
child: Row(
children: [
Spacer(),
button,
],
),
);
}
Widget _bottomButton(
String title, Function onPressed, Color color, Color textColor,
{bool hasBorder = false}) {
return MaterialButton(
height: 52.w,
padding: EdgeInsets.symmetric(vertical: 8.w, horizontal: 24.w),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(74.w),
side: !hasBorder ? BorderSide.none : BorderSide(color: Colors.black),
),
color: color,
onPressed: onPressed,
elevation: 0,
focusElevation: 0,
hoverElevation: 0,
highlightElevation: 0,
child: title.text.size(26.sp).color(textColor).make(),
);
}
Widget _rowTile(String iconPath, String title, Widget content) {
return Row(
children: [
SizedBox(
width: 40.w,
height: 40.w,
child: Image.asset(iconPath),
),
12.w.widthBox,
title.text.size(24.sp).color(kTextSubColor).make(),
Spacer(),
content,
],
);
}
}

@ -0,0 +1,186 @@
import 'package:aku_community_manager/models/manager/interview/interview_list_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/aku_divider.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart';
class InterviewDetailPage extends StatefulWidget {
final InterviewListModel model;
InterviewDetailPage({Key key, this.model}) : super(key: key);
@override
_InterviewDetailPageState createState() => _InterviewDetailPageState();
}
class _InterviewDetailPageState extends State<InterviewDetailPage> {
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '访谈详情',
body: ListView(
padding: EdgeInsets.all(32.w),
children: [
_interviewInfo(),
24.w.heightBox,
_contentWidget(),
],
),
);
}
Widget _interviewInfo() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
padding: EdgeInsets.all(24.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
'访谈信息'.text.size(32.sp).color(kTextPrimaryColor).bold.make(),
Spacer(),
widget.model.statusString.text
.size(28.sp)
.bold
.color(widget.model.statusColor)
.make()
],
),
16.w.heightBox,
AkuDivider.horizontal(),
24.w.heightBox,
...<Widget>[
_rowTile(
R.ASSETS_MANAGE_IC_RENWU_PNG,
'客户姓名',
'${widget.model.name}'
.text
.size(24.sp)
.color(kTextSubColor)
.make()),
_rowTile(R.ASSETS_MANAGE_IC_RENWU_PNG, '客户电话',
widget.model.tel.text.size(24.sp).color(kTextSubColor).make()),
_rowTile(
R.ASSETS_OUTDOOR_IC_ADDRESS_PNG,
'创建时间',
widget.model.createDate.text
.size(24.sp)
.color(kTextSubColor)
.make()),
...widget.model.interviewDate == null
? []
: [
_rowTile(
R.ASSETS_MANAGE_IC_TIME_PNG,
'访谈时间',
widget.model.interviewDate.text
.size(24.sp)
.color(kTextSubColor)
.make()),
],
...widget.model.feedbackDate == null
? []
: [
_rowTile(
R.ASSETS_MANAGE_IC_TIME_PNG,
'回复时间',
widget.model.feedbackDate.text
.size(24.sp)
.color(kTextSubColor)
.make()),
],
].sepWidget(separate: 12.w.heightBox),
// _getBottomButtons(widget.model.status),
],
),
);
}
Widget _contentWidget() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
'访谈内容'.text.size(32.sp).color(kTextPrimaryColor).bold.make(),
Spacer(),
],
),
16.w.heightBox,
AkuDivider.horizontal(),
20.w.heightBox,
widget.model.content.text.size(28.sp).color(kTextPrimaryColor).make(),
40.w.heightBox,
Row(
children: [
Spacer(),
widget.model.interviewDate.text
.size(24.sp)
.color(kTextSubColor)
.make(),
],
),
...widget.model.feedbackContent == null
? []
: [
16.w.heightBox,
AkuDivider.horizontal(),
20.w.heightBox,
Row(
children: [
'访谈回复'
.text
.size(32.sp)
.color(kTextPrimaryColor)
.bold
.make(),
Spacer(),
],
),
12.w.heightBox,
widget.model.feedbackContent.text
.size(28.sp)
.color(kTextPrimaryColor)
.make(),
20.w.heightBox,
Row(
children: [
Spacer(),
widget.model.feedbackDate.text
.size(24.sp)
.color(kTextSubColor)
.make(),
],
),
]
],
),
);
}
Widget _rowTile(String iconPath, String title, Widget content) {
return Row(
children: [
SizedBox(
width: 40.w,
height: 40.w,
child: Image.asset(iconPath),
),
12.w.widthBox,
title.text.size(24.sp).color(kTextSubColor).make(),
Spacer(),
content,
],
);
}
}

@ -0,0 +1,213 @@
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/interview/interview_list_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/aku_divider.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
import 'package:aku_community_manager/utils/network/base_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart';
class InterviewFeedBackPage extends StatefulWidget {
final InterviewListModel model;
InterviewFeedBackPage({Key key, this.model}) : super(key: key);
@override
_InterviewFeedBackPageState createState() => _InterviewFeedBackPageState();
}
class _InterviewFeedBackPageState extends State<InterviewFeedBackPage> {
TextEditingController _textEditingController;
@override
void initState() {
super.initState();
_textEditingController = TextEditingController();
}
@override
void dispose() {
_textEditingController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '访谈回复',
body: ListView(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
children: [
_interviewInfo(),
24.w.heightBox,
_feedBackWidget(),
],
),
bottom: AkuBottomButton(
title: '立即回复',
onTap: () async {
BaseModel baseModel = await NetUtil().post(
API.manage.interviewFeedBack,
params: {
"id": widget.model.id,
"feedbackContent": _textEditingController.text,
},
showMessage: true,
);
if (baseModel.status) {
Get.back();
}
},
),
);
}
Widget _feedBackWidget() {
return Container(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
'访谈回复'.text.size(32.sp).color(kTextPrimaryColor).bold.make(),
Spacer(),
],
),
16.w.heightBox,
_inputWidget(_textEditingController,hintText:'请输入回复内容'),
],
),
);
}
Widget _inputWidget(
TextEditingController controller,
{String hintText,}
) {
return Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
border: Border.all(
width: 2.w,
color: Color(0xFFE8E8E8),
),
),
child: TextField(
minLines: 5,
maxLines: 10,
autofocus: false,
controller: controller,
onChanged: (value) {
controller.text = value;
},
decoration: InputDecoration(
hintText: hintText??'',
hintStyle: TextStyle(
fontSize: 28.sp,
color: kTextSubColor,
),
contentPadding:
EdgeInsets.symmetric(vertical: 16.w, horizontal: 24.w),
border: InputBorder.none,
isDense: true,
),
),
);
}
Widget _interviewInfo() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
padding: EdgeInsets.all(24.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
'访谈信息'.text.size(32.sp).color(kTextPrimaryColor).bold.make(),
Spacer(),
widget.model.statusString.text
.size(28.sp)
.bold
.color(widget.model.statusColor)
.make()
],
),
16.w.heightBox,
AkuDivider.horizontal(),
24.w.heightBox,
...<Widget>[
_rowTile(
R.ASSETS_MANAGE_IC_RENWU_PNG,
'客户姓名',
'${widget.model.name}'
.text
.size(24.sp)
.color(kTextSubColor)
.make()),
_rowTile(R.ASSETS_MANAGE_IC_RENWU_PNG, '客户电话',
widget.model.tel.text.size(24.sp).color(kTextSubColor).make()),
_rowTile(
R.ASSETS_OUTDOOR_IC_ADDRESS_PNG,
'创建时间',
widget.model.createDate.text
.size(24.sp)
.color(kTextSubColor)
.make()),
...widget.model.interviewDate == null
? []
: [
_rowTile(
R.ASSETS_MANAGE_IC_TIME_PNG,
'访谈时间',
widget.model.interviewDate.text
.size(24.sp)
.color(kTextSubColor)
.make()),
],
...widget.model.feedbackDate == null
? []
: [
_rowTile(
R.ASSETS_MANAGE_IC_TIME_PNG,
'回复时间',
widget.model.feedbackDate.text
.size(24.sp)
.color(kTextSubColor)
.make()),
],
].sepWidget(separate: 12.w.heightBox),
// _getBottomButtons(widget.model.status),
],
),
);
}
Widget _rowTile(String iconPath, String title, Widget content) {
return Row(
children: [
SizedBox(
width: 40.w,
height: 40.w,
child: Image.asset(iconPath),
),
12.w.widthBox,
title.text.size(24.sp).color(kTextSubColor).make(),
Spacer(),
content,
],
);
}
}

@ -0,0 +1,32 @@
import 'package:aku_community_manager/ui/manage_pages/interview/interview_view.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class InterviewPage extends StatefulWidget {
InterviewPage({Key key}) : super(key: key);
@override
_InterviewPageState createState() => _InterviewPageState();
}
class _InterviewPageState extends State<InterviewPage> with TickerProviderStateMixin {
TabController _tabController;
@override
void initState() {
super.initState();
_tabController=TabController(length: _tabs.length, vsync: this);
}
List<String> _tabs=['待回复','已回复'];
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '访谈管理',
appBarBottom: PreferredSize(preferredSize: Size.fromHeight(88.w),child: AkuTabBar(controller: _tabController, tabs: _tabs),),
body:TabBarView(
controller: _tabController,
children: List.generate(_tabs.length, (index) => InterviewView(index:index))),
);
}
}

@ -0,0 +1,59 @@
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/interview/interview_list_model.dart';
import 'package:aku_community_manager/ui/manage_pages/interview/interview_card.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class InterviewView extends StatefulWidget {
final int index;
InterviewView({Key key, this.index}) : super(key: key);
@override
_InterviewViewState createState() => _InterviewViewState();
}
class _InterviewViewState extends State<InterviewView> {
EasyRefreshController _refreshController;
@override
void initState() {
super.initState();
_refreshController = EasyRefreshController();
}
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeListView(
path: API.manage.interviewList,
controller: _refreshController,
extraParams: {
"interviewStatus": widget.index + 1,
},
convert: (models) {
return models.tableList
.map((e) => InterviewListModel.fromJson(e))
.toList();
},
builder: (items) {
return ListView.separated(
padding: EdgeInsets.all(24.w),
itemBuilder: (context, index) {
return InterviewCard(
model: items[index],
);
},
separatorBuilder: (_, __) {
return 24.w.heightBox;
},
itemCount: items.length);
});
}
}
Loading…
Cancel
Save