主页对接接口

hmxc
章文轩 3 years ago
parent da874947e4
commit 46eb53711f

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 KiB

@ -701,6 +701,10 @@ class R {
static const String ASSETS_IMAGES_PLACEHOLDER_WEBP = static const String ASSETS_IMAGES_PLACEHOLDER_WEBP =
'assets/images/placeholder.webp'; 'assets/images/placeholder.webp';
/// ![preview](file:///Users/datang/aku_community/assets/images/property_bg.png)
static const String ASSETS_IMAGES_PROPERTY_BG_PNG =
'assets/images/property_bg.png';
/// ![preview](file:///Users/datang/aku_community/assets/images/splash_logo.png) /// ![preview](file:///Users/datang/aku_community/assets/images/splash_logo.png)
static const String ASSETS_IMAGES_SPLASH_LOGO_PNG = static const String ASSETS_IMAGES_SPLASH_LOGO_PNG =
'assets/images/splash_logo.png'; 'assets/images/splash_logo.png';

@ -429,6 +429,54 @@ class _Market {
///jcook ///jcook
String get collectionList => '/user/jcookCollection/myCollection'; String get collectionList => '/user/jcookCollection/myCollection';
///jcook
String get settledBrandsNum => '/user/jcookGoods/settledBrandsNum';
///jcook SKU
String get skuTotal => '/user/jcookGoods/skuTotal';
///jcook
String get newProductsTodayNum => '/user/jcookGoods/newProductsTodayNum';
///jcook
String get findMaxPopularity => '/user/jcookGoods/findMaxPopularity';
///jcook id
String get findAllCategoryByParentId => '/user/jcookGoods/findAllCategoryByParentId';
///jcook bigInfo
String get findGoodsDetailBigInfo => '/user/jcookGoods/findGoodsDetailBigInfo';
///jcook
String get findAllBrand => '/user/jcookGoods/findAllBrand';
///jcook
String get findRecommendGoodsList => '/user/jcookGoods/findRecommendGoodsList';
///jcook
String get findGoodsDetail => '/user/jcookGoods/findGoodsDetail';
///jcook
String get myShoppingCart => '/user/jcookShoppingCat/myShoppingCart';
///jcook
String get insertShoppingCart => '/user/jcookShoppingCat/insertShoppingCart';
///jcook
String get updateShoppingCartNum => '/user/jcookShoppingCat/updateShoppingCartNum';
///jcook
String get deleteShoppingCart => '/user/jcookShoppingCat/deleteShoppingCart';
///jcook
String get settlement => '/user/jcookShoppingCat/settlement';
///jcook
String get myOrder => '/user/jcookOrder/myOrder';
} }

@ -0,0 +1,33 @@
import 'package:aku_community/model/common/img_model.dart';
class GoodsClassification {
int? id;
String? name;
List<ImgModel>? imgUrls;
GoodsClassification({this.id, this.name, this.imgUrls});
GoodsClassification.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
if (json['imgUrls'] != null) {
imgUrls = [];
json['imgUrls'].forEach((v) {
imgUrls!.add(new ImgModel.fromJson(v));
});
} else {
imgUrls = [];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['imgUrls'] = this.imgUrls;
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls!.map((v) => v.toJson()).toList();
}
return data;
}
}

@ -0,0 +1,24 @@
class GoodsPopularModel {
int? id;
String? skuName;
String? mainPhoto;
int? viewsNum;
GoodsPopularModel({this.id, this.skuName, this.mainPhoto, this.viewsNum});
GoodsPopularModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
skuName = json['skuName'];
mainPhoto = json['mainPhoto'];
viewsNum = json['viewsNum'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['skuName'] = this.skuName;
data['mainPhoto'] = this.mainPhoto;
data['viewsNum'] = this.viewsNum;
return data;
}
}

@ -0,0 +1,40 @@
class GoodsHomeModel {
int? id;
String? skuName;
String? mainPhoto;
double? sellPrice;
double? discountPrice;
int? kind;
int? isCollection;
GoodsHomeModel(
{this.id,
this.skuName,
this.mainPhoto,
this.sellPrice,
this.discountPrice,
this.kind,
this.isCollection});
GoodsHomeModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
skuName = json['skuName'];
mainPhoto = json['mainPhoto'];
sellPrice = json['sellPrice'];
discountPrice = json['discountPrice'];
kind = json['kind'];
isCollection = json['isCollection'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['skuName'] = this.skuName;
data['mainPhoto'] = this.mainPhoto;
data['sellPrice'] = this.sellPrice;
data['discountPrice'] = this.discountPrice;
data['kind'] = this.kind;
data['isCollection'] = this.isCollection;
return data;
}
}

@ -10,7 +10,6 @@ import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart'; import 'package:aku_community/const/resource.dart';
import 'package:aku_community/constants/api.dart'; import 'package:aku_community/constants/api.dart';
import 'package:aku_community/model/common/img_model.dart'; import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/models/community_introduce/community_introduce_model.dart';
import 'package:aku_community/utils/network/base_model.dart'; import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.dart'; import 'package:aku_community/utils/network/net_util.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';

@ -96,7 +96,7 @@ class _HomePageState extends State<HomePage>
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: AnimateAppBar( appBar: AnimateAppBar(
scrollController: _scrollController, scrollController: _scrollController,
actions: [ actions: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Get.to(() => BeeSearch()); Get.to(() => BeeSearch());
@ -113,12 +113,12 @@ class _HomePageState extends State<HomePage>
showBadge: appProvider.messageCenterModel.commentCount != 0 || showBadge: appProvider.messageCenterModel.commentCount != 0 ||
appProvider.messageCenterModel.sysCount != 0, appProvider.messageCenterModel.sysCount != 0,
position: BadgePosition.topEnd( position: BadgePosition.topEnd(
top: 3, top: 8.w,
end: -5, end: -4.w,
), ),
badgeContent: Text( badgeContent: Text(
(sum).toString(), (sum).toString(),
style: TextStyle(color: Colors.white, fontSize: 10.sp), style: TextStyle(color: Colors.white, fontSize: 20.sp),
), ),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {

@ -151,6 +151,7 @@ class AppProvider extends ChangeNotifier {
return; return;
} }
_aMapFlutterLocation = AMapFlutterLocation(); _aMapFlutterLocation = AMapFlutterLocation();
_aMapFlutterLocation.onLocationChanged().listen((event) { _aMapFlutterLocation.onLocationChanged().listen((event) {
_location = event; _location = event;
if (_location != null) { if (_location != null) {

@ -2,11 +2,86 @@ import 'package:aku_community/constants/api.dart';
import 'package:aku_community/model/community/activity_item_model.dart'; import 'package:aku_community/model/community/activity_item_model.dart';
import 'package:aku_community/model/community/board_model.dart'; import 'package:aku_community/model/community/board_model.dart';
import 'package:aku_community/model/community/swiper_model.dart'; import 'package:aku_community/model/community/swiper_model.dart';
import 'package:aku_community/models/market/goods_classification.dart';
import 'package:aku_community/models/market/goods_popular_model.dart';
import 'package:aku_community/models/market/order/goods_home_model.dart';
import 'package:aku_community/utils/network/base_list_model.dart'; import 'package:aku_community/utils/network/base_list_model.dart';
import 'package:aku_community/utils/network/base_model.dart'; import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.dart'; import 'package:aku_community/utils/network/net_util.dart';
class CommunityFunc { class CommunityFunc {
///
static Future<String> getNewProductsTodayNum() async {
BaseModel model = await NetUtil().get(
API.market.newProductsTodayNum,
);
if (model.data! == null)
return '0';
return (model.data as int).toString();
}
///
static Future<String> getSettledBrandsNum() async {
BaseModel model = await NetUtil().get(
API.market.settledBrandsNum,
);
if (model.data! == null)
return '0';
return (model.data as int).toString();
}
///SKU
static Future<String> getSkuTotal() async {
BaseModel model = await NetUtil().get(
API.market.skuTotal,
);
if (model.data! == null)
return '0';
return (model.data as int).toString();
}
///
static Future<List<GoodsClassification>> getGoodsClassificationList(int parentId) async {
BaseListModel model = await NetUtil().getList(
API.market.findAllCategoryByParentId,
params: {'pageNum': 1, 'size': 9,'parentId':parentId},
);
if (model.tableList!.length == 0) return [];
return model.tableList!.map((e) => GoodsClassification.fromJson(e)).toList();
}
///
static Future<List<GoodsHomeModel>> getGoodsHomeModelList(
int PageNum,int size,int orderBySalesVolume,int orderByPrice,
) async {
BaseListModel model = await NetUtil().getList(
API.market.findRecommendGoodsList,
params: {'pageNum': PageNum, 'size': size,
'orderBySalesVolume': orderBySalesVolume,'orderByPrice': orderByPrice,},
);
if (model.tableList!.length == 0) return [];
return model.tableList!.map((e) => GoodsHomeModel.fromJson(e)).toList();
}
///
static Future<List<GoodsPopularModel>> getGoodsPopularModel(
int num
) async {
BaseModel model = await NetUtil().get(
API.market.findMaxPopularity,
params: {'num':num},
);
if (model.data!.length == 0)
return [];
return (model.data as List)
.map((e) => GoodsPopularModel.fromJson(e))
.toList();
}
static Future<ActivityItemModel?> activity() async { static Future<ActivityItemModel?> activity() async {
BaseListModel model = await NetUtil().getList( BaseListModel model = await NetUtil().getList(
API.community.activityList, API.community.activityList,

@ -0,0 +1,243 @@
import 'package:aku_community/models/market/order/goods_home_model.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/models/market/goods_item.dart';
import 'package:aku_community/ui/market/goods/goods_detail_page.dart';
import 'package:aku_community/utils/headers.dart';
class MarketHomeGoodsCard extends StatelessWidget {
final GoodsHomeModel item;
final bool? border;
const MarketHomeGoodsCard({Key? key, required this.item, this.border})
: super(key: key);
@override
Widget build(BuildContext context) {
return MaterialButton(
color: Colors.white,
elevation: 0,
shape: !(border ?? false)
? null
: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w),
side: BorderSide(color: Color(0xFFC4C4C4))),
padding: EdgeInsets.zero,
onPressed: () {
// Get.to(
// () => GoodsDetailPage(id: item.id),
// preventDuplicates: false,
// )
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(12.w)),
),
child: Stack(
children: [
FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: item.mainPhoto??'',
fit: BoxFit.fill,
imageErrorBuilder: (context, error, stackTrace) {
return Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP);
},
),
// Positioned(
// left: 0,
// right: 0,
// bottom: 0,
// child: Container(
// height: 38.w,
// color: Colors.black54,
// alignment: Alignment.centerLeft,
// padding: EdgeInsets.symmetric(horizontal: 12.w),
// child: Text(
// item.skuName??'',
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// color: Colors.white,
// fontSize: 18.sp,
// ),
// ),
// ),
// ),
],
),
),
Container(
padding: EdgeInsets.only(
left: 16.w,right: 16.w,
top: 10.w,
),
child: Text(
item.skuName??'',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 28.sp,
color: ktextPrimary
),
),
),
Padding(
padding: EdgeInsets.only(
left: 16.w,right: 16.w,
top: 10.w,
),
child: Container(
child: _getIcon(1),
)
),
10.hb,
Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w,
),
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: '¥',
style: TextStyle(
color: Colors.red,
fontSize: 28.sp,
),
),
TextSpan(
text: '${item.discountPrice??''} ',
style: TextStyle(
color: Colors.red,
fontWeight: FontWeight.bold,
fontSize: 40.sp,
),
),
],
),
),
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w,
),
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: '原价:¥',
style: TextStyle(
color: ktextSubColor,
fontSize: 20.sp,
),
),
TextSpan(
text: '${item.sellPrice??''}',
style: TextStyle(
color: ktextSubColor,
fontSize: 20.sp,
decoration: TextDecoration.lineThrough,
),
),
],
),
),
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w,
),
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: '折扣:',
style: TextStyle(
color: ktextSubColor,
fontSize: 20.sp,
),
),
TextSpan(
text: '9折',
style: TextStyle(
color: ktextSubColor,
fontSize: 20.sp,
),
),
],
),
),
),
],
),
);
}
Widget _getIcon(int type){
if(type==1){
return Container(
width: 86.w,
height: 26.w,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4.w), ),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFEC5329), Color(0xFFF58123)],
),
),
child: Text(
'京东自营',
style: TextStyle(
fontSize: 18.sp,
color: kForeGroundColor
),
),
);
}
else if(type==2){
return Container(
alignment: Alignment.center,
width: 86.w,
height: 30.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4.w), ),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFF59B1C), Color(0xFFF5AF16)],
),
),
child: Text(
'京东POP',
style: TextStyle(
fontSize: 18.sp,
color: kForeGroundColor
),
),
);
}
else
return SizedBox();
}
}

@ -3,6 +3,9 @@
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/model/common/img_model.dart'; import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/model/community/swiper_model.dart'; import 'package:aku_community/model/community/swiper_model.dart';
import 'package:aku_community/models/market/goods_classification.dart';
import 'package:aku_community/models/market/goods_popular_model.dart';
import 'package:aku_community/models/market/order/goods_home_model.dart';
import 'package:aku_community/provider/app_provider.dart'; import 'package:aku_community/provider/app_provider.dart';
import 'package:aku_community/ui/community/community_func.dart'; import 'package:aku_community/ui/community/community_func.dart';
import 'package:aku_community/ui/home/public_infomation/public_information_detail_page.dart'; import 'package:aku_community/ui/home/public_infomation/public_information_detail_page.dart';
@ -37,6 +40,8 @@ import 'package:provider/provider.dart';
import 'package:aku_community/provider/app_provider.dart'; import 'package:aku_community/provider/app_provider.dart';
import 'market_home_goods_card.dart';
// import 'package:aku_community/ui/market/goods/goods_detail_page.dart'; // import 'package:aku_community/ui/market/goods/goods_detail_page.dart';
// import 'package:aku_community/widget/tab_bar/bee_tab_bar.dart'; // import 'package:aku_community/widget/tab_bar/bee_tab_bar.dart';
@ -49,22 +54,23 @@ class MarketPage extends StatefulWidget {
} }
class _MarketPageState extends State<MarketPage> class _MarketPageState extends State<MarketPage>
with AutomaticKeepAliveClientMixin , TickerProviderStateMixin{ with TickerProviderStateMixin,AutomaticKeepAliveClientMixin{
List<MarketCategoryModel> _marketModels = [];
List<GoodsItem> _hotItems = [];
late EasyRefreshController _refreshController; late EasyRefreshController _refreshController;
late ScrollController _sliverListController; late ScrollController _sliverListController;
GlobalKey<HomeSliverAppBarState> _sliverAppBarGlobalKey = GlobalKey(); GlobalKey<HomeSliverAppBarState> _sliverAppBarGlobalKey = GlobalKey();
GlobalKey<AnimatedHomeBackgroundState> _animatedBackgroundState = GlobalKey(); GlobalKey<AnimatedHomeBackgroundState> _animatedBackgroundState = GlobalKey();
int _pageNum = 1; int _pageNum = 1;
int _size = 4; int _size = 10;
int _pageCount = 0; int _pageCount = 0;
double MessageHeight = 76.w; double MessageHeight = 76.w;
double bannerHeight = 354.w; double bannerHeight = 354.w;
double buttonsHeight = 334.w; double buttonsHeight = 334.w;
double searchHeight = 74.w; double searchHeight = 74.w;
String _total = '';
String _newTotal = '';
String _brandTotal = '';
double tabBarHeight = 60.w; double tabBarHeight = 40.w;
late TabController _tabController; late TabController _tabController;
List<SwiperModel> _swiperModels = []; List<SwiperModel> _swiperModels = [];
@ -72,15 +78,25 @@ class _MarketPageState extends State<MarketPage>
OrderType _orderType = OrderType.NORMAL; OrderType _orderType = OrderType.NORMAL;
IconData priceIcon = CupertinoIcons.chevron_up_chevron_down; IconData priceIcon = CupertinoIcons.chevron_up_chevron_down;
List<GoodsClassification> _goodsClassificationList = [];
List<GoodsHomeModel> _goodsHomeModelList = [];
List<GoodsPopularModel> _goodsPopularModelList = [];
int? orderBySalesVolume;
int? orderByPrice;
Future updateMarketInfo() async { Future updateMarketInfo() async {
BaseListModel baseListModel = BaseListModel baseListModel =
await NetUtil().getList(API.market.hotTop, params: { await NetUtil().getList( API.market.findRecommendGoodsList,
"pageNum": _pageNum, params: {'pageNum': _pageNum, 'size': _size,
"size": _size, 'orderBySalesVolume': orderBySalesVolume,'orderByPrice': orderByPrice,},
}); );
if (baseListModel.tableList!.isNotEmpty) { if (baseListModel.tableList!.isNotEmpty) {
_hotItems = (baseListModel.tableList as List) _goodsHomeModelList = (baseListModel.tableList as List)
.map((e) => GoodsItem.fromJson(e)) .map((e) => GoodsHomeModel.fromJson(e))
.toList(); .toList();
} }
_pageCount = baseListModel.pageCount!; _pageCount = baseListModel.pageCount!;
@ -88,14 +104,14 @@ class _MarketPageState extends State<MarketPage>
Future loadMarketInfo() async { Future loadMarketInfo() async {
BaseListModel baseListModel = BaseListModel baseListModel =
await NetUtil().getList(API.market.hotTop, params: { await NetUtil().getList( API.market.findRecommendGoodsList,
"pageNum": _pageNum, params: {'pageNum': _pageNum, 'size': _size,
"size": _size, 'orderBySalesVolume': orderBySalesVolume,'orderByPrice': orderByPrice,},
}); );
if (baseListModel.tableList!.isNotEmpty) { if (baseListModel.tableList!.isNotEmpty) {
_hotItems.addAll((baseListModel.tableList as List) _goodsHomeModelList = (baseListModel.tableList as List)
.map((e) => GoodsItem.fromJson(e)) .map((e) => GoodsHomeModel.fromJson(e))
.toList()); .toList();
} }
_pageCount = baseListModel.pageCount!; _pageCount = baseListModel.pageCount!;
} }
@ -103,13 +119,22 @@ class _MarketPageState extends State<MarketPage>
@override @override
void initState() { void initState() {
super.initState(); super.initState();
for(int i=0;i<10;i++){
_goodsClassificationList.add(GoodsClassification(id: 0,name: '',imgUrls: null));
}
for(int i=0;i<6;i++){
_goodsPopularModelList.add(GoodsPopularModel(id: 0,skuName: '',mainPhoto: '',viewsNum: 0));
}
_refreshController = EasyRefreshController(); _refreshController = EasyRefreshController();
_sliverListController = ScrollController(); _sliverListController = ScrollController();
_tabController = TabController( _tabController = TabController(
initialIndex: 0, length: 3, vsync: this); initialIndex: 0, length: 3, vsync: this);
///appbar refresh
Future.delayed(Duration(milliseconds: 0), () async { Future.delayed(Duration(milliseconds: 0), () async {
_marketModels = await DisplayCategoryModel.top8;
await updateMarketInfo(); await updateMarketInfo();
await _refresh();
setState(() {}); setState(() {});
}); });
} }
@ -124,21 +149,18 @@ class _MarketPageState extends State<MarketPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); // super.build(context);
final mediaWidth = MediaQuery.of(context).size.width; final mediaWidth = MediaQuery.of(context).size.width;
return Scaffold( return Scaffold(
body:EasyRefresh( body:EasyRefresh(
firstRefresh: true, firstRefresh: false,
enableControlFinishLoad: false, enableControlFinishLoad: false,
header: MaterialHeader(), header: MaterialHeader(),
footer: MaterialFooter(), footer: MaterialFooter(),
controller: _refreshController, controller: _refreshController,
onRefresh: () async { onRefresh: () async {
_pageNum = 1; _refresh();
await updateMarketInfo();
_swiperModels = await CommunityFunc.swiper();
setState(() {});
}, },
onLoad: () async { onLoad: () async {
_pageNum++; _pageNum++;
@ -157,11 +179,30 @@ class _MarketPageState extends State<MarketPage>
); );
} }
_refresh() async{
_pageNum = 1;
await updateMarketInfo();
_swiperModels = await CommunityFunc.swiper();
_newTotal = await CommunityFunc.getNewProductsTodayNum();
_total = await CommunityFunc.getSkuTotal();
_brandTotal = await CommunityFunc.getSettledBrandsNum();
_goodsClassificationList = await CommunityFunc.getGoodsClassificationList(0);//0
//_goodsPopularModelList = await CommunityFunc.getGoodsPopularModel(6);
setState(() {});
}
Widget _buildBody(BuildContext context) { Widget _buildBody(BuildContext context) {
final normalTypeButton = MaterialButton( final normalTypeButton = MaterialButton(
onPressed: () { onPressed: () async {
_orderType = OrderType.NORMAL; _orderType = OrderType.NORMAL;
priceIcon = CupertinoIcons.chevron_up_chevron_down; priceIcon = CupertinoIcons.chevron_up_chevron_down;
orderBySalesVolume = null;
orderByPrice = null;
await updateMarketInfo();
setState(() {}); setState(() {});
}, },
child: Text( child: Text(
@ -179,9 +220,12 @@ class _MarketPageState extends State<MarketPage>
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
); );
final salesTypeButton = MaterialButton( final salesTypeButton = MaterialButton(
onPressed: () { onPressed: () async {
_orderType = OrderType.SALES; _orderType = OrderType.SALES;
orderBySalesVolume = 2;
orderByPrice = null;
priceIcon = CupertinoIcons.chevron_up_chevron_down; priceIcon = CupertinoIcons.chevron_up_chevron_down;
await updateMarketInfo();
setState(() {}); setState(() {});
}, },
child: Text( child: Text(
@ -200,22 +244,29 @@ class _MarketPageState extends State<MarketPage>
); );
final priceButton = MaterialButton( final priceButton = MaterialButton(
onPressed: () { onPressed: () async {
switch (_orderType) { switch (_orderType) {
case OrderType.NORMAL: case OrderType.NORMAL:
case OrderType.SALES: case OrderType.SALES:
_orderType = OrderType.PRICE_HIGH; _orderType = OrderType.PRICE_HIGH;
orderByPrice = 1;
orderBySalesVolume = null;
priceIcon = CupertinoIcons.chevron_up; priceIcon = CupertinoIcons.chevron_up;
break; break;
case OrderType.PRICE_HIGH: case OrderType.PRICE_HIGH:
_orderType = OrderType.PRICE_LOW; _orderType = OrderType.PRICE_LOW;
orderByPrice = 2;
orderBySalesVolume = null;
priceIcon = CupertinoIcons.chevron_down; priceIcon = CupertinoIcons.chevron_down;
break; break;
case OrderType.PRICE_LOW: case OrderType.PRICE_LOW:
_orderType = OrderType.PRICE_HIGH; _orderType = OrderType.PRICE_HIGH;
orderByPrice = 1;
orderBySalesVolume = null;
priceIcon = CupertinoIcons.chevron_up; priceIcon = CupertinoIcons.chevron_up;
break; break;
} }
await updateMarketInfo();
setState(() {}); setState(() {});
}, },
child: Row( child: Row(
@ -308,7 +359,7 @@ class _MarketPageState extends State<MarketPage>
(BuildContext context, int index) { (BuildContext context, int index) {
///Item ///Item
return GoodsCard(item: _hotItems[index]); return MarketHomeGoodsCard(item: _goodsHomeModelList[index]);
// return Container( // return Container(
// width: 200.w, // width: 200.w,
// height: 200.w, // height: 200.w,
@ -316,7 +367,7 @@ class _MarketPageState extends State<MarketPage>
// ); // );
}, },
///Item ///Item
childCount: _hotItems.length, childCount: _goodsHomeModelList.length,
), ),
); );
} }
@ -331,7 +382,7 @@ class _MarketPageState extends State<MarketPage>
height: 40.w, width: 40.w), height: 40.w, width: 40.w),
), ),
Padding( Padding(
padding: const EdgeInsets.only( left: 12), padding: EdgeInsets.only( left: 32.w,right: 32.w),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
//Get.to(() => BeeSearch()); //Get.to(() => BeeSearch());
@ -511,7 +562,7 @@ class _MarketPageState extends State<MarketPage>
80.wb, 80.wb,
Image.asset(R.ASSETS_ICONS_SHOP_LABA_PNG,width: 36.w,height: 34.w,), Image.asset(R.ASSETS_ICONS_SHOP_LABA_PNG,width: 36.w,height: 34.w,),
20.wb, 20.wb,
Text('今日上新1231',style: TextStyle(color: Color(0xFFD0564B),fontSize: 24.sp,height: 1.05),), Text('今日上新${_total}',style: TextStyle(color: Color(0xFFD0564B),fontSize: 24.sp,height: 1.05),),
], ],
), ),
), ),
@ -535,9 +586,10 @@ class _MarketPageState extends State<MarketPage>
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text('SKU总数237809',style: TextStyle(color: Colors.white,fontSize: 24.sp),), Text('SKU总数${_newTotal}',style: TextStyle(color: Colors.white,fontSize: 24.sp),),
Text('入驻品牌数:237809',style: TextStyle(color: Colors.white,fontSize: 24.sp),) Text('入驻品牌数:${_brandTotal}',style: TextStyle(color: Colors.white,fontSize: 24.sp),)
], ],
), ),
)), )),
@ -620,79 +672,27 @@ class _MarketPageState extends State<MarketPage>
_buttonTitle() { _buttonTitle() {
Container titles = Container( Container titles = Container(
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(12.w), borderRadius: BorderRadius.circular(12.w),
), ),
child: child:
GridView.builder(
Column( padding: EdgeInsets.zero,
mainAxisAlignment: MainAxisAlignment.center, physics: NeverScrollableScrollPhysics(),
children: [ gridDelegate:
Row( SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 5),
mainAxisAlignment: MainAxisAlignment.center, itemBuilder: (context, index) {
children: <Widget>[ if(index == 9){
Expanded( return _buildAllTile();
child: Row( }else{
mainAxisAlignment: MainAxisAlignment.center, return _buildTile(_goodsClassificationList[index]);
children: <Widget>[ }
_buttonTitleRow( },
itemCount: 10,
), shrinkWrap: true,
_buttonTitleRow(
),
_buttonTitleRow(
),
_buttonTitleRow(
),
_buttonTitleRow(
),
],
),
),
],
),
28.hb,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_buttonTitleRow(
),
_buttonTitleRow(
),
_buttonTitleRow(
),
_buttonTitleRow(
),
_buttonTitleRow(
),
],
),
),
],
),
],
), ),
); );
return Container( return Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -703,6 +703,50 @@ class _MarketPageState extends State<MarketPage>
); );
} }
_buildTile(GoodsClassification item) {
return GestureDetector(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
width: 88.w,
height: 88.w,
image: API.image(ImgModel.first(item.imgUrls)),
imageErrorBuilder: (context, error, stackTrace) {
return Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP,height: 88.w,
width: 88.w,);
},
),
8.hb,
Text( (item.name??'').replaceAll('', ''),style: TextStyle(
fontSize: 28.sp,
color: ktextPrimary
),)
],
),
);
}
_buildAllTile() {
return GestureDetector(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(R.ASSETS_ICONS_TEST_KINGCION_PNG,height: 88.w,
width: 88.w,),
8.hb,
Text( '全部分类',style: TextStyle(
fontSize: 28.sp,
color: ktextPrimary
),)
],
),
);
}
Widget getkingCoin() { Widget getkingCoin() {
return Container( return Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -775,64 +819,56 @@ class _MarketPageState extends State<MarketPage>
), ),
], ],
), ),
Row( GridView.builder(
mainAxisAlignment: MainAxisAlignment.center, padding: EdgeInsets.zero,
children: [ physics: NeverScrollableScrollPhysics(),
Container( gridDelegate:
width: 96.w, SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 6),
height: 96.w, itemBuilder: (context, index) {
child: Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP,width: 96.w,height: 96.w,), return Row(
// FadeInImage.assetNetwork( mainAxisAlignment: MainAxisAlignment.center,
// placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, children: [
// image: Api.getImgUrl(kingCoin.url),) Container(
), width: 96.w,
20.wb, height: 96.w,
Container( child:FadeInImage.assetNetwork(
width: 96.w, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
height: 96.w, image: _goodsPopularModelList[index].mainPhoto??'',
child: Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP,width: 96.w,height: 96.w,), imageErrorBuilder: (context, error, stackTrace) {
// FadeInImage.assetNetwork( return Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP,height: 96.w,
// placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, width: 96.w,);
// image: Api.getImgUrl(kingCoin.url),) },
), ),
20.wb, ),
Container(
width: 96.w, ],
height: 96.w, );
child: Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP,width: 96.w,height: 96.w,), },
// FadeInImage.assetNetwork( itemCount: 6,
// placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, shrinkWrap: true,
// image: Api.getImgUrl(kingCoin.url),) ),
), // Row(
20.wb, // mainAxisAlignment: MainAxisAlignment.center,
Container( // children: [
width: 96.w, // ..._goodsPopularModelList.map((e) => Row(
height: 96.w, // children: [
child: Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP,width: 96.w,height: 96.w,), // Container(
// FadeInImage.assetNetwork( // width: 96.w,
// placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, // height: 96.w,
// image: Api.getImgUrl(kingCoin.url),) // child:FadeInImage.assetNetwork(
), // placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
20.wb, // image: e.mainPhoto??'',
Container( // imageErrorBuilder: (context, error, stackTrace) {
width: 96.w, // return Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP,height: 96.w,
height: 96.w, // width: 96.w,);
child: Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP,width: 96.w,height: 96.w,), // },
// FadeInImage.assetNetwork( // ),
// placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, // ),
// image: Api.getImgUrl(kingCoin.url),) // 20.wb,
), // ],
20.wb, // ),)
Container( // ],
width: 96.w, // ).expand(),
height: 96.w,
child: Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP,width: 96.w,height: 96.w,),
// FadeInImage.assetNetwork(
// placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
// image: Api.getImgUrl(kingCoin.url),)
),
],
).expand(),
], ],
) )
); );

@ -285,8 +285,9 @@ class _MarketPageState extends State<MarketPage111>
), ),
padding: EdgeInsets.all(32.w), padding: EdgeInsets.all(32.w),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final item = _hotItems[index]; return SizedBox();
return GoodsCard(item: item); //final item = _hotItems[index];
// return GoodsCard(item: item);
}, },
itemCount: _hotItems.length, itemCount: _hotItems.length,
), ),

@ -3,22 +3,20 @@ import 'dart:math';
import 'package:aku_community/model/common/img_model.dart'; import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/models/search/search_goods_model.dart'; import 'package:aku_community/models/search/search_goods_model.dart';
import 'package:aku_community/provider/user_provider.dart'; import 'package:aku_community/provider/user_provider.dart';
import 'package:aku_community/ui/market/collection/collection_list_card.dart';
import 'package:aku_community/ui/market/collection/my_collection.dart'; import 'package:aku_community/ui/market/collection/my_collection.dart';
import 'package:aku_community/ui/market/search/search_detail_page.dart';
import 'package:aku_community/ui/market/search/search_func.dart';
import 'package:aku_community/utils/hive_store.dart'; import 'package:aku_community/utils/hive_store.dart';
import 'package:aku_community/utils/network/base_list_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
import 'package:aku_community/utils/text_utils.dart'; import 'package:aku_community/utils/text_utils.dart';
import 'package:aku_community/widget/bee_back_button.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:waterfall_flow/waterfall_flow.dart';
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart'; import 'package:aku_community/constants/api.dart';
@ -395,7 +393,7 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
final item = items[index]; final item = items[index];
return GoodsListCard( return GoodsListCard(
model: item,); //GoodsCard(item: item); model: item,refreshController: _refreshController1,); //GoodsCard(item: item);
}, },
separatorBuilder: (_, __) { separatorBuilder: (_, __) {
return 32.w.heightBox; return 32.w.heightBox;

Loading…
Cancel
Save