Commit 19516d43 authored by 朱璇's avatar 朱璇

Merge branch 'test' of git.wanmeizhensuo.com:linshengyu/gm_flutter into zx/gmFlutter

parents 64ce8366 9d068e66
...@@ -28,7 +28,9 @@ class _PopView implements ICenterPicker { ...@@ -28,7 +28,9 @@ class _PopView implements ICenterPicker {
String hospitalId; String hospitalId;
String doctorId; String doctorId;
String pageName; String pageName;
_PopView(this.pageName, this.planId, this.hospitalId, this.doctorId); _PopView(this.pageName, this.planId, this.hospitalId, this.doctorId);
VoidCallback dismissCallback; VoidCallback dismissCallback;
double contentWidth; double contentWidth;
DiscussLowPriceModel _model = new DiscussLowPriceModel(); DiscussLowPriceModel _model = new DiscussLowPriceModel();
...@@ -53,7 +55,9 @@ class _PopView implements ICenterPicker { ...@@ -53,7 +55,9 @@ class _PopView implements ICenterPicker {
opacity: alp / 255.0, opacity: alp / 255.0,
child: Container( child: Container(
width: contentWidth, width: contentWidth,
height: 308.5, height: _model.popViewLive.data.second.title.length > 13
? 357.5
: 305.5,
child: Stack( child: Stack(
alignment: AlignmentDirectional.topCenter, alignment: AlignmentDirectional.topCenter,
children: <Widget>[ children: <Widget>[
...@@ -74,21 +78,29 @@ class _PopView implements ICenterPicker { ...@@ -74,21 +78,29 @@ class _PopView implements ICenterPicker {
'assets/discuss_loe_price_cancel.png'), 'assets/discuss_loe_price_cancel.png'),
)), )),
Container( Container(
width: 85, width: 85,
height: 85, height: 85,
decoration: BoxDecoration(boxShadow: [ decoration: BoxDecoration(boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black12, color: Colors.black12,
offset: Offset(0.0, 15.0), offset: Offset(0.0, 3.0),
blurRadius: 15.0, blurRadius: 15.0,
spreadRadius: 1.0) spreadRadius: 1.0)
], shape: BoxShape.circle), ], shape: BoxShape.circle),
child: ClipOval( child: Container(
child: Image.network( decoration: BoxDecoration(
_model.popViewLive.data.second.icon, shape: BoxShape.circle,
fit: BoxFit.cover), ),
), child: Image.network(
) _model.popViewLive.data.second.icon,
fit: BoxFit.cover),
)
// ClipOval(
// child: Image.network(
// _model.popViewLive.data.second.icon,
// fit: BoxFit.cover),
// ),
)
]), ]),
)); ));
}); });
...@@ -96,7 +108,6 @@ class _PopView implements ICenterPicker { ...@@ -96,7 +108,6 @@ class _PopView implements ICenterPicker {
setupBodyView() { setupBodyView() {
return Container( return Container(
height: 266,
width: contentWidth, width: contentWidth,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
...@@ -112,6 +123,7 @@ class _PopView implements ICenterPicker { ...@@ -112,6 +123,7 @@ class _PopView implements ICenterPicker {
detailView() { detailView() {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
...@@ -136,10 +148,12 @@ class _PopView implements ICenterPicker { ...@@ -136,10 +148,12 @@ class _PopView implements ICenterPicker {
]), ]),
), ),
Container( Container(
width: contentWidth,
alignment: Alignment.center,
margin: EdgeInsets.only(bottom: 25), margin: EdgeInsets.only(bottom: 25),
child: baseText( child: baseText(
_model.popViewLive.data.second.title, 18, Color(0xff464646), _model.popViewLive.data.second.title, 18, Color(0xff464646),
bold: true)), bold: true, textAlign: TextAlign.center)),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
...@@ -171,7 +185,6 @@ class _PopView implements ICenterPicker { ...@@ -171,7 +185,6 @@ class _PopView implements ICenterPicker {
}); });
}), }),
Container( Container(
width: contentWidth - 70,
margin: EdgeInsets.only(bottom: 23.5), margin: EdgeInsets.only(bottom: 23.5),
child: baseText('授权后,您的手机将以“虚拟号”方式提供给机构', 11, Color(0xff999999))), child: baseText('授权后,您的手机将以“虚拟号”方式提供给机构', 11, Color(0xff999999))),
]); ]);
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gm_flutter/ClueModel/server/entity/ProjectDetailsItem.dart'; import 'package:gm_flutter/ClueModel/server/entity/ProjectDetailsItem.dart';
import 'package:gm_flutter/commonModel/base/BaseComponent.dart';
class ProjectDetailsItemView extends StatelessWidget { class ProjectDetailsItemView extends StatelessWidget {
Groups listData; Groups listData;
...@@ -50,49 +51,25 @@ class ProjectDetailsItemView extends StatelessWidget { ...@@ -50,49 +51,25 @@ class ProjectDetailsItemView extends StatelessWidget {
width: double.maxFinite, width: double.maxFinite,
margin: EdgeInsets.only(bottom: 25, left: 15, right: 15), margin: EdgeInsets.only(bottom: 25, left: 15, right: 15),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only(right: 25.0), margin: EdgeInsets.only(right: 25.0),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
width: 78, width: 78,
child: baseText(attrs.attrName, 13, Color(0xFF999999)), child: baseText(attrs.attrName, 13, Color(0xFF999999),
), textAlign: TextAlign.left,
maxLines: 2,
overflow: TextOverflow.ellipsis)),
Expanded( Expanded(
child: Container( child: Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: baseText(attrs.attrValue, 14, Color(0xFF282828),
attrs.attrValue, textAlign: TextAlign.left,
textScaleFactor: 1.0, maxLines: 2,
softWrap: true, overflow: TextOverflow.ellipsis)),
style: TextStyle(
decoration: TextDecoration.none,
fontSize: 14,
color: Color(0xFF282828),
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400),
)
// baseText(attrs.attrValue, 14, Color(0xFF282828))
),
), ),
], ],
), ),
); );
} }
baseText(String text, double fontSize, Color color, {bool bold = false}) {
return Text(
text,
textScaleFactor: 1.0,
style: TextStyle(
decoration: TextDecoration.none,
fontSize: fontSize,
color: color,
fontStyle: FontStyle.normal,
fontWeight: bold ? FontWeight.w500 : FontWeight.w400),
textAlign: TextAlign.left,
maxLines: 2,
overflow: TextOverflow.ellipsis,
);
}
} }
/* /*
* @author lsy * @author dx
* @date 2020/6/29 * @date 2020/6/29
**/ **/
import 'dart:async'; import 'dart:async';
import 'dart:math'; import 'dart:math';
import 'dart:ui'; import 'dart:ui';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart' import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart'
as extend; as extend;
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
...@@ -18,14 +19,18 @@ import 'package:gm_flutter/ClueModel/page/mechanismBox/MechanismBoxPage.dart'; ...@@ -18,14 +19,18 @@ import 'package:gm_flutter/ClueModel/page/mechanismBox/MechanismBoxPage.dart';
import 'package:gm_flutter/commonModel/base/BaseComponent.dart'; import 'package:gm_flutter/commonModel/base/BaseComponent.dart';
import 'package:gm_flutter/commonModel/base/BaseState.dart'; import 'package:gm_flutter/commonModel/base/BaseState.dart';
import 'package:gm_flutter/commonModel/eventbus/SimpleEventBus.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'; import 'package:gm_flutter/commonModel/view/baseRefreshIndicator.dart';
import 'package:gm_flutter/main.mark.dart'; import 'package:gm_flutter/main.mark.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
class LevelTwoPage extends StatefulWidget { class LevelTwoPage extends StatefulWidget {
int planId;
final String PAGE_NAME = "level_two_plan_deatil"; final String PAGE_NAME = "level_two_plan_deatil";
LevelTwoPage(Map<String, dynamic> params) {} LevelTwoPage(Map<String, dynamic> params) {
planId = params['planId'];
}
@override @override
State<StatefulWidget> createState() => LevelTwoState(); State<StatefulWidget> createState() => LevelTwoState();
...@@ -33,7 +38,6 @@ class LevelTwoPage extends StatefulWidget { ...@@ -33,7 +38,6 @@ class LevelTwoPage extends StatefulWidget {
class LevelTwoState extends BaseState<LevelTwoPage> class LevelTwoState extends BaseState<LevelTwoPage>
with TickerProviderStateMixin { with TickerProviderStateMixin {
int planId = 10;
LevelOneModel _model = new LevelOneModel(); LevelOneModel _model = new LevelOneModel();
RefreshController _refreshController = RefreshController(); RefreshController _refreshController = RefreshController();
GlobalKey keyTop = new GlobalKey(); GlobalKey keyTop = new GlobalKey();
...@@ -48,7 +52,9 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -48,7 +52,9 @@ class LevelTwoState extends BaseState<LevelTwoPage>
@override @override
void initState() { void initState() {
DioUtil.getInstance().setProxy("172.30.8.245");
super.initState(); super.initState();
_model.plan_id = widget.planId;
_model.init(() { _model.init(() {
_initTabBar(); _initTabBar();
}); });
...@@ -110,7 +116,14 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -110,7 +116,14 @@ class LevelTwoState extends BaseState<LevelTwoPage>
}); });
return completer.future; return completer.future;
}, },
child: newHomeWarp()), child: Column(
children: <Widget>[
Expanded(
child: newHomeWarp(),
),
bottomWidget(),
],
)),
), () { ), () {
_model.init(() { _model.init(() {
_initTabBar(); _initTabBar();
...@@ -162,7 +175,6 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -162,7 +175,6 @@ class LevelTwoState extends BaseState<LevelTwoPage>
baseSliverBack(() { baseSliverBack(() {
Navigator.of(context).pop(); Navigator.of(context).pop();
}), }),
bottomWidget()
], ],
); );
} }
...@@ -173,8 +185,8 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -173,8 +185,8 @@ class LevelTwoState extends BaseState<LevelTwoPage>
for (int i = 0; i < _model.tabsList.length; i++) { for (int i = 0; i < _model.tabsList.length; i++) {
list.add(extend.NestedScrollViewInnerScrollPositionKeyWidget( list.add(extend.NestedScrollViewInnerScrollPositionKeyWidget(
Key("Tab${i}"), Key("Tab${i}"),
LevelOneList(1,widget.PAGE_NAME, LevelOneList(1, widget.PAGE_NAME, widget.planId,
planId, _model.tabsList[i].tabType, kToolbarHeight + d))); _model.tabsList[i].tabType, kToolbarHeight + d)));
} }
final double statusBarHeight = MediaQuery.of(context).padding.top; final double statusBarHeight = MediaQuery.of(context).padding.top;
final double pinnedHeaderHeight = statusBarHeight + kToolbarHeight; final double pinnedHeaderHeight = statusBarHeight + kToolbarHeight;
...@@ -206,6 +218,17 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -206,6 +218,17 @@ class LevelTwoState extends BaseState<LevelTwoPage>
height: 40, height: 40,
color: Colors.white, color: Colors.white,
child: baseTabBar(tabController, getTabs(), (index) { child: baseTabBar(tabController, getTabs(), (index) {
Map<String, dynamic> map = {};
map["page_name"] = "level_two_plan_deatil";
map["referrer"] = "";
map["referrer_id"] = "";
map["referrer_link"] = ["plan_home"];
map["from_tab_name"] = "全部";
map["tab_name"] = index == 0 ? '机构' : '医生';
map["position"] = 1;
RouterCenterImpl()
.findMainRouter()
.buriedEvent("on_click_tab", map);
_model.selectTab(index); _model.selectTab(index);
}, scroll: false), }, scroll: false),
)), )),
...@@ -232,7 +255,7 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -232,7 +255,7 @@ class LevelTwoState extends BaseState<LevelTwoPage>
); );
} }
return Padding( return Padding(
padding: EdgeInsets.only(left: 15.0, right: 15.0, top: 8.0), padding: EdgeInsets.only(left: 15.0, right: 15.0, top: 8.0, bottom: 20),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
...@@ -243,41 +266,43 @@ class LevelTwoState extends BaseState<LevelTwoPage> ...@@ -243,41 +266,43 @@ class LevelTwoState extends BaseState<LevelTwoPage>
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17), borderRadius: BorderRadius.circular(17),
border: Border.all(color: Color(0xffF9F8FB), width: 1)), border: Border.all(color: Color(0xffF9F8FB), width: 1)),
child: Image.network( child: CachedNetworkImage(
_model.planoverItem.banner.imageUrl, imageUrl: _model.planoverItem.banner.imageUrl,
width: 86, width: 86,
height: 86, height: 86,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
)), )),
Padding( Expanded(
padding: EdgeInsets.only(left: 12, top: 5), child: Padding(
child: Column( padding: EdgeInsets.only(left: 12, top: 5),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ mainAxisSize: MainAxisSize.max,
Text(_model.planoverItem.name, children: <Widget>[
style: TextStyle( Text(_model.planoverItem.name,
color: Color(0xff333333), style: TextStyle(
fontSize: 15, color: Color(0xff333333),
fontWeight: FontWeight.bold)), fontSize: 15,
Padding(padding: EdgeInsets.only(top: 5)), fontWeight: FontWeight.bold)),
Row( Padding(padding: EdgeInsets.only(top: 5)),
crossAxisAlignment: CrossAxisAlignment.start, Row(
verticalDirection: VerticalDirection.up, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ verticalDirection: VerticalDirection.up,
Text('指导价:', children: <Widget>[
style: TextStyle( Text('指导价:',
color: Color(0xff999999), fontSize: 12)), style: TextStyle(
Text( color: Color(0xff999999), fontSize: 12)),
'¥' + _model.planoverItem.guidePrice, Text(
style: '¥' + _model.planoverItem.guidePrice,
TextStyle(color: Color(0xffFF5963), fontSize: 12), style:
) TextStyle(color: Color(0xffFF5963), fontSize: 12),
], )
) ],
], )
)), ],
)),
)
], ],
), ),
); );
......
...@@ -2,16 +2,25 @@ import 'package:cached_network_image/cached_network_image.dart'; ...@@ -2,16 +2,25 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_common/commonModel/picker/base/BaseBottomPicker.dart'; import 'package:flutter_common/commonModel/picker/base/BaseBottomPicker.dart';
import 'package:flutter_common/commonModel/toast/NativeToast.dart'; import 'package:flutter_common/commonModel/toast/NativeToast.dart';
import 'package:gm_flutter/ClueModel/page/levelOne/LevelOneListModel.dart';
import 'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart';
import 'package:gm_flutter/ClueModel/view/FiveStarView.dart'; import 'package:gm_flutter/ClueModel/view/FiveStarView.dart';
import 'package:gm_flutter/commonModel/base/BaseComponent.dart'; import 'package:gm_flutter/commonModel/base/BaseComponent.dart';
import 'package:gm_flutter/ClueModel/page/mechanismBox/MechanismModel.dart'; import 'package:gm_flutter/ClueModel/page/mechanismBox/MechanismModel.dart';
import 'package:gm_flutter/commonModel/bean/Pair.dart'; import 'package:gm_flutter/commonModel/bean/Pair.dart';
import 'package:gm_flutter/main.mark.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
class MechanismBox implements IBottomPicker { class MechanismBox implements IBottomPicker {
VoidCallback dismissCall; VoidCallback dismissCall;
TextEditingController textController = TextEditingController(); TextEditingController textController = TextEditingController();
MechanismModel _model = new MechanismModel(); MechanismModel _model = new MechanismModel();
List<int> doctor_ids = new List(); List doctor_ids = new List();
LevelOneListModel _levelModel = LevelOneListModel();
RefreshController refreshController = RefreshController();
Function(String str) refresh;
@required @required
final int plan_id; final int plan_id;
...@@ -20,8 +29,27 @@ class MechanismBox implements IBottomPicker { ...@@ -20,8 +29,27 @@ class MechanismBox implements IBottomPicker {
@override @override
initState(dismissCall, BuildContext context) { initState(dismissCall, BuildContext context) {
Map<String, dynamic> map = {
"business_id": "level_two_plan_compare_deatil",
"page_name": "",
"referrer": "",
"referrer_id": "",
"referrer_link": [],
"referrer_tab_name": "",
"in": "",
"out": "",
"is_push": 1,
"fake": 1,
"is_first": 1
};
RouterCenterImpl().findMainRouter().buriedEvent("page_view", map);
this.dismissCall = dismissCall; this.dismissCall = dismissCall;
_model.getQuestions(plan_id); _model.getQuestions(plan_id);
_levelModel.refreshView(true);
refresh = (str) {
_levelModel.stateLive.notifyView(LOADING);
_levelModel.refreshView(true);
};
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -56,6 +84,9 @@ class MechanismBox implements IBottomPicker { ...@@ -56,6 +84,9 @@ class MechanismBox implements IBottomPicker {
@override @override
void dispose() { void dispose() {
textController.dispose(); textController.dispose();
refreshController.dispose();
_levelModel.dispose();
_model.dispose();
} }
setupHome(mq, keyHeight) { setupHome(mq, keyHeight) {
...@@ -114,21 +145,64 @@ class MechanismBox implements IBottomPicker { ...@@ -114,21 +145,64 @@ class MechanismBox implements IBottomPicker {
height: mq.size.height - 140 - 96 - 50 - keyHeight, height: mq.size.height - 140 - 96 - 50 - keyHeight,
width: mq.size.width, width: mq.size.width,
padding: EdgeInsets.only(left: 15, right: 15), padding: EdgeInsets.only(left: 15, right: 15),
child: ListView.separated( child: baseRefreshView(refreshController, () {}, null, null,
itemCount: 100, customScrollView: CustomScrollView(
itemBuilder: (BuildContext context, int index) { // physics: NeverScrollableScrollPhysics(),
return HospitalItem(context, index); physics: ClampingScrollPhysics(),
}, // shrinkWrap: true,
separatorBuilder: (BuildContext context, int index) { slivers: <Widget>[
return Divider(color: Color(0xffE5E5E5)); // SliverOverlapInjector(
}, // handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
)); // ),
StreamBuilder<List<Cards>>(
stream: _levelModel.cardsLive.stream,
initialData: _levelModel.cardsLive.data ?? [],
builder: (c, data) {
if (data.data.isEmpty && _levelModel.page > 1) {
refreshController.loadNoData();
} else {
refreshController.loadComplete();
}
return SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
if (index == _levelModel.data.length) {
return Container(
height: 40,
color: Color(0xffF7F6FA),
);
}
if (_levelModel.data[index].cardType == 'hospital') {
Hospital hospital =
_levelModel.data[index].hospital;
return HospitalItem(hospital);
} else {
return Container();
}
},
childCount: _levelModel.data.length + 1,
),
);
},
),
],
), onLoading: () {
_levelModel.loadMore();
}, pullDown: false, pullUp: true));
} }
// 机构卡片 // 机构卡片
Widget HospitalItem(BuildContext context, int index) { Widget HospitalItem(Hospital hospital) {
return GestureDetector( return GestureDetector(
onTap: () {}, onTap: () {
if (doctor_ids.indexOf(hospital.hosiptalId) != -1) {
doctor_ids.remove(hospital.hosiptalId);
} else {
doctor_ids.add(hospital.hosiptalId);
}
hospital.isCheck = !hospital.isCheck;
_levelModel.cardsLive.notifyView(_levelModel.cardsLive.data);
},
child: Container( child: Container(
height: 94.5, height: 94.5,
child: Stack( child: Stack(
...@@ -139,7 +213,7 @@ class MechanismBox implements IBottomPicker { ...@@ -139,7 +213,7 @@ class MechanismBox implements IBottomPicker {
child: Container( child: Container(
height: 17, height: 17,
width: 17, width: 17,
child: true child: hospital.isCheck
? Image.asset("assets/icon-checked.png") ? Image.asset("assets/icon-checked.png")
: Image.asset("assets/icon-check.png"), : Image.asset("assets/icon-check.png"),
)), )),
...@@ -151,10 +225,8 @@ class MechanismBox implements IBottomPicker { ...@@ -151,10 +225,8 @@ class MechanismBox implements IBottomPicker {
height: 45, height: 45,
child: ClipOval( child: ClipOval(
child: CachedNetworkImage( child: CachedNetworkImage(
// imageUrl: cards.hospital.portrait, // imageUrl: cards.hospital.portrait,
imageUrl: imageUrl: hospital.portrait),
'https://img1.gamersky.com/image2019/07/20190725_ll_red_136_2/gamersky_07small_14_201972510258D0.jpg',
),
), ),
), ),
), ),
...@@ -163,7 +235,8 @@ class MechanismBox implements IBottomPicker { ...@@ -163,7 +235,8 @@ class MechanismBox implements IBottomPicker {
top: 17.5, top: 17.5,
// child: baseText(cards.hospital.name, 15, Color(0xff333333), // child: baseText(cards.hospital.name, 15, Color(0xff333333),
// bold: true), // bold: true),
child: baseText('22222', 15, Color(0xff333333), bold: true), child:
baseText(hospital.name, 15, Color(0xff333333), bold: true),
), ),
Positioned( Positioned(
top: 42.5, top: 42.5,
...@@ -173,7 +246,8 @@ class MechanismBox implements IBottomPicker { ...@@ -173,7 +246,8 @@ class MechanismBox implements IBottomPicker {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
baseText("¥", 12, Color(0xffFF5963)), baseText("¥", 12, Color(0xffFF5963)),
baseText("${1}-${2}", 15, Color(0xffFF5963)), baseText("${hospital.minPrice}-${hospital.maxPrice}", 15,
Color(0xffFF5963)),
], ],
), ),
), ),
...@@ -181,12 +255,12 @@ class MechanismBox implements IBottomPicker { ...@@ -181,12 +255,12 @@ class MechanismBox implements IBottomPicker {
bottom: 21, bottom: 21,
left: 89, left: 89,
// child: baseText(cards.hospital.address, 12, Color(0xff666666)), // child: baseText(cards.hospital.address, 12, Color(0xff666666)),
child: baseText('dsssssssss', 12, Color(0xff666666)), child: baseText(hospital.address, 12, Color(0xff666666)),
), ),
Positioned( Positioned(
left: 89, left: 89,
top: 38.5, top: 38.5,
child: FiveStarView(2, 5), child: FiveStarView(int.parse(hospital.star), 5),
) )
], ],
), ),
...@@ -276,17 +350,17 @@ class MechanismBox implements IBottomPicker { ...@@ -276,17 +350,17 @@ class MechanismBox implements IBottomPicker {
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
textInputAction: TextInputAction.send, textInputAction: TextInputAction.send,
onSubmitted: (txt) { onSubmitted: (txt) {
if (!(doctor_ids.length > 3 || if (doctor_ids.length > 3 || doctor_ids.length < 1) {
doctor_ids.length < 1)) {
NativeToast.showNativeToast('请选择1-3个机构咨询'); NativeToast.showNativeToast('请选择1-3个机构咨询');
} else { } else {
if (txt == '') { if (txt != '') {
NativeToast.showNativeToast('text'); _model.sendMessage(doctor_ids, txt, plan_id, (i) {
} else { if (i == 0) {
_model.sendMessage(doctor_ids, txt, plan_id); dismissCall();
dismissCall(); textController.text = '';
textController.text = ''; NativeToast.showNativeToast('消息已发送成功');
NativeToast.showNativeToast('消息已发送成功'); }
});
} }
} }
}, },
......
...@@ -42,12 +42,14 @@ class MechanismModel extends BaseModel { ...@@ -42,12 +42,14 @@ class MechanismModel extends BaseModel {
}); });
} }
sendMessage(List<int> doctor_ids, String question, int plan_id) { sendMessage(List<int> doctor_ids, String question, int plan_id,
Function(int state) func) {
ClueApiImpl.getInstance() ClueApiImpl.getInstance()
.sendMessage( .sendMessage(
DioUtil.getInstance().getDio(), doctor_ids, question, plan_id) DioUtil.getInstance().getDio(), doctor_ids, question, plan_id)
.listen((event) { .listen((event) {
if (event.error == 0) { if (event.error == 0) {
func(0);
messageLive.notifyView(event.data.success); messageLive.notifyView(event.data.success);
} else { } else {
NativeToast.showNativeToast(event.message); NativeToast.showNativeToast(event.message);
......
...@@ -10,14 +10,22 @@ class LevelOneFeedList { ...@@ -10,14 +10,22 @@ class LevelOneFeedList {
UserType userType; UserType userType;
Data data; Data data;
LevelOneFeedList({this.error, this.message, this.extra, this.errorExtra, this.userType, this.data}); LevelOneFeedList(
{this.error,
this.message,
this.extra,
this.errorExtra,
this.userType,
this.data});
LevelOneFeedList.fromJson(Map<String, dynamic> json) { LevelOneFeedList.fromJson(Map<String, dynamic> json) {
error = json['error']; error = json['error'];
message = json['message']; message = json['message'];
extra = json['extra']; extra = json['extra'];
errorExtra = json['error_extra']; errorExtra = json['error_extra'];
userType = json['user_type'] != null ? new UserType.fromJson(json['user_type']) : null; userType = json['user_type'] != null
? new UserType.fromJson(json['user_type'])
: null;
data = json['data'] != null ? new Data.fromJson(json['data']) : null; data = json['data'] != null ? new Data.fromJson(json['data']) : null;
} }
...@@ -38,17 +46,14 @@ class LevelOneFeedList { ...@@ -38,17 +46,14 @@ class LevelOneFeedList {
} }
class UserType { class UserType {
UserType(); UserType();
UserType.fromJson(Map<String, dynamic> json) { UserType.fromJson(Map<String, dynamic> json) {}
}
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
return data; return data;
} }
} }
class Data { class Data {
...@@ -59,7 +64,9 @@ class Data { ...@@ -59,7 +64,9 @@ class Data {
Data.fromJson(Map<String, dynamic> json) { Data.fromJson(Map<String, dynamic> json) {
if (json['cards'] != null) { if (json['cards'] != null) {
cards = new List<Cards>(); cards = new List<Cards>();
json['cards'].forEach((v) { cards.add(new Cards.fromJson(v)); }); json['cards'].forEach((v) {
cards.add(new Cards.fromJson(v));
});
} }
} }
...@@ -84,8 +91,11 @@ class Cards { ...@@ -84,8 +91,11 @@ class Cards {
Cards.fromJson(Map<String, dynamic> json) { Cards.fromJson(Map<String, dynamic> json) {
cardType = json['card_type']; cardType = json['card_type'];
plan = json['plan'] != null ? new Plan.fromJson(json['plan']) : null; plan = json['plan'] != null ? new Plan.fromJson(json['plan']) : null;
hospital = json['hospital'] != null ? new Hospital.fromJson(json['hospital']) : null; hospital = json['hospital'] != null
doctor = json['doctor'] != null ? new Doctor.fromJson(json['doctor']) : null; ? new Hospital.fromJson(json['hospital'])
: null;
doctor =
json['doctor'] != null ? new Doctor.fromJson(json['doctor']) : null;
diary = json['diary'] != null ? new Diary.fromJson(json['diary']) : null; diary = json['diary'] != null ? new Diary.fromJson(json['diary']) : null;
} }
...@@ -119,7 +129,16 @@ class Plan { ...@@ -119,7 +129,16 @@ class Plan {
String consultType; String consultType;
String messageUrl; String messageUrl;
Plan({this.planName, this.minPrice, this.maxPrice, this.positiveRate, this.salesCount, this.baseAttrs, this.projectImage, this.consultType, this.messageUrl}); Plan(
{this.planName,
this.minPrice,
this.maxPrice,
this.positiveRate,
this.salesCount,
this.baseAttrs,
this.projectImage,
this.consultType,
this.messageUrl});
Plan.fromJson(Map<String, dynamic> json) { Plan.fromJson(Map<String, dynamic> json) {
planName = json['plan_name']; planName = json['plan_name'];
...@@ -129,7 +148,9 @@ class Plan { ...@@ -129,7 +148,9 @@ class Plan {
salesCount = json['sales_count']; salesCount = json['sales_count'];
if (json['base_attrs'] != null) { if (json['base_attrs'] != null) {
baseAttrs = new List<BaseAttrs>(); baseAttrs = new List<BaseAttrs>();
json['base_attrs'].forEach((v) { baseAttrs.add(new BaseAttrs.fromJson(v)); }); json['base_attrs'].forEach((v) {
baseAttrs.add(new BaseAttrs.fromJson(v));
});
} }
projectImage = json['project_image']; projectImage = json['project_image'];
consultType = json['consult_type']; consultType = json['consult_type'];
...@@ -174,6 +195,7 @@ class BaseAttrs { ...@@ -174,6 +195,7 @@ class BaseAttrs {
class Hospital { class Hospital {
String portrait; String portrait;
String hosiptalId;
String name; String name;
String minPrice; String minPrice;
String maxPrice; String maxPrice;
...@@ -181,11 +203,21 @@ class Hospital { ...@@ -181,11 +203,21 @@ class Hospital {
String address; String address;
String consultType; String consultType;
String messageUrl; String messageUrl;
bool isCheck = false;
Hospital({this.portrait, this.name, this.minPrice, this.maxPrice, this.star, this.address, this.consultType, this.messageUrl});
Hospital(
{this.portrait,
this.name,
this.minPrice,
this.maxPrice,
this.star,
this.address,
this.consultType,
this.messageUrl});
Hospital.fromJson(Map<String, dynamic> json) { Hospital.fromJson(Map<String, dynamic> json) {
portrait = json['portrait']; portrait = json['portrait'];
hosiptalId = json['hosiptal_id'];
name = json['name']; name = json['name'];
minPrice = json['min_price']; minPrice = json['min_price'];
maxPrice = json['max_price']; maxPrice = json['max_price'];
...@@ -198,6 +230,7 @@ class Hospital { ...@@ -198,6 +230,7 @@ class Hospital {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['portrait'] = this.portrait; data['portrait'] = this.portrait;
data['hosiptal_id'] = this.hosiptalId;
data['name'] = this.name; data['name'] = this.name;
data['min_price'] = this.minPrice; data['min_price'] = this.minPrice;
data['max_price'] = this.maxPrice; data['max_price'] = this.maxPrice;
...@@ -219,7 +252,15 @@ class Doctor { ...@@ -219,7 +252,15 @@ class Doctor {
String consultType; String consultType;
String messageUrl; String messageUrl;
Doctor({this.portrait, this.name, this.minPrice, this.maxPrice, this.star, this.title, this.consultType, this.messageUrl}); Doctor(
{this.portrait,
this.name,
this.minPrice,
this.maxPrice,
this.star,
this.title,
this.consultType,
this.messageUrl});
Doctor.fromJson(Map<String, dynamic> json) { Doctor.fromJson(Map<String, dynamic> json) {
portrait = json['portrait']; portrait = json['portrait'];
...@@ -285,7 +326,44 @@ class Diary { ...@@ -285,7 +326,44 @@ class Diary {
UserLevel userLevel; UserLevel userLevel;
int serviceId; int serviceId;
Diary({this.diaryNum, this.videoUrl, this.isIdentification, this.isLiked, this.titleStyleType, this.replyNum, this.lasestTopicCreatedTime, this.images, this.relationServiceSku, this.createdTime, this.latestTopicId, this.id, this.city, this.userId, this.title, this.isVoted, this.diaryId, this.preImageList, this.voteNum, this.tagsNewEra, this.content, this.videoPic, this.shortVideoUrl, this.diaryAmount, this.diaryTitle, this.authorType, this.tags, this.contentLevel, this.lastModified, this.user, this.isOnline, this.date, this.membershipLevel, this.viewNum, this.postImageList, this.userLevel, this.serviceId}); Diary(
{this.diaryNum,
this.videoUrl,
this.isIdentification,
this.isLiked,
this.titleStyleType,
this.replyNum,
this.lasestTopicCreatedTime,
this.images,
this.relationServiceSku,
this.createdTime,
this.latestTopicId,
this.id,
this.city,
this.userId,
this.title,
this.isVoted,
this.diaryId,
this.preImageList,
this.voteNum,
this.tagsNewEra,
this.content,
this.videoPic,
this.shortVideoUrl,
this.diaryAmount,
this.diaryTitle,
this.authorType,
this.tags,
this.contentLevel,
this.lastModified,
this.user,
this.isOnline,
this.date,
this.membershipLevel,
this.viewNum,
this.postImageList,
this.userLevel,
this.serviceId});
Diary.fromJson(Map<String, dynamic> json) { Diary.fromJson(Map<String, dynamic> json) {
diaryNum = json['diary_num']; diaryNum = json['diary_num'];
...@@ -297,9 +375,13 @@ class Diary { ...@@ -297,9 +375,13 @@ class Diary {
lasestTopicCreatedTime = json['lasest_topic_created_time']; lasestTopicCreatedTime = json['lasest_topic_created_time'];
if (json['images'] != null) { if (json['images'] != null) {
images = new List<Images>(); images = new List<Images>();
json['images'].forEach((v) { images.add(new Images.fromJson(v)); }); json['images'].forEach((v) {
images.add(new Images.fromJson(v));
});
} }
relationServiceSku = json['relation_service_sku'] != null ? new UserType.fromJson(json['relation_service_sku']) : null; relationServiceSku = json['relation_service_sku'] != null
? new UserType.fromJson(json['relation_service_sku'])
: null;
createdTime = json['created_time']; createdTime = json['created_time'];
latestTopicId = json['latest_topic_id']; latestTopicId = json['latest_topic_id'];
id = json['id']; id = json['id'];
...@@ -312,7 +394,9 @@ class Diary { ...@@ -312,7 +394,9 @@ class Diary {
voteNum = json['vote_num']; voteNum = json['vote_num'];
if (json['tags_new_era'] != null) { if (json['tags_new_era'] != null) {
tagsNewEra = new List<TagsNewEra>(); tagsNewEra = new List<TagsNewEra>();
json['tags_new_era'].forEach((v) { tagsNewEra.add(new TagsNewEra.fromJson(v)); }); json['tags_new_era'].forEach((v) {
tagsNewEra.add(new TagsNewEra.fromJson(v));
});
} }
content = json['content']; content = json['content'];
videoPic = json['video_pic']; videoPic = json['video_pic'];
...@@ -322,7 +406,9 @@ class Diary { ...@@ -322,7 +406,9 @@ class Diary {
authorType = json['author_type']; authorType = json['author_type'];
if (json['tags'] != null) { if (json['tags'] != null) {
tags = new List<Tags>(); tags = new List<Tags>();
json['tags'].forEach((v) { tags.add(new Tags.fromJson(v)); }); json['tags'].forEach((v) {
tags.add(new Tags.fromJson(v));
});
} }
contentLevel = json['content_level']; contentLevel = json['content_level'];
lastModified = json['last_modified']; lastModified = json['last_modified'];
...@@ -332,7 +418,9 @@ class Diary { ...@@ -332,7 +418,9 @@ class Diary {
membershipLevel = json['membership_level']; membershipLevel = json['membership_level'];
viewNum = json['view_num']; viewNum = json['view_num'];
postImageList = json['post_image_list'].cast<String>(); postImageList = json['post_image_list'].cast<String>();
userLevel = json['user_level'] != null ? new UserLevel.fromJson(json['user_level']) : null; userLevel = json['user_level'] != null
? new UserLevel.fromJson(json['user_level'])
: null;
serviceId = json['service_id']; serviceId = json['service_id'];
} }
...@@ -402,7 +490,16 @@ class Images { ...@@ -402,7 +490,16 @@ class Images {
String imageHalf; String imageHalf;
String desc; String desc;
Images({this.imageWide, this.imageType, this.image, this.sImagePlatform, this.imageSlimwidth, this.smallWide, this.imageThumb, this.imageHalf, this.desc}); Images(
{this.imageWide,
this.imageType,
this.image,
this.sImagePlatform,
this.imageSlimwidth,
this.smallWide,
this.imageThumb,
this.imageHalf,
this.desc});
Images.fromJson(Map<String, dynamic> json) { Images.fromJson(Map<String, dynamic> json) {
imageWide = json['image_wide']; imageWide = json['image_wide'];
...@@ -465,7 +562,14 @@ class User { ...@@ -465,7 +562,14 @@ class User {
String userName; String userName;
String membershipLevel; String membershipLevel;
User({this.city, this.userId, this.topicNumPosted, this.voteNumGained, this.portrait, this.userName, this.membershipLevel}); User(
{this.city,
this.userId,
this.topicNumPosted,
this.voteNumGained,
this.portrait,
this.userName,
this.membershipLevel});
User.fromJson(Map<String, dynamic> json) { User.fromJson(Map<String, dynamic> json) {
city = json['city']; city = json['city'];
...@@ -536,4 +640,3 @@ class Tags { ...@@ -536,4 +640,3 @@ class Tags {
return data; return data;
} }
} }
...@@ -36,7 +36,7 @@ class TestState extends BaseState<TestPage> { ...@@ -36,7 +36,7 @@ class TestState extends BaseState<TestPage> {
list.add(listItem("二级列表页", () { list.add(listItem("二级列表页", () {
RouterCenterImpl() RouterCenterImpl()
.findMainRouter() .findMainRouter()
.jumpPage(context, "level_two_plan_deatil", {"planId": 137}, false); .jumpPage(context, "level_two_plan_deatil", {"planId": 192}, false);
})); }));
list.add(listItem("项目首页", () { list.add(listItem("项目首页", () {
RouterCenterImpl() RouterCenterImpl()
......
...@@ -4,18 +4,11 @@ ...@@ -4,18 +4,11 @@
**/ **/
import 'package:app_settings/app_settings.dart'; import 'package:app_settings/app_settings.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_common/commonModel/eventbus/GlobalEventBus.dart';
import 'package:flutter_common/commonModel/live/LiveData.dart'; import 'package:flutter_common/commonModel/live/LiveData.dart';
import 'package:flutter_common/commonModel/view/iOSLoading.dart';
import 'package:flutter_svg/svg.dart';
import 'package:gm_flutter/commonModel/GMBase.dart';
import 'package:gm_flutter/commonModel/bean/Pair.dart'; import 'package:gm_flutter/commonModel/bean/Pair.dart';
import 'package:gm_flutter/commonModel/util/DartUtil.dart'; import 'package:gm_flutter/commonModel/util/DartUtil.dart';
import 'package:gm_flutter/commonModel/view/ImagesAnimation.dart';
import 'package:gm_flutter/commonModel/view/baseRefreshIndicator.dart';
import 'package:gm_flutter/commonModel/view/baseTabIndicator.dart'; import 'package:gm_flutter/commonModel/view/baseTabIndicator.dart';
import 'package:lottie/lottie.dart'; import 'package:lottie/lottie.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
...@@ -71,7 +64,7 @@ AppBar _baseAppBarChangeTitle( ...@@ -71,7 +64,7 @@ AppBar _baseAppBarChangeTitle(
tag: "left_arrow", tag: "left_arrow",
child: Container( child: Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 7),
child: Container( child: Container(
width: 30, width: 30,
height: 30, height: 30,
...@@ -86,9 +79,14 @@ AppBar _baseAppBarChangeTitle( ...@@ -86,9 +79,14 @@ AppBar _baseAppBarChangeTitle(
); );
} }
Text baseText(String text, double fontSize, Color color, {bool bold = false}) { Text baseText(String text, double fontSize, Color color,
{bool bold = false,
TextAlign textAlign,
int maxLines = 1,
TextOverflow overflow}) {
return Text( return Text(
text, text,
textAlign: textAlign ?? TextAlign.start,
textScaleFactor: 1.0, textScaleFactor: 1.0,
style: TextStyle( style: TextStyle(
decoration: TextDecoration.none, decoration: TextDecoration.none,
...@@ -96,6 +94,8 @@ Text baseText(String text, double fontSize, Color color, {bool bold = false}) { ...@@ -96,6 +94,8 @@ Text baseText(String text, double fontSize, Color color, {bool bold = false}) {
color: color, color: color,
fontStyle: FontStyle.normal, fontStyle: FontStyle.normal,
fontWeight: bold ? FontWeight.w500 : FontWeight.w400), fontWeight: bold ? FontWeight.w500 : FontWeight.w400),
maxLines: maxLines,
overflow: overflow == null ? TextOverflow.ellipsis : overflow,
); );
} }
...@@ -474,8 +474,8 @@ Widget baseSliverAppBar(String url, ...@@ -474,8 +474,8 @@ Widget baseSliverAppBar(String url,
Widget baseSliverBack(VoidCallback tap) { Widget baseSliverBack(VoidCallback tap) {
return Positioned( return Positioned(
top: 49, top: 40,
left: 15, left: 7,
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: tap, onTap: tap,
...@@ -485,11 +485,9 @@ Widget baseSliverBack(VoidCallback tap) { ...@@ -485,11 +485,9 @@ Widget baseSliverBack(VoidCallback tap) {
decoration: decoration:
BoxDecoration(color: Color(0x99FFFFFF), shape: BoxShape.circle), BoxDecoration(color: Color(0x99FFFFFF), shape: BoxShape.circle),
alignment: Alignment.center, alignment: Alignment.center,
child: Hero( child: Container(
tag: "left_arrow", child: Image.asset("assets/left_arrow.png"),
child: Container( ),
child: Image.asset("assets/left_arrow.png"),
)),
)), )),
); );
} }
......
...@@ -19,7 +19,7 @@ const String APP_HOST_RELEASE = "https://x6cgr5y5-gengmei.mock.coding.io"; ...@@ -19,7 +19,7 @@ const String APP_HOST_RELEASE = "https://x6cgr5y5-gengmei.mock.coding.io";
*/ */
//const String APP_HOST_DEBUG = "http://backend.paas-merchant.envs"; //const String APP_HOST_DEBUG = "http://backend.paas-merchant.envs";
//const String APP_HOST_DEBUG = "http://doctor.paas-merchant.env"; //const String APP_HOST_DEBUG = "http://doctor.paas-merchant.env";
//const String APP_HOST_DEBUG = "https://x6cgr5y5-gengmei.mock.coding.io"; // const String APP_HOST_DEBUG = "https://x6cgr5y5-gengmei.mock.coding.io";
const String APP_HOST_DEBUG = "http://backend.paas-merchant.env"; const String APP_HOST_DEBUG = "http://backend.paas-merchant.env";
//const String APP_HOST_DEBUG = "http://janus.paas-merchant.env"; //const String APP_HOST_DEBUG = "http://janus.paas-merchant.env";
......
...@@ -46,14 +46,14 @@ class DioUtil { ...@@ -46,14 +46,14 @@ class DioUtil {
DioCookieManager.getInstance().clearCookie(); DioCookieManager.getInstance().clearCookie();
} }
void setProxy(String proxy) { void setProxy(String proxy, {String port}) {
_dio = new Dio(_options); _dio = new Dio(_options);
_dio.interceptors.add(DioInterceptorManager.getInstance().getIntercept()); _dio.interceptors.add(DioInterceptorManager.getInstance().getIntercept());
_dio.interceptors.add(DioCookieManager.getInstance().getCookieManager()); _dio.interceptors.add(DioCookieManager.getInstance().getCookieManager());
(_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate =
(client) { (client) {
client.findProxy = (url) { client.findProxy = (url) {
return 'PROXY $proxy:8888'; return 'PROXY $proxy:${port??8888}';
}; };
}; };
} }
......
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