Commit 05fdeeeb authored by 林生雨's avatar 林生雨

w

parent b1742a37
......@@ -319,9 +319,10 @@ class LevelOneState extends BaseState<LevelOnePage>
child: baseText(
"${(_model.planoverItem.positiveRate.contains(".") ? _model.planoverItem.positiveRate.split(".")[0] : _model.planoverItem.positiveRate).replaceAll("%", "")}",
20,
Color(0xffFF5963)),
Color(0xffFF5963),
bold: true),
),
baseText("%", 11, Color(0xffFF5963)),
baseText("%", 10, Color(0xffFF5963)),
],
),
),
......@@ -329,7 +330,9 @@ class LevelOneState extends BaseState<LevelOnePage>
right: 15,
bottom: 8,
child: baseText(
"销量${NumPlanUtil.getSale(_model.planoverItem.salesCount)}", 11, Color(0xff666666)),
"销量${NumPlanUtil.getSale(_model.planoverItem.salesCount)}",
11,
Color(0xff666666)),
)
],
),
......@@ -364,7 +367,7 @@ class LevelOneState extends BaseState<LevelOnePage>
fontSize: 14,
color: Color(0xff282828),
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400),
fontWeight: FontWeight.w500),
),
),
Container(
......@@ -413,7 +416,8 @@ class LevelOneState extends BaseState<LevelOnePage>
Widget explain() {
List<Widget> list = [];
list.add(Container(
height: 31,
height: 18,
margin: EdgeInsets.only(top: 0, bottom: 10),
child: Row(
children: <Widget>[
baseText("项目说明", 15, Color(0xff282828)),
......@@ -435,9 +439,13 @@ class LevelOneState extends BaseState<LevelOnePage>
),
));
if (_model.planoverItem != null) {
int index = 0;
_model.planoverItem.explanationAttrs.forEach((element) {
list.add(Container(
margin: EdgeInsets.only(bottom: 15),
margin: EdgeInsets.only(
bottom: index == _model.planoverItem.explanationAttrs.length - 1
? 0
: 15),
child: Row(
children: <Widget>[
Container(
......
......@@ -56,23 +56,6 @@ class FilterViewState extends State<FilterView> {
height: 186,
child: Stack(
children: <Widget>[
Positioned(
bottom: 74.5,
left: 0,
child: Container(
width: MediaQuery.of(context).size.width,
child: PlanProgressBar(
widget.low,
widget.high,
0,
20010,
widget.call,
lowLive,
highLive,
padding: 15,
),
),
),
Positioned(
top: 54.5,
right: 15,
......@@ -113,7 +96,8 @@ class FilterViewState extends State<FilterView> {
child: baseText("重置", 16, Color(0xff3FB5AF)),
alignment: Alignment.center,
).gestureDetector(() {
SimpleEventBus.instance().notifyListener("FilterViewState", "reset");
SimpleEventBus.instance()
.notifyListener("FilterViewState", "reset");
}),
),
Expanded(
......@@ -129,7 +113,32 @@ class FilterViewState extends State<FilterView> {
],
),
),
)
),
Positioned(
bottom: 44.5,
child: Container(
width: MediaQuery.of(context).size.width,
height: 0.5,
color: Color(0xff51CDC7),
),
),
Positioned(
bottom: 74.5,
left: 0,
child: Container(
width: MediaQuery.of(context).size.width,
child: PlanProgressBar(
widget.low,
widget.high,
0,
20010,
widget.call,
lowLive,
highLive,
padding: 15,
),
),
),
],
),
);
......
......@@ -20,130 +20,154 @@ class PlanItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
StringBuffer stringBuffer = StringBuffer();
List<Widget> list = [];
int i = 0;
plans.baseAttrs.forEach((element) {
stringBuffer.write(element);
list.add(baseText("${element}", 11, Color(0xff999999)));
if (i != plans.baseAttrs.length - 1) {
stringBuffer.write("|");
list.add(Container(
width: 8.5,
height: 8,
alignment: Alignment.center,
child: Container(
width: 0.5,
height: 8,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(0.5),
color: Color(0xff999999)),
),
));
}
i++;
});
String rate = plans.positiveRate;
if (rate != null && rate.contains(".")) {
rate = rate.split(".")[0];
}
rate = rate.replaceAll("%", "");
return Container(
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
child: Container(
height: 90,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(4)),
child: Stack(
children: <Widget>[
Positioned(
top: 10,
left: 10,
child: Container(
width: 70,
height: 70,
child: ClipRRect(
borderRadius: BorderRadius.circular(4),
child: CachedNetworkImage(
imageUrl: plans.projectImage,
fit: BoxFit.cover,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
child: Card(
elevation: 1.0,
child: Container(
height: 90,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(4)),
child: Stack(
children: <Widget>[
Positioned(
top: 10,
left: 10,
child: Container(
width: 70,
height: 70,
child: ClipRRect(
borderRadius: BorderRadius.circular(4),
child: CachedNetworkImage(
imageUrl: plans.projectImage,
fit: BoxFit.cover,
),
),
),
),
),
),
Positioned(
left: 92,
top: 14,
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
baseText(plans.name, 14, Color(0xff282828)),
Container(
margin: EdgeInsets.only(left: 4),
child: Container(
width: 28,
height: 15,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0xffF0F9F7)),
alignment: Alignment.center,
child: baseText("??", 11, Color(0xff3FB5AF)),
),
)
],
),
),
Positioned(
top: 13,
right: 10,
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
baseText("好评率", 11, Color(0xff282828)),
Container(
width: 4,
Positioned(
left: 92,
top: 14,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
baseText(plans.name, 14, Color(0xff282828), bold: true),
Container(
margin: EdgeInsets.only(left: 4),
child: Container(
width: 28,
height: 15,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0xffF0F9F7)),
alignment: Alignment.center,
child:
baseText("??", 11, Color(0xff3FB5AF), bold: true),
),
)
],
),
baseText("${rate}", 14, Color(0xffFF5963)),
baseText("%", 11, Color(0xffFF5963)),
],
),
),
Positioned(
bottom: 14,
right: 10,
child: baseText("销量${NumPlanUtil.getSale(plans.salesCount)}", 11, Color(0xff282828)),
),
Positioned(
left: 91,
bottom: 14,
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
baseText("¥", 10, Color(0xffFF5963)),
baseText("${plans.minPrice}-${plans.maxPrice}", 13,
Color(0xffFF5963)),
],
),
),
Positioned(
top: 14,
right: 10,
child: Row(
mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.end,
verticalDirection: VerticalDirection.down,
children: <Widget>[
baseText("好评率", 11, Color(0xff282828)),
Container(
width: 4,
),
baseText("${rate}", 14, Color(0xffFF5963)),
baseText("%", 10, Color(0xffFF5963)),
],
),
),
Positioned(
bottom: 14,
right: 10,
child: baseText("销量${NumPlanUtil.getSale(plans.salesCount)}",
11, Color(0xff282828)),
),
Positioned(
left: 91,
bottom: 14,
child: Row(
verticalDirection: VerticalDirection.down,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
baseText("¥", 10, Color(0xffFF5963)),
baseText("${plans.minPrice}-${plans.maxPrice}", 13,
Color(0xffFF5963),
bold: true),
],
),
),
Positioned(
left: 92,
top: 36,
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: list,
),
)
],
),
Positioned(
left: 92,
top: 36,
child:
baseText("${stringBuffer.toString()}", 11, Color(0xff999999)),
)
],
),
),
).gestureDetector(() {
Map<String, dynamic> map;
if (isPlanPage) {
map = {
"page_name": "plan_home",
"tab_name": "plan_home",
"referrer_id": "",
"referrer": "",
"position": pos,
"business_id": "",
"card_id": plans.id,
"card_type": "card",
"transaction_type": "",
"card_content_type": "level_one_plan"
};
}
),
).gestureDetector(() {
Map<String, dynamic> map;
if (isPlanPage) {
map = {
"page_name": "plan_home",
"tab_name": "plan_home",
"referrer_id": "",
"referrer": "",
"position": pos,
"business_id": "",
"card_id": plans.id,
"card_type": "card",
"transaction_type": "",
"card_content_type": "level_one_plan"
};
}
RouterCenterImpl().findMainRouter().buriedEvent("on_click_card", map);
RouterCenterImpl().findMainRouter().jumpPage(
context,
"level_one_plan_detail",
{"planId": plans.id, "title": "${plans.name}"},
false);
});
RouterCenterImpl().findMainRouter().buriedEvent("on_click_card", map);
RouterCenterImpl().findMainRouter().jumpPage(
context,
"level_one_plan_detail",
{"planId": plans.id, "title": "${plans.name}"},
false);
}));
}
}
......@@ -90,20 +90,30 @@ class PlanModel extends BaseModel {
event.data.tags[0].subtags != null &&
event.data.tags[0].subtags.length > 0) {
tag_id = "${event.data.tags[0].subtags[0].tagId}";
PlanModelInstance.getInstance().tag_id = tag_id;
normalData[0] = "${event.data.tags[0].subtags[0].name}";
}
sortList = event.data.orders;
order_by = "${sortList[0].id}";
PlanModelInstance.getInstance().order_by = order_by;
min_price = "0";
max_price = "100000000";
PlanModelInstance.getInstance().min_price = min_price;
PlanModelInstance.getInstance().max_price = max_price;
low = 0;
projectSelectIndex = 0;
PlanModelInstance.getInstance().projectSelectIndex = projectSelectIndex;
high = 20100;
sortPos = 0;
picLive.notifyView(event.data.ranks);
stateLive.notifyView(ENDLOADING);
normalData[1] = event.data.orders[0].name;
PlanModelInstance.getInstance().normalData.clear();
PlanModelInstance.getInstance().normalData.addAll(normalData);
managerLive.notifyView(normalData);
PlanModelInstance.getInstance().low = low;
PlanModelInstance.getInstance().high = high;
PlanModelInstance.getInstance().sortPos = sortPos;
if (call != null) {
SimpleEventBus.instance().notifyListener("FilterViewState", "reset");
SimpleEventBus.instance().notifyListener("ProjectViewState", "reset");
......@@ -129,9 +139,13 @@ class PlanModel extends BaseModel {
return;
}
projectSelectIndex = index;
PlanModelInstance.getInstance().projectSelectIndex = projectSelectIndex;
normalData[0] = name;
PlanModelInstance.getInstance().normalData.clear();
PlanModelInstance.getInstance().normalData.addAll(normalData);
managerLive.notifyView(normalData);
tag_id = id;
PlanModelInstance.getInstance().tag_id = tag_id;
feedsLive.notifyView(Pair(LOADING, null));
refreshFeed(true);
}
......@@ -195,16 +209,6 @@ class PlanModel extends BaseModel {
@override
void dispose() {
PlanModelInstance.getInstance().normalData.clear();
PlanModelInstance.getInstance().normalData.addAll(normalData);
PlanModelInstance.getInstance().tag_id = tag_id;
PlanModelInstance.getInstance().projectSelectIndex = projectSelectIndex;
PlanModelInstance.getInstance().order_by = order_by;
PlanModelInstance.getInstance().min_price = min_price;
PlanModelInstance.getInstance().max_price = max_price;
PlanModelInstance.getInstance().sortPos = sortPos;
PlanModelInstance.getInstance().low = low;
PlanModelInstance.getInstance().high = high;
stateLive.dispost();
picLive.dispost();
rxDispose.dispose();
......@@ -213,6 +217,7 @@ class PlanModel extends BaseModel {
backLive.dispost();
feedsLive.dispost();
showTab.dispost();
print("LSY PLAN DISPOSE");
}
void backProgress(double pro, int index) {
......@@ -231,8 +236,12 @@ class PlanModel extends BaseModel {
return;
}
sortPos = index;
PlanModelInstance.getInstance().sortPos = sortPos;
order_by = sortList[index].id.toString();
PlanModelInstance.getInstance().order_by = order_by;
normalData[1] = "${sortList[index].name}";
PlanModelInstance.getInstance().normalData.clear();
PlanModelInstance.getInstance().normalData.addAll(normalData);
managerLive.notifyView(normalData);
feedsLive.notifyView(Pair(LOADING, null));
refreshFeed(true);
......@@ -247,8 +256,12 @@ class PlanModel extends BaseModel {
if (max > 20000) {
max = 20000000;
}
PlanModelInstance.getInstance().low = low;
PlanModelInstance.getInstance().high = high;
max_price = "${max}";
min_price = "${min}";
PlanModelInstance.getInstance().min_price = min_price;
PlanModelInstance.getInstance().max_price = max_price;
feedsLive.notifyView(Pair(LOADING, null));
refreshFeed(true);
}
......
......@@ -183,9 +183,11 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
width: MediaQuery.of(context).size.width,
maxHeight: 450,
listener: projectMenuListener,
child: ProjectView(_model.projectSelectIndex,_model.projectData, (id, name,index) {
child:
ProjectView(_model.projectSelectIndex, _model.projectData,
(id, name, index) {
clickIndexOther(0);
_model.projectClick(id, name,index);
_model.projectClick(id, name, index);
}),
proListener: (pro) {
_model.backProgress(pro, 0);
......@@ -200,7 +202,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
leftPos: data.data[0],
topPos: data.data[1],
width: MediaQuery.of(context).size.width,
maxHeight: 272,
maxHeight: 45*_model.sortList.length,
listener: sortMenuListener,
child: SortView(_model.sortList, _model.sortPos, (index) {
clickIndexOther(1);
......@@ -422,7 +424,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
Widget towPic() {
return Container(
height: 90,
margin: EdgeInsets.only(left: 15, right: 15, top: 15, bottom: 10),
margin: EdgeInsets.only(left: 15, right: 15, top: 15, bottom: 0),
child: Row(
children: <Widget>[
Expanded(
......@@ -487,7 +489,17 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
Widget planBar() {
return Container(
color: Colors.white,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.black12,
offset: Offset(0.0, 1.0), //阴影xy轴偏移量
blurRadius: 1.0, //阴影模糊程度
spreadRadius: 1.0 //阴影扩散程度
)
],
color: Colors.white,
),
key: globalKey,
child: planBarView,
);
......
......@@ -58,6 +58,8 @@ class PlanProgressBarState extends State<PlanProgressBar> {
if (str == "sure") {
widget.call(high, low);
} else {
low = 0;
high = 20100;
widget.low = 0;
widget.high = 20100;
init();
......@@ -106,9 +108,9 @@ class PlanProgressBarState extends State<PlanProgressBar> {
widget.highLive.notifyView(textStr);
}
double textWidth = textStr.length * 12.0;
double textWidth = textStr.length * 12.0+6;
if (textStr == "无限") {
textWidth = textStr.length * 14.0;
textWidth = textStr.length * 14.0+12;
}
double textL = textLeft * totle - textWidth / 2 + 9;
......@@ -157,9 +159,12 @@ class PlanProgressBarState extends State<PlanProgressBar> {
Container(
width: textWidth,
height: 37,
decoration: BoxDecoration(
color: Color(0x99000000),
borderRadius: BorderRadius.circular(6),
color: Colors.white,
child: Container(
decoration: BoxDecoration(
color: Color(0x99000000),
borderRadius: BorderRadius.circular(6),
),
),
),
Positioned(
......@@ -173,7 +178,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
),
),
Positioned(
top: 12,
top: 10,
child: Container(
width: textWidth,
alignment: Alignment.topCenter,
......@@ -210,6 +215,11 @@ class PlanProgressBarState extends State<PlanProgressBar> {
leftStarPosPercent = leftPosTempPercent;
setState(() {});
},
onPointerCancel: (p){
textLeft = -1;
leftStarPosPercent = leftPosTempPercent;
setState(() {});
},
child: Container(
width: 19,
height: 19,
......@@ -244,6 +254,11 @@ class PlanProgressBarState extends State<PlanProgressBar> {
rightStarPosPercent = rightPosTempPercent;
setState(() {});
},
onPointerCancel: (p){
textLeft = -1;
rightStarPosPercent = rightPosTempPercent;
setState(() {});
},
child: Container(
width: 19,
height: 19,
......
......@@ -426,19 +426,33 @@ Widget emptyItem(double width, double height,
Widget baseTabBar(
TabController controller, List<Widget> list, Function(int index) clickItem,
{BaseIndicator baseIndicator, double fontSize, Color color, bool scroll}) {
return TabBar(
onTap: clickItem,
controller: controller,
indicatorSize: TabBarIndicatorSize.tab,
isScrollable: scroll ?? true,
unselectedLabelColor: color ?? Color(0xffB5B5B5),
labelColor: color ?? Color(0xff282828),
labelStyle: TextStyle(fontSize: fontSize ?? 16),
unselectedLabelStyle: TextStyle(fontSize: fontSize ?? 16),
labelPadding: EdgeInsets.only(),
indicator: baseIndicator ?? BaseIndicator(),
tabs: list,
);
return Container(
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black12,
offset: Offset(0.0, 1.0), //阴影xy轴偏移量
blurRadius: 1.0, //阴影模糊程度
spreadRadius: 1.0 //阴影扩散程度
)
],
),
child: TabBar(
onTap: clickItem,
controller: controller,
indicatorSize: TabBarIndicatorSize.tab,
isScrollable: scroll ?? true,
unselectedLabelColor: color ?? Color(0xffB5B5B5),
labelColor: color ?? Color(0xff282828),
labelStyle:
TextStyle(fontSize: fontSize ?? 16, fontWeight: FontWeight.w500),
unselectedLabelStyle:
TextStyle(fontSize: fontSize ?? 16, fontWeight: FontWeight.w500),
labelPadding: EdgeInsets.only(),
indicator: baseIndicator ?? BaseIndicator(),
tabs: list,
));
}
Widget baseTabBarItem(String text,
......@@ -500,7 +514,7 @@ Widget baseSliverBack(VoidCallback tap) {
Widget baseSliverTitle(String text, double width, LiveData liveData) {
return Positioned(
top: 48,
top: 42,
child: StreamBuilder(
stream: liveData.stream,
initialData: liveData.data ?? 0.0,
......
......@@ -271,8 +271,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: de509ebaf4724de7c70d05ea403dbe13ecc775ea
resolved-ref: de509ebaf4724de7c70d05ea403dbe13ecc775ea
ref: "8175a0900ac0244040289488b86c5a98c45b0e94"
resolved-ref: "8175a0900ac0244040289488b86c5a98c45b0e94"
url: "https://github.com/asd451398533/flutter_common.git"
source: git
version: "0.0.1"
......
......@@ -17,7 +17,7 @@ dependencies:
flutter_common:
git:
url: 'https://github.com/asd451398533/flutter_common.git'
ref: 'de509ebaf4724de7c70d05ea403dbe13ecc775ea'
ref: '8175a0900ac0244040289488b86c5a98c45b0e94'
#网络库
dio: ^3.0.0
dio_cookie_manager: ^1.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