暂未上线功能添加提示

商城下啦加载完成后隐藏下拉加载框
pull/1/head
张萌 3 years ago
parent 8971038193
commit 196657627a

@ -29,6 +29,7 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
_buildTile(
AO object, {
bool editMode = false,
bool online = false,
}) {
return MaterialButton(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)),
@ -38,7 +39,7 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
: () {
if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRoom(object.title)) return;
if (object.page == null) {
if (object.page == null || !online) {
BotToast.showText(
text: '正在准备上线中,敬请期待', align: Alignment(0, 0.5));
} else {
@ -164,7 +165,7 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
);
}
Widget _buildView(List<AO> objects) {
Widget _buildView(List<AO> objects, bool online) {
final appProvider = Provider.of<AppProvider>(context);
return GridView.builder(
gridDelegate:
@ -172,7 +173,7 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
itemBuilder: (context, index) {
return Stack(
children: [
_buildTile(objects[index], editMode: _editMode),
_buildTile(objects[index], editMode: _editMode, online: online),
Positioned(
right: 0,
top: 0,
@ -220,8 +221,8 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
scrollDirection: Axis.vertical,
controller: _pageController,
children: [
_buildView(smartManagerApp),
_buildView(recommendApp),
_buildView(smartManagerApp, true),
_buildView(recommendApp, false),
],
).expand(),
],

@ -114,6 +114,8 @@ class _MarketPageState extends State<MarketPage>
_pageCount = baseListModel.total;
}
bool _onLoadVisible = true;
@override
void initState() {
super.initState();
@ -160,24 +162,28 @@ class _MarketPageState extends State<MarketPage>
topBouncing: false,
scrollController: _sliverListController,
controller: _refreshController,
onRefresh: () async {
_refresh();
},
onLoad: () async {
_pageNum++;
await loadMarketInfo();
if (_goodsHomeModelList.length >= _pageCount) {
_refreshController.finishLoad(noMore: false);
}
setState(() {});
},
onRefresh: _refresh,
onLoad: !_onLoadVisible
? null
: () async {
_pageNum++;
await loadMarketInfo();
print(_goodsHomeModelList.length);
if (_goodsHomeModelList.length >= _pageCount) {
_refreshController.finishLoad(noMore: true);
_onLoadVisible = false;
print(_onLoadVisible);
}
setState(() {});
},
slivers: _buildBody(context),
),
);
}
_refresh() async {
Future _refresh() async {
await updateMarketInfo();
_onLoadVisible = true;
//_swiperModels = await CommunityFunc.swiper();
_marketSwiperModels = await CommunityFunc.marketSwiper();
_statistics = await CommunityFunc.getMarketStatistics();

Loading…
Cancel
Save