Browse Source

1、跳转的修改

2、搜索的修改
3、搜索商品的筛选的优化
tags/0.0.1
PH2 4 years ago
parent
commit
28194f711d
21 changed files with 641 additions and 231 deletions
  1. +6
    -6
      lib/pages/search_result_page/item/bloc/search_result_item_repository.dart
  2. +12
    -9
      lib/register.dart
  3. +2
    -2
      lib/widgets/home/home_goods/home_goods_item.dart
  4. +2
    -2
      lib/widgets/home/home_goods/home_goods_item_single.dart
  5. +1
    -1
      lib/widgets/home/home_quick_entry/home_quick_entry.dart
  6. +2
    -1
      lib/widgets/home/home_sreach/home_sreach_widget.dart
  7. +2
    -1
      lib/widgets/search/history_tag/search_history_tag.dart
  8. +2
    -1
      lib/widgets/search/hot_tag/search_hot_tag_widget.dart
  9. +2
    -1
      lib/widgets/search/input/search_input_widget.dart
  10. +2
    -1
      lib/widgets/search/tabbar/search_tab_widget.dart
  11. +58
    -58
      lib/widgets/search_result/goods_list/bloc/search_result_goods_list_bloc.dart
  12. +38
    -38
      lib/widgets/search_result/goods_list/bloc/search_result_goods_list_event.dart
  13. +33
    -32
      lib/widgets/search_result/goods_list/bloc/search_result_goods_list_repository.dart
  14. +18
    -0
      lib/widgets/search_result/goods_list/search_result_goods_list_creater.dart
  15. +69
    -75
      lib/widgets/search_result/goods_list/search_result_goods_list_widget.dart
  16. +1
    -1
      lib/widgets/search_result/sort/search_result_sort_widget.dart
  17. +110
    -0
      lib/widgets/team/data/team_data_widet.dart
  18. +46
    -0
      lib/widgets/team/fans/team_fans_item.dart
  19. +204
    -0
      lib/widgets/team/recommend/team_recommend_widget.dart
  20. +29
    -0
      lib/widgets/team/temp/team_temp_widget.dart
  21. +2
    -2
      lib/widgets/wallet/wallet_detail/wallet_detail.dart

+ 6
- 6
lib/pages/search_result_page/item/bloc/search_result_item_repository.dart View File

@@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:zhiying_comm/zhiying_comm.dart'; import 'package:zhiying_comm/zhiying_comm.dart';


class SearchResultItemRepository { class SearchResultItemRepository {
List<Map<String, dynamic>> _pageData;
List<Map<String, dynamic>> _pageData = [];


/// 初始化 /// 初始化
Future<List<Map<String, dynamic>>> fetchInitData(final Map<String, dynamic> model) async { Future<List<Map<String, dynamic>>> fetchInitData(final Map<String, dynamic> model) async {
@@ -14,17 +14,15 @@ class SearchResultItemRepository {
if (NetUtil.isSuccess(result) && !EmptyUtil.isEmpty(result)) { if (NetUtil.isSuccess(result) && !EmptyUtil.isEmpty(result)) {
try { try {
List<Map<String, dynamic>> modList = List.from(result[GlobalConfig.HTTP_RESPONSE_KEY_DATA]['mod_list']); List<Map<String, dynamic>> modList = List.from(result[GlobalConfig.HTTP_RESPONSE_KEY_DATA]['mod_list']);

modList.forEach((Map<String, dynamic> item) { modList.forEach((Map<String, dynamic> item) {
var data = jsonDecode(item['data']); var data = jsonDecode(item['data']);
data['keywords'] = keywords; data['keywords'] = keywords;
item['data'] = jsonEncode(data); item['data'] = jsonEncode(data);
_pageData.add(item); _pageData.add(item);
}); });

return _pageData; return _pageData;
} catch (e) {
Logger.error(e.toString());
} catch (e, s) {
Logger.error('${e?.toString()} , s = ${s?.toString()}');
} }
} }
return null; return null;
@@ -49,7 +47,9 @@ class SearchResultItemRepository {
}); });
return _pageData; return _pageData;
} }
} catch (e) {}
} catch (e, s) {
Logger.error('${e?.toString()} , s = ${s?.toString()}');
}
return null; return null;
} }
} }

+ 12
- 9
lib/register.dart View File

@@ -2,6 +2,7 @@ import 'package:sharesdk_plugin/sharesdk_interface.dart';
import 'package:sharesdk_plugin/sharesdk_register.dart'; import 'package:sharesdk_plugin/sharesdk_register.dart';
import 'package:zhiying_base_widget/pages/favorite_page/favorite_page.dart'; import 'package:zhiying_base_widget/pages/favorite_page/favorite_page.dart';
import 'package:zhiying_base_widget/pages/goods_details_page/goods_details_page.dart'; import 'package:zhiying_base_widget/pages/goods_details_page/goods_details_page.dart';
import 'package:zhiying_base_widget/pages/home_page/home_page.dart';
import 'package:zhiying_base_widget/pages/invited_friends/invited_friends.dart'; import 'package:zhiying_base_widget/pages/invited_friends/invited_friends.dart';
import 'package:zhiying_base_widget/pages/launch_page/launch_page.dart'; import 'package:zhiying_base_widget/pages/launch_page/launch_page.dart';
import 'package:zhiying_base_widget/pages/main_page/main_page.dart'; import 'package:zhiying_base_widget/pages/main_page/main_page.dart';
@@ -57,6 +58,7 @@ import 'widgets/search/history_tag/search_history_tag.dart';
import 'widgets/search/hot_tag/search_hot_tag_widget.dart'; import 'widgets/search/hot_tag/search_hot_tag_widget.dart';
import 'widgets/search/input/search_input_widget.dart'; import 'widgets/search/input/search_input_widget.dart';
import 'widgets/search/tabbar/search_tab_creater.dart'; import 'widgets/search/tabbar/search_tab_creater.dart';
import 'widgets/search_result/goods_list/search_result_goods_list_creater.dart';
import 'widgets/search_result/goods_list/search_result_goods_list_widget.dart'; import 'widgets/search_result/goods_list/search_result_goods_list_widget.dart';
import 'widgets/search_result/search_input/search_result_input.dart'; import 'widgets/search_result/search_input/search_result_input.dart';


@@ -92,7 +94,8 @@ class BaseWidgetRegister {


// 注册页面 // 注册页面
static void registPage() { static void registPage() {
PageFactory.regist('homePage', (model) => LaunchPage());
PageFactory.regist('LaunchPage', (model) => LaunchPage());
PageFactory.regist('homePage', (model) => HomePage());
PageFactory.regist('pub.flutter.index', (model) => MainPage(model)); PageFactory.regist('pub.flutter.index', (model) => MainPage(model));
PageFactory.regist('pub.flutter.profile', (model) => MainPage(model)); PageFactory.regist('pub.flutter.profile', (model) => MainPage(model));
PageFactory.regist( PageFactory.regist(
@@ -193,42 +196,42 @@ class BaseWidgetRegister {
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); DefaultWidgetCreater((model) => SearchResultSortWidget(model)));
// 搜索结果的商品列表 淘宝 // 搜索结果的商品列表 淘宝
WidgetFactory.regist('search_result_taobao_item', WidgetFactory.regist('search_result_taobao_item',
DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model)));
SearchResultGoodsListCreater());


// 搜索结果页筛选widget 京东 // 搜索结果页筛选widget 京东
WidgetFactory.regist('search_result_jd_sort', WidgetFactory.regist('search_result_jd_sort',
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); DefaultWidgetCreater((model) => SearchResultSortWidget(model)));
// 搜索结果的商品列表 京东 // 搜索结果的商品列表 京东
WidgetFactory.regist('search_result_jd_item', WidgetFactory.regist('search_result_jd_item',
DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model)));
SearchResultGoodsListCreater());


// 搜索结果页筛选widget 苏宁 // 搜索结果页筛选widget 苏宁
WidgetFactory.regist('search_result_suning_sort', WidgetFactory.regist('search_result_suning_sort',
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); DefaultWidgetCreater((model) => SearchResultSortWidget(model)));
// 搜索结果的商品列表 苏宁 // 搜索结果的商品列表 苏宁
WidgetFactory.regist('search_result_suning_item', WidgetFactory.regist('search_result_suning_item',
DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model)));
SearchResultGoodsListCreater());


// 搜索结果页筛选widget 拼多多 // 搜索结果页筛选widget 拼多多
WidgetFactory.regist('search_result_pdd_sort', WidgetFactory.regist('search_result_pdd_sort',
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); DefaultWidgetCreater((model) => SearchResultSortWidget(model)));
// 搜索结果的商品列表 拼多多 // 搜索结果的商品列表 拼多多
WidgetFactory.regist('search_result_pdd_item', WidgetFactory.regist('search_result_pdd_item',
DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model)));
SearchResultGoodsListCreater());


// 搜索结果页筛选widget 唯品会 // 搜索结果页筛选widget 唯品会
WidgetFactory.regist('search_result_vip',
WidgetFactory.regist('search_result_vip_sort',
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); DefaultWidgetCreater((model) => SearchResultSortWidget(model)));
// 搜索结果的商品列表 唯品会 // 搜索结果的商品列表 唯品会
WidgetFactory.regist('search_result_vip_item', WidgetFactory.regist('search_result_vip_item',
DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model)));
SearchResultGoodsListCreater());


// 搜索结果页筛选widget 考拉 // 搜索结果页筛选widget 考拉
WidgetFactory.regist('search_result_kaola',
WidgetFactory.regist('search_result_kaola_sort',
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); DefaultWidgetCreater((model) => SearchResultSortWidget(model)));
// 搜索结果的商品列表 考拉 // 搜索结果的商品列表 考拉
WidgetFactory.regist('search_result_kaola_item', WidgetFactory.regist('search_result_kaola_item',
DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model)));
SearchResultGoodsListCreater());


/// ==================== 商品详情 ==================== /// /// ==================== 商品详情 ==================== ///
// 商品详情轮播图 // 商品详情轮播图


+ 2
- 2
lib/widgets/home/home_goods/home_goods_item.dart View File

@@ -1,6 +1,7 @@
import 'dart:convert'; import 'dart:convert';


import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/pages/goods_details_page/goods_details_page.dart'; import 'package:zhiying_base_widget/pages/goods_details_page/goods_details_page.dart';
import 'package:zhiying_base_widget/widgets/home/home_goods/models/home_goods_model.dart'; import 'package:zhiying_base_widget/widgets/home/home_goods/models/home_goods_model.dart';
@@ -24,8 +25,7 @@ class HomeGoodsItem extends StatelessWidget {


/// 跳到商品详情 /// 跳到商品详情
void _onJumpGoodsDetails(BuildContext context, HomeGoodsModel goods) { void _onJumpGoodsDetails(BuildContext context, HomeGoodsModel goods) {
Navigator.push(context,
MaterialPageRoute(builder: (_) => GoodsDetailsPage(goods.toJson())));
Navigator.push(context, CupertinoPageRoute(builder: (_) => GoodsDetailsPage(goods.toJson())));
} }


@override @override


+ 2
- 2
lib/widgets/home/home_goods/home_goods_item_single.dart View File

@@ -1,6 +1,7 @@
import 'dart:convert'; import 'dart:convert';


import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/pages/goods_details_page/goods_details_page.dart'; import 'package:zhiying_base_widget/pages/goods_details_page/goods_details_page.dart';
import 'package:zhiying_base_widget/widgets/home/home_goods/models/home_goods_model.dart'; import 'package:zhiying_base_widget/widgets/home/home_goods/models/home_goods_model.dart';
@@ -24,8 +25,7 @@ class HomeGoodsItemSingle extends StatelessWidget {


/// 跳到商品详情 /// 跳到商品详情
void _onJumpGoodsDetails(BuildContext context, HomeGoodsModel goods) { void _onJumpGoodsDetails(BuildContext context, HomeGoodsModel goods) {
Navigator.push(context,
MaterialPageRoute(builder: (_) => GoodsDetailsPage(goods.toJson())));
Navigator.push(context, CupertinoPageRoute(builder: (_) => GoodsDetailsPage(goods.toJson())));
} }


@override @override


+ 1
- 1
lib/widgets/home/home_quick_entry/home_quick_entry.dart View File

@@ -41,7 +41,7 @@ class _HomeQuickEntryContianerState extends State<HomeQuickEntryContianer> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BlocConsumer<HomeQuickEntryBloc, HomeQuickEntryState>( return BlocConsumer<HomeQuickEntryBloc, HomeQuickEntryState>(
listener: (context, state) { listener: (context, state) {
Logger.log('数据加载出错');
Logger.log('home_quick_entry = 数据加载出错');
}, },
buildWhen: (prev, current) { buildWhen: (prev, current) {
if (current is HomeQuickEntryErrorState) { if (current is HomeQuickEntryErrorState) {


+ 2
- 1
lib/widgets/home/home_sreach/home_sreach_widget.dart View File

@@ -2,6 +2,7 @@ import 'dart:convert' as convert;
import 'dart:ui'; import 'dart:ui';


import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/pages/search_page/search_page.dart'; import 'package:zhiying_base_widget/pages/search_page/search_page.dart';
import 'package:zhiying_comm/zhiying_comm.dart'; import 'package:zhiying_comm/zhiying_comm.dart';
@@ -72,7 +73,7 @@ class _HomeSreachContainer extends StatelessWidget {
void _openSreach(BuildContext context){ void _openSreach(BuildContext context){
// SkipModel skipModel = SkipModel.fromJson(model); // SkipModel skipModel = SkipModel.fromJson(model);
// RouterUtil.route(skipModel, null, context); // RouterUtil.route(skipModel, null, context);
Navigator.push(context, MaterialPageRoute(
Navigator.push(context, CupertinoPageRoute(
builder: (context) => SearchPage(null) builder: (context) => SearchPage(null)
)); ));
} }


+ 2
- 1
lib/widgets/search/history_tag/search_history_tag.dart View File

@@ -1,5 +1,6 @@
import 'dart:convert'; import 'dart:convert';


import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:zhiying_base_widget/pages/search_page/notifier/search_tag_notifier.dart'; import 'package:zhiying_base_widget/pages/search_page/notifier/search_tag_notifier.dart';
@@ -40,7 +41,7 @@ class _SearchHistoryTagWidgetState extends State<SearchHistoryTagWidget> {
/// 点击历史标签 /// 点击历史标签
void _historyTagClick(String tag) { void _historyTagClick(String tag) {
if (!EmptyUtil.isEmpty(tag)) { if (!EmptyUtil.isEmpty(tag)) {
Navigator.push(context, MaterialPageRoute(builder: (_) => SearchResultPage({'keywords': tag ?? '', 'tag': 'search_page'})));
Navigator.push(context, CupertinoPageRoute(builder: (_) => SearchResultPage({'keywords': tag ?? '', 'tag': 'search_page'})));
} }
} }




+ 2
- 1
lib/widgets/search/hot_tag/search_hot_tag_widget.dart View File

@@ -1,5 +1,6 @@
import 'dart:convert'; import 'dart:convert';


import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/pages/search_page/notifier/search_tag_notifier.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_result_page/search_result_page.dart';
@@ -31,7 +32,7 @@ class SearchHotTagWidget extends StatelessWidget {


await Provider.of<SearchTagNotifier>(context, listen: false).addTag(model.keyword); await Provider.of<SearchTagNotifier>(context, listen: false).addTag(model.keyword);


Navigator.push(context, MaterialPageRoute(builder: (_) => SearchResultPage({'keywords': model?.keyword ?? '', 'tag': 'search_page'})));
Navigator.push(context, CupertinoPageRoute(builder: (_) => SearchResultPage({'keywords': model?.keyword ?? '', 'tag': 'search_page'})));
} }
} }




+ 2
- 1
lib/widgets/search/input/search_input_widget.dart View File

@@ -1,5 +1,6 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:ui'; import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/pages/search_page/notifier/search_tag_notifier.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_result_page/search_result_page.dart';
@@ -40,7 +41,7 @@ class _SearchInputWidgetState extends State<SearchInputWidget> {
/// TODO 保存历史标签 /// TODO 保存历史标签
if (!EmptyUtil.isEmpty(content)) { if (!EmptyUtil.isEmpty(content)) {
await Provider.of<SearchTagNotifier>(context, listen: false).addTag(content); await Provider.of<SearchTagNotifier>(context, listen: false).addTag(content);
Navigator.push(context, MaterialPageRoute(builder: (_) => SearchResultPage({'keywords': content, 'tag': 'search_page'})));
Navigator.push(context, CupertinoPageRoute(builder: (_) => SearchResultPage({'keywords': content, 'tag': 'search_page'})));
}else{ }else{
Fluttertoast.showToast(msg: '输入内容不能为空!'); Fluttertoast.showToast(msg: '输入内容不能为空!');
} }


+ 2
- 1
lib/widgets/search/tabbar/search_tab_widget.dart View File

@@ -1,5 +1,6 @@
import 'dart:convert'; import 'dart:convert';


import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:tab_indicator_styler/tab_indicator_styler.dart'; import 'package:tab_indicator_styler/tab_indicator_styler.dart';
@@ -36,7 +37,7 @@ class _SearchTabWidgetState extends State<SearchTabWidget> {


/// 联想列表的item点击事件 /// 联想列表的item点击事件
_onThinkItemClick(SearchThinkModel model){ _onThinkItemClick(SearchThinkModel model){
Navigator.push(context, MaterialPageRoute(
Navigator.push(context, CupertinoPageRoute(
builder: (_)=> SearchResultPage(model.toJson()..['tag'] = 'search_page') builder: (_)=> SearchResultPage(model.toJson()..['tag'] = 'search_page')
)); ));
} }


+ 58
- 58
lib/widgets/search_result/goods_list/bloc/search_result_goods_list_bloc.dart View File

@@ -55,25 +55,25 @@ class SearchResultGoodsListBloc extends Bloc<SearchResultGoodsListEvent, SearchR
yield* _mapSortEventToState(event); yield* _mapSortEventToState(event);
} }


/// 综合
if (event is SearchResultGoodsListZHSortEvent) {
yield* _mapZhSortEventToState(event);
}
/// 补贴
if (event is SearchResultGoodsListBtSortEvent) {
yield* _mapBTSortEventToState(event);
}
/// 优惠券
if (event is SearchResultGoodsListYHQSortEvent) {
yield* _mapYHQSortEventToState(event);
}
/// 筛选
if (event is SearchResultGoodsListSXSortEvent) {
yield* _mapSXSortEventToState(event);
}
// /// 综合
// if (event is SearchResultGoodsListZHSortEvent) {
// yield* _mapZhSortEventToState(event);
// }
//
// /// 补贴
// if (event is SearchResultGoodsListBtSortEvent) {
// yield* _mapBTSortEventToState(event);
// }
//
// /// 优惠券
// if (event is SearchResultGoodsListYHQSortEvent) {
// yield* _mapYHQSortEventToState(event);
// }
//
// /// 筛选
// if (event is SearchResultGoodsListSXSortEvent) {
// yield* _mapSXSortEventToState(event);
// }
} }


/// 初始化事件 /// 初始化事件
@@ -136,43 +136,43 @@ class SearchResultGoodsListBloc extends Bloc<SearchResultGoodsListEvent, SearchR
} }
} }


/// 综合排序
Stream<SearchResultGoodsListState> _mapZhSortEventToState(SearchResultGoodsListZHSortEvent event) async* {
var result = await repository.fetchZhSort(event.args);
if (!EmptyUtil.isEmpty(result)) {
yield SearchResultGoodsListLoadedState(model: result);
} else {
yield SearchResultGoodsListErrorState();
}
}
/// 补贴排序
Stream<SearchResultGoodsListState> _mapBTSortEventToState(SearchResultGoodsListBtSortEvent event) async* {
var result = await repository.fetchBt(event.args);
if (!EmptyUtil.isEmpty(result)) {
yield SearchResultGoodsListLoadedState(model: result);
} else {
yield SearchResultGoodsListErrorState();
}
}
/// 优惠券排序
Stream<SearchResultGoodsListState> _mapYHQSortEventToState(SearchResultGoodsListYHQSortEvent event) async* {
var result = await repository.fetchYhq(event.args);
if (!EmptyUtil.isEmpty(result)) {
yield SearchResultGoodsListLoadedState(model: result);
} else {
yield SearchResultGoodsListErrorState();
}
}
/// 筛选排序
Stream<SearchResultGoodsListState> _mapSXSortEventToState(SearchResultGoodsListSXSortEvent event) async* {
var result = await repository.fetchSX(event.args);
if (!EmptyUtil.isEmpty(result)) {
yield SearchResultGoodsListLoadedState(model: result);
} else {
yield SearchResultGoodsListErrorState();
}
}
// /// 综合排序
// Stream<SearchResultGoodsListState> _mapZhSortEventToState(SearchResultGoodsListZHSortEvent event) async* {
// var result = await repository.fetchZhSort(event.args);
// if (!EmptyUtil.isEmpty(result)) {
// yield SearchResultGoodsListLoadedState(model: result);
// } else {
// yield SearchResultGoodsListErrorState();
// }
// }
//
// /// 补贴排序
// Stream<SearchResultGoodsListState> _mapBTSortEventToState(SearchResultGoodsListBtSortEvent event) async* {
// var result = await repository.fetchBt(event.args);
// if (!EmptyUtil.isEmpty(result)) {
// yield SearchResultGoodsListLoadedState(model: result);
// } else {
// yield SearchResultGoodsListErrorState();
// }
// }
//
// /// 优惠券排序
// Stream<SearchResultGoodsListState> _mapYHQSortEventToState(SearchResultGoodsListYHQSortEvent event) async* {
// var result = await repository.fetchYhq(event.args);
// if (!EmptyUtil.isEmpty(result)) {
// yield SearchResultGoodsListLoadedState(model: result);
// } else {
// yield SearchResultGoodsListErrorState();
// }
// }
//
// /// 筛选排序
// Stream<SearchResultGoodsListState> _mapSXSortEventToState(SearchResultGoodsListSXSortEvent event) async* {
// var result = await repository.fetchSX(event.args);
// if (!EmptyUtil.isEmpty(result)) {
// yield SearchResultGoodsListLoadedState(model: result);
// } else {
// yield SearchResultGoodsListErrorState();
// }
// }
} }

+ 38
- 38
lib/widgets/search_result/goods_list/bloc/search_result_goods_list_event.dart View File

@@ -36,41 +36,41 @@ class SearchResultGoodsListSortEvent extends SearchResultGoodsListEvent{
} }


/// 综合排序 /// 综合排序
class SearchResultGoodsListZHSortEvent extends SearchResultGoodsListEvent{
String args;
String id;
SearchResultGoodsListZHSortEvent(this.args, this.id);
@override
List<Object> get props => [this.args, this.id];
}
/// 补贴排序
class SearchResultGoodsListBtSortEvent extends SearchResultGoodsListEvent{
String args;
String id;
SearchResultGoodsListBtSortEvent(this.args, this.id);
@override
List<Object> get props => [this.args, this.id];
}
/// 优惠券排序
class SearchResultGoodsListYHQSortEvent extends SearchResultGoodsListEvent{
String args;
String id;
SearchResultGoodsListYHQSortEvent(this.args, this.id);
@override
List<Object> get props => [this.args, this.id];
}
/// 优惠券排序
class SearchResultGoodsListSXSortEvent extends SearchResultGoodsListEvent{
String args;
String id;
SearchResultGoodsListSXSortEvent(this.args, this.id);
@override
List<Object> get props => [this.args, this.id];
}
// class SearchResultGoodsListZHSortEvent extends SearchResultGoodsListEvent{
// String args;
// String id;
//
// SearchResultGoodsListZHSortEvent(this.args, this.id);
// @override
// List<Object> get props => [this.args, this.id];
// }
//
// /// 补贴排序
// class SearchResultGoodsListBtSortEvent extends SearchResultGoodsListEvent{
// String args;
// String id;
//
// SearchResultGoodsListBtSortEvent(this.args, this.id);
// @override
// List<Object> get props => [this.args, this.id];
// }
//
// /// 优惠券排序
// class SearchResultGoodsListYHQSortEvent extends SearchResultGoodsListEvent{
// String args;
// String id;
//
// SearchResultGoodsListYHQSortEvent(this.args, this.id);
// @override
// List<Object> get props => [this.args, this.id];
// }
//
// /// 优惠券排序
// class SearchResultGoodsListSXSortEvent extends SearchResultGoodsListEvent{
// String args;
// String id;
//
// SearchResultGoodsListSXSortEvent(this.args, this.id);
// @override
// List<Object> get props => [this.args, this.id];
// }

+ 33
- 32
lib/widgets/search_result/goods_list/bloc/search_result_goods_list_repository.dart View File

@@ -78,38 +78,6 @@ class SearchResultGoodsListRepository {
return _baseInitData(true, reqData); return _baseInitData(true, reqData);
} }


/// 综合排序
Future<List<HomeGoodsModel>> fetchZhSort(String arg) async {
_urlArgs['zh'] = arg;
_currentPage = 1;
_hasNomore = true;
return _baseInitData(true, reqData);
}

/// 补贴
Future<List<HomeGoodsModel>> fetchBt(String arg) async {
_urlArgs['bt'] = arg;
_currentPage = 1;
_hasNomore = true;
return _baseInitData(true, reqData);
}

/// 优惠券
Future<List<HomeGoodsModel>> fetchYhq(String arg) async {
_urlArgs['yhq'] = arg;
_currentPage = 1;
_hasNomore = true;
return _baseInitData(true, reqData);
}

/// 筛选
Future<List<HomeGoodsModel>> fetchSX(String arg) async {
_urlArgs['sx'] = arg;
_currentPage = 1;
_hasNomore = true;
return _baseInitData(true, reqData);
}

/// 查询 /// 查询
Future<List<HomeGoodsModel>> _baseInitData(bool refresh, final Map<String, dynamic> model) async { Future<List<HomeGoodsModel>> _baseInitData(bool refresh, final Map<String, dynamic> model) async {
String keyword = model['keywords'] ?? ''; String keyword = model['keywords'] ?? '';
@@ -177,4 +145,37 @@ class SearchResultGoodsListRepository {
return url; return url;
} }
} }


// /// 综合排序
// Future<List<HomeGoodsModel>> fetchZhSort(String arg) async {
// _urlArgs['zh'] = arg;
// _currentPage = 1;
// _hasNomore = true;
// return _baseInitData(true, reqData);
// }
//
// /// 补贴
// Future<List<HomeGoodsModel>> fetchBt(String arg) async {
// _urlArgs['bt'] = arg;
// _currentPage = 1;
// _hasNomore = true;
// return _baseInitData(true, reqData);
// }
//
// /// 优惠券
// Future<List<HomeGoodsModel>> fetchYhq(String arg) async {
// _urlArgs['yhq'] = arg;
// _currentPage = 1;
// _hasNomore = true;
// return _baseInitData(true, reqData);
// }
//
// /// 筛选
// Future<List<HomeGoodsModel>> fetchSX(String arg) async {
// _urlArgs['sx'] = arg;
// _currentPage = 1;
// _hasNomore = true;
// return _baseInitData(true, reqData);
// }
} }

+ 18
- 0
lib/widgets/search_result/goods_list/search_result_goods_list_creater.dart View File

@@ -0,0 +1,18 @@
import 'package:flutter/src/widgets/framework.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

import 'search_result_goods_list_widget.dart';


class SearchResultGoodsListCreater extends WidgetCreater {
@override
List<Widget> createWidgets(Map<String, dynamic> model) {

return [SearchResultGoodsListWidget(model)];
}

@override
bool isSliverChild() {
return true;
}
}

+ 69
- 75
lib/widgets/search_result/goods_list/search_result_goods_list_widget.dart View File

@@ -61,11 +61,6 @@ class _SearchResultGoodsListWidgetContainerState extends State<SearchResultGoods
BlocProvider.of<SearchResultGoodsListBloc>(context).add(SearchResultGoodsListOnLoadEvent()); BlocProvider.of<SearchResultGoodsListBloc>(context).add(SearchResultGoodsListOnLoadEvent());
} }


/// 跳转商品详情
void _openGoodsDetailsPage() {
Navigator.push(context, MaterialPageRoute(builder: (_) => GoodsDetailsPage(null)));
}

@override @override
void initState() { void initState() {
/// 初始化 /// 初始化
@@ -75,20 +70,35 @@ class _SearchResultGoodsListWidgetContainerState extends State<SearchResultGoods


@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BlocConsumer<SearchResultGoodsListBloc, SearchResultGoodsListState>(
listener: (BuildContext context, SearchResultGoodsListState state) {
if (state is SearchResultGoodsListErrorState) {
print('数据加载出错');
}
},
buildWhen: (previous, current) {
/// 数据加载出错不进行build
if (current is SearchResultGoodsListErrorState) {
return false;
}
// return BlocConsumer<SearchResultGoodsListBloc, SearchResultGoodsListState>(
// listener: (BuildContext context, SearchResultGoodsListState state) {
// if (state is SearchResultGoodsListErrorState) {
// print('search_result_goods_list_widget = 数据加载出错');
// }
// },
// buildWhen: (previous, current) {
// /// 数据加载出错不进行build
// if (current is SearchResultGoodsListErrorState) {
// return false;
// }
//
// return true;
// },
// builder: (context, state) {
// if (state is SearchResultGoodsListLoadedState) {
// return _getMainWidget(state?.model, widget?.style);
// }
// if (state is SearchResultGoodsListChangeStyleState) {
// _isShowOneColumn = state.isShowOneColumn;
// return _getMainWidget(state?.model, widget?.style);
// }
//
// /// 骨架屏幕
// return HomeGoodsSkeleton();
// },
// );


return true;
},
return BlocBuilder<SearchResultGoodsListBloc, SearchResultGoodsListState>(
builder: (context, state) { builder: (context, state) {
if (state is SearchResultGoodsListLoadedState) { if (state is SearchResultGoodsListLoadedState) {
return _getMainWidget(state?.model, widget?.style); return _getMainWidget(state?.model, widget?.style);
@@ -97,9 +107,7 @@ class _SearchResultGoodsListWidgetContainerState extends State<SearchResultGoods
_isShowOneColumn = state.isShowOneColumn; _isShowOneColumn = state.isShowOneColumn;
return _getMainWidget(state?.model, widget?.style); return _getMainWidget(state?.model, widget?.style);
} }

/// 骨架屏幕
return HomeGoodsSkeleton();
return SliverToBoxAdapter(child: HomeGoodsSkeleton(),);
}, },
); );
} }
@@ -108,11 +116,10 @@ class _SearchResultGoodsListWidgetContainerState extends State<SearchResultGoods
Widget _getMainWidget(List<HomeGoodsModel> goods, HomeGoodsStyleModel styleModel) { Widget _getMainWidget(List<HomeGoodsModel> goods, HomeGoodsStyleModel styleModel) {
int column = _isShowOneColumn ? 1 : 2; int column = _isShowOneColumn ? 1 : 2;


return ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: goods?.length ?? 0,
itemBuilder: (context, index) {
return SliverPadding(
padding: const EdgeInsets.only(top: 25),
sliver: SliverList(
delegate: SliverChildBuilderDelegate((context, index) {
if (column == 1) { if (column == 1) {
return HomeGoodsItemSingle( return HomeGoodsItemSingle(
goods[index], goods[index],
@@ -139,54 +146,41 @@ class _SearchResultGoodsListWidgetContainerState extends State<SearchResultGoods
), ),
); );
} }
});
}
}, childCount: goods.length),
),
);


/// 单列
// Widget _getSignleWidget(List<HomeGoodsModel> goods, HomeGoodsStyleModel styleModel) {
// return ListView.builder(
// shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
// itemCount: goods.length,
// itemBuilder: (context, index) {
// if (column == 1) {
// return HomeGoodsItemSingle(
// goods[index],
// styleModel,
// data: widget.data,
// );
// } else {
// // return Container(color: Colors.red, height: 126,margin: EdgeInsets.all(10),);
// return Padding(
// padding: const EdgeInsets.only(left: 5, right: 5),
// child: Row(
// children: List.generate(column, (c) {
// int i = index * column + c;
// return Expanded(
// child: i < goods.length
// ? HomeGoodsItem(
// goods[i],
// _style,
// data: widget.data,
// )
// : Container(),
// );
// }).toList(),
// ),
// );
// }
// });
//
// return HomeGoodsItemSingle(model, styleModel);
// }
//
// /// 双列
// Widget _getTowWidget(List<HomeGoodsModel> goods, HomeGoodsStyleModel styleModel) {
// int column = 2;
// int count = (goods.length / column).ceil();
//
// return Container(
// child: Text('22222222'),
// );
// }
// return ListView.builder(
// shrinkWrap: true,
// // physics: NeverScrollableScrollPhysics(),
// itemCount: goods?.length ?? 0,
// itemBuilder: (context, index) {
// if (column == 1) {
// return HomeGoodsItemSingle(
// goods[index],
// styleModel,
// data: widget.data,
// );
// } else {
// // return Container(color: Colors.red, height: 126,margin: EdgeInsets.all(10),);
// return Padding(
// padding: const EdgeInsets.only(left: 5, right: 5),
// child: Row(
// children: List.generate(column, (c) {
// int i = index * column + c;
// return Expanded(
// child: i < goods.length
// ? HomeGoodsItem(
// goods[i],
// styleModel,
// data: widget.data,
// )
// : Container(),
// );
// }).toList(),
// ),
// );
// }
// });
}
} }

+ 1
- 1
lib/widgets/search_result/sort/search_result_sort_widget.dart View File

@@ -330,7 +330,7 @@ class _SearchResultSortWidgetState extends State<SearchResultSortWidget> {
width: double.infinity, width: double.infinity,
child: Text( child: Text(
item?.name ?? '', item?.name ?? '',
style: TextStyle(fontSize: 12, color: HexColor.fromHex(item.isSelect ? widget?.model?.text_select_color ?? '' : widget?.model?.text_no_select_color ?? '')),
style: TextStyle(fontSize: 14, color: HexColor.fromHex(item.isSelect ? widget?.model?.text_select_color ?? '' : widget?.model?.text_no_select_color ?? '')),
), ),
), ),
)); ));


+ 110
- 0
lib/widgets/team/data/team_data_widet.dart View File

@@ -0,0 +1,110 @@
import 'package:flutter/material.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

///
/// 我的团队 - 数据widget
///
class TeamDataWidget extends StatefulWidget {
@override
_TeamDataWidgetState createState() => _TeamDataWidgetState();
}

class _TeamDataWidgetState extends State<TeamDataWidget> {
@override
Widget build(BuildContext context) {
return _getMainWidget();
}

/// 主视图
Widget _getMainWidget() {
return Container(
margin: const EdgeInsets.only(left: 12.5, right: 12.5, top: 8),
padding: const EdgeInsets.only(left: 10.5, right: 9.5),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: HexColor.fromHex('#FFFFFF')),
child: Column(
children: <Widget>[
/// 直推人数 & 间推人数
Row(
children: <Widget>[
/// 直推人数
_getCustomWidget(text: '直推人数', textColor: '#999999', textSize: 12, number: '2258', numberColor: '#333333', numberSize: 30, icon: 'sss'),

/// 分割线
VerticalDivider(width: 40, thickness: 0.5, color: HexColor.fromHex('#F0F0F0')),

/// 间推人数
_getCustomWidget(text: '间推人数', textColor: '#999999', textSize: 12, number: '469', numberColor: '#333333', numberSize: 30, icon: 'sss'),
],
),

/// 分割线
Divider(thickness: 0.5, height: double.infinity, color: HexColor.fromHex('#F0F0F0')),

/// 全部粉丝 & 今日新增 & 昨日新增
Row(
children: <Widget>[
/// 全部粉丝
_getCustomWidget(
text: '全部粉丝',
textColor: '#999999',
textSize: 11,
number: '2258',
numberColor: '#333333',
numberSize: 15,
),

/// 分割线
VerticalDivider(thickness: 0.5, width: 35, color: HexColor.fromHex('#F0F0F0')),

/// 今日新增
_getCustomWidget(
text: '今日新增',
textColor: '#999999',
textSize: 11,
number: '4',
numberColor: '#333333',
numberSize: 15,
),

/// 分割线
VerticalDivider(thickness: 0.5, width: 35, color: HexColor.fromHex('#F0F0F0')),

/// 昨日新增
_getCustomWidget(
text: '昨日新增',
textColor: '#999999',
textSize: 11,
number: '12',
numberColor: '#333333',
numberSize: 15,
),
],
)
],
),
);
}

/// 自定义Widget
Widget _getCustomWidget({String text, String textColor, double textSize, String number, String numberColor, double numberSize, String icon}) {
return Column(
children: <Widget>[
/// Number
Row(
children: <Widget>[
/// nummber\
Text(number,
style: TextStyle(color: HexColor.fromHex(numberColor), fontSize: numberSize, fontWeight: FontWeight.bold, fontFamily: 'Din', package: 'zhiying_base_widget')),
const SizedBox(width: 3),

/// icon
Visibility(visible: !EmptyUtil.isEmpty(icon), child: Container(height: 7, width: 5, color: Colors.red))
],
),

/// Text
Text(text, style: TextStyle(color: HexColor.fromHex(textColor), fontSize: textSize))
],
);
}
}

+ 46
- 0
lib/widgets/team/fans/team_fans_item.dart View File

@@ -0,0 +1,46 @@
import 'package:flutter/material.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

///
/// 我的团队 - 粉丝信息
///
class TeamFansItem extends StatefulWidget {
@override
_TeamFansItemState createState() => _TeamFansItemState();
}

class _TeamFansItemState extends State<TeamFansItem> {
@override
Widget build(BuildContext context) {
return Container();
}

/// 主体视图
Widget _getMainWidget() {
return Container(
decoration: BoxDecoration(
color: HexColor.fromHex('#FFFFFF'),
borderRadius: BorderRadius.circular(10)
),
margin: const EdgeInsets.only(left: 12.5, right: 12.5),
padding: const EdgeInsets.only(left: 20, right: 20, top: 17.5, bottom: 15),
child: Column(
children: <Widget>[

],
),
);
}


/// 粉丝头像信息等
Widget _getFansInfoWidget() {

}

/// 数据信息
Widget _getDataWidget() {

}

}

+ 204
- 0
lib/widgets/team/recommend/team_recommend_widget.dart View File

@@ -0,0 +1,204 @@
import 'package:flutter/material.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

///
/// 我的团队 - 我的推荐人
///
class TeamRecommendWidget extends StatefulWidget {
final Map<String, dynamic> data;

const TeamRecommendWidget(this.data);

@override
_TeamRecommendWidgetState createState() => _TeamRecommendWidgetState();
}

class _TeamRecommendWidgetState extends State<TeamRecommendWidget> {
@override
Widget build(BuildContext context) {
return Container();
}

/// 按钮点击事件
void _onClickListener() {}

/// 主体Widget
Widget _getMainWidget() {
return Container(
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white),
child: Column(
children: <Widget>[
/// 左上角的Icon

/// 数据视图
],
),
);
}

/// 我的推荐人IconWidget(左上角的ICON)
Widget _getLeftTopWidget() {
return Container(width: 73.5, height: 23.5, color: Colors.red);
}

/// 输入框
Widget _getInputWidget() {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: HexColor.fromHex('#F7F7F7'),
),
child: Column(
children: <Widget>[
/// 输入框
Row(
children: <Widget>[
/// 输入框
Expanded(
child: TextField(
decoration: InputDecoration(
border: InputBorder.none,
focusedBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
errorBorder: InputBorder.none,
disabledBorder: InputBorder.none,
enabledBorder: InputBorder.none,
filled: true,
fillColor: Colors.transparent),
),
),
/// 按钮
_getAddButtomWidget(),
],
),

const SizedBox(height: 10.5),

/// 文字提示
Text('还没有填写邀请人ID,填写后双方都可以获得奖励', style: TextStyle(color: HexColor.fromHex('#909090'), fontSize: 11)),
],
),
);
}

/// 添加的按钮
Widget _getAddButtomWidget() {
return Material(
child: Container(
height: 24,
width: double.infinity,
color: Colors.white,
child: RaisedButton(
child: Text('添加', style: TextStyle(fontSize: 13)),
textColor: HexColor.fromHex('#FFFFFF'),
color: HexColor.fromHex('#F94B47'),
disabledColor: HexColor.fromHex('#F94B47'),
disabledTextColor: HexColor.fromHex('#FFFFFF'),
elevation: 5,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24 / 2)),
onPressed: () => _onClickListener(),
),
),
);
}

/// 数据视图
Widget _getDataWidget() {
return Row(
children: <Widget>[
/// 头像widget
_getAvatarWidget(),

const SizedBox(width: 12),

/// 数据
_getDataRightWidget(),
],
);
}

/// 头像widget
Widget _getAvatarWidget() {
return Container(
width: 55,
height: 55,
color: Colors.red,
);
}

/// 数据右边视图,头像右边的widget
Widget _getDataRightWidget() {
return Column(
children: <Widget>[
/// 昵称
_getNickNameWidget(),

/// 手机号
_getPhoneNumberWidget(),

/// 微信号
_getWXWidget()
],
);
}

/// 昵称
Widget _getNickNameWidget() {
return Row(
children: <Widget>[
/// 昵称
Text('毛毛虫', style: TextStyle(fontSize: 14, color: HexColor.fromHex('#000000'), fontWeight: FontWeight.bold)),
const SizedBox(width: 6),
Text('邀请码:', style: TextStyle(fontSize: 11, color: HexColor.fromHex('#909090'))),
Text('123456', style: TextStyle(fontSize: 11, color: HexColor.fromHex('#909090'))),
],
);
}

/// 手机号
Widget _getPhoneNumberWidget() {
return Row(
children: <Widget>[
Text('手机号:', style: TextStyle(fontSize: 11, color: HexColor.fromHex('#AFAFAF'))),
Text('12354678910', style: TextStyle(fontSize: 11, color: HexColor.fromHex('#AFAFAF'))),
const SizedBox(width: 6),

/// 拷贝按钮
_getCustomCopyWidget(),
],
);
}

/// 微信号
Widget _getWXWidget() {
return Row(
children: <Widget>[
Text('微信号:', style: TextStyle(fontSize: 11, color: HexColor.fromHex('#AFAFAF'))),
Text('12354678910', style: TextStyle(fontSize: 11, color: HexColor.fromHex('#AFAFAF'))),
const SizedBox(width: 6),

/// 拷贝按钮
_getCustomCopyWidget(),
],
);
}

/// 自定义复制按钮的Widget
Widget _getCustomCopyWidget() {
return Container(
padding: const EdgeInsets.only(left: 4, bottom: 2, top: 2, right: 6),
decoration: BoxDecoration(
color: HexColor.fromHex('#FFF2F2'),
borderRadius: BorderRadius.circular(30),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(width: 11, height: 11, color: Colors.red),
const SizedBox(width: 4.5),
Text('复制', style: TextStyle(fontSize: 8, color: HexColor.fromHex('#F94B47')))
],
),
);
}
}

+ 29
- 0
lib/widgets/team/temp/team_temp_widget.dart View File

@@ -0,0 +1,29 @@
import 'package:flutter/material.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

///
/// 我的团队 - 空数据视图
///
class TeamTempWidget extends StatefulWidget {
@override
_TeamTempWidgetState createState() => _TeamTempWidgetState();
}

class _TeamTempWidgetState extends State<TeamTempWidget> {
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: <Widget>[
/// 空数据图片
Container(width: 108, height: 116.5, color: Colors.red),

const SizedBox(height: 26),

/// 文字提示
Text('暂时木有好友呀~', style: TextStyle(color: HexColor.fromHex('#999999'), fontSize: 12))
],
),
);
}
}

+ 2
- 2
lib/widgets/wallet/wallet_detail/wallet_detail.dart View File

@@ -161,7 +161,7 @@ class _WalletDetailState extends State<WalletDetail>
margin: EdgeInsets.only(right: 8), margin: EdgeInsets.only(right: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: CachedNetworkImageProvider(item.leftBgImg),
image: CachedNetworkImageProvider(item?.leftBgImg ?? ''),
fit: BoxFit.fill)), fit: BoxFit.fill)),
child: Center(child: Text("ddd")), child: Center(child: Text("ddd")),
), ),
@@ -172,7 +172,7 @@ class _WalletDetailState extends State<WalletDetail>
margin: EdgeInsets.only(left: 8), margin: EdgeInsets.only(left: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: CachedNetworkImageProvider(item.rightBgImg))),
image: CachedNetworkImageProvider(item?.rightBgImg ?? ''))),
child: Center(child: Text("dddd")), child: Center(child: Text("dddd")),
)) ))
], ],


Loading…
Cancel
Save