首页图片变更

master
laiiihz 5 years ago
parent d5b34a4085
commit 0c285071b7

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

@ -182,6 +182,9 @@ class R {
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/header/vip_header.png)
static const String ASSETS_HEADER_VIP_HEADER_PNG = 'assets/header/vip_header.png';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/home/invite.webp)
static const String ASSETS_HOME_INVITE_WEBP = 'assets/home/invite.webp';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/home_formal.png)
static const String ASSETS_HOME_FORMAL_PNG = 'assets/home_formal.png';
@ -338,6 +341,9 @@ class R {
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/lottery/upgrade.png)
static const String ASSETS_LOTTERY_UPGRADE_PNG = 'assets/lottery/upgrade.png';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/lottery_redeem/.DS_Store)
static const String ASSETS_LOTTERY_REDEEM__DS_STORE = 'assets/lottery_redeem/.DS_Store';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/lottery_redeem/big_lottery.png)
static const String ASSETS_LOTTERY_REDEEM_BIG_LOTTERY_PNG = 'assets/lottery_redeem/big_lottery.png';
@ -353,6 +359,9 @@ class R {
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/lottery_redeem/lottery_history.png)
static const String ASSETS_LOTTERY_REDEEM_LOTTERY_HISTORY_PNG = 'assets/lottery_redeem/lottery_history.png';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/lottery_redeem/lottery_icon.png)
static const String ASSETS_LOTTERY_REDEEM_LOTTERY_ICON_PNG = 'assets/lottery_redeem/lottery_icon.png';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/lottery_redeem/lottery_list.png)
static const String ASSETS_LOTTERY_REDEEM_LOTTERY_LIST_PNG = 'assets/lottery_redeem/lottery_list.png';
@ -368,9 +377,6 @@ class R {
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/master_right_remind.png)
static const String ASSETS_MASTER_RIGHT_REMIND_PNG = 'assets/master_right_remind.png';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/meizi.JPG)
static const String ASSETS_MEIZI_JPG = 'assets/meizi.JPG';
/// ![preview](file:///Users/akufe/Desktop/recook_temp/assets/navigation_category.png)
static const String ASSETS_NAVIGATION_CATEGORY_PNG = 'assets/navigation_category.png';

@ -1,373 +0,0 @@
/*
* ====================================================
* package : pages.home.classify
* author : Created by nansi.
* time : 2019/5/18 1:39 PM
* remark :
* ====================================================
*/
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:recook/base/base_store_state.dart';
import 'package:recook/pages/home/items/item_brand_detail_grid.dart';
import 'package:recook/constants/header.dart';
import 'package:recook/pages/home/items/item_tag_widget.dart';
import 'package:recook/widgets/filter_tool_bar.dart';
import 'package:recook/widgets/refresh_widget.dart';
import 'package:recook/pages/home/items/item_brand_detail_list.dart';
class BrandDetailPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _BrandDetailPageState();
}
}
class _BrandDetailPageState extends BaseStoreState<BrandDetailPage>
with TickerProviderStateMixin {
GSRefreshController _controller = GSRefreshController(initialRefresh: false);
FilterToolBarController filterController;
///
double _topInset = 0;
/// title
Color _titleColor = Colors.white;
/// Appbar
double _appBarBgOpacity = 0;
/// filterBar
double _topTotalHeight = 210;
/// true List false grid
bool _displayList = true;
@override
void initState() {
filterController = FilterToolBarController();
super.initState();
}
@override
void dispose() {
_controller?.dispose();
super.dispose();
}
@override
Widget buildContext(BuildContext context, {store}) {
return Scaffold(
backgroundColor: _displayList ? Colors.white : Color(0xFFF8F7F8),
body: FilterToolBarResultContainer(
controller: filterController,
body: NotificationListener<ScrollUpdateNotification>(
onNotification: (updateDetail) {
double offset = updateDetail.metrics.pixels;
// print("- --------- $offset --------- $_topInset");
double opacityScale = offset / (_topTotalHeight - 80);
setState(() {
_appBarBgOpacity = opacityScale.clamp(0.0, 1.0);
if (_appBarBgOpacity > 0.4) {
_titleColor =
Color.fromARGB((255 * _appBarBgOpacity).toInt(), 0, 0, 0);
} else {
_titleColor = Colors.white;
}
});
},
child: NestedScrollView(
headerSliverBuilder: (context, innerBoxIsScrolled) {
return [
SliverAppBar(
brightness: Brightness.light,
title: Offstage(
offstage: _appBarBgOpacity < 0.4,
child: Text(
"左家右厨",
style: TextStyle(color: _titleColor),
),
),
leading: _backButton(context),
/// 40 filterBar
expandedHeight: _topTotalHeight + 40 + _topInset,
pinned: true,
floating: false,
flexibleSpace: _header(),
bottom: PreferredSize(
child: _filterToolBar(context),
preferredSize: Size.fromHeight(40)),
)
];
},
body: _notificationList(),
),
),
));
}
Stack _header() {
return Stack(children: [
///
Positioned(
left: 0,
right: 0,
top: 0,
bottom: 0,
child: Image.asset(
'assets/meizi.JPG',
fit: BoxFit.cover,
)),
///
Positioned(
top: 0,
bottom: 0,
left: 0,
right: 0,
child: Opacity(
opacity: 0.3,
child: Container(
color: Colors.black,
),
)),
///
Positioned(
bottom: 40,
left: 0,
right: 0,
child: Container(
height: 85,
padding: EdgeInsets.only(left: 110, bottom: 20),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10), topRight: Radius.circular(10))),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Text(
"左家右厨",
style: AppTextStyle.generate(18, fontWeight: FontWeight.w500),
),
Text(
"全部商品: 12",
style: AppTextStyle.generate(14, color: Colors.grey[700]),
)
],
),
),
),
/// icon
Positioned(
left: 15,
bottom: 60,
child: Image.asset(
'assets/meizi.JPG',
height: 80,
width: 80,
fit: BoxFit.cover,
)),
/// appBar
Positioned(
top: 0,
left: 0,
right: 0,
height: DeviceInfo.statusBarHeight + DeviceInfo.appBarHeight,
child: Opacity(
opacity: _appBarBgOpacity,
child: Container(
color: Colors.white,
),
)),
]);
}
_backButton(context) {
return Container(
padding: EdgeInsets.all(13),
child: GestureDetector(
onTap: () {
Navigator.maybePop(context);
},
child: Container(
decoration: BoxDecoration(
color: Color.fromARGB(_appBarBgOpacity < 0.4 ? 100 : 0, 0, 0, 0),
borderRadius: BorderRadius.all(Radius.circular(28))),
child: Center(
child: IconButton(
iconSize: 17,
padding: EdgeInsets.zero,
icon: Icon(
AppIcons.icon_back,
color: _titleColor,
),
onPressed: null,
)),
),
),
);
}
_filterToolBar(BuildContext context) {
return FilterToolBar(
controller: filterController,
titles: [
FilterItemModel(
type: FilterItemType.list,
subtitles: ["综合排序", "新品优先"],
subtitleShort: ["综合", "新品"],
title: "综合"),
FilterItemModel(type: FilterItemType.double, title: "价格"),
FilterItemModel(
type: FilterItemType.normal,
title: "销量",
),
FilterItemModel(type: FilterItemType.normal, title: "特卖优先")
],
trialing: _displayIcon(),
selectedColor: Theme.of(context).primaryColor,
listener: (index, item) {
switch (index) {
case 0:
print("当前选了第 ${item.selectedSubIndex}");
break;
case 1:
print("当前是按价格 ${!item.topSelected ? "降序" : "升序"} ");
break;
case 2:
print("销量");
break;
case 3:
print("特卖优先");
break;
}
},
);
}
///
Container _displayIcon() {
return Container(
margin: EdgeInsets.symmetric(horizontal: 8),
child: GestureDetector(
onTap: () {
setState(() {
_displayList = !_displayList;
});
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
width: 1,
height: 15,
margin: EdgeInsets.only(right: 8),
color: Colors.grey[700],
),
Text(
"排列",
style: AppTextStyle.generate(14,
color: Colors.grey[700], fontWeight: FontWeight.w300),
),
Padding(
padding: const EdgeInsets.only(left: 2),
child: Icon(
_displayList
? AppIcons.icon_list_collection
: AppIcons.icon_list_normal,
color: Colors.grey[700],
size: 20,
),
),
],
),
),
);
}
///
NotificationListener<ScrollEndNotification> _notificationList() {
return NotificationListener<ScrollEndNotification>(
child: NotificationListener<ScrollUpdateNotification>(
onNotification: (detail) {
return true;
},
child: NotificationListener<OverscrollNotification>(
onNotification: (OverscrollNotification notify) {
double scale = 0.3;
if (notify.dragDetails != null &&
notify.dragDetails.delta != null) {
// print("$_topInset ------- ${notify.metrics.pixels}");
if (notify.dragDetails.delta.dy >= 0) {
if (_topInset > 100) {
scale = 0.1;
} else {
scale = 0.3;
}
setState(() {
_topInset += notify.dragDetails.delta.dy * scale;
});
}
}
return true;
},
child: _buildList(),
),
),
onNotification: (endDetail) {
AnimationController controller = AnimationController(
vsync: this, duration: Duration(milliseconds: 150));
Animation<double> animation =
new Tween(begin: _topInset, end: 0.0).animate(controller);
animation.addListener(() {
setState(() {
// the state that has changed here is the animation objects value
_topInset = animation.value;
});
});
controller.forward();
return true;
},
);
}
_buildList() {
return MediaQuery.removePadding(
context: context,
removeTop: true,
child: RefreshWidget(
isInNest: true,
enableOverScroll: false,
controller: _controller,
onLoadMore: () {
Future.delayed(Duration(seconds: 2), () {
_controller.loadNoData();
});
},
body: GridView.builder(
physics: ClampingScrollPhysics(),
padding: EdgeInsets.all(_displayList ? 0 : 8.0),
itemCount: 20,
gridDelegate: ItemTagWidget.getSliverGridDelegate(_displayList, context),
itemBuilder: (context, index) {
return MaterialButton(
padding: EdgeInsets.zero,
onPressed: () {
AppRouter.push(context, RouteName.COMMODITY_PAGE);
},
child: _displayList
? BrandDetailListItem()
: BrandDetailGridItem());
})));
}
}

@ -934,11 +934,10 @@ class _HomePageState extends BaseStoreState<HomePage>
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
// _buttonTitleRow("assets/home_menu_a.png", "我的权益",
_buttonTitleRow(
AppConfig.getShowCommission()
? "assets/home_menu_a.png"
: "assets/listtemp_recookmake_icon.png",
? R.ASSETS_HOME_MENU_A_PNG
: R.ASSETS_LISTTEMP_RECOOKMAKE_ICON_PNG,
AppConfig.getShowCommission() ? "我的权益" : "瑞库制品",
onPressed: () {
if (AppConfig.getShowCommission()) {
@ -960,16 +959,17 @@ class _HomePageState extends BaseStoreState<HomePage>
// AppRouter.push(context, RouteName.NEW_USER_DISCOUNT_PAGE);
}),
_buttonTitleRow(
// R.ASSETS_LOTTERY_REDEEM_LOTTERY_ICON_PNG,
AppConfig.getShowCommission()
? "assets/home_menu_bb.png"
: "assets/listtemp_homelife_icon.png",
? R.ASSETS_HOME_MENU_BB_PNG
: R.ASSETS_LISTTEMP_HOMELIFE_ICON_PNG,
AppConfig.getShowCommission() ? "我的店铺" : "家居生活",
onPressed:
//TODO
() {
showToast('⚠️需要处理打开逻辑');
AppRouter.push(context, RouteName.REDEEM_LOTTERY_PAGE);
},
() {
showToast('⚠️需要处理打开逻辑');
AppRouter.push(context, RouteName.REDEEM_LOTTERY_PAGE);
},
// () {
// if (AppConfig.getShowCommission()) {
// bool value = UserManager.instance.selectTabbar.value;
@ -984,8 +984,8 @@ class _HomePageState extends BaseStoreState<HomePage>
),
_buttonTitleRow(
AppConfig.getShowCommission()
? "assets/home_menu_cc.png"
: "assets/listtemp_homeappliances_icon.png",
? R.ASSETS_HOME_INVITE_WEBP
: R.ASSETS_LISTTEMP_HOMEAPPLIANCES_ICON_PNG,
AppConfig.getShowCommission()
// ? "升级店主"
? "一键邀请"
@ -1001,11 +1001,11 @@ class _HomePageState extends BaseStoreState<HomePage>
}
}),
_buttonTitleRow("assets/home_menu_dd.png", "热销榜单",
_buttonTitleRow(R.ASSETS_HOME_MENU_DD_PNG, "热销榜单",
onPressed: () {
AppRouter.push(context, RouteName.GOODS_HOT_LIST);
}),
_buttonTitleRow("assets/home_menu_ee.png", "全部分类",
_buttonTitleRow(R.ASSETS_HOME_MENU_EE_PNG, "全部分类",
onPressed: () {
AppRouter.push(context, RouteName.CLASSIFY);
}),

@ -14,7 +14,6 @@ import 'package:recook/pages/business/selling_point/selling_point_page.dart';
import 'package:recook/pages/home/barcode/fail_barcode_page.dart';
import 'package:recook/pages/home/barcode/input_barcode_page.dart';
import 'package:recook/pages/home/barcode/photos_fail_barcode_page.dart';
import 'package:recook/pages/home/classify/brand_detail_page.dart';
import 'package:recook/pages/home/classify/brandgoods_list_page.dart';
import 'package:recook/pages/home/classify/classify_page.dart';
import 'package:recook/pages/home/classify/commodity_detail_page.dart';
@ -159,7 +158,6 @@ class RouteName {
static const String CLASSIFY = "/classify";
//
static const String BRAND_PAGE = "/brandPage";
static const String GOODS_LIST_PAGE = "/GoodsList";
static const String BRANDGOODS_LIST_PAGE = "/BrandGoodsListPage";
//
@ -386,8 +384,6 @@ final Map<String, RouteBuilder> _routes = {
//()
RouteName.GOODS_LIST_TEMP: (context, {arguments}) =>
GoodsListTempPage(arguments: arguments),
//
RouteName.BRAND_PAGE: (context, {arguments}) => BrandDetailPage(),
//
RouteName.GOODS_LIST_PAGE: (context, {arguments}) => GoodsListPage(
arguments: arguments,
@ -645,9 +641,8 @@ final Map<String, RouteBuilder> _routes = {
RouteName.LOTTERY_ORDER_PAGE: (context, {arguments}) => LotteryOrderPage(),
RouteName.LOTTERY_ORDER_DETAIL_PAGE: (context, {arguments}) =>
LotteryOrderDetailPage(arguments: arguments),
RouteName.LOTTERY_CART_PAGE:(context,{arguments})=> LotteryCartPage(
arguments:arguments
),
RouteName.LOTTERY_CART_PAGE: (context, {arguments}) =>
LotteryCartPage(arguments: arguments),
};
///

@ -187,6 +187,9 @@ flutter:
uses-material-design: true
assets:
- assets/
#TODO 重构图片assets
- assets/home/
- assets/activityImage/
- assets/recook_launch_image/
- assets/keys/server_rsa_public_key.pem

Loading…
Cancel
Save