Commit 11a4f46c authored by 林生雨's avatar 林生雨

commit

parent 44fc10b9
......@@ -125,7 +125,9 @@ class LevelOneState extends BaseState<LevelOnePage>
_model.init(() {
_initTabBar();
});
})));
},paddingTop: stateBarHeight+kToolbarHeight)
)
);
}
Widget newHomeWarp() {
......
......@@ -130,7 +130,9 @@ class LevelTwoState extends BaseState<LevelTwoPage>
_model.init(() {
_initTabBar();
});
})));
},
paddingTop: MediaQueryData.fromWindow(window).padding.top +
kToolbarHeight)));
}
Widget newHomeWarp() {
......
/*
* @author lsy
* @date 2020/7/8
**/
import 'package:flutter/cupertino.dart';
class PlanList extends StatefulWidget{
@override
State<StatefulWidget> createState() =>PlanListState();
}
class PlanListState extends State<PlanList>{
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
}
}
\ No newline at end of file
......@@ -40,10 +40,11 @@ class PlanModel extends BaseModel {
String min_price = "";
String max_price = "";
String rank_type = "";
int page = 1;
int sortPos = 0;
void init() {
void init({VoidCallback call}) {
ClueApiImpl.getInstance()
.getPlan(DioUtil.getInstance().getDio())
.listen((event) {
......@@ -52,6 +53,9 @@ class PlanModel extends BaseModel {
sortList = event.data.orders;
picLive.notifyView(event.data.ranks);
stateLive.notifyView(ENDLOADING);
if (call != null) {
call();
}
refreshFeed(true);
} else {
stateLive.notifyView(FAIL);
......@@ -77,6 +81,7 @@ class PlanModel extends BaseModel {
void refreshFeed(bool clear, {RefreshController controller}) {
if (clear) {
page = 1;
feedDatas.clear();
}
ClueApiImpl.getInstance()
......@@ -85,7 +90,11 @@ class PlanModel extends BaseModel {
.listen((event) {
if (event.error == 0) {
if (event.data.plans == null || event.data.plans.isEmpty) {
if(page==1){
feedsLive.notifyView(Pair(EMPTY, []));
}else{
feedsLive.notifyView(Pair(ENDLOADING, []));
}
} else {
feedDatas.addAll(event.data.plans);
feedsLive.notifyView(Pair(ENDLOADING, feedDatas));
......@@ -134,6 +143,7 @@ class PlanModel extends BaseModel {
}
sortPos = index;
order_by = sortList[index].id.toString();
feedsLive.notifyView(Pair(LOADING, null));
refreshFeed(true);
}
......@@ -143,6 +153,7 @@ class PlanModel extends BaseModel {
}
max_price = max.toString();
min_price = min.toString();
feedsLive.notifyView(Pair(LOADING, null));
refreshFeed(true);
}
}
This diff is collapsed.
......@@ -43,6 +43,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
@override
void initState() {
// DioUtil.getInstance().setProxy("172.30.8.245");
_model.rank_type = widget.rank_type;
init();
super.initState();
......@@ -94,7 +95,9 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
child: homeWarp()),
), () {
init();
}),
},
paddingTop:
MediaQueryData.fromWindow(window).padding.top + kToolbarHeight),
);
}
......
......@@ -57,7 +57,7 @@ class Data {
tags = new List<Tags>();
json['tags'].forEach((v) { tags.add(new Tags.fromJson(v)); });
}
areas = json['areas'] != null ? new Areas.fromJson(json['areas']) : null;
// areas = json['areas'] != null ? new Areas.fromJson(json['areas']) : null;
if (json['orders'] != null) {
orders = new List<Orders>();
json['orders'].forEach((v) { orders.add(new Orders.fromJson(v)); });
......
......@@ -6,7 +6,7 @@ class PlanFeedBean {
int error;
String message;
Map extra;
Map errorCode;
int errorCode;
Map errorExtra;
Data data;
UserType userType;
......@@ -101,8 +101,8 @@ class Plans {
positiveRate = json['positive_rate'];
salesCount = json['sales_count'];
baseAttrs = json['base_attrs'].cast<String>();
minPrice = json['min_price'];
maxPrice = 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'];
}
......
......@@ -59,18 +59,20 @@ class MainManager {
innerSetData(map, IS_WIFI);
innerSetData(map, HARDWARE_MODEL);
innerSetData(map, USER_ID);
// innerSetData(map, COOKIE);
innerSetData(map, USER_AGENT);
if (map[COOKIE] == null) {
CacheManager.getInstance().get(MEMORY_CACHE).save(COOKIE,
"_gm_token=1da6071594101423; csrftoken=rUrkkYYMOVZfIIQnU2IH09QIGmsfe8tE; sessionid=uz7f70uap76r6og48znci5l2hbr9vm5c; _gtid=5af9a5deba8511ea8d4082a085c393c93393");
}else{
innerSetData(map, COOKIE);
}
innerSetData(map, BASE_URL);
DioUtil.setDefOptions(
baseUrl: "${map[BASE_URL]}/",
cookie: map[COOKIE],
agent: map[USER_AGENT]);
if (map[COOKIE] == null) {
CacheManager.getInstance().get(MEMORY_CACHE).save(COOKIE,
"_gm_token=1da6071594101423; csrftoken=rUrkkYYMOVZfIIQnU2IH09QIGmsfe8tE; sessionid=uz7f70uap76r6og48znci5l2hbr9vm5c; _gtid=5af9a5deba8511ea8d4082a085c393c93393");
}
print(
"LSY QQWWEERRTTYY ${CacheManager.getInstance().get(MEMORY_CACHE).get(COOKIE)}");
DioUtil.getInstance().changeOpt();
......
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