Browse Source

規格更改

zyh
w-R 3 years ago
parent
commit
57897247d4
  1. BIN
      assets/image/2x/bill_gl.webp
  2. BIN
      assets/image/2x/fa_bu.webp
  3. BIN
      assets/image/2x/mine_evaluation.webp
  4. BIN
      assets/image/2x/shop_yue.webp
  5. BIN
      assets/image/2x/shopping_bag.webp
  6. BIN
      assets/image/3x/bill_gl.webp
  7. BIN
      assets/image/3x/fa_bu.webp
  8. BIN
      assets/image/3x/mine_evaluation.webp
  9. BIN
      assets/image/3x/shop_yue.webp
  10. BIN
      assets/image/3x/shopping_bag.webp
  11. BIN
      assets/image/bill_gl.webp
  12. BIN
      assets/image/fa_bu.webp
  13. BIN
      assets/image/mine_evaluation.webp
  14. BIN
      assets/image/shop_yue.webp
  15. BIN
      assets/image/shopping_bag.webp
  16. 91
      lib/community/community_child_page.dart
  17. 32
      lib/community/community_page.dart
  18. 1
      lib/home/home_view/shortcut_operation.dart
  19. 5
      lib/main.dart
  20. 353
      lib/mine/coupon_page.dart
  21. 4
      lib/mine/mine_view/mine_item.dart
  22. 939
      lib/mine/recharge_page.dart
  23. 106
      lib/qr/invite_friends.dart
  24. 2
      lib/retrofit/min_api.dart
  25. 2
      lib/retrofit/min_api.g.dart
  26. 2
      lib/retrofit/retrofit_api.dart
  27. 3
      lib/settlement/settlement.dart
  28. 3
      lib/store/report_assess .dart
  29. 490
      lib/store/shop__details_page.dart
  30. 3
      lib/store/shopping/shopping_home/group_details.dart
  31. 149
      lib/store/store_order.dart
  32. 67
      lib/store/store_view/shop_car.dart
  33. 92
      lib/store/store_view/shop_goods.dart
  34. 54
      lib/store/store_view/store_info.dart
  35. 46
      lib/store/store_view/store_order_list.dart
  36. 114
      lib/union/union_page.dart
  37. 348
      lib/view_widget/new_coupon_widget.dart
  38. 319
      lib/view_widget/selector_store_dialog.dart

BIN
assets/image/2x/bill_gl.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 972 B

BIN
assets/image/2x/fa_bu.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
assets/image/2x/mine_evaluation.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

BIN
assets/image/2x/shop_yue.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 954 B

BIN
assets/image/2x/shopping_bag.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
assets/image/3x/bill_gl.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/3x/fa_bu.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
assets/image/3x/mine_evaluation.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/3x/shop_yue.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/image/3x/shopping_bag.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets/image/bill_gl.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 816 B

After

Width:  |  Height:  |  Size: 732 B

BIN
assets/image/fa_bu.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
assets/image/mine_evaluation.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

BIN
assets/image/shop_yue.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 908 B

After

Width:  |  Height:  |  Size: 551 B

BIN
assets/image/shopping_bag.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

91
lib/community/community_child_page.dart

@ -18,8 +18,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
class CommunityChildPage extends StatefulWidget { class CommunityChildPage extends StatefulWidget {
final String typeStr; final String typeStr;
final Function onScroll; final Function onScroll;
final Function toRelease;
CommunityChildPage(Key key, this.typeStr,this.onScroll): super(key: key); CommunityChildPage(Key key, this.typeStr,this.onScroll,this.toRelease): super(key: key);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -130,43 +131,61 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe
isLoadMore = true; isLoadMore = true;
setState(() {}); setState(() {});
}, },
child: (articles == null || articles.length == 0)? NoDataView( child: Stack(
src: "assets/image/guan_zhu.webp", alignment: Alignment.bottomRight,
isShowBtn: false, children: [
text: "目前暂无添加关注,可在推荐中关注自己喜欢的人哦~", (articles == null || articles.length == 0)? NoDataView(
fontSize: 16.sp, src: "assets/image/guan_zhu.webp",
margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w), isShowBtn: false,
):ListView.builder( text: "目前暂无添加关注,可在推荐中关注自己喜欢的人哦~",
controller: sc, fontSize: 16.sp,
itemBuilder: (context, position) { margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w),
return InkWell( ):ListView.builder(
child: CommunityDynamic( controller: sc,
articles[position], itemBuilder: (context, position) {
0, return InkWell(
userId: userId, child: CommunityDynamic(
isList: true, articles[position],
exitFull: () { 0,
setState(() { userId: userId,
onRefresh(); isList: true,
}); exitFull: () {
}, setState(() {
), onRefresh();
onTap: () { });
Navigator.of(context).pushNamed( },
'/router/community_details', ),
arguments: { onTap: () {
"businessId": articles[position].id, Navigator.of(context).pushNamed(
"userId": userId, '/router/community_details',
arguments: {
"businessId": articles[position].id,
"userId": userId,
},
).then((value) {
onRefresh();
setState(() {});
});
setState(() {});
}, },
).then((value) { );
onRefresh();
setState(() {});
});
setState(() {});
}, },
); itemCount: articles.length,
}, ),
itemCount: articles.length, GestureDetector(
onTap: (){
widget.toRelease();
},
child: Container(
margin: EdgeInsets.only(bottom:31,right: 14),
child: Image.asset(
"assets/image/fa_bu.webp",
width: 55,
height: 55,
),
),
)
],
), ),
); );
}, },

32
lib/community/community_page.dart

@ -104,20 +104,20 @@ class _CommunityPage extends State<CommunityPage>
tabs: lables.map((e) => MyTab(text: e)).toList(), tabs: lables.map((e) => MyTab(text: e)).toList(),
), ),
), ),
onTap: () { // onTap: () {
_toRelease(); // _toRelease();
}, // },
action: GestureDetector( // action: GestureDetector(
behavior: HitTestBehavior.opaque, // behavior: HitTestBehavior.opaque,
child: Container(color: Colors.transparent, // child: Container(color: Colors.transparent,
padding: EdgeInsets.only(left: 20,right: 20), // padding: EdgeInsets.only(left: 20,right: 20),
child: SvgPicture.asset( // child: SvgPicture.asset(
"assets/svg/shequ_fabu.svg", // "assets/svg/shequ_fabu.svg",
fit: BoxFit.contain, // fit: BoxFit.contain,
width: 24, // width: 24,
height: 24, // height: 24,
),) // ),)
) // )
), ),
body: Container( body: Container(
padding: EdgeInsets.only(bottom: 76.h), padding: EdgeInsets.only(bottom: 76.h),
@ -133,12 +133,12 @@ class _CommunityPage extends State<CommunityPage>
} }
else if(e == "分享健康"){ else if(e == "分享健康"){
if (tuijian == null){ if (tuijian == null){
tuijian = CommunityChildPage(tuijianKey,"分享健康",onChildScroll); tuijian = CommunityChildPage(tuijianKey,"分享健康",onChildScroll,_toRelease);
} }
return tuijian; return tuijian;
}else if(e == "关注"){ }else if(e == "关注"){
if (guanzhu == null){ if (guanzhu == null){
guanzhu = CommunityChildPage(guanzhuKey,"关注",onChildScroll); guanzhu = CommunityChildPage(guanzhuKey,"关注",onChildScroll,_toRelease);
} }
return guanzhu; return guanzhu;
} }

1
lib/home/home_view/shortcut_operation.dart

@ -152,6 +152,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
Expanded(child: GestureDetector( Expanded(child: GestureDetector(
onTap: (){ onTap: (){
Navigator.of(context).pushNamed('/router/roll_center_page'); Navigator.of(context).pushNamed('/router/roll_center_page');
// Navigator.of(context).pushNamed('/router/welfare_page');
}, },
child:Container( child:Container(
width: double.infinity, width: double.infinity,

5
lib/main.dart

@ -98,6 +98,7 @@ import 'home/welfare_page.dart';
import 'login/new_login_page.dart'; import 'login/new_login_page.dart';
import 'main_page.dart'; import 'main_page.dart';
import 'message/system_details.dart'; import 'message/system_details.dart';
import 'mine/coupon_page.dart';
import 'mine/edit_signature.dart'; import 'mine/edit_signature.dart';
import 'mine/invitation_record.dart'; import 'mine/invitation_record.dart';
import 'mine/manage_address_page.dart'; import 'mine/manage_address_page.dart';
@ -381,11 +382,13 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/report_assess': (context, {arguments}) => '/router/report_assess': (context, {arguments}) =>
ReportAssess(), ReportAssess(),
'/router/shop_details_page': (context, {arguments}) => '/router/shop_details_page': (context, {arguments}) =>
ShopDetailsPage(arguments:arguments,), ShopDetailsPage(arguments: arguments,),
'/router/mine_greenery': (context, {arguments}) => '/router/mine_greenery': (context, {arguments}) =>
MineGreenery(), MineGreenery(),
'/router/mine_shop_page': (context, {arguments}) => '/router/mine_shop_page': (context, {arguments}) =>
MineShopPage(), MineShopPage(),
'/router/mine_shop_details': (context, {arguments}) => '/router/mine_shop_details': (context, {arguments}) =>
MineShopDetails(arguments:arguments,), MineShopDetails(arguments:arguments,),
'/router/coupon_page': (context, {arguments}) =>
CouponPage(),
}; };

353
lib/mine/coupon_page.dart

@ -0,0 +1,353 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/new_coupon_widget.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:huixiang/view_widget/receive_success.dart';
import 'package:huixiang/view_widget/selector_store_dialog.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class CouponPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _CouponPage();
}
}
class _CouponPage extends State<CouponPage> {
ApiService apiService;
RefreshController _refreshController;
@override
void dispose() {
super.dispose();
_refreshController.dispose();
}
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) {
apiService =
ApiService(Dio(), context: context, token: value.getString('token'));
queryCard();
});
_refreshController = RefreshController(initialRefresh: false);
}
List<Coupon> coupons = [];
int pageNum = 1;
int state = 1;
_onRefresh() async {
pageNum = 1;
queryCard();
}
queryCard() async {
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCard({
"centre": true,
"pageNum": pageNum,
"pageSize": 10,
"searchKey": "",
"state": state
}).catchError((error) {
_refreshController.loadFailed();
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
if (pageNum == 1) {
coupons.clear();
}
coupons.addAll(baseData.data.list);
setState(() {
_refreshController.refreshCompleted();
_refreshController.loadComplete();
if (baseData.data.pageNum == baseData.data.pages) {
_refreshController.loadNoData();
} else {
pageNum += 1;
}
});
} else {
_refreshController.loadFailed();
_refreshController.refreshFailed();
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title: S.of(context).youhuiquan,
titleColor: Colors.black,
background: Color(0xFFFFFFFF),
leadingColor: Colors.black,
),
body: Column(
children: [
Container(
height: 54.h,
padding: EdgeInsets.only(left: 14.w, right: 14.w, bottom: 12.h),
margin: EdgeInsets.only(bottom: 10),
color: Color(0xFFFFFFFF),
child: Row(
children: [
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
state = 1;
_onRefresh();
});
},
child: Container(
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: new BorderRadius.only(
topLeft: Radius.circular(6),
bottomLeft: Radius.circular(6),
),
border: Border.all(
color: Color(0xFF32A060),
width: 1,
),
color: state == 1 ? Color(0xFF32A060) : Color(0xFFFFFFFF),
),
child: Text(
S.of(context).keyongquan,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 15.sp,
color: state == 1 ? Color(0xFFFFFFFF) : Color(0xFF32A060),
),
),
),
)),
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
state = 3;
_onRefresh();
});
},
child: Container(
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: new BorderRadius.only(
topRight: Radius.circular(6),
bottomRight: Radius.circular(6),
),
border: Border.all(
color: Color(0xFF32A060),
width: 1,
),
color: state == 3 ? Color(0xFF32A060) : Color(0xFFFFFFFF),
),
child: Text(
S.of(context).shixiaoquan,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 15.sp,
color: state == 3 ? Color(0xFFFFFFFF) : Color(0xFF32A060),
),
),
),
))
],
),
),
Expanded(
child: SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: true,
physics: BouncingScrollPhysics(),
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onLoading: queryCard,
child: (coupons != null && coupons.length > 0)
? ListView.builder(
itemBuilder: (context, position) {
return GestureDetector(
child: NewCouponWidget(
coupons[position],
(type) {
if (type == 1) {
receiveCoupon(coupons[position].id);
} else {
if (coupons[position].bizType == 5 ||
coupons[position].bizType == 3) {
Navigator.of(context).pushNamed(
'/router/write_off_page',
arguments: {
"couponId": coupons[position].id,
"coupon": jsonEncode(coupons[position]),
}).then((value) {
_onRefresh();
});
} else {
showStoreSelector(
coupons[position].storeList);
}
}
},
// (){
// setState(() {
// couponDialog();
// });
// },
() {
setState(() {
coupons[position].isEx =
!coupons[position].isEx;
});
},
type: 0,
),
);
},
itemCount: coupons != null ? coupons.length : 0,
)
: NoDataView(
src: "assets/image/ka.webp",
isShowBtn: false,
text: "目前暂无优惠券,请到领劵中心领取哦~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h, left: 60, right: 60),
),
),
),
],
),
);
}
receiveCoupon(couponId) async {
BaseData baseData =
await apiService.receiveCoupon(couponId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
_onRefresh();
showAlertDialog();
}
}
///使
showStoreSelector(storeList) {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return SelectorStoreWidget(storeList);
});
}
couponDialog(){
showCouponDialog();
}
showAlertDialog() {
//
showDialog(
context: context,
builder: (BuildContext context) {
return ReceiveSuccess();
},
);
}
///
showCouponDialog() {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Container(
width: MediaQuery.of(context).size.width - 14,
height: 330.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child:
Container(
alignment: Alignment.center,
child: Text(
"使用详情",
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 15.sp,
color: Color(0xFF353535),
),
),
)),
GestureDetector(
onTap: (){
setState(() {
Navigator.of(context).pop();
});
},
child: Icon(
Icons.clear,
color: Colors.black,
size: 18,
),
),
SizedBox(width: 14),
],
),
SizedBox(height: 12.h,),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF2F2F2),
margin: EdgeInsets.only(bottom:11.h),
),
Container(
color: Colors.white,
child: Html(
data: "注意",
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
),
],
),
),
);
},
);
}
}

4
lib/mine/mine_view/mine_item.dart

@ -141,7 +141,7 @@ class _MineItem extends State<MineItem> {
LoginTipsDialog().show(context); LoginTipsDialog().show(context);
return; return;
} }
Navigator.of(context).pushNamed('/router/mine_card'); Navigator.of(context).pushNamed('/router/coupon_page');
}); });
}, },
child: mineItem( child: mineItem(
@ -198,7 +198,7 @@ class _MineItem extends State<MineItem> {
}, },
child: mineItem( child: mineItem(
"我的评价", "我的评价",
"assets/image/fan_kui.webp", "assets/image/mine_evaluation.webp",
), ),
),), ),),
], ],

939
lib/mine/recharge_page.dart

File diff suppressed because it is too large Load Diff

106
lib/qr/invite_friends.dart

@ -3,15 +3,22 @@ import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/invitation_list.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
class InviteFriends extends StatefulWidget { class InviteFriends extends StatefulWidget {
@override @override
@ -24,11 +31,81 @@ class _InviteFriends extends State<InviteFriends> {
ApiService apiService; ApiService apiService;
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
Article article; List<InvitationList> invitationList = [];
UserInfo userInfo;
int pageNum = 1;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
queryInviteMember();
queryInviteMember();
}
///
queryInviteMember() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<PageInfo<InvitationList>> baseData =
await apiService.inviteMemberList({
"searchKey": "",
"pageNum": 1,
"pageSize": 100,
}).catchError((error) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
if (pageNum == 1) {
invitationList.clear();
}
invitationList.addAll(baseData.data.list);
setState(() {
refreshController.refreshCompleted();
});
} else {
refreshController.refreshFailed();
}
}
///
queryUserInfo() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<UserInfo> baseDate =
await apiService.queryInfo().catchError((onError) {
refreshController.refreshFailed();
});
if (baseDate != null && baseDate.isSuccess) {
setState(() {
userInfo = baseDate.data;
});
SharedPreferences.getInstance().then(
(value) => {
value.setString('user', jsonEncode(baseDate.data)),
},
);
refreshController.refreshCompleted();
} else {
refreshController.refreshFailed();
}
EasyLoading.dismiss();
}
_onRefresh(){
queryInviteMember();
queryInviteMember();
} }
@override @override
@ -84,7 +161,9 @@ class _InviteFriends extends State<InviteFriends> {
}, },
), ),
onRefresh: () { onRefresh: () {
setState(() {}); setState(() {
_onRefresh();
});
}, },
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
scrollController: scrollController, scrollController: scrollController,
@ -477,7 +556,7 @@ class _InviteFriends extends State<InviteFriends> {
Expanded(child:Column( Expanded(child:Column(
children: [ children: [
Text( Text(
"12", (userInfo?.todayInviteNumber ?? 0).toString(),
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 25.sp, fontSize: 25.sp,
@ -498,7 +577,7 @@ class _InviteFriends extends State<InviteFriends> {
Expanded(child:Column( Expanded(child:Column(
children: [ children: [
Text( Text(
"100", (userInfo?.inviteNumber ?? 0).toString(),
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 25.sp, fontSize: 25.sp,
@ -579,9 +658,16 @@ class _InviteFriends extends State<InviteFriends> {
), ),
],), ],),
SizedBox(height:12.h,), SizedBox(height:12.h,),
ListView.builder( (invitationList.length == null || invitationList.length == 0)
? NoDataView(
src: "assets/image/ding_dan.webp",
isShowBtn: false,
text:"还没有邀请记录哦~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
):ListView.builder(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemCount:6, itemCount:invitationList.length,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -589,7 +675,7 @@ class _InviteFriends extends State<InviteFriends> {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
}, },
child: mineInviteItem(), child: mineInviteItem(invitationList[position]),
); );
}, },
), ),
@ -598,7 +684,7 @@ class _InviteFriends extends State<InviteFriends> {
); );
} }
Widget mineInviteItem(){ Widget mineInviteItem(InvitationList invitationList){
return Container( return Container(
child:Column( child:Column(
children: [ children: [
@ -611,7 +697,7 @@ class _InviteFriends extends State<InviteFriends> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
AppUtils.phoneEncode("15392949097"), AppUtils.phoneEncode(invitationList?.phone ?? ""),
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 12.sp, fontSize: 12.sp,
@ -620,7 +706,7 @@ class _InviteFriends extends State<InviteFriends> {
), ),
SizedBox(height:8), SizedBox(height:8),
Text( Text(
"注册时间:2021.09.08 12:12:12", "注册时间:${invitationList?.createTime ?? ""}",
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 12.sp, fontSize: 12.sp,

2
lib/retrofit/min_api.dart

@ -39,7 +39,7 @@ part 'min_api.g.dart';
// const base_url = "http://192.168.10.37:8765/app/"; // const base_url = "http://192.168.10.37:8765/app/";
const localBaseUrl = "https://pos.api.lotus-wallet.com/app/";/// const localBaseUrl = "http://192.168.10.78:8765/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线

2
lib/retrofit/min_api.g.dart

@ -111,7 +111,7 @@ class _MinApiService implements MinApiService {
Future<BaseData<List<ShoppingCart>>> getShoppingCart(tableId) async { Future<BaseData<List<ShoppingCart>>> getShoppingCart(tableId) async {
ArgumentError.checkNotNull(tableId, 'tableId'); ArgumentError.checkNotNull(tableId, 'tableId');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{r'tableId': tableId}; final queryParameters = <String, dynamic>{'tableId': tableId};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('shoppingcart', final _result = await _dio.request<Map<String, dynamic>>('shoppingcart',
queryParameters: queryParameters, queryParameters: queryParameters,

2
lib/retrofit/retrofit_api.dart

@ -69,7 +69,7 @@ part 'retrofit_api.g.dart';
// const base_url = "http://192.168.10.132:8766/app/";/// // const base_url = "http://192.168.10.132:8766/app/";///
const localBaseUrl = "https://pos.platform.lotus-wallet.com/app/";/// const localBaseUrl = "http://192.168.10.78:8766/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线
@RestApi(baseUrl: localBaseUrl) @RestApi(baseUrl: localBaseUrl)

3
lib/settlement/settlement.dart

@ -177,7 +177,8 @@ class _Settlement extends State<Settlement> {
"productSkuId":productSkuId, "productSkuId":productSkuId,
"actProductId": actProductId, "actProductId": actProductId,
"actProductSkuId": actProductSkuId, "actProductSkuId": actProductSkuId,
"buyNum":buyNum "buyNum":buyNum,
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {

3
lib/store/report_assess .dart

@ -186,7 +186,6 @@ class _ReportAssess extends State<ReportAssess> {
); );
} }
/// ///
Widget goodsAssessList() { Widget goodsAssessList() {
return Container( return Container(
@ -390,6 +389,4 @@ class _ReportAssess extends State<ReportAssess> {
); );
} }
} }

490
lib/store/shop__details_page.dart

@ -1,12 +1,25 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/store_view/product_sku.dart';
import 'package:huixiang/store/store_view/shop_car.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
class ShopDetailsPage extends StatefulWidget { class ShopDetailsPage extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
@ -21,16 +34,385 @@ class ShopDetailsPage extends StatefulWidget {
class _ShopDetailsPage extends State<ShopDetailsPage> { class _ShopDetailsPage extends State<ShopDetailsPage> {
ApiService apiService; ApiService apiService;
MinApiService minService;
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
String id;
MiNiDetail miNiDetail;
ShoppingCart shopCarGoods;
bool dialogShowing = false;
StoreInfo storeInfo;
String parentCode = "";
@override @override
void initState() { void initState() {
super.initState(); super.initState();
id = widget.arguments["id"];
SharedPreferences.getInstance().then((value) {
String minToken = value.getString("minToken");
String tenant = value.getString("tenant");
String storeId = value.getString("storeId");
minService = MinApiService(Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
showLoading: true);
queryMiNiDetail(id);
});
}
///
queryMiNiDetail(id) async {
BaseData<MiNiDetail> baseData =
await minService.miNiDetail(id).catchError((error) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
setState(() {
miNiDetail = baseData.data;
});
refreshController.refreshCompleted();
} else {
refreshController.refreshFailed();
}
}
_onRefresh() {
queryMiNiDetail(id);
} }
// ///
// _queryMiNiDetail(String id, int count) async {
// EasyLoading.show(status: S.current.zhengzaijiazai);
// if(count < 0){
// shopCarGoods.shoppingCartSkuItemList.forEach((element) {
// if(element.productId == id){
// shopCartReduce(element);
// setState(() {
// });
// }
// });
// return;
// }
// BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
// if (baseData != null && baseData.isSuccess) {
// showStoreSelector(baseData.data, id, count);
// }
// }
//
// ///
// showStoreSelector(MiNiDetail miNiDetail, String id, int count) async {
// if (miNiDetail.attrList != null &&
// miNiDetail.attrList.length == 1 &&
// miNiDetail.attrList[0].attrValueList.length == 1) {
// _addShopCar(miNiDetail, [], count);
// } else {
// EasyLoading.dismiss();
// dialogShowing = true;
// SmartDialog.show(
// widget: ProductSku(
// miNiDetail,
// shopCarGoods,
// id,
// _addShopCar,
// add,
// reduce,
// ),
// onDismiss: () {
// dialogShowing = false;
// },
// alignmentTemp: Alignment.bottomCenter,
// );
// }
// }
//
// ///
// Future _addShopCar(MiNiDetail miNiDetail, selectSkus, int count) async {
// ProductSkuVOListBean productSku;
// if (selectSkus != null && selectSkus.length == 0) {
// productSku = miNiDetail.productSkuVOList.first;
// } else {
// productSku = miNiDetail.productSkuVOList.firstWhere((element) {
// bool gg = true;
// selectSkus.forEach((element1) {
// if (element.skuNameStr.indexOf(element1) < 0) {
// gg = false;
// return gg;
// }
// });
// return gg;
// });
// }
// if (productSku == null) return;
// String skuId = productSku.id;
// String skuValue = selectSkus
// .toString()
// .replaceAll("[", "")
// .replaceAll("]", "")
// .replaceAll(",", "");
//
// if (miNiDetail != null) {
// BaseData<List<ShoppingCart>> baseDate = await minService.addShoppingCart({
// "storeId": storeInfo.id,
// "storeName": storeInfo.storeName ?? "",
// "parentId": miNiDetail.id,
// "parentCode": parentCode,
// "shoppingCartSkuItemList": [
// {
// "buyNum": count,
// "id": skuId,
// "productId": miNiDetail.id,
// "productName": miNiDetail.productName,
// "skuName": skuValue,
// "storeId": storeInfo.id,
// "skuPrice": productSku.skuPrice,
// "skuStock": productSku.skuStock,
// },
// ],
// });
// EasyLoading.dismiss();
// if (baseDate != null && baseDate.isSuccess) {
// queryShopCar().then((value) {
// this.shopCarGoods = value;
// setState(() {});
// });
// }
// }
// }
//
// /// key,UI
// GlobalKey shopCartKey = GlobalKey();
//
// ///
// showShoppingCart() {
// queryShopCar().then((value) {
// this.shopCarGoods = value;
// dialogShowing = true;
// SmartDialog.show(
// widget: ShopCar(
// shopCartKey,
// this.shopCarGoods,
// clearShopCar,
// toDownOrder,
// shopCartAdd,
// shopCartReduce,
// ),
// onDismiss: () {
// dialogShowing = false;
// },
// alignmentTemp: Alignment.bottomCenter,
// );
// });
// }
//
// ///
// int count() {
// if (shopCarGoods == null ||
// shopCarGoods.shoppingCartSkuItemList == null ||
// shopCarGoods.shoppingCartSkuItemList.length == 0) return 0;
// int count = 0;
// shopCarGoods.shoppingCartSkuItemList.forEach((element) {
// count += element.buyNum;
// });
// return count;
// }
//
// ///
// toDownOrder() async {
// int num = count();
//
// if (miNiDetail.id == null || miNiDetail.id == "") {
// if (num == 0) {
// SmartDialog.showToast("请先选择您要购买的商品!~");
// return;
// }
// }
//
// await Navigator.of(context).pushNamed(
// '/router/settlement',
// arguments: {
// "storeInfo": storeInfo,
// "parentCode": parentCode,
// "parentId": miNiDetail.id,
// // "pName": pName,
// // "pid": pid,
// // "cName": cName,
// // "cid": cid,
// "shoppingCart": shopCarGoods,
// },
// );
// queryShopCar().then((value) {
// this.shopCarGoods = value;
// setState(() {});
// });
// }
//
// ///
// clearShopCar() async {
// BaseData<bool> baseData = await minService.clearShoppingCart();
// if (baseData.isSuccess) {
// shopCarGoods = null;
// setState(() {});
// }
// }
//
// ///
// Future<ShoppingCart> queryShopCar() async {
// // pName = ""; //
// // pid = ""; //
// // cName = ""; //
// // cid = ""; //
// BaseData<List<ShoppingCart>> baseDate =
// await minService.getShoppingCart(tableId);
// if (baseDate != null &&
// baseDate.isSuccess &&
// baseDate.data != null &&
// baseDate.data.length > 0) {
// if (baseDate.data[0].selectDiscount == 1) {
// baseDate.data[0].couponList.forEach((element) {
// if (element.isMaxCoupon) {
// cName = element.promotionName;
// cid = element.id;
// }
// });
// } else if (baseDate.data[0].selectDiscount == 2) {
// baseDate.data[0].promotionInfoList.forEach((element) {
// if (element.isMaxPromotion) {
// pName = element.name;
// pid = element.id;
// }
// });
// }
// return baseDate.data[0];
// } else {
// return null;
// }
// }
//
// ///1
// Future<ShoppingCart> shopCartAdd(
// ShoppingCartSkuItemListBean cartSkuItem) async {
// Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
// cartSkuItem.buyNum += 1;
// shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
// BaseData<List<ShoppingCart>> baseDate =
// await minService.shoppingCartSingle(shopCarTemp);
// if (baseDate.isSuccess) {
// this.shopCarGoods = await queryShopCar();
// if (shopCartKey != null) {
// shopCartKey.currentState.setState(() {});
// }
// setState(() {});
// }
// return this.shopCarGoods;
// }
//
// ///1
// Future<ShoppingCart> shopCartReduce(
// ShoppingCartSkuItemListBean cartSkuItem) async {
// Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
// cartSkuItem.buyNum -= 1;
// shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
// BaseData<List<ShoppingCart>> baseDate =
// await minService.shoppingCartSingle(shopCarTemp);
// if (baseDate.isSuccess) {
// EasyLoading.dismiss();
// this.shopCarGoods = await queryShopCar();
// if (shopCartKey?.currentState != null) {
// shopCartKey.currentState.setState(() {});
// }
// setState(() {
// });
// }
// return this.shopCarGoods;
// }
//
// ///1
// add(MiNiDetail miNiDetail, selectSkus) async {
// ProductSkuVOListBean productSku =
// miNiDetail.productSkuVOList.firstWhere((element) {
// return skuY(element, selectSkus);
// });
//
// if (productSku == null) return;
// String skuId = productSku.id;
// if (shopCarGoods == null) {
// await _addShopCar(miNiDetail, selectSkus, 2);
// return;
// }
// int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList
// .indexWhere((element) => skuId == element.id);
// Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
// shopCarGoods.tableId = "$tableId";
//
// if (shopSkuIndex >= 0) {
// shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum += 1;
// ShoppingCartSkuItemListBean cartSkuItem = shopCarGoods
// .shoppingCartSkuItemList
// .firstWhere((element) => skuId == element.id);
// shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
// } else {
// await _addShopCar(miNiDetail, selectSkus, 2);
// return;
// }
//
// BaseData<List<ShoppingCart>> baseDate =
// await minService.shoppingCartSingle(shopCarTemp);
// if (baseDate.isSuccess) {
// queryShopCar().then((value) {
// this.shopCarGoods = value;
// setState(() {});
// });
// }
// }
//
// ///1
// reduce(MiNiDetail miNiDetail, selectSkus) async {
// ProductSkuVOListBean productSku =
// miNiDetail.productSkuVOList.firstWhere((element) {
// return skuY(element, selectSkus);
// });
//
// if (productSku == null) return;
// String skuId = productSku.id;
// if (shopCarGoods == null) {
// await _addShopCar(miNiDetail, selectSkus, 2);
// return;
// }
// ShoppingCartSkuItemListBean shopSkuItem = shopCarGoods
// .shoppingCartSkuItemList
// .firstWhere((element) => skuId == element.id);
// int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList
// .indexWhere((element) => skuId == element.id);
//
// if (shopSkuItem != null) {
// if (shopSkuItem.buyNum > 1) {
// shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum -= 1;
// }
// } else {
// await _addShopCar(miNiDetail, selectSkus, 2);
// return;
// }
// shopCarGoods.tableId = "$tableId";
//
// Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
// ShoppingCartSkuItemListBean cartSkuItem = shopCarGoods
// .shoppingCartSkuItemList
// .firstWhere((element) => skuId == element.id);
// shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
//
// BaseData<List<ShoppingCart>> baseDate =
// await minService.shoppingCartSingle(shopCarTemp);
// if (baseDate.isSuccess) {
// queryShopCar().then((value) {
// this.shopCarGoods = value;
// setState(() {});
// });
// }
// }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -48,8 +430,9 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
return MyFooter(mode); return MyFooter(mode);
}, },
), ),
onRefresh:(){ onRefresh: () {
setState(() { setState(() {
_onRefresh();
}); });
}, },
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -64,7 +447,8 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
buildProduct(), buildProduct(),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 16.h,left: 14.w,right: 14.w,bottom: 16.h), padding: EdgeInsets.only(
top: 16.h, left: 14.w, right: 14.w, bottom: 16.h),
color: Colors.white, color: Colors.white,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -73,17 +457,26 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
Text( Text(
"商品详情", "商品详情",
style: TextStyle( style: TextStyle(
fontSize:15.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF000000), color: Color(0xFF000000),
), ),
), ),
SizedBox(height: 14.h,), SizedBox(
Image.asset( height: 14.h,
"assets/image/icon_story_td.webp", ),
width: double.infinity, Container(
fit: BoxFit.cover, color: Colors.white,
height:99.h, child: Html(
data: miNiDetail?.detail ?? "",
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
), ),
], ],
), ),
@ -120,7 +513,8 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
children: [ children: [
swiper(), swiper(),
Container( Container(
padding: EdgeInsets.only(top: 16.h,left: 14.w,right: 14.w,bottom: 16.h), padding: EdgeInsets.only(
top: 16.h, left: 14.w, right: 14.w, bottom: 16.h),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -130,26 +524,28 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
"¥19.00", miNiDetail?.price ?? "",
style: TextStyle( style: TextStyle(
fontSize:24.sp, fontSize: 24.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFF85400), color: Color(0xFFF85400),
), ),
), ),
SizedBox(width: 2,), SizedBox(
Expanded(child: width: 2,
Text( ),
"¥19.00", Expanded(
child: Text(
miNiDetail?.applyPrice ?? "",
style: TextStyle( style: TextStyle(
fontSize:16.sp, fontSize: 16.sp,
decoration: TextDecoration.lineThrough, decoration: TextDecoration.lineThrough,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFFA29E9E), color: Color(0xFFA29E9E),
), ),
)), )),
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
showDeleteDialog(); showDeleteDialog();
}, },
child: Container( child: Container(
@ -170,11 +566,13 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
width: 18, width: 18,
height: 18, height: 18,
), ),
SizedBox(width: 2,), SizedBox(
width: 2,
),
Text( Text(
"加入购物车", "加入购物车",
style: TextStyle( style: TextStyle(
fontSize:12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
), ),
@ -186,18 +584,22 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
], ],
), ),
Text( Text(
"手工啵啵奶茶", miNiDetail?.productName ?? "",
style: TextStyle( style: TextStyle(
fontSize:15.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF000000), color: Color(0xFF000000),
), ),
), ),
SizedBox(height: 12.h,), SizedBox(
height: 12.h,
),
Text( Text(
"商品是为了出售而生产的劳动成果,是人类社会生产力发展到一定历史阶段的产物,是用于交换的劳动产品。", miNiDetail?.shortName ?? "",
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize:12.sp, fontSize: 12.sp,
height: 1.5, height: 1.5,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFF4D4D4D), color: Color(0xFF4D4D4D),
@ -229,14 +631,15 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
), ),
), ),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return Image.asset( return MImage(
"assets/image/icon_story_td.webp", miNiDetail?.imgs != null ? miNiDetail.imgs[position]:"",
fit: BoxFit.cover, fit: BoxFit.cover,
width: 24, radius: BorderRadius.zero,
height: 24, errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
); );
}, },
itemCount: 3, itemCount: miNiDetail?.imgs?.length ?? 1,
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -266,7 +669,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
return AlertDialog( return AlertDialog(
content: Container( content: Container(
width: MediaQuery.of(context).size.width - 84, width: MediaQuery.of(context).size.width - 84,
height:500.h, height: 500.h,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -276,18 +679,23 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
ClipRRect( ClipRRect(
child: Image.asset( child: MImage(
"assets/image/icon_story_td.webp", miNiDetail.imgs[0],
fit: BoxFit.fill, // fit: BoxFit.cover,
height: 70.h,
width: 70, width: 70,
height: 70,
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
), ),
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
), ),
SizedBox(width: 10.w,), SizedBox(
Expanded(child:Container( width: 10.w,
),
Expanded(
child: Container(
height: 70, height: 70,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -296,7 +704,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
"手工啵啵奶茶", miNiDetail?.productName ?? "",
style: TextStyle( style: TextStyle(
fontSize: 13.sp, fontSize: 13.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -312,7 +720,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
], ],
), ),
Text( Text(
"19.00", "${miNiDetail?.price ?? ""}",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

3
lib/store/shopping/shopping_home/group_details.dart

@ -6,10 +6,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/retrofit/data/activity_actRecord_details.dart'; import 'package:huixiang/retrofit/data/activity_actRecord_details.dart';
import 'package:huixiang/retrofit/data/activity_details.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/launch_join_act.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';

149
lib/store/store_order.dart

@ -80,7 +80,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
if (tabcontroller == null) if (tabcontroller == null)
tabcontroller = TabController( tabcontroller = TabController(
length: 2, length: 1,
vsync: this, vsync: this,
); );
@ -234,7 +234,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
sliver: SliverAppBar( sliver: SliverAppBar(
expandedHeight: (storeInfo != null && expandedHeight: (storeInfo != null &&
storeInfo.couponVOList != null) storeInfo.couponVOList != null)
? 495.h ? 400.h
: 395.h, : 395.h,
floating: false, floating: false,
snap: false, snap: false,
@ -270,7 +270,10 @@ class _StoreOrderPage extends State<StoreOrderPage>
StretchMode.blurBackground, StretchMode.blurBackground,
], ],
background: Container( background: Container(
color: Colors.white, decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
),
child: Stack( child: Stack(
children: [ children: [
Positioned( Positioned(
@ -291,33 +294,52 @@ class _StoreOrderPage extends State<StoreOrderPage>
right: 0, right: 0,
), ),
Positioned( Positioned(
child: Container( child: Container( decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
/// ///
StoreInfoView(storeInfo), StoreInfoView(storeInfo),
// Padding(padding:EdgeInsets.only(left: 14.w),
/// // child: Text(
if (storeInfo != null && // S.of(context).diandan,
storeInfo.couponVOList != null) // style: TextStyle(
UnionCoupon( // fontWeight: MyFontWeight.bold,
storeInfo, // fontSize: 15.sp,
_receiveCoupon, // color: Color(0xFF000000),
coupon: true, // ),
), // ),),
// Container(
if (storeInfo == null || // width:22.w,
storeInfo.couponVOList == null) // height: 3.h,
SizedBox( // color: Color(0xFF32A060),
height: 8, // margin: EdgeInsets.only(top: 5.h,left: 14.w),
), // ),
// ///
///VIP信息 // if (storeInfo != null &&
Vip(storeInfo, () {}, false), // storeInfo.couponVOList != null)
// UnionCoupon(
// storeInfo,
// _receiveCoupon,
// coupon: true,
// ),
//
// if (storeInfo == null ||
// storeInfo.couponVOList == null)
// SizedBox(
// height: 8,
// ),
//
// ///VIP信息
// Vip(storeInfo, () {}, false),
], ],
), ),
), ),
top:105.h, top:225.h,
bottom: 0, bottom: 0,
left: 0, left: 0,
right: 0, right: 0,
@ -360,7 +382,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
labelColor: Colors.black, labelColor: Colors.black,
tabs: [ tabs: [
MyTab(text: S.of(context).diancan), MyTab(text: S.of(context).diancan),
MyTab(text: S.of(context).xindianhuodong), // MyTab(text: ""),
], ],
), ),
), ),
@ -369,7 +391,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
), ),
]; ];
}, },
body: TabBarView( body:
///
TabBarView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
children: [ children: [
/// ///
@ -385,10 +409,10 @@ class _StoreOrderPage extends State<StoreOrderPage>
), ),
///, ///,
StoreActivity( // StoreActivity(
widget.arguments, // widget.arguments,
activitys, // activitys,
), // ),
], ],
controller: tabcontroller, controller: tabcontroller,
), ),
@ -405,6 +429,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
child: child:
),*/ ),*/
), ),
if(count() != 0)
Positioned( Positioned(
bottom: 0, bottom: 0,
left: 0, left: 0,
@ -413,26 +438,36 @@ class _StoreOrderPage extends State<StoreOrderPage>
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
children: [ children: [
Container( Container(
height: 54.h, margin: EdgeInsets.symmetric(horizontal: 14),
color: Color(0xFFFAFAFA), height: 45.h,
// color: Color(0xFFFAFAFA),
decoration: BoxDecoration(
color: Color(0xFF383A38),
borderRadius: BorderRadius.circular(100),
),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Spacer(), SizedBox(width:45.w,),
Text( Text.rich(
S.of(context).heji, TextSpan(children: [
style: TextStyle( TextSpan(
fontSize: 12.sp, text: "",
fontWeight: MyFontWeight.regular, style: TextStyle(
color: Colors.black, fontSize: 12.sp,
), color: Color(0xFFFFFFFF),
), fontWeight: MyFontWeight.bold),
Text( ),
"${shopCarGoods != null ? shopCarGoods.cartSum : "0.0"}", TextSpan(
style: TextStyle( text:
fontSize: 20.sp, shopCarGoods != null ? shopCarGoods.cartSum : "0.0",
fontWeight: MyFontWeight.medium, style: TextStyle(
color: Color(0xFF32A060), fontSize: 20.sp,
), color: Color(0xFFFFFFFF),
fontWeight: MyFontWeight.semi_bold),
),
]),
), ),
Spacer(), Spacer(),
GestureDetector( GestureDetector(
@ -444,9 +479,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
height: 54.h, height: 54.h,
text: S.current.jiesuan, text: S.current.jiesuan,
textColor: Colors.white, textColor: Colors.white,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.bold,
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
radius: 0, radius: 100,
fontSize: 16.sp, fontSize: 16.sp,
padding: EdgeInsets.symmetric(vertical: 5.h), padding: EdgeInsets.symmetric(vertical: 5.h),
), ),
@ -458,25 +493,27 @@ class _StoreOrderPage extends State<StoreOrderPage>
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
if(count() != 0)
showShoppingCart(); showShoppingCart();
}, },
child: Image.asset( child: Image.asset(
"assets/image/shopp.webp", "assets/image/shopping_bag.webp",
width: 88, width: 66,
height: 88, height: 66,
fit: BoxFit.fitWidth, fit: BoxFit.fitWidth,
), ),
), ),
if(count() != 0)
Positioned( Positioned(
right: 15, right: 5,
top: 14, // top: 14,
child: RoundButton( child: RoundButton(
width: 17, width: 17,
height: 17, height: 17,
text: "${count()}", text: "${count()}",
textColor: Colors.white, textColor: Colors.white,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060), backgroup: Color(0xFFF65720),
fontSize: 12.sp, fontSize: 12.sp,
radius: 100, radius: 100,
), ),
@ -581,7 +618,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
Widget buildSwiper() { Widget buildSwiper() {
return Container( return Container(
width: double.infinity, width: double.infinity,
height: 180.h, height: 235.h,
child: Swiper( child: Swiper(
pagination: SwiperPagination( pagination: SwiperPagination(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,

67
lib/store/store_view/shop_car.dart

@ -140,39 +140,34 @@ class _ShopCar extends State<ShopCar> {
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
children: [ children: [
Container( Container(
height: 54.h, height: 45.h,
margin: EdgeInsets.symmetric(horizontal: 14),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFFAFAFA), color: Color(0xFF383A38),
boxShadow: [ borderRadius: BorderRadius.circular(100),
BoxShadow(
color: Colors.black.withAlpha(8),
offset: Offset(0, -1),
blurRadius: 3,
spreadRadius: 0,
),
],
), ),
child: Row( child: Row(
children: [ children: [
Spacer(), SizedBox(width:45.w,),
Text( Text.rich(
S.of(context).heji, TextSpan(children: [
style: TextStyle( TextSpan(
fontSize: 12.sp, text: "",
fontWeight: MyFontWeight.regular, style: TextStyle(
color: Colors.black, fontSize: 12.sp,
), color: Color(0xFFFFFFFF),
), fontWeight: MyFontWeight.bold),
Text( ),
"" + TextSpan(
(widget.shopingCar == null text:widget.shopingCar == null
? "0.0" ? "0.0"
: widget.shopingCar.cartSum), : widget.shopingCar.cartSum,
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontSize: 20.sp,
fontWeight: MyFontWeight.medium, color: Color(0xFFFFFFFF),
color: Color(0xFF32A060), fontWeight: MyFontWeight.semi_bold),
), ),
]),
), ),
Spacer(), Spacer(),
GestureDetector( GestureDetector(
@ -185,9 +180,9 @@ class _ShopCar extends State<ShopCar> {
height: 54.h, height: 54.h,
text: S.current.jiesuan, text: S.current.jiesuan,
textColor: Colors.white, textColor: Colors.white,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.bold,
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
radius: 0, radius: 100,
fontSize: 16.sp, fontSize: 16.sp,
padding: EdgeInsets.symmetric(vertical: 5.h), padding: EdgeInsets.symmetric(vertical: 5.h),
), ),
@ -203,21 +198,21 @@ class _ShopCar extends State<ShopCar> {
SmartDialog.dismiss(); SmartDialog.dismiss();
}, },
child: Image.asset( child: Image.asset(
"assets/image/shopp.webp", "assets/image/shopping_bag.webp",
width: 88, width: 66,
height: 88, height: 66,
), ),
), ),
Positioned( Positioned(
right: 15, right: 5,
top: 14, // top: 14,
child: RoundButton( child: RoundButton(
width: 17, width: 17,
height: 17, height: 17,
text: "${count()}", text: "${count()}",
textColor: Colors.white, textColor: Colors.white,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060), backgroup: Color(0xFFF65720),
fontSize: 12.sp, fontSize: 12.sp,
radius: 100, radius: 100,
// callback: () { // callback: () {

92
lib/store/store_view/shop_goods.dart

@ -43,7 +43,7 @@ class _ShopGoods extends State<ShopGoods> {
bottom: 10.h, bottom: 10.h,
top: 10.h, top: 10.h,
), ),
child: Row( child:Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -53,11 +53,12 @@ class _ShopGoods extends State<ShopGoods> {
widget.productListBean != null widget.productListBean != null
? widget.productListBean.imgPath ? widget.productListBean.imgPath
: (widget.shoppingCartSkuItemListBean != null : (widget.shoppingCartSkuItemListBean != null
? widget.shoppingCartSkuItemListBean.skuImg ? widget.shoppingCartSkuItemListBean.skuImg
: ""), : ""),
width: 70, width: 70,
height: 70, height: 70,
fit: BoxFit.cover, fit: BoxFit.cover,
radius: BorderRadius.circular(4),
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",
), ),
@ -68,15 +69,35 @@ class _ShopGoods extends State<ShopGoods> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Row(
widget.productListBean != null children: [
? widget.productListBean.productName Expanded(
: widget.shoppingCartSkuItemListBean.productName, child: Text(
style: TextStyle( widget.productListBean != null
color: Colors.black, ? widget.productListBean.productName
fontSize: 13.sp, : widget.shoppingCartSkuItemListBean.productName,
fontWeight: MyFontWeight.medium, style: TextStyle(
), color: Colors.black,
fontSize: 13.sp,
fontWeight: MyFontWeight.medium,
),
),
),
Image.asset(
"assets/image/green_leaf.webp",
fit: BoxFit.cover,
width: 12,
height: 12,
),
Text(
"X300",
style: TextStyle(
color: Color(0xFF55BC51),
fontSize: 10.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
],
), ),
SizedBox( SizedBox(
height: 2, height: 2,
@ -109,17 +130,6 @@ class _ShopGoods extends State<ShopGoods> {
children: [ children: [
Row( Row(
children: [ children: [
Text(
S.of(context).huiyuanjia,
style: TextStyle(
color: Color(0xFFFF7A1A),
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(
width: 4,
),
Text( Text(
"¥${widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price}", "¥${widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price}",
style: TextStyle( style: TextStyle(
@ -128,6 +138,24 @@ class _ShopGoods extends State<ShopGoods> {
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
), ),
), ),
SizedBox(width: 2.w,),
Container(
width: 44.w,
height: 18.h,
decoration: BoxDecoration(
color: Color(0xFFFF4500),
borderRadius: BorderRadius.circular(2),
),
alignment: Alignment.center,
child: Text(
"APP专享",
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
),
),
),
], ],
), ),
Spacer(), Spacer(),
@ -147,10 +175,10 @@ class _ShopGoods extends State<ShopGoods> {
padding: EdgeInsets.symmetric(vertical: 5.h), padding: EdgeInsets.symmetric(vertical: 5.h),
callback: () { callback: () {
widget.queryMiNiDetail( widget.queryMiNiDetail(
widget.productListBean != null widget.productListBean != null
? widget.productListBean.id ? widget.productListBean.id
: widget.shoppingCartSkuItemListBean : widget.shoppingCartSkuItemListBean
.productId,0 .productId,0
); );
}, },
), ),
@ -210,6 +238,16 @@ class _ShopGoods extends State<ShopGoods> {
), ),
], ],
), ),
SizedBox(height: 4.h,),
Text(
"¥191.00",
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 12.sp,
decoration: TextDecoration.lineThrough,
fontWeight: MyFontWeight.regular,
),
),
], ],
), ),
), ),

54
lib/store/store_view/store_info.dart

@ -25,24 +25,24 @@ class _StoreInfoView extends State<StoreInfoView> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 16.w, // left: 16.w,
right: 16.w, // right: 16.w,
top: 5.h, top: 5.h,
bottom: 6.h, bottom: 6.h,
), ),
height: 162.h, height: 154.h,
padding: EdgeInsets.all(12.w), padding: EdgeInsets.all(12.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8.w), borderRadius: BorderRadius.circular(8.w),
boxShadow: [ // boxShadow: [
BoxShadow( // BoxShadow(
color: Colors.black.withAlpha(25), // color: Colors.black.withAlpha(25),
offset: Offset(0, 3), // offset: Offset(0, 3),
blurRadius: 3, // blurRadius: 3,
spreadRadius: 0, // spreadRadius: 0,
), // ),
], // ],
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -91,11 +91,13 @@ class _StoreInfoView extends State<StoreInfoView> {
: "")), : "")),
), ),
Text( Text(
widget.storeInfo != null S.of(context).yingyeshijian(widget.storeInfo == null
? widget.storeInfo.address ? ""
: "", : (widget.storeInfo.openStartTime == null &&
maxLines: 2, widget.storeInfo.openEndTime == null)
textAlign: TextAlign.justify, ? S.of(context).quantian
: "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} "
"- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"),
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), color: Color(0xFF353535),
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -126,14 +128,12 @@ class _StoreInfoView extends State<StoreInfoView> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Expanded( Expanded(
child: Text( child:Text(
S.of(context).yingyeshijian(widget.storeInfo == null "${S.of(context).dizhi}:${widget.storeInfo != null
? "" ? widget.storeInfo.address
: (widget.storeInfo.openStartTime == null && : ""}",
widget.storeInfo.openEndTime == null) maxLines: 2,
? S.of(context).quantian textAlign: TextAlign.justify,
: "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} "
"- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"),
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), color: Color(0xFF353535),
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -176,6 +176,12 @@ class _StoreInfoView extends State<StoreInfoView> {
), ),
], ],
), ),
Container(
width: double.infinity,
height: 1,
color: Color(0xFFF4F5F2),
margin: EdgeInsets.only(top: 16),
)
], ],
), ),
); );

46
lib/store/store_view/store_order_list.dart

@ -21,7 +21,7 @@ class StoreOrderListPage extends StatefulWidget {
final ScrollController controller; final ScrollController controller;
final String minToken; final String minToken;
final String tenant; final String tenant;
final Function(String id,int count) queryMiNiDetail; final Function(String id, int count) queryMiNiDetail;
ShoppingCart shopCarGoods; ShoppingCart shopCarGoods;
@ -31,8 +31,8 @@ class StoreOrderListPage extends StatefulWidget {
this.storeInfo, this.storeInfo,
this.shopCarGoods, this.shopCarGoods,
this.controller, this.controller,
this.minToken, this.minToken,
this.tenant, this.tenant,
this.queryMiNiDetail, this.queryMiNiDetail,
); );
@ -50,8 +50,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
List<FindMiNiGroupList> appletProducts; List<FindMiNiGroupList> appletProducts;
List<ProductListBean> productListBeans = []; List<ProductListBean> productListBeans = [];
ScrollController controller1 = ScrollController(); ScrollController controller = ScrollController();
ScrollController controller2 = ScrollController();
@override @override
void initState() { void initState() {
@ -107,7 +106,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
width: 100.w, width: 100.w,
child: ListView.builder( child: ListView.builder(
itemCount: appletProducts == null ? 0 : appletProducts.length, itemCount: appletProducts == null ? 0 : appletProducts.length,
controller: controller1, controller: controller,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.only(top: 0, bottom: 25), padding: EdgeInsets.only(top: 0, bottom: 25),
@ -124,7 +123,16 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return goodsItem(position); return GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pushNamed('/router/shop_details_page',arguments: {
"id":productListBeans[position].id,
});
});
},
child: goodsItem(position),
);
}, },
), ),
), ),
@ -231,18 +239,18 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
}); });
} }
return ShopGoods( return ShopGoods(
(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) { (ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) {
widget.queryMiNiDetail(productListBeans[position].id,1); widget.queryMiNiDetail(productListBeans[position].id, 1);
}, },
(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) { (ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) {
if(count > 0) if (count > 0)
widget.queryMiNiDetail(productListBeans[position].id,-1); widget.queryMiNiDetail(productListBeans[position].id, -1);
}, },
productListBean: productListBeans[position], productListBean: productListBeans[position],
count: count, count: count,
isShopCart: false, isShopCart: false,
queryMiNiDetail: widget.queryMiNiDetail, queryMiNiDetail: widget.queryMiNiDetail,
shoppingCartSkuItemListBean: shoppingCartSkuItemListBean, shoppingCartSkuItemListBean: shoppingCartSkuItemListBean,
); );
} }
} }

114
lib/union/union_page.dart

@ -45,11 +45,11 @@ class _UnionPage extends State<UnionPage>
final RefreshController refreshController = final RefreshController refreshController =
RefreshController(initialRefresh: false); RefreshController(initialRefresh: false);
final RefreshController refreshController1 = final RefreshController refreshController1 =
RefreshController(initialRefresh: false); RefreshController(initialRefresh: false);
final RefreshController refreshController2 = final RefreshController refreshController2 =
RefreshController(initialRefresh: false); RefreshController(initialRefresh: false);
final RefreshController refreshController3 = final RefreshController refreshController3 =
RefreshController(initialRefresh: false); RefreshController(initialRefresh: false);
ApiService apiService; ApiService apiService;
bool isKeyBoardShow = false; bool isKeyBoardShow = false;
BMFCoordinate latLng; BMFCoordinate latLng;
@ -232,38 +232,44 @@ class _UnionPage extends State<UnionPage>
length: 4, length: 4,
child: Scaffold( child: Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
title:"", title: "",
leading: false, leading: false,
brightness: Brightness.light, brightness: Brightness.light,
titleChild: PreferredSize( titleChild: PreferredSize(
preferredSize: Size(double.infinity, 38.h), preferredSize: Size(double.infinity, 38.h),
child: TabBar( child: TabBar(
isScrollable: true, // isScrollable: true,
indicatorColor: Color(0xff39B54A), //
labelColor: Colors.black, indicatorColor: Color(0xff39B54A),
labelStyle: TextStyle( labelColor: Colors.black,
fontSize: 18.sp, labelStyle: TextStyle(
fontWeight: FontWeight.bold, fontSize: 18.sp,
), fontWeight: FontWeight.bold,
unselectedLabelStyle: TextStyle( ),
fontSize: 15.sp, unselectedLabelStyle: TextStyle(
fontWeight: FontWeight.normal, fontSize: 15.sp,
), fontWeight: FontWeight.normal,
// controller: tabController, ),
// // controller: tabController,
unselectedLabelColor: Color(0xffA29E9E), //
indicatorSize: TabBarIndicatorSize.label, unselectedLabelColor: Color(0xffA29E9E),
// indicatorSize: TabBarIndicatorSize.label,
tabs: <Widget>[ //
MyTab(text: S.of(context).quanbu), tabs: <Widget>[
MyTab(text:""), MyTab(text: S.of(context).quanbu),
MyTab(text:""), MyTab(text: ""),
MyTab(text:""), MyTab(text: ""),
], MyTab(text: ""),
), ],
)), ),
)),
body: TabBarView( body: TabBarView(
children: [buildItem(refreshController),buildItem(refreshController1), buildItem(refreshController2),buildItem(refreshController3),], children: [
buildItem(refreshController),
buildItem(refreshController1),
buildItem(refreshController2),
buildItem(refreshController3),
],
), ),
), ),
); );
@ -366,7 +372,7 @@ class _UnionPage extends State<UnionPage>
onRefresh: () { onRefresh: () {
startLocation(); startLocation();
}, },
child:ListView.builder( child: ListView.builder(
itemCount: storeList == null ? 0 : storeList.length, itemCount: storeList == null ? 0 : storeList.length,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 8.h, top: 8.h,
@ -378,6 +384,18 @@ class _UnionPage extends State<UnionPage>
onTap: () { onTap: () {
if (storeList[position].posType.code == "NORMALSTORE") { if (storeList[position].posType.code == "NORMALSTORE") {
showDeleteDialog(); showDeleteDialog();
} else if (storeList[position].posType.code ==
"RETAILSTORE" &&
storeList[position].storeName == "一心回乡商城") {
Navigator.of(context).pushNamed(
'/router/shopping_mall_home',
arguments: {
"type": 0,
"id": storeList[position].id,
"tenant": storeList[position].tenantCode,
"storeName": storeList[position].storeName
},
);
} else { } else {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
@ -391,8 +409,7 @@ class _UnionPage extends State<UnionPage>
}, },
child: buildStoreItem(storeList[position], position), child: buildStoreItem(storeList[position], position),
); );
}) })),
),
) )
], ],
); );
@ -542,7 +559,7 @@ class _UnionPage extends State<UnionPage>
) )
]), ]),
width: double.infinity, width: double.infinity,
height: 223, height: 228,
child: Stack( child: Stack(
children: [ children: [
Positioned( Positioned(
@ -574,7 +591,7 @@ class _UnionPage extends State<UnionPage>
left: 12, left: 12,
right: 0, right: 0,
child: Container( child: Container(
height:95, height: 100,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -588,9 +605,11 @@ class _UnionPage extends State<UnionPage>
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",
), ),
SizedBox(width: 6.w,), SizedBox(
Expanded(child: width: 6.w,
Column( ),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -625,20 +644,19 @@ class _UnionPage extends State<UnionPage>
width: 59.w, width: 59.w,
height: 18.h, height: 18.h,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(top:20.h), margin: EdgeInsets.only(top: 20.h),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.circular(2),
color: Color(0xFF32A060), color: Color(0xFF32A060),
), ),
child: Visibility( child: Visibility(
child: Text( child: Text(
(store.distance ?? 0) > 1000 (store.distance ?? 0) > 1000
? S.of(context).gongli( ? S.of(context).gongli(
((store.distance ?? 0) / 1000 * 100).toInt() / ((store.distance ?? 0) / 1000 * 100).toInt() /
100.0) 100.0)
: S.of(context).mi( : S.of(context).mi(
((store.distance ?? 0) * 100).toInt() / ((store.distance ?? 0) * 100).toInt() / 100.0),
100.0),
style: TextStyle( style: TextStyle(
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
fontSize: 10.sp, fontSize: 10.sp,

348
lib/view_widget/new_coupon_widget.dart

@ -7,11 +7,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
class NewCouponWidget extends StatelessWidget { class NewCouponWidget extends StatelessWidget {
final Function(int type) callback; final Function(int type) callback;
// final Function couponDialog;
final GestureTapCallback callbackEx; final GestureTapCallback callbackEx;
final Coupon coupon; final Coupon coupon;
final int type; final int type;
NewCouponWidget(this.coupon, this.callback, this.callbackEx, {this.type = 1}); NewCouponWidget(this.coupon, this.callback,this.callbackEx, {this.type = 1});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -28,6 +29,158 @@ class NewCouponWidget extends StatelessWidget {
// } // }
return Container( return Container(
height: (coupon != null && coupon.isEx) ? 168.h : 151.h,
width: double.infinity,
margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(6),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 6.w,
height: double.infinity,
decoration: BoxDecoration(
borderRadius: new BorderRadius.only(
topLeft: Radius.circular(6),
bottomLeft: Radius.circular(6),
),
color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF32A060),
)
),
Expanded(
flex: 2,
child:Container(
margin: EdgeInsets.only(top: 12,left: 12,bottom: 12),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"券名称:${coupon != null ? coupon.couponName ?? "" : ""}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF0D0D0D),
),
),
SizedBox(height: 6,),
Expanded(child:
(coupon.useStartTime == null &&
coupon.useEndTime == null)?
Text(
S.of(context).quantian,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D),
),
):Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"有效期: ",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D),
),
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${coupon?.useStartTime ??""} ~",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D),
),
),
Text(
"${coupon?.useEndTime ?? ""}",
maxLines:1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D),
),
)
],
)
],
),),
GestureDetector(
onTap: (){
// showDeleteDialog();
},
child: Row(
children: [
Text(
"使用详情",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF4D4D4D),
),
),
Icon(
Icons.keyboard_arrow_right,
color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D),
size: 20,
)
],
),
)
],
),
)),
Expanded(
flex: 1,
child:Container(
margin: EdgeInsets.only(top: 12,left: 12,bottom: 12),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: Container(
child: priceWidget(context),
)),
Container(
margin: EdgeInsets.only(right: 23.w),
child: rightBtn(context),
)
],
),
)),
],
),
);
Container(
height: (coupon != null && coupon.isEx) ? 168.h : 151.h, height: (coupon != null && coupon.isEx) ? 168.h : 151.h,
width: double.infinity, width: double.infinity,
margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h), margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h),
@ -93,7 +246,7 @@ class NewCouponWidget extends StatelessWidget {
), ),
Expanded( Expanded(
child: Text( child: Text(
(coupon.storeId != "0" && coupon?.storeList != null && coupon.storeList.firstWhere((x) => x.id == coupon.storeId)!=null ? (coupon.storeId != "0" && coupon?.storeList != null && coupon.storeList.isNotEmpty && coupon.storeList.firstWhere((x) => x.id == coupon.storeId)!=null ?
coupon.storeList.firstWhere((x) => x.id == coupon.storeId).storeName : coupon.tenantName), coupon.storeList.firstWhere((x) => x.id == coupon.storeId).storeName : coupon.tenantName),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
@ -218,40 +371,38 @@ class NewCouponWidget extends StatelessWidget {
Widget priceWidget(BuildContext context) { Widget priceWidget(BuildContext context) {
if (coupon.bizType == 1) { if (coupon.bizType == 1) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Row(
child: Row( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.baseline,
crossAxisAlignment: CrossAxisAlignment.baseline, textBaseline: TextBaseline.alphabetic,
textBaseline: TextBaseline.alphabetic, children: [
children: [ Text(
Text( "¥",
"¥", style: TextStyle(
style: TextStyle( fontSize: 22.sp,
fontSize: 22.sp, fontWeight: MyFontWeight.medium,
fontWeight: MyFontWeight.medium, color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
color: Color(0xff32A060),
),
),
SizedBox(
height: 4.h,
), ),
Text( ),
coupon != null SizedBox(
? double.tryParse("${coupon.discountAmount}" ?? "0") height: 4.h,
.toInt() ),
.toString() Text(
: "", coupon != null
style: TextStyle( ? double.tryParse("${coupon.discountAmount}" ?? "0")
fontSize: 40.sp, .toInt()
fontWeight: MyFontWeight.semi_bold, .toString()
color: Color(0xff32A060), : "",
), style: TextStyle(
fontSize: 40.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
], ),
), ],
), ),
Text( Text(
S.of(context).manyuankeyong(coupon != null S.of(context).manyuankeyong(coupon != null
@ -261,26 +412,27 @@ class NewCouponWidget extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
), ),
], ],
); );
} else if (coupon.bizType == 3) { } else if (coupon.bizType == 3) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Container(
padding: EdgeInsets.only(bottom:10,top: 7),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
S.of(context).duihuanquan, S.of(context).duihuanquan,
style: TextStyle( style: TextStyle(
fontSize: 25.sp, fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
), ),
], ],
@ -291,26 +443,27 @@ class NewCouponWidget extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
), ),
], ],
); );
} else if (coupon.bizType == 5) { } else if (coupon.bizType == 5) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Container(
padding: EdgeInsets.only(bottom:10,top: 7),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
S.of(context).duihuanquan, S.of(context).duihuanquan,
style: TextStyle( style: TextStyle(
fontSize: 25.sp, fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
), ),
], ],
@ -321,53 +474,51 @@ class NewCouponWidget extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
), ),
], ],
); );
} else { } else {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Row(
child: Row( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.baseline,
crossAxisAlignment: CrossAxisAlignment.baseline, textBaseline: TextBaseline.alphabetic,
textBaseline: TextBaseline.alphabetic, children: [
children: [ Text(
Text( coupon != null
coupon != null ? "${(coupon.discountPercent / 10.0 >= 10) ? 10 : coupon.discountPercent / 10.0}" ??
? "${(coupon.discountPercent / 10.0 >= 10) ? 10 : coupon.discountPercent / 10.0}" ?? "0"
"0" : "",
: "", style: TextStyle(
style: TextStyle( fontSize: 40.sp,
fontSize: 40.sp, fontWeight: MyFontWeight.semi_bold,
fontWeight: MyFontWeight.semi_bold, color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
color: Color(0xff32A060),
),
),
SizedBox(
height: 4.h,
), ),
Text( ),
"", SizedBox(
style: TextStyle( height: 4.h,
fontSize: 20.sp, ),
fontWeight: MyFontWeight.semi_bold, Text(
color: Color(0xff32A060), "",
), style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
], ),
), ],
), ),
Text( Text(
S.of(context).quanchangtongyong, S.of(context).quanchangtongyong,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
), ),
], ],
@ -430,22 +581,41 @@ class NewCouponWidget extends StatelessWidget {
callback(type); callback(type);
}, },
child: Container( child: Container(
padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h), width: 64.w,
height: 19.h,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.5),
color: Color(0xFF32A060), color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(10),
), ),
child: Text( alignment: Alignment.center,
(coupon.bizType == 5 || coupon.bizType == 3) child:Text(
? S.of(context).quhexiao "立即使用",
: S.of(context).qushiyong, maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.regular,
color: Colors.white, color: Color(0xFFFFFFFF),
), ),
), ),
), ),
// Container(
// padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(10.5),
// color: Color(0xFF32A060),
// ),
// child: Text(
// (coupon.bizType == 5 || coupon.bizType == 3)
// ? S.of(context).quhexiao
// : S.of(context).qushiyong,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.medium,
// color: Colors.white,
// ),
// ),
// ),
), ),
); );
} else if (coupon != null && coupon.status == 2) { } else if (coupon != null && coupon.status == 2) {
@ -474,18 +644,18 @@ class NewCouponWidget extends StatelessWidget {
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Container( child: Container(
padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h), padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h),
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.5), // borderRadius: BorderRadius.circular(10.5),
// border: Border.all( // // border: Border.all(
// width: 1, color: Color(0xFFA0A0A0), style: BorderStyle.solid) // // width: 1, color: Color(0xFFA0A0A0), style: BorderStyle.solid)
color: Color(0xFFA0A0A0), // color: Color(0xFFA0A0A0),
), // ),
child: Text( child: Text(
S.of(context).yishixiao, S.of(context).yishixiao,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.semi_bold,
color: Colors.white, color: Color(0xFFB3B3B3),
), ),
), ),
), ),

319
lib/view_widget/selector_store_dialog.dart

@ -3,6 +3,7 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/store.dart'; import 'package:huixiang/retrofit/data/store.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/store/scan.dart'; import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart'; import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
@ -24,6 +25,7 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: double.infinity,
height: ((widget.stores != null height: ((widget.stores != null
? (widget.stores.length > 4 ? 4 : widget.stores.length) ? (widget.stores.length > 4 ? 4 : widget.stores.length)
: 0.0) * : 0.0) *
@ -32,156 +34,255 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
158.0.h, 158.0.h,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 16.h, top: 16.h,
left: 16.w,
right: 10.w,
bottom: 16.h, bottom: 16.h,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.horizontal( borderRadius: BorderRadius.only(
left: Radius.circular(8), topLeft: Radius.circular(8),
right: Radius.circular(8), topRight: Radius.circular(8),
), ),
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Row(
S.of(context).qingxuanzeshiyongmendian, mainAxisAlignment: MainAxisAlignment.start,
textAlign: TextAlign.left, crossAxisAlignment: CrossAxisAlignment.center,
style: TextStyle( children: [
color: Color(0xFF353535), Expanded(
fontSize: 16.sp, child: Container(
fontWeight: FontWeight.bold, alignment: Alignment.center,
), child: Text(
S.of(context).qingxuanzeshiyongmendian,
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 15.sp,
color: Color(0xFF353535),
),
),
)),
GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pop();
});
},
child: Icon(
Icons.clear,
color: Colors.black,
size: 18,
),
),
SizedBox(width: 14),
],
), ),
SizedBox( SizedBox(
height: 12.h, height: 12.h,
), ),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF2F2F2),
margin: EdgeInsets.only(bottom: 11.h),
),
Expanded(child:
Container( Container(
height: (widget.stores != null height: (widget.stores != null
? (widget.stores.length > 4 ? 4 : widget.stores.length) ? (widget.stores.length > 4 ? 4 : widget.stores.length)
: 0) * : 0) *
52.h, 60.h,
child: ListView.builder( child: ListView.builder(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return storeItem(widget.stores[position], position); return GestureDetector(
onTap: (){
setState(() {
selectIndex = position;
});
},
child: storeItem(widget.stores[position], position),
);
}, },
itemCount: widget.stores != null ? widget.stores.length : 0, itemCount: widget.stores != null ? widget.stores.length : 0,
), ),
), )),
SizedBox( GestureDetector(
height: 38.h, onTap: (){
), if (widget.stores[selectIndex].posType.code ==
Row( "NORMALSTORE") {
mainAxisAlignment: MainAxisAlignment.center, Scan.toScan(
crossAxisAlignment: CrossAxisAlignment.center, context,
children: [ widget.stores[selectIndex].id,
InkWell( widget.stores[selectIndex].tenantCode,
onTap: () { widget.stores[selectIndex].storeName,
Navigator.of(context).pop(); );
}, } else {
child: BorderText( Navigator.of(context).pushNamed(
text: S.of(context).quxiao, '/router/store_order',
borderColor: Color(0xFF32A060), arguments: {
textColor: Color(0xFF32A060), "id": widget.stores[selectIndex].id,
radius: 4, "tenant": widget.stores[selectIndex].tenantCode,
fontSize: 16.sp, "storeName": widget.stores[selectIndex].storeName
fontWeight: FontWeight.bold, },
borderWidth: 1.w, );
padding: EdgeInsets.symmetric( }
vertical: 12.h, },
horizontal: 42.w, child: Container(
), width: double.infinity,
), height: 40.h,
), decoration: BoxDecoration(
SizedBox( borderRadius: BorderRadius.circular(6),
width: 13.w, color:Color(0xFF32A060),
), ),
InkWell( alignment: Alignment.center,
onTap: () { margin: EdgeInsets.only(top: 14.h),
if(widget.stores[selectIndex].posType.code == "NORMALSTORE") { child: Text(
Scan.toScan( S.of(context).queding,
context, style: TextStyle(
widget.stores[selectIndex].id, fontWeight: MyFontWeight.bold,
widget.stores[selectIndex].tenantCode,
widget.stores[selectIndex].storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": widget.stores[selectIndex].id,
"tenant": widget.stores[selectIndex].tenantCode,
"storeName": widget.stores[selectIndex].storeName
},
);
}
},
child: RoundButton(
text: S.of(context).queding,
textColor: Colors.white,
backgroup: Color(0xFF32A060),
radius: 4,
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.bold, color: Color(0xFFFFFFFF),
padding: EdgeInsets.symmetric(
vertical: 12.h,
horizontal: 42.w,
),
), ),
), ),
], ),
), ),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// InkWell(
// onTap: () {
// Navigator.of(context).pop();
// },
// child: BorderText(
// text: S.of(context).quxiao,
// borderColor: Color(0xFF32A060),
// textColor: Color(0xFF32A060),
// radius: 4,
// fontSize: 16.sp,
// fontWeight: FontWeight.bold,
// borderWidth: 1.w,
// padding: EdgeInsets.symmetric(
// vertical: 12.h,
// horizontal: 42.w,
// ),
// ),
// ),
// SizedBox(
// width: 13.w,
// ),
// InkWell(
// onTap: () {
// if (widget.stores[selectIndex].posType.code ==
// "NORMALSTORE") {
// Scan.toScan(
// context,
// widget.stores[selectIndex].id,
// widget.stores[selectIndex].tenantCode,
// widget.stores[selectIndex].storeName,
// );
// } else {
// Navigator.of(context).pushNamed(
// '/router/store_order',
// arguments: {
// "id": widget.stores[selectIndex].id,
// "tenant": widget.stores[selectIndex].tenantCode,
// "storeName": widget.stores[selectIndex].storeName
// },
// );
// }
// },
// child: RoundButton(
// text: S.of(context).queding,
// textColor: Colors.white,
// backgroup: Color(0xFF32A060),
// radius: 4,
// fontSize: 16.sp,
// fontWeight: FontWeight.bold,
// padding: EdgeInsets.symmetric(
// vertical: 12.h,
// horizontal: 42.w,
// ),
// ),
// ),
// ],
// ),
], ],
), ),
); );
} }
Widget storeItem(Store store, position) { Widget storeItem(Store store, position) {
return Container( return Container(
height: 52.h, height:52 ,
child: Row( margin: EdgeInsets.only(bottom: 12,left: 14,right: 14),
mainAxisAlignment: MainAxisAlignment.center, child: Stack(
crossAxisAlignment: CrossAxisAlignment.center, alignment: Alignment.bottomRight,
children: [ children: [
MImage( Container(
store.logo, height: 52.h,
width: 28.w, width: double.infinity,
height: 28.h, decoration: BoxDecoration(
fit: BoxFit.cover, borderRadius: new BorderRadius.circular(6),
radius: BorderRadius.circular(2), border: Border.all(
errorSrc: "assets/image/default_1.webp", color: position == selectIndex ? Color(0xFF32A060):Color(0xFFF7F7F7),
fadeSrc: "assets/image/default_1.webp", width: position == selectIndex ? 1 :0,
), ),
SizedBox( color: position == selectIndex ? Color(0xFFF0FAF4) :Color(0xFFF7F7F7),
width: 12.w, ),
), alignment: Alignment.centerLeft,
Expanded( padding: EdgeInsets.only(left: 12, bottom: 16, top: 16),
flex: 1,
child: Text( child: Text(
store.storeName, store.storeName,
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), fontWeight: MyFontWeight.bold,
fontSize: 16.sp, fontSize: 15.sp,
color: position == selectIndex ?Color(0xFF32A060) : Color(0xFF0D0D0D),
), ),
), ),
), ),
Checkbox( if (position == selectIndex)
value: position == selectIndex, Image.asset(
onChanged: (value) { "assets/image/recharge.webp",
setState(() { width: 20.w,
selectIndex = position; height: 20.h,
});
},
checkColor: Color(0xFFFFFFFF),
fillColor: MaterialStateProperty.all(Color(0xFF39B54A)),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: CircleBorder(),
), ),
// MImage(
// store.logo,
// width: 28.w,
// height: 28.h,
// fit: BoxFit.cover,
// radius: BorderRadius.circular(2),
// errorSrc: "assets/image/default_1.webp",
// fadeSrc: "assets/image/default_1.webp",
// ),
// SizedBox(
// width: 12.w,
// ),
// Expanded(
// flex: 1,
// child: Text(
// store.storeName,
// style: TextStyle(
// color: Color(0xFF353535),
// fontSize: 16.sp,
// ),
// ),
// ),
// Checkbox(
// value: position == selectIndex,
// onChanged: (value) {
// setState(() {
// selectIndex = position;
// });
// },
// checkColor: Color(0xFFFFFFFF),
// fillColor: MaterialStateProperty.all(Color(0xFF39B54A)),
// materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
// shape: CircleBorder(),
// ),
], ],
), ),
); );

Loading…
Cancel
Save