Commit 9a71c9e9 authored by 林生雨's avatar 林生雨

w

parent 1c22b115
......@@ -267,11 +267,11 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
return Container(
height: 170,
child: Stack(children: <Widget>[
// Positioned(
// right: 20,
// top: 0,
// child: baseText(plan.positiveRate, 21, Color(0xff3FB5AF),
// bold: true)),
Positioned(
right: 20,
top: 0,
child: baseText(plan.positiveRate, 21, Color(0xff3FB5AF),
bold: true)),
Positioned(
right: 20,
top: 24,
......@@ -280,14 +280,18 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
Positioned(
right: 20,
top: 46,
child: FiveStarView(3, 5,
starAssets: 'assets/plan_compare_detail_green_star_all.png'),
),
// Positioned(
// right: 20,
// top: 84,
// child: baseText(plan.salesCount, 21, Color(0xff3FB5AF), bold: true),
// ),
child: FiveStarView(
plan.planStart,
5,
starAssets: 'assets/plan_compare_detail_green_star_all.png',
isForward: true,
),
),
Positioned(
right: 20,
top: 84,
child: baseText(plan.salesCount, 21, Color(0xff3FB5AF), bold: true),
),
Positioned(
right: 20,
top: 108,
......@@ -333,11 +337,11 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
return Container(
height: 170,
child: Stack(children: <Widget>[
// Positioned(
// left: 20,
// top: 0,
// child: baseText(plan.positiveRate, 21, Color(0xffF25874),
// bold: true)),
Positioned(
left: 20,
top: 0,
child: baseText(plan.positiveRate, 21, Color(0xffF25874),
bold: true)),
Positioned(
left: 20,
top: 24,
......@@ -350,16 +354,16 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
height: 13,
width: 81,
child: FiveStarView(
3,
plan.planStart,
5,
starAssets: 'assets/plan_compare_detail_red_star_all.png',
),
)),
// Positioned(
// left: 20,
// top: 84,
// child: baseText(plan.salesCount, 21, Color(0xffF25874), bold: true),
// ),
Positioned(
left: 20,
top: 84,
child: baseText(plan.salesCount, 21, Color(0xffF25874), bold: true),
),
Positioned(
left: 20,
top: 108,
......@@ -477,12 +481,12 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
double sellCount(int index, Plans anotherPlans) {
Groups popularity = _model.detailLive.data.second[0];
Plans plans = popularity.plans[index];
// int salesCount = int.parse(plans.salesCount);
// int anSalesCount = int.parse(plans.salesCount);
// if (salesCount >= anSalesCount) {
// return 1.0;
// } else {
// return anSalesCount / salesCount;
// }
int salesCount = int.parse(plans.salesCount);
int anSalesCount = int.parse(plans.salesCount);
if (salesCount >= anSalesCount) {
return 1.0;
} else {
return anSalesCount / salesCount;
}
}
}
......@@ -48,6 +48,8 @@ class _PlansCompareFeedItemViewState
}
getFirstLevelItem() {
String price =
NumPlanUtil.getPrice(widget.plan.minPrice, widget.plan.maxPrice);
return Container(
width: double.maxFinite,
height: 80,
......@@ -109,10 +111,19 @@ class _PlansCompareFeedItemViewState
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
baseText('¥${widget.plan.minPrice}-${widget.plan.maxPrice}',
13, Color(0xFFFF5963)),
price == "暂无报价"
? Container(
width: 0,
height: 0,
)
: baseText("¥", 12, Color(0xFFFF5963)),
baseText(price, price == "暂无报价" ? 13 : 15,
price == "暂无报价" ? Color(0xFF666666) : Color(0xFFFF5963),
bold: price != "暂无报价"),
Expanded(
child: Container(),
),
baseText(
"销量${widget.plan.salesCount}", 11, Color(0xFF666666))
],
......
......@@ -138,11 +138,17 @@ class Groups {
class Plans {
int planId;
List<Attrs> attrs;
String positiveRate;
String salesCount;
int planStart;
Plans({this.planId, this.attrs});
Plans.fromJson(Map<String, dynamic> json) {
planId = json['plan_id'];
positiveRate = json['positive_rate'];
salesCount = json['sales_count'];
planStart = json['plan_start'];
if (json['attrs'] != null) {
attrs = new List<Attrs>();
json['attrs'].forEach((v) {
......@@ -154,6 +160,9 @@ class Plans {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['plan_id'] = this.planId;
data['positive_rate'] = this.positiveRate;
data['sales_count'] = this.salesCount;
data['plan_start'] = this.planStart;
if (this.attrs != null) {
data['attrs'] = this.attrs.map((v) => v.toJson()).toList();
}
......
......@@ -8,20 +8,55 @@ class FiveStarView extends StatelessWidget {
final int allStarCount;
final int lightStarCount;
String starAssets;
bool isForward = false;
FiveStarView(this.lightStarCount, this.allStarCount, {this.starAssets});
FiveStarView(this.lightStarCount, this.allStarCount,
{this.starAssets, this.isForward}) {
if (isForward == null) {
isForward = false;
}
}
@override
Widget build(BuildContext context) {
List<Widget> list = new List();
if (isForward) {
for (int i = 0; i < allStarCount; i++) {
if (i >= allStarCount - lightStarCount) {
list.add(Container(
height: 13,
width: 13,
child: Image.asset(starAssets ?? "assets/sel_star.png"),
));
if (i != allStarCount - 1) {
list.add(Container(
height: 1,
width: 2,
));
}
} else {
list.add(Container(
height: 13,
width: 13,
child: Image.asset("assets/normal_star.png"),
));
if (i != allStarCount - 1) {
list.add(Container(
height: 1,
width: 2,
));
}
}
}
} else {
for (int i = 0; i < allStarCount; i++) {
if (i <= lightStarCount) {
if (i < lightStarCount) {
list.add(Container(
height: 13,
width: 13,
child: Image.asset(starAssets ?? "assets/sel_star.png"),
));
if ( i != allStarCount - 1) {
if (i != allStarCount - 1) {
list.add(Container(
height: 1,
width: 2,
......@@ -33,7 +68,7 @@ class FiveStarView extends StatelessWidget {
width: 13,
child: Image.asset("assets/normal_star.png"),
));
if ( i != allStarCount - 1) {
if (i != allStarCount - 1) {
list.add(Container(
height: 1,
width: 2,
......@@ -41,6 +76,7 @@ class FiveStarView extends StatelessWidget {
}
}
}
}
return Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
......
......@@ -15,11 +15,14 @@ abstract class MainRouter extends RouterBaser {
void buriedEvent(String name, Map<String, dynamic> map);
void jumpPage(BuildContext context,String pageName, Map<String, dynamic> params,bool nativePage);
void jumpPage(BuildContext context, String pageName,
Map<String, dynamic> params, bool nativePage);
Widget getProxyPage();
void catchErrorToBugly(String err);
bool isWithNative();
void jumpToSetting();
}
......@@ -47,4 +47,9 @@ class MainRouterImpl implements MainRouter {
bool isWithNative() {
return MainManager.getInstance().isInit;
}
@override
void jumpToSetting() {
MainManager.getInstance().jumpToSetting();
}
}
......@@ -118,21 +118,12 @@ class MainManager {
}
}
void getInitParams(VoidCallback callback) {
if (isInit) {
if (flutterChannel != null) {
flutterChannel.invokeMethod("get_common_params").then((data) {
if (data is Map) {
var map = Map<String, dynamic>.from(data);
initParams(map, callback: callback);
}
}).whenComplete(() {
// callback();
});
void jumpToSetting() {
if (!isInit) {
return;
}
if (flutterChannel != null) {
flutterChannel.invokeMethod("check_system_settings", "");
}
callback();
}
}
......@@ -3,7 +3,6 @@
* @date 2019-10-13
**/
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';
......@@ -11,6 +10,7 @@ import 'package:flutter_common/commonModel/live/LiveData.dart';
import 'package:gm_flutter/commonModel/bean/Pair.dart';
import 'package:gm_flutter/commonModel/util/DartUtil.dart';
import 'package:gm_flutter/commonModel/view/baseTabIndicator.dart';
import 'package:gm_flutter/main.mark.dart';
import 'package:lottie/lottie.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
......@@ -211,7 +211,7 @@ Widget errorItem(double width, double height, VoidCallback retry,
alignment: Alignment.center,
child: baseText("检查网络设置", 16, Color(0xffFF5963)),
).gestureDetector(() {
AppSettings.openWIFISettings();
RouterCenterImpl().findMainRouter().jumpToSetting();
}),
],
)));
......
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