分类加载页面

master
laiiihz 4 years ago
parent 1b9ceabed2
commit 2530296b59

@ -13,9 +13,10 @@ import 'package:recook/manager/http_manager.dart';
import 'package:recook/models/category_model.dart';
class HomeDao {
static getCategories({@required OnSuccess<List<FirstCategory>> success,@required OnFailure failure}) async {
ResultData res = await HttpManager.post(GoodsApi.categories, {
});
static Future getCategories(
{@required OnSuccess<List<FirstCategory>> success,
@required OnFailure failure}) async {
ResultData res = await HttpManager.post(GoodsApi.categories, {});
if (!res.result) {
failure(res.code, res.msg);
@ -28,6 +29,4 @@ class HomeDao {
}
}
}
}

@ -1162,8 +1162,10 @@ class _HomePageState extends BaseStoreState<HomePage>
Widget _buildSingleGoodsCard(String path, String name) {
return InkWell(
onTap: () {
HomeDao.getCategories(success: (data, code, msg) {
onTap: () async {
GSDialog.of(context).showLoadingDialog(context, '');
await HomeDao.getCategories(success: (data, code, msg) {
GSDialog.of(context).dismiss(context);
CRoute.push(
context,
ClassifyPage(

Loading…
Cancel
Save