周边企业

hmxc
章文轩 3 years ago
parent 33752a5ba5
commit 5c4c332e30

@ -320,6 +320,11 @@ class _Manager {
String get houseType => String get houseType =>
'/user/houseTypeDescription/list'; '/user/houseTypeDescription/list';
///
String get surroundingEnterprises =>
'/user/surroundingEnterprises/list';
} }
class _Community { class _Community {

@ -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;
}
}

@ -1,19 +1,17 @@
import 'package:aku_community/models/house_introduce/house_introduce_model.dart'; 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:aku_community/pages/surrounding_enterprises/surrounding_enterprises_detail_page.dart';
import 'package:aku_community/utils/hive_store.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart'; import 'package:aku_community/constants/api.dart';
import 'package:aku_community/constants/app_theme.dart'; import 'package:aku_community/constants/app_theme.dart';
import 'package:aku_community/model/common/img_model.dart'; import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/model/user/committee_item_model.dart';
import 'package:aku_community/pages/things_page/widget/bee_list_view.dart'; import 'package:aku_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
@ -30,6 +28,8 @@ class SurroundingEnterprisesPage extends StatefulWidget {
class _SurroundingEnterprisesPageState extends State<SurroundingEnterprisesPage> { class _SurroundingEnterprisesPageState extends State<SurroundingEnterprisesPage> {
EasyRefreshController _refreshController = EasyRefreshController(); EasyRefreshController _refreshController = EasyRefreshController();
int _page = 1;
int _size = 10;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -44,10 +44,10 @@ class _SurroundingEnterprisesPageState extends State<SurroundingEnterprisesPage>
} }
Widget _buildCard(HouseIntroduceModel model) { Widget _buildCard(SurroundingEnterprisesModel model) {
return GestureDetector( return GestureDetector(
onTap: (){ onTap: (){
Get.to(SurroundingEnterprisesDetailPage(houseIntroduceModel: model,)); Get.to(SurroundingEnterprisesDetailPage(surroundingEnterprisesModel: model,));
}, },
child: Container( child: Container(
padding: EdgeInsets.all(20.w), padding: EdgeInsets.all(20.w),
@ -62,7 +62,7 @@ class _SurroundingEnterprisesPageState extends State<SurroundingEnterprisesPage>
borderRadius: BorderRadius.circular(4.w), borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image(ImgModel.first(model.imgUrls)), image: API.image(ImgModel.first(model.imgList)),
height: 200.w, height: 200.w,
width: 240.w, width: 240.w,
fit: BoxFit.fill, fit: BoxFit.fill,
@ -86,13 +86,36 @@ class _SurroundingEnterprisesPageState extends State<SurroundingEnterprisesPage>
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),
Spacer(), 20.hb,
'发布于:${model.getReleaseDate}' Container(
.text width: 440.w,
.size(20.sp) child: Text(
.color(ktextThirdColor) '${model.content}',
.make(), 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(),
],
)
], ],
), ),
], ],
@ -103,13 +126,14 @@ class _SurroundingEnterprisesPageState extends State<SurroundingEnterprisesPage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
title: '住房介绍', title: '周边企业',
systemStyle: SystemStyle.genStyle(bottom: Color(0xFF2A2A2A)), systemStyle: SystemStyle.genStyle(bottom: Color(0xFF2A2A2A)),
body: BeeListView<HouseIntroduceModel>( body: BeeListView<SurroundingEnterprisesModel>(
path: API.manager.houseType, path: API.manager.surroundingEnterprises,
extraParams: {'pageNum': _page, 'size': _size},
convert: (model) { convert: (model) {
return model.tableList! return model.tableList!
.map((e) => HouseIntroduceModel.fromJson(e)) .map((e) => SurroundingEnterprisesModel.fromJson(e))
.toList(); .toList();
}, },
controller: _refreshController, controller: _refreshController,

@ -1,4 +1,5 @@
import 'package:aku_community/models/house_introduce/house_introduce_model.dart'; 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/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -15,9 +16,9 @@ import 'package:aku_community/utils/network/net_util.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
class SurroundingEnterprisesDetailPage extends StatefulWidget { class SurroundingEnterprisesDetailPage extends StatefulWidget {
final HouseIntroduceModel houseIntroduceModel; final SurroundingEnterprisesModel surroundingEnterprisesModel;
SurroundingEnterprisesDetailPage({Key? key, required this.houseIntroduceModel}) SurroundingEnterprisesDetailPage({Key? key, required this.surroundingEnterprisesModel})
: super(key: key); : super(key: key);
@override @override
@ -25,7 +26,6 @@ class SurroundingEnterprisesDetailPage extends StatefulWidget {
} }
class _SurroundingEnterprisesDetailPageState extends State<SurroundingEnterprisesDetailPage> { class _SurroundingEnterprisesDetailPageState extends State<SurroundingEnterprisesDetailPage> {
bool _onload = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -39,38 +39,38 @@ class _SurroundingEnterprisesDetailPageState extends State<SurroundingEnterprise
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
fit: BoxFit.cover, fit: BoxFit.cover,
image: API image: API
.image(ImgModel.first(widget.houseIntroduceModel.imgUrls))), .image(ImgModel.first(widget.surroundingEnterprisesModel.imgList))),
width: double.infinity, width: double.infinity,
height: 424.w, height: 424.w,
), ),
24.w.heightBox, // 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(
padding: EdgeInsets.symmetric(horizontal: 32.w), padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 32.w),
child:
// widget.houseIntroduceModel.content!.text
// .size(28.sp)
// .color(ktextPrimary)
// .make(),
Text(
widget.houseIntroduceModel.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.houseIntroduceModel.getReleaseDate}' ,
style: TextStyle(
fontSize: 20.sp,
color: (ktextThirdColor),
fontWeight: FontWeight.bold),
)),
Padding(
padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 40.w),
child: Text( child: Text(
widget.houseIntroduceModel.content ?? '', widget.surroundingEnterprisesModel.content ?? '',
style: TextStyle( style: TextStyle(
fontSize: 26.sp, fontSize: 26.sp,
color: (ktextSubColor), color: (ktextSubColor),

Loading…
Cancel
Save