master
章文轩 3 years ago
parent b279cbcd23
commit 5f44ca4cc8

@ -2,6 +2,7 @@ import 'package:aku_new_community_manager/new_ui/auth/sign_func.dart';
import 'package:aku_new_community_manager/new_ui/auth/widget/login_button_widget.dart';
import 'package:aku_new_community_manager/tools/user_tool.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
@ -23,6 +24,13 @@ class _SetNickNamePageState extends State<SetNickNamePage> {
super.dispose();
}
@override
void initState() {
super.initState();
BotToast.closeAllLoading();
}
@override
Widget build(BuildContext context) {
return AkuScaffold(

@ -23,10 +23,12 @@ class HouseholdAuditPage extends StatefulWidget {
class _HouseholdAuditPageState extends State<HouseholdAuditPage>
with SingleTickerProviderStateMixin {
List<String> _tabs = ['全部', '待审核', '同意', '已驳回'];
List<String> _tabs = ['全部', '待审核', '驳回', '已同意'];
List<EasyRefreshController> _refreshControllers = [];
late TabController _tabController;
List<HouseholdAuditListModel> _models = [];
int _page = 1;
int _size = 10;
@override
void initState() {
@ -67,14 +69,25 @@ class _HouseholdAuditPageState extends State<HouseholdAuditPage>
header: MaterialHeader(),
footer: MaterialFooter(),
onRefresh: () async {
var base = await NetUtil().getList(SAASAPI.householdAudit.list);
_models = [];
_page = 1;
var base = await NetUtil().getList(SAASAPI.householdAudit.list,params: {
'pageNum': _page,
'size': _size,
'status':index==0?null:index
});
_models = base.rows
.map((e) => HouseholdAuditListModel.fromJson(e))
.toList();
setState(() {});
},
onLoad: () async {
var base = await NetUtil().getList(SAASAPI.householdAudit.list);
_page++;
var base = await NetUtil().getList(SAASAPI.householdAudit.list,params: {
'pageNum': _page,
'size': _size,
'status':index==0?null:index
});
if (_models.length < base.total) {
_models.addAll(base.rows
.map((e) => HouseholdAuditListModel.fromJson(e))

@ -72,6 +72,7 @@ class _DistributorDetailPageState extends State<DistributorDetailPage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
40.w.heightBox,
GestureDetector(
onTap: () async {
await WorkOrderFuc.getProgress(
@ -106,6 +107,7 @@ class _DistributorDetailPageState extends State<DistributorDetailPage> {
],
),
),
Spacer(),
],
),
@ -128,7 +130,7 @@ class _DistributorDetailPageState extends State<DistributorDetailPage> {
? Container()
: ListView(
padding:
EdgeInsets.only(top: 120.w, left: 32.w, right: 32.w),
EdgeInsets.only(top: 140.w, left: 32.w, right: 32.w),
children: [
Offstage(
offstage: _model!.status < 5,
@ -245,6 +247,10 @@ class _DistributorDetailPageState extends State<DistributorDetailPage> {
var re = await WorkOrderFuc.reminderPay(widget.id);
if (re) {
_refreshController.callRefresh();
setState(() {
});
}
Get.back();
},

@ -1,5 +1,6 @@
import 'package:aku_new_community_manager/const/saas_api.dart';
import 'package:aku_new_community_manager/new_ui/work_order/distributor/distributor_card.dart';
import 'package:aku_new_community_manager/new_ui/work_order/receiver/work_order_receiver_widget.dart';
import 'package:aku_new_community_manager/saas_models/work_order/work_order_list_model.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/ui/widgets/inner/aku_tab_bar.dart';
@ -19,7 +20,7 @@ class WorkOrderReceiverPage extends StatefulWidget {
class _WorkOrderReceiverPageState extends State<WorkOrderReceiverPage>
with SingleTickerProviderStateMixin {
List<String> _tabs = ['全部', '工单池', '已接单', '处理中', '待确认', '已完成', '已评价', '已取消'];
List<String> _tabs = ['全部', '待分配', '工单池', '已接单', '处理中', '待确认', '待支付', '已完成', '已评价', '已取消'];
late TabController _tabController;
EasyRefreshController _refreshController = EasyRefreshController();
int _page = 1;
@ -62,7 +63,7 @@ class _WorkOrderReceiverPageState extends State<WorkOrderReceiverPage>
body: TabBarView(
controller: _tabController,
children:
_tabs.mapIndexed((e, index) => _getOrderView(index)).toList()),
_tabs.mapIndexed((e, index) => WorkOrderReceiverWidget( index:index,)).toList()),
);
}
@ -71,6 +72,7 @@ class _WorkOrderReceiverPageState extends State<WorkOrderReceiverPage>
firstRefresh: true,
header: MaterialHeader(),
onRefresh: () async {
_models = [];
_page = 1;
var base = await NetUtil().getList(SAASAPI.workOrder.list, params: {
'pageNum': _page,
@ -96,7 +98,7 @@ class _WorkOrderReceiverPageState extends State<WorkOrderReceiverPage>
_refreshController.finishLoad();
}
},
child: ListView.separated(
child:_models==[]?SizedBox(): ListView.separated(
padding: EdgeInsets.all(24.w),
itemBuilder: (context, index) {
return DistributorCard(

@ -0,0 +1,90 @@
import 'package:aku_new_community_manager/const/saas_api.dart';
import 'package:aku_new_community_manager/new_ui/work_order/distributor/distributor_card.dart';
import 'package:aku_new_community_manager/saas_models/work_order/work_order_list_model.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/ui/widgets/inner/aku_tab_bar.dart';
import 'package:aku_new_community_manager/utils/network/net_util.dart';
import 'package:flutter/cupertino.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';
class WorkOrderReceiverWidget extends StatefulWidget {
final int index;
const WorkOrderReceiverWidget({Key? key, required this.index}) : super(key: key);
@override
_WorkOrderReceiverWidgetState createState() => _WorkOrderReceiverWidgetState();
}
class _WorkOrderReceiverWidgetState extends State<WorkOrderReceiverWidget>
with SingleTickerProviderStateMixin {
EasyRefreshController _refreshController = EasyRefreshController();
int _page = 1;
int _size = 10;
List<WorkOrderListModel> _models = [];
@override
void initState() {
super.initState();
}
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),
onRefresh: () async {
_models = [];
_page = 1;
var base = await NetUtil().getList(SAASAPI.workOrder.list, params: {
'pageNum': _page,
'size': _size,
'status': widget.index == 0 ? null : widget.index ,
});
_models =
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList();
setState(() {});
},
onLoad: () async {
_page++;
var base = await NetUtil().getList(SAASAPI.workOrder.list, params: {
'pageNum': _page,
'size': _size,
'status': widget.index == 0 ? null : widget.index ,
});
if (_models.length < base.total) {
_models.addAll(
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList());
setState(() {});
} else {
_refreshController.finishLoad();
}
},
child:_models==[]?SizedBox(): ListView.separated(
padding: EdgeInsets.all(24.w),
itemBuilder: (context, index) {
return DistributorCard(
model: _models[index],
refresh: _refreshController.callRefresh,
);
},
separatorBuilder: (context, index) {
return 24.w.heightBox;
},
itemCount: _models.length));
}
}

@ -109,6 +109,7 @@ class _SplashPageState extends State<SplashPage> {
var result = await _showLoginVerify();
if (result == null || !result) {
SystemNavigator.pop();
HiveStore.appBox!.put('agreement', false);
} else {
HiveStore.appBox!.put('agreement', true);

@ -2,6 +2,7 @@
import 'dart:io';
import 'package:aku_new_community_manager/const/saas_api.dart';
import 'package:aku_new_community_manager/new_ui/auth/other_login_page.dart';
import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/saas_models/net_model/base_list_model.dart';
import 'package:aku_new_community_manager/saas_models/net_model/base_model.dart';
@ -172,7 +173,7 @@ class NetUtil {
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
if (!model.success && (model.code == 10010 || model.msg == '登录失效,请重新登录')) {
userProvider.logout();
Get.offAll(() => LoginPage());
Get.offAll(() => OtherLoginPage());
if (userProvider.isLogin) {
BotToast.showText(text: model.msg);
}

Loading…
Cancel
Save