房产相关问题修复

hmxc
小赖 4 years ago
parent 857e0c011d
commit 5de81e360a

@ -5,6 +5,8 @@ class HouseModel {
int id;
String roomName;
int estateId;
///1.3.4.
int status;
@ -87,6 +89,7 @@ class HouseModel {
this.type,
this.effectiveTimeStart,
this.effectiveTimeEnd,
this.estateId,
});
HouseModel.fromJson(Map<String, dynamic> json) {
@ -96,6 +99,7 @@ class HouseModel {
type = json['type'];
effectiveTimeStart = json['effectiveTimeStart'];
effectiveTimeEnd = json['effectiveTimeEnd'];
estateId = json['estateId'];
}
Map<String, dynamic> toJson() {

@ -69,6 +69,7 @@ class _LifePayPageState extends State<LifePayPage> {
GestureDetector(
onTap: () {
Get.to(() => PickMyHousePage());
_controller.callRefresh();
},
child: Row(
children: [
@ -216,6 +217,7 @@ class _LifePayPageState extends State<LifePayPage> {
@override
Widget build(BuildContext context) {
UserProvider userProvider = Provider.of<UserProvider>(context);
final appProvider = Provider.of<AppProvider>(context);
return BeeScaffold(
title: '生活缴费',
actions: [
@ -234,9 +236,7 @@ class _LifePayPageState extends State<LifePayPage> {
body: BeeListView(
path: API.manager.dailyPaymentList,
controller: _controller,
extraParams: {
'estateId': userProvider.currentHouseId,
},
extraParams: {'estateId': appProvider.selectedHouse.estateId},
convert: (model) {
_selectPay = List.generate(model.tableList.length,
(index) => SelectPay(payCount: 0, payTotal: 0.0));

@ -1,4 +1,5 @@
import 'package:akuCommunity/constants/app_values.dart';
import 'package:akuCommunity/provider/app_provider.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -86,6 +87,7 @@ class _LifePayDetailPageState extends State<LifePayDetailPage> {
Widget _buildCard(DailyPaymentTypeVos model) {
UserProvider userProvider = Provider.of<UserProvider>(context);
final appProvider = Provider.of<AppProvider>(context);
return Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.w),
child: Column(
@ -94,7 +96,7 @@ class _LifePayDetailPageState extends State<LifePayDetailPage> {
children: [
model.name.text.black.size(30.sp).bold.make(),
Spacer(),
'${S.of(context).tempPlotName} ${userProvider.currentHouse}'
'${S.of(context).tempPlotName} ${appProvider.selectedHouse.estateId}'
.text
.color(ktextSubColor)
.size(24.sp)

@ -1,4 +1,3 @@
import 'package:akuCommunity/constants/app_values.dart';
import 'package:akuCommunity/provider/app_provider.dart';
import 'package:flutter/material.dart';
@ -72,14 +71,13 @@ class _MyHousePageState extends State<MyHousePage> {
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w),
child: GestureDetector(
onTap: () {
userProvider.setCurrentHouse(estateName);
setState(() {});
},
child: Row(
children: [
CommonRadio(
value: BeeParse.getEstateNameId(estateName),
groupValue: userProvider.currentHouseId,
groupValue: 0,
size: 32.w,
),
24.w.widthBox,
@ -125,8 +123,8 @@ class _MyHousePageState extends State<MyHousePage> {
...userProvider.userDetailModel.estateNames.isEmpty
? [SizedBox()]
: userProvider.userDetailModel.estateNames
.map((e) => _buildCard(userProvider.currentHouseId, e,
userProvider.userDetailModel.estateNames.indexOf(e),
.map((e) => _buildCard(
0, e, userProvider.userDetailModel.estateNames.indexOf(e),
paid: widget.needFindPayTag
? false
: _unPaidList

@ -237,7 +237,7 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
List<String> urls = await NetUtil()
.uploadFiles(_files, API.upload.uploadRepair);
BaseModel baseModel = await ManagerFunc.reportRepairInsert(
appProvider.selectedHouse.id,
appProvider.selectedHouse.estateId,
_selectType + 1,
_textEditingController.text,
urls);

@ -315,7 +315,7 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
_selectTime(),
SizedBox(height: 64.w),
_create(
appProvider.selectedHouse.id,
appProvider.selectedHouse.estateId,
userProvider.userDetailModel.type,
userProvider.userDetailModel.tel,
),

@ -186,6 +186,10 @@ class AppProvider extends ChangeNotifier {
updateHouses(List<HouseModel> items) {
if (items == null) return;
if (items.isEmpty) return;
_selectedHouse = items.firstWhere(
(element) => element.id == (_selectedHouse?.id ?? -1),
orElse: () => null,
);
_houses = items;
notifyListeners();
}

@ -8,7 +8,6 @@ import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/user/user_detail_model.dart';
import 'package:akuCommunity/model/user/user_info_model.dart';
import 'package:akuCommunity/pages/sign/sign_func.dart';
import 'package:akuCommunity/utils/bee_parse.dart';
import 'package:akuCommunity/utils/hive_store.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:akuCommunity/utils/network/net_util.dart';
@ -20,21 +19,20 @@ class UserProvider extends ChangeNotifier {
bool get isLogin => _isLogin;
bool get isNotLogin => !_isLogin;
Future setLogin(int token) async {
final appProvider = Provider.of<AppProvider>(Get.context,listen: false);
final appProvider = Provider.of<AppProvider>(Get.context, listen: false);
_isLogin = true;
NetUtil().dio.options.headers.putIfAbsent('App-Admin-Token', () => token);
HiveStore.appBox.put('token', token);
HiveStore.appBox.put('login', true);
await updateProfile();
await updateUserDetail();
await setCurrentHouse((_userDetailModel?.estateNames?.isEmpty ?? true)
? ''
: _userDetailModel?.estateNames?.first);
await appProvider.updateHouses(await HouseFunc.houses);
notifyListeners();
}
logout() {
final appProvider = Provider.of<AppProvider>(Get.context, listen: false);
appProvider.setCurrentHouse(null);
_isLogin = false;
_token = null;
_userInfoModel = null;
@ -133,13 +131,4 @@ class UserProvider extends ChangeNotifier {
await updateProfile();
}
}
///
String _currentHouse;
int get currentHouseId => BeeParse.getEstateNameId(_currentHouse);
String get currentHouse => BeeParse.getEstateName(_currentHouse);
setCurrentHouse(String house) {
_currentHouse = house;
notifyListeners();
}
}

@ -49,7 +49,10 @@ class _PickMyHousePageState extends State<PickMyHousePage> {
return SliverList(
delegate: SliverChildListDelegate(
housesWithoutSelected
.map((e) => _HouseCard(model: e))
.map((e) => _HouseCard(
model: e,
controller: _refreshController,
))
.toList()
.sepWidget(
separate: Divider(
@ -82,6 +85,7 @@ class _PickMyHousePageState extends State<PickMyHousePage> {
child: _HouseCard(
model: appProvider.selectedHouse,
highlight: true,
controller: _refreshController,
),
),
_renderSep,
@ -108,8 +112,13 @@ class _PickMyHousePageState extends State<PickMyHousePage> {
class _HouseCard extends StatelessWidget {
final HouseModel model;
final bool highlight;
const _HouseCard({Key key, @required this.model, this.highlight = false})
: super(key: key);
final EasyRefreshController controller;
const _HouseCard({
Key key,
@required this.model,
this.highlight = false,
@required this.controller,
}) : super(key: key);
bool get canTapSlide {
if (model == null) return false;
return model.status == 4 || model.status == 3 && !highlight;
@ -147,6 +156,8 @@ class _HouseCard extends StatelessWidget {
'ids': [model.id]
},
);
// if(controller.)
controller.callRefresh();
cancel();
}
}

Loading…
Cancel
Save