Commit 9c0c815d authored by 朱翠翠's avatar 朱翠翠

Merge branch 'test' of http://git.wanmeizhensuo.com/linshengyu/gm_flutter into zcc/flutter

parents 386c886a d9cb642b
...@@ -173,7 +173,8 @@ class LevelOneItem extends StatelessWidget { ...@@ -173,7 +173,8 @@ class LevelOneItem extends StatelessWidget {
), ),
), ),
), ),
Positioned( allSize != null && position != null && position < allSize - 1
? Positioned(
left: 0, left: 0,
bottom: 0, bottom: 0,
child: Container( child: Container(
...@@ -182,6 +183,10 @@ class LevelOneItem extends StatelessWidget { ...@@ -182,6 +183,10 @@ class LevelOneItem extends StatelessWidget {
color: Color(0xffE5E5E5), color: Color(0xffE5E5E5),
), ),
) )
: Container(
width: 0,
height: 0,
)
], ],
), ),
), ),
...@@ -305,7 +310,8 @@ class LevelOneItem extends StatelessWidget { ...@@ -305,7 +310,8 @@ class LevelOneItem extends StatelessWidget {
// top: 47, // top: 47,
// child: FiveStarView(int.parse(cards.hospital.star), 5), // child: FiveStarView(int.parse(cards.hospital.star), 5),
// ), // ),
Positioned( allSize != null && position != null && position < allSize - 1
? Positioned(
left: 0, left: 0,
bottom: 0, bottom: 0,
child: Container( child: Container(
...@@ -314,6 +320,10 @@ class LevelOneItem extends StatelessWidget { ...@@ -314,6 +320,10 @@ class LevelOneItem extends StatelessWidget {
color: Color(0xffE5E5E5), color: Color(0xffE5E5E5),
), ),
) )
: Container(
width: 0,
height: 0,
)
], ],
), ),
)); ));
...@@ -634,11 +644,15 @@ class LevelOneItem extends StatelessWidget { ...@@ -634,11 +644,15 @@ class LevelOneItem extends StatelessWidget {
], ],
), ),
), ),
Container( allSize != null && position != null && position < allSize - 1
? Container(
width: double.maxFinite, width: double.maxFinite,
height: 0.5, height: 0.5,
color: Color(0xffE5E5E5), color: Color(0xffE5E5E5),
) )
: Container(
height: 0.5,
)
], ],
), ),
).gestureDetector(() { ).gestureDetector(() {
......
...@@ -134,7 +134,7 @@ class FilterViewState extends State<FilterView> { ...@@ -134,7 +134,7 @@ class FilterViewState extends State<FilterView> {
), ),
Expanded( Expanded(
child: Container( child: Container(
color: Color(0xff3FB5AF), color: Color(0xff51CDC7),
alignment: Alignment.center, alignment: Alignment.center,
child: baseText("确定", 16, Colors.white), child: baseText("确定", 16, Colors.white),
).gestureDetector(() { ).gestureDetector(() {
......
...@@ -60,10 +60,21 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -60,10 +60,21 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
PlanBarView planBarView; PlanBarView planBarView;
double stateBarHeight; double stateBarHeight;
double topHeight; double topHeight;
Function(String str) func;
@override @override
void initState() { void initState() {
if (RouterCenterImpl().findMainRouter().isWithNative() &&
CacheManager.getInstance().get(MEMORY_CACHE).get(BASE_URL).empty()) {
func = (str) {
if (str == "init") {
_model.init(needCache: true); _model.init(needCache: true);
}
};
SimpleEventBus.instance().resignEvent("clueModel|Plan|PlanPage", func);
} else {
_model.init(needCache: true);
}
super.initState(); super.initState();
planBarView = planBarView =
PlanBarView(_model.managerLive, clickIndex, hideAllMenuListener); PlanBarView(_model.managerLive, clickIndex, hideAllMenuListener);
...@@ -71,6 +82,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -71,6 +82,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
@override @override
void dispose() { void dispose() {
SimpleEventBus.instance().unResignEvent("clueModel|Plan|PlanPage", func);
hideAllMenuListener.dispose(); hideAllMenuListener.dispose();
projectMenuListener.dispose(); projectMenuListener.dispose();
sortMenuListener.dispose(); sortMenuListener.dispose();
...@@ -84,24 +96,15 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -84,24 +96,15 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
@override @override
Widget buildItem(BuildContext context) { Widget buildItem(BuildContext context) {
stateBarHeight = MediaQueryData stateBarHeight = MediaQueryData.fromWindow(window).padding.top;
.fromWindow(window)
.padding
.top;
topHeight = stateBarHeight + kToolbarHeight; topHeight = stateBarHeight + kToolbarHeight;
return Scaffold( return Scaffold(
body: MediaQuery.removePadding( body: MediaQuery.removePadding(
removeTop: true, removeTop: true,
context: context, context: context,
child: baseStateView( child: baseStateView(
MediaQuery MediaQuery.of(context).size.width,
.of(context) MediaQuery.of(context).size.height,
.size
.width,
MediaQuery
.of(context)
.size
.height,
_model.stateLive, _model.stateLive,
newHome(), () { newHome(), () {
_model.stateLive.notifyView(LOADING); _model.stateLive.notifyView(LOADING);
...@@ -113,26 +116,14 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -113,26 +116,14 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
Widget newHome() { Widget newHome() {
double diff = Platform.isAndroid ? 50.0 : 0.0; double diff = Platform.isAndroid ? 50.0 : 0.0;
return Container( return Container(
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context)
.size
.width,
//主页 剪去tabbar高度 //主页 剪去tabbar高度
height: MediaQuery height: MediaQuery.of(context).size.height - diff,
.of(context)
.size
.height -diff,
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
Container( Container(
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context) height: MediaQuery.of(context).size.height - diff,
.size
.width,
height: MediaQuery
.of(context)
.size
.height - diff,
// child: child(), // child: child(),
child: homeWarp(), child: homeWarp(),
), ),
...@@ -146,14 +137,8 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -146,14 +137,8 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
child: Visibility( child: Visibility(
visible: data.data[2] > 0.1, visible: data.data[2] > 0.1,
child: Container( child: Container(
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context) height: MediaQuery.of(context).size.height,
.size
.width,
height: MediaQuery
.of(context)
.size
.height,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
...@@ -204,10 +189,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -204,10 +189,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
return BasePopMenu( return BasePopMenu(
leftPos: data.data[0], leftPos: data.data[0],
topPos: data.data[1], topPos: data.data[1],
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context)
.size
.width,
maxHeight: 450, maxHeight: 450,
listener: projectMenuListener, listener: projectMenuListener,
child: child:
...@@ -228,10 +210,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -228,10 +210,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
return BasePopMenu( return BasePopMenu(
leftPos: data.data[0], leftPos: data.data[0],
topPos: data.data[1], topPos: data.data[1],
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context)
.size
.width,
maxHeight: 45 * _model.sortList.length, maxHeight: 45 * _model.sortList.length,
listener: sortMenuListener, listener: sortMenuListener,
child: SortView(_model.sortList, _model.sortPos, (index) { child: SortView(_model.sortList, _model.sortPos, (index) {
...@@ -251,10 +230,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -251,10 +230,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
return BasePopMenu( return BasePopMenu(
leftPos: data.data[0], leftPos: data.data[0],
topPos: data.data[1], topPos: data.data[1],
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context)
.size
.width,
maxHeight: 186, maxHeight: 186,
listener: filterMenuListener, listener: filterMenuListener,
child: FilterView( child: FilterView(
...@@ -398,14 +374,8 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -398,14 +374,8 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
initialData: _model.feedsLive.data ?? Pair(LOADING, null), initialData: _model.feedsLive.data ?? Pair(LOADING, null),
builder: (c, data) { builder: (c, data) {
if (data.data.first == FAIL) { if (data.data.first == FAIL) {
return errorItem(MediaQuery return errorItem(MediaQuery.of(context).size.width,
.of(context) MediaQuery.of(context).size.height, () {
.size
.width,
MediaQuery
.of(context)
.size
.height, () {
_model.feedsLive.notifyView(Pair(LOADING, null)); _model.feedsLive.notifyView(Pair(LOADING, null));
_model.refreshFeed(true); _model.refreshFeed(true);
}); });
...@@ -413,26 +383,14 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -413,26 +383,14 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
if (data.data.first == LOADING) { if (data.data.first == LOADING) {
return Container( return Container(
color: Colors.white, color: Colors.white,
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context) height: MediaQuery.of(context).size.height,
.size
.width,
height: MediaQuery
.of(context)
.size
.height,
child: loadingItem(), child: loadingItem(),
); );
} }
if (data.data.first == EMPTY) { if (data.data.first == EMPTY) {
return emptyItem(MediaQuery return emptyItem(MediaQuery.of(context).size.width,
.of(context) MediaQuery.of(context).size.height);
.size
.width,
MediaQuery
.of(context)
.size
.height);
} }
return Container( return Container(
color: Color(0xffF7F6FA), color: Color(0xffF7F6FA),
...@@ -486,8 +444,10 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -486,8 +444,10 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
margin: EdgeInsets.only(left: 15, right: 15, top: 0, bottom: 0), margin: EdgeInsets.only(left: 15, right: 15, top: 0, bottom: 0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( // Expanded(
child: Container( // child:
AspectRatio(
aspectRatio: 335/180,
child: StreamBuilder<List<Ranks>>( child: StreamBuilder<List<Ranks>>(
stream: _model.picLive.stream, stream: _model.picLive.stream,
initialData: _model.picLive.data ?? null, initialData: _model.picLive.data ?? null,
...@@ -514,12 +474,17 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -514,12 +474,17 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
}, },
), ),
), ),
), // ),
Container(
width: 10,
),
Expanded( Expanded(
child: Container( child: Container(),
),
// Container(
// width: 10,
// ),
// Expanded(
// child:
AspectRatio(
aspectRatio: 335/180,
child: StreamBuilder<List<Ranks>>( child: StreamBuilder<List<Ranks>>(
stream: _model.picLive.stream, stream: _model.picLive.stream,
initialData: _model.picLive.data ?? null, initialData: _model.picLive.data ?? null,
...@@ -545,7 +510,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin { ...@@ -545,7 +510,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
}); });
}, },
), ),
), // ),
) )
], ],
), ),
......
...@@ -81,9 +81,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin { ...@@ -81,9 +81,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
@override @override
Widget buildItem(BuildContext context) { Widget buildItem(BuildContext context) {
return Scaffold( return Scaffold(
body: SafeArea( body: baseStateView(
top: false,
child: baseStateView(
MediaQuery.of(context).size.width, MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height, MediaQuery.of(context).size.height,
_model.stateLive, _model.stateLive,
...@@ -104,7 +102,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin { ...@@ -104,7 +102,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
}, },
paddingTop: paddingTop:
MediaQueryData.fromWindow(window).padding.top + kToolbarHeight), MediaQueryData.fromWindow(window).padding.top + kToolbarHeight),
)); );
} }
Widget homeWarp() { Widget homeWarp() {
......
...@@ -12,6 +12,7 @@ import 'package:flutter_common/commonModel/toast/toast.dart'; ...@@ -12,6 +12,7 @@ import 'package:flutter_common/commonModel/toast/toast.dart';
import 'package:gm_flutter/commonModel/GMBase.dart'; import 'package:gm_flutter/commonModel/GMBase.dart';
import 'package:gm_flutter/commonModel/base/BaseUtil.dart'; import 'package:gm_flutter/commonModel/base/BaseUtil.dart';
import 'package:gm_flutter/commonModel/cache/CacheManager.dart'; import 'package:gm_flutter/commonModel/cache/CacheManager.dart';
import 'package:gm_flutter/commonModel/eventbus/SimpleEventBus.dart';
import 'package:gm_flutter/commonModel/util/DartUtil.dart'; import 'package:gm_flutter/commonModel/util/DartUtil.dart';
import '../../commonModel/App.dart'; import '../../commonModel/App.dart';
...@@ -72,7 +73,15 @@ class MainManager { ...@@ -72,7 +73,15 @@ class MainManager {
innerSetData(map, USER_ID); innerSetData(map, USER_ID);
innerSetData(map, USER_AGENT); innerSetData(map, USER_AGENT);
// innerSetData(map, BASE_URL); innerSetData(map, BASE_URL);
if (map[BASE_URL] != null) {
DioUtil.getInstance();
DioUtil.setDefOptions(
baseUrl: "${map[BASE_URL]}/", agent: map[USER_AGENT]);
DioUtil.getInstance().changeOpt();
}
SimpleEventBus.instance().notifyListener("clueModel|Plan|PlanPage", "init");
// if (map[COOKIE] == null) { // if (map[COOKIE] == null) {
// CacheManager.getInstance().get(MEMORY_CACHE).save(COOKIE, // CacheManager.getInstance().get(MEMORY_CACHE).save(COOKIE,
// "_gm_token=1da6071594101423; csrftoken=rUrkkYYMOVZfIIQnU2IH09QIGmsfe8tE; sessionid=uz7f70uap76r6og48znci5l2hbr9vm5c; _gtid=5af9a5deba8511ea8d4082a085c393c93393"); // "_gm_token=1da6071594101423; csrftoken=rUrkkYYMOVZfIIQnU2IH09QIGmsfe8tE; sessionid=uz7f70uap76r6og48znci5l2hbr9vm5c; _gtid=5af9a5deba8511ea8d4082a085c393c93393");
...@@ -88,11 +97,7 @@ class MainManager { ...@@ -88,11 +97,7 @@ class MainManager {
print( print(
"LSY QQWWEERRTTYY ${CacheManager.getInstance().get(MEMORY_CACHE).get(COOKIE)}" "LSY QQWWEERRTTYY ${CacheManager.getInstance().get(MEMORY_CACHE).get(COOKIE)}"
" ${CacheManager.getInstance().get(MEMORY_CACHE).get(COOKIE) is String}"); " ${CacheManager.getInstance().get(MEMORY_CACHE).get(COOKIE) is String}");
if (map[BASE_URL] != null) {
DioUtil.setDefOptions(
baseUrl: "${map[BASE_URL]}/", agent: map[USER_AGENT]);
DioUtil.getInstance().changeOpt();
}
// SimpleEventBus.instance().notifyListener("PlanPage!initState", ""); // SimpleEventBus.instance().notifyListener("PlanPage!initState", "");
} }
......
...@@ -53,7 +53,7 @@ class DioUtil { ...@@ -53,7 +53,7 @@ class DioUtil {
(_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate =
(client) { (client) {
client.findProxy = (url) { client.findProxy = (url) {
return 'PROXY $proxy:${port??8888}'; return 'PROXY $proxy:${port ?? 8888}';
}; };
}; };
} }
...@@ -62,7 +62,7 @@ class DioUtil { ...@@ -62,7 +62,7 @@ class DioUtil {
return _dio; return _dio;
} }
static void setDefOptions({String baseUrl, String cookie, String agent}) { static void setDefOptions({String baseUrl, String agent}) {
_options.connectTimeout = 10 * 1000; _options.connectTimeout = 10 * 1000;
_options.receiveTimeout = 20 * 1000; _options.receiveTimeout = 20 * 1000;
_options.responseType = ResponseType.plain; _options.responseType = ResponseType.plain;
...@@ -71,10 +71,8 @@ class DioUtil { ...@@ -71,10 +71,8 @@ class DioUtil {
if (agent != null) { if (agent != null) {
headers['User-Agent'] = agent; headers['User-Agent'] = agent;
} }
if (cookie != null) {
headers[HttpHeaders.cookieHeader] = cookie;
}
_options.headers = headers; _options.headers = headers;
_options.baseUrl = baseUrl ?? Api.getInstance().getBaseUrl() + "/"; print("ISEMPTY ?? ${baseUrl}");
_options.baseUrl = baseUrl ?? "${Api.getInstance().getBaseUrl()}/";
} }
} }
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