Browse Source

视频修改;

充值增加支付宝;
购物车修改;(选规格弹窗/详情加购物车弹窗数量修改)
订单详情跳转修改;
福利中心修改;
订单详情地址距离更改;
dart3_last
wurong 2 years ago
parent
commit
95343314f4
  1. 4
      lib/base_state.dart
  2. 2
      lib/community/community_details.dart
  3. 1
      lib/community/community_view/class_details.dart
  4. 2
      lib/community/community_view/community_dynamic.dart
  5. 55
      lib/home/welfare_page.dart
  6. 4
      lib/main.dart
  7. 4
      lib/main_page.dart
  8. 66
      lib/mine/recharge_page.dart
  9. 17
      lib/order/edit_remarks_page.dart
  10. 4
      lib/order/order_detail_page.dart
  11. 3
      lib/order/order_history_page.dart
  12. 24
      lib/order/order_view/order_address.dart
  13. 5
      lib/settlement/settlement.dart
  14. 42
      lib/settlement/settlement_view/distribution.dart
  15. 7
      lib/settlement/settlement_view/pay_method.dart
  16. 357
      lib/store/shop_details_page.dart
  17. 66
      lib/store/store_order.dart
  18. 630
      lib/store/store_view/product_sku.dart
  19. 148
      lib/store/store_view/shop_goods.dart
  20. 3
      lib/union/union_list.dart
  21. 6
      lib/view_widget/activity_poster.dart

4
lib/base_state.dart

@ -59,8 +59,10 @@ abstract class BaseState<T extends StatefulWidget> extends State<T>
params["activityId"] = pushMap["info"];
break;
case 3:
routeName = "/router/union_detail_page";
routeName = "/router/store_order";
params["id"] = pushMap["info"];
params["tenant"] = pushMap["tenant"];
params["storeName"] = pushMap["storeName"];
break;
case 4:
routeName = "/router/integral_store_page";

2
lib/community/community_details.dart

@ -106,7 +106,7 @@ class _CommunityDetails extends State<CommunityDetails>
void _focusNodeListener() {
/*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){
setState(() {
emojiShowing = false;
smileyPadGone = true;
});
}*/
}

1
lib/community/community_view/class_details.dart

@ -213,6 +213,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
child: Column(
children: [
Container(
height: MediaQuery.of(context).size.width / 1.5,
child: Stack(
children: [
ClassDetailsVideo(

2
lib/community/community_view/community_dynamic.dart

@ -226,7 +226,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
},
child: MImage(
(widget?.article?.authorHeadImg ??
"https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg"),
""),
width: 44,
height: 44,
isCircle: true,

55
lib/home/welfare_page.dart

@ -50,8 +50,7 @@ class _WelfarePage extends State<WelfarePage> {
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), context: context, token: value.getString("token")),
queryGoods(),
queryCoupon(),
_onRefresh(),
});
}
@ -108,6 +107,8 @@ class _WelfarePage extends State<WelfarePage> {
"searchKey": "",
"state": 0
}).catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
refreshController.refreshFailed();
refreshController.loadFailed();
});
@ -134,7 +135,7 @@ class _WelfarePage extends State<WelfarePage> {
_onRefresh(){
queryGoods();
// queryCoupon();
queryCoupon();
}
@ -262,7 +263,13 @@ class _WelfarePage extends State<WelfarePage> {
),
],
)),
AspectRatio(
coupon.length == 0?
NoDataView(
src: "assets/image/ka.webp",
isShowBtn: false,
text: S.of(context).haimeiyouyouhuiquankeyilingqu,
fontSize: 16.sp,
): AspectRatio(
aspectRatio: 1.10,
child: Swiper(
onIndexChanged: (it){
@ -288,12 +295,11 @@ class _WelfarePage extends State<WelfarePage> {
children: [
Container(
child: weekList(coupon[position]),
// weekList(testList2[position]),
),
],
);
},
itemCount:coupon.length,
itemCount:coupon.length ?? 0,
),
)
],
@ -302,27 +308,30 @@ class _WelfarePage extends State<WelfarePage> {
}
Widget weekList(List<Coupon> cops){
return Expanded(child:(cops != null && cops.length > 0)?ListView.builder(
padding: EdgeInsets.zero,
itemCount: cops.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: weekCoupon(cops[position]),
);
},
):NoDataView(
return Expanded(
child:(cops == null && cops.length == 0)?
NoDataView(
src: "assets/image/ka.webp",
isShowBtn: false,
text: S.of(context).haimeiyouyouhuiquankeyilingqu,
fontSize: 16.sp,
),);
):ListView.builder(
padding: EdgeInsets.zero,
itemCount: cops.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: weekCoupon(cops[position]),
);
},
),);
}
///
Widget weekCoupon(Coupon cop) {
return Container(
height: 95.h,
@ -396,6 +405,7 @@ class _WelfarePage extends State<WelfarePage> {
);
}
///
Widget weekWidget(Coupon cop) {
if (cop.bizType == 1) {
return Column(
@ -581,6 +591,7 @@ class _WelfarePage extends State<WelfarePage> {
}
}
///
Widget weekBtn(Coupon cop) {
if(cop.status == 0)
return Align(
@ -645,6 +656,7 @@ class _WelfarePage extends State<WelfarePage> {
);
}
///
receiveCoupon(couponId) async {
couponIndex = swiperIndex;
BaseData baseData = await apiService.receiveCoupon(couponId);
@ -881,7 +893,6 @@ class _WelfarePage extends State<WelfarePage> {
);
}
String pointPrice(Goods goodsPrice){
if(goodsPrice == null)
return "";

4
lib/main.dart

@ -199,7 +199,7 @@ class MyApp extends StatelessWidget {
} else if (locales[0].countryCode == "CN"){
locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH');
} else{
locale = Locale.fromSubtags(languageCode: 'en', countryCode: 'CH');
locale = Locale.fromSubtags(languageCode: 'en', countryCode: 'US');
}
return appLocale ?? locale;
},
@ -325,7 +325,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/help_feedback_page': (context, {arguments}) => HelpFeedbackPage(),
'/router/founder_story_page': (context, {arguments}) => FounderStoryPage(),
'/router/system_msg_page': (context, {arguments}) => SystemMessagePage(),
'/router/edit_remarks_page': (context, {arguments}) => EditRemarksPage(),
'/router/edit_remarks_page': (context, {arguments}) => EditRemarksPage(arguments: arguments),
// '/router/hot_article_page': (context, {arguments}) => HotArticlePage(),
'/router/address_map_page': (context, {arguments}) => AddressMapPage(),
'/router/roll_center_page': (context, {arguments}) => RollCenterPage(),

4
lib/main_page.dart

@ -297,8 +297,10 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
params["activityId"] = pushMap["info"];
break;
case 3:
routeName = "/router/union_detail_page";
routeName = "/router/store_order";
params["id"] = pushMap["info"];
params["tenant"] = pushMap["tenant"];
params["storeName"] = pushMap["storeName"];
break;
case 4:
routeName = "/router/integral_store_page";

66
lib/mine/recharge_page.dart

@ -296,6 +296,7 @@ class _RechargePage extends State<RechargePage> {
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 2;
@ -327,37 +328,38 @@ class _RechargePage extends State<RechargePage> {
),
),
SizedBox(height:10.h),
// GestureDetector(
// onTap: () {
// setState(() {
// checkIndex = 3;
// });
// },
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.start,
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Image.asset(
// "assets/image/icon_alipay.webp"),
// Expanded(
// flex: 1,
// child: Padding(
// padding: EdgeInsets.only(left: 8.w),
// child: Text(
// S.of(context).zhifubao,
// style: TextStyle(
// fontSize: 14.sp,
// color: Color(0xff353535),
// ),
// ),
// ),
// ),
// checkView(3),
// ],
// ),
// ),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 3;
});
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Image.asset(
"assets/image/icon_alipay.webp"),
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).zhifubao,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
),
),
),
),
checkView(3),
],
),
),
],
),
),
@ -632,7 +634,7 @@ class _RechargePage extends State<RechargePage> {
Widget checkView(var index) {
return Container(
padding: EdgeInsets.only(right: 16.w),
padding: EdgeInsets.only(right: 16.w,left: 46.w),
alignment: Alignment.center,
child: Image.asset(
checkIndex != index

17
lib/order/edit_remarks_page.dart

@ -5,6 +5,9 @@ import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class EditRemarksPage extends StatefulWidget {
final Map<String, dynamic> arguments;
EditRemarksPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _EditRemarksPage();
@ -14,6 +17,14 @@ class EditRemarksPage extends StatefulWidget {
class _EditRemarksPage extends State<EditRemarksPage> {
TextEditingController commentTextController = TextEditingController();
@override
void initState() {
super.initState();
if((widget.arguments["remake"]??"") != "")
commentTextController.text = widget.arguments["remake"];
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -75,7 +86,8 @@ class _EditRemarksPage extends State<EditRemarksPage> {
controller: commentTextController,
keyboardType: TextInputType.multiline,
maxLines: 10,
decoration: InputDecoration(
decoration:
InputDecoration(
isDense: true,
hintText: '请填写备注信息,例如:面包切一刀',
hintStyle: TextStyle(
@ -97,7 +109,8 @@ class _EditRemarksPage extends State<EditRemarksPage> {
),
GestureDetector(
onTap: (){
Navigator.pop(context,commentTextController.text);
String notes = commentTextController.text;
Navigator.pop(context,notes);
},
child: Container(
padding: EdgeInsets.all(16.h),

4
lib/order/order_detail_page.dart

@ -34,11 +34,11 @@ class OrderDetailPage extends StatefulWidget {
class _OrderDetailPage extends State<OrderDetailPage> {
ApiService apiService;
MinApiService minService;
int jumpState;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) {
apiService = ApiService(
Dio(),
@ -48,6 +48,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
);
queryDetails();
});
jumpState = widget.arguments["jumpState"];
}
///
@ -183,6 +184,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
paySelected,
_orderCancel,
orderInfo,
jumpState
),
///

3
lib/order/order_history_page.dart

@ -155,7 +155,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
return InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/order_details',
arguments: {"id": orderInfos[position].id});
arguments: {"id": orderInfos[position].id,"jumpState":2});
},
child: orderItem(orderInfos[position]),
);
@ -469,6 +469,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
text: orderInfo.finalPayPrice,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),

24
lib/order/order_view/order_address.dart

@ -22,6 +22,7 @@ class OrderAddress extends StatefulWidget {
final Function orderCancel;
final Function() carryOnPay;
final OrderInfo orderInfo;
final int jumpState;
OrderAddress(
this.orderStatus,
@ -33,7 +34,8 @@ class OrderAddress extends StatefulWidget {
this.center,
this.carryOnPay,
this.orderCancel,
this.orderInfo,);
this.orderInfo,
this.jumpState);
@override
State<StatefulWidget> createState() {
@ -271,14 +273,18 @@ class _OrderAddress extends State<OrderAddress> {
widget.orderInfo.storeVO.storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": widget.orderInfo.storeVO.id,
"tenant": widget.orderInfo.tenantCode,
"storeName": widget.orderInfo.storeVO.storeName
},
);
if(widget.jumpState == 1){
Navigator.of(context).pop();
}else if(widget.jumpState == 2){
Navigator.of(context).popAndPushNamed(
'/router/store_order',
arguments: {
"id": widget.orderInfo.storeVO.id,
"tenant": widget.orderInfo.tenantCode,
"storeName": widget.orderInfo.storeVO.storeName
},
);
}
}
}

5
lib/settlement/settlement.dart

@ -698,6 +698,7 @@ class _Settlement extends State<Settlement> {
'/router/order_details',
arguments: {
"id": orderId,
"jumpState":1,
},
);
// Navigator.of(context).pop();
@ -771,7 +772,7 @@ class _Settlement extends State<Settlement> {
payChannel,
tableId ?? 0);
}, queryAddress, storeInfo, address,
selectedAddress, pageType),
selectedAddress, pageType,widget.arguments["distance"]),
SizedBox(
height: 16,
@ -810,7 +811,7 @@ class _Settlement extends State<Settlement> {
() {
Navigator.of(context).pushNamed(
'/router/edit_remarks_page',
arguments: {},
arguments: {"remake":remakers}
).then((value) => {
setState(() {
if (value != null) remakers = value;

42
lib/settlement/settlement_view/distribution.dart

@ -26,9 +26,10 @@ class DistributionMode extends StatefulWidget {
final StoreInfo storeInfo;
final Address address;
final String pageType;
final double distance;
DistributionMode(this.queryOrderInfo, this.queryAddress, this.storeInfo,
this.address, this.selectedNewAddress, this.pageType);
this.address, this.selectedNewAddress, this.pageType, this.distance);
@override
State<StatefulWidget> createState() {
@ -56,7 +57,7 @@ class _DistributionMode extends State<DistributionMode> {
///
void startLocation() async {
Location.getInstance().startLocation(context, (BaiduLocation result){
Location.getInstance().startLocation(context, (BaiduLocation result) {
if (result != null &&
result.latitude != null &&
result.longitude != null) {
@ -261,11 +262,21 @@ class _DistributionMode extends State<DistributionMode> {
Column(
children: [
RoundButton(
// width: 41.w,
height: 13,
text: distance.length > 3
? "${distance}km"
: "距离您${distance}km",
? ((widget.distance ?? 0) > 1000
? "${((widget.distance ?? 0) / 1000 * 100).toInt() / 100.0}km"
: S.of(context).mi(
((widget.distance ?? 0) *
100)
.toInt() /
100.0))
: "距离您${(widget.distance ?? 0) > 1000 ?
"${((widget.distance ?? 0) / 1000 * 100).toInt() / 100.0}km"
: S.of(context).mi(((widget.distance ?? 0) * 100).toInt() / 100.0)}",
// distance.length > 3
// ? "${distance}km"
// : "距离您${distance}km",
textColor: Color(0xFF34A262),
fontWeight: MyFontWeight.semi_bold,
radius: 7.5,
@ -310,16 +321,17 @@ class _DistributionMode extends State<DistributionMode> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
(widget.storeInfo.storeName == "一心回乡商城") ?
Icon(
Icons.local_shipping,
color: Color(0xFF727272),
size: 24,
):Image.asset(
"assets/image/icon_permission_location.webp",
height: 24.h,
width: 24.w,
),
(widget.storeInfo.storeName == "一心回乡商城")
? Icon(
Icons.local_shipping,
color: Color(0xFF727272),
size: 24,
)
: Image.asset(
"assets/image/icon_permission_location.webp",
height: 24.h,
width: 24.w,
),
SizedBox(width: 5),
Text(
widget?.address?.username ?? "",

7
lib/settlement/settlement_view/pay_method.dart

@ -90,6 +90,7 @@ class _PayMethod extends State<PayMethod> {
),
if(!(widget.settleOrderInfo?.isRaise ?? false))
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 1;
@ -134,6 +135,7 @@ class _PayMethod extends State<PayMethod> {
),
if(!(widget.settleOrderInfo?.isRaise ?? false))
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 2;
@ -178,6 +180,7 @@ class _PayMethod extends State<PayMethod> {
),
if(mGreenMoney!="0.00" && !(widget.settleOrderInfo?.isRaise ?? false))
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 3;
@ -231,6 +234,7 @@ class _PayMethod extends State<PayMethod> {
),
if(mRaiseMoney!="0" && (widget.settleOrderInfo?.isRaise ?? false))
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 4;
@ -284,6 +288,7 @@ class _PayMethod extends State<PayMethod> {
),
if(!(widget.settleOrderInfo?.isRaise ?? false))
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 5;
@ -320,7 +325,7 @@ class _PayMethod extends State<PayMethod> {
Widget checkView(var index) {
return Container(
padding: EdgeInsets.only(right: 16.w),
padding: EdgeInsets.only(right:36.w),
alignment: Alignment.center,
child: Image.asset(
checkIndex != index

357
lib/store/shop_details_page.dart

@ -65,6 +65,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
String storeId;
String parentId;
int numberOfPeople = 0;
int index;
@override
void initState() {
@ -91,7 +92,6 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
buildCount();
}
///
queryStoreInfo() async {
SharedPreferences value = await SharedPreferences.getInstance();
@ -152,7 +152,6 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
});
}
///
queryMiNiDetail(id) async {
BaseData<MiNiDetail> baseData =
@ -938,10 +937,8 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
child: Container(
margin: EdgeInsets.only(left: 16, top: 52),
padding: EdgeInsets.all(5),
child: Icon(
Icons.arrow_back_ios,
size: 24,
color: Color(0xFF353535),
child: Image.asset(
"assets/image/integral_return.webp",
),
),
),
@ -959,205 +956,199 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
context,
state,
) {
return WillPopScope(
onWillPop: () async => false,
child:Container(
alignment: Alignment.topCenter,
padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16),
height: MediaQuery.of(context).size.height / 3 * 2,
width: double.infinity,
decoration: BoxDecoration(
color: Color(0xFFFAFAFA),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
return Container(
alignment: Alignment.topCenter,
padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16),
height: MediaQuery.of(context).size.height / 3 * 2,
width: double.infinity,
decoration: BoxDecoration(
color: Color(0xFFFAFAFA),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
child: MImage(
miNiDetail.imgs[0],
fit: BoxFit.cover,
width: 70,
height: 70,
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
),
borderRadius: BorderRadius.circular(4),
),
SizedBox(
width: 10.w,
),
Expanded(
child: Container(
height: 70,
child: Column(
ClipRRect(
child: MImage(
miNiDetail.imgs[0],
fit: BoxFit.cover,
width: 70,
height: 70,
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
),
borderRadius: BorderRadius.circular(4),
),
SizedBox(
width: 10.w,
),
Expanded(
child: Container(
height: 70,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
miNiDetail?.productName ?? "",
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF000000),
),
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Image.asset(
"assets/image/cancel.webp",
fit: BoxFit.cover,
height: 24,
width: 24,
),
),
],
),
Text(
"${miNiDetail?.price ?? ""}",
miNiDetail?.productName ?? "",
style: TextStyle(
fontSize: 12.sp,
fontSize: 13.sp,
fontWeight: FontWeight.bold,
color: Color(0xFFF65720),
color: Color(0xFF000000),
),
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Image.asset(
"assets/image/cancel.webp",
fit: BoxFit.cover,
height: 24,
width: 24,
),
),
],
),
)),
],
),
if (miNiDetail.attrList != null &&
miNiDetail.attrList.length > 0)
SizedBox(
height: 10,
),
if (miNiDetail.attrList != null &&
miNiDetail.attrList.length > 0)
Expanded(
child: ListView.builder(
itemCount: miNiDetail.attrList.length,
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.zero,
itemBuilder: (context, position) {
return attrItem(
(attrValue) {
state(() {
// if(selectSkus.length > position)
selectSkus[position] = attrValue;
buildCount();
});
},
miNiDetail.attrList[position],
position,
);
Text(
"${miNiDetail?.price ?? ""}",
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Color(0xFFF65720),
),
),
],
),
)),
],
),
if (miNiDetail.attrList != null &&
miNiDetail.attrList.length > 0)
SizedBox(
height: 10,
),
if (miNiDetail.attrList != null &&
miNiDetail.attrList.length > 0)
Expanded(
child: ListView.builder(
itemCount: miNiDetail.attrList.length,
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.zero,
itemBuilder: (context, position) {
return attrItem(
(attrValue) {
state(() {
// if(selectSkus.length > position)
selectSkus[position] = attrValue;
buildCount();
});
},
),
miNiDetail.attrList[position],
position,
);
},
),
),
SizedBox(
height: 24,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"数量",
style: TextStyle(
color: Color(0xFFB3B3B3),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
height: 24,
height: 10,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
Row(
children: [
Text(
"数量",
style: TextStyle(
color: Color(0xFFB3B3B3),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
height: 10,
),
Row(
children: [
InkWell(
onTap: () {
state(() {
if (counts > 1)
setState(() {
counts -= 1;
});
reduce(miNiDetail, selectSkus);
InkWell(
onTap: () {
state(() {
if (counts > 1)
setState(() {
counts -= 1;
});
},
child: Icon(
Icons.remove,
color: Color(0xFF32A060),
size: 24,
)
// Image.asset(
// "assets/image/reduce.webp",
// width: 22,
// height: 22,
// ),
),
Padding(
padding: EdgeInsets.only(left: 8, right: 8),
child: Text(
"$counts",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
// reduce(miNiDetail, selectSkus);
});
},
child: Icon(
Icons.remove,
color: Color(0xFF32A060),
size: 24,
)
),
Padding(
padding: EdgeInsets.only(left: 8, right: 8),
child: Text(
"$counts",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
InkWell(
onTap: () {
state(() {
counts += 1;
add(miNiDetail, selectSkus);
});
},
child: Icon(
Icons.add,
color: Color(0xFF32A060),
size: 24,
)),
],
)
),
),
InkWell(
onTap: () {
state(() {
counts += 1;
// add(miNiDetail, selectSkus);
});
},
child: Icon(
Icons.add,
color: Color(0xFF32A060),
size: 24,
)),
],
),
SizedBox(
height: 24,
),
RoundButton(
width: double.infinity,
height: 54.h,
text: "加入购物车",
textColor: Colors.white,
fontWeight: MyFontWeight.semi_bold,
radius: 27,
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
callback: () {
state(() {
_addShopCar(miNiDetail, selectSkus, counts);
Navigator.of(context).pop();
});
},
),
)
],
),
));
SizedBox(
height: 24,
),
RoundButton(
width: double.infinity,
height: 54.h,
text: "加入购物车",
textColor: Colors.white,
fontWeight: MyFontWeight.semi_bold,
radius: 27,
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
callback: () {
state(() {
_addShopCar(miNiDetail, selectSkus, counts);
counts = 1;
Navigator.of(context).pop();
});
},
),
],
),
);
});
},
backgroundColor: Colors.transparent,

66
lib/store/store_order.dart

@ -515,12 +515,12 @@ class _StoreOrderPage extends State<StoreOrderPage>
Spacer(),
GestureDetector(
onTap: () {
// if(AppUtils.compareTime(storeInfo.openStartTime,DateFormat('HH:mm:ss').format(DateTime.now()))
// &&(!AppUtils.compareTime(storeInfo.openEndTime,DateFormat('HH:mm:ss').format(DateTime.now())))){
if(AppUtils.compareTime(storeInfo.openStartTime,DateFormat('HH:mm:ss').format(DateTime.now()))
&&(!AppUtils.compareTime(storeInfo.openEndTime,DateFormat('HH:mm:ss').format(DateTime.now())))){
toDownOrder();
// }
// else
// SmartDialog.showToast("营业时间:${storeInfo.openStartTime}-${storeInfo.openEndTime}", alignment: Alignment.center);
}
else
SmartDialog.showToast("营业时间:${storeInfo.openStartTime}-${storeInfo.openEndTime}", alignment: Alignment.center);
},
child: RoundButton(
width: 103.w,
@ -649,6 +649,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
"cid": cid,
"shoppingCart": shopCarGoods,
"numberOfPeople": numberOfPeople,
"distance":widget.arguments["distance"],
},
);
if (tableId > 0) {
@ -737,15 +738,16 @@ class _StoreOrderPage extends State<StoreOrderPage>
_queryMiNiDetail(String id, int count) async {
EasyLoading.show(status: S.current.zhengzaijiazai);
if (count < 0) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) async{
if (element.productId == id) {
shopCartReduce(element);
await shopCartReduce(element);
setState(() {});
}
});
return;
}
BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
EasyLoading.dismiss();
if (baseData != null && baseData.isSuccess) {
showStoreSelector(baseData.data, id, count);
}
@ -758,20 +760,19 @@ class _StoreOrderPage extends State<StoreOrderPage>
} else {
EasyLoading.dismiss();
dialogShowing = true;
SmartDialog.show(
widget: ProductSku(
miNiDetail,
shopCarGoods,
id,
_addShopCar,
add,
reduce,
),
onDismiss: () {
dialogShowing = false;
},
alignmentTemp: Alignment.bottomCenter,
);
showModalBottomSheet(
backgroundColor: Colors.transparent,
context: context,
builder: (_) {
return ProductSku(
miNiDetail,
shopCarGoods,
id,
_addShopCar,
add,
reduce,
);
});
}
}
@ -822,12 +823,10 @@ class _StoreOrderPage extends State<StoreOrderPage>
},
],
});
EasyLoading.dismiss();
// EasyLoading.dismiss();
if (baseDate != null && baseDate.isSuccess) {
queryShopCar().then((value) {
this.shopCarGoods = value;
setState(() {});
});
this.shopCarGoods = await queryShopCar();
setState(() {});
} else {
SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center);
}
@ -917,7 +916,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
if (productSku == null) return;
String skuId = productSku.id;
if (shopCarGoods == null) {
await _addShopCar(miNiDetail, selectSkus, 2);
await _addShopCar(miNiDetail, selectSkus, 1);
return;
}
int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList
@ -932,17 +931,16 @@ class _StoreOrderPage extends State<StoreOrderPage>
.firstWhere((element) => skuId == element.id);
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
} else {
await _addShopCar(miNiDetail, selectSkus, 2);
await _addShopCar(miNiDetail, selectSkus, 1);
return;
}
BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp);
if (baseDate.isSuccess) {
queryShopCar().then((value) {
this.shopCarGoods = value;
setState(() {});
});
this.shopCarGoods = await queryShopCar();
debugPrint("count.toString()");
setState(() {});
}
}
@ -956,7 +954,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
if (productSku == null) return;
String skuId = productSku.id;
if (shopCarGoods == null) {
await _addShopCar(miNiDetail, selectSkus, 2);
await _addShopCar(miNiDetail, selectSkus, 1);
return;
}
ShoppingCartSkuItemListBean shopSkuItem = shopCarGoods
@ -970,7 +968,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum -= 1;
}
} else {
await _addShopCar(miNiDetail, selectSkus, 2);
await _addShopCar(miNiDetail, selectSkus, 1);
return;
}
shopCarGoods.tableId = "$tableId";

630
lib/store/store_view/product_sku.dart

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -9,24 +10,18 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart';
class ProductSku extends StatefulWidget {
final MiNiDetail miNiDetail;
final String productId;
final Function(MiNiDetail miNiDetail, List<String> selectSkus, int count) addShopCar;
final Function(MiNiDetail miNiDetail, List<String> selectSkus, int count)
addShopCar;
final Function(MiNiDetail miNiDetail, List<String> selectSkus) add;
final Function(MiNiDetail miNiDetail, List<String> selectSkus) reduce;
final ShoppingCart shopCarGoods;
final int buttonType;
final int buttonType;
ProductSku(
this.miNiDetail,
this.shopCarGoods,
this.productId,
this.addShopCar,
this.add,
this.reduce,
{ this.buttonType}
);
ProductSku(this.miNiDetail, this.shopCarGoods, this.productId,
this.addShopCar, this.add, this.reduce,
{this.buttonType});
@override
State<StatefulWidget> createState() {
@ -36,8 +31,9 @@ class ProductSku extends StatefulWidget {
class _ProductSku extends State<ProductSku> {
List<String> selectSkus = [];
int count = 1;
int count = 1, realCount = 0;
String selectedPrice = "";
bool _isTapEd = false;
@override
void initState() {
@ -57,16 +53,19 @@ class _ProductSku extends State<ProductSku> {
productSku = widget.miNiDetail.productSkuVOList.firstWhere((element) {
return skuY(element, selectSkus);
});
}catch(ex){
} catch (ex) {
return;
}
if (productSku == null) return;
selectedPrice = productSku.skuPrice;
String skuId = productSku.id;
if (widget.shopCarGoods == null || widget.shopCarGoods.shoppingCartSkuItemList == null) return;
int shopSkuIndex = widget.shopCarGoods.shoppingCartSkuItemList.indexWhere((element) => skuId == element.id);
if (widget.shopCarGoods == null ||
widget.shopCarGoods.shoppingCartSkuItemList == null) return;
int shopSkuIndex = widget.shopCarGoods.shoppingCartSkuItemList
.indexWhere((element) => skuId == element.id);
if (shopSkuIndex >= 0) {
count = widget.shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum;
realCount = count;
}
}
@ -81,19 +80,19 @@ class _ProductSku extends State<ProductSku> {
return gg;
}
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
debugPrint("ssssasdadsasdadasd");
SmartDialog.dismiss();
// debugPrint("ssssasdadsasdadasd");
// SmartDialog.dismiss();
Navigator.of(context).pop();
return true;
},
child: StatefulBuilder(builder: (context1, state) {
return Container(
alignment: Alignment.topCenter,
padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16),
padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 16),
height: MediaQuery.of(context).size.height / 3 * 2,
width: double.infinity,
decoration: BoxDecoration(
@ -124,7 +123,8 @@ class _ProductSku extends State<ProductSku> {
SizedBox(
width: 10,
),
Expanded(child:Column(
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -136,12 +136,15 @@ class _ProductSku extends State<ProductSku> {
fontWeight: MyFontWeight.medium,
),
),
if(widget.miNiDetail.attrList[0].attrName!="")
if (widget.miNiDetail.attrList[0].attrName != "")
Padding(
padding: EdgeInsets.only(top: 4, bottom: 7),
child: Text(
"已选: " +
(selectSkus.map((e) => "$e").toList().toString()),
(selectSkus
.map((e) => "$e")
.toList()
.toString()),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -175,8 +178,8 @@ class _ProductSku extends State<ProductSku> {
)),
InkWell(
onTap: () {
// Navigator.of(context).pop();
SmartDialog.dismiss();
Navigator.of(context).pop();
// SmartDialog.dismiss();
},
child: Image.asset(
"assets/image/cancel.webp",
@ -187,11 +190,14 @@ class _ProductSku extends State<ProductSku> {
),
],
),
if (widget.miNiDetail.attrList != null && widget.miNiDetail.attrList.length > 0)
if (widget.miNiDetail.attrList != null &&
widget.miNiDetail.attrList.length > 0)
SizedBox(
height:10,
height: 10,
),
if (widget.miNiDetail.attrList != null && widget.miNiDetail.attrList.length > 0 && widget.miNiDetail.attrList[0].attrName!="")
if (widget.miNiDetail.attrList != null &&
widget.miNiDetail.attrList.length > 0 &&
widget.miNiDetail.attrList[0].attrName != "")
Expanded(
child: ListView.builder(
itemCount: widget.miNiDetail.attrList.length,
@ -200,7 +206,7 @@ class _ProductSku extends State<ProductSku> {
padding: EdgeInsets.zero,
itemBuilder: (context, position) {
return attrItem(
(attrValue) {
(attrValue) {
state(() {
selectSkus[position] = attrValue;
buildCount();
@ -212,8 +218,8 @@ class _ProductSku extends State<ProductSku> {
},
),
),
if (widget.miNiDetail.attrList[0].attrName=="")
Expanded(child: Container()),
if (widget.miNiDetail.attrList[0].attrName == "")
Expanded(child: Container()),
SizedBox(
height: 24,
),
@ -231,12 +237,15 @@ class _ProductSku extends State<ProductSku> {
),
),
InkWell(
onTap: () {
if (count > 1)
setState(() {
count -= 1;
});
widget.reduce(widget.miNiDetail, selectSkus);
onTap: () async {
if(count == 1)
return;
_isTapEd = true;
EasyLoading.show(status: S.current.zhengzaijiazai);
await widget.reduce(widget.miNiDetail, selectSkus);
count -= 1;
setState(() {});
EasyLoading.dismiss();
},
child: Image.asset(
"assets/image/reduce.webp",
@ -256,11 +265,17 @@ class _ProductSku extends State<ProductSku> {
),
),
InkWell(
onTap: () {
setState(() {
count += 1;
});
widget.add(widget.miNiDetail, selectSkus);
onTap: () async {
_isTapEd = true;
EasyLoading.show(status: S.current.zhengzaijiazai);
if (count == 1 && realCount == 0)
await widget.addShopCar(
widget.miNiDetail, selectSkus, 2);
else
await widget.add(widget.miNiDetail, selectSkus);
count += 1;
setState(() {});
EasyLoading.dismiss();
},
child: Image.asset(
"assets/image/add.webp",
@ -273,7 +288,7 @@ class _ProductSku extends State<ProductSku> {
SizedBox(
height: 24,
),
if(widget.buttonType != 1)
if (widget.buttonType != 1)
RoundButton(
width: double.infinity,
height: 54.h,
@ -284,12 +299,13 @@ class _ProductSku extends State<ProductSku> {
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
callback: () {
// Navigator.of(context).pop();
SmartDialog.dismiss();
widget.addShopCar(widget.miNiDetail, selectSkus, 1);
Navigator.of(context).pop();
// SmartDialog.dismiss();
if (!_isTapEd)
widget.addShopCar(widget.miNiDetail, selectSkus, 1);
},
),
if(widget.buttonType == 1)
if (widget.buttonType == 1)
RoundButton(
width: double.infinity,
height: 54.h,
@ -300,72 +316,21 @@ class _ProductSku extends State<ProductSku> {
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
callback: () {
// Navigator.of(context).pop();
SmartDialog.dismiss();
widget.addShopCar(widget.miNiDetail, selectSkus,count);
Navigator.of(context).pop();
// SmartDialog.dismiss();
widget.addShopCar(widget.miNiDetail, selectSkus, count);
},
),
///
if(widget.buttonType == 2)
if (widget.buttonType == 2)
Row(
children: [
Expanded(child: GestureDetector(
onTap: (){
Navigator.of(context).pushReplacementNamed('/router/group_details');
},
child: Container(
alignment: Alignment.center,
width: 120.w,
height:40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
border: Border.all(
width: 1,
color: Color(0xFF32A060),
style: BorderStyle.solid,
),
),
child: Column(
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 7.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),
),
],
),
),
Expanded(child:
Text(
"原价购买",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),
)),
],
),
),
),),
Expanded(child: GestureDetector(
onTap: (){
Navigator.of(context).popAndPushNamed('/router/bargain_details');
Expanded(
child: GestureDetector(
onTap: () {
Navigator.of(context)
.pushReplacementNamed('/router/group_details');
},
child: Container(
alignment: Alignment.center,
@ -373,16 +338,12 @@ class _ProductSku extends State<ProductSku> {
height: 40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
border: Border.all(
width: 1,
color: Color(0xFF32A060),
style: BorderStyle.solid,
),
),
child: Column(
children: [
@ -394,7 +355,7 @@ class _ProductSku extends State<ProductSku> {
style: TextStyle(
fontSize: 7.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
color: Color(0xFF32A060),
),
),
TextSpan(
@ -402,89 +363,99 @@ class _ProductSku extends State<ProductSku> {
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
color: Color(0xFF32A060),
),
),
],
),
),
Expanded(child:
Text(
"我要砍价",
Expanded(
child: Text(
"原价购买",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
color: Color(0xFF32A060),
),
),),
)),
],
),
)),),
],
),
///
if(widget.buttonType == 3)
Row(
children: [
Expanded(child:GestureDetector(
onTap: (){
Navigator.of(context).popAndPushNamed('/router/group_details');
},
child: Container(
alignment: Alignment.center,
width: 120.w,
height:40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
border: Border.all(
width: 1,
color: Color(0xFF32A060),
style: BorderStyle.solid,
),
),
child: Column(
children: [
Text.rich(
TextSpan(
children: [
),
),
Expanded(
child: GestureDetector(
onTap: () {
Navigator.of(context)
.popAndPushNamed('/router/bargain_details');
},
child: Container(
alignment: Alignment.center,
width: 120.w,
height: 40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Column(
children: [
Text.rich(
TextSpan(
text: "",
style: TextStyle(
fontSize: 7.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 7.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
],
),
TextSpan(
text: "284.00",
),
Expanded(
child: Text(
"我要砍价",
style: TextStyle(
fontSize: 10.sp,
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
color: Colors.white,
),
),
],
),
),
],
),
Expanded(child:
Text(
"原价购买",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),
)),
],
),
),
),),
Expanded(child:GestureDetector(
onTap: (){
Navigator.of(context).popAndPushNamed('/router/bargain_details');
)),
),
],
),
///
if (widget.buttonType == 3)
Row(
children: [
Expanded(
child: GestureDetector(
onTap: () {
Navigator.of(context)
.popAndPushNamed('/router/group_details');
},
child: Container(
alignment: Alignment.center,
@ -492,16 +463,12 @@ class _ProductSku extends State<ProductSku> {
height: 40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
border: Border.all(
width: 1,
color: Color(0xFF32A060),
style: BorderStyle.solid,
),
),
child: Column(
children: [
@ -513,7 +480,7 @@ class _ProductSku extends State<ProductSku> {
style: TextStyle(
fontSize: 7.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
color: Color(0xFF32A060),
),
),
TextSpan(
@ -521,87 +488,99 @@ class _ProductSku extends State<ProductSku> {
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
color: Color(0xFF32A060),
),
),
],
),
),
Expanded(child:
Text(
"我要秒杀",
Expanded(
child: Text(
"原价购买",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
color: Color(0xFF32A060),
),
),),
)),
],
),
)),),
],
),
///
if(widget.buttonType == 4)
Row(
children: [
Expanded(child: GestureDetector(
onTap: (){
Navigator.of(context).popAndPushNamed('/router/group_details');
},
child: Container(
alignment: Alignment.center,
width: 120.w,
height:40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
border: Border.all(
width: 1,
color: Color(0xFF32A060),
style: BorderStyle.solid,
),
),
child: Column(
children: [
Text.rich(
TextSpan(
),
Expanded(
child: GestureDetector(
onTap: () {
Navigator.of(context)
.popAndPushNamed('/router/bargain_details');
},
child: Container(
alignment: Alignment.center,
width: 120.w,
height: 40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Column(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 7.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 7.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
],
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
Expanded(
child: Text(
"我要秒杀",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
],
),
),
Expanded(child:
Text(
"单人购买",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),
)),
],
),
),
)),
Expanded(child:GestureDetector(
onTap: (){
Navigator.of(context).popAndPushNamed('/router/bargain_details');
],
),
///
if (widget.buttonType == 4)
Row(
children: [
Expanded(
child: GestureDetector(
onTap: () {
Navigator.of(context)
.popAndPushNamed('/router/group_details');
},
child: Container(
alignment: Alignment.center,
@ -609,16 +588,12 @@ class _ProductSku extends State<ProductSku> {
height: 40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
border: Border.all(
width: 1,
color: Color(0xFF32A060),
style: BorderStyle.solid,
),
),
child: Column(
children: [
@ -630,7 +605,7 @@ class _ProductSku extends State<ProductSku> {
style: TextStyle(
fontSize: 7.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
color: Color(0xFF32A060),
),
),
TextSpan(
@ -638,26 +613,88 @@ class _ProductSku extends State<ProductSku> {
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
color: Color(0xFF32A060),
),
),
],
),
),
Expanded(child:
Text(
"我要开团",
Expanded(
child: Text(
"单人购买",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
color: Color(0xFF32A060),
),
),),
)),
],
),
)),),
],
),
),
)),
Expanded(
child: GestureDetector(
onTap: () {
Navigator.of(context)
.popAndPushNamed('/router/bargain_details');
},
child: Container(
alignment: Alignment.center,
width: 120.w,
height: 40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Column(
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 7.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
],
),
),
Expanded(
child: Text(
"我要开团",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
],
),
)),
),
],
),
SizedBox(
height: 21.h,
),
@ -669,7 +706,8 @@ class _ProductSku extends State<ProductSku> {
}
Widget attrItem(Function fc, AttrListBean attrListBean, position) {
if (attrListBean.attrValueList != null && attrListBean.attrValueList.length > 0)
if (attrListBean.attrValueList != null &&
attrListBean.attrValueList.length > 0)
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -684,7 +722,7 @@ class _ProductSku extends State<ProductSku> {
),
),
),
sweetnessStore(fc,attrListBean.attrValueList, position),
sweetnessStore(fc, attrListBean.attrValueList, position),
// sweetnessStore(fc, attrListBean.attrValueList, position),
],
);
@ -723,16 +761,17 @@ class _ProductSku extends State<ProductSku> {
// );
// }
Widget sweetnessStore(Function fc,List<AttrValueListBean> arrays, position){
Widget sweetnessStore(Function fc, List<AttrValueListBean> arrays, position) {
return Wrap(
runSpacing: 10.0,
spacing: 10.0,
children: arrays.take(arrays.length).map<Widget>((AttrValueListBean tag) {
children:
arrays.take(arrays.length).map<Widget>((AttrValueListBean tag) {
return GestureDetector(
onTap: () {
fc(tag.attrValue);
},
child:sweetnessItem(
child: sweetnessItem(
tag.attrValue,
(tag.attrValue == selectSkus[position]) ?? false,
));
@ -741,27 +780,26 @@ class _ProductSku extends State<ProductSku> {
Widget sweetnessItem(String name, bool isCheck) {
return Container(
padding: const EdgeInsets.symmetric(vertical:5.0,horizontal: 12.0),
decoration: BoxDecoration(
color: !isCheck ? Color(0xFFF2F2F2) : Color(0xFFF0FAF4),
border: Border.all(
width: !isCheck ? 0:1,
color: !isCheck ? Color(0xFFF2F2F2):Color(0xFF32A060),
style: BorderStyle.solid,
),
borderRadius: const BorderRadius.all(
Radius.circular(4.0),
),
),
child: Text(
name,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color:!isCheck ? Color(0xFF4D4D4D) : Color(0xFF32A060),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 12.0),
decoration: BoxDecoration(
color: !isCheck ? Color(0xFFF2F2F2) : Color(0xFFF0FAF4),
border: Border.all(
width: !isCheck ? 0 : 1,
color: !isCheck ? Color(0xFFF2F2F2) : Color(0xFF32A060),
style: BorderStyle.solid,
),
borderRadius: const BorderRadius.all(
Radius.circular(4.0),
),
),
));
child: Text(
name,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: !isCheck ? Color(0xFF4D4D4D) : Color(0xFF32A060),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
));
}
}

148
lib/store/store_view/shop_goods.dart

@ -94,10 +94,10 @@ class _ShopGoods extends State<ShopGoods> {
Widget build(BuildContext context) {
return Container(
color: Colors.white,
padding: EdgeInsets.only(
right: 16.w,
// bottom: 20.h,
),
// padding: EdgeInsets.only(
// right: 16.w,
// // bottom: 20.h,
// ),
height: 123.h,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
@ -125,7 +125,8 @@ class _ShopGoods extends State<ShopGoods> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
Padding(padding: EdgeInsets.only(right: 16.w),
child: Row(
children: [
Expanded(
child: Text(
@ -156,11 +157,12 @@ class _ShopGoods extends State<ShopGoods> {
// ),
// ),
],
),
),),
SizedBox(
height: 2.h,
),
Row(
Padding(padding: EdgeInsets.only(right: 16.w),
child: Row(
children: [
Expanded(
child: Text(
@ -180,11 +182,12 @@ class _ShopGoods extends State<ShopGoods> {
width: 10,
),
],
),
)),
SizedBox(
height: 7.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
@ -219,35 +222,38 @@ class _ShopGoods extends State<ShopGoods> {
// ),
],
),
Spacer(),
if (!widget.isShopCart &&
(widget.productListBean?.attrStyle ?? 0) == 1)
Stack(
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async{
if(widget.storeInfo.posType.code == "NORMALSTORE"&& widget.tableId == 0){
showDeleteDialog();
}else{
widget.queryMiNiDetail(
widget.productListBean != null
? widget.productListBean.id
: widget.shoppingCartSkuItemListBean
.productId,
0);
}
},
child:Container(
padding: EdgeInsets.only(right: 16.w),
child: Stack(
children: [
Container(
margin: EdgeInsets.only(right: 8, top: 4),
child: RoundButton(
// width: 49.w,
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),
callback: () {
if(widget.storeInfo.posType.code == "NORMALSTORE"&& widget.tableId == 0){
showDeleteDialog();
}else{
widget.queryMiNiDetail(
widget.productListBean != null
? widget.productListBean.id
: widget.shoppingCartSkuItemListBean
.productId,
0);
}
},
),
Container(
padding: EdgeInsets.only(left:35.w,top: 4.h,bottom: 4.h,),
margin: EdgeInsets.only(right: 8, top: 4),
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(
right: 0,
@ -266,26 +272,32 @@ class _ShopGoods extends State<ShopGoods> {
),
),
],
),
),)),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0)
InkWell(
onTap: () {
if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){
showDeleteDialog();
}else{
widget.reduce(widget.shoppingCartSkuItemListBean);}
},
child: Image.asset(
"assets/image/reduce.webp",
width: 22,
height: 22.h,
Spacer(),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async{
if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){
showDeleteDialog();
}else{
widget.reduce(widget.shoppingCartSkuItemListBean);}
},
child: Container(
padding: EdgeInsets.only(left: 15.w,right: 6.w),
child: Image.asset(
"assets/image/reduce.webp",
width: 22,
height: 22.h,
),
),
),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0)
Container(
width: 30,
alignment: Alignment.center,
child: Text(
"${widget.count}",
@ -298,31 +310,35 @@ class _ShopGoods extends State<ShopGoods> {
),
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0)
GestureDetector(
onTap: () async{
if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){
showDeleteDialog();
}else{
if(_jumpType == -1)
queryMiNiDetail(widget.productListBean.id);
else if(_jumpType == 0)
widget.add(widget.shoppingCartSkuItemListBean);
else if(_jumpType == 1)
await Navigator.of(context)
.pushNamed('/router/product_meals_sku', arguments: {
"id":widget.productListBean.id,
"storeId":widget.productListBean.storeId,
"tableId":widget.tableId
});
widget.queryShoppingCart();
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async{
if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){
showDeleteDialog();
}else{
if(_jumpType == -1)
queryMiNiDetail(widget.productListBean.id);
else if(_jumpType == 0)
widget.add(widget.shoppingCartSkuItemListBean);
else if(_jumpType == 1)
await Navigator.of(context)
.pushNamed('/router/product_meals_sku', arguments: {
"id":widget.productListBean.id,
"storeId":widget.productListBean.storeId,
"tableId":widget.tableId
});
widget.queryShoppingCart();
}
},
child: Image.asset(
},
child: Container(
padding: EdgeInsets.only(left: 6.w,right:16.w),
child: Image.asset(
"assets/image/add.webp",
width: 22,
height: 22.h,
),
),
),
],
),
SizedBox(

3
lib/union/union_list.dart

@ -87,7 +87,8 @@ class _UnionList extends State<UnionList> {
arguments: {
"id": widget.storeList[position].id,
"tenant": widget.storeList[position].tenantCode,
"storeName": widget.storeList[position].storeName
"storeName": widget.storeList[position].storeName,
"distance":widget.storeList[position].distance
},
);
}

6
lib/view_widget/activity_poster.dart

@ -22,7 +22,9 @@ class ActivityPoster extends StatefulWidget {
class _ActivityPoster extends State<ActivityPoster> {
@override
Widget build(BuildContext context) {
return Container(
return WillPopScope(
onWillPop: () async => false,
child:Container(
width: double.infinity,
alignment: Alignment.center,
margin: EdgeInsets.only(
@ -69,7 +71,7 @@ class _ActivityPoster extends State<ActivityPoster> {
) )
],
),
);
));
}
/// contentType 0123,4:,5:

Loading…
Cancel
Save