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

commit

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