添加 咨询建议/投诉表演 完成反馈

对接其接口
hmxc
张萌 4 years ago
parent db68667f41
commit 39c76ff04a

@ -230,6 +230,9 @@ class _Manager {
///app ///app
String get communityIntroduceInfo => '/user/communityIntroduction/findEnable'; String get communityIntroduceInfo => '/user/communityIntroduction/findEnable';
////
String get completeFeedBack => '/user/advice/completeFeedback';
} }
class _Community { class _Community {

@ -43,7 +43,7 @@ class _ServiceBrowsePageState extends State<ServiceBrowsePage> {
}, },
builder: (items) { builder: (items) {
return ListView.separated( return ListView.separated(
padding: EdgeInsets.symmetric(vertical: 24.w), padding: EdgeInsets.symmetric(vertical: 24.w),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return _buildCard(items[index]); return _buildCard(items[index]);
}, },
@ -58,39 +58,39 @@ class _ServiceBrowsePageState extends State<ServiceBrowsePage> {
Widget _buildCard(ServiceBrowseListModel model) { Widget _buildCard(ServiceBrowseListModel model) {
return Container( return Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), width: double.infinity,
width: double.infinity, child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ model.name.text
model.name.text .size(32.sp)
.size(32.sp) .color(ktextPrimary)
.color(ktextPrimary) .maxLines(1)
.maxLines(1) .overflow(TextOverflow.ellipsis)
.overflow(TextOverflow.ellipsis) .bold
.bold .make(),
.make(), 32.w.heightBox,
32.w.heightBox, model.content.text
model.content.text .size(24.sp)
.size(24.sp) .color(ktextSubColor)
.color(ktextSubColor) .maxLines(3)
.maxLines(3) .overflow(TextOverflow.ellipsis)
.overflow(TextOverflow.ellipsis) .make(),
.make(), 32.w.heightBox,
32.w.heightBox, Row(
Row( children: [
children: [ '南宁人才公寓'.text.size(20.sp).color(ktextSubColor).make(),
'南宁人才公寓'.text.size(20.sp).color(ktextSubColor).make(), Spacer(),
Spacer(), '发布于 ${DateUtil.formatDateStr(model.createDate, format: 'MM-dd HH:mm')}'
'发布于 ${DateUtil.formatDateStr(model.createDate, format: 'MM-dd HH:mm')}' .text
.text .size(20.sp)
.size(20.sp) .color(ktextSubColor)
.color(ktextSubColor) .make(),
.make(), ],
], ),
), ],
], ),
)); );
} }
} }

@ -1,3 +1,5 @@
import 'package:aku_community/utils/network/base_model.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
@ -165,38 +167,67 @@ class _AdviceDetailPageState extends State<AdviceDetailPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
title: '查看详情', title: '查看详情',
systemStyle: SystemStyle.yellowBottomBar, systemStyle: SystemStyle.yellowBottomBar,
actions: [ // actions: [
TextButton( // TextButton(
onPressed: () => // onPressed: () =>
Get.to(() => AdviceEvaluatePage(id: widget.model!.id)), // Get.to(() => AdviceEvaluatePage(id: widget.model!.id)),
child: '评价'.text.make(), // child: '评价'.text.make(),
// ),
// ],
body: EasyRefresh(
firstRefresh: true,
child: _loading ? _buildShimmer() : _buildChild(),
controller: _refreshController,
header: MaterialHeader(),
onRefresh: () async {
Response res = await NetUtil().dio!.get(
API.manager.adviceDetail,
queryParameters: {'adviceId': widget.model!.id},
);
_model = AdviceDetailModel.fromJson(res.data);
_loading = false;
if (mounted) setState(() {});
},
), ),
bottomNavi: _bottomButtons());
}
Widget _bottomButtons() {
return Row(
children: [
widget.model?.status == 3
? SizedBox()
: SizedBox(
width: 290.w,
child: BottomButton(
bgColor: Colors.black,
textColor: Colors.white,
onPressed: () async {
bool result = await (Get.to(
() => AdviceAddCommentPage(id: widget.model!.id)));
if (result && mounted) _refreshController.callRefresh();
},
child: '继续提问'.text.bold.make(),
),
),
Expanded(
child: BottomButton(
onPressed: () async {
BaseModel baseModel =
await NetUtil().get(API.manager.completeFeedBack, params: {
"adviceId": widget.model!.id,
});
if (baseModel.status ?? false) {
Get.to(() => AdviceEvaluatePage(id: widget.model!.id));
}
BotToast.showText(text: baseModel.message ?? '未知错误');
},
child: '完成沟通'.text.bold.make(),
),
)
], ],
body: EasyRefresh(
firstRefresh: true,
child: _loading ? _buildShimmer() : _buildChild(),
controller: _refreshController,
header: MaterialHeader(),
onRefresh: () async {
Response res = await NetUtil().dio!.get(
API.manager.adviceDetail,
queryParameters: {'adviceId': widget.model!.id},
);
_model = AdviceDetailModel.fromJson(res.data);
_loading = false;
if (mounted) setState(() {});
},
),
bottomNavi: BottomButton(
onPressed: () async {
bool result =
await (Get.to(() => AdviceAddCommentPage(id: widget.model!.id)));
if (result && mounted) _refreshController.callRefresh();
},
child: '继续提问'.text.bold.make(),
),
); );
} }
} }

@ -7,11 +7,14 @@ import 'package:aku_community/base/base_style.dart';
class BottomButton extends StatelessWidget { class BottomButton extends StatelessWidget {
final VoidCallback? onPressed; final VoidCallback? onPressed;
final Widget child; final Widget child;
final Color bgColor;
final Color textColor;
const BottomButton({ const BottomButton({
Key? key, Key? key,
required this.onPressed, required this.onPressed,
required this.child, required this.child,
this.bgColor = kPrimaryColor,
this.textColor = ktextPrimary,
}) : super(key: key); }) : super(key: key);
@override @override
@ -23,10 +26,10 @@ class BottomButton extends StatelessWidget {
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
disabledColor: Colors.white.withOpacity(0.5), disabledColor: Colors.white.withOpacity(0.5),
disabledTextColor: ktextSubColor.withOpacity(0.8), disabledTextColor: ktextSubColor.withOpacity(0.8),
textColor: ktextPrimary, textColor: textColor,
child: child, child: child,
onPressed: onPressed, onPressed: onPressed,
color: kPrimaryColor, color: bgColor,
height: 98.w, height: 98.w,
minWidth: double.infinity, minWidth: double.infinity,
), ),

Loading…
Cancel
Save