Showing
5 changed files
with
2 additions
and
277 deletions
| ... | @@ -6,7 +6,7 @@ import 'package:one_poem/login/widgets/my_text_field.dart'; | ... | @@ -6,7 +6,7 @@ import 'package:one_poem/login/widgets/my_text_field.dart'; |
| 6 | import 'package:one_poem/res/constant.dart'; | 6 | import 'package:one_poem/res/constant.dart'; |
| 7 | import 'package:one_poem/res/resources.dart'; | 7 | import 'package:one_poem/res/resources.dart'; |
| 8 | import 'package:one_poem/routers/fluro_navigator.dart'; | 8 | import 'package:one_poem/routers/fluro_navigator.dart'; |
| 9 | -import 'package:one_poem/store/store_router.dart'; | 9 | +import 'package:one_poem/routers/routers.dart'; |
| 10 | import 'package:one_poem/util/change_notifier_manage.dart'; | 10 | import 'package:one_poem/util/change_notifier_manage.dart'; |
| 11 | import 'package:one_poem/util/other_utils.dart'; | 11 | import 'package:one_poem/util/other_utils.dart'; |
| 12 | import 'package:one_poem/widgets/my_app_bar.dart'; | 12 | import 'package:one_poem/widgets/my_app_bar.dart'; |
| ... | @@ -76,7 +76,7 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag | ... | @@ -76,7 +76,7 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag |
| 76 | 76 | ||
| 77 | void _login() { | 77 | void _login() { |
| 78 | SpUtil.putString(Constant.phone, _nameController.text); | 78 | SpUtil.putString(Constant.phone, _nameController.text); |
| 79 | - NavigatorUtils.push(context, StoreRouter.auditPage); | 79 | + NavigatorUtils.push(context, Routes.home, clearStack: true); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | @override | 82 | @override | ... | ... |
| ... | @@ -8,7 +8,6 @@ import 'package:one_poem/login/login_router.dart'; | ... | @@ -8,7 +8,6 @@ import 'package:one_poem/login/login_router.dart'; |
| 8 | import 'package:one_poem/order/order_router.dart'; | 8 | import 'package:one_poem/order/order_router.dart'; |
| 9 | import 'package:one_poem/setting/setting_router.dart'; | 9 | import 'package:one_poem/setting/setting_router.dart'; |
| 10 | import 'package:one_poem/shop/shop_router.dart'; | 10 | import 'package:one_poem/shop/shop_router.dart'; |
| 11 | -import 'package:one_poem/store/store_router.dart'; | ||
| 12 | import 'package:one_poem/video/video_router.dart'; | 11 | import 'package:one_poem/video/video_router.dart'; |
| 13 | 12 | ||
| 14 | import 'i_router.dart'; | 13 | import 'i_router.dart'; |
| ... | @@ -46,7 +45,6 @@ class Routes { | ... | @@ -46,7 +45,6 @@ class Routes { |
| 46 | _listRouter.add(LoginRouter()); | 45 | _listRouter.add(LoginRouter()); |
| 47 | _listRouter.add(GoodsRouter()); | 46 | _listRouter.add(GoodsRouter()); |
| 48 | _listRouter.add(OrderRouter()); | 47 | _listRouter.add(OrderRouter()); |
| 49 | - _listRouter.add(StoreRouter()); | ||
| 50 | _listRouter.add(AccountRouter()); | 48 | _listRouter.add(AccountRouter()); |
| 51 | _listRouter.add(SettingRouter()); | 49 | _listRouter.add(SettingRouter()); |
| 52 | _listRouter.add(VideoRouter()); | 50 | _listRouter.add(VideoRouter()); | ... | ... |
lib/store/page/store_audit_page.dart
deleted
100644 → 0
| 1 | -import 'package:flutter/foundation.dart'; | ||
| 2 | -import 'package:flutter/material.dart'; | ||
| 3 | -import 'package:one_poem/res/resources.dart'; | ||
| 4 | -import 'package:one_poem/routers/fluro_navigator.dart'; | ||
| 5 | -import 'package:one_poem/util/other_utils.dart'; | ||
| 6 | -import 'package:one_poem/util/theme_utils.dart'; | ||
| 7 | -import 'package:one_poem/widgets/my_app_bar.dart'; | ||
| 8 | -import 'package:one_poem/widgets/my_button.dart'; | ||
| 9 | -import 'package:one_poem/widgets/my_scroll_view.dart'; | ||
| 10 | -import 'package:one_poem/widgets/selected_image.dart'; | ||
| 11 | -import 'package:one_poem/widgets/selected_item.dart'; | ||
| 12 | -import 'package:one_poem/widgets/text_field_item.dart'; | ||
| 13 | -import 'package:image_picker/image_picker.dart'; | ||
| 14 | -import 'package:keyboard_actions/keyboard_actions.dart'; | ||
| 15 | - | ||
| 16 | -import '../store_router.dart'; | ||
| 17 | - | ||
| 18 | - | ||
| 19 | -/// design/2店铺审核/index.html | ||
| 20 | -class StoreAuditPage extends StatefulWidget { | ||
| 21 | - | ||
| 22 | - const StoreAuditPage({Key? key}) : super(key: key); | ||
| 23 | - | ||
| 24 | - @override | ||
| 25 | - _StoreAuditPageState createState() => _StoreAuditPageState(); | ||
| 26 | -} | ||
| 27 | - | ||
| 28 | -class _StoreAuditPageState extends State<StoreAuditPage> { | ||
| 29 | - | ||
| 30 | - final GlobalKey<SelectedImageState> _imageGlobalKey = GlobalKey<SelectedImageState>(); | ||
| 31 | - final FocusNode _nodeText1 = FocusNode(); | ||
| 32 | - final FocusNode _nodeText2 = FocusNode(); | ||
| 33 | - final FocusNode _nodeText3 = FocusNode(); | ||
| 34 | - final ImagePicker picker = ImagePicker(); | ||
| 35 | - final String _address = '陕西省 西安市 雁塔区 高新六路201号'; | ||
| 36 | - | ||
| 37 | - | ||
| 38 | - KeyboardActionsConfig _buildConfig(BuildContext context) { | ||
| 39 | - return KeyboardActionsConfig( | ||
| 40 | - keyboardActionsPlatform: KeyboardActionsPlatform.IOS, | ||
| 41 | - keyboardBarColor: ThemeUtils.getKeyboardActionsColor(context), | ||
| 42 | - actions: [ | ||
| 43 | - KeyboardActionsItem( | ||
| 44 | - focusNode: _nodeText1, | ||
| 45 | - displayDoneButton: false, | ||
| 46 | - ), | ||
| 47 | - KeyboardActionsItem( | ||
| 48 | - focusNode: _nodeText2, | ||
| 49 | - displayDoneButton: false, | ||
| 50 | - ), | ||
| 51 | - KeyboardActionsItem( | ||
| 52 | - focusNode: _nodeText3, | ||
| 53 | - toolbarButtons: [ | ||
| 54 | - (node) { | ||
| 55 | - return GestureDetector( | ||
| 56 | - onTap: () => node.unfocus(), | ||
| 57 | - child: Padding( | ||
| 58 | - padding: const EdgeInsets.only(right: 16.0), | ||
| 59 | - child: Text(Utils.getCurrLocale() == 'zh' ? '关闭' : 'Close'), | ||
| 60 | - ), | ||
| 61 | - ); | ||
| 62 | - }, | ||
| 63 | - ], | ||
| 64 | - ), | ||
| 65 | - ], | ||
| 66 | - ); | ||
| 67 | - } | ||
| 68 | - | ||
| 69 | - @override | ||
| 70 | - Widget build(BuildContext context) { | ||
| 71 | - return Scaffold( | ||
| 72 | - appBar: const MyAppBar( | ||
| 73 | - centerTitle: '店铺审核资料', | ||
| 74 | - ), | ||
| 75 | - body: MyScrollView( | ||
| 76 | - padding: const EdgeInsets.symmetric(vertical: 16.0), | ||
| 77 | - keyboardConfig: _buildConfig(context), | ||
| 78 | - tapOutsideToDismiss: true, | ||
| 79 | - bottomButton: Padding( | ||
| 80 | - padding: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 8.0), | ||
| 81 | - child: MyButton( | ||
| 82 | - onPressed: () { | ||
| 83 | - debugPrint('文件路径:${_imageGlobalKey.currentState?.pickedFile?.path}'); | ||
| 84 | - NavigatorUtils.push(context, StoreRouter.auditResultPage); | ||
| 85 | - }, | ||
| 86 | - text: '提交', | ||
| 87 | - ), | ||
| 88 | - ), | ||
| 89 | - children: _buildBody(), | ||
| 90 | - ), | ||
| 91 | - /// 同时存在底部按钮与keyboardConfig配置时,为保证Android与iOS平台软键盘弹出高度正常,添加下面的代码。 | ||
| 92 | - resizeToAvoidBottomInset: defaultTargetPlatform != TargetPlatform.iOS, | ||
| 93 | - ); | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | - List<Widget> _buildBody() { | ||
| 97 | - return [ | ||
| 98 | - Gaps.vGap5, | ||
| 99 | - const Padding( | ||
| 100 | - padding: EdgeInsets.only(left: 16.0), | ||
| 101 | - child: Text('店铺资料', style: TextStyles.textBold18), | ||
| 102 | - ), | ||
| 103 | - Gaps.vGap16, | ||
| 104 | - Center( | ||
| 105 | - child: SelectedImage( | ||
| 106 | - key: _imageGlobalKey, | ||
| 107 | - ), | ||
| 108 | - ), | ||
| 109 | - Gaps.vGap10, | ||
| 110 | - Center( | ||
| 111 | - child: Text( | ||
| 112 | - '店主手持身份证或营业执照', | ||
| 113 | - style: Theme.of(context).textTheme.subtitle2?.copyWith(fontSize: Dimens.font_sp14), | ||
| 114 | - ), | ||
| 115 | - ), | ||
| 116 | - Gaps.vGap16, | ||
| 117 | - TextFieldItem( | ||
| 118 | - focusNode: _nodeText1, | ||
| 119 | - title: '店铺名称', | ||
| 120 | - hintText: '填写店铺名称' | ||
| 121 | - ), | ||
| 122 | - SelectedItem( | ||
| 123 | - title: '主营范围', | ||
| 124 | - content: _sortName, | ||
| 125 | - onTap: () => _showBottomSheet() | ||
| 126 | - ), | ||
| 127 | - SelectedItem( | ||
| 128 | - title: '店铺地址', | ||
| 129 | - content: _address, | ||
| 130 | - onTap: () { | ||
| 131 | - | ||
| 132 | - } | ||
| 133 | - ), | ||
| 134 | - Gaps.vGap32, | ||
| 135 | - const Padding( | ||
| 136 | - padding:EdgeInsets.only(left: 16.0), | ||
| 137 | - child: Text('店主信息', style: TextStyles.textBold18), | ||
| 138 | - ), | ||
| 139 | - Gaps.vGap16, | ||
| 140 | - TextFieldItem( | ||
| 141 | - focusNode: _nodeText2, | ||
| 142 | - title: '店主姓名', | ||
| 143 | - hintText: '填写店主姓名' | ||
| 144 | - ), | ||
| 145 | - TextFieldItem( | ||
| 146 | - focusNode: _nodeText3, | ||
| 147 | - keyboardType: TextInputType.phone, | ||
| 148 | - title: '联系电话', | ||
| 149 | - hintText: '填写店主联系电话' | ||
| 150 | - ) | ||
| 151 | - ]; | ||
| 152 | - } | ||
| 153 | - | ||
| 154 | - String _sortName = ''; | ||
| 155 | - final List<String> _list = ['水果生鲜', '家用电器', '休闲食品', '茶酒饮料', '美妆个护', '粮油调味', '家庭清洁', '厨具用品', '儿童玩具', '床上用品']; | ||
| 156 | - | ||
| 157 | - void _showBottomSheet() { | ||
| 158 | - showModalBottomSheet<void>( | ||
| 159 | - context: context, | ||
| 160 | - builder: (BuildContext context) { | ||
| 161 | - // 可滑动ListView关闭BottomSheet | ||
| 162 | - return DraggableScrollableSheet( | ||
| 163 | - key: const Key('goods_sort'), | ||
| 164 | - initialChildSize: 0.7, | ||
| 165 | - minChildSize: 0.65, | ||
| 166 | - expand: false, | ||
| 167 | - builder: (_, scrollController) { | ||
| 168 | - return ListView.builder( | ||
| 169 | - controller: scrollController, | ||
| 170 | - itemExtent: 48.0, | ||
| 171 | - itemBuilder: (_, index) { | ||
| 172 | - return InkWell( | ||
| 173 | - child: Container( | ||
| 174 | - padding: const EdgeInsets.symmetric(horizontal: 16.0), | ||
| 175 | - alignment: Alignment.centerLeft, | ||
| 176 | - child: Text(_list[index]), | ||
| 177 | - ), | ||
| 178 | - onTap: () { | ||
| 179 | - setState(() { | ||
| 180 | - _sortName = _list[index]; | ||
| 181 | - }); | ||
| 182 | - NavigatorUtils.goBack(context); | ||
| 183 | - }, | ||
| 184 | - ); | ||
| 185 | - }, | ||
| 186 | - itemCount: _list.length, | ||
| 187 | - ); | ||
| 188 | - }, | ||
| 189 | - ); | ||
| 190 | - }, | ||
| 191 | - ); | ||
| 192 | - } | ||
| 193 | -} |
| 1 | -import 'package:flutter/material.dart'; | ||
| 2 | -import 'package:one_poem/res/resources.dart'; | ||
| 3 | -import 'package:one_poem/routers/fluro_navigator.dart'; | ||
| 4 | -import 'package:one_poem/routers/routers.dart'; | ||
| 5 | -import 'package:one_poem/widgets/load_image.dart'; | ||
| 6 | -import 'package:one_poem/widgets/my_app_bar.dart'; | ||
| 7 | -import 'package:one_poem/widgets/my_button.dart'; | ||
| 8 | - | ||
| 9 | -/// design/2店铺审核/index.html#artboard2 | ||
| 10 | -class StoreAuditResultPage extends StatefulWidget { | ||
| 11 | - | ||
| 12 | - const StoreAuditResultPage({Key? key}) : super(key: key); | ||
| 13 | - | ||
| 14 | - @override | ||
| 15 | - _StoreAuditResultPageState createState() => _StoreAuditResultPageState(); | ||
| 16 | -} | ||
| 17 | - | ||
| 18 | -class _StoreAuditResultPageState extends State<StoreAuditResultPage> { | ||
| 19 | - @override | ||
| 20 | - Widget build(BuildContext context) { | ||
| 21 | - return Scaffold( | ||
| 22 | - appBar: const MyAppBar( | ||
| 23 | - title: '审核结果', | ||
| 24 | - ), | ||
| 25 | - body: Padding( | ||
| 26 | - padding: const EdgeInsets.all(16.0), | ||
| 27 | - child: Column( | ||
| 28 | - children: <Widget>[ | ||
| 29 | - Gaps.vGap50, | ||
| 30 | - const LoadAssetImage('store/icon_success', | ||
| 31 | - width: 80.0, | ||
| 32 | - height: 80.0, | ||
| 33 | - ), | ||
| 34 | - Gaps.vGap12, | ||
| 35 | - const Text( | ||
| 36 | - '恭喜,店铺资料审核成功', | ||
| 37 | - style: TextStyles.textSize16, | ||
| 38 | - ), | ||
| 39 | - Gaps.vGap8, | ||
| 40 | - Text( | ||
| 41 | - '2021-02-21 15:20:10', | ||
| 42 | - style: Theme.of(context).textTheme.subtitle2, | ||
| 43 | - ), | ||
| 44 | - Gaps.vGap8, | ||
| 45 | - Text( | ||
| 46 | - '预计完成时间:02月28日', | ||
| 47 | - style: Theme.of(context).textTheme.subtitle2, | ||
| 48 | - ), | ||
| 49 | - Gaps.vGap24, | ||
| 50 | - MyButton( | ||
| 51 | - onPressed: () { | ||
| 52 | - NavigatorUtils.push(context, Routes.home, clearStack: true); | ||
| 53 | - }, | ||
| 54 | - text: '进入', | ||
| 55 | - ) | ||
| 56 | - ], | ||
| 57 | - ), | ||
| 58 | - ), | ||
| 59 | - ); | ||
| 60 | - } | ||
| 61 | -} |
lib/store/store_router.dart
deleted
100644 → 0
| 1 | -import 'package:fluro/fluro.dart'; | ||
| 2 | -import 'package:one_poem/routers/i_router.dart'; | ||
| 3 | - | ||
| 4 | -import 'page/store_audit_page.dart'; | ||
| 5 | -import 'page/store_audit_result_page.dart'; | ||
| 6 | - | ||
| 7 | - | ||
| 8 | -class StoreRouter implements IRouterProvider{ | ||
| 9 | - | ||
| 10 | - static String auditPage = '/store/audit'; | ||
| 11 | - static String auditResultPage = '/store/auditResult'; | ||
| 12 | - | ||
| 13 | - @override | ||
| 14 | - void initRouter(FluroRouter router) { | ||
| 15 | - router.define(auditPage, handler: Handler(handlerFunc: (_, __) => const StoreAuditPage())); | ||
| 16 | - router.define(auditResultPage, handler: Handler(handlerFunc: (_, __) => const StoreAuditResultPage())); | ||
| 17 | - } | ||
| 18 | - | ||
| 19 | -} |
-
Please register or login to post a comment