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. 264
      lib/main_page.dart
  5. 998
      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. 202
      lib/settlement/settlement_view/settlement_order_commodity.dart
  12. 20
      lib/store/shop_details_page.dart
  13. 13
      lib/store/store_order.dart
  14. 264
      lib/store/store_view/product_meals_sku.dart
  15. 42
      lib/store/store_view/product_sku.dart
  16. 166
      lib/store/store_view/shop_goods.dart
  17. 504
      lib/store/store_view/shop_goods_car.dart
  18. 1
      lib/store/store_view/store_order_list.dart
  19. 58
      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, maxLines: 5,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
height: 1.3,
letterSpacing:1,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C), 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> { class _PointGoods extends State<PointGoods> {
String pointPrice(Goods goods) { String pointPrice(Goods goods) {
if (goods == null) return ""; if (goods == null) return "";
if (goods?.oneBean != null && goods?.oneBean != "0") {
return "${goods?.oneBean}印章";
}
if (goods?.onePrice != null && goods?.onePrice != "0") { if (goods?.onePrice != null && goods?.onePrice != "0") {
return S.of(context).jifen_(goods?.onePrice); return S.of(context).jifen_(goods?.onePrice);
} else if ((goods?.onePrice == null || goods?.onePrice == "0") && } 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) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
goods = baseData.data; goods = baseData.data;
if(goods != null && points != null && double.tryParse(goods.onePrice) if(goods != null && points != null && double.tryParse(goods?.oneBean ?? "0")
!= 0 && double.tryParse(goods.onePrice) <= double.tryParse(points)){ != 0 && double.tryParse(goods?.oneBean ?? "0") <= double.tryParse(points)){
payType = 1; 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) } else if (goods != null && points != null && double.tryParse(goods.price) != 0 && double.tryParse(goods.price)
<= double.tryParse(points) && double.tryParse(goods.money) != 0.00){ <= double.tryParse(points) && double.tryParse(goods.money) != 0.00){
payType = 2; payType = 3;
} else if (goods != null && points != null } else if (goods != null && points != null
&& double.tryParse(goods.oneMoney) != 0.00){ && double.tryParse(goods.oneMoney) != 0.00){
payType = 3; payType = 4;
} }
refreshController.refreshCompleted(); refreshController.refreshCompleted();
}); });
@ -82,7 +85,9 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
String pointPrice(){ String pointPrice(){
if(goods == null) if(goods == null)
return ""; 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); 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"))){ }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)}"); 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){ if(payType > 0){
toExchangeOrder(); toExchangeOrder();
}else{ }else{
SmartDialog.showToast("您的积分不足!", alignment: Alignment.center); SmartDialog.showToast(pointPrice().contains("印章")?"您的印章数量不足!" : "您的积分不足!", alignment: Alignment.center);
return; return;
} }
}, },
@ -187,7 +192,7 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
child: Text( child: Text(
(payType > 0) (payType > 0)
? "立即兑换" ? "立即兑换"
: S.of(context).jifenbuzu, : pointPrice().contains("印章")?"您的印章数量不足" :S.of(context).jifenbuzu,
// "兑换功能暂未开放", // "兑换功能暂未开放",
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
@ -211,6 +216,7 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
"money": goods.money, "money": goods.money,
"onePrice":goods.onePrice, "onePrice":goods.onePrice,
"oneMoney":goods.oneMoney, "oneMoney":goods.oneMoney,
"oneBean":goods.oneBean,
"price": goods.price, "price": goods.price,
"image": goods.mainImgPath, "image": goods.mainImgPath,
"payType":payType, "payType":payType,

264
lib/main_page.dart

@ -55,6 +55,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
final GlobalKey minePageKey = GlobalKey(); final GlobalKey minePageKey = GlobalKey();
final GlobalKey unionPageKey = GlobalKey(); final GlobalKey unionPageKey = GlobalKey();
final GlobalKey vipPageKey = GlobalKey(); final GlobalKey vipPageKey = GlobalKey();
// List<String> iconn; // List<String> iconn;
ApiService apiService; ApiService apiService;
int lastTime = DateTime.now().millisecondsSinceEpoch; int lastTime = DateTime.now().millisecondsSinceEpoch;
@ -73,11 +74,11 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
break; break;
case AppLifecycleState.resumed: // case AppLifecycleState.resumed: //
pushRoute(); pushRoute();
if(DateTime.now().millisecondsSinceEpoch - lastTime > 420000) if (DateTime.now().millisecondsSinceEpoch - lastTime > 420000)
Navigator.of(context).popAndPushNamed('/router/start_page'); Navigator.of(context).popAndPushNamed('/router/start_page');
break; break;
case AppLifecycleState.paused: // case AppLifecycleState.paused: //
lastTime = DateTime.now().millisecondsSinceEpoch; lastTime = DateTime.now().millisecondsSinceEpoch;
break; break;
case AppLifecycleState.detached: // APP结束时调用 case AppLifecycleState.detached: // APP结束时调用
break; break;
@ -87,8 +88,12 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
pageController = PageController(initialPage: widget.arguments != null && widget.arguments["index"] != null ? widget.arguments["index"]:0); pageController = PageController(
if(widget.arguments != null && widget.arguments["index"] != null) initialPage:
widget.arguments != null && widget.arguments["index"] != null
? widget.arguments["index"]
: 0);
if (widget.arguments != null && widget.arguments["index"] != null)
clickIndex = widget.arguments["index"]; clickIndex = widget.arguments["index"];
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
EasyLoading.instance EasyLoading.instance
@ -103,7 +108,6 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
..userInteractions = false ..userInteractions = false
..dismissOnTap = false; ..dismissOnTap = false;
initSdk(); initSdk();
pushRoute(); pushRoute();
@ -112,32 +116,43 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
var interviewCouponList; var interviewCouponList;
var firstLoginCouponList; var firstLoginCouponList;
if(widget.arguments != null && (widget.arguments["invite"]??"") != "" if (widget.arguments != null &&
&& widget.arguments["interviewCouponList"] != null ){ (widget.arguments["invite"] ?? "") != "" &&
widget.arguments["interviewCouponList"] != null) {
invite = widget.arguments["invite"]; invite = widget.arguments["invite"];
interviewCouponList = widget.arguments["interviewCouponList"]; interviewCouponList = widget.arguments["interviewCouponList"];
} }
if(widget.arguments != null && widget.arguments["firstLoginCouponList"] != null ){ if (widget.arguments != null &&
widget.arguments["firstLoginCouponList"] != null) {
firstLoginCouponList = widget.arguments["firstLoginCouponList"]; firstLoginCouponList = widget.arguments["firstLoginCouponList"];
} }
_widgetOptions = <Widget>[ _widgetOptions = <Widget>[
// BrandPage(), // BrandPage(),
HomePage(homePageKey,(index,jpIndex) { HomePage(
if(index == 1){ homePageKey,
if(unionPageKey?.currentState != null) { (index, jpIndex) {
UnionPageState state = unionPageKey.currentState; if (index == 1) {
state.jumpIndex(jpIndex); if (unionPageKey?.currentState != null) {
}else _widgetOptions[1] = UnionPage(unionPageKey,jpIndex); UnionPageState state = unionPageKey.currentState;
} state.jumpIndex(jpIndex);
setState(() { } else
pageController.jumpToPage(index); _widgetOptions[1] = UnionPage(unionPageKey, jpIndex);
}); }
},invite:invite,interviewCouponList:interviewCouponList,firstLoginCouponList:firstLoginCouponList,), setState(() {
pageController.jumpToPage(index);
});
},
invite: invite,
interviewCouponList: interviewCouponList,
firstLoginCouponList: firstLoginCouponList,
),
// MainHomePage(), // MainHomePage(),
UnionPage(unionPageKey,0), UnionPage(unionPageKey, 0),
VipPage(vipPageKey), VipPage(vipPageKey),
Platform.isAndroid ? (ExamineInstance.instance.isExamine?OrderPage():CommunityPage()) :CommunityPage(), Platform.isAndroid
? (ExamineInstance.instance.isExamine ? OrderPage() : CommunityPage())
: CommunityPage(),
// CommunityPage(), // CommunityPage(),
MinePage(minePageKey), MinePage(minePageKey),
]; ];
@ -167,9 +182,12 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
///App自动更新 ///App自动更新
appAutoUpdate(); appAutoUpdate();
} }
final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin();
initSdk() async { initSdk() async {
xgFlutterPlugin.stopXg(); xgFlutterPlugin.stopXg();
///ios startXg前需要调用此方法 ///ios startXg前需要调用此方法
xgFlutterPlugin.configureClusterDomainName("tpns.sh.tencent.com"); xgFlutterPlugin.configureClusterDomainName("tpns.sh.tencent.com");
xgFlutterPlugin.setEnableDebug(true); xgFlutterPlugin.setEnableDebug(true);
@ -217,7 +235,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
if (Platform.isAndroid) { if (Platform.isAndroid) {
xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler( xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler(
MyNativeEventHandler( MyNativeEventHandler(
(String title, String message, String customContent, int type) { (String title, String message, String customContent, int type) {
print("xgPushClickAction2: $customContent"); print("xgPushClickAction2: $customContent");
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
value.setString("pushData", customContent); value.setString("pushData", customContent);
@ -234,7 +252,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
if (Platform.isAndroid if (Platform.isAndroid
? (event["actionType"] == 0) ? (event["actionType"] == 0)
: (event["xg"]["msgtype"] == 1) && : (event["xg"]["msgtype"] == 1) &&
event[Platform.isAndroid ? "customMessage" : "custom"] != null) { event[Platform.isAndroid ? "customMessage" : "custom"] != null) {
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
value.setString("pushData", value.setString("pushData",
event[Platform.isAndroid ? "customMessage" : "custom"]); event[Platform.isAndroid ? "customMessage" : "custom"]);
@ -249,15 +267,15 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
} }
return event; return event;
}, onReceiveNotificationResponse: (event) async { }, onReceiveNotificationResponse: (event) async {
try{ try {
if(jsonDecode(event["customMessage"])["typed"] == 6){ if (jsonDecode(event["customMessage"])["typed"] == 6) {
// HomePageState state = homePageKey.currentState; // HomePageState state = homePageKey.currentState;
// state.queryMsgStats(); // state.queryMsgStats();
MinePageState state = minePageKey.currentState; MinePageState state = minePageKey.currentState;
state.queryMsgStats(); state.queryMsgStats();
} }
}catch(ex){} } catch (ex) {}
print("onReceiveNotificationResponse: ${event.toString()}"); print("onReceiveNotificationResponse: ${event.toString()}");
return event; return event;
}, onReceiveMessage: (event) async { }, onReceiveMessage: (event) async {
@ -277,7 +295,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
if (sharedPreferences.getString("token") == null || if (sharedPreferences.getString("token") == null ||
sharedPreferences.getString("token") == "") return; sharedPreferences.getString("token") == "") return;
String startIntent; String startIntent;
if(Platform.isAndroid) startIntent= await Bridge.getStartIntent(); if (Platform.isAndroid) startIntent = await Bridge.getStartIntent();
print("intent:$startIntent"); print("intent:$startIntent");
String pushData = ""; String pushData = "";
if (startIntent != null && startIntent != "") { if (startIntent != null && startIntent != "") {
@ -292,37 +310,45 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
String routeName = ""; String routeName = "";
Map<String, dynamic> params = {}; Map<String, dynamic> params = {};
switch (pushMap["typed"].toString()) { switch (pushMap["typed"].toString()) {
case "1":case "ARTICLE": case "1":
case "ARTICLE":
routeName = "/router/web_page"; routeName = "/router/web_page";
params["articleId"] = pushMap["info"]; params["articleId"] = pushMap["info"];
break; break;
case "2":case "ACTIVITY": case "2":
case "ACTIVITY":
routeName = "/router/web_page"; routeName = "/router/web_page";
params["activityId"] = pushMap["info"]; params["activityId"] = pushMap["info"];
break; break;
case "3":case "SHOP": case "3":
case "SHOP":
routeName = "/router/store_order"; routeName = "/router/store_order";
params["id"] = pushMap["info"]; params["id"] = pushMap["info"];
params["tenant"] = pushMap["tenant"]; params["tenant"] = pushMap["tenant"];
params["storeName"] = pushMap["storeName"]; params["storeName"] = pushMap["storeName"];
break; break;
case "4":case "CREDIT_GOODS": case "4":
case "CREDIT_GOODS":
routeName = "/router/integral_store_page"; routeName = "/router/integral_store_page";
params["goodsId"] = pushMap["info"]; params["goodsId"] = pushMap["info"];
break; break;
case "5":case "ORDER": case "5":
case "ORDER":
routeName = "/router/order_details"; routeName = "/router/order_details";
params["id"] = pushMap["info"]; params["id"] = pushMap["info"];
break; break;
case "6":case "MEMBER": case "6":
case "MEMBER":
routeName = "/router/community_details"; routeName = "/router/community_details";
params["businessId"] = pushMap["info"]; params["businessId"] = pushMap["info"];
break; break;
case "8":case "WALLET": case "8":
case "WALLET":
routeName = "/router/mine_wallet"; routeName = "/router/mine_wallet";
params["id"] = pushMap["info"]; params["id"] = pushMap["info"];
break; break;
case "9":case "WELFARE": case "9":
case "WELFARE":
routeName = "/router/welfare_page"; routeName = "/router/welfare_page";
params["id"] = pushMap["info"]; params["id"] = pushMap["info"];
break; break;
@ -366,35 +392,37 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null) { if (apiService == null) {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
); );
} }
PackageInfo packageInfo = await PackageInfo.fromPlatform(); 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) { if (baseData != null && baseData.isSuccess) {
// baseData.data.appLastVersion = "2.0.17"; // baseData.data.appLastVersion = "2.0.17";
// baseData.data.appLastVersionUp = "1.0.1"; // baseData.data.appLastVersionUp = "1.0.1";
if(AppUtils.versionCompare(packageInfo.version,baseData.data?.appLastVersion) if (AppUtils.versionCompare(
&& AppUtils.versionCompare(value.getString("appLastVersion")??"1.0.0",baseData.data?.appLastVersion)){ packageInfo.version, baseData.data?.appLastVersion) &&
AppUtils.versionCompare(value.getString("appLastVersion") ?? "1.0.0",
baseData.data?.appLastVersion)) {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (BuildContext context) { builder: (BuildContext context) {
return WillPopScope( return WillPopScope(
child:UpdateDialog(packageInfo.version,baseData.data), child: UpdateDialog(packageInfo.version, baseData.data),
onWillPop: () async { onWillPop: () async {
return Future.value(false); return Future.value(false);
}); });
}, },
); );
}else{ } else {
return; return;
} }
}else{ } else {
SmartDialog.showToast(baseData.msg, SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
alignment: Alignment.center);
Navigator.of(context).pop(); 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_menu2, 1),
// bottomNavigationItem(S.of(context).main_menu3 , 2), // bottomNavigationItem(S.of(context).main_menu3 , 2),
bottomNavigationItem(S.of(context).main_menu5, 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), bottomNavigationItem(S.of(context).main_menu4, 4),
], ],
), ),
@ -525,72 +559,72 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
); );
} }
// Widget bottomNavigationBigItem(text, index) { // Widget bottomNavigationBigItem(text, index) {
// var isSelected = index == clickIndex; // var isSelected = index == clickIndex;
// return Expanded( // return Expanded(
// child: InkWell( // child: InkWell(
// onTap: () { // onTap: () {
// setState(() { // setState(() {
// clickIndex = index; // clickIndex = index;
// pageController.jumpToPage(clickIndex); // pageController.jumpToPage(clickIndex);
// }); // });
// }, // },
// child: Container( // child: Container(
// width: 45.w, // width: 45.w,
// alignment: Alignment.center, // alignment: Alignment.center,
// child: AnimatedCrossFade( // child: AnimatedCrossFade(
// firstCurve: Curves.easeIn, // firstCurve: Curves.easeIn,
// secondCurve: Curves.ease, // secondCurve: Curves.ease,
// sizeCurve: Curves.easeInOut, // sizeCurve: Curves.easeInOut,
// duration: Duration(milliseconds: 50), // duration: Duration(milliseconds: 50),
// firstChild: Container( // firstChild: Container(
// padding: EdgeInsets.all(4), // padding: EdgeInsets.all(4),
// height: 82.h, // height: 82.h,
// alignment: // alignment:
// Platform.isAndroid ? Alignment.center : Alignment.topCenter, // Platform.isAndroid ? Alignment.center : Alignment.topCenter,
// child: Image.asset( // child: Image.asset(
// icons[index], // icons[index],
// width: 45, // width: 45,
// height: 45, // height: 45,
// fit: BoxFit.contain, // fit: BoxFit.contain,
// ), // ),
// ), // ),
// secondChild: Column( // secondChild: Column(
// mainAxisAlignment: Platform.isAndroid // mainAxisAlignment: Platform.isAndroid
// ? MainAxisAlignment.center // ? MainAxisAlignment.center
// : MainAxisAlignment.start, // : MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
// children: [ // children: [
// if (Platform.isIOS) // if (Platform.isIOS)
// SizedBox( // SizedBox(
// height: 4.h, // height: 4.h,
// ), // ),
// Image.asset( // Image.asset(
// iconn[index], // iconn[index],
// width: 30, // width: 30,
// height: 30, // height: 30,
// fit: BoxFit.contain, // fit: BoxFit.contain,
// ), // ),
// SizedBox( // SizedBox(
// height: 1.h, // height: 1.h,
// ), // ),
// Text( // Text(
// text, // text,
// style: TextStyle( // style: TextStyle(
// fontSize: 10.sp, // fontSize: 10.sp,
// fontWeight: MyFontWeight.semi_bold, // fontWeight: MyFontWeight.semi_bold,
// color: Color(isSelected ? 0xFF4C4C4C : 0xFFA29E9E), // color: Color(isSelected ? 0xFF4C4C4C : 0xFFA29E9E),
// ), // ),
// ), // ),
// ], // ],
// ), // ),
// crossFadeState: isSelected // crossFadeState: isSelected
// ? CrossFadeState.showFirst // ? CrossFadeState.showFirst
// : CrossFadeState.showSecond, // : CrossFadeState.showSecond,
// ), // ),
// ), // ),
// ), // ),
// flex: 1, // flex: 1,
// ); // );
// } // }
} }

998
lib/order/exchange_order_page.dart

File diff suppressed because it is too large Load Diff

3
lib/retrofit/data/findMiNiGroupList.dart

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

6
lib/retrofit/data/goods.dart

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

2
lib/retrofit/min_api.dart

@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart';
part 'min_api.g.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 localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/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); data: _data);
final value = BaseData<List<ShoppingCart>>.fromJson( final value = BaseData<List<ShoppingCart>>.fromJson(
_result.data, _result.data,
(json) => (json as List<dynamic>) (json) => ((json??"") == "")?null:(json as List<dynamic>)
.map<ShoppingCart>( .map<ShoppingCart>(
(i) => ShoppingCart.fromJson(i as Map<String, dynamic>)) (i) => ShoppingCart.fromJson(i as Map<String, dynamic>))
.toList()); .toList());

2
lib/retrofit/retrofit_api.dart

@ -66,7 +66,7 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.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 localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线

202
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/custom_image.dart';
import 'package:huixiang/view_widget/separator.dart'; import 'package:huixiang/view_widget/separator.dart';
import '../../retrofit/data/shoppingCart.dart';
class SettlementOrderCommodity extends StatefulWidget { class SettlementOrderCommodity extends StatefulWidget {
final int isTakeOut; final int isTakeOut;
final int tableId; final int tableId;
@ -181,89 +183,149 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
Widget commodityItem(OrderProductVOList productList) { Widget commodityItem(OrderProductVOList productList) {
return Container( return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row( child: Column(
children: [ children: [
MImage( Row(
productList.skuImg, children: [
width: 55, MImage(
height: 55, productList.skuImg,
fit: BoxFit.cover, width: 55,
radius: BorderRadius.circular(4), height: 55,
errorSrc: "assets/image/default_1.webp", fit: BoxFit.cover,
fadeSrc: "assets/image/default_1.webp", radius: BorderRadius.circular(4),
), errorSrc: "assets/image/default_1.webp",
Expanded( fadeSrc: "assets/image/default_1.webp",
flex: 1,
child: Container(
margin: EdgeInsets.only(
left: 8.w,
), ),
// height: 44.h, Expanded(
child: Column( flex: 1,
mainAxisAlignment: MainAxisAlignment.spaceAround, child: Container(
crossAxisAlignment: CrossAxisAlignment.start, margin: EdgeInsets.only(
children: [ left: 8.w,
Text(
productList.productName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 4.h,
), ),
Text( // height: 44.h,
productList.skuNameStr != null child: Column(
? "${productList.skuNameStr ?? ""}" mainAxisAlignment: MainAxisAlignment.spaceAround,
: "", crossAxisAlignment: CrossAxisAlignment.start,
overflow: TextOverflow.ellipsis, children: [
style: TextStyle( Text(
fontSize: 10.sp, productList.productName,
color: Color(0xFFA29E9E), maxLines: 1,
), overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 4.h,
),
Text(
productList.skuNameStr != null
? "${productList.skuNameStr ?? ""}"
: "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
Text(
"x${productList.buyNum}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF727272),
),
),
],
), ),
),
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text( Text(
"x${productList.buyNum}", 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"))),
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontWeight: MyFontWeight.medium,
color: Color(0xFF727272), fontSize: 14.sp,
color: Color(0xFF4C4C4C),
), ),
), ),
if (productList.discountAmount != null && productList.discountAmount != "0")
Text(
S.of(context).yuan_(productList.sellPrice),
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
fontFamily: 'JDZhengHT',
decoration: TextDecoration.lineThrough,
color: Color(0xFFA29E9E),
),
)
], ],
), ),
],
),
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,
),
), ),
), ),
Column( Expanded(flex:3,
mainAxisAlignment: MainAxisAlignment.start, child: Text(
crossAxisAlignment: CrossAxisAlignment.end, "${(setMealDataList.productInfoList[0].skuName == "") ? "": setMealDataList.productInfoList[0].skuName}",
children: [ overflow: TextOverflow.ellipsis,
Text( maxLines: 1,
productList.buyNum > 1 style: TextStyle(
? S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - AppUtils.stringAsFixedDouble2((double.tryParse(productList.discountAmount ?? "0") / productList.buyNum)))) color: Color(0xffA29E9E),
: S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - double.tryParse(productList.discountAmount ?? "0"))), fontSize: 13.sp,
style: TextStyle( fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFF4C4C4C),
),
), ),
if (productList.discountAmount != null && productList.discountAmount != "0") ),
Text( ),
S.of(context).yuan_(productList.sellPrice), Text(
style: TextStyle( "x${setMealDataList.productInfoList[0].buyNumber.toString()}",
fontWeight: MyFontWeight.regular, overflow: TextOverflow.ellipsis,
fontSize: 12.sp, maxLines: 1,
fontFamily: 'JDZhengHT', style: TextStyle(
decoration: TextDecoration.lineThrough, color: Color(0xffFF7A1A),
color: Color(0xFFA29E9E), fontSize: 13.sp,
), fontWeight: MyFontWeight.regular,
) ),
], ),
)
], ],
), ),
); );

20
lib/store/shop_details_page.dart

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

13
lib/store/store_order.dart

@ -426,6 +426,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
]; ];
}, },
body: body:
/// ///
TabBarView( TabBarView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -656,9 +657,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
"cid": cid, "cid": cid,
"shoppingCart": shopCarGoods, "shoppingCart": shopCarGoods,
"numberOfPeople": numberOfPeople, "numberOfPeople": numberOfPeople,
"distance":widget.arguments["distance"], "distance": widget.arguments["distance"],
"vipLevelName":memberVo.memberRankVo.rankName, "vipLevelName": memberVo.memberRankVo.rankName,
"isVips":memberVo.isVip, "isVips": memberVo.isVip,
"distance": widget.arguments["distance"], "distance": widget.arguments["distance"],
"subscribeParam": miNiDetail?.subscribeParam, "subscribeParam": miNiDetail?.subscribeParam,
}, },
@ -693,7 +694,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
color: Colors.white.withAlpha(76), color: Colors.white.withAlpha(76),
), ),
), ),
autoplay: (storeInfo?.bannerList?.length ?? 0) == 0 ? false :true, autoplay: (storeInfo?.bannerList?.length ?? 0) == 0 ? false : true,
duration: 1000, duration: 1000,
autoplayDelay: 2000, autoplayDelay: 2000,
itemBuilder: (context, position) { itemBuilder: (context, position) {
@ -969,6 +970,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
this.shopCarGoods = await queryShopCar(); this.shopCarGoods = await queryShopCar();
debugPrint("count.toString()"); debugPrint("count.toString()");
setState(() {}); setState(() {});
} else {
SmartDialog.showToast(baseDate.msg, alignment: Alignment.center);
} }
} }
@ -1014,6 +1017,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
this.shopCarGoods = value; this.shopCarGoods = value;
setState(() {}); setState(() {});
}); });
} else {
SmartDialog.showToast(baseDate.msg, alignment: Alignment.center);
} }
} }

264
lib/store/store_view/product_meals_sku.dart

@ -316,6 +316,7 @@ class _ProductMealsSku extends State<ProductMealsSku> {
return Container( return Container(
margin: EdgeInsets.symmetric(vertical: 16.h), margin: EdgeInsets.symmetric(vertical: 16.h),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
MImage( MImage(
productSetMeals[position].productInfoList[index].productImg ?? "", productSetMeals[position].productInfoList[index].productImg ?? "",
@ -332,60 +333,63 @@ class _ProductMealsSku extends State<ProductMealsSku> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Padding(
children: [ padding: EdgeInsets.symmetric(vertical: 8.h),
Expanded( child: Row(
child: Text( children: [
productSetMeals[position] Expanded(
.productInfoList[index]
.productName ??
"",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Colors.black,
fontSize: 13.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
),
if (productSetMeals[position]
.productInfoList[index]
.productAttrInfoList[0]
.attrName !=
"")
GestureDetector(
child: Text( child: Text(
S.of(context).xuanguige, productSetMeals[position]
.productInfoList[index]
.productName ??
"",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 13.sp, fontSize: 13.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.semi_bold,
), ),
), ),
onTap: () {
showSkuDialog(position, index);
},
), ),
if (productSetMeals[position] if (productSetMeals[position]
.productInfoList[index] .productInfoList[index]
.productAttrInfoList[0] .productAttrInfoList[0]
.attrName != .attrName !=
"") "")
GestureDetector( GestureDetector(
onTap: () { child: Text(
showSkuDialog(position, index); S.of(context).xuanguige,
}, style: TextStyle(
child: Icon( color: Colors.black,
Icons.chevron_right, fontSize: 13.sp,
color: Colors.black, fontWeight: MyFontWeight.regular,
size: 18, ),
),
onTap: () {
showSkuDialog(position, index);
},
), ),
) if (productSetMeals[position]
], .productInfoList[index]
.productAttrInfoList[0]
.attrName !=
"")
GestureDetector(
onTap: () {
showSkuDialog(position, index);
},
child: Icon(
Icons.chevron_right,
color: Colors.black,
size: 18,
),
)
],
),
), ),
SizedBox(height: 8.h),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
if (productSetMeals[position] if (productSetMeals[position]
.productInfoList[index] .productInfoList[index]
@ -410,77 +414,123 @@ class _ProductMealsSku extends State<ProductMealsSku> {
), ),
), ),
Spacer(), Spacer(),
InkWell( if (productSetMeals[position]
onTap: () {
setState(() {
if (productSetMeals[position]
.productInfoList[index]
.count >=
1)
productSetMeals[position]
.productInfoList[index]
.count -= 1;
});
},
child: Image.asset(
"assets/image/reduce.webp",
width: 22,
height: 22.h,
),
),
Container(
width: 30,
alignment: Alignment.center,
child: Text(
productSetMeals[position]
.productInfoList[index] .productInfoList[index]
.count .skuInfoList
.toString(), .where((element) => element.isSelected)
style: TextStyle( .isNotEmpty &&
color: Colors.black, productSetMeals[position].productInfoList[index].count >
fontSize: 14.sp, 0)
fontWeight: MyFontWeight.medium, 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]
GestureDetector( .productInfoList[index]
onTap: () { .productAttrInfoList[0]
setState(() { .attrName ==
if (productSetMeals[position] "")
InkWell(
onTap: () {
setState(() {
if (productSetMeals[position]
.productInfoList[index]
.count >=
1)
productSetMeals[position]
.productInfoList[index] .productInfoList[index]
.productAttrInfoList[0] .count -= 1;
.attrName !=
"") {
showSkuDialog(position, index);
return;
}
int total = 0;
productSetMeals[position]
.productInfoList
.forEach((element) {
total += element.count;
}); });
if (total >= },
productSetMeals[position].optionalNumber) { child: Image.asset(
SmartDialog.showToast("抱歉,无法加购更多", "assets/image/reduce.webp",
alignment: Alignment.center); width: 22,
return; height: 22.h,
} ),
if (productSetMeals[position] ),
if (productSetMeals[position]
.productInfoList[index]
.productAttrInfoList[0]
.attrName ==
"")
Container(
width: 30,
alignment: Alignment.center,
child: Text(
(productSetMeals[position].totalNumber > 1 &&
productSetMeals[position].totalNumber !=
productSetMeals[position].optionalNumber)
? productSetMeals[position]
.productInfoList[index] .productInfoList[index]
.count == .count
0) .toString()
: (productSetMeals[position]
.productInfoList[index]
.count = 1)
.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
if (productSetMeals[position]
.productInfoList[index]
.productAttrInfoList[0]
.attrName ==
"")
GestureDetector(
onTap: () {
setState(() {
if (productSetMeals[position]
.productInfoList[index]
.productAttrInfoList[0]
.attrName !=
"") {
showSkuDialog(position, index);
return;
}
int total = 0;
productSetMeals[position] productSetMeals[position]
.productInfoList[index] .productInfoList
.count += 1; .forEach((element) {
}); total += element.count;
}, });
child: Image.asset( if (total >=
"assets/image/add.webp", productSetMeals[position].optionalNumber ||
width: 22, productSetMeals[position]
height: 22.h, .productInfoList[index]
.count >=
1) {
SmartDialog.showToast("抱歉,无法加购更多",
alignment: Alignment.center);
return;
}
if (productSetMeals[position]
.productInfoList[index]
.count ==
0)
productSetMeals[position]
.productInfoList[index]
.count += 1;
});
},
child: Image.asset(
"assets/image/add.webp",
width: 22,
height: 22.h,
),
), ),
),
], ],
), ),
SizedBox( SizedBox(

42
lib/store/store_view/product_sku.dart

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

166
lib/store/store_view/shop_goods.dart

@ -1,6 +1,7 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart'; import 'package:huixiang/retrofit/data/shoppingCart.dart';
@ -232,7 +233,8 @@ class _ShopGoods extends State<ShopGoods> {
(widget.productListBean?.attrStyle ?? 0) == 1 && (widget.productListBean?.attrStyle ?? 0) == 1 &&
!(widget?.productListBean?.subscribeParam !(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ?? ?.isEnableSubscribe ??
false)) false) &&
!(widget?.productListBean?.isSetMeal ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () async { onTap: () async {
@ -249,58 +251,57 @@ class _ShopGoods extends State<ShopGoods> {
0); 0);
} }
}, },
child: Container( child: Stack(
// padding: EdgeInsets.only(right: 16.w), children: [
child: Stack( Container(
children: [ padding: EdgeInsets.only(
Container( left: 35.w,
padding: EdgeInsets.only( top: 4.h,
left: 35.w, bottom: 4.h,
top: 4.h,
bottom: 4.h,
),
margin: EdgeInsets.only(right:8.w,top: 4.h),
child: RoundButton(
text: S.of(context).xuanguige,
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 3,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w),
),
), ),
Positioned( margin: EdgeInsets.only(right: 8.w, top: 4.h),
right: 0, child: RoundButton(
child: Visibility( text: S.of(context).xuanguige,
visible: widget.count > 0, textColor: Colors.white,
child: RoundButton( fontWeight: MyFontWeight.medium,
width: 17, radius: 3,
height: 17.h, backgroup: Color(0xFF32A060),
text: "${widget.count}", fontSize: 11.sp,
textColor: Color(0xFF32A060), padding: EdgeInsets.symmetric(
fontWeight: MyFontWeight.regular, vertical: 5.h, horizontal: 3.w),
backgroup: Colors.white, ),
fontSize: 12.sp, ),
radius: 100, 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,
), ),
), ),
], ),
), ],
)), )),
if (widget.isShopCart || if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0 && (widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam !(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ?? ?.isEnableSubscribe ??
false)) false) &&
!(widget?.productListBean?.isSetMeal ?? false))
Spacer(), Spacer(),
if (widget.isShopCart || if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0 && (widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam !(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ?? ?.isEnableSubscribe ??
false)) false) &&
!(widget?.productListBean?.isSetMeal ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () async { onTap: () async {
@ -324,7 +325,8 @@ class _ShopGoods extends State<ShopGoods> {
(widget.productListBean?.attrStyle ?? 0) == 0 && (widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam !(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ?? ?.isEnableSubscribe ??
false)) false) &&
!(widget?.productListBean?.isSetMeal ?? false))
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
@ -340,7 +342,8 @@ class _ShopGoods extends State<ShopGoods> {
(widget.productListBean?.attrStyle ?? 0) == 0 && (widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam !(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ?? ?.isEnableSubscribe ??
false)) false) &&
!(widget?.productListBean?.isSetMeal ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () async { onTap: () async {
@ -348,7 +351,14 @@ class _ShopGoods extends State<ShopGoods> {
widget.tableId == 0) { widget.tableId == 0) {
showDeleteDialog(); showDeleteDialog();
} else { } 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); queryMiNiDetail(widget.productListBean.id);
else if (_jumpType == 0) else if (_jumpType == 0)
widget.add(widget.shoppingCartSkuItemListBean); widget.add(widget.shoppingCartSkuItemListBean);
@ -364,7 +374,7 @@ class _ShopGoods extends State<ShopGoods> {
} }
}, },
child: Container( child: Container(
padding: EdgeInsets.only(left: 6.w, right:9.w), padding: EdgeInsets.only(left: 6.w, right: 9.w),
child: Image.asset( child: Image.asset(
"assets/image/add.webp", "assets/image/add.webp",
width: 22, width: 22,
@ -401,7 +411,7 @@ class _ShopGoods extends State<ShopGoods> {
top: 4.h, top: 4.h,
bottom: 4.h, bottom: 4.h,
), ),
margin: EdgeInsets.only(right:8.w,top: 4), margin: EdgeInsets.only(right: 8.w, top: 4),
child: RoundButton( child: RoundButton(
text: S.of(context).lijiyuyue, text: S.of(context).lijiyuyue,
textColor: Colors.white, textColor: Colors.white,
@ -413,6 +423,72 @@ class _ShopGoods extends State<ShopGoods> {
vertical: 5.h, horizontal: 3.w), 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( SizedBox(

504
lib/store/store_view/shop_goods_car.dart

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart'; import 'package:huixiang/retrofit/data/shoppingCart.dart';
@ -12,21 +13,21 @@ class ShopGoodsCar extends StatefulWidget {
final Function(String id, int count) queryMiNiDetail; final Function(String id, int count) queryMiNiDetail;
final Function(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) add; final Function(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) add;
final Function(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) final Function(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean)
reduce; reduce;
final ProductListBean productListBean; final ProductListBean productListBean;
final ShoppingCartSkuItemListBean shoppingCartSkuItemListBean; final ShoppingCartSkuItemListBean shoppingCartSkuItemListBean;
final int count; final int count;
final bool isShopCart; final bool isShopCart;
ShopGoodsCar( ShopGoodsCar(
this.add, this.add,
this.reduce, { this.reduce, {
this.productListBean, this.productListBean,
this.count = 0, this.count = 0,
this.isShopCart = false, this.isShopCart = false,
this.queryMiNiDetail, this.queryMiNiDetail,
this.shoppingCartSkuItemListBean, this.shoppingCartSkuItemListBean,
}); });
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -38,260 +39,283 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only( padding: EdgeInsets.only(
right: 16.w, right: 16.w,
// bottom: 20.h, // bottom: 20.h,
), ),
child:Column( child: Column(
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
SizedBox(width: 12.w), SizedBox(width: 12.w),
MImage( MImage(
widget.productListBean != null widget.productListBean != null
? widget.productListBean.imgPath ? widget.productListBean.imgPath
: (widget.shoppingCartSkuItemListBean != null : (widget.shoppingCartSkuItemListBean != null
? widget.shoppingCartSkuItemListBean.skuImg ? widget.shoppingCartSkuItemListBean.skuImg
: ""), : ""),
width: 70.h, width: 70.h,
height: 70.h, height: 70.h,
radius: BorderRadius.circular(4), radius: BorderRadius.circular(4),
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",
), ),
SizedBox( SizedBox(
width: 10, width: 10,
), ),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
widget.productListBean != null widget.productListBean != null
? widget.productListBean.productName ? widget.productListBean.productName
: widget.shoppingCartSkuItemListBean.productName, : widget
overflow: TextOverflow.ellipsis, .shoppingCartSkuItemListBean.productName,
maxLines: 2, overflow: TextOverflow.ellipsis,
style: TextStyle( maxLines: 2,
color: Colors.black,
fontSize: 13.sp,
fontWeight: MyFontWeight.medium,
),
),
),
// Image.asset(
// "assets/image/green_leaf.webp",
// fit: BoxFit.cover,
// width: 12,
// height: 12,
// ),
// Text(
// "X300",
// style: TextStyle(
// color: Color(0xFF55BC51),
// fontSize: 10.sp,
// fontWeight: MyFontWeight.semi_bold,
// ),
// ),
],
),
SizedBox(
height: 2.h,
),
Row(
children: [
Expanded(
child: Text(
(widget.productListBean != null
? widget.productListBean.shortName
: ((widget.shoppingCartSkuItemListBean.skuName == "0") ? "": widget.shoppingCartSkuItemListBean.skuName ) ?? ""),
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
color: Color(0xFF4C4C4C),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
),
SizedBox(
width: 10,
),
],
),
SizedBox(
height: 7.h,
),
Row(
children: [
Row(
children: [
Text(
"¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price) ?? 0)}",
style: TextStyle( style: TextStyle(
color: Color(0xFFFF7A1A), color: Colors.black,
fontSize: 16.sp, fontSize: 13.sp,
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
), ),
), ),
SizedBox( ),
width: 2.w, // Image.asset(
// "assets/image/green_leaf.webp",
// fit: BoxFit.cover,
// width: 12,
// height: 12,
// ),
// Text(
// "X300",
// style: TextStyle(
// color: Color(0xFF55BC51),
// fontSize: 10.sp,
// fontWeight: MyFontWeight.semi_bold,
// ),
// ),
],
),
SizedBox(
height: 2.h,
),
Row(
children: [
Expanded(
child: Text(
(widget.productListBean != null
? widget.productListBean.shortName
: ((widget.shoppingCartSkuItemListBean
.skuName ==
"0")
? ""
: widget.shoppingCartSkuItemListBean
.skuName) ??
""),
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
color: Color(0xFF4C4C4C),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
), ),
// Container( ),
// width: 44.w, SizedBox(
// height: 18.h, width: 10,
// decoration: BoxDecoration( ),
// color: Color(0xFFFF4500), ],
// borderRadius: BorderRadius.circular(2), ),
// ), SizedBox(
// alignment: Alignment.center, height: 7.h,
// child: Text( ),
// "APP专享", Row(
// style: TextStyle( children: [
// color: Color(0xFFFFFFFF), Row(
// fontSize: 10.sp,
// fontWeight: MyFontWeight.medium,
// ),
// ),
// ),
],
),
Spacer(),
if (!widget.isShopCart &&
(widget.productListBean?.attrStyle ?? 0) == 1)
Stack(
children: [ children: [
Container( Text(
margin: EdgeInsets.only(right: 8, top: 4), "¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price) ?? 0)}",
child: RoundButton( style: TextStyle(
width: 49.w, color: Color(0xFFFF7A1A),
text: S.of(context).xuanguige, fontSize: 16.sp,
textColor: Colors.white, fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
radius: 3,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
callback: () {
widget.queryMiNiDetail(
widget.productListBean != null
? widget.productListBean.id
: widget.shoppingCartSkuItemListBean
.productId,
0);
},
), ),
), ),
Positioned( SizedBox(
right: 0, width: 2.w,
child: Visibility( ),
visible: widget.count > 0, // Container(
// width: 44.w,
// height: 18.h,
// decoration: BoxDecoration(
// color: Color(0xFFFF4500),
// borderRadius: BorderRadius.circular(2),
// ),
// alignment: Alignment.center,
// child: Text(
// "APP专享",
// style: TextStyle(
// color: Color(0xFFFFFFFF),
// fontSize: 10.sp,
// fontWeight: MyFontWeight.medium,
// ),
// ),
// ),
],
),
Spacer(),
if (!widget.isShopCart &&
(widget.productListBean?.attrStyle ?? 0) == 1)
Stack(
children: [
Container(
margin: EdgeInsets.only(right: 8, top: 4),
child: RoundButton( child: RoundButton(
width: 17, width: 49.w,
height: 17.h, text: S.of(context).xuanguige,
text: "${widget.count}", textColor: Colors.white,
textColor: Color(0xFF32A060), fontWeight: MyFontWeight.medium,
fontWeight: MyFontWeight.regular, radius: 3,
backgroup: Colors.white, backgroup: Color(0xFF32A060),
fontSize: 12.sp, fontSize: 11.sp,
radius: 100, padding:
EdgeInsets.symmetric(vertical: 5.h),
callback: () {
widget.queryMiNiDetail(
widget.productListBean != null
? widget.productListBean.id
: widget
.shoppingCartSkuItemListBean
.productId,
0);
},
),
),
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,
),
), ),
), ),
],
),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0)
InkWell(
onTap: () {
widget
.reduce(widget.shoppingCartSkuItemListBean);
},
child: Image.asset(
"assets/image/reduce.webp",
width: 22,
height: 22.h,
), ),
],
),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0)
InkWell(
onTap: () {
widget.reduce(widget.shoppingCartSkuItemListBean);
},
child: Image.asset(
"assets/image/reduce.webp",
width: 22,
height: 22.h,
), ),
), if (widget.isShopCart ||
if (widget.isShopCart || (widget.productListBean?.attrStyle ?? 0) == 0)
(widget.productListBean?.attrStyle ?? 0) == 0) Container(
Container( width: 30,
width: 30, alignment: Alignment.center,
alignment: Alignment.center, child: Text(
child: Text( "${widget.count}",
"${widget.count}", style: TextStyle(
style: TextStyle( color: Colors.black,
color: Colors.black, fontSize: 14.sp,
fontSize: 14.sp, fontWeight: MyFontWeight.medium,
fontWeight: MyFontWeight.medium, ),
), ),
), ),
), if (widget.isShopCart ||
if (widget.isShopCart || (widget.productListBean?.attrStyle ?? 0) == 0)
(widget.productListBean?.attrStyle ?? 0) == 0) GestureDetector(
GestureDetector( onTap: () {
onTap: () { if ((widget?.productListBean?.oversold ?? 0) ==
widget.add(widget.shoppingCartSkuItemListBean); 0 &&
}, widget.count >=
child: Image.asset( (widget?.shoppingCartSkuItemListBean
"assets/image/add.webp", ?.skuStock ??
width: 22, 0)) {
height: 22.h, SmartDialog.showToast("库存不足",
alignment: Alignment.center);
} else {
widget
.add(widget.shoppingCartSkuItemListBean);
}
},
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)}",
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 12.sp,
fontFamily: 'JDZhengHT',
decoration: TextDecoration.lineThrough,
fontWeight: MyFontWeight.regular,
), ),
), SizedBox(
], height: 4.h,
),
Text(
"${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.applyPrice) ?? 0)}",
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 12.sp,
fontFamily: 'JDZhengHT',
decoration: TextDecoration.lineThrough,
fontWeight: MyFontWeight.regular,
),
),
],
),
), ),
), ],
],
),
if(widget.shoppingCartSkuItemListBean.setMealDataList.length != 0)
ListView.builder(
itemCount: widget.shoppingCartSkuItemListBean.setMealDataList.length,
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
itemBuilder: (context, index) {
return shopCarMealsItem(widget.shoppingCartSkuItemListBean.setMealDataList[index]);
},
), ),
SizedBox(height:15.h,) if (widget.shoppingCartSkuItemListBean.setMealDataList.length != 0)
], ListView.builder(
) itemCount:
); widget.shoppingCartSkuItemListBean.setMealDataList.length,
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
itemBuilder: (context, index) {
return shopCarMealsItem(widget
.shoppingCartSkuItemListBean.setMealDataList[index]);
},
),
SizedBox(
height: 15.h,
)
],
));
} }
Widget shopCarMealsItem(SetMealDataList setMealDataList) { Widget shopCarMealsItem(SetMealDataList setMealDataList) {
return Container( return Container(
margin: EdgeInsets.symmetric(vertical:10.h,horizontal: 16.w), margin: EdgeInsets.symmetric(vertical: 10.h, horizontal: 16.w),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
flex:2, flex: 2,
child: Text( child: Text(
setMealDataList.productInfoList[0].productName, setMealDataList.productInfoList[0].productName,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
@ -303,9 +327,10 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
), ),
), ),
), ),
Expanded(flex:3, Expanded(
flex: 3,
child: Text( child: Text(
"${(setMealDataList.productInfoList[0].skuName == "") ? "默认": setMealDataList.productInfoList[0].skuName}", "${(setMealDataList.productInfoList[0].skuName == "") ? "默认" : setMealDataList.productInfoList[0].skuName}",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
style: TextStyle( style: TextStyle(
@ -316,7 +341,7 @@ class _ShopGoodsCar extends State<ShopGoodsCar> {
), ),
), ),
Text( Text(
setMealDataList.productInfoList[0].buyNumber.toString(), "x${setMealDataList.productInfoList[0].buyNumber.toString()}",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
style: TextStyle( 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: { .pushNamed('/router/shop_details_page', arguments: {
"id": e.id, "id": e.id,
"storeId": e.storeId, "storeId": e.storeId,
"isSetMeal":e.isSetMeal
}); });
widget.queryShoppingCart(); widget.queryShoppingCart();
} }

58
lib/utils/upload_async.dart

@ -5,6 +5,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.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:shared_preferences/shared_preferences.dart';
import 'package:thumbnails/thumbnails.dart'; import 'package:thumbnails/thumbnails.dart';
@ -12,23 +13,56 @@ import '../community/release_dynamic.dart';
import '../retrofit/data/base_data.dart'; import '../retrofit/data/base_data.dart';
import '../retrofit/data/upload_result.dart'; import '../retrofit/data/upload_result.dart';
import '../retrofit/retrofit_api.dart'; import '../retrofit/retrofit_api.dart';
import '../view_widget/custom_image.dart';
import 'font_weight.dart';
class UploadAsync { class UploadAsync {
static void upload(int dynamicType, List<Medias> mediaPaths, static void upload(int dynamicType, List<Medias> mediaPaths,
String addressText, String dynamicText) async { String addressText, String dynamicText) async {
SmartDialog.show( SmartDialog.show(
widget: Container( widget: Container(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
margin: EdgeInsets.only( margin: EdgeInsets.only(
right: 10.w, right: 10.w,
),
child: CircularProgressIndicator(
strokeWidth: 4.0,
backgroundColor: Colors.green,
// value: 0.4,
valueColor: new AlwaysStoppedAnimation<Color>(Colors.grey),
),
), ),
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(), maskWidgetTemp: SizedBox(),
); );
var sp = await SharedPreferences.getInstance(); var sp = await SharedPreferences.getInstance();
@ -162,7 +196,7 @@ class UploadInstance {
return _instance; return _instance;
} }
void notifyAllObservers(){ void notifyAllObservers() {
_uploadObserverList.forEach((element) { _uploadObserverList.forEach((element) {
element.onUploadFinish(); element.onUploadFinish();
}); });

2
pubspec.yaml

@ -3,7 +3,7 @@ description: 一心回乡.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev 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: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save