Browse Source

safety

master
fmk 3 years ago
parent
commit
74623d38fe
  1. 95
      lib/store/store_view/product_sku.dart
  2. 10
      lib/store/store_view/store_order_list.dart

95
lib/store/store_view/product_sku.dart

@ -2,15 +2,16 @@ import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart';
import 'package:huixiang/store/store_view/store_order_list.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart';
class ProductSku extends StatefulWidget {
final ProductListBean productListBean;
final MiNiDetail miNiDetail;
ProductSku(this.productListBean);
ProductSku(this.miNiDetail);
@override
State<StatefulWidget> createState() {
@ -19,13 +20,6 @@ class ProductSku extends StatefulWidget {
}
class _ProductSku extends State<ProductSku> {
List<testModel> temperatureStoreList = [
testModel("正常冰"),
testModel("少冰"),
testModel("多冰"),
testModel("去冰")
];
List<testModel> sweetnessStoreList = [testModel("正常糖"), testModel("5分糖")];
int isChoice = 0;
int tempClickIndex = 0;
@ -33,11 +27,7 @@ class _ProductSku extends State<ProductSku> {
Widget build(BuildContext context) {
return Container(
alignment: Alignment.topCenter,
padding: EdgeInsets.only(
top: 16,
left: 16,
right: 16,
),
padding: EdgeInsets.only(top: 16, left: 16, right: 16),
width: double.infinity,
decoration: BoxDecoration(
color: Color(0xFFFAFAFA),
@ -55,21 +45,19 @@ class _ProductSku extends State<ProductSku> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MImage(
widget.productListBean.imgPath,
widget.miNiDetail.imgs[0],
width: 70,
height: 70,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
SizedBox(
width: 10,
),
SizedBox(width: 10),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.productListBean.productName,
widget.miNiDetail.productName,
style: TextStyle(
color: Colors.black,
fontSize: 16.sp,
@ -98,7 +86,7 @@ class _ProductSku extends State<ProductSku> {
),
),
Text(
widget.productListBean.applyPrice,
widget.miNiDetail.price,
style: TextStyle(
color: Color(0xFFFF7A1A),
fontSize: 14.sp,
@ -125,57 +113,33 @@ class _ProductSku extends State<ProductSku> {
SizedBox(
height: 23,
),
Text(
"温度",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
height: 15,
),
sweetnessStore(
Expanded(
child: ListView.builder(
itemCount: widget.miNiDetail.attrList.length,
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return attrItem(
() {
setState(() {
for (var i = 0; i < temperatureStoreList.length; i++) {
for (var i = 0;
i <
widget.miNiDetail.attrList[position].attrValueList
.length;
i++) {
if (tempClickIndex == i)
temperatureStoreList[i].isSelected = true;
widget.miNiDetail.attrList[position].attrValueList[i]
.isSelected = true;
else
temperatureStoreList[i].isSelected = false;
widget.miNiDetail.attrList[position].attrValueList[i]
.isSelected = false;
}
});
},
temperatureStoreList,
),
SizedBox(
height: 24,
),
Text(
"甜度",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
height: 15,
),
sweetnessStore(
() {
setState(() {
for (var i = 0; i < sweetnessStoreList.length; i++) {
if (tempClickIndex == i)
sweetnessStoreList[i].isSelected = true;
else
sweetnessStoreList[i].isSelected = false;
}
});
widget.miNiDetail.attrList[position],
);
},
sweetnessStoreList,
),
)),
SizedBox(
height: 24,
),
@ -190,8 +154,7 @@ class _ProductSku extends State<ProductSku> {
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
),
)),
InkWell(
onTap: () {},
child: Image.asset(
@ -203,7 +166,7 @@ class _ProductSku extends State<ProductSku> {
Padding(
padding: EdgeInsets.only(left: 8, right: 8),
child: Text(
widget.productListBean.buyNum.toString(),
"1",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,

10
lib/store/store_view/store_order_list.dart

@ -368,8 +368,12 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return StatefulBuilder(builder: (context1, state) {
return ProductSku(productListBean);
return StatefulBuilder(builder: (context1, state)
{
return ProductSku(miNiDetail);
});
}
);
}
}

Loading…
Cancel
Save