投诉/建议功能添加

pull/1/head
戴余标 3 years ago
parent 0e0ff7a387
commit 5036d2e368

@ -37,6 +37,8 @@ import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../../ui/manager/advice/advice_page.dart';
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
HomePage({Key? key}) : super(key: key); HomePage({Key? key}) : super(key: key);
@ -356,11 +358,7 @@ class _HomePageState extends State<HomePage>
), ),
), ),
onTap: () async { onTap: () async {
BotToast.showText( Get.to(AdvicePage(type: AdviceType.SUGGESTION));
text: '此功能升级中,稍后上线',
align: Alignment(0, 0.5));
// Get.to(AdvicePage(
// type: AdviceType.SUGGESTION));
}, },
), ),
) )

@ -70,9 +70,9 @@ class _AdviceAddCommentPageState extends State<AdviceAddCommentPage> {
onPressed: () async { onPressed: () async {
if (_formKey.currentState!.validate()) { if (_formKey.currentState!.validate()) {
BaseModel baseModel = await NetUtil().post( BaseModel baseModel = await NetUtil().post(
API.manager.adviceQuestion, SAASAPI.advice.reQuestion,
params: { params: {
'adviceId': widget.id, 'appAdviceId': widget.id,
'content': _textEditingController.text, 'content': _textEditingController.text,
'parentId': 0, 'parentId': 0,
}, },

@ -1,5 +1,5 @@
import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart';
import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/utils/network/net_util.dart';
@ -67,9 +67,10 @@ class _AdviceEvaluatePageState extends State<AdviceEvaluatePage> {
color: kPrimaryColor, color: kPrimaryColor,
elevation: 0, elevation: 0,
onPressed: () async { onPressed: () async {
BaseModel baseModel = await NetUtil().post( print(_rating);
API.manager.adviceEvaluate, BaseModel baseModel = await NetUtil().get(
params: {'id': widget.id, 'score': _rating}, SAASAPI.advice.evaluate,
params: {'adviceId': widget.id, 'score': _rating},
showMessage: true, showMessage: true,
); );
if (baseModel.success) { if (baseModel.success) {

@ -0,0 +1,167 @@
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/widget/bee_scaffold.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';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';
import '../../../base/base_style.dart';
import '../../../constants/saas_api.dart';
import '../../../gen/assets.gen.dart';
import '../../../models/user/my_house_model.dart';
import '../../../utils/network/net_util.dart';
import '../../../widget/bee_divider.dart';
import '../../../widget/others/user_tool.dart';
import '../../../widget/tag/bee_tag.dart';
import '../../profile/house/add_house_page.dart';
import '../../profile/new_house/apply_record_page.dart';
import '../../profile/new_house/my_house_page.dart';
import '../../profile/new_house/widgets/add_house_button.dart';
class AdviceHousePage extends StatefulWidget {
const AdviceHousePage({Key? key}) : super(key: key);
@override
State<AdviceHousePage> createState() => _AdviceHousePageState();
}
class _AdviceHousePageState extends State<AdviceHousePage> {
EasyRefreshController _refreshController = EasyRefreshController();
@override
void initState() {
super.initState();
}
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '我的房屋',
body: SafeArea(
child: UserTool.userProvider.myHouses.isEmpty
? HouseEmptyWidget()
: EasyRefresh(
controller: _refreshController,
firstRefresh: true,
header: MaterialHeader(),
onRefresh: () async {
await UserTool.userProvider.updateMyHouseInfo();
setState(() {});
},
child: ListView(
padding:
EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
children: <Widget>[
...UserTool.userProvider.myHouses
.map((e) => _houseCard(e))
.toList()
].sepWidget(separate: 24.w.heightBox),
),
)),
);
}
Widget _houseCard(MyHouseModel model) {
return Stack(
children: [
GestureDetector(
onTap: () async {
var base = await NetUtil().get(
SAASAPI.profile.house.switchDefaultEstate,
params: {'estateId': model.id});
if (base.success) {
_refreshController.callRefresh();
UserTool.userProvider.updateDefaultHouse();
Get.back();
} else {
BotToast.showText(text: '切换默认房屋失败');
}
},
child: Material(
child: Container(
width: 686.w,
padding: EdgeInsets.all(24.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w)),
child: Column(
children: [
Row(
children: [
'${model.addressName} ${model.communityName}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
8.w.heightBox,
Row(
children: [
'${model.buildingName}${model.unitName}单元${model.estateName}'
.text
.size(36.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
24.w.widthBox,
model.isDefault == 1
? BeeTag.yellowSolid(
text: '${model.manageEstateTypeName}')
: BeeTag.blackSolid(
text: '${model.manageEstateTypeName}'),
],
),
24.w.heightBox,
BeeDivider.horizontal(),
24.w.heightBox,
Row(
children: [
model.isDefault == 1
? BeeTag.yellowHollow(
text: '${model.manageEstateTypeName}')
: BeeTag.blackHollow(
text: '${model.manageEstateTypeName}'),
10.w.widthBox,
'${model.name} ${model.tel}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
)
],
),
),
),
),
if (model.isDefault == 1)
Positioned(
top: 0,
right: 0,
child: ClipPath(
clipper: TriangleClipper(),
child: Container(
width: 120.w,
height: 80.w,
color: kPrimaryColor,
alignment: Alignment.topRight,
child: Padding(
padding: EdgeInsets.only(right: 10.w, top: 10.w),
child: Icon(
Icons.check,
size: 40.w,
color: Colors.white,
),
),
)),
),
],
);
}
}

@ -5,7 +5,6 @@ import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/app_theme.dart'; import 'package:aku_new_community/constants/app_theme.dart';
import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/model/manager/suggestion_or_complain_model.dart'; import 'package:aku_new_community/model/manager/suggestion_or_complain_model.dart';
@ -15,7 +14,6 @@ import 'package:aku_new_community/ui/manager/advice/new_advice_page.dart';
import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/hive_store.dart'; import 'package:aku_new_community/utils/hive_store.dart';
import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:aku_new_community/utils/websocket/tips_dialog.dart';
import 'package:aku_new_community/widget/animated/animated_transition.dart'; import 'package:aku_new_community/widget/animated/animated_transition.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart';
@ -76,7 +74,7 @@ class _AdvicePageState extends State<AdvicePage> with TickerProviderStateMixin {
Future.delayed(Duration(milliseconds: 0), () async { Future.delayed(Duration(milliseconds: 0), () async {
var agreement = await HiveStore.appBox?.get('AdvicePage') ?? false; var agreement = await HiveStore.appBox?.get('AdvicePage') ?? false;
if (!agreement) { if (!agreement) {
await TipsDialog.tipsDialog(); //await TipsDialog.tipsDialog();
HiveStore.appBox!.put('AdvicePage', true); HiveStore.appBox!.put('AdvicePage', true);
} }
}); });
@ -112,7 +110,7 @@ class _AdvicePageState extends State<AdvicePage> with TickerProviderStateMixin {
children: List.generate(2, (index) { children: List.generate(2, (index) {
return BeeListView<SuggestionOrComplainModel>( return BeeListView<SuggestionOrComplainModel>(
path: SAASAPI.advice.list, path: SAASAPI.advice.list,
extraParams: {'adviceType': adviceValue(index)}, extraParams: {'type': adviceValue(index)},
controller: _refreshController, controller: _refreshController,
convert: (model) => model.rows convert: (model) => model.rows
.map((e) => SuggestionOrComplainModel.fromJson(e)) .map((e) => SuggestionOrComplainModel.fromJson(e))
@ -169,7 +167,7 @@ class _AdvicePageState extends State<AdvicePage> with TickerProviderStateMixin {
onPressed: () async { onPressed: () async {
await NetUtil().post( await NetUtil().post(
SAASAPI.advice.delete, SAASAPI.advice.delete,
params: {'ids': _selectedItems}, params: {'adviceIds': _selectedItems},
showMessage: true, showMessage: true,
); );
_refreshController.callRefresh(); _refreshController.callRefresh();

@ -1,5 +1,6 @@
import 'dart:io'; import 'dart:io';
import 'package:aku_new_community/ui/manager/advice/advice_house_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -99,13 +100,13 @@ class _NewAdvicePageState extends State<NewAdvicePage> {
Future addAdvice(int type, List<File> files, String content) async { Future addAdvice(int type, List<File> files, String content) async {
VoidCallback cancel = BotToast.showLoading(); VoidCallback cancel = BotToast.showLoading();
List<String?> urls = List<String?> urls =
await NetUtil().uploadFiles(files,SAASAPI.uploadFile.uploadImg); await NetUtil().uploadFiles(files, SAASAPI.uploadFile.uploadImg);
BaseModel baseModel = await NetUtil().post( BaseModel baseModel = await NetUtil().post(
SAASAPI.advice.insert, SAASAPI.advice.insert,
params: { params: {
'type': type, 'type': type,
'content': content, 'content': content,
'fileUrls': urls, 'imgUrls': urls,
}, },
showMessage: true, showMessage: true,
); );
@ -138,21 +139,34 @@ class _NewAdvicePageState extends State<NewAdvicePage> {
children: [ children: [
'业主/租客房屋'.text.size(28.sp).black.make(), '业主/租客房屋'.text.size(28.sp).black.make(),
32.hb, 32.hb,
<Widget>[ GestureDetector(
Image.asset( onTap: () {
R.ASSETS_IMAGES_HOUSE_ATTESTATION_PNG, setState(() {
height: 60.w, Get.to(() => AdviceHousePage());
width: 60.w, });
), },
40.wb, child: <Widget>[
'${userProvider.defaultHouse!.addressName}${userProvider.defaultHouse!.communityName}\n' Image.asset(
'${userProvider.defaultHouse!.buildingName}幢-${UserTool.userProvider.defaultHouse!.unitName}单元-${userProvider.defaultHouse!.estateName}' R.ASSETS_IMAGES_HOUSE_ATTESTATION_PNG,
.text height: 60.w,
.size(32.sp) width: 60.w,
.black ),
.bold 40.wb,
.make(), '${userProvider.defaultHouse!.addressName}${userProvider.defaultHouse!.communityName}\n'
].row(), '${userProvider.defaultHouse!.buildingName}幢-${UserTool.userProvider.defaultHouse!.unitName}单元-${userProvider.defaultHouse!.estateName}'
.text
.size(32.sp)
.black
.bold
.make(),
300.wb,
Icon(
Icons.arrow_forward_ios,
size: 35.w,
color: Colors.black.withOpacity(0.25),
),
].row(),
),
Divider(height: 64.w), Divider(height: 64.w),
'您要选择的类型是?'.text.size(28.sp).make(), '您要选择的类型是?'.text.size(28.sp).make(),
32.hb, 32.hb,

Loading…
Cancel
Save