Commit e0dd6c79 authored by 林生雨's avatar 林生雨

commit

parent 5674523a
...@@ -63,7 +63,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -63,7 +63,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
@override @override
void initState() { void initState() {
print("LSY PLAN INIT"); print("LSY PLAN INIT");
// DioUtil.getInstance().setProxy("172.30.9.128"); DioUtil.getInstance().setProxy("172.30.9.128");
_model.init(needCache: true); _model.init(needCache: true);
super.initState(); super.initState();
planBarView = planBarView =
...@@ -429,7 +429,10 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -429,7 +429,10 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
data.data == null ? "" : data.data[0].icon ?? "", data.data == null ? "" : data.data[0].icon ?? "",
fit: BoxFit.cover, fit: BoxFit.cover,
)).gestureDetector(() { )).gestureDetector(() {
Map<String, dynamic> map = {"rank_type": "0"}; Map<String, dynamic> map = {
"rank_type": "0",
"id": "${data.data[1].id}"
};
RouterCenterImpl() RouterCenterImpl()
.findMainRouter() .findMainRouter()
.jumpPage(context, "favor_plan", map, false); .jumpPage(context, "favor_plan", map, false);
...@@ -454,7 +457,10 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -454,7 +457,10 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
data.data == null ? "" : data.data[1].icon ?? "", data.data == null ? "" : data.data[1].icon ?? "",
fit: BoxFit.cover, fit: BoxFit.cover,
)).gestureDetector(() { )).gestureDetector(() {
Map<String, dynamic> map = {"rank_type": "1"}; Map<String, dynamic> map = {
"rank_type": "1",
"id": "${data.data[1].id}"
};
RouterCenterImpl() RouterCenterImpl()
.findMainRouter() .findMainRouter()
.jumpPage(context, "hot_plan", map, false); .jumpPage(context, "hot_plan", map, false);
......
...@@ -15,8 +15,9 @@ import 'TopListModel.dart'; ...@@ -15,8 +15,9 @@ import 'TopListModel.dart';
class TopList extends StatefulWidget { class TopList extends StatefulWidget {
final int id; final int id;
double topHeight; double topHeight;
final String rankId;
TopList(this.id, this.topHeight); TopList(this.rankId, this.id, this.topHeight);
@override @override
State<StatefulWidget> createState() => TopListState(); State<StatefulWidget> createState() => TopListState();
...@@ -31,6 +32,7 @@ class TopListState extends State<TopList> with AutomaticKeepAliveClientMixin { ...@@ -31,6 +32,7 @@ class TopListState extends State<TopList> with AutomaticKeepAliveClientMixin {
void initState() { void initState() {
super.initState(); super.initState();
_model.tagId = "${widget.id}"; _model.tagId = "${widget.id}";
_model.rankId = widget.rankId;
_model.getData(true); _model.getData(true);
refresh = (str) { refresh = (str) {
_model.stateLive.notifyView(LOADING); _model.stateLive.notifyView(LOADING);
......
...@@ -15,6 +15,7 @@ import 'package:gm_flutter/commonModel/util/PrintUtil.dart'; ...@@ -15,6 +15,7 @@ import 'package:gm_flutter/commonModel/util/PrintUtil.dart';
class TopListModel extends BaseModel { class TopListModel extends BaseModel {
LiveData<int> stateLive = LiveData(); LiveData<int> stateLive = LiveData();
String tagId; String tagId;
String rankId = "";
int page = 1; int page = 1;
RxDispose rxDispose = RxDispose(); RxDispose rxDispose = RxDispose();
LiveData<List<Plans>> datasLive = LiveData(); LiveData<List<Plans>> datasLive = LiveData();
...@@ -33,7 +34,7 @@ class TopListModel extends BaseModel { ...@@ -33,7 +34,7 @@ class TopListModel extends BaseModel {
} }
ClueApiImpl.getInstance() ClueApiImpl.getInstance()
.getPlanFeed( .getPlanFeed(
DioUtil.getInstance().getDio(), tagId, "", "", "", "", "", page) DioUtil.getInstance().getDio(), tagId, "", "", "", "", rankId, page)
.listen((event) { .listen((event) {
if (event.error == 0) { if (event.error == 0) {
if (event.data.plans == null || event.data.plans.isEmpty) { if (event.data.plans == null || event.data.plans.isEmpty) {
......
...@@ -25,10 +25,12 @@ import 'TopList.dart'; ...@@ -25,10 +25,12 @@ import 'TopList.dart';
class TopPage extends StatefulWidget { class TopPage extends StatefulWidget {
String rank_type; String rank_type;
String id;
TopPage(Map<String, dynamic> map) { TopPage(Map<String, dynamic> map) {
print("LSY ${map.toString()}"); print("LSY ${map.toString()}");
this.rank_type = map["rank_type"]; this.rank_type = map["rank_type"];
this.id = map["id"];
} }
@override @override
...@@ -149,7 +151,8 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin { ...@@ -149,7 +151,8 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
var d = MediaQueryData.fromWindow(window).padding.top; var d = MediaQueryData.fromWindow(window).padding.top;
for (int i = 0; i < _model.tabs.length; i++) { for (int i = 0; i < _model.tabs.length; i++) {
list.add(extend.NestedScrollViewInnerScrollPositionKeyWidget( list.add(extend.NestedScrollViewInnerScrollPositionKeyWidget(
Key("Tab${i}"), TopList(_model.tabs[i].id, kToolbarHeight + d))); Key("Tab${i}"),
TopList(widget.id, _model.tabs[i].id, kToolbarHeight + d)));
} }
return extend.NestedScrollView( return extend.NestedScrollView(
innerScrollPositionKeyBuilder: () { innerScrollPositionKeyBuilder: () {
...@@ -161,8 +164,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin { ...@@ -161,8 +164,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
SliverOverlapAbsorber( SliverOverlapAbsorber(
handle: extend.NestedScrollView.sliverOverlapAbsorberHandleFor( handle: extend.NestedScrollView.sliverOverlapAbsorberHandleFor(
context), context),
sliver: baseSliverAppBar(_model.imageUrl sliver: baseSliverAppBar(_model.imageUrl, height: 175)),
,height: 175)),
SliverPersistentHeader( SliverPersistentHeader(
pinned: true, pinned: true,
delegate: StickyTabBarDelegate( delegate: StickyTabBarDelegate(
......
...@@ -10,6 +10,9 @@ class PlanBean { ...@@ -10,6 +10,9 @@ class PlanBean {
Map errorExtra; Map errorExtra;
Data data; Data data;
UserType userType; UserType userType;
String firstName;
String secondName;
int sortPos;
PlanBean({this.error, this.message, this.extra, this.errorCode, this.errorExtra, this.data, this.userType}); PlanBean({this.error, this.message, this.extra, this.errorCode, this.errorExtra, this.data, this.userType});
...@@ -19,6 +22,9 @@ class PlanBean { ...@@ -19,6 +22,9 @@ class PlanBean {
extra = json['extra']; extra = json['extra'];
errorCode = json['error_code']; errorCode = json['error_code'];
errorExtra = json['error_extra']; errorExtra = json['error_extra'];
firstName = json['firstName'];
secondName = json['secondName'];
sortPos = json['sortPos'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null; data = json['data'] != null ? new Data.fromJson(json['data']) : null;
userType = json['user_type'] != null ? new UserType.fromJson(json['user_type']) : null; userType = json['user_type'] != null ? new UserType.fromJson(json['user_type']) : null;
} }
...@@ -28,8 +34,11 @@ class PlanBean { ...@@ -28,8 +34,11 @@ class PlanBean {
data['error'] = this.error; data['error'] = this.error;
data['message'] = this.message; data['message'] = this.message;
data['extra'] = this.extra; data['extra'] = this.extra;
data['sortPos'] = this.sortPos;
data['error_code'] = this.errorCode; data['error_code'] = this.errorCode;
data['error_extra'] = this.errorExtra; data['error_extra'] = this.errorExtra;
data['firstName'] = this.firstName;
data['secondName'] = this.secondName;
if (this.data != null) { if (this.data != null) {
data['data'] = this.data.toJson(); data['data'] = this.data.toJson();
} }
......
...@@ -11,6 +11,12 @@ class PlanFeedBean { ...@@ -11,6 +11,12 @@ class PlanFeedBean {
Data data; Data data;
UserType userType; UserType userType;
String tag_id;
String order_by;
String min_price;
String max_price;
int page;
PlanFeedBean( PlanFeedBean(
{this.error, {this.error,
this.message, this.message,
...@@ -24,6 +30,13 @@ class PlanFeedBean { ...@@ -24,6 +30,13 @@ class PlanFeedBean {
error = json['error']; error = json['error'];
message = json['message']; message = json['message'];
extra = json['extra']; extra = json['extra'];
tag_id = json['tag_id'];
order_by = json['order_by'];
min_price = json['min_price'];
max_price = json['max_price'];
page = json['page'];
errorCode = json['error_code']; errorCode = json['error_code'];
errorExtra = json['error_extra']; errorExtra = json['error_extra'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null; data = json['data'] != null ? new Data.fromJson(json['data']) : null;
...@@ -37,6 +50,13 @@ class PlanFeedBean { ...@@ -37,6 +50,13 @@ class PlanFeedBean {
data['error'] = this.error; data['error'] = this.error;
data['message'] = this.message; data['message'] = this.message;
data['extra'] = this.extra; data['extra'] = this.extra;
data['tag_id'] = this.tag_id;
data['order_by'] = this.order_by;
data['min_price'] = this.min_price;
data['max_price'] = this.max_price;
data['page'] = this.page;
data['error_code'] = this.errorCode; data['error_code'] = this.errorCode;
data['error_extra'] = this.errorExtra; data['error_extra'] = this.errorExtra;
if (this.data != null) { if (this.data != null) {
...@@ -101,8 +121,10 @@ class Plans { ...@@ -101,8 +121,10 @@ class Plans {
positiveRate = json['positive_rate']; positiveRate = json['positive_rate'];
salesCount = json['sales_count']; salesCount = json['sales_count'];
baseAttrs = json['base_attrs'].cast<String>(); baseAttrs = json['base_attrs'].cast<String>();
minPrice = json['min_price'] is int? "${json['min_price']}":json['min_price']; minPrice =
maxPrice = json['max_price'] is int? "${json['max_price']}":json['max_price']; json['min_price'] is int ? "${json['min_price']}" : json['min_price'];
maxPrice =
json['max_price'] is int ? "${json['max_price']}" : json['max_price'];
projectImage = json['project_image']; projectImage = json['project_image'];
} }
......
...@@ -89,7 +89,7 @@ class BaseNestedScrollViewRefreshIndicator extends StatefulWidget { ...@@ -89,7 +89,7 @@ class BaseNestedScrollViewRefreshIndicator extends StatefulWidget {
const BaseNestedScrollViewRefreshIndicator({ const BaseNestedScrollViewRefreshIndicator({
Key key, Key key,
@required this.child, @required this.child,
this.displacement = 55.0, this.displacement = 10.0,
@required this.onRefresh, @required this.onRefresh,
this.color, this.color,
this.backgroundColor, this.backgroundColor,
...@@ -161,7 +161,7 @@ class NestedScrollViewRefreshIndicatorState ...@@ -161,7 +161,7 @@ class NestedScrollViewRefreshIndicatorState
Future<void> _pendingRefreshFuture; Future<void> _pendingRefreshFuture;
bool _isIndicatorAtTop=false; bool _isIndicatorAtTop=false;
double _dragOffset=0.0; double _dragOffset=0.0;
_RefreshIndicatorMode _mode=_RefreshIndicatorMode.done; _RefreshIndicatorMode _mode=_RefreshIndicatorMode.drag;
static final Animatable<double> _threeQuarterTween = static final Animatable<double> _threeQuarterTween =
...@@ -451,9 +451,11 @@ class NestedScrollViewRefreshIndicatorState ...@@ -451,9 +451,11 @@ class NestedScrollViewRefreshIndicatorState
final bool showIndeterminateIndicator = final bool showIndeterminateIndicator =
_mode == _RefreshIndicatorMode.refresh || _mode == _RefreshIndicatorMode.refresh ||
_mode == _RefreshIndicatorMode.done; _mode == _RefreshIndicatorMode.done;
return Column( return
Column(
children: <Widget>[ children: <Widget>[
Container( Container(
color: Color(0xffF7F6FA),
child: SizeTransition( child: SizeTransition(
axisAlignment: _isIndicatorAtTop ? 1.0 : -1.0, axisAlignment: _isIndicatorAtTop ? 1.0 : -1.0,
sizeFactor: _positionFactor, // this is what brings it down sizeFactor: _positionFactor, // this is what brings it down
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment