pull/1/head
张萌 3 years ago
parent 59abb6e51c
commit 59f8aa50b3

@ -155,6 +155,9 @@ class _Community {
}
class _Task {
///
String get urgeService => '/app/user/taskRelease/urgeService';
///,
String get cancel => '/app/user/taskRelease/cancel';
@ -267,19 +270,19 @@ class _Pay {
String get createPrepaymentOrder => '/app/user/alipay/createPrepaymentOrder';
///
String get prepaymentOrderCheckAlipay => '/app/user/alipay/prepaymentOrderCheckAlipay';
String get prepaymentOrderCheckAlipay =>
'/app/user/alipay/prepaymentOrderCheckAlipay';
///
String get createLivingExpensesOrder => '/app/user/alipay/createLivingExpensesOrder';
String get createLivingExpensesOrder =>
'/app/user/alipay/createLivingExpensesOrder';
///
String get livingExpensesOrderCheckAlipay => '/app/user/alipay/livingExpensesOrderCheckAlipay';
String get livingExpensesOrderCheckAlipay =>
'/app/user/alipay/livingExpensesOrderCheckAlipay';
}
class _LifePay{
class _LifePay {
///
String get livingExpensesList => '/app/user/livingExpenses/list';
@ -288,6 +291,4 @@ class _LifePay{
///
String get findEstateBalance => '/app/user/livingExpenses/findEstateBalance';
}

@ -1,5 +1,6 @@
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:aku_new_community/models/community/all_dynamic_list_model.dart';
import 'package:common_utils/common_utils.dart';
import 'package:json_annotation/json_annotation.dart';
part 'dynamic_my_list_body.g.dart';
@ -17,9 +18,12 @@ class DynamicMyListBody {
final List<ImgModel> dynamicImgList;
final List<TopicTag> topicTags;
final bool isLike;
factory DynamicMyListBody.fromJson(Map<String, dynamic> json) =>
_$DynamicMyListBodyFromJson(json);
DateTime? get createDT => DateUtil.getDateTime(createDate);
const DynamicMyListBody({
required this.id,
this.content,

@ -7,18 +7,17 @@
* ====================================================
*/
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/model/user/adress_model.dart';
import 'package:aku_new_community/pages/personal/user_func.dart';
import 'package:aku_new_community/provider/app_provider.dart';
import 'package:aku_new_community/utils/headers.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:provider/provider.dart';
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/model/user/adress_model.dart';
import 'package:aku_new_community/pages/personal/user_func.dart';
import 'package:aku_new_community/provider/app_provider.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'address/new_address_page.dart';
// ignore: must_be_immutable
@ -196,10 +195,8 @@ class _MyAddressItemState extends State<MyAddressItem> {
if (result == true) {
bool? result =
await Userfunc.deleteAddress(widget.addressModel.id!);
if (result != null) {
if (result) widget.refreshController!.callRefresh();
}
}
;
},
child: Container(

@ -63,7 +63,7 @@ class Userfunc {
///
static Future<bool> deleteAddress(int addressId) async {
BaseModel model = await NetUtil().post(SAASAPI.market.address.delete,
BaseModel model = await NetUtil().get(SAASAPI.market.address.delete,
params: {'id': addressId}, showMessage: false);
if (model.success) {
BotToast.showText(text: '删除成功');

@ -1,7 +1,6 @@
import 'dart:math';
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/model/common/img_model.dart';
import 'package:aku_new_community/models/community/all_dynamic_list_model.dart';
@ -143,14 +142,21 @@ class _CommunityPageState extends State<CommunityPage>
EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),
footer: MaterialFooter(),
controller: _easyRefreshController,
onRefresh: () async {
_pageNum = 1;
await (getNewInfo());
_gambitModels = await CommunityFunc.getListGambit();
_hotNewsModels = await CommunityFunc.getHotNews();
_onload = false;
setState(() {});
},
onLoad: () async {
_pageNum++;
await loadNewInfo();
setState(() {});
},
child: _onload
? SizedBox()
: ListView(
@ -191,15 +197,15 @@ class _CommunityPageState extends State<CommunityPage>
}
Future loadNewInfo() async {
BaseListModel baseListModel =
await NetUtil().getList(API.market.hotTop, params: {
"pageNum": _pageNum,
"size": _size,
});
if (baseListModel.rows.isNotEmpty) {
BaseListModel baseListModel = await NetUtil().getList(
SAASAPI.community.dynamicList,
params: {"pageNum": _pageNum, "size": _size, 'type': 1});
if (baseListModel.total > _newItems.length) {
_newItems.addAll((baseListModel.rows)
.map((e) => AllDynamicListModel.fromJson(e))
.toList());
} else {
_easyRefreshController.finishLoadCallBack!(noMore: true);
}
}

@ -8,8 +8,11 @@ import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_new_community/ui/community/community_views/widgets/my_event_card.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/login_util.dart';
import 'package:aku_new_community/utils/network/base_list_model.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:aku_new_community/widget/bee_avatar_widget.dart';
import 'package:aku_new_community/widget/line/vertical_line_painter.dart';
import 'package:aku_new_community/widget/others/user_tool.dart';
import 'package:aku_new_community/widget/picker/bee_image_preview.dart';
import 'package:aku_new_community/widget/views/bee_grid_image_view.dart';
import 'package:flutter/cupertino.dart';
@ -17,8 +20,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import '../community_func.dart';
class MyCommunityView extends StatefulWidget {
MyCommunityView({Key? key}) : super(key: key);
@ -32,6 +33,8 @@ class MyCommunityViewState extends State<MyCommunityView>
bool _onload = true;
List<DynamicMyListBody> _myEventItems = [];
DynamicMyListHead? _head;
int _pageNum = 1;
int _size = 10;
refresh() {
_refreshController.callRefresh();
@ -53,10 +56,10 @@ class MyCommunityViewState extends State<MyCommunityView>
crossAxisAlignment: CrossAxisAlignment.center,
children: [
12.hb,
Image.asset(
R.ASSETS_ICONS_ICON_LOGISTICS_PNG,
BeeAvatarWidget(
width: 132.w,
height: 132.w,
imgs: UserTool.userProvider.userInfoModel!.imgList,
),
32.hb,
'${_head?.createName}'
@ -132,7 +135,12 @@ class MyCommunityViewState extends State<MyCommunityView>
header: MaterialHeader(),
controller: _refreshController,
onRefresh: () async {
_myEventItems = await CommunityFunc.getMyEventItem();
BaseListModel model = await NetUtil().getList(
SAASAPI.community.dynamicMyListL,
params: {'pageNum': _pageNum, 'size': _size},
);
_myEventItems =
model.rows.map((e) => DynamicMyListBody.fromJson(e)).toList();
var base = await NetUtil().get(SAASAPI.community.dynamicMyListH);
if (base.success) {
_head = DynamicMyListHead.fromJson(base.data);
@ -140,6 +148,19 @@ class MyCommunityViewState extends State<MyCommunityView>
_onload = false;
setState(() {});
},
onLoad: () async {
BaseListModel model = await NetUtil().getList(
SAASAPI.community.dynamicMyListL,
params: {'pageNum': _pageNum, 'size': _size},
);
if (model.total > _myEventItems.length) {
_myEventItems.addAll(
model.rows.map((e) => DynamicMyListBody.fromJson(e)).toList());
setState(() {});
} else {
_refreshController.finishLoadCallBack!(noMore: true);
}
},
child: _onload
? SizedBox()
: ListView(
@ -206,14 +227,14 @@ class MyCommunityViewState extends State<MyCommunityView>
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'11.15'
'${item.createDT?.month ?? ''}.${item.createDT?.day ?? ''}'
.text
.size(32.sp)
.color(Color(0xA6000000))
.bold
.isIntrinsic
.make(),
'2021'
'${item.createDT?.year ?? ''}'
.text
.size(24.sp)
.color(Color(0x73000000))
@ -232,7 +253,7 @@ class MyCommunityViewState extends State<MyCommunityView>
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
'25.61'
'${item.createDT?.hour ?? ''}.${item.createDT?.second ?? ''}'
.text
.size(28.sp)
.color(Color(0xA6000000))

@ -107,6 +107,8 @@ class _TopicDetailPageState extends State<TopicDetailPage> {
title: _detailModel?.title,
imgPath: ImgModel.first(_detailModel?.imgList),
subTitle: _detailModel?.content,
dynamicNum: _detailModel?.dynamicNum,
commentNum: _detailModel?.commentNum,
),
pinned: true,
floating: true,

@ -66,7 +66,7 @@ class _AddAppointmentAddressPageState extends State<AddAppointmentAddressPage> {
children: [
SizedBox(
width: 170.w,
child: '标志建筑'
child: '目标地点'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
@ -78,7 +78,7 @@ class _AddAppointmentAddressPageState extends State<AddAppointmentAddressPage> {
controller: _tagController,
decoration: InputDecoration(
border: InputBorder.none,
hintText: '请输入标志建筑',
hintText: '请输入目标地点',
contentPadding: EdgeInsets.zero,
isDense: true,
hintStyle: TextStyle(

@ -11,6 +11,7 @@ import 'hall_card.dart';
class HallView extends StatefulWidget {
final EasyRefreshController refreshController;
final int type;
const HallView(
{Key? key, required this.refreshController, required this.type})
: super(key: key);
@ -32,7 +33,7 @@ class _HallViewState extends State<HallView> {
controller: widget.refreshController,
extraParams: {
'taskModel': 1,
'type': widget.type + 1,
'type': widget.type == 0 ? null : widget.type,
},
convert: (json) =>
json.rows.map((e) => HallListModel.fromJson(e)).toList(),

@ -32,7 +32,7 @@ class _MyTakeTaskViewState extends State<MyTakeTaskView> {
controller: widget.refreshController,
extraParams: {
'taskModel': 2,
'type': widget.type + 1,
'type': widget.type == 0 ? null : widget.type,
},
convert: (json) =>
json.rows.map((e) => MyTakeTaskListModel.fromJson(e)).toList(),

@ -70,8 +70,8 @@ class MyTaskCard extends StatelessWidget {
],
);
return GestureDetector(
onTap: () {
Get.to(() => MyTaskDetailPage(model: model));
onTap: () async {
await Get.to(() => MyTaskDetailPage(model: model));
},
child: Container(
width: double.infinity,

@ -1,8 +1,10 @@
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/saas_model/task/my_task_list_model.dart';
import 'package:aku_new_community/ui/function_and_service/task/dialogs/task_cancel_dialog.dart';
import 'package:aku_new_community/ui/function_and_service/task/dialogs/task_evaluation_dialog.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/buttons/bee_long_button.dart';
@ -200,7 +202,13 @@ class _MyTaskDetailPageState extends State<MyTaskDetailPage> {
);
case 2:
return MaterialButton(
onPressed: () {},
onPressed: () async {
var base = await NetUtil().get(SAASAPI.task.urgeService,
params: {'taskId': widget.model.id}, showMessage: true);
if (base.success) {
Get.back();
}
},
minWidth: 330.w,
height: 80.w,
elevation: 0,

@ -32,7 +32,7 @@ class _MyTaskViewState extends State<MyTaskView> {
controller: widget.refreshController,
extraParams: {
'taskModel': 2,
'type': widget.type + 1,
'type': widget.type == 0 ? null : widget.type,
},
convert: (json) =>
json.rows.map((e) => MyTaskListModel.fromJson(e)).toList(),

@ -77,7 +77,7 @@ class _TaskPageState extends State<TaskPage> with TickerProviderStateMixin {
Padding(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
child: Row(
children: TaskMap.taskType.values
children: <String>['全部', ...TaskMap.taskType.values]
.mapIndexed((currentValue, index) =>
_typeBar(currentValue, index))
.toList(),

@ -511,7 +511,9 @@ class _AddHousePageState extends State<AddHousePage> {
'${model.house == null ? '请选择楼层房号' : '${model.building!.name}-${model.unit!.name}-${model.floor!.name}-${model.house!.name}'}'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.25))
.color(model.house != null
? Colors.black.withOpacity(0.5)
: Colors.black.withOpacity(0.25))
.make(),
),
Icon(

Loading…
Cancel
Save