Browse Source

safety

master
fmk 3 years ago
parent
commit
034ce9d310
  1. 105
      lib/store/store_order.dart
  2. 4
      lib/store/store_view/settlement.dart
  3. 10
      lib/store/store_view/shop_car.dart
  4. 222
      lib/store/store_view/shop_goods.dart
  5. 288
      lib/store/store_view/store_order_list.dart

105
lib/store/store_order.dart

@ -8,10 +8,12 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/store_view/product_sku.dart';
import 'package:huixiang/store/store_view/shop_car.dart'; import 'package:huixiang/store/store_view/shop_car.dart';
import 'package:huixiang/store/store_view/shop_goods.dart'; import 'package:huixiang/store/store_view/shop_goods.dart';
import 'package:huixiang/store/store_view/store_activity.dart'; import 'package:huixiang/store/store_view/store_activity.dart';
@ -28,7 +30,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
class StoreOrderPage extends StatefulWidget { class StoreOrderPage extends StatefulWidget {
final Map arguments; final Map<String, dynamic> arguments;
StoreOrderPage({this.arguments}); StoreOrderPage({this.arguments});
@ -63,13 +65,14 @@ class _StoreOrderPage extends State<StoreOrderPage>
); );
_widgetOptions = [ _widgetOptions = [
StoreOrderListPage(widget.arguments, activitys, storeInfo, controller, StoreOrderListPage(
(ac, ap) { widget.arguments,
setState(() { activitys,
allCount = ac; storeInfo,
allPrice = ap; controller,
}); _queryMiNiDetail,
}), _fc,
),
///, ///,
StoreActivity( StoreActivity(
@ -77,10 +80,50 @@ class _StoreOrderPage extends State<StoreOrderPage>
activitys, activitys,
), ),
]; ];
minLogin();
queryStoreInfo(); queryStoreInfo();
} }
_fc(ac, ap) {
setState(() {
allCount = ac;
allPrice = ap;
});
}
///
minLogin() async {
final SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString('token'),
);
apiService
.minLogin(widget.arguments["id"])
.catchError((onError) {})
.then((baseData) {
if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
String tenant = widget.arguments["tenant"];
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
},
);
minService = MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
);
}
});
}
/// ///
queryStoreInfo() async { queryStoreInfo() async {
final SharedPreferences value = await SharedPreferences.getInstance(); final SharedPreferences value = await SharedPreferences.getInstance();
@ -307,7 +350,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
onTap: () { onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/settlement', '/router/settlement',
arguments: {}, arguments: widget.arguments,
); );
}, },
child: RoundButton( child: RoundButton(
@ -400,7 +443,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
); );
} }
List<ProductList> productLists = []; List<ProductListBean> productLists = [];
/// ///
showShoppingCart() { showShoppingCart() {
@ -408,13 +451,47 @@ class _StoreOrderPage extends State<StoreOrderPage>
context: context, context: context,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
builder: (context) { builder: (context) {
return ShopCar(productLists); return ShopCar(productLists, _queryMiNiDetail, (ac, ap) {
setState(() {
allCount = ac;
allPrice = ap;
});
});
}, },
); );
} }
Widget shoppGoodsItem(ProductList pro, position) { ///
return ShopGoods(pro, position); _queryMiNiDetail(String id) async {
BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
if (baseData != null && baseData.isSuccess) {
setState(() {
showStoreSelector(baseData.data);
});
}
}
///
addsShoppingCart() async {
BaseData baseDate = await apiService.creditOrder({
"parentId": widget.arguments["parentId"],
"skuImg": widget.arguments["skuImg"],
"skuNameStr": widget.arguments["skuNameStr"],
"skuPrice": widget.arguments["skuPrice"],
"skuStock": widget.arguments["skuStock"],
});
if (baseDate != null && baseDate.isSuccess) {}
}
///
showStoreSelector(MiNiDetail miNiDetail) {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return ProductSku(miNiDetail);
},
);
} }
@override @override

4
lib/store/store_view/settlement.dart

@ -50,10 +50,8 @@ class _Settlement extends State<Settlement> {
int refundStatus = 0; int refundStatus = 0;
// String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE // String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE
queryDetails() async { queryDetails() async {
BaseData<OrderInfo> baseData = BaseData<OrderInfo> baseData = await apiService.orderDetail(widget.arguments["id"]);
await apiService.orderDetail(widget.arguments["id"]);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
orderInfo = baseData.data; orderInfo = baseData.data;
payStatus = orderInfo.payStatus; payStatus = orderInfo.payStatus;

10
lib/store/store_view/shop_car.dart

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/store/store_view/shop_goods.dart'; import 'package:huixiang/store/store_view/shop_goods.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
@ -8,9 +9,11 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
class ShopCar extends StatefulWidget { class ShopCar extends StatefulWidget {
final List<ProductList> productLists; final List<ProductListBean> productLists;
final Function(String id) queryMiNiDetail;
final Function(int allCount, double allPrice) fc;
ShopCar(this.productLists); ShopCar(this.productLists, this.queryMiNiDetail, this.fc);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -79,10 +82,9 @@ class _ShopCar extends State<ShopCar> {
itemCount: widget.productLists == null ? 0 : widget.productLists.length, itemCount: widget.productLists == null ? 0 : widget.productLists.length,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (context, position) { itemBuilder: (context, position) {
// return shoppGoodsItem();
return GestureDetector( return GestureDetector(
onTap: () {}, onTap: () {},
child: ShopGoods(widget.productLists[position], position), child: ShopGoods(widget.productLists, position, widget.queryMiNiDetail, widget.fc),
); );
}, },
), ),

222
lib/store/store_view/shop_goods.dart

@ -1,74 +1,92 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart';
class ShopGoods extends StatefulWidget { class ShopGoods extends StatefulWidget {
final List<ProductListBean> productListBeans;
final ProductList pro;
final int position; final int position;
final Function(String id) queryMiNiDetail;
final Function(int allCount, double allPrice) fc;
ShopGoods(this.pro, this.position); ShopGoods(
this.productListBeans,
this.position,
this.queryMiNiDetail,
this.fc,
);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _ShopGoods(); return _ShopGoods();
} }
} }
class _ShopGoods extends State<ShopGoods> { class _ShopGoods extends State<ShopGoods> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.only(bottom: 10), color: Colors.white,
padding: EdgeInsets.only(right: 16.w, bottom: 10.h, top: 10.h),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Image.asset( SizedBox(width: 12.w),
"assets/image/default_1.png", MImage(
width: 60, widget.productListBeans[widget.position] != null
height: 60, ? widget.productListBeans[widget.position].imgPath
: "",
width: 70,
height: 70,
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
SizedBox(
width: 10,
), ),
SizedBox(width: 10),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"手工啵啵奶茶", widget.productListBeans[widget.position].productName,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 12.sp, fontSize: 13.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
), ),
), ),
SizedBox(height: 2), SizedBox(
height: 2,
),
Row( Row(
children: [ children: [
Text( Expanded(
"无香精", child: Text(
style: TextStyle( widget.productListBeans[widget.position].shortName,
color: Color(0xFF4C4C4C), overflow: TextOverflow.ellipsis,
fontSize: 11.sp, maxLines: 2,
fontWeight: MyFontWeight.regular, style: TextStyle(
color: Color(0xFF4C4C4C),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
), ),
), ),
SizedBox(width: 10), SizedBox(
Text( width: 10,
"无香精", ),
style: TextStyle(
color: Color(0xFF4C4C4C),
fontSize: 11.sp,
fontWeight: MyFontWeight.regular,
),
)
], ],
), ),
SizedBox(height: 6), SizedBox(
height: 7,
),
Row( Row(
children: [ children: [
Column( Column(
@ -77,62 +95,136 @@ class _ShopGoods extends State<ShopGoods> {
Row( Row(
children: [ children: [
Text( Text(
"会员价", S.of(context).huiyuanjia,
style: TextStyle( style: TextStyle(
color: Color(0xFFFF7A1A), color: Color(0xFFFF7A1A),
fontSize: 13.sp, fontSize: 10.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
), ),
), ),
SizedBox(
width: 4,
),
Text( Text(
"¥19.00", "¥${widget.productListBeans[widget.position].price}",
style: TextStyle( style: TextStyle(
color: Color(0xFFFF7A1A), color: Color(0xFFFF7A1A),
fontSize: 14.sp, fontSize: 11.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
), ),
) ),
],
),
Row(
children: [
Text(
S.of(context).yuanjia,
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 9.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
width: 4,
),
Text(
"¥${widget.productListBeans[widget.position].applyPrice}",
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
], ],
), ),
], ],
), ),
Spacer(), Spacer(),
InkWell( widget.productListBeans[widget.position].attrStyle == 1
onTap: () {}, ? RoundButton(
child: Image.asset( width: 49.w,
"assets/image/reduce.png", text: S.of(context).xuanguige,
width: 22, textColor: Colors.white,
height: 22, fontWeight: MyFontWeight.medium,
), radius: 11,
), backgroup: Color(0xFF32A060),
Padding( fontSize: 11.sp,
padding: EdgeInsets.only(left: 8, right: 8), padding: EdgeInsets.symmetric(vertical: 5.h),
child: Text( callback: () {
"1", widget.queryMiNiDetail(
style: TextStyle( widget.productListBeans[widget.position].id);
color: Colors.black, },
fontSize: 14.sp, )
fontWeight: MyFontWeight.medium, : InkWell(
onTap: () {
setState(() {
{
if (widget.productListBeans[widget.position]
.buyNum >
0)
widget.productListBeans[widget.position]
.buyNum--;
int allCount = 0;
double allPrice = 0;
widget.productListBeans.forEach((element) {
allCount += element.buyNum;
allPrice += double.parse(element.price) *
element.buyNum;
});
widget.fc(allCount, allPrice);
}
});
},
child: Image.asset(
"assets/image/reduce.png",
width: 22,
height: 22,
),
),
if (widget.productListBeans[widget.position].attrStyle == 0)
Padding(
padding: EdgeInsets.only(left: 8, right: 8),
child: Text(
widget.productListBeans[widget.position].buyNum
.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
), ),
), ),
), if (widget.productListBeans[widget.position].attrStyle == 0)
InkWell( InkWell(
onTap: () {}, onTap: () {
child: Image.asset( setState(() {
"assets/image/add.png", {
width: 22, widget.productListBeans[widget.position].buyNum++;
height: 22, int allCount = 0;
double allPrice = 0;
widget.productListBeans.forEach((element) {
allCount += element.buyNum;
allPrice += double.parse(element.price) *
element.buyNum;
});
widget.fc(allCount, allPrice);
}
});
},
child: Image.asset(
"assets/image/add.png",
width: 22,
height: 22,
),
), ),
),
], ],
), ),
], ],
), ),
flex: 1, )
),
], ],
), ),
); );
} }
}
}

288
lib/store/store_view/store_order_list.dart

@ -1,7 +1,5 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
@ -10,9 +8,8 @@ import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/store_view/product_sku.dart'; import 'package:huixiang/store/store_view/product_sku.dart';
import 'package:huixiang/store/store_view/shop_goods.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -22,9 +19,16 @@ class StoreOrderListPage extends StatefulWidget {
final StoreInfo storeInfo; final StoreInfo storeInfo;
final ScrollController controller; final ScrollController controller;
final Function(int allCount, double allPrice) fc; final Function(int allCount, double allPrice) fc;
final Function(String id) queryMiNiDetail;
StoreOrderListPage( StoreOrderListPage(
this.arguments, this.activitys, this.storeInfo, this.controller, this.fc); this.arguments,
this.activitys,
this.storeInfo,
this.controller,
this.queryMiNiDetail,
this.fc,
);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -33,7 +37,6 @@ class StoreOrderListPage extends StatefulWidget {
} }
class _StoreOrderListPage extends State<StoreOrderListPage> { class _StoreOrderListPage extends State<StoreOrderListPage> {
int isSelected = 0; int isSelected = 0;
int tempClickIndex = 0; int tempClickIndex = 0;
ApiService apiService; ApiService apiService;
@ -45,47 +48,23 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
void initState() { void initState() {
super.initState(); super.initState();
minLogin(); appletGoods();
widget.controller.addListener(() {}); widget.controller.addListener(() {});
} }
/// ///
minLogin() async { appletGoods() async {
final SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService( String minToken = value.getString("minToken");
String tenant = value.getString("tenant");
minService = MinApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString('token'), token: minToken,
tenant: tenant,
); );
apiService
.minLogin(widget.arguments["id"])
.catchError((onError) {})
.then((baseData) {
if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
String tenant = widget.arguments["tenant"];
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
},
);
minService = MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
);
appletGoods();
// queryMiNiDetail(widget.arguments["id"]);
}
});
}
///
appletGoods() async {
BaseData<List<FindMiNiGroupList>> baseData = BaseData<List<FindMiNiGroupList>> baseData =
await minService.findMiNiGroupList( await minService.findMiNiGroupList(
{ {
@ -101,28 +80,6 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
} }
} }
///
queryMiNiDetail(String id) async {
BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
if (baseData != null && baseData.isSuccess) {
setState(() {
showStoreSelector(baseData.data);
});
}
}
///
addsShoppingCart() async {
BaseData baseDate = await apiService.creditOrder({
"parentId": widget.arguments["parentId"],
"skuImg": widget.arguments["skuImg"],
"skuNameStr": widget.arguments["skuNameStr"],
"skuPrice": widget.arguments["skuPrice"],
"skuStock": widget.arguments["skuStock"],
});
if (baseDate != null && baseDate.isSuccess) {}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -202,199 +159,11 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
} }
Widget goodsItem(position) { Widget goodsItem(position) {
return Container( return ShopGoods(
color: Colors.white, productListBeans,
padding: EdgeInsets.only(right: 16.w, bottom: 10.h, top: 10.h), position,
child: Row( widget.queryMiNiDetail,
crossAxisAlignment: CrossAxisAlignment.start, widget.fc,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(width: 12.w),
MImage(
productListBeans[position] != null
? productListBeans[position].imgPath
: "",
width: 70,
height: 70,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
productListBeans[position].productName,
style: TextStyle(
color: Colors.black,
fontSize: 13.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(
height: 2,
),
Row(
children: [
Expanded(
child: Text(
productListBeans[position].shortName,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
color: Color(0xFF4C4C4C),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
),
SizedBox(
width: 10,
),
],
),
SizedBox(
height: 7,
),
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
S.of(context).huiyuanjia,
style: TextStyle(
color: Color(0xFFFF7A1A),
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(
width: 4,
),
Text(
"¥${productListBeans[position].price}",
style: TextStyle(
color: Color(0xFFFF7A1A),
fontSize: 11.sp,
fontWeight: MyFontWeight.medium,
),
),
],
),
Row(
children: [
Text(
S.of(context).yuanjia,
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 9.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
width: 4,
),
Text(
"¥${productListBeans[position].applyPrice}",
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
],
),
],
),
Spacer(),
productListBeans[position].attrStyle == 1
? GestureDetector(
onTap: () {
queryMiNiDetail(productListBeans[position].id);
},
child: RoundButton(
width: 49.w,
text: S.of(context).xuanguige,
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 11,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
),
)
: InkWell(
onTap: () {
setState(() {
{
if (productListBeans[position].buyNum > 0)
productListBeans[position].buyNum--;
int allCount = 0;
double allPrice = 0;
productListBeans.forEach((element) {
allCount += element.buyNum;
allPrice += double.parse(element.price) *
element.buyNum;
});
widget.fc(allCount, allPrice);
}
});
},
child: Image.asset(
"assets/image/reduce.png",
width: 22,
height: 22,
),
),
if (productListBeans[position].attrStyle == 0)
Padding(
padding: EdgeInsets.only(left: 8, right: 8),
child: Text(
productListBeans[position].buyNum.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
if (productListBeans[position].attrStyle == 0)
InkWell(
onTap: () {
setState(() {
{
productListBeans[position].buyNum++;
int allCount = 0;
double allPrice = 0;
productListBeans.forEach((element) {
allCount += element.buyNum;
allPrice += double.parse(element.price) *
element.buyNum;
});
widget.fc(allCount, allPrice);
}
});
},
child: Image.asset(
"assets/image/add.png",
width: 22,
height: 22,
),
),
],
),
],
),
)
],
),
); );
} }
@ -402,15 +171,4 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
return productListBeans; return productListBeans;
} }
///
showStoreSelector(MiNiDetail miNiDetail) {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return ProductSku(miNiDetail);
},
);
}
} }

Loading…
Cancel
Save