Browse Source

点单页,单规格,多规格起购量加购流程更改;

商品详情起购量流程更改;
购物车起购量商品数量加减流程更改;
门店列表,商品新增跳转事件;
订单详情新增结算金额明细;
wr_2023_new_business_new
wurong 4 months ago
parent
commit
3da1ea3432
  1. 101
      lib/order/order_view/order_commodity.dart
  2. 3
      lib/retrofit/data/findMiNiGroupList.dart
  3. 19
      lib/retrofit/data/miNiDetail.dart
  4. 136
      lib/retrofit/data/order_info.dart
  5. 3
      lib/retrofit/data/shoppingCart.dart
  6. 2
      lib/retrofit/min_api.g.dart
  7. 201
      lib/store/shop_details_page.dart
  8. 19
      lib/store/store_order.dart
  9. 271
      lib/store/store_view/product_sku.dart
  10. 76
      lib/store/store_view/shop_goods.dart
  11. 39
      lib/store/store_view/shop_goods_car.dart
  12. 7
      lib/store/store_view/store_order_list.dart
  13. 18
      lib/union/union_list.dart

101
lib/order/order_view/order_commodity.dart

@ -76,7 +76,9 @@ class _OrderCommodity extends State<OrderCommodity> {
}
widgets.add(SizedBox(height: 20.h));
if (widget.orderInfo.isTakeOut != 0 && widget.orderInfo.isTakeOut != 3 && widget.orderInfo.isTakeOut != 4) {
if (widget.orderInfo.isTakeOut != 0 &&
widget.orderInfo.isTakeOut != 3 &&
widget.orderInfo.isTakeOut != 4) {
//
widgets.add(
discountItem(
@ -113,7 +115,6 @@ class _OrderCommodity extends State<OrderCommodity> {
);
}
if (widget.orderInfo.orderDetail != null &&
widget.orderInfo.orderDetail.couponDTO != null) {
//
@ -129,7 +130,8 @@ class _OrderCommodity extends State<OrderCommodity> {
if (widget.orderInfo.orderDetail != null &&
widget.orderInfo.orderDetail.activityPrice != null &&
double.tryParse(widget.orderInfo.orderDetail.activityPrice ?? "0") > 0) {
double.tryParse(widget.orderInfo.orderDetail.activityPrice ?? "0") >
0) {
//
widgets.add(
discountItem(
@ -141,7 +143,6 @@ class _OrderCommodity extends State<OrderCommodity> {
);
}
if (widget.orderInfo.orderDetail != null &&
widget.orderInfo.vipDiscountPrice != null &&
double.tryParse(widget.orderInfo.vipDiscountPrice ?? "0") > 0) {
@ -151,7 +152,7 @@ class _OrderCommodity extends State<OrderCommodity> {
Color(0xFFFF7A1A),
"VIP优惠",
"",
"- ${widget.orderInfo.vipDiscountPrice??""}",
"- ${widget.orderInfo.vipDiscountPrice ?? ""}",
),
);
}
@ -179,7 +180,6 @@ class _OrderCommodity extends State<OrderCommodity> {
return widgets;
}
Widget commodityItem(OrderProductVOList productList) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
@ -248,15 +248,23 @@ class _OrderCommodity extends State<OrderCommodity> {
children: [
Text(
productList.buyNum > 1
? S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - AppUtils.stringAsFixedDouble2((double.tryParse(productList.discountAmount ?? "0") / productList.buyNum))))
: S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - double.tryParse(productList.discountAmount ?? "0"))),
? S.of(context).yuan_(AppUtils.calculateDouble(
double.tryParse(productList.sellPrice ?? "0") -
AppUtils.stringAsFixedDouble2((double.tryParse(
productList.discountAmount ?? "0") /
productList.buyNum))))
: S.of(context).yuan_(AppUtils.calculateDouble(
double.tryParse(productList.sellPrice ?? "0") -
double.tryParse(
productList.discountAmount ?? "0"))),
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFF4C4C4C),
),
),
if (productList.discountAmount != null && productList.discountAmount != "0")
if (productList.discountAmount != null &&
productList.discountAmount != "0")
Text(
S.of(context).yuan_(productList.sellPrice),
style: TextStyle(
@ -288,7 +296,8 @@ class _OrderCommodity extends State<OrderCommodity> {
}
Widget orderMealsItem(SetMealDataList setMealDataList) {
return Column(children: setMealDataList.productInfoList.map((e) {
return Column(
children: setMealDataList.productInfoList.map((e) {
return Container(
margin: EdgeInsets.symmetric(
vertical: 10.h,
@ -334,7 +343,8 @@ class _OrderCommodity extends State<OrderCommodity> {
],
),
);
}).toList(),);
}).toList(),
);
}
Widget discountItem(Color color, textName, condition, amount) {
@ -386,7 +396,7 @@ class _OrderCommodity extends State<OrderCommodity> {
);
}
Widget vipItem(Color color, textName,amount) {
Widget vipItem(Color color, textName, amount) {
return Container(
margin: EdgeInsets.only(top: 9.h, bottom: 9.h),
child: Row(
@ -497,9 +507,9 @@ class _OrderCommodity extends State<OrderCommodity> {
);
}
String buyNumAllGoods(){
String buyNumAllGoods() {
int count = 0;
if(widget.orderInfo != null){
if (widget.orderInfo != null) {
widget.orderInfo.productList.forEach((element) {
count += element.buyNum;
});
@ -512,7 +522,7 @@ class _OrderCommodity extends State<OrderCommodity> {
margin: EdgeInsets.only(top: 7.h, bottom: 11.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.baseline,
crossAxisAlignment: CrossAxisAlignment.start,
textBaseline: TextBaseline.alphabetic,
children: [
Expanded(
@ -538,27 +548,76 @@ class _OrderCommodity extends State<OrderCommodity> {
SizedBox(
width: 15.w,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
margin: EdgeInsets.only(bottom:8.h),
child: Text(
S.of(context).jiesuanjine,
"${S.of(context).jiesuanjine}:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF353535),
fontWeight: MyFontWeight.semi_bold),
fontWeight: MyFontWeight.medium),
),
),
if(widget.orderInfo.orderDetail.payRecords != null)
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: widget.orderInfo.orderDetail.payRecords.map((e) {
return Container(
margin:EdgeInsets.only(bottom:5.h),
child: Text(
"${e?.countName ?? ""}:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF727272),
fontWeight: MyFontWeight.regular),
));
}).toList(),
),
],
),
SizedBox(
width: 5.w,
),
Text(
"${widget.orderInfo.orderDetail.paySumPrice}"
/*totalPrice()*/,
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(margin:EdgeInsets.only(bottom:7.5.h),
child: Text(
"${widget.orderInfo.orderDetail.paySumPrice}" /*totalPrice()*/,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
fontSize: 13.sp,
color: Color(0xFF32A060),
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.semi_bold),
)),
if(widget.orderInfo.orderDetail.payRecords != null)
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: widget.orderInfo.orderDetail.payRecords.map((e) {
return Container(
margin:EdgeInsets.only(bottom:4.h),
child: Text(
"${e?.amount ?? "0.00"}",
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF32A060),
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.regular),
),
);
}).toList(),
),
],
),
],
)
],
),

3
lib/retrofit/data/findMiNiGroupList.dart

@ -104,6 +104,7 @@ class ProductListBean {
dynamic markProductNone;
SubscribeParam subscribeParam;
bool isSetMeal;
int minQty;
static ProductListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null;
@ -139,6 +140,7 @@ class ProductListBean {
productListBean.markProductNone = map['markProductNone'];
productListBean.subscribeParam = SubscribeParam.fromJson(map['subscribeParam']);
productListBean.isSetMeal = map['isSetMeal'];
productListBean.minQty = map['minQty'];
return productListBean;
}
@ -174,6 +176,7 @@ class ProductListBean {
"markProductNone": markProductNone,
"subscribeParam": subscribeParam,
"isSetMeal": isSetMeal,
"minQty": minQty,
};
}

19
lib/retrofit/data/miNiDetail.dart

@ -87,6 +87,7 @@ class MiNiDetail {
dynamic namePinyin;
dynamic nameInitials;
SubscribeParam subscribeParam;
int minQty;
static MiNiDetail fromJson(Map<String, dynamic> map) {
if (map == null) return null;
@ -142,6 +143,7 @@ class MiNiDetail {
miNiDetailBean.nameInitials = map['nameInitials'];
miNiDetailBean.subscribeParam =
SubscribeParam.fromJson(map['subscribeParam']);
miNiDetailBean.minQty = map['minQty'];
return miNiDetailBean;
}
@ -192,6 +194,7 @@ class MiNiDetail {
"namePinyin": namePinyin,
"nameInitials": nameInitials,
"subscribeParam": subscribeParam,
"minQty": minQty
};
}
@ -229,6 +232,7 @@ class ProductSkuVOListBean {
String storeId;
String skuCode;
String skuNameStr;
int _minQty;
String productId;
String skuPrice;
String applyPrice;
@ -246,6 +250,19 @@ class ProductSkuVOListBean {
List<SkuAttrListBean> skuAttrList;
List<ProductSetMeals> productSetMeals;
dynamic setMealDTOList;
int _count;
int get minQty => _minQty??0;
set minQty(int value) {
_minQty = value;
}
int get count => _count??1;
set count(int value) {
_count = value;
}
static ProductSkuVOListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null;
@ -258,6 +275,7 @@ class ProductSkuVOListBean {
productSkuVOListBean.storeId = map['storeId'];
productSkuVOListBean.skuCode = map['skuCode'];
productSkuVOListBean.skuNameStr = map['skuNameStr'];
productSkuVOListBean._minQty = map['minQty'];
productSkuVOListBean.productId = map['productId'];
productSkuVOListBean.skuPrice = map['skuPrice'];
productSkuVOListBean.applyPrice = map['applyPrice'];
@ -291,6 +309,7 @@ class ProductSkuVOListBean {
"storeId": storeId,
"skuCode": skuCode,
"skuNameStr": skuNameStr,
"minQty": _minQty,
"productId": productId,
"skuPrice": skuPrice,
"applyPrice": applyPrice,

136
lib/retrofit/data/order_info.dart

@ -433,6 +433,7 @@ class OrderDetail {
String shipperCode;
String logisticsName;
String logisticsNum;
List<PayRecords> payRecords;
int orderNum;
int productNum;
int mins;
@ -461,6 +462,7 @@ class OrderDetail {
String shipperCode,
String logisticsName,
String logisticsNum,
List<PayRecords> payRecords,
int orderNum,
int productNum,
int mins,
@ -487,6 +489,7 @@ class OrderDetail {
this.shipperCode = shipperCode;
this.logisticsName = logisticsName;
this.logisticsNum = logisticsNum;
this.payRecords = payRecords;
this.orderNum = orderNum;
this.productNum = productNum;
this.mins = mins;
@ -526,6 +529,12 @@ class OrderDetail {
this.shipperCode = json["shipperCode"];
this.logisticsName = json["logisticsName"];
this.logisticsNum = json["logisticsNum"];
if (json["payRecords"] != null) {
this.payRecords = [];
json["payRecords"].forEach((v) {
this.payRecords.add(PayRecords.fromJson(v));
});
}
this.orderNum = json["orderNum"];
this.productNum = json["productNum"];
this.mins = json["mins"];
@ -560,6 +569,9 @@ class OrderDetail {
map["shipperCode"] = this.shipperCode;
map["logisticsName"] = this.logisticsName;
map["logisticsNum"] = this.logisticsNum;
if (this.payRecords != null) {
map["payRecords"] = this.payRecords.map((v) => v.toJson()).toList();
}
map["orderNum"] = this.orderNum;
map["productNum"] = this.productNum;
map["mins"] = this.mins;
@ -891,3 +903,127 @@ class CouponDTO {
return map;
}
}
/// id : "1828720860895117312"
/// orderId : "1828720033405075456"
/// countName : "商户活动余额支付"
/// type : 8
/// amount : "10.00"
/// refundAmount : "0.00"
/// createTime : "2024-08-28 17:06:44"
/// refId : "1828720859515191296"
/// memberName : "soon"
/// memberBalance : "3551.19"
/// memberPhone : "13052919193"
/// isDiscount : false
class PayRecords {
PayRecords({
String id,
String orderId,
String countName,
int type,
String amount,
String refundAmount,
String createTime,
String refId,
String memberName,
String memberBalance,
String memberPhone,
bool isDiscount,}){
_id = id;
_orderId = orderId;
_countName = countName;
_type = type;
_amount = amount;
_refundAmount = refundAmount;
_createTime = createTime;
_refId = refId;
_memberName = memberName;
_memberBalance = memberBalance;
_memberPhone = memberPhone;
_isDiscount = isDiscount;
}
PayRecords.fromJson(dynamic json) {
_id = json['id'];
_orderId = json['orderId'];
_countName = json['countName'];
_type = json['type'];
_amount = json['amount'];
_refundAmount = json['refundAmount'];
_createTime = json['createTime'];
_refId = json['refId'];
_memberName = json['memberName'];
_memberBalance = json['memberBalance'];
_memberPhone = json['memberPhone'];
_isDiscount = json['isDiscount'];
}
String _id;
String _orderId;
String _countName;
int _type;
String _amount;
String _refundAmount;
String _createTime;
String _refId;
String _memberName;
String _memberBalance;
String _memberPhone;
bool _isDiscount;
PayRecords copyWith({ String id,
String orderId,
String countName,
int type,
String amount,
String refundAmount,
String createTime,
String refId,
String memberName,
String memberBalance,
String memberPhone,
bool isDiscount,
}) => PayRecords( id: id ?? _id,
orderId: orderId ?? _orderId,
countName: countName ?? _countName,
type: type ?? _type,
amount: amount ?? _amount,
refundAmount: refundAmount ?? _refundAmount,
createTime: createTime ?? _createTime,
refId: refId ?? _refId,
memberName: memberName ?? _memberName,
memberBalance: memberBalance ?? _memberBalance,
memberPhone: memberPhone ?? _memberPhone,
isDiscount: isDiscount ?? _isDiscount,
);
String get id => _id;
String get orderId => _orderId;
String get countName => _countName;
int get type => _type;
String get amount => _amount;
String get refundAmount => _refundAmount;
String get createTime => _createTime;
String get refId => _refId;
String get memberName => _memberName;
String get memberBalance => _memberBalance;
String get memberPhone => _memberPhone;
bool get isDiscount => _isDiscount;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['orderId'] = _orderId;
map['countName'] = _countName;
map['type'] = _type;
map['amount'] = _amount;
map['refundAmount'] = _refundAmount;
map['createTime'] = _createTime;
map['refId'] = _refId;
map['memberName'] = _memberName;
map['memberBalance'] = _memberBalance;
map['memberPhone'] = _memberPhone;
map['isDiscount'] = _isDiscount;
return map;
}
}

3
lib/retrofit/data/shoppingCart.dart

@ -88,6 +88,7 @@ class ShoppingCartSkuItemListBean {
int skuStock;
String storeId;
String tableId;
int minQty;
static ShoppingCartSkuItemListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null;
@ -112,6 +113,7 @@ class ShoppingCartSkuItemListBean {
shoppingCartSkuItemListBean.skuStock = map['skuStock'];
shoppingCartSkuItemListBean.storeId = map['storeId'];
shoppingCartSkuItemListBean.tableId = map['tableId'];
shoppingCartSkuItemListBean.minQty = map['minQty'];
return shoppingCartSkuItemListBean;
}
@ -132,6 +134,7 @@ class ShoppingCartSkuItemListBean {
"skuStock": skuStock,
"storeId": storeId,
"tableId": tableId,
"minQty": minQty,
};
}

2
lib/retrofit/min_api.g.dart

@ -78,7 +78,7 @@ class _MinApiService implements MinApiService {
data: _data);
final value = BaseData<MiNiDetail>.fromJson(
_result.data,
(json) => MiNiDetail.fromJson(json),
(json) => ((json??"") == "")? null :MiNiDetail.fromJson(json),
);
return value;
}

201
lib/store/shop_details_page.dart

@ -28,6 +28,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../view_widget/border_text.dart';
import '../view_widget/request_permission.dart';
import '../view_widget/settlement_tips_dialog.dart';
class ShopDetailsPage extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -68,6 +69,10 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
int index;
bool isSetMeal;
int scIndex = 0;
int skuMinQty = 0;
int singleNum = 0;
String goodsSkuId;
bool isCounts = false;
@override
void initState() {
@ -347,6 +352,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
BaseData<bool> baseData = await minService.clearShoppingCart(storeId);
if (baseData.isSuccess) {
shopCarGoods = null;
singleNum = 0;
setState(() {});
}
}
@ -367,6 +373,8 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
if (baseData != null && baseData.isSuccess) {
showStoreSelector(baseData.data, id, count);
}else{
SmartDialog.showToast(baseData.msg);
}
EasyLoading.dismiss();
}
@ -376,9 +384,11 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
if (miNiDetail.attrList != null &&
miNiDetail.attrList.length == 1 &&
miNiDetail.attrList[0].attrValueList.length == 1) {
_addShopCar(miNiDetail, [], counts);
_addShopCar(miNiDetail, [], count);
} else {
// showSpanDialog();
setState(() {
buildCount();
});
selectSpecsShowBottomSheet();
}
}
@ -443,7 +453,12 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
setState(() {});
});
} else {
SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center);
SmartDialog.show(
widget: SettlementTips(
() {},
text: "${baseDate.msg.replaceAll("~", ",") + "请重新加购商品"}",
),
);
}
}
}
@ -475,6 +490,17 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
}
});
}
baseDate.data[0].shoppingCartSkuItemList.forEach((element) {
if((goodsSkuId == element.id)){
singleNum = element.buyNum;
}else{
if(id == element.productId){
singleNum = element.buyNum;
}else{
singleNum = 0;
}
}
});
return baseDate.data[0];
} else {
return null;
@ -501,9 +527,9 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
///1
Future<ShoppingCart> shopCartReduce(
ShoppingCartSkuItemListBean cartSkuItem) async {
ShoppingCartSkuItemListBean cartSkuItem,{int count = 1}) async {
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
cartSkuItem.buyNum -= 1;
cartSkuItem.buyNum -= (count>0) ? ((cartSkuItem.minQty>1 && cartSkuItem.buyNum == cartSkuItem.minQty) ? cartSkuItem.minQty: count) : -count;
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp);
@ -578,7 +604,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
if (shopSkuItem != null) {
if (shopSkuItem.buyNum > 1) {
shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum -= 1;
shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum -= (skuMinQty > 1 && skuMinQty ==shopSkuItem.buyNum) ? skuMinQty:1;
}
} else {
await _addShopCar(miNiDetail, selectSkus, 2);
@ -626,6 +652,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
if (productSku == null) return;
selectedPrice = productSku.skuPrice;
String skuId = productSku.id;
skuMinQty = productSku.minQty;
if (shopCarGoods == null || shopCarGoods.shoppingCartSkuItemList == null)
return;
int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList
@ -848,8 +875,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
SizedBox(
width: 2.w,
),
Expanded(
child: Text(
Text(
miNiDetail?.applyPrice ?? "",
style: TextStyle(
fontSize: 16.sp,
@ -858,7 +884,32 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
fontWeight: MyFontWeight.regular,
color: Color(0xFFA29E9E),
),
)),
),
if((widget?.arguments["minQty"] ?? 0).toInt() > 1)
Container(
height: 20.h,
padding: EdgeInsets.symmetric(horizontal:6.w),
margin: EdgeInsets.only(left: 16.w),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFFF65720),
style: BorderStyle.solid,
),
),
alignment: Alignment.center,
child: Text(
"${widget?.arguments["minQty"] ?? 0 ?? "0"}份起购",
style: TextStyle(
color: Color(0xFFF65720),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
),
Spacer(),
GestureDetector(
onTap: () async {
if (storeInfo.posType.code == "NORMALSTORE" &&
@ -968,8 +1019,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
SizedBox(
width: 2.w,
),
Expanded(
child: Text(
Text(
miNiDetail?.applyPrice ?? "",
style: TextStyle(
fontSize: 16.sp,
@ -978,7 +1028,31 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
fontWeight: MyFontWeight.regular,
color: Color(0xFFA29E9E),
),
)),
),
if((widget?.arguments["minQty"] ?? 0).toInt() > 1)
Container(
padding: EdgeInsets.symmetric(horizontal:6.w,vertical: 2.h),
margin: EdgeInsets.only(left: 16.w),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFFF65720),
style: BorderStyle.solid,
),
),
alignment: Alignment.center,
child: Text(
"${widget?.arguments["minQty"] ?? 0}份起购",
style: TextStyle(
color: Color(0xFFF65720),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
),
Spacer(),
GestureDetector(
onTap: () async {
if (storeInfo.posType.code == "NORMALSTORE" &&
@ -997,7 +1071,8 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
setState(() {});
});
} else {
_queryMiNiDetail(id, counts);
_queryMiNiDetail(id,(skuMinQty > 1 ? counts : ((widget.arguments["minQty"]??0) > 1 && singleNum==0)
? (widget.arguments["minQty"]??0):counts));
}
},
child: Container(
@ -1191,6 +1266,31 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
),
],
),
if(skuMinQty > 1)
Row(children: [
Container(
padding: EdgeInsets.symmetric(horizontal:4.w),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFFF65720),
style: BorderStyle.solid,
),
),
alignment: Alignment.center,
child: Text(
"${skuMinQty}份起购",
style: TextStyle(
color: Color(0xFFF65720),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
),
Spacer()
]),
Text(
"${miNiDetail?.price ?? ""}",
style: TextStyle(
@ -1237,7 +1337,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
S.of(context).shuliang,
@ -1247,28 +1347,59 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
height: 10,
if(skuMinQty > 1 && (counts ==1 || counts ==0))
Row(
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
state(() {
isCounts = true;
counts += skuMinQty-1;
_addShopCar(miNiDetail, selectSkus, counts);
});
},
child:Container(
margin: EdgeInsets.only(right: 8.w, top: 14.h,bottom: 24.h),
child: RoundButton(
text:"${skuMinQty}份起购",
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 3,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w),
),
)),
Spacer()
],
),
if((skuMinQty > 1 && counts !=1) || skuMinQty == 0 || skuMinQty == 1)
Row(
children: [
InkWell(
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
state(() {
if (counts > 1)
setState(() {
counts -= 1;
counts -= (skuMinQty > 1 && skuMinQty == counts) ? (skuMinQty - 1) : 1;
});
// reduce(miNiDetail, selectSkus);
isCounts = true;
reduce(miNiDetail, selectSkus);
});
},
child: Container(
padding:EdgeInsets.only(right:8.w,top: 10.h,bottom: 24.h),
child: Icon(
Icons.remove,
color: Color(0xFF32A060),
size: 24,
)),
))),
Padding(
padding: EdgeInsets.only(left: 8, right: 8),
padding: EdgeInsets.only(right: 8.w,bottom: 14.h),
child: Text(
"$counts",
style: TextStyle(
@ -1278,25 +1409,27 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
),
),
),
InkWell(
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
state(() {
counts += 1;
// add(miNiDetail, selectSkus);
isCounts = true;
add(miNiDetail, selectSkus);
});
},
child: Container(
padding:EdgeInsets.only(right:20.w,top: 10.h,bottom: 24.h),
child: Icon(
Icons.add,
color: Color(0xFF32A060),
size: 24,
),
)),
],
)
],
),
SizedBox(
height: 24,
),
RoundButton(
width: double.infinity,
height: 54.h,
@ -1308,12 +1441,24 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
textColor: Colors.white,
fontWeight: MyFontWeight.semi_bold,
radius: 27,
backgroup: Color(0xFF32A060),
backgroup:Color(0xFF32A060),
fontSize: 16.sp,
callback: () {
state(() {
_addShopCar(miNiDetail, selectSkus, counts);
if(skuMinQty > 1 && counts == 1){
SmartDialog.show(
widget: SettlementTips(
() {},
text: "请选择购买数量",
),
);
return;
}
if(!isCounts || counts == 1){
_addShopCar(miNiDetail, selectSkus,1);
counts = 1;
isCounts = false;
}
Navigator.of(context).pop();
});
},

19
lib/store/store_order.dart

@ -32,6 +32,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../retrofit/data/settleOrderInfo.dart';
import '../view_widget/settlement_tips_dialog.dart';
class StoreOrderPage extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -777,7 +778,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
if (count < 0) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) async {
if (element.productId == id) {
await shopCartReduce(element);
await shopCartReduce(element,count: count);
setState(() {});
}
});
@ -873,7 +874,12 @@ class _StoreOrderPage extends State<StoreOrderPage>
toDownOrder();
setState(() {});
} else {
SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center);
SmartDialog.show(
widget: SettlementTips(
() {},
text: "${baseDate.msg.replaceAll("~", ",") + "请重新加购商品"}",
),
);
}
}
}
@ -947,9 +953,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
///1
Future<ShoppingCart> shopCartReduce(
ShoppingCartSkuItemListBean cartSkuItem) async {
ShoppingCartSkuItemListBean cartSkuItem,{int count = 1}) async {
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
cartSkuItem.buyNum -= 1;
cartSkuItem.buyNum -= (count>0) ? ((cartSkuItem.minQty>1 && cartSkuItem.buyNum == cartSkuItem.minQty) ? cartSkuItem.minQty: count) : -count;
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp);
@ -1004,10 +1010,13 @@ class _StoreOrderPage extends State<StoreOrderPage>
}
}
int countMinQty = 1;
///1
reduce(MiNiDetail miNiDetail, selectSkus) async {
ProductSkuVOListBean productSku =
miNiDetail.productSkuVOList.firstWhere((element) {
countMinQty = element.minQty;
return skuY(element, selectSkus);
});
@ -1025,7 +1034,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
if (shopSkuItem != null) {
if (shopSkuItem.buyNum > 1) {
shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum -= 1;
shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum -= (countMinQty > 1 && countMinQty ==shopSkuItem.buyNum) ? countMinQty:1;
}
} else {
await _addShopCar(miNiDetail, selectSkus, 1);

271
lib/store/store_view/product_sku.dart

@ -9,6 +9,8 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart';
import '../../view_widget/settlement_tips_dialog.dart';
class ProductSku extends StatefulWidget {
final MiNiDetail miNiDetail;
final String productId;
@ -31,44 +33,57 @@ class ProductSku extends StatefulWidget {
class _ProductSku extends State<ProductSku> {
List<String> selectSkus = [];
int count = 1, realCount = 0;
String selectedPrice = "";
bool _isTapEd = false;
int _currentSkuIndex;
@override
void initState() {
super.initState();
if (widget.shopCarGoods != null && widget.shopCarGoods.shoppingCartSkuItemList != null) {
widget.shopCarGoods.shoppingCartSkuItemList.forEach((e1) {
if (widget.miNiDetail != null && widget.miNiDetail.productSkuVOList != null && widget.miNiDetail.productSkuVOList.isNotEmpty) {
try {
widget.miNiDetail.productSkuVOList.firstWhere((e2) => e1.id == e2.id).count = e1.buyNum;
} catch (e) {
return;
}
}
});
}
widget.miNiDetail.attrList.forEach((element) {
selectSkus.add(element.attrValueList[0].attrValue);
});
buildCount();
}
buildCount() {
count = 1;
ProductSkuVOListBean productSku;
try {
productSku = widget.miNiDetail.productSkuVOList.firstWhere((element) {
_currentSkuIndex = widget.miNiDetail.productSkuVOList.indexWhere((element) {
return skuY(element, selectSkus);
});
} catch (ex) {
return;
}
if (productSku == null) return;
selectedPrice = productSku.vipPrice ?? productSku.skuPrice ?? "";
String skuId = productSku.id;
if (widget.shopCarGoods == null ||
widget.shopCarGoods.shoppingCartSkuItemList == null) return;
int shopSkuIndex = widget.shopCarGoods.shoppingCartSkuItemList
.indexWhere((element) => skuId == element.id);
if (shopSkuIndex >= 0) {
count = widget.shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum;
realCount = count;
}
}
// buildCount() {
// count = 1;
// ProductSkuVOListBean productSku;
// try {
// productSku = widget.miNiDetail.productSkuVOList.firstWhere((element) {
// return skuY(element, selectSkus);
// });
// } catch (ex) {
// return;
// }
// if (productSku == null) return;
// selectedPrice = productSku.vipPrice ?? productSku.skuPrice ?? "";
// String skuId = productSku.id;
// widget.miNiDetail.productSkuVOList[_currentSkuIndex].minQty = productSku.minQty;
// if (widget.shopCarGoods == null ||
// widget.shopCarGoods.shoppingCartSkuItemList == null) return;
// int shopSkuIndex = widget.shopCarGoods.shoppingCartSkuItemList
// .indexWhere((element) => skuId == element.id);
// if (shopSkuIndex >= 0) {
// count = widget.shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum;
// realCount = count;
// }
// }
bool skuY(ProductSkuVOListBean productSku, selectSkus) {
bool gg = true;
selectSkus.forEach((element1) {
@ -140,11 +155,7 @@ class _ProductSku extends State<ProductSku> {
Padding(
padding: EdgeInsets.only(top: 4, bottom: 7),
child: Text(
"已选: " +
(selectSkus
.map((e) => "$e")
.toList()
.toString()),
"已选: " + selectSkus.join(" "),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -154,6 +165,7 @@ class _ProductSku extends State<ProductSku> {
),
),
),
///
// Row(
// children: [
@ -175,6 +187,34 @@ class _ProductSku extends State<ProductSku> {
// ),
// ],
// ),
Row(
children: [
if (widget.miNiDetail
.productSkuVOList[_currentSkuIndex].minQty >
1)
Container(
padding: EdgeInsets.symmetric(horizontal: 4.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFFF65720),
style: BorderStyle.solid,
),
),
alignment: Alignment.center,
child: Text(
"${widget.miNiDetail.productSkuVOList[_currentSkuIndex].minQty}份起购",
style: TextStyle(
color: Color(0xFFF65720),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
),
Spacer()
],
)
],
)),
InkWell(
@ -210,7 +250,11 @@ class _ProductSku extends State<ProductSku> {
(attrValue) {
state(() {
selectSkus[position] = attrValue;
buildCount();
_currentSkuIndex = widget
.miNiDetail.productSkuVOList
.indexWhere((element) {
return skuY(element, selectSkus);
});
});
},
widget.miNiDetail.attrList[position],
@ -237,18 +281,116 @@ class _ProductSku extends State<ProductSku> {
),
),
),
if (widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.minQty >
1 &&
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.count ==
1)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
if ((widget?.miNiDetail?.subscribeParam
?.isEnableSubscribe ??
false) ==
false) {
_isTapEd = true;
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
if (widget
.miNiDetail
.productSkuVOList[_currentSkuIndex]
.count ==
1)
await widget.addShopCar(
widget.miNiDetail,
selectSkus,
widget.miNiDetail.productSkuVOList[ _currentSkuIndex].minQty > 1
? widget
.miNiDetail
.productSkuVOList[_currentSkuIndex]
.minQty
: 2);
else
await widget.add(widget.miNiDetail, selectSkus);
}
if ((widget?.miNiDetail?.oversold ?? 0) == 0 &&
widget.miNiDetail.productSkuVOList[_currentSkuIndex] .count >=
(widget?.miNiDetail?.productSkuVOList[0]?.skuStock ?? 0)) {
SmartDialog.showToast("库存不足",
alignment: Alignment.center);
} else {
if (widget.miNiDetail.productSkuVOList[_currentSkuIndex].minQty > 1) {
widget
.miNiDetail
.productSkuVOList[_currentSkuIndex]
.count += widget
.miNiDetail
.productSkuVOList[_currentSkuIndex]
.minQty - 1;
} else {
widget
.miNiDetail
.productSkuVOList[_currentSkuIndex]
.count += 1;
}
}
setState(() {});
EasyLoading.dismiss();
},
child: Container(
margin: EdgeInsets.only(right: 8.w, top: 4.h),
child: RoundButton(
text:
"${widget.miNiDetail.productSkuVOList[_currentSkuIndex].minQty}份起购",
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 3,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w),
),
)),
if ((widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.minQty >
1 &&
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.count !=
1) ||
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.minQty ==
0 ||
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.minQty ==
1)
InkWell(
onTap: () async {
if (count == 1) return;
if (widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.count ==
1) return;
if ((widget?.miNiDetail?.subscribeParam
?.isEnableSubscribe ??
false) ==
false) {
_isTapEd = true;
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
await widget.reduce(widget.miNiDetail, selectSkus);
}
count -= 1;
if (widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.minQty ==
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.count) {
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.count -= (widget.miNiDetail
.productSkuVOList[_currentSkuIndex].minQty);
} else {
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.count -= 1;
}
setState(() {});
EasyLoading.dismiss();
},
@ -258,10 +400,22 @@ class _ProductSku extends State<ProductSku> {
height: 22,
),
),
if ((widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.minQty >
1 &&
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.count !=
1) ||
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.minQty ==
0 ||
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.minQty ==
1)
Padding(
padding: EdgeInsets.only(left: 8, right: 8),
child: Text(
"$count",
"${widget.miNiDetail.productSkuVOList[_currentSkuIndex].count}",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
@ -269,6 +423,18 @@ class _ProductSku extends State<ProductSku> {
),
),
),
if ((widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.minQty >
1 &&
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.count !=
1) ||
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.minQty ==
0 ||
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.minQty ==
1)
InkWell(
onTap: () async {
if ((widget?.miNiDetail?.subscribeParam
@ -276,22 +442,26 @@ class _ProductSku extends State<ProductSku> {
false) ==
false) {
_isTapEd = true;
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
if (count == 1 && realCount == 0)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
if (widget.miNiDetail.productSkuVOList[_currentSkuIndex].count == 1)
await widget.addShopCar(
widget.miNiDetail, selectSkus, 2);
widget.miNiDetail, selectSkus,2);
else
await widget.add(widget.miNiDetail, selectSkus);
}
if ((widget?.miNiDetail?.oversold ?? 0) == 0 &&
count >=
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.count >=
(widget?.miNiDetail?.productSkuVOList[0]
?.skuStock ??
0)) {
SmartDialog.showToast("库存不足",
alignment: Alignment.center);
} else {
count += 1;
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.count += 1;
}
setState(() {});
EasyLoading.dismiss();
@ -320,9 +490,19 @@ class _ProductSku extends State<ProductSku> {
textColor: Colors.white,
fontWeight: MyFontWeight.semi_bold,
radius: 27,
backgroup: Color(0xFF32A060),
backgroup:Color(0xFF32A060),
fontSize: 16.sp,
callback: () {
if(widget.miNiDetail.productSkuVOList[_currentSkuIndex].minQty > 1 && widget.miNiDetail
.productSkuVOList[_currentSkuIndex].count ==1){
SmartDialog.show(
widget: SettlementTips(
() {},
text: "请选择购买数量",
),
);
return;
}
Navigator.of(context).pop();
// SmartDialog.dismiss();
if (!_isTapEd)
@ -334,7 +514,8 @@ class _ProductSku extends State<ProductSku> {
false) ==
false)
? 1
: count);
: widget.miNiDetail
.productSkuVOList[_currentSkuIndex].count);
},
),
if (widget.buttonType == 1)
@ -350,7 +531,11 @@ class _ProductSku extends State<ProductSku> {
callback: () {
Navigator.of(context).pop();
// SmartDialog.dismiss();
widget.addShopCar(widget.miNiDetail, selectSkus, count);
widget.addShopCar(
widget.miNiDetail,
selectSkus,
widget.miNiDetail.productSkuVOList[_currentSkuIndex]
.count);
},
),

76
lib/store/store_view/shop_goods.dart

@ -208,7 +208,7 @@ class _ShopGoods extends State<ShopGoods> {
),
),
SizedBox(
width: 2.w,
width:5.w,
),
// Container(
// width: 44.w,
@ -227,8 +227,71 @@ class _ShopGoods extends State<ShopGoods> {
// ),
// ),
// ),
if((widget.productListBean?.minQty ?? 0).toInt() > 1)
Container(
padding: EdgeInsets.symmetric(horizontal:4.w),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFFF65720),
style: BorderStyle.solid,
),
),
alignment: Alignment.center,
child: Text(
"${widget.productListBean?.minQty ?? 0}份起购",
style: TextStyle(
color: Color(0xFFF65720),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
),
],
),
if((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count == 0 && (widget.productListBean?.attrStyle ?? 0) != 1)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
if (widget.storeInfo.posType.code == "NORMALSTORE" &&
widget.tableId == 0) {
showDeleteDialog();
} else {
if (_jumpType == -1)
queryMiNiDetail(widget.productListBean.id);
else if (_jumpType == 0)
widget.add(widget.shoppingCartSkuItemListBean);
else if (_jumpType == 1)
await Navigator.of(context).pushNamed(
'/router/product_meals_sku',
arguments: {
"id": widget.productListBean.id,
"storeId": widget.productListBean.storeId,
"tableId": widget.tableId
});
widget.queryShoppingCart();
}
},
child:Container(
padding: EdgeInsets.only(
left:50.w,
top: 4.h,
bottom: 4.h,
),
margin: EdgeInsets.only(right: 8.w, top: 4.h),
child: RoundButton(
text:"${widget?.productListBean?.minQty ?? 0}份起购",
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 3,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w),
),
)),
if (!widget.isShopCart &&
(widget.productListBean?.attrStyle ?? 0) == 1 &&
!(widget?.productListBean?.subscribeParam
@ -297,7 +360,8 @@ class _ShopGoods extends State<ShopGoods> {
!(widget?.productListBean?.isSetMeal ?? false))
Spacer(),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0 &&
(widget.productListBean?.attrStyle ?? 0) == 0 && (((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0)
|| (widget.productListBean?.minQty ?? 0).toInt() == 0) &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false) &&
@ -322,7 +386,8 @@ class _ShopGoods extends State<ShopGoods> {
),
),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0 &&
(widget.productListBean?.attrStyle ?? 0) == 0 && (((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0)
|| (widget.productListBean?.minQty ?? 0).toInt() == 0) &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false) &&
@ -339,7 +404,8 @@ class _ShopGoods extends State<ShopGoods> {
),
),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0 &&
(widget.productListBean?.attrStyle ?? 0) == 0 &&(((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0)
|| (widget.productListBean?.minQty ?? 0).toInt() == 0) &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false) &&
@ -375,7 +441,7 @@ class _ShopGoods extends State<ShopGoods> {
}
},
child: Container(
padding: EdgeInsets.only(left: 6.w, right: 9.w),
padding: EdgeInsets.only(left: 6.w, right: 5.5.w),
child: Image.asset(
"assets/image/add.webp",
width: 22,

39
lib/store/store_view/shop_goods_car.dart

@ -40,10 +40,10 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
Widget build(BuildContext context) {
return Container(
color: Colors.white,
padding: EdgeInsets.only(
right: 16.w,
// bottom: 20.h,
),
// padding: EdgeInsets.only(
// right: 16.w,
// // bottom: 20.h,
// ),
child: Column(
children: [
Row(
@ -135,12 +135,10 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
),
],
),
SizedBox(
height: 7.h,
),
Row(
children: [
Row(
Padding(padding:EdgeInsets.only(top: 7.h,bottom: 4.h),
child: Row(
children: [
Text(
"¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price) ?? 0)}",
@ -172,11 +170,13 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
// ),
// ),
],
),
),),
Spacer(),
if (!widget.isShopCart &&
(widget.productListBean?.attrStyle ?? 0) == 1)
Stack(
Container(
padding:EdgeInsets.only(top: 7.h,bottom: 4.h),
child: Stack(
children: [
Container(
margin: EdgeInsets.only(right: 8, top: 4),
@ -219,23 +219,27 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
),
],
),
),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0)
InkWell(
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
widget
.reduce(widget.shoppingCartSkuItemListBean);
widget.reduce(widget.shoppingCartSkuItemListBean);
},
child: Container(
padding: EdgeInsets.only(top: 7.h,bottom: 4.h,left:20.w),
child: Image.asset(
"assets/image/reduce.webp",
width: 22,
height: 22.h,
),
)),
),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0)
Container(
width: 30,
padding: EdgeInsets.only(top: 7.h,bottom: 4.h),
alignment: Alignment.center,
child: Text(
"${widget.count}",
@ -249,19 +253,20 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
widget.add(widget.shoppingCartSkuItemListBean);
},
child: Container(
padding: EdgeInsets.only(right: 16.w,top: 7.h,bottom: 4.h),
child: Image.asset(
"assets/image/add.webp",
width: 22,
height: 22.h,
),
),
],
),
SizedBox(
height: 4.h,
],
),
Text(
"${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.applyPrice) ?? 0)}",

7
lib/store/store_view/store_order_list.dart

@ -211,7 +211,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
.pushNamed('/router/shop_details_page', arguments: {
"id": e.id,
"storeId": e.storeId,
"isSetMeal":e.isSetMeal
"isSetMeal":e.isSetMeal,
"minQty":e.minQty,
});
widget.queryShoppingCart();
}
@ -367,10 +368,10 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
}
return ShopGoods(
(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) {
widget.queryMiNiDetail(e.id, 1);
widget.queryMiNiDetail(e.id, ((e.minQty?? 0).toInt()>1 && count == 0)? (e.minQty??0):1);
},
(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) {
if (count > 0) widget.queryMiNiDetail(e.id, -1);
if (count > 0) widget.queryMiNiDetail(e.id, ((e.minQty?? 0).toInt()>1 && count==(e.minQty??0) )? -(e.minQty??0):-1);
},
productListBean: e,
count: count,

18
lib/union/union_list.dart

@ -107,10 +107,7 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: buildStoreItemSm(),
);
return buildStoreItemSm();
},
):((storeList == null || storeList.length == 0)
? NoDataView(
@ -128,7 +125,8 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
bottom: 100.h,
),
itemBuilder: (context, position) {
return InkWell(
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
{
// if (storeList[position].storeName == "一心回乡商城") {
@ -353,7 +351,15 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
physics:BouncingScrollPhysics(),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {},
onTap: () {Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": storeList[position].id,
"tenant": storeList[position].tenantCode,
"storeName": storeList[position].storeName,
"distance": storeList[position].distance
},
);},
child: unionGoodsItem(
storeList[position].productShow[index]),
);

Loading…
Cancel
Save