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

w

parent 101f8906
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
**/ **/
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_common/commonModel/picker/base/BaseBottomPicker.dart';
import 'package:gm_flutter/ClueModel/page/DiscussLowPrice/DiscussLowPricePopView.dart'; import 'package:gm_flutter/ClueModel/page/DiscussLowPrice/DiscussLowPricePopView.dart';
import 'package:gm_flutter/ClueModel/page/levelOne/LevelOneListModel.dart'; import 'package:gm_flutter/ClueModel/page/levelOne/LevelOneListModel.dart';
import 'package:gm_flutter/ClueModel/page/mechanismBox/MechanismBoxPage.dart';
import 'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart'; import 'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart';
import 'package:gm_flutter/commonModel/App.dart'; import 'package:gm_flutter/commonModel/App.dart';
import 'package:gm_flutter/commonModel/base/BaseComponent.dart'; import 'package:gm_flutter/commonModel/base/BaseComponent.dart';
...@@ -99,7 +101,13 @@ class LevelOneListState extends State<LevelOneList> ...@@ -99,7 +101,13 @@ class LevelOneListState extends State<LevelOneList>
return LevelOneItem( return LevelOneItem(
_model.data[index], _model.data[index],
lowPrice: () { lowPrice: () {
if (CacheManager.getInstance().get(USER_ID) == null) { if (CacheManager.getInstance()
.get(MEMORY_CACHE)
.get(COOKIE) ==
null &&
RouterCenterImpl()
.findMainRouter()
.isWithNative()) {
RouterCenterImpl() RouterCenterImpl()
.findMainRouter() .findMainRouter()
.jumpPage(context, "show_login", null, true); .jumpPage(context, "show_login", null, true);
...@@ -116,6 +124,20 @@ class LevelOneListState extends State<LevelOneList> ...@@ -116,6 +124,20 @@ class LevelOneListState extends State<LevelOneList>
? _model.data[index].doctor.doctor_id ? _model.data[index].doctor.doctor_id
: ""); : "");
}, },
ask: () {
var data2 = _model.data[index];
if (data2.cardType == "doctor") {
RouterCenterImpl().findMainRouter().jumpPage(
context, data2.doctor.messageUrl, null, true);
} else if (data2.cardType == "hospital") {
RouterCenterImpl().findMainRouter().jumpPage(
context, data2.hospital.messageUrl, null, true);
} else if (data2.cardType == "plan") {
BaseBottomPicker()
..setPicker(MechanismBox(data2.plan.plan_id))
..show(context);
}
},
compare: () { compare: () {
RouterCenterImpl().findMainRouter().jumpPage( RouterCenterImpl().findMainRouter().jumpPage(
context, context,
......
...@@ -513,7 +513,8 @@ class LevelOneState extends BaseState<LevelOnePage> ...@@ -513,7 +513,8 @@ class LevelOneState extends BaseState<LevelOnePage>
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
if (CacheManager.getInstance().get(USER_ID) == null) { if (CacheManager.getInstance().get(MEMORY_CACHE).get(COOKIE) == null &&
RouterCenterImpl().findMainRouter().isWithNative()) {
RouterCenterImpl() RouterCenterImpl()
.findMainRouter() .findMainRouter()
.jumpPage(context, "show_login", null, true); .jumpPage(context, "show_login", null, true);
...@@ -536,7 +537,8 @@ class LevelOneState extends BaseState<LevelOnePage> ...@@ -536,7 +537,8 @@ class LevelOneState extends BaseState<LevelOnePage>
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
if (CacheManager.getInstance().get(USER_ID) == null) { if (CacheManager.getInstance().get(MEMORY_CACHE).get(COOKIE) == null &&
RouterCenterImpl().findMainRouter().isWithNative()) {
RouterCenterImpl() RouterCenterImpl()
.findMainRouter() .findMainRouter()
.jumpPage(context, "show_login", null, true); .jumpPage(context, "show_login", null, true);
...@@ -550,8 +552,8 @@ class LevelOneState extends BaseState<LevelOnePage> ...@@ -550,8 +552,8 @@ class LevelOneState extends BaseState<LevelOnePage>
RouterCenterImpl() RouterCenterImpl()
.findMainRouter() .findMainRouter()
.buriedEvent("popup_view", map); .buriedEvent("popup_view", map);
DiscussLowPricePopView.showPopView(context, DiscussLowPricePopView.showPopView(
widget.PAGE_NAME, "${widget.planId}", "", ""); context, widget.PAGE_NAME, "${widget.planId}", "", "");
}, },
child: Container( child: Container(
margin: EdgeInsets.only(left: 15), margin: EdgeInsets.only(left: 15),
......
...@@ -301,7 +301,8 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -301,7 +301,8 @@ class LevelTwoState extends BaseState<LevelTwoPage>
style: TextStyle( style: TextStyle(
color: Color(0xff999999), fontSize: 12)), color: Color(0xff999999), fontSize: 12)),
Expanded( Expanded(
child: baseText('¥' + _model.planoverItem.guidePrice,12,Color(0xffFF5963)), child: baseText('¥' + _model.planoverItem.guidePrice,
12, Color(0xffFF5963)),
) )
], ],
) )
...@@ -482,7 +483,8 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -482,7 +483,8 @@ class LevelTwoState extends BaseState<LevelTwoPage>
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
if (CacheManager.getInstance().get(USER_ID) == null) { if (CacheManager.getInstance().get(MEMORY_CACHE).get(COOKIE) == null &&
RouterCenterImpl().findMainRouter().isWithNative()) {
RouterCenterImpl() RouterCenterImpl()
.findMainRouter() .findMainRouter()
.jumpPage(context, "show_login", null, true); .jumpPage(context, "show_login", null, true);
......
...@@ -14,8 +14,6 @@ class FilterView extends StatelessWidget { ...@@ -14,8 +14,6 @@ class FilterView extends StatelessWidget {
FilterView(this.call); FilterView(this.call);
int min = 0;
int max = 0;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -31,9 +29,10 @@ class FilterView extends StatelessWidget { ...@@ -31,9 +29,10 @@ class FilterView extends StatelessWidget {
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
child: PlanProgressBar( child: PlanProgressBar(
0, 0,
5, 5000,
0, 0,
10000, 20010,
call,
padding: 15, padding: 15,
), ),
), ),
...@@ -75,7 +74,7 @@ class FilterView extends StatelessWidget { ...@@ -75,7 +74,7 @@ class FilterView extends StatelessWidget {
alignment: Alignment.center, alignment: Alignment.center,
child: baseText("确定", 16, Colors.white), child: baseText("确定", 16, Colors.white),
).gestureDetector(() { ).gestureDetector(() {
call(max, min); SimpleEventBus.instance().notifyListener("PlanProgressBarState", "sure");
}), }),
) )
], ],
......
...@@ -180,9 +180,12 @@ class PlanModel extends BaseModel { ...@@ -180,9 +180,12 @@ class PlanModel extends BaseModel {
} }
void filterClick(int max, int min) { void filterClick(int max, int min) {
if (max_price == max.toString() && min_price == min.toString()) { if (max_price == "${max}" && min_price == "${min}") {
return; return;
} }
if (max > 20000) {
max = 20000000;
}
max_price = "${max}"; max_price = "${max}";
min_price = "${min}"; min_price = "${min}";
feedsLive.notifyView(Pair(LOADING, null)); feedsLive.notifyView(Pair(LOADING, null));
......
...@@ -13,8 +13,9 @@ class PlanProgressBar extends StatefulWidget { ...@@ -13,8 +13,9 @@ class PlanProgressBar extends StatefulWidget {
int maxlow; int maxlow;
int maxHigh; int maxHigh;
int padding; int padding;
final Function(int high, int low) call;
PlanProgressBar(this.low, this.high, this.maxlow, this.maxHigh, PlanProgressBar(this.low, this.high, this.maxlow, this.maxHigh, this.call,
{this.padding}); {this.padding});
@override @override
...@@ -37,14 +38,23 @@ class PlanProgressBarState extends State<PlanProgressBar> { ...@@ -37,14 +38,23 @@ class PlanProgressBarState extends State<PlanProgressBar> {
bool isLeftMove = true; bool isLeftMove = true;
Function(String str) func; Function(String str) func;
int low;
int high;
@override @override
void initState() { void initState() {
low = widget.low;
high = widget.high;
super.initState(); super.initState();
distance = widget.maxHigh - widget.maxlow - 0.0; distance = widget.maxHigh - widget.maxlow - 0.0;
init(); init();
func = (str) { func = (str) {
init(); if (str == "sure") {
setState(() {}); widget.call(high, low);
} else {
init();
setState(() {});
}
}; };
SimpleEventBus.instance().resignEvent("PlanProgressBarState", func); SimpleEventBus.instance().resignEvent("PlanProgressBarState", func);
} }
...@@ -71,11 +81,23 @@ class PlanProgressBarState extends State<PlanProgressBar> { ...@@ -71,11 +81,23 @@ class PlanProgressBarState extends State<PlanProgressBar> {
(isLeftMove ? leftPosTempPercent : rightPosTempPercent + 0.03) * (isLeftMove ? leftPosTempPercent : rightPosTempPercent + 0.03) *
distance) distance)
.toInt(); .toInt();
if (isLeftMove) {
low = textInt;
} else {
high = textInt;
}
String textStr = "¥${textInt}"; String textStr = "¥${textInt}";
if (textInt > 20000) {
textStr = "无限";
}
double textWidth = textStr.length * 12.0; double textWidth = textStr.length * 12.0;
if (textStr == "无限") {
textWidth = textStr.length * 14.0;
}
double textL = textLeft * totle - textWidth / 2 + 9; double textL = textLeft * totle - textWidth / 2 + 9;
// if (textL < 0) { // if (textL < 0) {
// textL = 0; // textL = 0;
// } else if (textL + textWidth > totle) { // } else if (textL + textWidth > totle) {
......
...@@ -20,4 +20,6 @@ abstract class MainRouter extends RouterBaser { ...@@ -20,4 +20,6 @@ abstract class MainRouter extends RouterBaser {
Widget getProxyPage(); Widget getProxyPage();
void catchErrorToBugly(String err); void catchErrorToBugly(String err);
bool isWithNative();
} }
...@@ -42,4 +42,9 @@ class MainRouterImpl implements MainRouter { ...@@ -42,4 +42,9 @@ class MainRouterImpl implements MainRouter {
void catchErrorToBugly(String err) { void catchErrorToBugly(String err) {
MainManager.getInstance().catchErrorToBugly(err); MainManager.getInstance().catchErrorToBugly(err);
} }
@override
bool isWithNative() {
return MainManager.getInstance().isInit;
}
} }
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