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. 23
      lib/community/community_child_page.dart
  17. 32
      lib/community/community_page.dart
  18. 1
      lib/home/home_view/shortcut_operation.dart
  19. 3
      lib/main.dart
  20. 353
      lib/mine/coupon_page.dart
  21. 4
      lib/mine/mine_view/mine_item.dart
  22. 321
      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. 470
      lib/store/shop__details_page.dart
  30. 3
      lib/store/shopping/shopping_home/group_details.dart
  31. 135
      lib/store/store_order.dart
  32. 55
      lib/store/store_view/shop_car.dart
  33. 56
      lib/store/store_view/shop_goods.dart
  34. 52
      lib/store/store_view/store_info.dart
  35. 16
      lib/store/store_view/store_order_list.dart
  36. 40
      lib/union/union_page.dart
  37. 256
      lib/view_widget/new_coupon_widget.dart
  38. 265
      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

23
lib/community/community_child_page.dart

@ -18,8 +18,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
class CommunityChildPage extends StatefulWidget {
final String typeStr;
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
State<StatefulWidget> createState() {
@ -130,7 +131,10 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe
isLoadMore = true;
setState(() {});
},
child: (articles == null || articles.length == 0)? NoDataView(
child: Stack(
alignment: Alignment.bottomRight,
children: [
(articles == null || articles.length == 0)? NoDataView(
src: "assets/image/guan_zhu.webp",
isShowBtn: false,
text: "目前暂无添加关注,可在推荐中关注自己喜欢的人哦~",
@ -168,6 +172,21 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe
},
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(),
),
),
onTap: () {
_toRelease();
},
action: GestureDetector(
behavior: HitTestBehavior.opaque,
child: Container(color: Colors.transparent,
padding: EdgeInsets.only(left: 20,right: 20),
child: SvgPicture.asset(
"assets/svg/shequ_fabu.svg",
fit: BoxFit.contain,
width: 24,
height: 24,
),)
)
// onTap: () {
// _toRelease();
// },
// action: GestureDetector(
// behavior: HitTestBehavior.opaque,
// child: Container(color: Colors.transparent,
// padding: EdgeInsets.only(left: 20,right: 20),
// child: SvgPicture.asset(
// "assets/svg/shequ_fabu.svg",
// fit: BoxFit.contain,
// width: 24,
// height: 24,
// ),)
// )
),
body: Container(
padding: EdgeInsets.only(bottom: 76.h),
@ -133,12 +133,12 @@ class _CommunityPage extends State<CommunityPage>
}
else if(e == "分享健康"){
if (tuijian == null){
tuijian = CommunityChildPage(tuijianKey,"分享健康",onChildScroll);
tuijian = CommunityChildPage(tuijianKey,"分享健康",onChildScroll,_toRelease);
}
return tuijian;
}else if(e == "关注"){
if (guanzhu == null){
guanzhu = CommunityChildPage(guanzhuKey,"关注",onChildScroll);
guanzhu = CommunityChildPage(guanzhuKey,"关注",onChildScroll,_toRelease);
}
return guanzhu;
}

1
lib/home/home_view/shortcut_operation.dart

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

3
lib/main.dart

@ -98,6 +98,7 @@ import 'home/welfare_page.dart';
import 'login/new_login_page.dart';
import 'main_page.dart';
import 'message/system_details.dart';
import 'mine/coupon_page.dart';
import 'mine/edit_signature.dart';
import 'mine/invitation_record.dart';
import 'mine/manage_address_page.dart';
@ -388,4 +389,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
MineShopPage(),
'/router/mine_shop_details': (context, {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);
return;
}
Navigator.of(context).pushNamed('/router/mine_card');
Navigator.of(context).pushNamed('/router/coupon_page');
});
},
child: mineItem(
@ -198,7 +198,7 @@ class _MineItem extends State<MineItem> {
},
child: mineItem(
"我的评价",
"assets/image/fan_kui.webp",
"assets/image/mine_evaluation.webp",
),
),),
],

321
lib/mine/recharge_page.dart

@ -120,7 +120,8 @@ class _RechargePage extends State<RechargePage> {
token: value.getString("token"),
);
}
BaseData<List<RechargeList>> baseData = await apiService.rechargeAct().catchError((onError) {});
BaseData<List<RechargeList>> baseData =
await apiService.rechargeAct().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
rechargeA = baseData.data;
@ -141,16 +142,20 @@ class _RechargePage extends State<RechargePage> {
),
body: Container(
color: Color(0xFFFFFFFF),
child: SingleChildScrollView(
child: Container(
child: Stack(
children: [
Column(children: [
Column(
children: [
SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: 16, right: 16),
child: Column(
children: [
Column(
Container(
margin: EdgeInsets.only(left: 16, right: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
@ -184,7 +189,9 @@ class _RechargePage extends State<RechargePage> {
// setState(() {});
// },
// ),
SizedBox(height:20,),
SizedBox(
height: 20,
),
Row(
children: [
Expanded(
@ -193,7 +200,8 @@ class _RechargePage extends State<RechargePage> {
style: TextStyle(
fontSize: 15.sp,
color: Color(0xFF181818),
fontWeight: MyFontWeight.semi_bold),
fontWeight:
MyFontWeight.semi_bold),
)),
Text.rich(
TextSpan(children: [
@ -202,14 +210,16 @@ class _RechargePage extends State<RechargePage> {
style: TextStyle(
fontSize: 26.sp,
color: Color(0xFF181818),
fontWeight: MyFontWeight.semi_bold),
fontWeight:
MyFontWeight.semi_bold),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 15.sp,
color: Color(0xFF181818),
fontWeight: MyFontWeight.semi_bold),
fontWeight:
MyFontWeight.semi_bold),
),
]),
),
@ -217,7 +227,6 @@ class _RechargePage extends State<RechargePage> {
),
SizedBox(height: 28),
rechargeList(),
SizedBox(height:22),
// Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -242,13 +251,11 @@ class _RechargePage extends State<RechargePage> {
// ],
// ),
],
),
)),
Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 16.h,
bottom: 4.h,
),
bottom: 22.h, left: 16, right: 16),
padding: EdgeInsets.only(
top: 20.h,
bottom: 20.h,
@ -258,7 +265,8 @@ class _RechargePage extends State<RechargePage> {
// borderRadius: BorderRadius.circular(4),
// ),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisAlignment:
MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
@ -279,10 +287,13 @@ class _RechargePage extends State<RechargePage> {
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Image.asset("assets/image/icon_we_chat.webp"),
Image.asset(
"assets/image/icon_we_chat.webp"),
Expanded(
flex: 1,
child: Padding(
@ -303,11 +314,6 @@ class _RechargePage extends State<RechargePage> {
],
),
),
],
),
),
)
],),
Align(
alignment: Alignment.bottomCenter,
child: GestureDetector(
@ -322,7 +328,8 @@ class _RechargePage extends State<RechargePage> {
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(27),
),
margin: EdgeInsets.only(left: 16,right: 16,bottom: 21),
margin: EdgeInsets.only(
left: 16, right: 16, bottom: 21),
child: Text(
S.of(context).querenchongzhi,
style: TextStyle(
@ -436,6 +443,14 @@ class _RechargePage extends State<RechargePage> {
],
),
),
)
],
),
],
),
),
),
),
);
}
@ -447,7 +462,7 @@ class _RechargePage extends State<RechargePage> {
itemCount: rechargeA == null ? 0 : rechargeA.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
@ -455,119 +470,113 @@ class _RechargePage extends State<RechargePage> {
selectIndex = position;
});
},
child: newRechargeItem(rechargeA[position],position)
);
},
);
GridView.builder(
itemCount: rechargeA == null ? 0 : rechargeA.length,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//Widget数量
crossAxisCount: 3,
//Widget之间间距
crossAxisSpacing:11,
//Widget之间间距
mainAxisSpacing: 0,
childAspectRatio: 1.5,
),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
selectIndex = index;
});
},
child: rechargeItem(rechargeA[index],index),
);
child: rechargeItem(rechargeA[position], position));
},
);
}
Widget rechargeItem(RechargeList rechargeA, index) {
return Container(
child: Stack(
alignment: Alignment.bottomRight,
children: [
Container(
alignment: Alignment.center,
width: double.infinity,
height: 69.h,
decoration: BoxDecoration(
color: selectIndex == index ?Color(0x2432A060) : Color(0xFFFAFAFA),
borderRadius: BorderRadius.circular(4),
),
// margin: EdgeInsets.only(right: 11,bottom: 16),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
border: Border.all(
color: selectIndex == index ? Color(0xFF32A060) :Color(0xFFFAFAFA),
width: selectIndex == index ? 1 :0,
),
color: selectIndex == index ? Color(0XFFF0FAF4) :Color(0xFFFAFAFA)),
margin: EdgeInsets.only(bottom: 14.w),
padding: EdgeInsets.only(left: 16),
child: Flex(
direction: Axis.horizontal,
children: [
Text(
"${AppUtils.calculateDouble(double.tryParse(rechargeA.rechargeMoney)??0)}",
textAlign: TextAlign.center,
Expanded(
flex: 1,
child: Container(
child: Text.rich(
TextSpan(children: [
TextSpan(
text: "储值 ",
style: TextStyle(
color: Color(0xFF868686),
fontWeight: MyFontWeight.medium,
fontSize:18.sp,
),
fontSize: 12.sp,
color:selectIndex == index ? Color(0xFF4D4D4D):Color(0xFF868686),
fontWeight: MyFontWeight.regular),
),
SizedBox(height:2,),
Text(
"实际到账:${AppUtils.calculateDouble((double.tryParse(rechargeA.rechargeMoney)??0) + (double.tryParse(rechargeA.giftdMoney)??0) +((double.tryParse(rechargeA.rechargeMoney)??0) - ((double.tryParse(rechargeA.rechargeMoney)??0) * (discount/100))))}",
textAlign: TextAlign.center,
TextSpan(
text:
"${AppUtils.calculateDouble(double.tryParse(rechargeA.rechargeMoney) ?? 0)}",
style: TextStyle(
color: Color(0xFF868686),
fontWeight: MyFontWeight.regular,
fontSize:10.sp,
),
),
],
),
fontSize: 18.sp,
color: selectIndex == index ? Color(0xFF353535) : Color(0xFF868686),
fontWeight: MyFontWeight.semi_bold),
),
if(selectIndex == index)
Image.asset(
"assets/image/recharge.webp",
width: 20,
height:20,
]),
),
],
));
}
Widget newRechargeItem(RechargeList rechargeA,index) {
return Container(
width:double.infinity,
height: 69.h,
decoration: BoxDecoration(
color: Color(0xFFFAFAFA),
borderRadius: BorderRadius.circular(4),
)),
Container(
width: 1.w,
height: 37.h,
color: selectIndex == index ? Color(0xFF32A060):Color(0xFF979797),
margin: EdgeInsets.only(right: 16.w, left: 12),
),
child: Row(
Expanded(
flex: 2,
child:Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
TextSpan(children: [
TextSpan(
text: "储值 ",
text: "实际到账 ",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
color: selectIndex == index ? Color(0xFF353535) : Color(0xFF868686),
fontWeight: MyFontWeight.regular),
),
TextSpan(
text: "${AppUtils.calculateDouble(double.tryParse(rechargeA.rechargeMoney)??0)}",
text:
"${AppUtils.calculateDouble((double.tryParse(rechargeA.rechargeMoney) ?? 0) + (double.tryParse(rechargeA.giftdMoney) ?? 0) + ((double.tryParse(rechargeA.rechargeMoney) ?? 0) - ((double.tryParse(rechargeA.rechargeMoney) ?? 0) * (discount / 100))))}",
style: TextStyle(
fontSize: 15.sp,
color: Color(0xFF181818),
fontSize: 18.sp,
color: selectIndex == index ? Color(0xFF353535) : Color(0xFF868686),
fontWeight: MyFontWeight.semi_bold),
),
]),
),
Container(
width: 1.w,
height: 37.h,
color: Color(0xFF979797),
SizedBox(
height: 4.h,
),
GestureDetector(
onTap: (){
setState(() {
if(selectIndex == index)
rechargeShowBottomSheet();
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"充值说明",
style: TextStyle(
color: selectIndex == index ?Color(0xFF4D4D4D) : Color(0xFF868686),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
Icon(
Icons.chevron_right,
size: 20,
color: selectIndex == index ? Color(0xFF353535) : Color(0xFF868686),
),
],
)
),
],
))
],
));
}
@ -586,6 +595,98 @@ class _RechargePage extends State<RechargePage> {
);
}
///
rechargeShowBottomSheet() {
showModalBottomSheet(
builder: (BuildContext context) {
return buildBottomSheetWidget(context);
},
backgroundColor: Colors.transparent,
context: context);
}
Widget buildBottomSheetWidget(BuildContext context) {
return Container(
padding: EdgeInsets.only(top: 12),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(25.0),
topRight: const Radius.circular(25.0))),
child: Container(
width: 299,
height:299,
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child:
Container(
margin: EdgeInsets.symmetric(vertical: 12.h),
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:13.h),
),
Padding(padding:EdgeInsets.only(left: 14),
child:
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
if (vipRuleDetails?.recharge != null &&
vipRuleDetails.recharge != "")
Expanded(
child: Container(
color: Colors.white,
child: Html(
data: "注意:${vipRuleDetails?.recharge ?? ""}",
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
),
)
],
),)
],
),
));
}
recharge() async {
// String money = controller.text;
// if (money == null || money == "") {
@ -610,8 +711,11 @@ class _RechargePage extends State<RechargePage> {
}
}
BaseData<dynamic> baseData = await apiService.recharge(
{"amount": 0,"rechargeActId":rechargeA[selectIndex].id, "rechargeType": 2}).catchError((error) {});
BaseData<dynamic> baseData = await apiService.recharge({
"amount": 0,
"rechargeActId": rechargeA[selectIndex].id,
"rechargeType": 2
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
WxPay wxPay = WxPay.fromJson(baseData.data);
await registerWxApi(
@ -632,5 +736,4 @@ class _RechargePage extends State<RechargePage> {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
// }
}

106
lib/qr/invite_friends.dart

@ -3,15 +3,22 @@ import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.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/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:flutter_screenutil/flutter_screenutil.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:shared_preferences/shared_preferences.dart';
class InviteFriends extends StatefulWidget {
@override
@ -24,11 +31,81 @@ class _InviteFriends extends State<InviteFriends> {
ApiService apiService;
final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
Article article;
List<InvitationList> invitationList = [];
UserInfo userInfo;
int pageNum = 1;
@override
void 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
@ -84,7 +161,9 @@ class _InviteFriends extends State<InviteFriends> {
},
),
onRefresh: () {
setState(() {});
setState(() {
_onRefresh();
});
},
physics: BouncingScrollPhysics(),
scrollController: scrollController,
@ -477,7 +556,7 @@ class _InviteFriends extends State<InviteFriends> {
Expanded(child:Column(
children: [
Text(
"12",
(userInfo?.todayInviteNumber ?? 0).toString(),
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 25.sp,
@ -498,7 +577,7 @@ class _InviteFriends extends State<InviteFriends> {
Expanded(child:Column(
children: [
Text(
"100",
(userInfo?.inviteNumber ?? 0).toString(),
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 25.sp,
@ -579,9 +658,16 @@ class _InviteFriends extends State<InviteFriends> {
),
],),
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,
itemCount:6,
itemCount:invitationList.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
@ -589,7 +675,7 @@ class _InviteFriends extends State<InviteFriends> {
return GestureDetector(
onTap: () {
},
child: mineInviteItem(),
child: mineInviteItem(invitationList[position]),
);
},
),
@ -598,7 +684,7 @@ class _InviteFriends extends State<InviteFriends> {
);
}
Widget mineInviteItem(){
Widget mineInviteItem(InvitationList invitationList){
return Container(
child:Column(
children: [
@ -611,7 +697,7 @@ class _InviteFriends extends State<InviteFriends> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
AppUtils.phoneEncode("15392949097"),
AppUtils.phoneEncode(invitationList?.phone ?? ""),
style: TextStyle(
color: Color(0xFF000000),
fontSize: 12.sp,
@ -620,7 +706,7 @@ class _InviteFriends extends State<InviteFriends> {
),
SizedBox(height:8),
Text(
"注册时间:2021.09.08 12:12:12",
"注册时间:${invitationList?.createTime ?? ""}",
style: TextStyle(
color: Color(0xFF000000),
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 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/";///线

2
lib/retrofit/min_api.g.dart

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

3
lib/settlement/settlement.dart

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

3
lib/store/report_assess .dart

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

470
lib/store/shop__details_page.dart

@ -1,12 +1,25 @@
import 'package:dio/dio.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: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/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/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
class ShopDetailsPage extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -21,16 +34,385 @@ class ShopDetailsPage extends StatefulWidget {
class _ShopDetailsPage extends State<ShopDetailsPage> {
ApiService apiService;
MinApiService minService;
final ScrollController scrollController = ScrollController();
final RefreshController refreshController = RefreshController();
String id;
MiNiDetail miNiDetail;
ShoppingCart shopCarGoods;
bool dialogShowing = false;
StoreInfo storeInfo;
String parentCode = "";
@override
void 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
Widget build(BuildContext context) {
return Scaffold(
@ -50,6 +432,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
),
onRefresh: () {
setState(() {
_onRefresh();
});
},
physics: BouncingScrollPhysics(),
@ -64,7 +447,8 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
buildProduct(),
Container(
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,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -78,12 +462,21 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
color: Color(0xFF000000),
),
),
SizedBox(height: 14.h,),
Image.asset(
"assets/image/icon_story_td.webp",
width: double.infinity,
fit: BoxFit.cover,
height:99.h,
SizedBox(
height: 14.h,
),
Container(
color: Colors.white,
child: Html(
data: miNiDetail?.detail ?? "",
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
),
],
),
@ -120,7 +513,8 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
children: [
swiper(),
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(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -130,17 +524,19 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"¥19.00",
miNiDetail?.price ?? "",
style: TextStyle(
fontSize: 24.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFF85400),
),
),
SizedBox(width: 2,),
Expanded(child:
Text(
"¥19.00",
SizedBox(
width: 2,
),
Expanded(
child: Text(
miNiDetail?.applyPrice ?? "",
style: TextStyle(
fontSize: 16.sp,
decoration: TextDecoration.lineThrough,
@ -170,7 +566,9 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
width: 18,
height: 18,
),
SizedBox(width: 2,),
SizedBox(
width: 2,
),
Text(
"加入购物车",
style: TextStyle(
@ -186,16 +584,20 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
],
),
Text(
"手工啵啵奶茶",
miNiDetail?.productName ?? "",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF000000),
),
),
SizedBox(height: 12.h,),
SizedBox(
height: 12.h,
),
Text(
"商品是为了出售而生产的劳动成果,是人类社会生产力发展到一定历史阶段的产物,是用于交换的劳动产品。",
miNiDetail?.shortName ?? "",
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
height: 1.5,
@ -229,14 +631,15 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
),
),
itemBuilder: (context, position) {
return Image.asset(
"assets/image/icon_story_td.webp",
return MImage(
miNiDetail?.imgs != null ? miNiDetail.imgs[position]:"",
fit: BoxFit.cover,
width: 24,
height: 24,
radius: BorderRadius.zero,
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
);
},
itemCount: 3,
itemCount: miNiDetail?.imgs?.length ?? 1,
),
GestureDetector(
onTap: () {
@ -276,16 +679,21 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
child: Image.asset(
"assets/image/icon_story_td.webp",
fit: BoxFit.fill, //
height: 70.h,
child: MImage(
miNiDetail.imgs[0],
fit: BoxFit.cover,
width: 70,
height: 70,
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
),
borderRadius: BorderRadius.circular(4),
),
SizedBox(width: 10.w,),
Expanded(child:Container(
SizedBox(
width: 10.w,
),
Expanded(
child: Container(
height: 70,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -296,7 +704,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"手工啵啵奶茶",
miNiDetail?.productName ?? "",
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.bold,
@ -312,7 +720,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
],
),
Text(
"19.00",
"${miNiDetail?.price ?? ""}",
style: TextStyle(
fontSize: 12.sp,
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_swiper/flutter_swiper.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/launch_join_act.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';

135
lib/store/store_order.dart

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

55
lib/store/store_view/shop_car.dart

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

56
lib/store/store_view/shop_goods.dart

@ -58,6 +58,7 @@ class _ShopGoods extends State<ShopGoods> {
width: 70,
height: 70,
fit: BoxFit.cover,
radius: BorderRadius.circular(4),
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
@ -68,7 +69,10 @@ class _ShopGoods extends State<ShopGoods> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
Row(
children: [
Expanded(
child: Text(
widget.productListBean != null
? widget.productListBean.productName
: widget.shoppingCartSkuItemListBean.productName,
@ -78,6 +82,23 @@ class _ShopGoods extends State<ShopGoods> {
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(
height: 2,
),
@ -110,24 +131,31 @@ class _ShopGoods extends State<ShopGoods> {
Row(
children: [
Text(
S.of(context).huiyuanjia,
"¥${widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price}",
style: TextStyle(
color: Color(0xFFFF7A1A),
fontSize: 10.sp,
fontSize: 11.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(
width: 4,
SizedBox(width: 2.w,),
Container(
width: 44.w,
height: 18.h,
decoration: BoxDecoration(
color: Color(0xFFFF4500),
borderRadius: BorderRadius.circular(2),
),
Text(
"¥${widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price}",
alignment: Alignment.center,
child: Text(
"APP专享",
style: TextStyle(
color: Color(0xFFFF7A1A),
fontSize: 11.sp,
color: Color(0xFFFFFFFF),
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
),
),
),
],
),
Spacer(),
@ -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,
),
),
],
),
),

52
lib/store/store_view/store_info.dart

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

16
lib/store/store_view/store_order_list.dart

@ -50,8 +50,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
List<FindMiNiGroupList> appletProducts;
List<ProductListBean> productListBeans = [];
ScrollController controller1 = ScrollController();
ScrollController controller2 = ScrollController();
ScrollController controller = ScrollController();
@override
void initState() {
@ -107,7 +106,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
width: 100.w,
child: ListView.builder(
itemCount: appletProducts == null ? 0 : appletProducts.length,
controller: controller1,
controller: controller,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.only(top: 0, bottom: 25),
@ -124,7 +123,16 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
shrinkWrap: true,
padding: EdgeInsets.zero,
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),
);
},
),
),

40
lib/union/union_page.dart

@ -238,7 +238,8 @@ class _UnionPage extends State<UnionPage>
titleChild: PreferredSize(
preferredSize: Size(double.infinity, 38.h),
child: TabBar(
isScrollable: true, //
isScrollable: true,
//
indicatorColor: Color(0xff39B54A),
labelColor: Colors.black,
labelStyle: TextStyle(
@ -263,7 +264,12 @@ class _UnionPage extends State<UnionPage>
),
)),
body: TabBarView(
children: [buildItem(refreshController),buildItem(refreshController1), buildItem(refreshController2),buildItem(refreshController3),],
children: [
buildItem(refreshController),
buildItem(refreshController1),
buildItem(refreshController2),
buildItem(refreshController3),
],
),
),
);
@ -378,6 +384,18 @@ class _UnionPage extends State<UnionPage>
onTap: () {
if (storeList[position].posType.code == "NORMALSTORE") {
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 {
Navigator.of(context).pushNamed(
'/router/store_order',
@ -391,8 +409,7 @@ class _UnionPage extends State<UnionPage>
},
child: buildStoreItem(storeList[position], position),
);
})
),
})),
)
],
);
@ -542,7 +559,7 @@ class _UnionPage extends State<UnionPage>
)
]),
width: double.infinity,
height: 223,
height: 228,
child: Stack(
children: [
Positioned(
@ -574,7 +591,7 @@ class _UnionPage extends State<UnionPage>
left: 12,
right: 0,
child: Container(
height:95,
height: 100,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -588,9 +605,11 @@ class _UnionPage extends State<UnionPage>
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
SizedBox(width: 6.w,),
Expanded(child:
Column(
SizedBox(
width: 6.w,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -637,8 +656,7 @@ class _UnionPage extends State<UnionPage>
((store.distance ?? 0) / 1000 * 100).toInt() /
100.0)
: S.of(context).mi(
((store.distance ?? 0) * 100).toInt() /
100.0),
((store.distance ?? 0) * 100).toInt() / 100.0),
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 10.sp,

256
lib/view_widget/new_coupon_widget.dart

@ -7,6 +7,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
class NewCouponWidget extends StatelessWidget {
final Function(int type) callback;
// final Function couponDialog;
final GestureTapCallback callbackEx;
final Coupon coupon;
final int type;
@ -28,6 +29,158 @@ class NewCouponWidget extends StatelessWidget {
// }
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,
width: double.infinity,
margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h),
@ -93,7 +246,7 @@ class NewCouponWidget extends StatelessWidget {
),
Expanded(
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),
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -218,11 +371,10 @@ class NewCouponWidget extends StatelessWidget {
Widget priceWidget(BuildContext context) {
if (coupon.bizType == 1) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Row(
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
@ -232,7 +384,7 @@ class NewCouponWidget extends StatelessWidget {
style: TextStyle(
fontSize: 22.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xff32A060),
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
SizedBox(
@ -247,12 +399,11 @@ class NewCouponWidget extends StatelessWidget {
style: TextStyle(
fontSize: 40.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060),
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
),
),
Text(
S.of(context).manyuankeyong(coupon != null
? ("${coupon.fullAmount}" ?? "0")
@ -261,26 +412,27 @@ class NewCouponWidget extends StatelessWidget {
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060),
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
);
} else if (coupon.bizType == 3) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
Container(
padding: EdgeInsets.only(bottom:10,top: 7),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
S.of(context).duihuanquan,
style: TextStyle(
fontSize: 25.sp,
fontSize: 26.sp,
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(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060),
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
);
} else if (coupon.bizType == 5) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
Container(
padding: EdgeInsets.only(bottom:10,top: 7),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
S.of(context).duihuanquan,
style: TextStyle(
fontSize: 25.sp,
fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060),
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
@ -321,18 +474,17 @@ class NewCouponWidget extends StatelessWidget {
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060),
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
);
} else {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Row(
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
@ -345,7 +497,7 @@ class NewCouponWidget extends StatelessWidget {
style: TextStyle(
fontSize: 40.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060),
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
SizedBox(
@ -356,18 +508,17 @@ class NewCouponWidget extends StatelessWidget {
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060),
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
),
),
Text(
S.of(context).quanchangtongyong,
style: TextStyle(
fontSize: 12.sp,
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);
},
child: Container(
padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h),
width: 64.w,
height: 19.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.5),
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(10),
),
alignment: Alignment.center,
child:Text(
(coupon.bizType == 5 || coupon.bizType == 3)
? S.of(context).quhexiao
: S.of(context).qushiyong,
"立即使用",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
fontWeight: MyFontWeight.regular,
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) {
@ -474,18 +644,18 @@ class NewCouponWidget extends StatelessWidget {
alignment: Alignment.centerRight,
child: Container(
padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.5),
// border: Border.all(
// width: 1, color: Color(0xFFA0A0A0), style: BorderStyle.solid)
color: Color(0xFFA0A0A0),
),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(10.5),
// // border: Border.all(
// // width: 1, color: Color(0xFFA0A0A0), style: BorderStyle.solid)
// color: Color(0xFFA0A0A0),
// ),
child: Text(
S.of(context).yishixiao,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFB3B3B3),
),
),
),

265
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:flutter_screenutil/flutter_screenutil.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/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart';
@ -24,6 +25,7 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
height: ((widget.stores != null
? (widget.stores.length > 4 ? 4 : widget.stores.length)
: 0.0) *
@ -32,77 +34,84 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
158.0.h,
padding: EdgeInsets.only(
top: 16.h,
left: 16.w,
right: 10.w,
bottom: 16.h,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.horizontal(
left: Radius.circular(8),
right: Radius.circular(8),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
alignment: Alignment.center,
child: Text(
S.of(context).qingxuanzeshiyongmendian,
textAlign: TextAlign.left,
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 15.sp,
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
),
)),
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),
),
Expanded(child:
Container(
height: (widget.stores != null
? (widget.stores.length > 4 ? 4 : widget.stores.length)
: 0) *
52.h,
60.h,
child: ListView.builder(
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return storeItem(widget.stores[position], position);
},
itemCount: widget.stores != null ? widget.stores.length : 0,
),
),
SizedBox(
height: 38.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkWell(
return GestureDetector(
onTap: (){
Navigator.of(context).pop();
setState(() {
selectIndex = position;
});
},
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,
child: storeItem(widget.stores[position], position),
);
},
itemCount: widget.stores != null ? widget.stores.length : 0,
),
InkWell(
)),
GestureDetector(
onTap: (){
if(widget.stores[selectIndex].posType.code == "NORMALSTORE") {
if (widget.stores[selectIndex].posType.code ==
"NORMALSTORE") {
Scan.toScan(
context,
widget.stores[selectIndex].id,
@ -119,23 +128,87 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
},
);
}
},
child: RoundButton(
text: S.of(context).queding,
textColor: Colors.white,
backgroup: Color(0xFF32A060),
radius: 4,
child: Container(
width: double.infinity,
height: 40.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color:Color(0xFF32A060),
),
alignment: Alignment.center,
margin: EdgeInsets.only(top: 14.h),
child: Text(
S.of(context).queding,
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 16.sp,
fontWeight: FontWeight.bold,
padding: EdgeInsets.symmetric(
vertical: 12.h,
horizontal: 42.w,
color: Color(0xFFFFFFFF),
),
),
),
],
),
// 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,
// ),
// ),
// ),
// ],
// ),
],
),
);
@ -143,45 +216,73 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
Widget storeItem(Store store, position) {
return Container(
height: 52.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
height:52 ,
margin: EdgeInsets.only(bottom: 12,left: 14,right: 14),
child: Stack(
alignment: Alignment.bottomRight,
children: [
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",
Container(
height: 52.h,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: new BorderRadius.circular(6),
border: Border.all(
color: position == selectIndex ? Color(0xFF32A060):Color(0xFFF7F7F7),
width: position == selectIndex ? 1 :0,
),
SizedBox(
width: 12.w,
color: position == selectIndex ? Color(0xFFF0FAF4) :Color(0xFFF7F7F7),
),
Expanded(
flex: 1,
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 12, bottom: 16, top: 16),
child: Text(
store.storeName,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.bold,
fontSize: 15.sp,
color: position == selectIndex ?Color(0xFF32A060) : Color(0xFF0D0D0D),
),
),
),
Checkbox(
value: position == selectIndex,
onChanged: (value) {
setState(() {
selectIndex = position;
});
},
checkColor: Color(0xFFFFFFFF),
fillColor: MaterialStateProperty.all(Color(0xFF39B54A)),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: CircleBorder(),
if (position == selectIndex)
Image.asset(
"assets/image/recharge.webp",
width: 20.w,
height: 20.h,
),
// 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