修复我的借还物品显示错误

问卷调查已结束问卷改为不可点击查看详情
部分页面添加自动刷新
hmxc
张萌 4 years ago
parent d879ce5816
commit 67fb556104

@ -30,7 +30,7 @@ class VotingDetailPage extends StatefulWidget {
class _VotingDetailPageState extends State<VotingDetailPage> { class _VotingDetailPageState extends State<VotingDetailPage> {
VotingDetailModel _model = VotingDetailModel(); VotingDetailModel _model = VotingDetailModel();
EasyRefreshController? _refreshController; late EasyRefreshController _refreshController;
bool _isOnload = true; bool _isOnload = true;
// List<int> _select = []; // List<int> _select = [];
int? _selectId; int? _selectId;
@ -50,7 +50,7 @@ class _VotingDetailPageState extends State<VotingDetailPage> {
@override @override
void dispose() { void dispose() {
_refreshController?.dispose(); _refreshController.dispose();
super.dispose(); super.dispose();
} }
@ -183,6 +183,7 @@ class _VotingDetailPageState extends State<VotingDetailPage> {
child: '取消'.text.black.size(34.sp).isIntrinsic.make(), child: '取消'.text.black.size(34.sp).isIntrinsic.make(),
onPressed: () { onPressed: () {
Get.back(); Get.back();
Get.back();
}, },
), ),
CupertinoDialogAction( CupertinoDialogAction(
@ -195,6 +196,7 @@ class _VotingDetailPageState extends State<VotingDetailPage> {
.make(), .make(),
onPressed: () { onPressed: () {
Get.back(); Get.back();
_refreshController.callRefresh();
}, },
) )
], ],

@ -34,7 +34,6 @@ class _GoodsDetoPageState extends State<GoodsDetoPage> {
bool _canSkew(int? state) { bool _canSkew(int? state) {
switch (state) { switch (state) {
case 1: case 1:
return false; return false;
case 2: case 2:
case 3: case 3:
@ -123,11 +122,14 @@ class _GoodsDetoPageState extends State<GoodsDetoPage> {
_select.clear(); _select.clear();
_refreshController.callRefresh(); _refreshController.callRefresh();
} }
: () { : userProvider.isLogin
userProvider.isLogin ? () async {
? Get.to(() => DetoCreatePage()) await Get.to(() => DetoCreatePage());
: BotToast.showText(text: '请先登录!'); _refreshController.callRefresh();
}, }
: () {
BotToast.showText(text: '请先登录!');
},
child: _isEdit child: _isEdit
? '删除'.text.size(32.sp).bold.make() ? '删除'.text.size(32.sp).bold.make()
: '新增'.text.size(32.sp).bold.make(), : '新增'.text.size(32.sp).bold.make(),

@ -19,7 +19,7 @@ class MineGoodsPage extends StatefulWidget {
} }
class _MineGoodsPageState extends State<MineGoodsPage> { class _MineGoodsPageState extends State<MineGoodsPage> {
EasyRefreshController? _controller; late EasyRefreshController _controller;
@override @override
void initState() { void initState() {
@ -30,13 +30,14 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
_controller!.dispose(); _controller.dispose();
} }
InkWell _frmLoss(int? id) { InkWell _frmLoss(int? id) {
return InkWell( return InkWell(
onTap: () async { onTap: () async {
await ManagerFunc.fromLoss(id); await ManagerFunc.fromLoss(id);
_controller.callRefresh();
}, },
child: Container( child: Container(
width: 120.w, width: 120.w,
@ -95,16 +96,16 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
color: Color(0xff4a4b51), color: Color(0xff4a4b51),
), ),
), ),
Container( // Container(
margin: EdgeInsets.only(top: 16.w), // margin: EdgeInsets.only(top: 16.w),
child: Text( // child: Text(
'借还数量10个', // '借还数量10个',
style: TextStyle( // style: TextStyle(
fontSize: 24.sp, // fontSize: 24.sp,
color: Color(0xff333333), // color: Color(0xff333333),
), // ),
), // ),
), // ),
Container( Container(
margin: EdgeInsets.only(top: 16.w), margin: EdgeInsets.only(top: 16.w),
child: Text( child: Text(
@ -131,7 +132,7 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'借用状态: ${BeeMap.borrowStatus}', '借用状态: ${BeeMap.borrowStatus[model.borrowStatus]}',
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
color: Color(0xff999999), color: Color(0xff999999),
@ -167,26 +168,6 @@ class _MineGoodsPageState extends State<MineGoodsPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
title: '我的借还物品', 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<MineGoodsModel>( body: BeeListView<MineGoodsModel>(
path: API.manager.articleBorrowMylist, path: API.manager.articleBorrowMylist,
controller: _controller, controller: _controller,

@ -130,9 +130,11 @@ class _QuestionnairePageState extends State<QuestionnairePage> {
// EdgeInsets.symmetric(horizontal: 30.w, vertical: 8.w), // EdgeInsets.symmetric(horizontal: 30.w, vertical: 8.w),
elevation: 0, elevation: 0,
onPressed: () { onPressed: () {
Get.to(() => QuestionnaireDetailPage( if (model.status == 2) {
id: model.id, Get.to(() => QuestionnaireDetailPage(
)); id: model.id,
));
}
}, },
child: (_getButtonText(model.status)) child: (_getButtonText(model.status))
.text .text

Loading…
Cancel
Save