From 9fcb159c7e6059029c6aa76663c2eebc43932c88 Mon Sep 17 00:00:00 2001 From: PH2 <1293456824@qq.com> Date: Tue, 8 Dec 2020 09:58:19 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=9B=BE=E7=89=87=E7=9A=84=E5=8D=A0?= =?UTF-8?q?=E4=BD=8D=202=E3=80=81=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E9=A1=B5=E5=92=8C=E6=90=9C=E7=B4=A2=E9=A1=B5=E7=9A=84item=20pa?= =?UTF-8?q?ge=E5=88=A0=E9=99=A4=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/register.dart | 37 +++++++++++++++---- .../detail_img/goods_details_img.dart | 8 +++- .../detail_img/goods_details_img_sk.dart | 23 +++++++++++- .../search/tabbar/search_tab_widget.dart | 4 +- .../tarbar/search_result_tab_widget.dart | 4 +- 5 files changed, 65 insertions(+), 11 deletions(-) diff --git a/lib/register.dart b/lib/register.dart index d923e16..dc912d3 100644 --- a/lib/register.dart +++ b/lib/register.dart @@ -160,37 +160,60 @@ class BaseWidgetRegister { // 注册页面 static void registPage() { + /// 闪图页 PageFactory.regist('LaunchPage', (model) => LaunchPage()); // PageFactory.regist('homePage', (model) => HomePage()); // PageFactory.regist('pub.flutter.index', (model) => MainPage(model)); + /// 首页 -> 第一页 PageFactory.regist('pub.flutter.index', (model) => CustomPage(model)); + + /// 我的页面 PageFactory.regist('pub.flutter.profile', (model) => MainPage(model)); + + /// 热榜页 PageFactory.regist('pub.flutter.hot_rank', (model) => HotRankingPage(model)); + + /// 钱包页 PageFactory.regist('pub.flutter.my_wallet', (model) => WalletPage(data: model)); + + /// 商品详情页 PageFactory.regist('goods_details', (model) => GoodsDetailsPage(model)); + + /// 搜索页 PageFactory.regist('pub.flutter.search_index', (model) => SearchPage(model)); - PageFactory.regist('search_item_page', (model) => SearchItemPage(model)); + + /// 搜索结果页 PageFactory.regist('pub.flutter.search_result', (model) => SearchResultPage(model)); - PageFactory.regist('search_result_item', (model) => SearchResultItemPage(model)); + + /// 反馈页 PageFactory.regist('pub.flutter.feedback', (model) => FeedbackPage(model)); + + /// 反馈列表页 PageFactory.regist('pub.flutter.feedback_list', (model) => FeedbackRecordPage(model)); + + /// 微信导师 PageFactory.regist('pub.flutter.wechat_teacher', (model) => WechatTeacherPage(model)); + + /// 提现页 PageFactory.regist('pub.flutter.cash_out', (model) => WithdrawPage(model)); - // webview + /// webview PageFactory.regist('pub.flutter.url', (model) => BaseWebview(model)); PageFactory.regist('pub.flutter.profile_settings', (model) => MineDetailPage()); PageFactory.regist('pub.flutter.settings', (model) => SettingPage(model)); - + /// 订单页面 PageFactory.regist('pub.flutter.my_order', (model) => OrdersPage(model)); PageFactory.regist('pub.flutter.account_security', (model) => SecurityPage(model)); PageFactory.regist('pub.flutter.account_security_alipay', (model) => SecurityBindAlipayPage(model)); - // 登录密码 + + /// 登录密码 PageFactory.regist('pub.flutter.account_security_password', (model) => SecurityPassword(model)); - // 修改手机号 + + /// 修改手机号 PageFactory.regist('pub.flutter.account_security_mobile', (model) => SecurityMobile(model)); - // 邀请好友 + + /// 邀请好友 PageFactory.regist('pub.flutter.invite_friends', (model) => InvitedFriendsPage(model)); /// 我的团队 diff --git a/lib/widgets/goods_details/detail_img/goods_details_img.dart b/lib/widgets/goods_details/detail_img/goods_details_img.dart index ed49ced..992313c 100644 --- a/lib/widgets/goods_details/detail_img/goods_details_img.dart +++ b/lib/widgets/goods_details/detail_img/goods_details_img.dart @@ -3,7 +3,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:zhiying_base_widget/widgets/goods_details/detail_img/bloc/goods_details_img_bloc.dart'; import 'package:zhiying_base_widget/widgets/goods_details/detail_img/goods_details_img_sk.dart'; import 'package:zhiying_base_widget/widgets/goods_details/detail_img/model/goods_details_img_model.dart'; -import 'package:zhiying_base_widget/widgets/home/home_quick_entry/cached_network_image_util.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:zhiying_base_widget/widgets/goods_details/detail_img/bloc/goods_details_img_repository.dart'; @@ -108,6 +107,13 @@ class _GoodsDetailsImgWidgetContainerState child: CachedNetworkImage( imageUrl: item ?? '', fit: BoxFit.fitWidth, + // 默认default图片 + placeholder: (context, url){ + return AspectRatio( + aspectRatio: 1/1, + child: Container(color: Colors.white, height: double.infinity, width: double.infinity,), + ); + }, ), )); }).toList(), diff --git a/lib/widgets/goods_details/detail_img/goods_details_img_sk.dart b/lib/widgets/goods_details/detail_img/goods_details_img_sk.dart index 52bd89f..cc7f82a 100644 --- a/lib/widgets/goods_details/detail_img/goods_details_img_sk.dart +++ b/lib/widgets/goods_details/detail_img/goods_details_img_sk.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:shimmer/shimmer.dart'; /// /// 商品详情骨架图 @@ -6,6 +7,26 @@ import 'package:flutter/material.dart'; class GoodsDetailsImgSkeleton extends StatelessWidget { @override Widget build(BuildContext context) { - return Container(); + return Column( + children: List.generate(4, (index) => AspectRatio( + aspectRatio: 1/1, + child: Container( + margin: const EdgeInsets.only(top: 7.5, left: 12.5, right: 12.5), + child: _shimmerWidget(width: double.infinity, height: double.infinity, radius: 5), + ), + )), + ); + } + + Widget _shimmerWidget({double width, double height, double radius = 0}) { + return Shimmer.fromColors( + baseColor: Colors.grey[300], + highlightColor: Colors.grey[100], + child: Container( + width: width, + height: height, + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(radius)), + ), + ); } } diff --git a/lib/widgets/search/tabbar/search_tab_widget.dart b/lib/widgets/search/tabbar/search_tab_widget.dart index 6d75c4d..026c7b6 100644 --- a/lib/widgets/search/tabbar/search_tab_widget.dart +++ b/lib/widgets/search/tabbar/search_tab_widget.dart @@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:tab_indicator_styler/tab_indicator_styler.dart'; +import 'package:zhiying_base_widget/pages/search_page/item/search_item_page.dart'; import 'package:zhiying_base_widget/pages/search_page/notifier/search_tag_notifier.dart'; import 'package:zhiying_base_widget/pages/search_result_page/search_result_page.dart'; import 'package:zhiying_base_widget/pages/search_think_page/bloc/search_think_bloc.dart'; @@ -169,7 +170,8 @@ class _SearchTabWidgetState extends State { controller: _tabController, children: model.search_icon_list.map((item){ // TODO 这里需要和后台沟通改成页面的唯一标示 - return PageFactory.create('search_item_page', item.toJson()); + // return PageFactory.create('search_item_page', item.toJson()); + return SearchItemPage(item.toJson()); }).toList(), ); } diff --git a/lib/widgets/search_result/tarbar/search_result_tab_widget.dart b/lib/widgets/search_result/tarbar/search_result_tab_widget.dart index f820fdf..34e1338 100644 --- a/lib/widgets/search_result/tarbar/search_result_tab_widget.dart +++ b/lib/widgets/search_result/tarbar/search_result_tab_widget.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:tab_indicator_styler/tab_indicator_styler.dart'; import 'package:zhiying_base_widget/pages/search_page/notifier/search_tag_notifier.dart'; +import 'package:zhiying_base_widget/pages/search_result_page/item/search_result_item_page.dart'; import 'package:zhiying_base_widget/pages/search_result_page/search_result_page.dart'; import 'package:zhiying_base_widget/pages/search_think_page/bloc/search_think_bloc.dart'; import 'package:zhiying_base_widget/pages/search_think_page/model/search_think_model.dart'; @@ -220,7 +221,8 @@ class _SearchResultTabWidgetState extends State { controller: _tabController, children: model.search_icon_list.map((item) { // TODO 这里需要和后台沟通改成页面的唯一标示 - return PageFactory.create('search_result_item', item.toJson()..['keywords']= widget?.model?.keywords ?? ''); + // return PageFactory.create('search_result_item', item.toJson()..['keywords']= widget?.model?.keywords ?? ''); + return SearchResultItemPage(item.toJson()..['keywords']= widget?.model?.keywords ?? ''); }).toList(), ); }