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

w

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