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

2
lib/generated/intl/messages_zh_CN.dart

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

2
lib/generated/intl/messages_zh_TW.dart

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

2
lib/generated/l10n.dart

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

27
lib/mine/fans_page.dart

@ -149,15 +149,26 @@ class _FansPage extends State<FansPage>
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
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",
GestureDetector(
onTap:(){
Navigator.of(context)
.pushNamed('/router/personal_page', arguments: {
"memberId": list.mid ?? "",
});},
child: Padding(
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(
width: 8,
),

29
lib/mine/follow_page.dart

@ -143,17 +143,24 @@ class _FollowPage extends State<FollowPage> with SingleTickerProviderStateMixin,
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment:CrossAxisAlignment.center,
children: [
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(
width:8,
GestureDetector(
onTap:(){
Navigator.of(context)
.pushNamed('/router/personal_page', arguments: {
"memberId": list.mid ?? "",
});},
child: Padding(
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",
),
),
),
Expanded(child:Text(
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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.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/miNiDetail.dart' as MiNi;
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:flutter_screenutil/flutter_screenutil.dart';
import '../../generated/l10n.dart';
import '../../view_widget/classic_header.dart';
import '../../view_widget/my_footer.dart';
@ -54,18 +56,7 @@ class _ProductMealsSku extends State<ProductMealsSku> {
tableId = widget.arguments["tableId"];
id = widget.arguments["id"];
storeId = widget.arguments["storeId"];
SharedPreferences.getInstance().then((value) {
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);
});
_onRefresh();
}
///
@ -78,6 +69,11 @@ class _ProductMealsSku extends State<ProductMealsSku> {
setState(() {
miNiDetail = baseData.data;
productSetMeals = miNiDetail.productSkuVOList[0].productSetMeals;
SharedPreferences.getInstance().then(
(value) => {
value.setString('miNiDetail${id}', jsonEncode(baseData.data)),
},
);
});
refreshController.refreshCompleted();
} 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);
}
@ -168,7 +178,7 @@ class _ProductMealsSku extends State<ProductMealsSku> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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(
miNiDetail?.productName ?? "",
style: TextStyle(
@ -466,25 +476,28 @@ class _ProductMealsSku extends State<ProductMealsSku> {
Widget productMealsList(MiNi.ProductSetMeals productSetMeals) {
return Container(
padding:EdgeInsets.symmetric(horizontal:14.w),
// padding:EdgeInsets.symmetric(horizontal:14.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
Padding(padding:EdgeInsets.only(top: 12.h,left:14.w,right:14.w),
child:Text(
"${productSetMeals.groupName}(${productSetMeals.totalNumber}${productSetMeals.optionalNumber})",
style: TextStyle(
fontSize: 14.sp,
color: Colors.black,
fontWeight: FontWeight.w600,
),
),
),),
SizedBox(
height: 8.h,
),
///
Container(
height: 205.h,
margin:EdgeInsets.only(bottom:18.h),
margin:EdgeInsets.only(bottom:4.h),
padding:EdgeInsets.symmetric(horizontal:14.w),
child: ListView.builder(
itemCount: productSetMeals?.productInfoList?.length??0,
scrollDirection: Axis.horizontal,
@ -503,24 +516,183 @@ class _ProductMealsSku extends State<ProductMealsSku> {
},
),
),
// if (productSetMeals
// .productInfoList[productSetMeals.checkIndex]
// .productAttrInfoList[0]
// .attrName !=
// "")
ListView.builder(
itemCount: productSetMeals
.productInfoList[productSetMeals.checkIndex]
.productAttrInfoList
.length,
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.zero,
itemBuilder: (context, pos) {
return porAttrItem(productSetMeals
///
if (productSetMeals
.productInfoList[productSetMeals.checkIndex]
.productAttrInfoList[0]
.attrName !=
"")
Container(
padding:EdgeInsets.symmetric(horizontal:14.w),
child: ListView.builder(
itemCount: productSetMeals
.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),
child:Text(
productInfoList.productName ?? "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
color: Colors.black,
@ -616,6 +790,11 @@ class _ProductMealsSku extends State<ProductMealsSku> {
}
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 !=
null && productAttrInfoList.attrValueList
.length >
@ -624,12 +803,12 @@ class _ProductMealsSku extends State<ProductMealsSku> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 16, bottom: 16),
padding: EdgeInsets.only(bottom:16.h,top: 14.h),
child: Text(
productAttrInfoList.attrName,
style: TextStyle(
color: Color(0xFFB3B3B3),
fontSize: 14.sp,
color: Color(0xFF191919),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
@ -646,8 +825,7 @@ class _ProductMealsSku extends State<ProductMealsSku> {
return GestureDetector(
onTap: () {
setState(() {
productAttrInfoList
.selectSku = tag.attrName;
productAttrInfoList.selectSku = tag.attrName;
});
},
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) {
return Container(
padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 12.0),
@ -717,12 +861,13 @@ class _ProductMealsSku extends State<ProductMealsSku> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: !isCheck ? Color(0xFF4D4D4D) : Color(0xFF32A060),
fontSize: 14.sp,
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
),
));
}
//
//ui
// Widget productMealsItems(int position, int index) {
// return Container(
// 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 {
@ -1050,8 +1195,8 @@ class _ProductMealsSku extends State<ProductMealsSku> {
// ),
// ));
// }
///
//
// ///
// showSkuDialog(int position, int index) async {
// showDialog(
// context: context,

Loading…
Cancel
Save