dock interface:findEstateIsPayment

hmxc
张萌 4 years ago
parent 8dee43f2b7
commit c3638b08c2

@ -142,6 +142,9 @@ class _Manager {
///list ///list
String get dailyPaymentList => '/user/dailyPayment/list'; String get dailyPaymentList => '/user/dailyPayment/list';
///
String get findEstatelsPament => '/user/dailyPayment/findEstateIsPayment';
} }
class _Community { class _Community {

@ -0,0 +1,21 @@
class EstatePaymentModel {
int id;
String roomName;
int status;
EstatePaymentModel({this.id, this.roomName, this.status});
EstatePaymentModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
roomName = json['roomName'];
status = json['status'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['roomName'] = this.roomName;
data['status'] = this.status;
return data;
}
}

@ -78,7 +78,9 @@ class _LifePayPageState extends State<LifePayPage> {
32.w.heightBox, 32.w.heightBox,
GestureDetector( GestureDetector(
onTap: () { onTap: () {
MyHousePage().to(); MyHousePage(
needFindPayTag: true,
).to();
}, },
child: Row( child: Row(
children: [ children: [

@ -1,5 +1,7 @@
import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/model/manager/estate_payment_model.dart';
import 'package:akuCommunity/pages/goods_deto_page/deto_create_page/widget/common_radio.dart'; import 'package:akuCommunity/pages/goods_deto_page/deto_create_page/widget/common_radio.dart';
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/provider/user_provider.dart'; import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/utils/bee_parse.dart'; import 'package:akuCommunity/utils/bee_parse.dart';
import 'package:akuCommunity/widget/bee_divider.dart'; import 'package:akuCommunity/widget/bee_divider.dart';
@ -9,7 +11,8 @@ import 'package:akuCommunity/utils/headers.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class MyHousePage extends StatefulWidget { class MyHousePage extends StatefulWidget {
MyHousePage({Key key}) : super(key: key); final bool needFindPayTag;
MyHousePage({Key key, this.needFindPayTag = false}) : super(key: key);
@override @override
_MyHousePageState createState() => _MyHousePageState(); _MyHousePageState createState() => _MyHousePageState();
@ -41,6 +44,20 @@ Widget _unPaidTag() {
class _MyHousePageState extends State<MyHousePage> { class _MyHousePageState extends State<MyHousePage> {
int _select; int _select;
List<EstatePaymentModel> _list;
List<EstatePaymentModel> get _unPaidList => _list.where((element) => element.status == 1).toList();
@override
void initState() {
super.initState();
if (widget.needFindPayTag) {
ManagerFunc.findEstatelsPayment().then((value) {
_list = value.data;
return _list;
});
}
}
Widget _buildCard(String currentHouse, String estateName, int index, Widget _buildCard(String currentHouse, String estateName, int index,
{bool paid = false}) { {bool paid = false}) {
return Container( return Container(
@ -65,7 +82,12 @@ class _MyHousePageState extends State<MyHousePage> {
children: [ children: [
kEstateName.text.size(24.sp).color(ktextSubColor).bold.make(), kEstateName.text.size(24.sp).color(ktextSubColor).bold.make(),
16.w.heightBox, 16.w.heightBox,
BeeParse.getEstateName(estateName).text.color(ktextPrimary).size(28.sp).bold.make(), BeeParse.getEstateName(estateName)
.text
.color(ktextPrimary)
.size(28.sp)
.bold
.make(),
], ],
), ),
Spacer(), Spacer(),
@ -88,7 +110,10 @@ class _MyHousePageState extends State<MyHousePage> {
children: <Widget>[ children: <Widget>[
...userProvider.userDetailModel.estateNames ...userProvider.userDetailModel.estateNames
.map((e) => _buildCard(userProvider.currentHouse, e, .map((e) => _buildCard(userProvider.currentHouse, e,
userProvider.userDetailModel.estateNames.indexOf(e))) userProvider.userDetailModel.estateNames.indexOf(e),
paid: widget.needFindPayTag
? false
: _unPaidList.one((element) => element.roomName == e)))
.toList(), .toList(),
].sepWidget(separate: BeeDivider.horizontal()), ].sepWidget(separate: BeeDivider.horizontal()),
), ),

@ -158,4 +158,12 @@ class ManagerFunc {
); );
return baseModel; return baseModel;
} }
static Future<BaseModel> findEstatelsPayment()async{
BaseModel baseModel = await NetUtil().get(
API.manager.findEstatelsPament,
showMessage: false,
);
return baseModel.data;
}
} }

Loading…
Cancel
Save