# Conflicts: # lib/const/resource.dart # lib/constants/api.dart # lib/constants/application_objects.dart # lib/main.dart # lib/models/geographic_information/geographic_information_model.dart # lib/models/house_introduce/house_introduce_model.dart # lib/pages/house_introduce/house_detail_page.dart # lib/pages/house_introduce/house_introduce.dart # lib/utils/websocket/AlarmModel.dart # lib/utils/websocket/fire_dialog.darthmxc
commit
58cff6462f
@ -0,0 +1,40 @@
|
||||
import 'package:aku_community/model/common/img_model.dart';
|
||||
import 'package:flustars/flustars.dart';
|
||||
|
||||
class SurroundingEnterprisesModel {
|
||||
int? id;
|
||||
String? name;
|
||||
String? content;
|
||||
String? releaseDate;
|
||||
List<ImgModel>? imgList;
|
||||
|
||||
DateTime? get getReleaseDate => DateUtil.getDateTime(releaseDate!);
|
||||
|
||||
SurroundingEnterprisesModel(
|
||||
{this.id, this.name, this.content, this.releaseDate, this.imgList});
|
||||
|
||||
SurroundingEnterprisesModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
content = json['content'];
|
||||
releaseDate = json['releaseDate'];
|
||||
if (json['imgList'] != null) {
|
||||
imgList = [];
|
||||
json['imgList'].forEach((v) {
|
||||
imgList!.add(new ImgModel.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
data['content'] = this.content;
|
||||
data['releaseDate'] = this.releaseDate;
|
||||
if (this.imgList != null) {
|
||||
data['imgList'] = this.imgList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
import 'package:aku_community/models/geographic_information/geographic_information_model.dart';
|
||||
import 'package:aku_community/models/house_introduce/house_introduce_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
import 'package:aku_community/base/base_style.dart';
|
||||
import 'package:aku_community/const/resource.dart';
|
||||
import 'package:aku_community/constants/api.dart';
|
||||
import 'package:aku_community/model/common/img_model.dart';
|
||||
import 'package:aku_community/models/community_introduce/community_introduce_model.dart';
|
||||
import 'package:aku_community/utils/network/base_model.dart';
|
||||
import 'package:aku_community/utils/network/net_util.dart';
|
||||
import 'package:aku_community/widget/bee_scaffold.dart';
|
||||
|
||||
class GeographicInformationPage extends StatefulWidget {
|
||||
|
||||
|
||||
GeographicInformationPage({Key? key,})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_GeographicInformationPageState createState() => _GeographicInformationPageState();
|
||||
}
|
||||
|
||||
class _GeographicInformationPageState extends State<GeographicInformationPage> {
|
||||
GeographicInformationModel _model = GeographicInformationModel.init();
|
||||
bool _onload = false;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
bodyColor: Colors.white,
|
||||
title: '地理信息',
|
||||
body:EasyRefresh(
|
||||
firstRefresh: true,
|
||||
header: MaterialHeader(),
|
||||
onRefresh: () async {
|
||||
BaseModel baseModel =
|
||||
await NetUtil().get(API.manager.geographyInformation);
|
||||
if (baseModel.status! && baseModel.data != null) {
|
||||
_model = GeographicInformationModel.fromJson(baseModel.data);
|
||||
}
|
||||
_onload = false;
|
||||
setState(() {});
|
||||
},
|
||||
child: _onload
|
||||
? Container()
|
||||
:
|
||||
ListView(
|
||||
children: [
|
||||
SizedBox(
|
||||
child: FadeInImage.assetNetwork(
|
||||
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
||||
fit: BoxFit.cover,
|
||||
image: API
|
||||
.image(ImgModel.first(_model.imgUrls))),
|
||||
width: double.infinity,
|
||||
height: 424.w,
|
||||
),
|
||||
24.w.heightBox,
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 40.w),
|
||||
child: Text(
|
||||
_model.content ?? '',
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp,
|
||||
color: (ktextSubColor),
|
||||
fontWeight: FontWeight.bold),
|
||||
)),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
import 'package:aku_community/models/house_introduce/house_introduce_model.dart';
|
||||
import 'package:aku_community/models/surrounding_enterprises/surrounding_enterprises_model.dart';
|
||||
import 'package:aku_community/pages/surrounding_enterprises/surrounding_enterprises_detail_page.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:velocity_x/velocity_x.dart';
|
||||
|
||||
import 'package:aku_community/base/base_style.dart';
|
||||
import 'package:aku_community/constants/api.dart';
|
||||
import 'package:aku_community/constants/app_theme.dart';
|
||||
import 'package:aku_community/model/common/img_model.dart';
|
||||
import 'package:aku_community/pages/things_page/widget/bee_list_view.dart';
|
||||
import 'package:aku_community/utils/headers.dart';
|
||||
import 'package:aku_community/widget/bee_scaffold.dart';
|
||||
|
||||
|
||||
class SurroundingEnterprisesPage extends StatefulWidget {
|
||||
SurroundingEnterprisesPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_SurroundingEnterprisesPageState createState() => _SurroundingEnterprisesPageState();
|
||||
}
|
||||
|
||||
|
||||
|
||||
class _SurroundingEnterprisesPageState extends State<SurroundingEnterprisesPage> {
|
||||
EasyRefreshController _refreshController = EasyRefreshController();
|
||||
int _page = 1;
|
||||
int _size = 10;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// Future.delayed(Duration(milliseconds: 0), () async {
|
||||
// var agreement = await HiveStore.appBox?.get('IndustryCommitteePage') ?? false;
|
||||
// if (!agreement) {
|
||||
// await TipsDialog.tipsDialog();
|
||||
// HiveStore.appBox!.put('IndustryCommitteePage',true);
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
|
||||
Widget _buildCard(SurroundingEnterprisesModel model) {
|
||||
return GestureDetector(
|
||||
onTap: (){
|
||||
Get.to(SurroundingEnterprisesDetailPage(surroundingEnterprisesModel: model,));
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(20.w),
|
||||
color: Colors.white,
|
||||
height: 250.w,
|
||||
child: Row(
|
||||
// .padding(EdgeInsets.all(20.w)).white.withRounded(value: 8.w).make()
|
||||
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(4.w),
|
||||
child: FadeInImage.assetNetwork(
|
||||
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
||||
image: API.image(ImgModel.first(model.imgList)),
|
||||
height: 200.w,
|
||||
width: 240.w,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
24.wb,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width: 440.w,
|
||||
child: Text(
|
||||
'${model.name}',
|
||||
style: TextStyle(
|
||||
fontSize: 30.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: ktextPrimary
|
||||
),
|
||||
maxLines: 4,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
20.hb,
|
||||
Container(
|
||||
width: 440.w,
|
||||
child: Text(
|
||||
'${model.content}',
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
|
||||
color: ktextPrimary
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
'南宁人才公寓'
|
||||
.text
|
||||
.size(20.sp)
|
||||
.color(ktextThirdColor)
|
||||
.make(),
|
||||
Spacer(),
|
||||
'发布于:${model.getReleaseDate}'
|
||||
.text
|
||||
.size(20.sp)
|
||||
.color(ktextThirdColor)
|
||||
.make(),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '周边企业',
|
||||
systemStyle: SystemStyle.genStyle(bottom: Color(0xFF2A2A2A)),
|
||||
body: BeeListView<SurroundingEnterprisesModel>(
|
||||
path: API.manager.surroundingEnterprises,
|
||||
extraParams: {'pageNum': _page, 'size': _size},
|
||||
convert: (model) {
|
||||
return model.tableList!
|
||||
.map((e) => SurroundingEnterprisesModel.fromJson(e))
|
||||
.toList();
|
||||
},
|
||||
controller: _refreshController,
|
||||
builder: (items) {
|
||||
return ListView.separated(
|
||||
padding: EdgeInsets.symmetric(vertical: 20.w),
|
||||
itemBuilder: (context, index) {
|
||||
return _buildCard(items[index]);
|
||||
},
|
||||
separatorBuilder: (context, index) => 20.hb,
|
||||
itemCount: items.length,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
import 'package:aku_community/models/house_introduce/house_introduce_model.dart';
|
||||
import 'package:aku_community/models/surrounding_enterprises/surrounding_enterprises_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
import 'package:aku_community/base/base_style.dart';
|
||||
import 'package:aku_community/const/resource.dart';
|
||||
import 'package:aku_community/constants/api.dart';
|
||||
import 'package:aku_community/model/common/img_model.dart';
|
||||
import 'package:aku_community/models/community_introduce/community_introduce_model.dart';
|
||||
import 'package:aku_community/utils/network/base_model.dart';
|
||||
import 'package:aku_community/utils/network/net_util.dart';
|
||||
import 'package:aku_community/widget/bee_scaffold.dart';
|
||||
|
||||
class SurroundingEnterprisesDetailPage extends StatefulWidget {
|
||||
final SurroundingEnterprisesModel surroundingEnterprisesModel;
|
||||
|
||||
SurroundingEnterprisesDetailPage({Key? key, required this.surroundingEnterprisesModel})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_SurroundingEnterprisesDetailPageState createState() => _SurroundingEnterprisesDetailPageState();
|
||||
}
|
||||
|
||||
class _SurroundingEnterprisesDetailPageState extends State<SurroundingEnterprisesDetailPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
bodyColor: Colors.white,
|
||||
title: '住房详情',
|
||||
body: ListView(
|
||||
children: [
|
||||
SizedBox(
|
||||
child: FadeInImage.assetNetwork(
|
||||
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
||||
fit: BoxFit.cover,
|
||||
image: API
|
||||
.image(ImgModel.first(widget.surroundingEnterprisesModel.imgList))),
|
||||
width: double.infinity,
|
||||
height: 424.w,
|
||||
),
|
||||
// 24.w.heightBox,
|
||||
// Padding(
|
||||
// padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
// child:
|
||||
// // widget.houseIntroduceModel.content!.text
|
||||
// // .size(28.sp)
|
||||
// // .color(ktextPrimary)
|
||||
// // .make(),
|
||||
// Text(
|
||||
// widget.surroundingEnterprisesModel.name ?? '',
|
||||
// style: TextStyle(
|
||||
// fontSize: 30.sp,
|
||||
// color: (ktextPrimary),
|
||||
// fontWeight: FontWeight.bold),
|
||||
// )),
|
||||
// Padding(
|
||||
// padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 16.w),
|
||||
// child: Text(
|
||||
// '发布于:${widget.surroundingEnterprisesModel.getReleaseDate}' ,
|
||||
// style: TextStyle(
|
||||
// fontSize: 20.sp,
|
||||
// color: (ktextThirdColor),
|
||||
// fontWeight: FontWeight.bold),
|
||||
// )),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 32.w),
|
||||
child: Text(
|
||||
widget.surroundingEnterprisesModel.content ?? '',
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp,
|
||||
color: (ktextSubColor),
|
||||
fontWeight: FontWeight.bold),
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue