Browse Source

safety

master
fmk 3 years ago
parent
commit
36b42e6340
  1. 3
      lib/store/store_order.dart
  2. 20
      lib/store/store_view/settlement.dart
  3. 76
      lib/store/store_view/store_order_list.dart

3
lib/store/store_order.dart

@ -407,7 +407,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
fontSize: 12.sp,
radius: 100,
),
)
),
],
),
],
@ -557,7 +557,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
}
calculatePrice() {
AiDecimalAccuracy allPriceDecimal = AiDecimalAccuracy.zero;
int allCount = 0;
shopCarGoods.forEach((element2) {

20
lib/store/store_view/settlement.dart

@ -82,16 +82,16 @@ class _Settlement extends State<Settlement> {
///
queryOrderInfo() async {
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
"addressId":0,
"isTake": 0,
"memberCouponId": 0,
"orderId": widget.arguments["orderId"],
"promotionId": 0
});
if (baseData != null && baseData.isSuccess) {
setState(() {});
}
// BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
// "addressId":0,
// "isTake": 0,
// "memberCouponId": 0,
// "orderId": widget.arguments["orderId"],
// "promotionId": 0
// });
// if (baseData != null && baseData.isSuccess) {
// setState(() {});
// }
}
@override

76
lib/store/store_view/store_order_list.dart

@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/store_view/shop_goods.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:shared_preferences/shared_preferences.dart';
class StoreOrderListPage extends StatefulWidget {
@ -30,18 +31,15 @@ class StoreOrderListPage extends StatefulWidget {
this.controller,
this.queryMiNiDetail,
this.productListResult,
this.fc
);
this.fc);
@override
State<StatefulWidget> createState() {
return _StoreOrderListPage();
}
}
class _StoreOrderListPage extends State<StoreOrderListPage> {
int isSelected = 0;
int tempClickIndex = 0;
ApiService apiService;
@ -54,7 +52,6 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
super.initState();
appletGoods();
}
///
@ -90,7 +87,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
Widget build(BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height - (kToolbarHeight + 38 + 54.h),
height:
MediaQuery.of(context).size.height - (kToolbarHeight + 38 + 54.h),
margin: EdgeInsets.only(
top: (MediaQuery.of(context).padding.top + 38 + kToolbarHeight),
),
@ -101,7 +99,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
Container(
width: 100.w,
child: ListView.builder(
itemCount: appletProducts == null ? 0 : appletProducts.length,
itemCount:
appletProducts == null ? 0 : appletProducts.length,
controller: controller1,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(top: 0, bottom: 25),
@ -113,7 +112,9 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
Container(
width: MediaQuery.of(context).size.width - 100.w,
child: ListView.builder(
itemCount: productListBeans == null ? 0 : productListBeans.length,
itemCount: productListBeans == null
? 0
: productListBeans.length,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.zero,
itemBuilder: (context, position) {
@ -130,12 +131,10 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
ScrollController controller2 = ScrollController();
Widget orderItem(FindMiNiGroupList findMiNiGroupList, int index) {
int count = calculateItemCount(findMiNiGroupList);
return Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
width: 100,
child: GestureDetector(
onTap: () {
setState(() {
isSelected = index;
@ -143,10 +142,25 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
productListBeans.addAll(findMiNiGroupList.productList);
});
},
child: Container(
child: Stack(
alignment: Alignment.center,
children: [
Container(
color: isSelected != index ? Color(0xFFFAFAFA) : Colors.white,
alignment: Alignment.center,
padding: EdgeInsets.all(15),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (isSelected == index)
Container(
width: 2,
height: 17,
color: Color(0xFF32A060),
margin: EdgeInsets.only(right: 10),
),
Expanded(
child: Text(
findMiNiGroupList.groupName,
textAlign: TextAlign.center,
@ -158,13 +172,45 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
fontWeight: MyFontWeight.medium,
),
),
flex: 1,
),
],
),
),
Positioned(
right: 0,
child: Visibility(
visible: count > 0,
child: RoundButton(
width: 17,
height: 17,
text: "$count",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
fontSize: 12.sp,
radius: 100,
),
),
),
],
),
),
);
}
int calculateItemCount(FindMiNiGroupList findMiNiGroupList) {
int count = 0;
findMiNiGroupList.productList.forEach((element) {
widget.shopCarGoods.forEach((element1) {
if (element.id == element1["id"]) {
count += element1["count"];
}
});
});
return count;
}
Widget goodsItem(position) {
Map<String, dynamic> map;
widget.shopCarGoods.forEach((element) {
@ -189,10 +235,10 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
}
});
widget.fc(count, productId, allCount, allPrice.toDouble());
setState(() {});
},
queryMiNiDetail: widget.queryMiNiDetail,
shopCarGoods: map,
);
}
}

Loading…
Cancel
Save