Browse Source

选套餐流程更改-调试;

关注-粉丝列表头像跳转更改;
wr_2023_new_business_new
wurong 4 months ago
parent
commit
f079ccd537
  1. 2
      lib/generated/intl/messages_en.dart
  2. 2
      lib/generated/intl/messages_zh_CN.dart
  3. 2
      lib/generated/intl/messages_zh_Hans_CN.dart
  4. 2
      lib/generated/intl/messages_zh_Hant_CN.dart
  5. 2
      lib/generated/intl/messages_zh_TW.dart
  6. 2
      lib/generated/l10n.dart
  7. 27
      lib/mine/fans_page.dart
  8. 29
      lib/mine/follow_page.dart
  9. 305
      lib/store/store_view/product_meals_sku.dart

2
lib/generated/intl/messages_en.dart

@ -642,7 +642,7 @@ class MessageLookup extends MessageLookupByLibrary {
"weikaiqi" : MessageLookupByLibrary.simpleMessage("未开启"), "weikaiqi" : MessageLookupByLibrary.simpleMessage("未开启"),
"weilegeiningenghaodefuwu" : MessageLookupByLibrary.simpleMessage("为了给您提供更好的服务,以及享受更加精彩的信息内容,请您在使用期间,进行登录"), "weilegeiningenghaodefuwu" : MessageLookupByLibrary.simpleMessage("为了给您提供更好的服务,以及享受更加精彩的信息内容,请您在使用期间,进行登录"),
"weilejishishoudaohuodongxiaoxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,请您开启消息通知权限"), "weilejishishoudaohuodongxiaoxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,请您开启消息通知权限"),
"weilekaipaizhaoxuanzhetouxiang" : MessageLookupByLibrary.simpleMessage("为了您可以在使用过程中更换头像,扫码,请您开启相机使用权限"), "weilekaipaizhaoxuanzhetouxiang" : MessageLookupByLibrary.simpleMessage("为了您可以在使用过程中更换头像,请您开启相机使用权限"),
"weilexiangnintuijianfujindemendianxinxi" : MessageLookupByLibrary.simpleMessage("为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息"), "weilexiangnintuijianfujindemendianxinxi" : MessageLookupByLibrary.simpleMessage("为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息"),
"weilexuanzhezhaopianhuancun" : MessageLookupByLibrary.simpleMessage("为了获得照片使用,缓存等功能,推荐您在使用期间打开存储权限"), "weilexuanzhezhaopianhuancun" : MessageLookupByLibrary.simpleMessage("为了获得照片使用,缓存等功能,推荐您在使用期间打开存储权限"),
"weiwancheng" : MessageLookupByLibrary.simpleMessage(" 未完成 "), "weiwancheng" : MessageLookupByLibrary.simpleMessage(" 未完成 "),

2
lib/generated/intl/messages_zh_CN.dart

@ -642,7 +642,7 @@ class MessageLookup extends MessageLookupByLibrary {
"weikaiqi" : MessageLookupByLibrary.simpleMessage("未开启"), "weikaiqi" : MessageLookupByLibrary.simpleMessage("未开启"),
"weilegeiningenghaodefuwu" : MessageLookupByLibrary.simpleMessage("为了给您提供更好的服务,以及享受更加精彩的信息内容,请您在使用期间,进行登录"), "weilegeiningenghaodefuwu" : MessageLookupByLibrary.simpleMessage("为了给您提供更好的服务,以及享受更加精彩的信息内容,请您在使用期间,进行登录"),
"weilejishishoudaohuodongxiaoxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,请您开启消息通知权限"), "weilejishishoudaohuodongxiaoxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,请您开启消息通知权限"),
"weilekaipaizhaoxuanzhetouxiang" : MessageLookupByLibrary.simpleMessage("为了您可以在使用过程中更换头像,扫码,请您开启相机使用权限"), "weilekaipaizhaoxuanzhetouxiang" : MessageLookupByLibrary.simpleMessage("为了您可以在使用过程中更换头像,请您开启相机使用权限"),
"weilexiangnintuijianfujindemendianxinxi" : MessageLookupByLibrary.simpleMessage("为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息"), "weilexiangnintuijianfujindemendianxinxi" : MessageLookupByLibrary.simpleMessage("为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息"),
"weilexuanzhezhaopianhuancun" : MessageLookupByLibrary.simpleMessage("为了获得照片使用,缓存等功能,推荐您在使用期间打开存储权限"), "weilexuanzhezhaopianhuancun" : MessageLookupByLibrary.simpleMessage("为了获得照片使用,缓存等功能,推荐您在使用期间打开存储权限"),
"weiwancheng" : MessageLookupByLibrary.simpleMessage(" 未完成 "), "weiwancheng" : MessageLookupByLibrary.simpleMessage(" 未完成 "),

2
lib/generated/intl/messages_zh_Hans_CN.dart

@ -642,7 +642,7 @@ class MessageLookup extends MessageLookupByLibrary {
"weikaiqi" : MessageLookupByLibrary.simpleMessage("未开启"), "weikaiqi" : MessageLookupByLibrary.simpleMessage("未开启"),
"weilegeiningenghaodefuwu" : MessageLookupByLibrary.simpleMessage("为了给您提供更好的服务,以及享受更加精彩的信息内容,请您在使用期间,进行登录"), "weilegeiningenghaodefuwu" : MessageLookupByLibrary.simpleMessage("为了给您提供更好的服务,以及享受更加精彩的信息内容,请您在使用期间,进行登录"),
"weilejishishoudaohuodongxiaoxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,请您开启消息通知权限"), "weilejishishoudaohuodongxiaoxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,请您开启消息通知权限"),
"weilekaipaizhaoxuanzhetouxiang" : MessageLookupByLibrary.simpleMessage("为了您可以在使用过程中更换头像,扫码,请您开启相机使用权限"), "weilekaipaizhaoxuanzhetouxiang" : MessageLookupByLibrary.simpleMessage("为了您可以在使用过程中更换头像,请您开启相机使用权限"),
"weilexiangnintuijianfujindemendianxinxi" : MessageLookupByLibrary.simpleMessage("为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息"), "weilexiangnintuijianfujindemendianxinxi" : MessageLookupByLibrary.simpleMessage("为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息"),
"weilexuanzhezhaopianhuancun" : MessageLookupByLibrary.simpleMessage("为了获得照片使用,缓存等功能,推荐您在使用期间打开存储权限"), "weilexuanzhezhaopianhuancun" : MessageLookupByLibrary.simpleMessage("为了获得照片使用,缓存等功能,推荐您在使用期间打开存储权限"),
"weiwancheng" : MessageLookupByLibrary.simpleMessage(" 未完成 "), "weiwancheng" : MessageLookupByLibrary.simpleMessage(" 未完成 "),

2
lib/generated/intl/messages_zh_Hant_CN.dart

@ -636,7 +636,7 @@ class MessageLookup extends MessageLookupByLibrary {
"weikaiqi" : MessageLookupByLibrary.simpleMessage("未開啓"), "weikaiqi" : MessageLookupByLibrary.simpleMessage("未開啓"),
"weilegeiningenghaodefuwu" : MessageLookupByLibrary.simpleMessage("為了給您提供更好的服務,以及享受更加精彩的信息內容,請在使用使用期間登錄"), "weilegeiningenghaodefuwu" : MessageLookupByLibrary.simpleMessage("為了給您提供更好的服務,以及享受更加精彩的信息內容,請在使用使用期間登錄"),
"weilejishishoudaohuodongxiaoxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,请您开启消息通知权限"), "weilejishishoudaohuodongxiaoxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,请您开启消息通知权限"),
"weilekaipaizhaoxuanzhetouxiang" : MessageLookupByLibrary.simpleMessage("为了您可以在使用过程中更换头像,扫码,请您开启相机使用权限"), "weilekaipaizhaoxuanzhetouxiang" : MessageLookupByLibrary.simpleMessage("为了您可以在使用过程中更换头像,请您开启相机使用权限"),
"weilexiangnintuijianfujindemendianxinxi" : MessageLookupByLibrary.simpleMessage("為了向您推薦附近的門店信息,推薦您在使用期間讓我們使用位置信息"), "weilexiangnintuijianfujindemendianxinxi" : MessageLookupByLibrary.simpleMessage("為了向您推薦附近的門店信息,推薦您在使用期間讓我們使用位置信息"),
"weilexuanzhezhaopianhuancun" : MessageLookupByLibrary.simpleMessage("为了获得照片使用,缓存等功能,推荐您在使用期间打开存储权限"), "weilexuanzhezhaopianhuancun" : MessageLookupByLibrary.simpleMessage("为了获得照片使用,缓存等功能,推荐您在使用期间打开存储权限"),
"weiwancheng" : MessageLookupByLibrary.simpleMessage(" 未完成 "), "weiwancheng" : MessageLookupByLibrary.simpleMessage(" 未完成 "),

2
lib/generated/intl/messages_zh_TW.dart

@ -639,7 +639,7 @@ class MessageLookup extends MessageLookupByLibrary {
"weikaiqi" : MessageLookupByLibrary.simpleMessage("未開啓"), "weikaiqi" : MessageLookupByLibrary.simpleMessage("未開啓"),
"weilegeiningenghaodefuwu" : MessageLookupByLibrary.simpleMessage("為了給您提供更好的服務,以及享受更加精彩的信息內容,請在使用使用期間登錄"), "weilegeiningenghaodefuwu" : MessageLookupByLibrary.simpleMessage("為了給您提供更好的服務,以及享受更加精彩的信息內容,請在使用使用期間登錄"),
"weilejishishoudaohuodongxiaoxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,请您开启消息通知权限"), "weilejishishoudaohuodongxiaoxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,请您开启消息通知权限"),
"weilekaipaizhaoxuanzhetouxiang" : MessageLookupByLibrary.simpleMessage("为了您可以在使用过程中更换头像,扫码,请您开启相机使用权限"), "weilekaipaizhaoxuanzhetouxiang" : MessageLookupByLibrary.simpleMessage("为了您可以在使用过程中更换头像,请您开启相机使用权限"),
"weilexiangnintuijianfujindemendianxinxi" : MessageLookupByLibrary.simpleMessage("為了向您推薦附近的門店信息,推薦您在使用期間讓我們使用位置信息"), "weilexiangnintuijianfujindemendianxinxi" : MessageLookupByLibrary.simpleMessage("為了向您推薦附近的門店信息,推薦您在使用期間讓我們使用位置信息"),
"weilexuanzhezhaopianhuancun" : MessageLookupByLibrary.simpleMessage("为了获得照片使用,缓存等功能,推荐您在使用期间打开存储权限"), "weilexuanzhezhaopianhuancun" : MessageLookupByLibrary.simpleMessage("为了获得照片使用,缓存等功能,推荐您在使用期间打开存储权限"),
"weiwancheng" : MessageLookupByLibrary.simpleMessage(" 未完成 "), "weiwancheng" : MessageLookupByLibrary.simpleMessage(" 未完成 "),

2
lib/generated/l10n.dart

@ -3548,7 +3548,7 @@ class S {
/// `使使` /// `使使`
String get weilekaipaizhaoxuanzhetouxiang { String get weilekaipaizhaoxuanzhetouxiang {
return Intl.message( return Intl.message(
'为了您可以在使用过程中更换头像,扫码,请您开启相机使用权限', '为了您可以在使用过程中更换头像,请您开启相机使用权限',
name: 'weilekaipaizhaoxuanzhetouxiang', name: 'weilekaipaizhaoxuanzhetouxiang',
desc: '', desc: '',
args: [], args: [],

27
lib/mine/fans_page.dart

@ -149,15 +149,26 @@ class _FansPage extends State<FansPage>
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
MImage( GestureDetector(
list != null ? (list.avatar ?? "") : "", onTap:(){
width: 44, Navigator.of(context)
height: 44, .pushNamed('/router/personal_page', arguments: {
isCircle: true, "memberId": list.mid ?? "",
fit: BoxFit.cover, });},
errorSrc: "assets/image/default_1.webp", child: Padding(
fadeSrc: "assets/image/default_1.webp", padding: EdgeInsets.only(right: 8.w),
child: MImage(
list != null ? (list.avatar ?? "") : "",
width: 44,
height: 44,
isCircle: true,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
),
), ),
SizedBox( SizedBox(
width: 8, width: 8,
), ),

29
lib/mine/follow_page.dart

@ -143,17 +143,24 @@ class _FollowPage extends State<FollowPage> with SingleTickerProviderStateMixin,
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment:CrossAxisAlignment.center, crossAxisAlignment:CrossAxisAlignment.center,
children: [ children: [
MImage( GestureDetector(
list != null ? (list.avatar ?? "") : "", onTap:(){
width: 44, Navigator.of(context)
height: 44, .pushNamed('/router/personal_page', arguments: {
isCircle: true, "memberId": list.mid ?? "",
fit: BoxFit.cover, });},
errorSrc: "assets/image/default_1.webp", child: Padding(
fadeSrc: "assets/image/default_1.webp", padding: EdgeInsets.only(right: 8.w),
), child: MImage(
SizedBox( list != null ? (list.avatar ?? "") : "",
width:8, width: 44,
height: 44,
isCircle: true,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
),
), ),
Expanded(child:Text( Expanded(child:Text(
list != null ? (list.nickname ?? "") : "", list != null ? (list.nickname ?? "") : "",

305
lib/store/store_view/product_meals_sku.dart

@ -1,10 +1,11 @@
import 'dart:convert';
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_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart' as MiNi; import 'package:huixiang/retrofit/data/miNiDetail.dart' as MiNi;
import 'package:huixiang/retrofit/data/shoppingCart.dart'; import 'package:huixiang/retrofit/data/shoppingCart.dart';
@ -17,6 +18,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../generated/l10n.dart';
import '../../view_widget/classic_header.dart'; import '../../view_widget/classic_header.dart';
import '../../view_widget/my_footer.dart'; import '../../view_widget/my_footer.dart';
@ -54,18 +56,7 @@ class _ProductMealsSku extends State<ProductMealsSku> {
tableId = widget.arguments["tableId"]; tableId = widget.arguments["tableId"];
id = widget.arguments["id"]; id = widget.arguments["id"];
storeId = widget.arguments["storeId"]; storeId = widget.arguments["storeId"];
SharedPreferences.getInstance().then((value) { _onRefresh();
String minToken = value.getString("minToken");
String tenant = value.getString("tenant");
String storeId = value.getString("storeId");
minService = MinApiService(Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
showLoading: true);
queryMiNiDetail(id);
});
} }
/// ///
@ -78,6 +69,11 @@ class _ProductMealsSku extends State<ProductMealsSku> {
setState(() { setState(() {
miNiDetail = baseData.data; miNiDetail = baseData.data;
productSetMeals = miNiDetail.productSkuVOList[0].productSetMeals; productSetMeals = miNiDetail.productSkuVOList[0].productSetMeals;
SharedPreferences.getInstance().then(
(value) => {
value.setString('miNiDetail${id}', jsonEncode(baseData.data)),
},
);
}); });
refreshController.refreshCompleted(); refreshController.refreshCompleted();
} else { } else {
@ -85,7 +81,21 @@ class _ProductMealsSku extends State<ProductMealsSku> {
} }
} }
_onRefresh() { _onRefresh() async{
SharedPreferences value = await SharedPreferences.getInstance();
String minToken = value.getString("minToken");
String tenant = value.getString("tenant");
String storeId = value.getString("storeId");
minService = MinApiService(Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
showLoading: true);
if (value.getString("miNiDetail${id}") != null) {
miNiDetail = MiNi.MiNiDetail.fromJson(jsonDecode(value.getString('miNiDetail${id}')));
setState(() {});
}
queryMiNiDetail(id); queryMiNiDetail(id);
} }
@ -168,7 +178,7 @@ class _ProductMealsSku extends State<ProductMealsSku> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
swiper(), swiper(),
Padding(padding:EdgeInsets.only(left:14.w,top:10.h,bottom:18.h), Padding(padding:EdgeInsets.only(left:14.w,top:10.h,bottom:6.h),
child:Text( child:Text(
miNiDetail?.productName ?? "", miNiDetail?.productName ?? "",
style: TextStyle( style: TextStyle(
@ -466,25 +476,28 @@ class _ProductMealsSku extends State<ProductMealsSku> {
Widget productMealsList(MiNi.ProductSetMeals productSetMeals) { Widget productMealsList(MiNi.ProductSetMeals productSetMeals) {
return Container( return Container(
padding:EdgeInsets.symmetric(horizontal:14.w), // padding:EdgeInsets.symmetric(horizontal:14.w),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Padding(padding:EdgeInsets.only(top: 12.h,left:14.w,right:14.w),
child:Text(
"${productSetMeals.groupName}(${productSetMeals.totalNumber}${productSetMeals.optionalNumber})", "${productSetMeals.groupName}(${productSetMeals.totalNumber}${productSetMeals.optionalNumber})",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),),
SizedBox( SizedBox(
height: 8.h, height: 8.h,
), ),
///
Container( Container(
height: 205.h, height: 205.h,
margin:EdgeInsets.only(bottom:18.h), margin:EdgeInsets.only(bottom:4.h),
padding:EdgeInsets.symmetric(horizontal:14.w),
child: ListView.builder( child: ListView.builder(
itemCount: productSetMeals?.productInfoList?.length??0, itemCount: productSetMeals?.productInfoList?.length??0,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
@ -503,24 +516,183 @@ class _ProductMealsSku extends State<ProductMealsSku> {
}, },
), ),
), ),
// if (productSetMeals ///
// .productInfoList[productSetMeals.checkIndex] if (productSetMeals
// .productAttrInfoList[0] .productInfoList[productSetMeals.checkIndex]
// .attrName != .productAttrInfoList[0]
// "") .attrName !=
ListView.builder( "")
itemCount: productSetMeals Container(
.productInfoList[productSetMeals.checkIndex] padding:EdgeInsets.symmetric(horizontal:14.w),
.productAttrInfoList child: ListView.builder(
.length, itemCount: productSetMeals
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.zero,
itemBuilder: (context, pos) {
return porAttrItem(productSetMeals
.productInfoList[productSetMeals.checkIndex] .productInfoList[productSetMeals.checkIndex]
.productAttrInfoList[pos]); .productAttrInfoList
}, .length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.zero,
itemBuilder: (context, pos) {
return
porAttrItem(productSetMeals
.productInfoList[productSetMeals.checkIndex]
.productAttrInfoList[pos]);
},
)),
///
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
if (productSetMeals
.productInfoList[productSetMeals.checkIndex]
.count >=
1)
productSetMeals
.productInfoList[productSetMeals.checkIndex]
.count -= 1;
});
},
child: Container(
padding:EdgeInsets.only(left:8.w,right:14.w,bottom:14.h),
child: Image.asset(
"assets/image/reduce.webp",
width: 22,
height: 22.h,
),
),
),
Container(
padding:EdgeInsets.only(bottom:14.h),
alignment: Alignment.center,
child: Text(
(productSetMeals.totalNumber > 1 &&
productSetMeals.totalNumber !=
productSetMeals.optionalNumber)
? productSetMeals
.productInfoList[productSetMeals.checkIndex]
.count
.toString()
: (productSetMeals
.productInfoList[productSetMeals.checkIndex]
.count = 1)
.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
GestureDetector(
onTap: () {
setState(() {
int total = 0;
if(productSetMeals
.productInfoList[productSetMeals.checkIndex]
.productAttrInfoList[0]
.attrName !=
""){
productSetMeals
.productInfoList
.forEach((element) {
total += element.count;
});
if (productSetMeals
.productInfoList[productSetMeals.checkIndex]
.productAttrInfoList
.where((element) => element.selectSku == null)
.isNotEmpty) {
SmartDialog.showToast(S.of(context).qingxianxuanguige,
alignment: Alignment.center);
return;
}
if (total >= productSetMeals.optionalNumber &&
productSetMeals
.productInfoList[productSetMeals.checkIndex]
.count !=
1) {
SmartDialog.showToast("抱歉,无法加购更多",
alignment: Alignment.center);
return;
}
productSetMeals.productInfoList[productSetMeals.checkIndex].count =
1;
productSetMeals
.productInfoList[productSetMeals.checkIndex]
.skuInfoList
.forEach((element) {
bool flag = true;
productSetMeals
.productInfoList[productSetMeals.checkIndex]
.productAttrInfoList
.forEach((e1) {
if (!element.skuName.contains(e1.selectSku))
flag = false;
});
element.isSelected = flag;
});
return;
}else{
productSetMeals.productInfoList
.forEach((element) {
total += element.count;
});
if (total >=
productSetMeals.optionalNumber ||
productSetMeals.productInfoList[productSetMeals.checkIndex]
.count >=
1) {
SmartDialog.showToast("抱歉,无法加购更多",
alignment: Alignment.center);
return;
}
if (productSetMeals.productInfoList[productSetMeals.checkIndex]
.count ==
0)
productSetMeals.productInfoList[productSetMeals.checkIndex]
.count += 1;
}
});
// setState(() {
// int total = 0;
// productSetMeals.productInfoList
// .forEach((element) {
// total += element.count;
// });
// if (total >=
// productSetMeals.optionalNumber ||
// productSetMeals.productInfoList[productSetMeals.checkIndex]
// .count >=
// 1) {
// SmartDialog.showToast("抱歉,无法加购更多",
// alignment: Alignment.center);
// return;
// }
// if (productSetMeals.productInfoList[productSetMeals.checkIndex]
// .count ==
// 0)
// productSetMeals.productInfoList[productSetMeals.checkIndex]
// .count += 1;
// });
},
child: Container(
padding:EdgeInsets.only(left:8.w,right:14.w,bottom:14.h),
child: Image.asset(
"assets/image/add.webp",
width: 22,
height: 22.h,
),),
),
],
),
Container(
color: Color(0xFFF9FAF7),
height: 12.h,
), ),
], ],
)); ));
@ -562,6 +734,8 @@ class _ProductMealsSku extends State<ProductMealsSku> {
Padding(padding:EdgeInsets.only(left:8.w,right:8.w,top:8.h,bottom: 6.h), Padding(padding:EdgeInsets.only(left:8.w,right:8.w,top:8.h,bottom: 6.h),
child:Text( child:Text(
productInfoList.productName ?? "", productInfoList.productName ?? "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Colors.black, color: Colors.black,
@ -616,6 +790,11 @@ class _ProductMealsSku extends State<ProductMealsSku> {
} }
Widget porAttrItem(MiNi.ProductAttrInfoList productAttrInfoList) { Widget porAttrItem(MiNi.ProductAttrInfoList productAttrInfoList) {
if (productAttrInfoList.attrValueList != null && productAttrInfoList.attrValueList.length > 0)
//
if (productAttrInfoList.selectSku == null) {
productAttrInfoList.selectSku = productAttrInfoList.attrValueList.first.attrName;
}
if (productAttrInfoList.attrValueList != if (productAttrInfoList.attrValueList !=
null && productAttrInfoList.attrValueList null && productAttrInfoList.attrValueList
.length > .length >
@ -624,12 +803,12 @@ class _ProductMealsSku extends State<ProductMealsSku> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(top: 16, bottom: 16), padding: EdgeInsets.only(bottom:16.h,top: 14.h),
child: Text( child: Text(
productAttrInfoList.attrName, productAttrInfoList.attrName,
style: TextStyle( style: TextStyle(
color: Color(0xFFB3B3B3), color: Color(0xFF191919),
fontSize: 14.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
), ),
), ),
@ -646,8 +825,7 @@ class _ProductMealsSku extends State<ProductMealsSku> {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
productAttrInfoList productAttrInfoList.selectSku = tag.attrName;
.selectSku = tag.attrName;
}); });
}, },
child: sweetnessItem( child: sweetnessItem(
@ -664,40 +842,6 @@ class _ProductMealsSku extends State<ProductMealsSku> {
} }
} }
Widget sweetnessStore(int position, int index, int pos, state) {
return Wrap(
runSpacing: 10.0,
spacing: 10.0,
children: productSetMeals[position]
.productInfoList[index]
.productAttrInfoList[pos]
.attrValueList
.take(productSetMeals[position]
.productInfoList[index]
.productAttrInfoList[pos]
.attrValueList
.length)
.map<Widget>((MiNi.AttrValueList tag) {
return GestureDetector(
onTap: () {
state(() {
productSetMeals[position]
.productInfoList[index]
.productAttrInfoList[pos]
.selectSku = tag.attrName;
});
},
child: sweetnessItem(
tag.attrName,
(productSetMeals[position]
.productInfoList[index]
.productAttrInfoList[pos]
.selectSku ==
tag.attrName),
));
}).toList());
}
Widget sweetnessItem(String name, bool isCheck) { Widget sweetnessItem(String name, bool isCheck) {
return Container( return Container(
padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 12.0), padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 12.0),
@ -717,12 +861,13 @@ class _ProductMealsSku extends State<ProductMealsSku> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: !isCheck ? Color(0xFF4D4D4D) : Color(0xFF32A060), color: !isCheck ? Color(0xFF4D4D4D) : Color(0xFF32A060),
fontSize: 14.sp, fontSize: 13.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
), ),
)); ));
} }
//
//ui
// Widget productMealsItems(int position, int index) { // Widget productMealsItems(int position, int index) {
// return Container( // return Container(
// margin: EdgeInsets.symmetric(vertical: 16.h), // margin: EdgeInsets.symmetric(vertical: 16.h),
@ -984,7 +1129,7 @@ class _ProductMealsSku extends State<ProductMealsSku> {
// ), // ),
// ), // ),
// ), // ),
// sweetnessStore(position, index, pos, state), // sweetnessStores(position, index, pos, state),
// ], // ],
// ); // );
// else { // else {
@ -1050,8 +1195,8 @@ class _ProductMealsSku extends State<ProductMealsSku> {
// ), // ),
// )); // ));
// } // }
//
/// // ///
// showSkuDialog(int position, int index) async { // showSkuDialog(int position, int index) async {
// showDialog( // showDialog(
// context: context, // context: context,

Loading…
Cancel
Save