Commit bca1b3b6 authored by 杜欣's avatar 杜欣

Merge branch 'test' into featrue/duxin

parents f523ef59 790d0f59
......@@ -102,10 +102,10 @@ class LevelOneListState extends State<LevelOneList>
widget.pageName,
"${widget.planId}",
_model.data[index].cardType == "hospital"
? _model.data[index].hospital
? _model.data[index].hospital.hosiptalId
: "",
_model.data[index].cardType == "doctor"
? _model.data[index].doctor
? _model.data[index].doctor.doctor_id
: "");
},
compare: () {
......
......@@ -16,6 +16,7 @@ import 'package:gm_flutter/ClueModel/page/levelOne/LevelOneModel.dart';
import 'package:gm_flutter/commonModel/GMBase.dart';
import 'package:gm_flutter/commonModel/base/BaseComponent.dart';
import 'package:gm_flutter/commonModel/base/BaseState.dart';
import 'package:gm_flutter/commonModel/bean/Pair.dart';
import 'package:gm_flutter/commonModel/eventbus/SimpleEventBus.dart';
import 'package:gm_flutter/commonModel/view/baseRefreshIndicator.dart';
import 'package:gm_flutter/main.mark.dart';
......@@ -120,6 +121,7 @@ class LevelOneState extends BaseState<LevelOnePage>
},
child: newHomeWarp()),
), () {
_model.stateLive.notifyView(LOADING);
_model.init(() {
_initTabBar();
});
......@@ -409,28 +411,26 @@ class LevelOneState extends BaseState<LevelOnePage>
child: Row(
children: <Widget>[
Container(
constraints: BoxConstraints(
maxWidth: 52,
),
child: Text(
element.attrName,
textScaleFactor: 1.0,
softWrap: true,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
decoration: TextDecoration.none,
fontSize: 13,
color: Color(0xff999999),
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400),
)
),
constraints: BoxConstraints(
maxWidth: 52,
),
child: Text(
element.attrName,
textScaleFactor: 1.0,
softWrap: true,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
decoration: TextDecoration.none,
fontSize: 13,
color: Color(0xff999999),
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400),
)),
Expanded(
child: Container(
margin: EdgeInsets.only(left: 12),
child:
Text(
child: Text(
element.attrValue,
textScaleFactor: 1.0,
softWrap: false,
......@@ -446,7 +446,6 @@ class LevelOneState extends BaseState<LevelOnePage>
// ),
),
)
],
),
));
......
......@@ -18,6 +18,7 @@ import 'package:gm_flutter/ClueModel/page/levelOne/LevelOneModel.dart';
import 'package:gm_flutter/ClueModel/page/mechanismBox/MechanismBoxPage.dart';
import 'package:gm_flutter/commonModel/base/BaseComponent.dart';
import 'package:gm_flutter/commonModel/base/BaseState.dart';
import 'package:gm_flutter/commonModel/bean/Pair.dart';
import 'package:gm_flutter/commonModel/eventbus/SimpleEventBus.dart';
import 'package:gm_flutter/commonModel/net/DioUtil.dart';
import 'package:gm_flutter/commonModel/view/baseRefreshIndicator.dart';
......@@ -125,6 +126,7 @@ class LevelTwoState extends BaseState<LevelTwoPage>
],
)),
), () {
_model.stateLive.notifyView(LOADING);
_model.init(() {
_initTabBar();
});
......
......@@ -34,7 +34,7 @@ class PlanModel extends BaseModel {
List<Orders> sortList = [];
RxDispose rxDispose = RxDispose();
String tag_id = "";
String tag_id = "0";
String order_by = "";
String current_city_id = "";
String min_price = "";
......
......@@ -53,6 +53,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
ChangeNotifier hideAllMenuListener = new ChangeNotifier();
GlobalKey globalKey = GlobalKey();
PlanBarView planBarView;
double stateBarHeight;
@override
void initState() {
......@@ -81,6 +82,8 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
@override
Widget buildItem(BuildContext context) {
stateBarHeight = MediaQueryData.fromWindow(window).padding.top;
return Scaffold(
body: MediaQuery.removePadding(
removeTop: true,
......@@ -100,7 +103,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height - 86,
height: MediaQuery.of(context).size.height - stateBarHeight,
child: child(),
),
StreamBuilder<List<double>>(
......@@ -283,59 +286,59 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
Widget head() {
return Container(
height: 86,
child: Container(
margin: EdgeInsets.only(top: 48, left: 15, right: 15),
width: double.maxFinite,
height: 32,
child: TextField(
cursorColor: Color(0xff20BDBB),
style: TextStyle(fontSize: 12, color: Color(0xff999999)),
decoration: InputDecoration(
isDense: true,
prefixIcon: Container(
child: Container(
margin: EdgeInsets.only(left: 12, right: 6),
width: 13,
height: 13,
child: Image.asset("assets/search.png"),
),
),
prefixIconConstraints:
BoxConstraints(maxWidth: 31, minWidth: 31, maxHeight: 13),
suffixIconConstraints:
BoxConstraints(maxWidth: 56.5, maxHeight: 32),
suffixIcon: Container(
decoration: BoxDecoration(
color: Color(0xff51CDC7),
borderRadius: BorderRadius.circular(16),
),
alignment: Alignment.center,
child: baseText("搜索", 14, Colors.white),
).gestureDetector(() {
//TODO
}),
contentPadding:
const EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(19.5),
borderSide: BorderSide.none),
filled: true,
fillColor: Color(0xffF7F6FA),
hintStyle: TextStyle(fontSize: 12, color: Color(0xff999999)),
hintText: "切开双眼皮"),
maxLines: 1,
enableInteractiveSelection: true,
focusNode: focusNode,
autocorrect: false,
autofocus: false,
textInputAction: TextInputAction.search,
controller: _editingController,
minLines: null,
onEditingComplete: () {},
onSubmitted: (text) {},
),
),
height: stateBarHeight,
// child: Container(
// margin: EdgeInsets.only(top: 48, left: 15, right: 15),
// width: double.maxFinite,
// height: 32,
// child: TextField(
// cursorColor: Color(0xff20BDBB),
// style: TextStyle(fontSize: 12, color: Color(0xff999999)),
// decoration: InputDecoration(
// isDense: true,
// prefixIcon: Container(
// child: Container(
// margin: EdgeInsets.only(left: 12, right: 6),
// width: 13,
// height: 13,
// child: Image.asset("assets/search.png"),
// ),
// ),
// prefixIconConstraints:
// BoxConstraints(maxWidth: 31, minWidth: 31, maxHeight: 13),
// suffixIconConstraints:
// BoxConstraints(maxWidth: 56.5, maxHeight: 32),
// suffixIcon: Container(
// decoration: BoxDecoration(
// color: Color(0xff51CDC7),
// borderRadius: BorderRadius.circular(16),
// ),
// alignment: Alignment.center,
// child: baseText("搜索", 14, Colors.white),
// ).gestureDetector(() {
// //TODO
// }),
// contentPadding:
// const EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
// border: OutlineInputBorder(
// borderRadius: BorderRadius.circular(19.5),
// borderSide: BorderSide.none),
// filled: true,
// fillColor: Color(0xffF7F6FA),
// hintStyle: TextStyle(fontSize: 12, color: Color(0xff999999)),
// hintText: "切开双眼皮"),
// maxLines: 1,
// enableInteractiveSelection: true,
// focusNode: focusNode,
// autocorrect: false,
// autofocus: false,
// textInputAction: TextInputAction.search,
// controller: _editingController,
// minLines: null,
// onEditingComplete: () {},
// onSubmitted: (text) {},
// ),
// ),
);
}
......@@ -452,7 +455,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
double bottom =
// WidgetUtil.buttonLeftMenuPosition(globalKey.currentContext)?.top ??
topPos == null ? 0.0 : topPos.dy + 45 - 86;
topPos == null ? 0.0 : topPos.dy + 45 - stateBarHeight;
if (bottom < 45) {
bottom = 45;
}
......@@ -528,7 +531,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
void _onScroll(double offset) {
var topPos = PosUtil.findPos(globalKey);
if (topPos != null) {
if (topPos.dy > 86) {
if (topPos.dy > stateBarHeight) {
_model.showTab.notifyView(false);
} else {
_model.showTab.notifyView(true);
......
......@@ -34,6 +34,7 @@ class ProjectViewState extends State<ProjectView> {
children: <Widget>[
Container(
width: 75,
color: Color(0xffF4F3F8),
child: ListView.builder(
itemBuilder: (c, index) {
return Container(
......@@ -78,13 +79,13 @@ class ProjectViewState extends State<ProjectView> {
itemBuilder: (c, index) {
return Container(
margin: EdgeInsets.only(left: 20, top: 18, bottom: 18),
child: baseText(widget.datas[selectIndex].subTags[index].name,
child: baseText(widget.datas[selectIndex].subtags[index].name,
14, Color(0xff464646)),
).gestureDetector(() {
widget.clickCall(widget.datas[selectIndex].subTags[index].id);
widget.clickCall("${widget.datas[selectIndex].subtags[index].tagId}");
});
},
itemCount: widget.datas[selectIndex].subTags.length,
itemCount: widget.datas[selectIndex].subtags.length,
),
)
],
......
......@@ -56,7 +56,7 @@ class TopListState extends State<TopList>
return baseStateView(MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height, _model.stateLive, home(), () {
_model.getData(true);
});
},paddingTop: widget.topHeight);
}
Widget home() {
......
......@@ -16,6 +16,7 @@ import 'package:gm_flutter/ClueModel/util/PosUtil.dart';
import 'package:gm_flutter/commonModel/base/BaseComponent.dart';
import 'package:gm_flutter/commonModel/base/BaseState.dart';
import 'package:gm_flutter/commonModel/eventbus/SimpleEventBus.dart';
import 'package:gm_flutter/commonModel/net/DioUtil.dart';
import 'package:gm_flutter/commonModel/util/DartUtil.dart';
import 'package:gm_flutter/commonModel/view/baseRefreshIndicator.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
......@@ -42,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();
......
class ConsultQuestionsBean {
int error;
String message;
Null extra;
Null errorExtra;
Map extra;
Map errorExtra;
UserType userType;
Data data;
......
......@@ -8,8 +8,8 @@
class DiscussLowPriceAuthBean {
int error;
String message;
Null extra;
Null errorExtra;
Map extra;
Map errorExtra;
UserType userType;
Data data;
......
......@@ -5,8 +5,8 @@
class LevelOneFeedList {
int error;
String message;
Null extra;
Null errorExtra;
Map extra;
Map errorExtra;
UserType userType;
Data data;
......@@ -245,6 +245,7 @@ class Hospital {
class Doctor {
String portrait;
String name;
String doctor_id;
String minPrice;
String maxPrice;
String star;
......@@ -267,6 +268,7 @@ class Doctor {
name = json['name'];
minPrice = json['min_price'];
maxPrice = json['max_price'];
doctor_id = json['doctor_id'];
star = json['star'];
title = json['title'];
consultType = json['consult_type'];
......@@ -277,6 +279,7 @@ class Doctor {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['portrait'] = this.portrait;
data['name'] = this.name;
data['doctor_id'] = this.doctor_id;
data['min_price'] = this.minPrice;
data['max_price'] = this.maxPrice;
data['star'] = this.star;
......
......@@ -5,8 +5,8 @@
class PlanBarBean {
int error;
String message;
Null extra;
Null errorExtra;
Map extra;
Map errorExtra;
UserType userType;
Data data;
......
......@@ -5,28 +5,22 @@
class PlanBean {
int error;
String message;
String extra;
String errorExtra;
UserType userType;
Null extra;
Null errorCode;
Null errorExtra;
Data data;
UserType userType;
PlanBean(
{this.error,
this.message,
this.extra,
this.errorExtra,
this.userType,
this.data});
PlanBean({this.error, this.message, this.extra, this.errorCode, this.errorExtra, this.data, this.userType});
PlanBean.fromJson(Map<String, dynamic> json) {
error = json['error'];
message = json['message'];
extra = json['extra']??"";
errorExtra = json['error_extra']??"";
userType = json['user_type'] != null
? new UserType.fromJson(json['user_type'])
: null;
extra = json['extra'];
errorCode = json['error_code'];
errorExtra = json['error_extra'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
userType = json['user_type'] != null ? new UserType.fromJson(json['user_type']) : null;
}
Map<String, dynamic> toJson() {
......@@ -34,60 +28,39 @@ class PlanBean {
data['error'] = this.error;
data['message'] = this.message;
data['extra'] = this.extra;
data['error_code'] = this.errorCode;
data['error_extra'] = this.errorExtra;
if (this.userType != null) {
data['user_type'] = this.userType.toJson();
}
if (this.data != null) {
data['data'] = this.data.toJson();
}
return data;
}
}
class UserType {
UserType();
UserType.fromJson(Map<String, dynamic> json) {}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.userType != null) {
data['user_type'] = this.userType.toJson();
}
return data;
}
}
class Data {
List<Ranks> ranks;
List<Areas> areas;
List<Tags> tags;
Areas areas;
List<Orders> orders;
Data({this.ranks, this.areas, this.tags, this.orders});
Data({this.ranks, this.tags, this.areas, this.orders});
Data.fromJson(Map<String, dynamic> json) {
if (json['ranks'] != null) {
ranks = new List<Ranks>();
json['ranks'].forEach((v) {
ranks.add(new Ranks.fromJson(v));
});
}
if (json['areas'] != null) {
areas = new List<Areas>();
json['areas'].forEach((v) {
areas.add(new Areas.fromJson(v));
});
json['ranks'].forEach((v) { ranks.add(new Ranks.fromJson(v)); });
}
if (json['tags'] != null) {
tags = new List<Tags>();
json['tags'].forEach((v) {
tags.add(new Tags.fromJson(v));
});
json['tags'].forEach((v) { tags.add(new Tags.fromJson(v)); });
}
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));
});
json['orders'].forEach((v) { orders.add(new Orders.fromJson(v)); });
}
}
......@@ -96,12 +69,12 @@ class Data {
if (this.ranks != null) {
data['ranks'] = this.ranks.map((v) => v.toJson()).toList();
}
if (this.areas != null) {
data['areas'] = this.areas.map((v) => v.toJson()).toList();
}
if (this.tags != null) {
data['tags'] = this.tags.map((v) => v.toJson()).toList();
}
if (this.areas != null) {
data['areas'] = this.areas.toJson();
}
if (this.orders != null) {
data['orders'] = this.orders.map((v) => v.toJson()).toList();
}
......@@ -115,7 +88,7 @@ class Ranks {
String gmUrl;
String icon;
Ranks({this.name, this.gmUrl, this.icon});
Ranks({this.id, this.name, this.gmUrl, this.icon});
Ranks.fromJson(Map<String, dynamic> json) {
id = json['id'];
......@@ -126,29 +99,127 @@ class Ranks {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['name'] = this.name;
data['id'] = this.id;
data['name'] = this.name;
data['gm_url'] = this.gmUrl;
data['icon'] = this.icon;
return data;
}
}
class Tags {
List<Subtags> subtags;
int isNewTag;
String name;
int tagId;
Tags({this.subtags, this.isNewTag, this.name, this.tagId});
Tags.fromJson(Map<String, dynamic> json) {
if (json['subtags'] != null) {
subtags = new List<Subtags>();
json['subtags'].forEach((v) { subtags.add(new Subtags.fromJson(v)); });
}
isNewTag = json['is_new_tag'];
name = json['name'];
tagId = json['tag_id'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.subtags != null) {
data['subtags'] = this.subtags.map((v) => v.toJson()).toList();
}
data['is_new_tag'] = this.isNewTag;
data['name'] = this.name;
data['tag_id'] = this.tagId;
return data;
}
}
class Subtags {
int isNewTag;
String name;
int tagId;
Subtags({this.isNewTag, this.name, this.tagId});
Subtags.fromJson(Map<String, dynamic> json) {
isNewTag = json['is_new_tag'];
name = json['name'];
tagId = json['tag_id'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['is_new_tag'] = this.isNewTag;
data['name'] = this.name;
data['tag_id'] = this.tagId;
return data;
}
}
class Areas {
AutoLocated autoLocated;
List<Countries> countries;
Areas({this.autoLocated, this.countries});
Areas.fromJson(Map<String, dynamic> json) {
autoLocated = json['auto_located'] != null ? new AutoLocated.fromJson(json['auto_located']) : null;
if (json['countries'] != null) {
countries = new List<Countries>();
json['countries'].forEach((v) { countries.add(new Countries.fromJson(v)); });
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.autoLocated != null) {
data['auto_located'] = this.autoLocated.toJson();
}
if (this.countries != null) {
data['countries'] = this.countries.map((v) => v.toJson()).toList();
}
return data;
}
}
class AutoLocated {
int type;
int id;
String name;
AutoLocated({this.type, this.id, this.name});
AutoLocated.fromJson(Map<String, dynamic> json) {
type = json['type'];
id = json['id'];
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['type'] = this.type;
data['id'] = this.id;
data['name'] = this.name;
return data;
}
}
class Countries {
bool isLocated;
String name;
List<Groups> groups;
Areas({this.isLocated, this.name, this.groups});
Countries({this.isLocated, this.name, this.groups});
Areas.fromJson(Map<String, dynamic> json) {
Countries.fromJson(Map<String, dynamic> json) {
isLocated = json['is_located'];
name = json['name'];
if (json['groups'] != null) {
groups = new List<Groups>();
json['groups'].forEach((v) {
groups.add(new Groups.fromJson(v));
});
json['groups'].forEach((v) { groups.add(new Groups.fromJson(v)); });
}
}
......@@ -176,9 +247,7 @@ class Groups {
initial = json['initial'];
if (json['cities'] != null) {
cities = new List<Cities>();
json['cities'].forEach((v) {
cities.add(new Cities.fromJson(v));
});
json['cities'].forEach((v) { cities.add(new Cities.fromJson(v)); });
}
title = json['title'];
}
......@@ -196,90 +265,57 @@ class Groups {
}
class Cities {
String cityName;
String id;
String name;
int tagId;
Cities({this.cityName, this.id, this.name});
Cities({this.id, this.name, this.tagId});
Cities.fromJson(Map<String, dynamic> json) {
cityName = json['city_name'];
id = json['id'].toString();
id = json['id'];
name = json['name'];
tagId = json['tag_id'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['city_name'] = this.cityName;
data['id'] = this.id;
data['name'] = this.name;
data['tag_id'] = this.tagId;
return data;
}
}
class Tags {
String id;
List<SubTags> subTags;
class Orders {
int id;
String name;
Tags({this.id, this.subTags, this.name});
Orders({this.id, this.name});
Tags.fromJson(Map<String, dynamic> json) {
id = json['id'].toString();
if (json['sub_tags'] != null) {
subTags = new List<SubTags>();
json['sub_tags'].forEach((v) {
subTags.add(new SubTags.fromJson(v));
});
}
Orders.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
if (this.subTags != null) {
data['sub_tags'] = this.subTags.map((v) => v.toJson()).toList();
}
data['name'] = this.name;
return data;
}
}
class SubTags {
String id;
String name;
class UserType {
SubTags({this.id, this.name});
SubTags.fromJson(Map<String, dynamic> json) {
id = json['id'].toString();
name = json['name'];
}
UserType();
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
return data;
}
UserType.fromJson(Map<String, dynamic> json) {
}
class Orders {
int id;
String name;
Orders({this.id, this.name});
Orders.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
return data;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
return data;
}
}
......@@ -7,8 +7,8 @@
class PlanCompareDetail {
int error;
String message;
Null extra;
Null errorExtra;
Map extra;
Map errorExtra;
UserType userType;
Data data;
......
class PlanConsultBean {
int error;
String message;
Null extra;
Null errorExtra;
Map extra;
Map errorExtra;
UserType userType;
Data data;
......
......@@ -5,8 +5,8 @@
class PlanFeedBean {
int error;
String message;
String extra;
String errorExtra;
Map extra;
Map errorExtra;
UserType userType;
Data data;
......
......@@ -5,8 +5,8 @@
class PlanOverViewBean {
int error;
String message;
Null extra;
Null errorExtra;
Map extra;
Map errorExtra;
UserType userType;
PlanOverData data;
......
class PlansCompareFeed {
int error;
String message;
String extra;
String errorExtra;
Map extra;
Map errorExtra;
UserType userType;
Data data;
......
......@@ -4,6 +4,7 @@
**/
import 'package:app_settings/app_settings.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_common/commonModel/live/LiveData.dart';
......@@ -463,8 +464,8 @@ Widget baseSliverAppBar(String url,
automaticallyImplyLeading: false,
flexibleSpace: FlexibleSpaceBar(
background: needpic
? Image.network(
url ?? '',
? CachedNetworkImage(
imageUrl: url ?? '',
fit: BoxFit.cover,
)
: Container(),
......@@ -494,7 +495,7 @@ Widget baseSliverBack(VoidCallback tap) {
Widget baseSliverTitle(String text, double width, LiveData liveData) {
return Positioned(
top: 57,
top: 48,
child: StreamBuilder(
stream: liveData.stream,
initialData: liveData.data ?? 0.0,
......
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