Browse Source

1.套餐样式更改;

2.购买商品时增加库存判断;(分别更改点单页,详情页,多规格选择弹窗页;)
3.小程序商品分组增加新字段(isSetMeal),用于判断该商品是否是套餐;
4.套餐内容选择ui更改,如果是唯一项选择(比如:1选1,或者3选3这种类型),默认数量为1,减少多于操作;
5.订单结算页增加套餐内容明细显示;
6.发表动态,异步加载样式更改;(异步加载时,如若发表的是图文,加载圈底部则会显示第一张图片共同加载,发表视频则,也显示视频的首图用于底部加载,文字,则会将文字内容用于底部加载);
7.积分兑换板块,增加集换卡兑换,在原有的基础上,增加集换卡兑换(oneBean);
8.积分兑换板块,样式逻辑更改;使用顺序:集换卡-积分-积分+现金-纯现金;
9.创建积分订单接口,原:isPoints废弃;改用:payType,传积分类型(1=积分 2=集卡券 3=人民币混用);
10.应付金额优化,做部分调整;
new_revision_app
wurong 2 years ago
parent
commit
e60ceb5c7f
  1. 2
      lib/community/release_dynamic.dart
  2. 3
      lib/home/points_mall_view/points_goods_view.dart
  3. 20
      lib/integral_store/integral_store_details_page.dart
  4. 80
      lib/main_page.dart
  5. 174
      lib/order/exchange_order_page.dart
  6. 3
      lib/retrofit/data/findMiNiGroupList.dart
  7. 6
      lib/retrofit/data/goods.dart
  8. 2
      lib/retrofit/min_api.dart
  9. 2
      lib/retrofit/min_api.g.dart
  10. 2
      lib/retrofit/retrofit_api.dart
  11. 66
      lib/settlement/settlement_view/settlement_order_commodity.dart
  12. 18
      lib/store/shop_details_page.dart
  13. 5
      lib/store/store_order.dart
  14. 58
      lib/store/store_view/product_meals_sku.dart
  15. 40
      lib/store/store_view/product_sku.dart
  16. 94
      lib/store/store_view/shop_goods.dart
  17. 54
      lib/store/store_view/shop_goods_car.dart
  18. 1
      lib/store/store_view/store_order_list.dart
  19. 40
      lib/utils/upload_async.dart
  20. 2
      pubspec.yaml

2
lib/community/release_dynamic.dart

@ -381,6 +381,8 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
maxLines: 5,
style: TextStyle(
fontSize: 14.sp,
height: 1.3,
letterSpacing:1,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),

3
lib/home/points_mall_view/points_goods_view.dart

@ -22,6 +22,9 @@ class PointGoods extends StatefulWidget {
class _PointGoods extends State<PointGoods> {
String pointPrice(Goods goods) {
if (goods == null) return "";
if (goods?.oneBean != null && goods?.oneBean != "0") {
return "${goods?.oneBean}印章";
}
if (goods?.onePrice != null && goods?.onePrice != "0") {
return S.of(context).jifen_(goods?.onePrice);
} else if ((goods?.onePrice == null || goods?.onePrice == "0") &&

20
lib/integral_store/integral_store_details_page.dart

@ -62,15 +62,18 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
if (baseData != null && baseData.isSuccess) {
setState(() {
goods = baseData.data;
if(goods != null && points != null && double.tryParse(goods.onePrice)
!= 0 && double.tryParse(goods.onePrice) <= double.tryParse(points)){
if(goods != null && points != null && double.tryParse(goods?.oneBean ?? "0")
!= 0 && double.tryParse(goods?.oneBean ?? "0") <= double.tryParse(points)){
payType = 1;
} else if(goods != null && points != null && double.tryParse(goods.onePrice)
!= 0 && double.tryParse(goods.onePrice) <= double.tryParse(points)){
payType = 2;
} else if (goods != null && points != null && double.tryParse(goods.price) != 0 && double.tryParse(goods.price)
<= double.tryParse(points) && double.tryParse(goods.money) != 0.00){
payType = 2;
payType = 3;
} else if (goods != null && points != null
&& double.tryParse(goods.oneMoney) != 0.00){
payType = 3;
payType = 4;
}
refreshController.refreshCompleted();
});
@ -82,7 +85,9 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
String pointPrice(){
if(goods == null)
return "";
if(goods?.onePrice!=null && goods?.onePrice!="0"){
if(goods?.oneBean!=null && goods?.oneBean!="0"){
return "${goods?.oneBean}印章";
}else if(goods?.onePrice!=null && goods?.onePrice!="0"){
return S.of(context).jifen_(goods?.onePrice);
}else if((goods?.onePrice == null || goods?.onePrice == "0") && ((goods?.price != null && goods?.price != "0") || (goods?.money != null && goods?.money != "0.00"))){
return (goods?.price== "0"|| goods?.price == null ? "" : S.of(context).jifen_(goods?.price)) + (goods?.money== "0"|| goods?.money == null ? "" : " + ${AppUtils.calculateDouble(double.tryParse(goods?.money) ?? 0)}");
@ -168,7 +173,7 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
if(payType > 0){
toExchangeOrder();
}else{
SmartDialog.showToast("您的积分不足!", alignment: Alignment.center);
SmartDialog.showToast(pointPrice().contains("印章")?"您的印章数量不足!" : "您的积分不足!", alignment: Alignment.center);
return;
}
},
@ -187,7 +192,7 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
child: Text(
(payType > 0)
? "立即兑换"
: S.of(context).jifenbuzu,
: pointPrice().contains("印章")?"您的印章数量不足" :S.of(context).jifenbuzu,
// "兑换功能暂未开放",
style: TextStyle(
fontSize: 16.sp,
@ -211,6 +216,7 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
"money": goods.money,
"onePrice":goods.onePrice,
"oneMoney":goods.oneMoney,
"oneBean":goods.oneBean,
"price": goods.price,
"image": goods.mainImgPath,
"payType":payType,

80
lib/main_page.dart

@ -55,6 +55,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
final GlobalKey minePageKey = GlobalKey();
final GlobalKey unionPageKey = GlobalKey();
final GlobalKey vipPageKey = GlobalKey();
// List<String> iconn;
ApiService apiService;
int lastTime = DateTime.now().millisecondsSinceEpoch;
@ -87,7 +88,11 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
@override
void initState() {
super.initState();
pageController = PageController(initialPage: widget.arguments != null && widget.arguments["index"] != null ? widget.arguments["index"]:0);
pageController = PageController(
initialPage:
widget.arguments != null && widget.arguments["index"] != null
? widget.arguments["index"]
: 0);
if (widget.arguments != null && widget.arguments["index"] != null)
clickIndex = widget.arguments["index"];
WidgetsBinding.instance.addObserver(this);
@ -103,7 +108,6 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
..userInteractions = false
..dismissOnTap = false;
initSdk();
pushRoute();
@ -112,32 +116,43 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
var interviewCouponList;
var firstLoginCouponList;
if(widget.arguments != null && (widget.arguments["invite"]??"") != ""
&& widget.arguments["interviewCouponList"] != null ){
if (widget.arguments != null &&
(widget.arguments["invite"] ?? "") != "" &&
widget.arguments["interviewCouponList"] != null) {
invite = widget.arguments["invite"];
interviewCouponList = widget.arguments["interviewCouponList"];
}
if(widget.arguments != null && widget.arguments["firstLoginCouponList"] != null ){
if (widget.arguments != null &&
widget.arguments["firstLoginCouponList"] != null) {
firstLoginCouponList = widget.arguments["firstLoginCouponList"];
}
_widgetOptions = <Widget>[
// BrandPage(),
HomePage(homePageKey,(index,jpIndex) {
HomePage(
homePageKey,
(index, jpIndex) {
if (index == 1) {
if (unionPageKey?.currentState != null) {
UnionPageState state = unionPageKey.currentState;
state.jumpIndex(jpIndex);
}else _widgetOptions[1] = UnionPage(unionPageKey,jpIndex);
} else
_widgetOptions[1] = UnionPage(unionPageKey, jpIndex);
}
setState(() {
pageController.jumpToPage(index);
});
},invite:invite,interviewCouponList:interviewCouponList,firstLoginCouponList:firstLoginCouponList,),
},
invite: invite,
interviewCouponList: interviewCouponList,
firstLoginCouponList: firstLoginCouponList,
),
// MainHomePage(),
UnionPage(unionPageKey, 0),
VipPage(vipPageKey),
Platform.isAndroid ? (ExamineInstance.instance.isExamine?OrderPage():CommunityPage()) :CommunityPage(),
Platform.isAndroid
? (ExamineInstance.instance.isExamine ? OrderPage() : CommunityPage())
: CommunityPage(),
// CommunityPage(),
MinePage(minePageKey),
];
@ -167,9 +182,12 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
///App自动更新
appAutoUpdate();
}
final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin();
initSdk() async {
xgFlutterPlugin.stopXg();
///ios startXg前需要调用此方法
xgFlutterPlugin.configureClusterDomainName("tpns.sh.tencent.com");
xgFlutterPlugin.setEnableDebug(true);
@ -292,37 +310,45 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
String routeName = "";
Map<String, dynamic> params = {};
switch (pushMap["typed"].toString()) {
case "1":case "ARTICLE":
case "1":
case "ARTICLE":
routeName = "/router/web_page";
params["articleId"] = pushMap["info"];
break;
case "2":case "ACTIVITY":
case "2":
case "ACTIVITY":
routeName = "/router/web_page";
params["activityId"] = pushMap["info"];
break;
case "3":case "SHOP":
case "3":
case "SHOP":
routeName = "/router/store_order";
params["id"] = pushMap["info"];
params["tenant"] = pushMap["tenant"];
params["storeName"] = pushMap["storeName"];
break;
case "4":case "CREDIT_GOODS":
case "4":
case "CREDIT_GOODS":
routeName = "/router/integral_store_page";
params["goodsId"] = pushMap["info"];
break;
case "5":case "ORDER":
case "5":
case "ORDER":
routeName = "/router/order_details";
params["id"] = pushMap["info"];
break;
case "6":case "MEMBER":
case "6":
case "MEMBER":
routeName = "/router/community_details";
params["businessId"] = pushMap["info"];
break;
case "8":case "WALLET":
case "8":
case "WALLET":
routeName = "/router/mine_wallet";
params["id"] = pushMap["info"];
break;
case "9":case "WELFARE":
case "9":
case "WELFARE":
routeName = "/router/welfare_page";
params["id"] = pushMap["info"];
break;
@ -372,12 +398,15 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
);
}
PackageInfo packageInfo = await PackageInfo.fromPlatform();
BaseData<AppUpdate> baseData = await apiService.appVersion().catchError((onError) {});
BaseData<AppUpdate> baseData =
await apiService.appVersion().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
// baseData.data.appLastVersion = "2.0.17";
// baseData.data.appLastVersionUp = "1.0.1";
if(AppUtils.versionCompare(packageInfo.version,baseData.data?.appLastVersion)
&& AppUtils.versionCompare(value.getString("appLastVersion")??"1.0.0",baseData.data?.appLastVersion)){
if (AppUtils.versionCompare(
packageInfo.version, baseData.data?.appLastVersion) &&
AppUtils.versionCompare(value.getString("appLastVersion") ?? "1.0.0",
baseData.data?.appLastVersion)) {
showDialog(
context: context,
barrierDismissible: false,
@ -393,8 +422,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
return;
}
} else {
SmartDialog.showToast(baseData.msg,
alignment: Alignment.center);
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
Navigator.of(context).pop();
}
}
@ -443,7 +471,13 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
bottomNavigationItem(S.of(context).main_menu2, 1),
// bottomNavigationItem(S.of(context).main_menu3 , 2),
bottomNavigationItem(S.of(context).main_menu5, 2),
bottomNavigationItem(Platform.isAndroid ? (ExamineInstance.instance.isExamine?"订单":S.of(context).main_menu3) :S.of(context).main_menu3, 3),
bottomNavigationItem(
Platform.isAndroid
? (ExamineInstance.instance.isExamine
? "订单"
: S.of(context).main_menu3)
: S.of(context).main_menu3,
3),
bottomNavigationItem(S.of(context).main_menu4, 4),
],
),

174
lib/order/exchange_order_page.dart

@ -62,7 +62,9 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
'/router/exchange_order_success_page',
arguments: {
"id": widget.arguments["goodsId"],
"price": realPay.contains("积分") ? realPay.substring(0,realPay.indexOf("积分")) : "0",
"price": realPay.contains("积分")
? realPay.substring(0, realPay.indexOf("积分"))
: "0",
"points": points,
"realPay": realPay,
"payChannel": widget.arguments["payChannel"],
@ -73,18 +75,17 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
return;
}
});
}
@override
void dispose() {
super.dispose();
if(payListen!=null)
payListen.cancel();
if (payListen != null) payListen.cancel();
}
queryUserBalance() async {
BaseData<UserInfo> baseData = await apiService.queryInfo().catchError((onError) {});
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
mBalance = double.tryParse(userInfo.money);
@ -125,8 +126,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
spreadRadius: 0,
)
],
borderRadius:
BorderRadius.all(Radius.circular(8)),
borderRadius: BorderRadius.all(Radius.circular(8)),
),
child: Column(
children: [
@ -213,16 +213,14 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
toAddressPicker();
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: Text(
(address != null &&
address != "")
(address != null && address != "")
? address
: widget.arguments[
"useTyped"] ==
@ -236,11 +234,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
? S
.of(context)
.qingxuanzeshouhuodizhi
: S
.of(context)
.xuni,
overflow:
TextOverflow.ellipsis,
: S.of(context).xuni,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF32A060),
@ -268,8 +263,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
Row(
children: [
Visibility(
visible:
widget.arguments["useTyped"] != 3,
visible: widget.arguments["useTyped"] != 3,
child: Text(
S.of(context).zitishijian,
style: TextStyle(
@ -278,24 +272,20 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
),
),
Visibility(
visible:
widget.arguments["useTyped"] != 3,
visible: widget.arguments["useTyped"] != 3,
child: SizedBox(
width: 12.w,
),
),
Text(
widget.arguments["useTyped"] == 1
? S
.of(context)
.duihuanhouwugegongzuori
? S.of(context).duihuanhouwugegongzuori
: widget.arguments["useTyped"] == 2
? S.of(context).duihuanhoufahuo
: S.of(context).feishiwushangpin,
style: TextStyle(
fontSize: 14.sp,
color:
widget.arguments["useTyped"] == 3
color: widget.arguments["useTyped"] == 3
? Color(0xFF32A060)
: Color(0xFF353535)),
),
@ -644,20 +634,30 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
width: 12,
),
Text(
widget.arguments["payType"] == 1
? "${(double.parse(widget.arguments["onePrice"]) * buyNum).toInt()}积分"
: ((widget.arguments["price"] == null ||
widget.arguments["price"] == "0"
? ""
: "${(double.parse(widget.arguments["price"]) * buyNum).toInt()}积分") +
(widget.arguments["money"] == null ||
widget.arguments["money"] ==
"0.00"
? ""
: " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}")),
// widget.arguments["payType"] == 1
// ? "${(double.parse(widget.arguments["oneBean"] ?? "0") * buyNum).toInt()}印章"
// : (widget.arguments["payType"] == 2 ?"${(double.parse(widget.arguments["onePrice"]) * buyNum).toInt()}积分"
// :((widget.arguments["price"] == null ||
// widget.arguments["price"] == "0"
// ? (widget.arguments["oneBean"] != "0" && double.parse(userInfo?.points ?? "0") <= double.parse(widget.arguments["oneBean"] ??"0")
// ? "${AppUtils.calculateDouble(double.parse(widget.arguments["oneBean"] ?? "0") * buyNum)}印章"
// :(widget.arguments["onePrice"] != "0" && double.parse(userInfo?.points ?? "0") <= double.parse(widget.arguments["onePrice"])
// ?"${AppUtils.calculateDouble(double.parse(widget.arguments["onePrice"]) * buyNum)}积分"
// :"${AppUtils.calculateDouble(double.parse(widget.arguments["oneMoney"]) * buyNum)}"))
// : "${(double.parse(widget.arguments["price"]) * buyNum).toInt()}积分") +
// (widget.arguments["money"] == null ||
// widget.arguments["money"] ==
// "0.00"
// ? ""
// : " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}"))),
payableAmount(),
style: TextStyle(
fontSize: 12,
decoration: (widget.arguments["payType"] == 3)
decoration: (widget.arguments["payType"] ==
4 &&
((widget.arguments["price"] != "0" && widget.arguments["money"] != "0.00"
|| (widget.arguments["oneBean"] ?? "0") != "0"
|| widget.arguments["onePrice"] != "0")))
? TextDecoration.lineThrough
: TextDecoration.none,
fontFamily: 'JDZhengHT',
@ -669,13 +669,17 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
SizedBox(
height: 12,
),
if (widget.arguments["payType"] == 3)
if (widget.arguments["payType"] == 4 &&
(widget.arguments["price"] != "0" &&
widget.arguments["money"] != "0.00" ||
(widget.arguments["oneBean"] ?? "0") != "0" ||
widget.arguments["onePrice"] != "0"))
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"现金抵扣积分",
payableAmount().contains("印章")? "现金抵扣印章":"现金抵扣积分",
style: TextStyle(
fontSize: 14,
color: Color(0xFF353535),
@ -685,7 +689,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
width: 12,
),
Text(
"${double.parse(widget.arguments["oneMoney"]) * buyNum}",
"${AppUtils.calculateDouble(double.parse(widget.arguments["oneMoney"]) * buyNum)}",
style: TextStyle(
fontSize: 12,
fontFamily: 'JDZhengHT',
@ -715,7 +719,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
handleNeedPay(),
style: TextStyle(
fontFamily: 'JDZhengHT',
fontSize: 12.sp, color: Color(0xFF32A060)),
fontSize: 12.sp,
color: Color(0xFF32A060)),
),
],
),
@ -778,16 +783,23 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
setState(() {
if (widget.arguments["payType"] == 1
? (double.parse(widget
.arguments["onePrice"]) *
.arguments["oneBean"]) *
(buyNum + 1)) >
double.parse(points)
: (widget.arguments["price"] == null ||
widget.arguments["price"] == "0"
: (widget.arguments["payType"] == 2
? (double.parse(widget.arguments[
"onePrice"]) *
(buyNum + 1)) >
double.parse(points)
: (widget.arguments["price"] ==
null ||
widget.arguments["price"] ==
"0"
? false
: (double.parse(widget
.arguments["price"]) *
(buyNum + 1)) >
double.parse(points))) {
double.parse(points)))) {
SmartDialog.showToast("您的积分不足",
alignment: Alignment.center);
return;
@ -806,8 +818,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
],
),
),
if (widget.arguments["payType"] == 3 ||
(widget.arguments["payType"] == 2 &&
if (widget.arguments["payType"] == 4 ||
(widget.arguments["payType"] == 3 &&
widget.arguments["money"] != "0.00"))
Container(
width: double.infinity,
@ -971,11 +983,10 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
height: 54.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(
45
),
borderRadius: BorderRadius.circular(45),
),
margin: EdgeInsets.only(bottom:20.h,left: 16.w,right: 16.w),
margin:
EdgeInsets.only(bottom: 20.h, left: 16.w, right: 16.w),
child: Row(
children: [
Spacer(),
@ -1019,8 +1030,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
),
),
child: Text(
widget.arguments["payType"] == 3 ||
(widget.arguments["payType"] == 2 &&
widget.arguments["payType"] == 4 ||
(widget.arguments["payType"] == 3 &&
widget.arguments["money"] != "0.00")
? S.current.jiesuan
: S.current.duihuan,
@ -1029,7 +1040,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),),
),
),
),
],
),
@ -1053,12 +1065,39 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
);
}
String handleNeedPay() {
if(widget.arguments["payType"] == 0)
return "";
///
String payableAmount() {
if (widget.arguments["payType"] == 0) return "";
if (widget.arguments["payType"] == 1) {
return S.of(context).jifen_((double.parse(widget.arguments["onePrice"]) * buyNum).toInt());
return "${(double.parse(widget.arguments["oneBean"] ?? "0") * buyNum).toInt()}印章";
} else if (widget.arguments["payType"] == 2) {
return "${(double.parse(widget.arguments["onePrice"]) * buyNum).toInt()}积分";
} else if (widget.arguments["payType"] == 3) {
return "${(double.parse(widget.arguments["price"]) * buyNum).toInt()}积分" + " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}";
} else if (widget.arguments["payType"] == 4) {
if ((widget.arguments["oneBean"] ?? "0") != "0") {
return "${AppUtils.calculateDouble(double.parse(widget.arguments["oneBean"] ?? "0") * buyNum)}印章";
} else if (widget.arguments["onePrice"] != "0") {
return "${AppUtils.calculateDouble(double.parse(widget.arguments["onePrice"]) * buyNum)}积分";
} else if ((widget.arguments["price"] != null || widget.arguments["price"] != "0") && (widget.arguments["money"] != null || widget.arguments["money"] != "0.00")) {
if(widget.arguments["price"] == "0"){
return "${AppUtils.calculateDouble(double.parse(widget.arguments["oneMoney"]) * buyNum)}";
}
return "${(double.parse(widget.arguments["price"]) * buyNum).toInt()}积分" + " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}";
}
}
}
///
String handleNeedPay() {
if (widget.arguments["payType"] == 0) return "";
if (widget.arguments["payType"] == 1) {
return "${(double.parse(widget.arguments["oneBean"]) * buyNum).toInt()}印章";
}
if (widget.arguments["payType"] == 2) {
return S.of(context).jifen_(
(double.parse(widget.arguments["onePrice"]) * buyNum).toInt());
} else if (widget.arguments["payType"] == 3) {
return (widget.arguments["price"] == null ||
widget.arguments["price"] == "0"
? ""
@ -1067,7 +1106,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
widget.arguments["money"] == "0.00"
? ""
: " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}");
}else if(widget.arguments["payType"] == 3){
} else if (widget.arguments["payType"] == 4) {
return "${AppUtils.calculateDouble(double.tryParse(widget.arguments["oneMoney"]) * buyNum) ?? 0}";
}
}
@ -1123,8 +1162,13 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
}
BaseData baseDate = await apiService.creditOrder({
"goodsId": widget.arguments["goodsId"],
"isOneSell": widget.arguments["payType"] != 2,
"isPoints": !handleNeedPay().contains(""),
"isOneSell": widget.arguments["payType"] != 3,
///payType
// "isPoints": !handleNeedPay().contains(""),
"payType": (widget.arguments["payType"] == 1)
? 2
: ((widget.arguments["payType"] == 2) ? 1 : 3),
"number": buyNum,
"useTyped": widget.arguments["useTyped"],
"payChannel":
@ -1134,8 +1178,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
});
if (baseDate.isSuccess) {
String realPay = handleNeedPay();
if ((widget.arguments["payType"] == 3 ||
(widget.arguments["payType"] == 2 &&
if ((widget.arguments["payType"] == 4 ||
(widget.arguments["payType"] == 3 &&
widget.arguments["money"] != "0.00")) &&
checkIndex == 3) {
// if(Platform.isAndroid){
@ -1165,7 +1209,9 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
}
await Navigator.of(context)
.pushNamed('/router/exchange_order_success_page', arguments: {
"price": realPay.contains("积分") ? realPay.substring(0,realPay.indexOf("积分")) : "0",
"price": realPay.contains("积分")
? realPay.substring(0, realPay.indexOf("积分"))
: "0",
"realPay": realPay,
"points": points,
"payChannel": widget.arguments["payChannel"],

3
lib/retrofit/data/findMiNiGroupList.dart

@ -103,6 +103,7 @@ class ProductListBean {
String printerFlag;
dynamic markProductNone;
SubscribeParam subscribeParam;
bool isSetMeal;
static ProductListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null;
@ -137,6 +138,7 @@ class ProductListBean {
productListBean.printerFlag = map['printerFlag'];
productListBean.markProductNone = map['markProductNone'];
productListBean.subscribeParam = SubscribeParam.fromJson(map['subscribeParam']);
productListBean.isSetMeal = map['isSetMeal'];
return productListBean;
}
@ -171,6 +173,7 @@ class ProductListBean {
"printerFlag": printerFlag,
"markProductNone": markProductNone,
"subscribeParam": subscribeParam,
"isSetMeal": isSetMeal,
};
}

6
lib/retrofit/data/goods.dart

@ -42,6 +42,7 @@ class Goods {
String money,
String onePrice,
String oneMoney,
String oneBean,
String orderId,
int stock,
int sales,
@ -69,6 +70,7 @@ class Goods {
_money = money;
_onePrice = onePrice;
_oneMoney = oneMoney;
_oneBean = oneBean;
_orderId = orderId;
_stock = stock;
_sales = sales;
@ -99,6 +101,7 @@ class Goods {
_money = json['money'];
_onePrice = json['onePrice'];
_oneMoney = json['oneMoney'];
_oneBean = json['oneBean'];
_orderId = json['orderId'];
_stock = json['stock'];
_sales = json['sales'];
@ -127,6 +130,7 @@ class Goods {
String _money;
String _onePrice;
String _oneMoney;
String _oneBean;
String _orderId;
int _stock;
int _sales;
@ -155,6 +159,7 @@ class Goods {
String get money => _money;
String get onePrice => _onePrice;
String get oneMoney => _oneMoney;
String get oneBean => _oneBean;
String get orderId => _orderId;
int get stock => _stock;
int get sales => _sales;
@ -185,6 +190,7 @@ class Goods {
map['money'] = _money;
map['onePrice'] = _onePrice;
map['oneMoney'] = _oneMoney;
map['oneBean'] = _oneBean;
map['orderId'] = _orderId;
map['stock'] = _stock;
map['sales'] = _sales;

2
lib/retrofit/min_api.dart

@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart';
part 'min_api.g.dart';
const localBaseUrl = "http://192.168.10.78:8765/app/";///
const localBaseUrl = "http://192.168.10.129:8765/app/";///
// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线

2
lib/retrofit/min_api.g.dart

@ -194,7 +194,7 @@ class _MinApiService implements MinApiService {
data: _data);
final value = BaseData<List<ShoppingCart>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
(json) => ((json??"") == "")?null:(json as List<dynamic>)
.map<ShoppingCart>(
(i) => ShoppingCart.fromJson(i as Map<String, dynamic>))
.toList());

2
lib/retrofit/retrofit_api.dart

@ -66,7 +66,7 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart';
const localBaseUrl = "http://192.168.10.78:8766/app/";///
const localBaseUrl = "http://192.168.10.129:8766/app/";///
// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线

66
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -10,6 +10,8 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/separator.dart';
import '../../retrofit/data/shoppingCart.dart';
class SettlementOrderCommodity extends StatefulWidget {
final int isTakeOut;
final int tableId;
@ -181,7 +183,9 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
Widget commodityItem(OrderProductVOList productList) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row(
child: Column(
children: [
Row(
children: [
MImage(
productList.skuImg,
@ -263,7 +267,65 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
),
)
],
)
),
],
),
if(productList.setMealDataList.length != 0)
ListView.builder(
itemCount: productList.setMealDataList.length,
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
itemBuilder: (context, index) {
return orderMealsItem(productList.setMealDataList[index]);
},
),
],
),
);
}
Widget orderMealsItem(SetMealDataList setMealDataList) {
return Container(
margin: EdgeInsets.symmetric(vertical:10.h,),
child: Row(
children: [
Expanded(
flex:2,
child: Text(
setMealDataList.productInfoList[0].productName,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Color(0xffA29E9E),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
),
Expanded(flex:3,
child: Text(
"${(setMealDataList.productInfoList[0].skuName == "") ? "": setMealDataList.productInfoList[0].skuName}",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Color(0xffA29E9E),
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
),
),
),
Text(
"x${setMealDataList.productInfoList[0].buyNumber.toString()}",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Color(0xffFF7A1A),
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
),
),
],
),
);

18
lib/store/shop_details_page.dart

@ -64,12 +64,14 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
String parentId;
int numberOfPeople = 0;
int index;
bool isSetMeal;
@override
void initState() {
super.initState();
id = widget.arguments["id"];
storeId = widget.arguments["storeId"];
isSetMeal = widget.arguments["isSetMeal"] ?? false;
// SharedPreferences.getInstance().then((value) {
// String minToken = value.getString("minToken");
// String tenant = value.getString("tenant");
@ -841,10 +843,22 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
),
)),
GestureDetector(
onTap: () {
onTap: () async {
if (storeInfo.posType.code == "NORMALSTORE" &&
tableId == 0) {
showDeleteDialog();
} else if (isSetMeal == true) {
await Navigator.of(context).pushNamed(
'/router/product_meals_sku',
arguments: {
"id": id,
"storeId": storeId,
"tableId": tableId
});
queryShopCar().then((value) {
this.shopCarGoods = value;
setState(() {});
});
} else {
_queryMiNiDetail(id, counts);
}
@ -875,6 +889,8 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
false) ==
true)
? S.of(context).lijiyuyue
: (isSetMeal ?? false) == true
? "选套餐"
: "加入购物车",
style: TextStyle(
fontSize: 12.sp,

5
lib/store/store_order.dart

@ -426,6 +426,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
];
},
body:
///
TabBarView(
physics: NeverScrollableScrollPhysics(),
@ -969,6 +970,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
this.shopCarGoods = await queryShopCar();
debugPrint("count.toString()");
setState(() {});
} else {
SmartDialog.showToast(baseDate.msg, alignment: Alignment.center);
}
}
@ -1014,6 +1017,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
this.shopCarGoods = value;
setState(() {});
});
} else {
SmartDialog.showToast(baseDate.msg, alignment: Alignment.center);
}
}

58
lib/store/store_view/product_meals_sku.dart

@ -316,6 +316,7 @@ class _ProductMealsSku extends State<ProductMealsSku> {
return Container(
margin: EdgeInsets.symmetric(vertical: 16.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MImage(
productSetMeals[position].productInfoList[index].productImg ?? "",
@ -332,7 +333,9 @@ class _ProductMealsSku extends State<ProductMealsSku> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
Padding(
padding: EdgeInsets.symmetric(vertical: 8.h),
child: Row(
children: [
Expanded(
child: Text(
@ -384,8 +387,9 @@ class _ProductMealsSku extends State<ProductMealsSku> {
)
],
),
SizedBox(height: 8.h),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (productSetMeals[position]
.productInfoList[index]
@ -410,6 +414,31 @@ class _ProductMealsSku extends State<ProductMealsSku> {
),
),
Spacer(),
if (productSetMeals[position]
.productInfoList[index]
.skuInfoList
.where((element) => element.isSelected)
.isNotEmpty &&
productSetMeals[position].productInfoList[index].count >
0)
Padding(
padding: EdgeInsets.only(right: 4.w),
child: Text(
"x${productSetMeals[position].productInfoList[index].count}",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Color(0xffFF7A1A),
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
),
),
),
if (productSetMeals[position]
.productInfoList[index]
.productAttrInfoList[0]
.attrName ==
"")
InkWell(
onTap: () {
setState(() {
@ -428,13 +457,25 @@ class _ProductMealsSku extends State<ProductMealsSku> {
height: 22.h,
),
),
if (productSetMeals[position]
.productInfoList[index]
.productAttrInfoList[0]
.attrName ==
"")
Container(
width: 30,
alignment: Alignment.center,
child: Text(
productSetMeals[position]
(productSetMeals[position].totalNumber > 1 &&
productSetMeals[position].totalNumber !=
productSetMeals[position].optionalNumber)
? productSetMeals[position]
.productInfoList[index]
.count
.toString()
: (productSetMeals[position]
.productInfoList[index]
.count = 1)
.toString(),
style: TextStyle(
color: Colors.black,
@ -443,6 +484,11 @@ class _ProductMealsSku extends State<ProductMealsSku> {
),
),
),
if (productSetMeals[position]
.productInfoList[index]
.productAttrInfoList[0]
.attrName ==
"")
GestureDetector(
onTap: () {
setState(() {
@ -461,7 +507,11 @@ class _ProductMealsSku extends State<ProductMealsSku> {
total += element.count;
});
if (total >=
productSetMeals[position].optionalNumber) {
productSetMeals[position].optionalNumber ||
productSetMeals[position]
.productInfoList[index]
.count >=
1) {
SmartDialog.showToast("抱歉,无法加购更多",
alignment: Alignment.center);
return;

40
lib/store/store_view/product_sku.dart

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart';
@ -237,9 +238,11 @@ class _ProductSku extends State<ProductSku> {
),
InkWell(
onTap: () async {
if(count == 1)
return;
if((widget?.miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == false){
if (count == 1) return;
if ((widget?.miNiDetail?.subscribeParam
?.isEnableSubscribe ??
false) ==
false) {
_isTapEd = true;
EasyLoading.show(status: S.current.zhengzaijiazai);
await widget.reduce(widget.miNiDetail, selectSkus);
@ -267,7 +270,10 @@ class _ProductSku extends State<ProductSku> {
),
InkWell(
onTap: () async {
if((widget?.miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == false){
if ((widget?.miNiDetail?.subscribeParam
?.isEnableSubscribe ??
false) ==
false) {
_isTapEd = true;
EasyLoading.show(status: S.current.zhengzaijiazai);
if (count == 1 && realCount == 0)
@ -276,7 +282,16 @@ class _ProductSku extends State<ProductSku> {
else
await widget.add(widget.miNiDetail, selectSkus);
}
if ((widget?.miNiDetail?.oversold ?? 0) == 0 &&
count >=
(widget?.miNiDetail?.productSkuVOList[0]
?.skuStock ??
0)) {
SmartDialog.showToast("库存不足",
alignment: Alignment.center);
} else {
count += 1;
}
setState(() {});
EasyLoading.dismiss();
},
@ -295,7 +310,12 @@ class _ProductSku extends State<ProductSku> {
RoundButton(
width: double.infinity,
height: 54.h,
text: (widget?.miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == true ? S.of(context).lijiyuyue:"加入购物车",
text:
(widget?.miNiDetail?.subscribeParam?.isEnableSubscribe ??
false) ==
true
? S.of(context).lijiyuyue
: "加入购物车",
textColor: Colors.white,
fontWeight: MyFontWeight.semi_bold,
radius: 27,
@ -305,7 +325,15 @@ class _ProductSku extends State<ProductSku> {
Navigator.of(context).pop();
// SmartDialog.dismiss();
if (!_isTapEd)
widget.addShopCar(widget.miNiDetail, selectSkus,((widget?.miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == false) ? 1 : count);
widget.addShopCar(
widget.miNiDetail,
selectSkus,
((widget?.miNiDetail?.subscribeParam
?.isEnableSubscribe ??
false) ==
false)
? 1
: count);
},
),
if (widget.buttonType == 1)

94
lib/store/store_view/shop_goods.dart

@ -1,6 +1,7 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.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/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart';
@ -232,7 +233,8 @@ class _ShopGoods extends State<ShopGoods> {
(widget.productListBean?.attrStyle ?? 0) == 1 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
false) &&
!(widget?.productListBean?.isSetMeal ?? false))
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
@ -249,8 +251,6 @@ class _ShopGoods extends State<ShopGoods> {
0);
}
},
child: Container(
// padding: EdgeInsets.only(right: 16.w),
child: Stack(
children: [
Container(
@ -288,19 +288,20 @@ class _ShopGoods extends State<ShopGoods> {
),
),
],
),
)),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
false) &&
!(widget?.productListBean?.isSetMeal ?? false))
Spacer(),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
false) &&
!(widget?.productListBean?.isSetMeal ?? false))
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
@ -324,7 +325,8 @@ class _ShopGoods extends State<ShopGoods> {
(widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
false) &&
!(widget?.productListBean?.isSetMeal ?? false))
Container(
alignment: Alignment.center,
child: Text(
@ -340,7 +342,8 @@ class _ShopGoods extends State<ShopGoods> {
(widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false))
false) &&
!(widget?.productListBean?.isSetMeal ?? false))
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
@ -348,7 +351,14 @@ class _ShopGoods extends State<ShopGoods> {
widget.tableId == 0) {
showDeleteDialog();
} else {
if (_jumpType == -1)
if ((widget?.productListBean?.oversold ?? 0) == 0 &&
widget.count >=
(widget?.shoppingCartSkuItemListBean
?.skuStock ??
0)) {
SmartDialog.showToast("库存不足",
alignment: Alignment.center);
} else if (_jumpType == -1)
queryMiNiDetail(widget.productListBean.id);
else if (_jumpType == 0)
widget.add(widget.shoppingCartSkuItemListBean);
@ -413,6 +423,72 @@ class _ShopGoods extends State<ShopGoods> {
vertical: 5.h, horizontal: 3.w),
),
)),
if ((widget.productListBean.isSetMeal ?? false) == true)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
if (widget.storeInfo.posType.code ==
"NORMALSTORE" &&
widget.tableId == 0) {
showDeleteDialog();
} else if ((widget?.productListBean?.oversold ??
0) ==
0 &&
widget.count >=
(widget?.shoppingCartSkuItemListBean
?.skuStock ??
0)) {
SmartDialog.showToast("库存不足",
alignment: Alignment.center);
} else {
await Navigator.of(context).pushNamed(
'/router/product_meals_sku',
arguments: {
"id": widget.productListBean.id,
"storeId": widget.productListBean.storeId,
"tableId": widget.tableId
});
widget.queryShoppingCart();
}
},
child: Stack(
children: [
Container(
padding: EdgeInsets.only(
left: 35.w,
top: 4.h,
bottom: 4.h,
),
margin: EdgeInsets.only(right: 8.w, top: 4.h),
child: RoundButton(
text: "选套餐",
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 3,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w),
),
),
Positioned(
right: 0,
child: Visibility(
visible: widget.count > 0,
child: RoundButton(
width: 17,
height: 17.h,
text: "${widget.count}",
textColor: Color(0xFF32A060),
fontWeight: MyFontWeight.regular,
backgroup: Colors.white,
fontSize: 12.sp,
radius: 100,
),
),
),
],
))
],
),
SizedBox(

54
lib/store/store_view/shop_goods_car.dart

@ -1,4 +1,5 @@
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/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart';
@ -77,7 +78,8 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
child: Text(
widget.productListBean != null
? widget.productListBean.productName
: widget.shoppingCartSkuItemListBean.productName,
: widget
.shoppingCartSkuItemListBean.productName,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
@ -112,7 +114,13 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
child: Text(
(widget.productListBean != null
? widget.productListBean.shortName
: ((widget.shoppingCartSkuItemListBean.skuName == "0") ? "": widget.shoppingCartSkuItemListBean.skuName ) ?? ""),
: ((widget.shoppingCartSkuItemListBean
.skuName ==
"0")
? ""
: widget.shoppingCartSkuItemListBean
.skuName) ??
""),
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
@ -180,12 +188,14 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
radius: 3,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
padding:
EdgeInsets.symmetric(vertical: 5.h),
callback: () {
widget.queryMiNiDetail(
widget.productListBean != null
? widget.productListBean.id
: widget.shoppingCartSkuItemListBean
: widget
.shoppingCartSkuItemListBean
.productId,
0);
},
@ -213,7 +223,8 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
(widget.productListBean?.attrStyle ?? 0) == 0)
InkWell(
onTap: () {
widget.reduce(widget.shoppingCartSkuItemListBean);
widget
.reduce(widget.shoppingCartSkuItemListBean);
},
child: Image.asset(
"assets/image/reduce.webp",
@ -239,7 +250,18 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
(widget.productListBean?.attrStyle ?? 0) == 0)
GestureDetector(
onTap: () {
widget.add(widget.shoppingCartSkuItemListBean);
if ((widget?.productListBean?.oversold ?? 0) ==
0 &&
widget.count >=
(widget?.shoppingCartSkuItemListBean
?.skuStock ??
0)) {
SmartDialog.showToast("库存不足",
alignment: Alignment.center);
} else {
widget
.add(widget.shoppingCartSkuItemListBean);
}
},
child: Image.asset(
"assets/image/add.webp",
@ -269,22 +291,24 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
),
if (widget.shoppingCartSkuItemListBean.setMealDataList.length != 0)
ListView.builder(
itemCount: widget.shoppingCartSkuItemListBean.setMealDataList.length,
itemCount:
widget.shoppingCartSkuItemListBean.setMealDataList.length,
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
itemBuilder: (context, index) {
return shopCarMealsItem(widget.shoppingCartSkuItemListBean.setMealDataList[index]);
return shopCarMealsItem(widget
.shoppingCartSkuItemListBean.setMealDataList[index]);
},
),
SizedBox(height:15.h,)
],
SizedBox(
height: 15.h,
)
);
],
));
}
Widget shopCarMealsItem(SetMealDataList setMealDataList) {
return Container(
margin: EdgeInsets.symmetric(vertical: 10.h, horizontal: 16.w),
@ -303,7 +327,8 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
),
),
),
Expanded(flex:3,
Expanded(
flex: 3,
child: Text(
"${(setMealDataList.productInfoList[0].skuName == "") ? "默认" : setMealDataList.productInfoList[0].skuName}",
overflow: TextOverflow.ellipsis,
@ -316,7 +341,7 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
),
),
Text(
setMealDataList.productInfoList[0].buyNumber.toString(),
"x${setMealDataList.productInfoList[0].buyNumber.toString()}",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
@ -329,5 +354,4 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
),
);
}
}

1
lib/store/store_view/store_order_list.dart

@ -189,6 +189,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
.pushNamed('/router/shop_details_page', arguments: {
"id": e.id,
"storeId": e.storeId,
"isSetMeal":e.isSetMeal
});
widget.queryShoppingCart();
}

40
lib/utils/upload_async.dart

@ -5,6 +5,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:image_pickers/image_pickers.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:thumbnails/thumbnails.dart';
@ -12,6 +13,8 @@ import '../community/release_dynamic.dart';
import '../retrofit/data/base_data.dart';
import '../retrofit/data/upload_result.dart';
import '../retrofit/retrofit_api.dart';
import '../view_widget/custom_image.dart';
import 'font_weight.dart';
class UploadAsync {
static void upload(int dynamicType, List<Medias> mediaPaths,
@ -22,12 +25,43 @@ class UploadAsync {
margin: EdgeInsets.only(
right: 10.w,
),
child: CircularProgressIndicator(
strokeWidth: 4.0,
backgroundColor: Colors.green,
child: Stack(
alignment: Alignment.center,
children: [
Container(
width: 50.h,
height: 70.h,
decoration: BoxDecoration(
color: Colors.grey, borderRadius: BorderRadius.circular(2)),
child: dynamicType == 0
? Text(
dynamicText,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 10.sp,
color: Color(0xFFCDCCCC),
),
)
: ClipRRect(
borderRadius: BorderRadius.circular(2),
child: Image.file(
File(mediaPaths[0].galleryMode == GalleryMode.video
? mediaPaths[0].thumbPath
: mediaPaths[0].path),
fit: BoxFit.cover,
width: double.infinity,
height: double.infinity,
),
),
),
CircularProgressIndicator(
strokeWidth: 3.0,
backgroundColor: Colors.white,
// value: 0.4,
valueColor: new AlwaysStoppedAnimation<Color>(Colors.grey),
),
],
),
),
maskWidgetTemp: SizedBox(),
);

2
pubspec.yaml

@ -3,7 +3,7 @@ description: 一心回乡.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 3.2.13+57
version: 3.2.14+58
environment:
sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save