From 67fb55610488f4b25e7d5ac2a5a974f83eb5229a Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Thu, 20 May 2021 10:08:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=88=91=E7=9A=84=E5=80=9F?= =?UTF-8?q?=E8=BF=98=E7=89=A9=E5=93=81=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= =?UTF-8?q?=20=E9=97=AE=E5=8D=B7=E8=B0=83=E6=9F=A5=E5=B7=B2=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E9=97=AE=E5=8D=B7=E6=94=B9=E4=B8=BA=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=9F=A5=E7=9C=8B=E8=AF=A6=E6=83=85=20?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event_activity/voting_detail_page.dart | 6 ++- .../goods_deto_page/goods_deto_page.dart | 14 +++--- .../mine_goods_page/mine_goods_page.dart | 47 ++++++------------- .../questionnaire/questionnaire_page.dart | 8 ++-- 4 files changed, 31 insertions(+), 44 deletions(-) diff --git a/lib/pages/event_activity/voting_detail_page.dart b/lib/pages/event_activity/voting_detail_page.dart index f2ff643b..f4973e01 100644 --- a/lib/pages/event_activity/voting_detail_page.dart +++ b/lib/pages/event_activity/voting_detail_page.dart @@ -30,7 +30,7 @@ class VotingDetailPage extends StatefulWidget { class _VotingDetailPageState extends State { VotingDetailModel _model = VotingDetailModel(); - EasyRefreshController? _refreshController; + late EasyRefreshController _refreshController; bool _isOnload = true; // List _select = []; int? _selectId; @@ -50,7 +50,7 @@ class _VotingDetailPageState extends State { @override void dispose() { - _refreshController?.dispose(); + _refreshController.dispose(); super.dispose(); } @@ -183,6 +183,7 @@ class _VotingDetailPageState extends State { child: '取消'.text.black.size(34.sp).isIntrinsic.make(), onPressed: () { Get.back(); + Get.back(); }, ), CupertinoDialogAction( @@ -195,6 +196,7 @@ class _VotingDetailPageState extends State { .make(), onPressed: () { Get.back(); + _refreshController.callRefresh(); }, ) ], diff --git a/lib/pages/goods_deto_page/goods_deto_page.dart b/lib/pages/goods_deto_page/goods_deto_page.dart index a303e5f4..c547d56e 100644 --- a/lib/pages/goods_deto_page/goods_deto_page.dart +++ b/lib/pages/goods_deto_page/goods_deto_page.dart @@ -34,7 +34,6 @@ class _GoodsDetoPageState extends State { bool _canSkew(int? state) { switch (state) { case 1: - return false; case 2: case 3: @@ -123,11 +122,14 @@ class _GoodsDetoPageState extends State { _select.clear(); _refreshController.callRefresh(); } - : () { - userProvider.isLogin - ? Get.to(() => DetoCreatePage()) - : BotToast.showText(text: '请先登录!'); - }, + : userProvider.isLogin + ? () async { + await Get.to(() => DetoCreatePage()); + _refreshController.callRefresh(); + } + : () { + BotToast.showText(text: '请先登录!'); + }, child: _isEdit ? '删除'.text.size(32.sp).bold.make() : '新增'.text.size(32.sp).bold.make(), diff --git a/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart b/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart index 18deec8b..a3249eb9 100644 --- a/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart +++ b/lib/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart @@ -19,7 +19,7 @@ class MineGoodsPage extends StatefulWidget { } class _MineGoodsPageState extends State { - EasyRefreshController? _controller; + late EasyRefreshController _controller; @override void initState() { @@ -30,13 +30,14 @@ class _MineGoodsPageState extends State { @override void dispose() { super.dispose(); - _controller!.dispose(); + _controller.dispose(); } InkWell _frmLoss(int? id) { return InkWell( onTap: () async { await ManagerFunc.fromLoss(id); + _controller.callRefresh(); }, child: Container( width: 120.w, @@ -95,16 +96,16 @@ class _MineGoodsPageState extends State { color: Color(0xff4a4b51), ), ), - Container( - margin: EdgeInsets.only(top: 16.w), - child: Text( - '借还数量:10个', - style: TextStyle( - fontSize: 24.sp, - color: Color(0xff333333), - ), - ), - ), + // Container( + // margin: EdgeInsets.only(top: 16.w), + // child: Text( + // '借还数量:10个', + // style: TextStyle( + // fontSize: 24.sp, + // color: Color(0xff333333), + // ), + // ), + // ), Container( margin: EdgeInsets.only(top: 16.w), child: Text( @@ -131,7 +132,7 @@ class _MineGoodsPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - '借用状态: ${BeeMap.borrowStatus}', + '借用状态: ${BeeMap.borrowStatus[model.borrowStatus]}', style: TextStyle( fontSize: 24.sp, color: Color(0xff999999), @@ -167,26 +168,6 @@ class _MineGoodsPageState extends State { Widget build(BuildContext context) { return BeeScaffold( title: '我的借还物品', - // body: RefreshConfiguration( - // child: SmartRefresher( - // controller: _refreshController, - // header: WaterDropHeader(), - // footer: ClassicFooter(), - // onRefresh: _onRefresh, - // onLoading: _onLoading, - // enablePullUp: true, - // child: ListView.builder( - // itemBuilder: (BuildContext context, int index) => _goodsCard( - // _listGoods[index]['title'], - // _listGoods[index]['borrowTime'], - // _listGoods[index]['timeLength'], - // _listGoods[index]['status'], - // _listGoods[index]['goodsNum'], - // ), - // itemCount: _listGoods.length, - // ), - // ), - // ), body: BeeListView( path: API.manager.articleBorrowMylist, controller: _controller, diff --git a/lib/ui/manager/questionnaire/questionnaire_page.dart b/lib/ui/manager/questionnaire/questionnaire_page.dart index 5643c2ec..831e2402 100644 --- a/lib/ui/manager/questionnaire/questionnaire_page.dart +++ b/lib/ui/manager/questionnaire/questionnaire_page.dart @@ -130,9 +130,11 @@ class _QuestionnairePageState extends State { // EdgeInsets.symmetric(horizontal: 30.w, vertical: 8.w), elevation: 0, onPressed: () { - Get.to(() => QuestionnaireDetailPage( - id: model.id, - )); + if (model.status == 2) { + Get.to(() => QuestionnaireDetailPage( + id: model.id, + )); + } }, child: (_getButtonText(model.status)) .text