Browse Source

Merge remote-tracking branch 'origin/new_revision_app' into new_revision_app

# Conflicts:
#	lib/mine/recharge_page.dart
new_revision_app
fmk 2 years ago
parent
commit
1ed8f1fec8
  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. 702
      lib/message/system_message.dart
  9. 4
      lib/mine/recharge_page.dart
  10. 17
      lib/order/edit_remarks_page.dart
  11. 4
      lib/order/order_detail_page.dart
  12. 3
      lib/order/order_history_page.dart
  13. 24
      lib/order/order_view/order_address.dart
  14. 5
      lib/settlement/settlement.dart
  15. 42
      lib/settlement/settlement_view/distribution.dart
  16. 7
      lib/settlement/settlement_view/pay_method.dart
  17. 357
      lib/store/shop_details_page.dart
  18. 66
      lib/store/store_order.dart
  19. 630
      lib/store/store_view/product_sku.dart
  20. 148
      lib/store/store_view/shop_goods.dart
  21. 3
      lib/union/union_list.dart
  22. 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"]; params["activityId"] = pushMap["info"];
break; break;
case 3: case 3:
routeName = "/router/union_detail_page"; routeName = "/router/store_order";
params["id"] = pushMap["info"]; params["id"] = pushMap["info"];
params["tenant"] = pushMap["tenant"];
params["storeName"] = pushMap["storeName"];
break; break;
case 4: case 4:
routeName = "/router/integral_store_page"; routeName = "/router/integral_store_page";

2
lib/community/community_details.dart

@ -105,7 +105,7 @@ class _CommunityDetails extends State<CommunityDetails>
void _focusNodeListener() { void _focusNodeListener() {
/*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){ /*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){
setState(() { 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( child: Column(
children: [ children: [
Container( Container(
height: MediaQuery.of(context).size.width / 1.5,
child: Stack( child: Stack(
children: [ children: [
ClassDetailsVideo( ClassDetailsVideo(

2
lib/community/community_view/community_dynamic.dart

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

55
lib/home/welfare_page.dart

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

4
lib/main.dart

@ -199,7 +199,7 @@ class MyApp extends StatelessWidget {
} else if (locales[0].countryCode == "CN"){ } else if (locales[0].countryCode == "CN"){
locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH'); locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH');
} else{ } else{
locale = Locale.fromSubtags(languageCode: 'en', countryCode: 'CH'); locale = Locale.fromSubtags(languageCode: 'en', countryCode: 'US');
} }
return appLocale ?? locale; return appLocale ?? locale;
}, },
@ -325,7 +325,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/help_feedback_page': (context, {arguments}) => HelpFeedbackPage(), '/router/help_feedback_page': (context, {arguments}) => HelpFeedbackPage(),
'/router/founder_story_page': (context, {arguments}) => FounderStoryPage(), '/router/founder_story_page': (context, {arguments}) => FounderStoryPage(),
'/router/system_msg_page': (context, {arguments}) => SystemMessagePage(), '/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/hot_article_page': (context, {arguments}) => HotArticlePage(),
'/router/address_map_page': (context, {arguments}) => AddressMapPage(), '/router/address_map_page': (context, {arguments}) => AddressMapPage(),
'/router/roll_center_page': (context, {arguments}) => RollCenterPage(), '/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"]; params["activityId"] = pushMap["info"];
break; break;
case 3: case 3:
routeName = "/router/union_detail_page"; routeName = "/router/store_order";
params["id"] = pushMap["info"]; params["id"] = pushMap["info"];
params["tenant"] = pushMap["tenant"];
params["storeName"] = pushMap["storeName"];
break; break;
case 4: case 4:
routeName = "/router/integral_store_page"; routeName = "/router/integral_store_page";

702
lib/message/system_message.dart

@ -28,13 +28,13 @@ class _SystemMessagePage extends State<SystemMessagePage> {
ApiService apiService; ApiService apiService;
int pageNum = 1; int pageNum = 1;
List<Message> messages = []; List<Message> messages = [];
Map <String,int> msgNumber = { Map<String, int> msgNumber = {
"1":0, "1": 0,
"2":0, "2": 0,
"3":0, "3": 0,
"4":0, "4": 0,
"5":0, "5": 0,
"6":0, "6": 0,
}; };
int state = 0; int state = 0;
@ -75,7 +75,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
List<Message> message = []; List<Message> message = [];
message.addAll(baseData.data.list); message.addAll(baseData.data.list);
message.forEach((element) { message.forEach((element) {
if(element.typed==2 || element.typed==3){ if (element.typed == 2 || element.typed == 3) {
messages.add(element); messages.add(element);
} }
}); });
@ -102,14 +102,15 @@ class _SystemMessagePage extends State<SystemMessagePage> {
token: value.getString("token"), token: value.getString("token"),
); );
} }
BaseData<List<MsgStats>> baseData = await apiService.stats().catchError((onError) {}); BaseData<List<MsgStats>> baseData =
await apiService.stats().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
msgNumber.forEach((key, value) { msgNumber.forEach((key, value) {
msgNumber[key] = 0; msgNumber[key] = 0;
}); });
baseData.data.forEach((element) { baseData.data.forEach((element) {
if(msgNumber.containsKey(element.name)){ if (msgNumber.containsKey(element.name)) {
msgNumber[element.name] = element.number; msgNumber[element.name] = element.number;
} }
}); });
@ -125,34 +126,34 @@ class _SystemMessagePage extends State<SystemMessagePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: MyAppBar( // appBar: MyAppBar(
background: Colors.white, // background: Colors.white,
leadingColor: Colors.black, // leadingColor: Colors.black,
title: S.of(context).xiaoxi, // title: S.of(context).xiaoxi,
titleSize: 18.sp, // titleSize: 18.sp,
titleColor: Colors.black, // titleColor: Colors.black,
actions: [ // actions: [
Container( // Container(
margin: EdgeInsets.only(right: 16.w), // margin: EdgeInsets.only(right: 16.w),
alignment: Alignment.centerRight, // alignment: Alignment.centerRight,
child: GestureDetector( // child: GestureDetector(
onTap: () { // onTap: () {
setState(() { // setState(() {
queryMsgStats(); // queryMsgStats();
}); // });
}, // },
child: Text( // child: Text(
S.of(context).biaoweiyidu, // S.of(context).biaoweiyidu,
style: TextStyle( // style: TextStyle(
fontSize: 16.sp, // fontSize: 16.sp,
fontWeight:MyFontWeight.semi_bold, // fontWeight:MyFontWeight.semi_bold,
color: Color(0xFF353535), // color: Color(0xFF353535),
), // ),
), // ),
), // ),
), // ),
], // ],
), // ),
body: SmartRefresher( body: SmartRefresher(
enablePullDown: true, enablePullDown: true,
enablePullUp: true, enablePullUp: true,
@ -161,7 +162,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
footer: CustomFooter( footer: CustomFooter(
loadStyle: LoadStyle.ShowWhenLoading, loadStyle: LoadStyle.ShowWhenLoading,
builder: (BuildContext context, LoadStatus mode) { builder: (BuildContext context, LoadStatus mode) {
return (messages.length == 0)?Container():MyFooter(mode); return (messages.length == 0) ? Container() : MyFooter(mode);
}, },
), ),
controller: _refreshController, controller: _refreshController,
@ -177,262 +178,314 @@ class _SystemMessagePage extends State<SystemMessagePage> {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 10.h,
bottom: 15.h,right: 16.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop();
},
child: Container(
alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 12,),
padding: EdgeInsets.all(6),
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
size: 24,
),
),
),
Spacer(),
Expanded(
child: Text(
S.of(context).xiaoxi,
style: TextStyle(
color: Colors.black,
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
queryMsgStats();
});
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: Text(
S.of(context).biaoweiyidu,
style: TextStyle(
color: Colors.black,
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),
newsSurvey(), newsSurvey(),
SizedBox(height: 16.h,), SizedBox(
height: 16.h,
),
buildMessage(), buildMessage(),
], ],
), ),
), ),
), ),
), ),
), ),
); );
} }
Widget newsSurvey(){ Widget newsSurvey() {
return Container( return Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 16.h,bottom: 16.h), padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
child: Row( child: Row(
children: [ children: [
Expanded(child: GestureDetector( Expanded(
onTap: (){ child: GestureDetector(
Navigator.of(context) onTap: () {
.pushNamed('/router/system_details',arguments: {"msgType":5}).then((value) { Navigator.of(context).pushNamed('/router/system_details',
setState(() { arguments: {"msgType": 5}).then((value) {
msgNumber["5"] = 0; setState(() {
msgNumber["5"] = 0;
});
}); });
}); },
}, child: Column(
child:Column( children: [
children: [ Stack(
Stack( children: [
children: [ Image.asset(
Image.asset( "assets/image/icon_z.webp",
"assets/image/icon_z.webp", width: 40,
width: 40, height: 40,
height: 40,
),
if(msgNumber["5"].toString() != "0")
Container(
width:48,
alignment: Alignment.topRight,
child:Container(
width:20,
height:17,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color:Color(0xFFFF441A),
), ),
child:RoundButton( if (msgNumber["5"].toString() != "0")
text:msgNumber["5"].toString(), Container(
textColor: Colors.white, width: 48,
fontWeight: MyFontWeight.regular, alignment: Alignment.topRight,
backgroup: Color(0xFFFF441A), child: Container(
fontSize:8.sp, width: 20,
radius: 100, height: 17,
) decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color: Color(0xFFFF441A),
),
child: RoundButton(
text: msgNumber["5"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 8.sp,
radius: 100,
)),
)
],
), ),
) SizedBox(height: 6.h),
], Text(
), S.of(context).dianzan,
SizedBox(height: 6.h), style: TextStyle(
Text( fontSize: 14.sp,
S.of(context).dianzan, fontWeight: MyFontWeight.medium,
style: TextStyle( color: Color(0xFF060606),
fontSize: 14.sp,
fontWeight:MyFontWeight.medium,
color: Color(0xFF060606),
),
)
],
)
)
),
Expanded(child:
GestureDetector(
onTap: (){
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":6}).then((value) {
setState(() {
msgNumber["6"] = 0;
});
});
},
child: Column(
children: [
Stack(
children: [
Image.asset(
"assets/image/icon_pl.webp",
width: 40,
height: 40,
), ),
if(msgNumber["6"].toString() != "0") )
Container( ],
width:48, ))),
alignment: Alignment.topRight, Expanded(
child:Container( child: GestureDetector(
width:16, onTap: () {
height:16, Navigator.of(context).pushNamed('/router/system_details',
decoration: BoxDecoration( arguments: {"msgType": 6}).then((value) {
borderRadius: BorderRadius.circular(100), setState(() {
border: Border.all( msgNumber["6"] = 0;
width: 1, });
color: Colors.white, });
style: BorderStyle.solid, },
), child: Column(
color:Color(0xFFFF441A), children: [
), Stack(
child:RoundButton( children: [
text: msgNumber["6"].toString(), Image.asset(
textColor: Colors.white, "assets/image/icon_pl.webp",
fontWeight: MyFontWeight.regular, width: 40,
backgroup: Color(0xFFFF441A), height: 40,
fontSize:8.sp,
radius: 100,
)
), ),
) if (msgNumber["6"].toString() != "0")
], Container(
), width: 48,
SizedBox(height: 6.h), alignment: Alignment.topRight,
Text( child: Container(
S.of(context).pinglun, width: 16,
style: TextStyle( height: 16,
fontSize: 14.sp, decoration: BoxDecoration(
fontWeight:MyFontWeight.medium, borderRadius: BorderRadius.circular(100),
color: Color(0xFF060606), border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color: Color(0xFFFF441A),
),
child: RoundButton(
text: msgNumber["6"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 8.sp,
radius: 100,
)),
)
],
), ),
), SizedBox(height: 6.h),
], Text(
) S.of(context).pinglun,
)), style: TextStyle(
Expanded(child: fontSize: 14.sp,
GestureDetector( fontWeight: MyFontWeight.medium,
onTap: (){ color: Color(0xFF060606),
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":4}).then((value) {
setState(() {
msgNumber["4"] = 0;
});
});
},
child:Column(
children: [
Stack(
children: [
Image.asset(
"assets/image/icon_gz.webp",
width: 40,
height: 40,
), ),
if(msgNumber["4"].toString() != "0") ),
Container( ],
width:48, ))),
alignment: Alignment.topRight, Expanded(
child:Container( child: GestureDetector(
width:16, onTap: () {
height:16, Navigator.of(context).pushNamed('/router/system_details',
decoration: BoxDecoration( arguments: {"msgType": 4}).then((value) {
borderRadius: BorderRadius.circular(100), setState(() {
border: Border.all( msgNumber["4"] = 0;
width: 1, });
color: Colors.white, });
style: BorderStyle.solid, },
), child: Column(
color:Color(0xFFFF441A), children: [
), Stack(
child:RoundButton( children: [
text: msgNumber["4"].toString(), Image.asset(
textColor: Colors.white, "assets/image/icon_gz.webp",
fontWeight: MyFontWeight.regular, width: 40,
backgroup: Color(0xFFFF441A), height: 40,
fontSize:8.sp,
radius: 100,
)
), ),
) if (msgNumber["4"].toString() != "0")
], Container(
), width: 48,
SizedBox(height: 6.h), alignment: Alignment.topRight,
Text( child: Container(
S.of(context).guanzhu, width: 16,
style: TextStyle( height: 16,
fontSize: 14.sp, decoration: BoxDecoration(
fontWeight:MyFontWeight.medium, borderRadius: BorderRadius.circular(100),
color: Color(0xFF060606), border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color: Color(0xFFFF441A),
),
child: RoundButton(
text: msgNumber["4"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 8.sp,
radius: 100,
)),
)
],
), ),
), SizedBox(height: 6.h),
], Text(
) S.of(context).guanzhu,
) style: TextStyle(
), fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF060606),
),
),
],
))),
], ],
), ),
); );
} }
Widget buildMessage(){ Widget buildMessage() {
return Container( return Container(
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(20.w), padding: EdgeInsets.all(20.w),
child:Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
S.of(context).xitongxiaoxi, S.of(context).xitongxiaoxi,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight:MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Colors.black, color: Colors.black,
),
), ),
), (messages == null || messages.length == 0)
(messages == null || messages.length == 0) ? NoDataView(
? NoDataView( src: "assets/image/icon_empty.webp",
src: "assets/image/icon_empty.webp", isShowBtn: false,
isShowBtn: false, text: S.of(context).haimeiyouxiaoxi,
text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp,
fontSize: 16.sp, margin: EdgeInsets.only(top: 120.h),
margin: EdgeInsets.only(top: 120.h), )
) : ListView.builder(
:ListView.builder( padding: EdgeInsets.only(top: 16),
padding: EdgeInsets.only(top: 16), itemCount: messages.length,
itemCount: messages.length, shrinkWrap: true,
shrinkWrap: true, physics: NeverScrollableScrollPhysics(),
physics: NeverScrollableScrollPhysics(), itemBuilder: (context, position) {
itemBuilder: (context, position) { return GestureDetector(
return GestureDetector( onTap: () {
onTap: () { if (messages[position].typed == 2)
if(messages[position].typed == 2) Navigator.of(context).pushNamed(
Navigator.of(context) '/router/system_details',
.pushNamed('/router/system_details',arguments: {"msgType":2}).then((value) { arguments: {"msgType": 2}).then((value) {
setState(() { setState(() {
msgNumber["2"] = 0; msgNumber["2"] = 0;
}); });
}); });
else if(messages[position].typed == 3) else if (messages[position].typed == 3)
Navigator.of(context) Navigator.of(context).pushNamed(
.pushNamed('/router/system_details',arguments: {"msgType":3}).then((value) { '/router/system_details',
setState(() { arguments: {"msgType": 3}).then((value) {
msgNumber["3"] = 0; setState(() {
}); msgNumber["3"] = 0;
}); });
}, });
child: buildMessageItem(messages[position]), },
); child: buildMessageItem(messages[position]),
}), );
], }),
) ],
); ));
} }
Widget buildMessageItem(Message message) { Widget buildMessageItem(Message message) {
@ -464,26 +517,28 @@ class _SystemMessagePage extends State<SystemMessagePage> {
(message.typed == 1) (message.typed == 1)
? "assets/image/icon_system_message.webp" ? "assets/image/icon_system_message.webp"
: (message.typed == 2) : (message.typed == 2)
? "assets/image/icon_system_message.webp" ? "assets/image/icon_system_message.webp"
: "assets/image/c_z.webp", : "assets/image/c_z.webp",
width: 40.w, width: 40.w,
height: 40.h, height: 40.h,
), ),
SizedBox( SizedBox(
width:12.w, width: 12.w,
), ),
Expanded(child:Column( Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
Expanded(child:Text( Expanded(
child: Text(
(message.typed == 1) (message.typed == 1)
? S.of(context).xitongtongzhi ? S.of(context).xitongtongzhi
: (message.typed == 2) : (message.typed == 2)
? S.of(context).dingdanxiaoxi ? S.of(context).dingdanxiaoxi
: S.of(context).chongzhixiaoxi, : S.of(context).chongzhixiaoxi,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -499,64 +554,67 @@ class _SystemMessagePage extends State<SystemMessagePage> {
), ),
], ],
), ),
SizedBox(height:4.h,), SizedBox(
(message.typed != 3) ? height: 4.h,
Row(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child:
Text(
S.of(context).ninyouyigexindedingdan,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),),
if(msgNumber["2"].toString() != "0")
RoundButton(
width: 16,
height: 16,
text:msgNumber["2"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:10.sp,
radius: 100,
),
],
):
Row(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child:
Text(
message.content,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
)),
if(msgNumber["3"].toString() != "0")
RoundButton(
width: 16,
height: 16,
text:msgNumber["3"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:10.sp,
radius: 100,
),
],
), ),
(message.typed != 3)
? Row(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
S.of(context).ninyouyigexindedingdan,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),
),
if (msgNumber["2"].toString() != "0")
RoundButton(
width: 16,
height: 16,
text: msgNumber["2"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 10.sp,
radius: 100,
),
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
message.content,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
)),
if (msgNumber["3"].toString() != "0")
RoundButton(
width: 16,
height: 16,
text: msgNumber["3"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 10.sp,
radius: 100,
),
],
),
], ],
)), )),
], ],
), ),
Container( Container(
margin: EdgeInsets.only(top: 16.h,bottom:8.h), margin: EdgeInsets.only(top: 16.h, bottom: 8.h),
height: 1.h, height: 1.h,
width: double.infinity, width: double.infinity,
color: Color(0xFFF7F7F7), color: Color(0xFFF7F7F7),

4
lib/mine/recharge_page.dart

@ -296,6 +296,7 @@ class _RechargePage extends State<RechargePage> {
), ),
), ),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 2; checkIndex = 2;
@ -328,6 +329,7 @@ class _RechargePage extends State<RechargePage> {
), ),
SizedBox(height:10.h), SizedBox(height:10.h),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 3; checkIndex = 3;
@ -632,7 +634,7 @@ class _RechargePage extends State<RechargePage> {
Widget checkView(var index) { Widget checkView(var index) {
return Container( return Container(
padding: EdgeInsets.only(right: 16.w), padding: EdgeInsets.only(right: 16.w,left: 46.w),
alignment: Alignment.center, alignment: Alignment.center,
child: Image.asset( child: Image.asset(
checkIndex != index 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'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class EditRemarksPage extends StatefulWidget { class EditRemarksPage extends StatefulWidget {
final Map<String, dynamic> arguments;
EditRemarksPage({this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _EditRemarksPage(); return _EditRemarksPage();
@ -14,6 +17,14 @@ class EditRemarksPage extends StatefulWidget {
class _EditRemarksPage extends State<EditRemarksPage> { class _EditRemarksPage extends State<EditRemarksPage> {
TextEditingController commentTextController = TextEditingController(); TextEditingController commentTextController = TextEditingController();
@override
void initState() {
super.initState();
if((widget.arguments["remake"]??"") != "")
commentTextController.text = widget.arguments["remake"];
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -75,7 +86,8 @@ class _EditRemarksPage extends State<EditRemarksPage> {
controller: commentTextController, controller: commentTextController,
keyboardType: TextInputType.multiline, keyboardType: TextInputType.multiline,
maxLines: 10, maxLines: 10,
decoration: InputDecoration( decoration:
InputDecoration(
isDense: true, isDense: true,
hintText: '请填写备注信息,例如:面包切一刀', hintText: '请填写备注信息,例如:面包切一刀',
hintStyle: TextStyle( hintStyle: TextStyle(
@ -97,7 +109,8 @@ class _EditRemarksPage extends State<EditRemarksPage> {
), ),
GestureDetector( GestureDetector(
onTap: (){ onTap: (){
Navigator.pop(context,commentTextController.text); String notes = commentTextController.text;
Navigator.pop(context,notes);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(16.h), 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> { class _OrderDetailPage extends State<OrderDetailPage> {
ApiService apiService; ApiService apiService;
MinApiService minService; MinApiService minService;
int jumpState;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
@ -48,6 +48,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
); );
queryDetails(); queryDetails();
}); });
jumpState = widget.arguments["jumpState"];
} }
/// ///
@ -183,6 +184,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
paySelected, paySelected,
_orderCancel, _orderCancel,
orderInfo, orderInfo,
jumpState
), ),
/// ///

3
lib/order/order_history_page.dart

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

24
lib/order/order_view/order_address.dart

@ -22,6 +22,7 @@ class OrderAddress extends StatefulWidget {
final Function orderCancel; final Function orderCancel;
final Function() carryOnPay; final Function() carryOnPay;
final OrderInfo orderInfo; final OrderInfo orderInfo;
final int jumpState;
OrderAddress( OrderAddress(
this.orderStatus, this.orderStatus,
@ -33,7 +34,8 @@ class OrderAddress extends StatefulWidget {
this.center, this.center,
this.carryOnPay, this.carryOnPay,
this.orderCancel, this.orderCancel,
this.orderInfo,); this.orderInfo,
this.jumpState);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -271,14 +273,18 @@ class _OrderAddress extends State<OrderAddress> {
widget.orderInfo.storeVO.storeName, widget.orderInfo.storeVO.storeName,
); );
} else { } else {
Navigator.of(context).pushNamed( if(widget.jumpState == 1){
'/router/store_order', Navigator.of(context).pop();
arguments: { }else if(widget.jumpState == 2){
"id": widget.orderInfo.storeVO.id, Navigator.of(context).popAndPushNamed(
"tenant": widget.orderInfo.tenantCode, '/router/store_order',
"storeName": widget.orderInfo.storeVO.storeName 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', '/router/order_details',
arguments: { arguments: {
"id": orderId, "id": orderId,
"jumpState":1,
}, },
); );
// Navigator.of(context).pop(); // Navigator.of(context).pop();
@ -771,7 +772,7 @@ class _Settlement extends State<Settlement> {
payChannel, payChannel,
tableId ?? 0); tableId ?? 0);
}, queryAddress, storeInfo, address, }, queryAddress, storeInfo, address,
selectedAddress, pageType), selectedAddress, pageType,widget.arguments["distance"]),
SizedBox( SizedBox(
height: 16, height: 16,
@ -810,7 +811,7 @@ class _Settlement extends State<Settlement> {
() { () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/edit_remarks_page', '/router/edit_remarks_page',
arguments: {}, arguments: {"remake":remakers}
).then((value) => { ).then((value) => {
setState(() { setState(() {
if (value != null) remakers = value; if (value != null) remakers = value;

42
lib/settlement/settlement_view/distribution.dart

@ -26,9 +26,10 @@ class DistributionMode extends StatefulWidget {
final StoreInfo storeInfo; final StoreInfo storeInfo;
final Address address; final Address address;
final String pageType; final String pageType;
final double distance;
DistributionMode(this.queryOrderInfo, this.queryAddress, this.storeInfo, DistributionMode(this.queryOrderInfo, this.queryAddress, this.storeInfo,
this.address, this.selectedNewAddress, this.pageType); this.address, this.selectedNewAddress, this.pageType, this.distance);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -56,7 +57,7 @@ class _DistributionMode extends State<DistributionMode> {
/// ///
void startLocation() async { void startLocation() async {
Location.getInstance().startLocation(context, (BaiduLocation result){ Location.getInstance().startLocation(context, (BaiduLocation result) {
if (result != null && if (result != null &&
result.latitude != null && result.latitude != null &&
result.longitude != null) { result.longitude != null) {
@ -261,11 +262,21 @@ class _DistributionMode extends State<DistributionMode> {
Column( Column(
children: [ children: [
RoundButton( RoundButton(
// width: 41.w,
height: 13, height: 13,
text: distance.length > 3 text: distance.length > 3
? "${distance}km" ? ((widget.distance ?? 0) > 1000
: "距离您${distance}km", ? "${((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), textColor: Color(0xFF34A262),
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
radius: 7.5, radius: 7.5,
@ -310,16 +321,17 @@ class _DistributionMode extends State<DistributionMode> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
(widget.storeInfo.storeName == "一心回乡商城") ? (widget.storeInfo.storeName == "一心回乡商城")
Icon( ? Icon(
Icons.local_shipping, Icons.local_shipping,
color: Color(0xFF727272), color: Color(0xFF727272),
size: 24, size: 24,
):Image.asset( )
"assets/image/icon_permission_location.webp", : Image.asset(
height: 24.h, "assets/image/icon_permission_location.webp",
width: 24.w, height: 24.h,
), width: 24.w,
),
SizedBox(width: 5), SizedBox(width: 5),
Text( Text(
widget?.address?.username ?? "", 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)) if(!(widget.settleOrderInfo?.isRaise ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 1; checkIndex = 1;
@ -134,6 +135,7 @@ class _PayMethod extends State<PayMethod> {
), ),
if(!(widget.settleOrderInfo?.isRaise ?? false)) if(!(widget.settleOrderInfo?.isRaise ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 2; checkIndex = 2;
@ -178,6 +180,7 @@ class _PayMethod extends State<PayMethod> {
), ),
if(mGreenMoney!="0.00" && !(widget.settleOrderInfo?.isRaise ?? false)) if(mGreenMoney!="0.00" && !(widget.settleOrderInfo?.isRaise ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 3; checkIndex = 3;
@ -231,6 +234,7 @@ class _PayMethod extends State<PayMethod> {
), ),
if(mRaiseMoney!="0" && (widget.settleOrderInfo?.isRaise ?? false)) if(mRaiseMoney!="0" && (widget.settleOrderInfo?.isRaise ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 4; checkIndex = 4;
@ -284,6 +288,7 @@ class _PayMethod extends State<PayMethod> {
), ),
if(!(widget.settleOrderInfo?.isRaise ?? false)) if(!(widget.settleOrderInfo?.isRaise ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 5; checkIndex = 5;
@ -320,7 +325,7 @@ class _PayMethod extends State<PayMethod> {
Widget checkView(var index) { Widget checkView(var index) {
return Container( return Container(
padding: EdgeInsets.only(right: 16.w), padding: EdgeInsets.only(right:36.w),
alignment: Alignment.center, alignment: Alignment.center,
child: Image.asset( child: Image.asset(
checkIndex != index checkIndex != index

357
lib/store/shop_details_page.dart

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

66
lib/store/store_order.dart

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

630
lib/store/store_view/product_sku.dart

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

3
lib/union/union_list.dart

@ -87,7 +87,8 @@ class _UnionList extends State<UnionList> {
arguments: { arguments: {
"id": widget.storeList[position].id, "id": widget.storeList[position].id,
"tenant": widget.storeList[position].tenantCode, "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> { class _ActivityPoster extends State<ActivityPoster> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return WillPopScope(
onWillPop: () async => false,
child:Container(
width: double.infinity, width: double.infinity,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only( margin: EdgeInsets.only(
@ -69,7 +71,7 @@ class _ActivityPoster extends State<ActivityPoster> {
) ) ) )
], ],
), ),
); ));
} }
/// contentType 0123,4:,5: /// contentType 0123,4:,5:

Loading…
Cancel
Save