| d1d32220  liangchengyou
 
feat:兑换课程+购买记录 | 1
2 |   import 'package:flutter/material.dart';
  import 'package:flutter_bloc/flutter_bloc.dart';
 | 
| d1d32220  liangchengyou
 
feat:兑换课程+购买记录 | 3
4
5 |   import 'package:flutter_screenutil/flutter_screenutil.dart';
  import 'package:wow_english/common/extension/string_extension.dart';
  import 'package:wow_english/common/widgets/we_app_bar.dart';
 | 
| 07599105  吴启风
 
feat:商品列表请求&路由 | 6 |   import 'package:wow_english/pages/shop/home/widgets/product_item.dart';
 | 
| d1d32220  liangchengyou
 
feat:兑换课程+购买记录 | 7 |   import 'package:wow_english/route/route.dart';
 | 
| c61b3c1a  Key
 
feat: toast_util.... | 8 |   import 'package:wow_english/utils/toast_util.dart';
 | 
| 4b358e22  liangchengyou
 
feat:调整文件结构 | 9
10 |   
  import 'bloc/shop_home_bloc.dart';
 | 
| d1d32220  liangchengyou
 
feat:兑换课程+购买记录 | 11
12
13
14
15
16
17 |   
  class ShopHomePage extends StatelessWidget {
    const ShopHomePage({super.key});
  
    @override
    Widget build(BuildContext context) {
      return BlocProvider(
 | 
| 07599105  吴启风
 
feat:商品列表请求&路由 | 18 |         create: (context) => ShopHomeBloc()..add(RequestDataEvent()),
 | 
| d1d32220  liangchengyou
 
feat:兑换课程+购买记录 | 19
20
21
22
23
24
25
26 |         child: _ShopHomeView(),
      );
    }
  }
  
  class _ShopHomeView extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
 | 
| c61b3c1a  Key
 
feat: toast_util.... | 27 |       return BlocListener<ShopHomeBloc, ShopHomeState>(
 | 
| d1d32220  liangchengyou
 
feat:兑换课程+购买记录 | 28
29
30
31
32 |         listener: (context, state) {},
        child: _shopHomeWidget(),
      );
    }
  
 | 
| 07599105  吴启风
 
feat:商品列表请求&路由 | 33
34
35 |     Widget _shopHomeWidget() =>
        BlocBuilder<ShopHomeBloc, ShopHomeState>(builder: (context, state) {
          final bloc = BlocProvider.of<ShopHomeBloc>(context);
 | 
| c61b3c1a  Key
 
feat: toast_util.... | 36
37
38
39
40
41
42
43
44
45
46 |           return Scaffold(
            appBar: WEAppBar(
              actions: [
                IconButton(
                  icon: Image.asset(
                    'check_lesson'.assetPng,
                    width: 40,
                    height: 40,
                  ),
                  color: Colors.white,
                  onPressed: () {
 | 
| e6a08b82  biao
 
修复兑换之后回到首页不刷新问题;修... | 47
48
49
50 |                     pushNamed(AppRouteName.exLesson).then((value) => {
                          if (value != null)
                            {bloc.exchangeResult = value['exchange']}
                        });
 | 
| c61b3c1a  Key
 
feat: toast_util.... | 51
52
53
54 |                   },
                ),
                IconButton(
                  icon: Image.asset(
 | 
| d5b465e7  吴启风
 
feat:购前须知图标替换 | 55 |                     'icon_shop_desc'.assetPng,
 | 
| c61b3c1a  Key
 
feat: toast_util.... | 56
57
58
59
60 |                     width: 40,
                    height: 40,
                  ),
                  color: Colors.white,
                  onPressed: () {
 | 
| fc3c67bf  吴启风
 
feat:新增购前须知页 | 61 |                     pushNamed(AppRouteName.shopDesc);
 | 
| c61b3c1a  Key
 
feat: toast_util.... | 62
63
64 |                   },
                )
              ],
 | 
| e6a08b82  biao
 
修复兑换之后回到首页不刷新问题;修... | 65
66
67 |               onBack: () {
                popPage(data: {'exchange': bloc.exchangeResult});
              },
 | 
| d1d32220  liangchengyou
 
feat:兑换课程+购买记录 | 68 |             ),
 | 
| c61b3c1a  Key
 
feat: toast_util.... | 69
70 |             body: Center(
              child: Padding(
 | 
| 98670c0d  吴启风
 
feat:练习顶部页码居中显示 | 71 |                 padding: EdgeInsets.symmetric(vertical: 24.h, horizontal: 24.w),
 | 
| c61b3c1a  Key
 
feat: toast_util.... | 72 |                 child: GridView.builder(
 | 
| 07599105  吴启风
 
feat:商品列表请求&路由 | 73 |                     itemCount: bloc.productDatas.length,
 | 
| c61b3c1a  Key
 
feat: toast_util.... | 74
75
76 |                     gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                      crossAxisCount: 2,
                      childAspectRatio: 2,
 | 
| 2101b1cc  吴启风
 
feat:购买页ui优化 | 77
78 |                       mainAxisSpacing: 16.h,
                      crossAxisSpacing: 12.w,
 | 
| c61b3c1a  Key
 
feat: toast_util.... | 79
80 |                     ),
                    itemBuilder: (BuildContext context, int index) {
 | 
| 07599105  吴启风
 
feat:商品列表请求&路由 | 81 |                       final productEntity = bloc.productDatas[index];
 | 
| e6a08b82  biao
 
修复兑换之后回到首页不刷新问题;修... | 82
83
84
85
86 |                       return ProductItem(
                          onTap: () {
                            pushNamed(AppRouteName.pay, arguments: productEntity);
                          },
                          entity: productEntity);
 | 
| c61b3c1a  Key
 
feat: toast_util.... | 87 |                     }),
 | 
| d1d32220  liangchengyou
 
feat:兑换课程+购买记录 | 88 |               ),
 | 
| c61b3c1a  Key
 
feat: toast_util.... | 89
90
91
92 |             ),
          );
        });
  }
 |