修复商城分类信息展示

pull/1/head
张萌 3 years ago
parent 4fd4bd52ee
commit b09ea45bd7

File diff suppressed because it is too large Load Diff

@ -1,3 +1,4 @@
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'market_all_category_model.g.dart';
@ -6,7 +7,7 @@ part 'market_all_category_model.g.dart';
class MarketAllCategoryModel {
final int id;
final String? name;
final List<String> imgUrls;
final List<ImgModel> imgUrls;
final List<MarketAllCategoryModel> categoryList;
factory MarketAllCategoryModel.fromJson(Map<String, dynamic> json) =>
_$MarketAllCategoryModelFromJson(json);

@ -11,8 +11,9 @@ MarketAllCategoryModel _$MarketAllCategoryModelFromJson(
MarketAllCategoryModel(
id: json['id'] as int,
name: json['name'] as String?,
imgUrls:
(json['imgUrls'] as List<dynamic>).map((e) => e as String).toList(),
imgUrls: (json['imgUrls'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
categoryList: (json['categoryList'] as List<dynamic>)
.map(
(e) => MarketAllCategoryModel.fromJson(e as Map<String, dynamic>))

@ -1,3 +1,4 @@
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
@ -7,7 +8,7 @@ part 'market_category_model.g.dart';
class MarketCategoryModel extends Equatable {
final int id;
final String? name;
final List<String> imgUrls;
final List<ImgModel> imgUrls;
@override
List<Object?> get props => [id];

@ -10,6 +10,7 @@ MarketCategoryModel _$MarketCategoryModelFromJson(Map<String, dynamic> json) =>
MarketCategoryModel(
id: json['id'] as int,
name: json['name'] as String?,
imgUrls:
(json['imgUrls'] as List<dynamic>).map((e) => e as String).toList(),
imgUrls: (json['imgUrls'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
);

@ -1,7 +1,7 @@
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/models/market/market_all_category_model.dart';
import 'package:aku_new_community/ui/market/search/search_goods_page.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/widget/beeImageNetwork.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@ -19,13 +19,10 @@ class NewCategorySubCard extends StatelessWidget {
child: Column(
children: [
Spacer(),
FadeInImage.assetNetwork(
image: SAASAPI.image(
subModels.imgUrls.isNotEmpty ? subModels.imgUrls.first : ''),
//subModels.imgUrls!.isNotEmpty? subModels.imgUrls!.first :'',
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
BeeImageNetwork(
height: 75.w,
width: 75.w,
imgs: subModels.imgUrls,
),
12.hb,
Container(

@ -771,7 +771,7 @@ class _MarketPageState extends State<MarketPage>
imageErrorBuilder: (context, error, stackTrace) {
return Image.asset(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
fit: BoxFit.fill,
fit: BoxFit.cover,
);
},
),
@ -825,7 +825,7 @@ class _MarketPageState extends State<MarketPage>
BeeImageNetwork(
width: 88.w,
height: 88.w,
urls: item.imgUrls,
imgs: item.imgUrls,
),
8.hb,
Text(

@ -1,13 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:waterfall_flow/waterfall_flow.dart';
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/models/market/goods_popular_model.dart';
import 'package:aku_new_community/models/search/search_goods_model.dart';
@ -19,6 +10,13 @@ import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/hive_store.dart';
import 'package:aku_new_community/utils/text_utils.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:waterfall_flow/waterfall_flow.dart';
import '../search_goods_card.dart';
import 'good_detail_page.dart';
import 'goods_list_card.dart';
@ -435,7 +433,7 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
Container(
color: Color(0xFFF2F3F4),
child: BeeListView(
path: API.market.findGoodsList,
path: SAASAPI.market.good.recommend,
controller: _refreshController1,
refreshExtra: (model) =>
_models = model as List<SearchGoodsModel>,
@ -677,7 +675,7 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
///
_searchHistoryWidget() {
List<Widget> choiceChipList = [];
if (_searchHistory != null && _searchHistory.length > 0) {
if (_searchHistory.length > 0) {
for (var text in _searchHistory) {
choiceChipList.add(Padding(
padding: EdgeInsets.only(right: 10, bottom: 5),
@ -760,12 +758,10 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
///
getSearchListFromSharedPreferences() async {
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
_searchHistory = HiveStore.appBox!.get(
userProvider.userInfoModel?.id.toString() ??
'' + "userSearhHistory") ??
'';
if (_searchHistory == null) {
_searchHistory = [];
var history = HiveStore.appBox!.get(
userProvider.userInfoModel?.id.toString() ?? '' + "userSearhHistory");
if (history != null) {
_searchHistory = (history as List).cast<String>().toList();
}
setState(() {});
}

Loading…
Cancel
Save