问卷调查功能添加;投诉表扬部分功能

pull/1/head
戴余标 3 years ago
parent 8829381ae9
commit cad5108bd0

@ -0,0 +1,17 @@
class NEWAPI {
///HOST
static const String host = 'http://127.0.0.1:8006';
///
static const String baseURL = '$host';
//
static _Questionnaire questionnaire = _Questionnaire();
}
class _Questionnaire {
///
String get list => '/app/user/questionnaire/list';
///id
String get detail => '/app/user/questionnaire/findById';
///
String get submit => '/app/user/questionnaire/submit';
}

@ -40,6 +40,7 @@ class SAASAPI {
static _CommunityIntroduce communityIntroduce = _CommunityIntroduce();
static _ConveniencePhone conveniencePhone = _ConveniencePhone();
static _CommitteeStaff committeeStaff = _CommitteeStaff();
static _Advice advice = _Advice();
///
static _ProfileApi profile = _ProfileApi();
@ -357,3 +358,19 @@ class _CommitteeStaff {
///
String get list => '/app/user/industryCommittee/list';
}
class _Advice{
///
String get list => '/app/user/advice/list';
////
String get insert => '/app/user/advice/insert';
////id /
String get find => '/app/user/advice/findById';
///
String get reQuestion => '/app/user/advice/reQuestion';
///
String get complete => '/app/user/advice/complete';
///
String get evaluate => '/app/user/advice/evaluate';
////
String get delete => '/app/user/advice/delete';
}

@ -3,79 +3,62 @@ import 'package:common_utils/common_utils.dart';
import 'package:aku_new_community/model/common/img_model.dart';
class AdviceDetailModel {
AppAdviceDetailVo? appAdviceDetailVo;
AppAdviceFBIDetailVo? appAdviceFBIDetailVo;
List<AppAdviceFBIContentVos>? appAdviceFBIContentVos;
AdviceDetailModel({this.appAdviceDetailVo});
AdviceDetailModel({this.appAdviceFBIDetailVo, this.appAdviceFBIContentVos});
AdviceDetailModel.fromJson(Map<String, dynamic> json) {
appAdviceDetailVo = json['appAdviceDetailVo'] != null
? new AppAdviceDetailVo.fromJson(json['appAdviceDetailVo'])
appAdviceFBIDetailVo = json['appAdviceFBIDetailVo'] != null
? new AppAdviceFBIDetailVo.fromJson(json['appAdviceFBIDetailVo'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.appAdviceDetailVo != null) {
data['appAdviceDetailVo'] = this.appAdviceDetailVo!.toJson();
}
return data;
}
}
class AppAdviceDetailVo {
AppAdviceVo? appAdviceVo;
List<AppAdviceContentVos>? appAdviceContentVos;
AppAdviceDetailVo({this.appAdviceVo, this.appAdviceContentVos});
AppAdviceDetailVo.fromJson(Map<String, dynamic> json) {
appAdviceVo = json['appAdviceVo'] != null
? new AppAdviceVo.fromJson(json['appAdviceVo'])
: null;
if (json['appAdviceContentVos'] != null) {
appAdviceContentVos = [];
json['appAdviceContentVos'].forEach((v) {
appAdviceContentVos!.add(new AppAdviceContentVos.fromJson(v));
if (json['appAdviceFBIContentVos'] != null) {
appAdviceFBIContentVos = [];
json['appAdviceFBIContentVos'].forEach((v) {
appAdviceFBIContentVos!.add(new AppAdviceFBIContentVos.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.appAdviceVo != null) {
data['appAdviceVo'] = this.appAdviceVo!.toJson();
if (this.appAdviceFBIDetailVo != null) {
data['appAdviceFBIDetailVo'] = this.appAdviceFBIDetailVo!.toJson();
}
if (this.appAdviceContentVos != null) {
data['appAdviceContentVos'] =
this.appAdviceContentVos!.map((v) => v.toJson()).toList();
if (this.appAdviceFBIContentVos != null) {
data['appAdviceFBIContentVos'] =
this.appAdviceFBIContentVos!.map((v) => v.toJson()).toList();
}
return data;
}
}
class AppAdviceVo {
class AppAdviceFBIDetailVo {
int? id;
int? type;
int? status;
String? content;
int? score;
String? createDate;
List<ImgModel>? imgUrls;
DateTime? get date => DateUtil.getDateTime(createDate!);
AppAdviceVo(
AppAdviceFBIDetailVo(
{this.id,
this.type,
this.status,
this.content,
this.score,
this.createDate,
this.imgUrls});
AppAdviceVo.fromJson(Map<String, dynamic> json) {
AppAdviceFBIDetailVo.fromJson(Map<String, dynamic> json) {
id = json['id'];
type = json['type'];
status = json['status'];
content = json['content'];
score = json['score'];
createDate = json['createDate'];
if (json['imgUrls'] != null) {
imgUrls = [];
@ -91,6 +74,7 @@ class AppAdviceVo {
data['type'] = this.type;
data['status'] = this.status;
data['content'] = this.content;
data['score'] = this.score;
data['createDate'] = this.createDate;
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls!.map((v) => v.toJson()).toList();
@ -99,14 +83,14 @@ class AppAdviceVo {
}
}
class AppAdviceContentVos {
class AppAdviceFBIContentVos {
int? id;
int? createUserType;
String? content;
String? createDate;
int? parentId;
AppAdviceContentVos(
AppAdviceFBIContentVos(
{this.id,
this.createUserType,
this.content,
@ -115,7 +99,7 @@ class AppAdviceContentVos {
DateTime? get date => DateUtil.getDateTime(createDate!);
AppAdviceContentVos.fromJson(Map<String, dynamic> json) {
AppAdviceFBIContentVos.fromJson(Map<String, dynamic> json) {
id = json['id'];
createUserType = json['createUserType'];
content = json['content'];

@ -10,6 +10,8 @@ class QuestionnaireModel {
int? answerNum;
List<ImgModel>? imgUrls;
List<ImgModel>? headImgURls;
bool? answered;
bool? allowAnswer;
QuestionnaireModel(
{this.id,
@ -20,7 +22,10 @@ class QuestionnaireModel {
this.status,
this.answerNum,
this.imgUrls,
this.headImgURls});
this.headImgURls,
this.answered,
this.allowAnswer,
});
QuestionnaireModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
@ -44,6 +49,9 @@ class QuestionnaireModel {
});
} else
headImgURls = [];
answered = json['answered'];
allowAnswer = json['allowAnswer'];
}
Map<String, dynamic> toJson() {
@ -61,6 +69,8 @@ class QuestionnaireModel {
if (this.headImgURls != null) {
data['headImgURls'] = this.headImgURls!.map((v) => v.toJson()).toList();
}
data['answered']=this.answered;
data['allowAnswer']=this.allowAnswer;
return data;
}
}

@ -24,15 +24,15 @@ class QuestionnaireDetialModel {
description = json['description'];
beginDate = json['beginDate'];
endDate = json['endDate'];
if (json['questionnaireTopicVoList'] != null) {
if (json['appQuestionnaireFBITopicVoList'] != null) {
questionnaireTopicVoList = [];
json['questionnaireTopicVoList'].forEach((v) {
json['appQuestionnaireFBITopicVoList'].forEach((v) {
questionnaireTopicVoList!.add(new QuestionnaireTopicVoList.fromJson(v));
});
}
if (json['voResourcesImgList'] != null) {
if (json['imgList'] != null) {
voResourcesImgList = [];
json['voResourcesImgList'].forEach((v) {
json['imgList'].forEach((v) {
voResourcesImgList!.add(new ImgModel.fromJson(v));
});
} else
@ -47,11 +47,11 @@ class QuestionnaireDetialModel {
data['beginDate'] = this.beginDate;
data['endDate'] = this.endDate;
if (this.questionnaireTopicVoList != null) {
data['questionnaireTopicVoList'] =
data['appQuestionnaireFBITopicVoList'] =
this.questionnaireTopicVoList!.map((v) => v.toJson()).toList();
}
if (this.voResourcesImgList != null) {
data['voResourcesImgList'] =
data['imgList'] =
this.voResourcesImgList!.map((v) => v.toJson()).toList();
}
return data;
@ -71,9 +71,9 @@ class QuestionnaireTopicVoList {
id = json['id'];
type = json['type'];
topic = json['topic'];
if (json['questionnaireChoiceVoList'] != null) {
if (json['appQuestionnaireFBITopicChoiceVoList'] != null) {
questionnaireChoiceVoList = [];
json['questionnaireChoiceVoList'].forEach((v) {
json['appQuestionnaireFBITopicChoiceVoList'].forEach((v) {
questionnaireChoiceVoList!
.add(new QuestionnaireChoiceVoList.fromJson(v));
});
@ -87,7 +87,7 @@ class QuestionnaireTopicVoList {
data['type'] = this.type;
data['topic'] = this.topic;
if (this.questionnaireChoiceVoList != null) {
data['questionnaireChoiceVoList'] =
data['appQuestionnaireFBITopicChoiceVoList'] =
this.questionnaireChoiceVoList!.map((v) => v.toJson()).toList();
} else
questionnaireChoiceVoList = [];

@ -1,4 +1,6 @@
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/new_api.dart';
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/model/manager/article_QR_code_model.dart';
import 'package:aku_new_community/model/manager/moving_company_model.dart';
import 'package:aku_new_community/model/manager/questionnaire_detail_model.dart';
@ -229,7 +231,7 @@ class ManagerFunc {
static Future<QuestionnaireDetialModel> questionnairefindById(int? id) async {
BaseModel baseModel = await NetUtil().get(
API.manager.questionnairefindById,
NEWAPI.questionnaire.detail,
params: {
'questionnaireId': id,
},
@ -241,7 +243,7 @@ class ManagerFunc {
static Future<BaseModel> questionnaireSubmit(
int? id, List<AppQuestionnaireAnswerSubmits> model) async {
BaseModel baseModel = await NetUtil().post(
API.manager.questionnaireSubmit,
NEWAPI.questionnaire.submit,
params: {
'id': id,
'appQuestionnaireAnswerSubmits': model,

@ -91,7 +91,7 @@ class _AdviceDetailPageState extends State<AdviceDetailPage> {
);
}
_buildAdviceContent(AppAdviceContentVos item) {
_buildAdviceContent(AppAdviceFBIContentVos item) {
String type = '';
switch (item.createUserType) {
case 1:
@ -127,13 +127,14 @@ class _AdviceDetailPageState extends State<AdviceDetailPage> {
children: [
'您的$adviceValue'.text.black.bold.size(38.sp).make(),
30.hb,
_model.appAdviceDetailVo!.appAdviceVo!.content!.text
_model.appAdviceFBIDetailVo!.content!
.text
.color(ktextSubColor)
.size(28.sp)
.make(),
24.hb,
DateUtil.formatDate(
_model.appAdviceDetailVo!.appAdviceVo!.date,
_model.appAdviceFBIDetailVo!.date,
format: 'yyyy年MM月dd日 HH:mm',
).text.size(24.sp).color(Color(0xFF999999)).make(),
...widget.model!.imgUrls!.isEmpty
@ -154,7 +155,7 @@ class _AdviceDetailPageState extends State<AdviceDetailPage> {
color: Color(0xFFD8D8D8),
)
],
..._model.appAdviceDetailVo!.appAdviceContentVos!
..._model.appAdviceFBIContentVos!
.map((e) => _buildAdviceContent(e))
.toList(),
],
@ -186,10 +187,10 @@ class _AdviceDetailPageState extends State<AdviceDetailPage> {
header: MaterialHeader(),
onRefresh: () async {
Response res = await NetUtil().dio!.get(
API.manager.adviceDetail,
SAASAPI.advice.find,
queryParameters: {'adviceId': widget.model!.id},
);
_model = AdviceDetailModel.fromJson(res.data);
_model = AdviceDetailModel.fromJson(res.data['data']);
_loading = false;
if (mounted) setState(() {});
},
@ -219,7 +220,7 @@ class _AdviceDetailPageState extends State<AdviceDetailPage> {
child: BottomButton(
onPressed: () async {
BaseModel baseModel =
await NetUtil().get(API.manager.completeFeedBack, params: {
await NetUtil().get(SAASAPI.advice.complete, params: {
"adviceId": widget.model!.id,
});
if (baseModel.success) {
@ -229,7 +230,7 @@ class _AdviceDetailPageState extends State<AdviceDetailPage> {
},
child: '完成沟通'.text.bold.make(),
),
)
),
],
);
}

@ -111,7 +111,7 @@ class _AdvicePageState extends State<AdvicePage> with TickerProviderStateMixin {
controller: _tabController,
children: List.generate(2, (index) {
return BeeListView<SuggestionOrComplainModel>(
path: API.manager.advice,
path: SAASAPI.advice.list,
extraParams: {'adviceType': adviceValue(index)},
controller: _refreshController,
convert: (model) => model.rows
@ -168,7 +168,7 @@ class _AdvicePageState extends State<AdvicePage> with TickerProviderStateMixin {
firstChild: BottomButton(
onPressed: () async {
await NetUtil().post(
API.manager.deleteAdvice,
SAASAPI.advice.delete,
params: {'ids': _selectedItems},
showMessage: true,
);

@ -11,7 +11,6 @@ import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/const/resource.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/app_theme.dart';
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/provider/app_provider.dart';
@ -97,9 +96,9 @@ class _NewAdvicePageState extends State<NewAdvicePage> {
Future addAdvice(int type, List<File> files, String content) async {
VoidCallback cancel = BotToast.showLoading();
List<String?> urls =
await NetUtil().uploadFiles(files, API.upload.uploadAdvice);
await NetUtil().uploadFiles(files,SAASAPI.uploadFile.uploadImg);
BaseModel baseModel = await NetUtil().post(
API.manager.addAdvice,
SAASAPI.advice.insert,
params: {
'type': type,
'content': content,

@ -14,6 +14,7 @@ import 'package:aku_new_community/utils/network/base_model.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/buttons/bottom_button.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -21,9 +22,9 @@ import 'package:get/get.dart';
class QuestionnaireDetailPage extends StatefulWidget {
final int? id;
final int? status;
final bool? answered;
QuestionnaireDetailPage({Key? key, this.id, this.status}) : super(key: key);
QuestionnaireDetailPage({Key? key, this.id, this.answered}) : super(key: key);
@override
_QuestionnaireDetailPageState createState() =>
@ -258,12 +259,14 @@ class _QuestionnaireDetailPageState extends State<QuestionnaireDetailPage> {
bottomNavi: BottomButton(
child: '确认提交'
.text
.color(widget.status != 2 ? ktextSubColor : ktextPrimary)
.color(widget.answered! ? ktextSubColor : ktextPrimary)
.size(32.sp)
.bold
.make(),
onPressed: widget.status != 2
? () {}
onPressed: widget.answered != 2
? () {
BotToast.showText(text: '该问卷已填写过');
}
: () async {
BaseModel baseModel = await ManagerFunc.questionnaireSubmit(
widget.id, _submitModels);

@ -1,5 +1,6 @@
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/new_api.dart';
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:aku_new_community/model/manager/questinnaire_model.dart';
@ -10,6 +11,7 @@ import 'package:aku_new_community/utils/hive_store.dart';
import 'package:aku_new_community/utils/websocket/tips_dialog.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/others/stack_avatar.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -40,12 +42,11 @@ class _QuestionnairePageState extends State<QuestionnairePage> {
String _getButtonText(int? status) {
switch (status) {
case 1:
return '未开始';
case 2:
return '去投票';
return '进行中';
case 3:
return '已结束';
case 4:
return '已投票';
default:
return '';
}
@ -54,10 +55,14 @@ class _QuestionnairePageState extends State<QuestionnairePage> {
Widget _buildCard(QuestionnaireModel model) {
return GestureDetector(
onTap: () {
if(model.status==2){
Get.to(() => QuestionnaireDetailPage(
id: model.id,
status: model.status,
answered: model.answered,
));
}else{
BotToast.showText(text: '该问卷已结束或未开始');
}
},
child: Container(
decoration: BoxDecoration(
@ -142,6 +147,7 @@ class _QuestionnairePageState extends State<QuestionnairePage> {
if (model.status == 2) {
Get.to(() => QuestionnaireDetailPage(
id: model.id,
answered: model.answered,
));
}
},
@ -171,7 +177,7 @@ class _QuestionnairePageState extends State<QuestionnairePage> {
return BeeScaffold(
title: '问卷调查',
body: BeeListView<QuestionnaireModel>(
path: API.manager.questionnaireList,
path: NEWAPI.questionnaire.list,
controller: _easyRefreshController,
convert: (model) {
return model.rows

@ -101,8 +101,6 @@ class ApplicationUtil {
title: '投诉表扬',
imgPath: Assets.newIcon.icTsby.path,
onTap: () {
BotToast.showText(text: '此功能暂未上线');
return;
Get.to(() => AdvicePage(type: AdviceType.COMPLAIN));
}),
AppElement(

Loading…
Cancel
Save