Browse Source

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

# Conflicts:
#	lib/retrofit/min_api.dart
#	lib/retrofit/retrofit_api.dart
#	lib/settlement/settlement_view/settlement_order_commodity.dart
#	lib/utils/flutter_utils.dart
new_revision_app
fmk 2 years ago
parent
commit
a88bc627b2
  1. 2
      android/app/build.gradle
  2. 33
      lib/home/home_page.dart
  3. 1
      lib/main_page.dart
  4. 324
      lib/message/system_details.dart
  5. 1
      lib/message/system_message.dart
  6. 43
      lib/mine/mine_page.dart
  7. 6
      lib/order/order_detail_page.dart
  8. 5
      lib/order/order_history_page.dart
  9. 9
      lib/retrofit/data/order_product_vo.dart
  10. 132
      lib/retrofit/data/shoppingCart.dart
  11. 2
      lib/retrofit/min_api.dart
  12. 2
      lib/retrofit/retrofit_api.dart
  13. 9
      lib/settlement/settlement.dart
  14. 2
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  15. 72
      lib/settlement/settlement_view/settlement_order_commodity.dart
  16. 3
      lib/union/location_map_page.dart
  17. 1
      lib/union/union_list.dart
  18. 62
      lib/utils/location.dart
  19. 71
      lib/view_widget/activity_poster.dart
  20. 5
      lib/view_widget/new_coupon_widget.dart
  21. 2
      lib/view_widget/new_people_reward.dart
  22. 300
      pubspec.lock
  23. 4
      pubspec.yaml

2
android/app/build.gradle

@ -184,7 +184,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.6.5' // implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.6.5'
implementation fileTree(include: ['*.aar'], dir: 'libs') implementation fileTree(include: ['*.aar'], dir: 'libs')
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'

33
lib/home/home_page.dart

@ -81,9 +81,9 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
widget.interviewCouponList != null && widget.interviewCouponList != null &&
widget.interviewCouponList.length > 0) showInvite = true; widget.interviewCouponList.length > 0) showInvite = true;
if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0) //
showNew = true; // if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0)
// showNew = true;
} }
@ -98,19 +98,8 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
); );
} }
///
newShowAlertDialog(newUserCouponList) {
//
showDialog(
context: context,
builder: (BuildContext context) {
return NewPeopleReward(newUserCouponList);
},
);
}
/// ///
posterShowAlertDialog(ActivityPos activityPos) { posterShowAlertDialog(ActivityPos activityPos,firstLoginCouponList) {
var today = DateTime.now().day; var today = DateTime.now().day;
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
if(value.getInt("today")==today && (value.getString("ActivityPosCode") ?? "").contains("${activityPos.code}_${value.getString("userId")};")) if(value.getInt("today")==today && (value.getString("ActivityPosCode") ?? "").contains("${activityPos.code}_${value.getString("userId")};"))
@ -121,7 +110,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return ActivityPoster(activityPos); return ActivityPoster(activityPos,firstLoginCouponList);
}, },
); );
}); });
@ -283,10 +272,12 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
inviteShowAlertDialog(widget.invite, widget.interviewCouponList[0]); inviteShowAlertDialog(widget.invite, widget.interviewCouponList[0]);
showInvite = false; showInvite = false;
} }
if (showNew) {
newShowAlertDialog(widget.firstLoginCouponList); //
showNew = false; // if (showNew) {
} // newShowAlertDialog(widget.firstLoginCouponList);
// showNew = false;
// }
} }
queryUserBalance() async { queryUserBalance() async {
@ -337,7 +328,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
if(baseData.data?.enabled ?? true) if(baseData.data?.enabled ?? true)
posterShowAlertDialog(baseData.data); posterShowAlertDialog(baseData.data,widget.firstLoginCouponList);
} }
} }

1
lib/main_page.dart

@ -161,6 +161,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
queryUserInfo(); queryUserInfo();
///App自动更新
appAutoUpdate(); appAutoUpdate();
} }
final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin();

324
lib/message/system_details.dart

@ -23,6 +23,7 @@ class SystemDetails extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
SystemDetails({this.arguments}); SystemDetails({this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _SystemDetails(); return _SystemDetails();
@ -34,6 +35,7 @@ class _SystemDetails extends State<SystemDetails> {
int pageNum = 1; int pageNum = 1;
List<Message> messages = []; List<Message> messages = [];
int msgType = 0; int msgType = 0;
// String parenId = "0"; // String parenId = "0";
var commentFocus = FocusNode(); var commentFocus = FocusNode();
String hintText = S.current.liuxianinjingcaidepinglunba; String hintText = S.current.liuxianinjingcaidepinglunba;
@ -43,7 +45,6 @@ class _SystemDetails extends State<SystemDetails> {
final TextEditingController commentTextController = TextEditingController(); final TextEditingController commentTextController = TextEditingController();
int indexMsg = 0; int indexMsg = 0;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -56,7 +57,6 @@ class _SystemDetails extends State<SystemDetails> {
}); });
} }
_refresh() { _refresh() {
pageNum = 1; pageNum = 1;
queryMessage(); queryMessage();
@ -93,12 +93,13 @@ class _SystemDetails extends State<SystemDetails> {
} }
//// ////
_vipFollow(followId,isFollow) async { _vipFollow(followId, isFollow) async {
BaseData baseData = await apiService.follow(followId); BaseData baseData = await apiService.follow(followId);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
// widget.refresh(); // widget.refresh();
queryMessage(); queryMessage();
SmartDialog.showToast(isFollow?"取关成功":"关注成功", alignment: Alignment.center); SmartDialog.showToast(isFollow ? "取关成功" : "关注成功",
alignment: Alignment.center);
} else { } else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
@ -117,16 +118,15 @@ class _SystemDetails extends State<SystemDetails> {
BaseData baseData = await apiService.memberComment({ BaseData baseData = await apiService.memberComment({
"content": content, "content": content,
"parentId": messageRelational["additionId"].toString(), "parentId": messageRelational["additionId"].toString(),
"relationalId":messageRelational["businessId"].toString(), "relationalId": messageRelational["businessId"].toString(),
"relationalType":4 "relationalType": 4
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
commentTextController.text = ""; commentTextController.text = "";
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
Navigator.of(context).pop(); Navigator.of(context).pop();
SmartDialog.showToast("发布成功", alignment: Alignment.center); SmartDialog.showToast("发布成功", alignment: Alignment.center);
} } else {
else{
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
} }
@ -139,11 +139,19 @@ class _SystemDetails extends State<SystemDetails> {
appBar: MyAppBar( appBar: MyAppBar(
background: Colors.white, background: Colors.white,
leadingColor: Colors.black, leadingColor: Colors.black,
title: (msgType == 2) ? S.of(context).dingdantongzhi:(msgType == 3) ? S.of(context).chongzhixiaoxi:(msgType == 4) ?"关注":(msgType == 5) ?"点赞":"评论", title: (msgType == 2)
? S.of(context).dingdantongzhi
: (msgType == 3)
? S.of(context).chongzhixiaoxi
: (msgType == 4)
? S.of(context).guanzhu
: (msgType == 5)
? S.of(context).dianzan
: S.of(context).pinglun,
titleSize: 18.sp, titleSize: 18.sp,
titleColor: Colors.black, titleColor: Colors.black,
), ),
body:SmartRefresher( body: SmartRefresher(
enablePullDown: true, enablePullDown: true,
enablePullUp: true, enablePullUp: true,
header: MyHeader(), header: MyHeader(),
@ -151,7 +159,7 @@ class _SystemDetails extends State<SystemDetails> {
footer: CustomFooter( footer: CustomFooter(
loadStyle: LoadStyle.ShowWhenLoading, loadStyle: LoadStyle.ShowWhenLoading,
builder: (BuildContext context, LoadStatus mode) { builder: (BuildContext context, LoadStatus mode) {
return (messages.length == 0)?Container():MyFooter(mode); return (messages.length == 0) ? Container() : MyFooter(mode);
}, },
), ),
controller: _refreshController, controller: _refreshController,
@ -159,24 +167,17 @@ class _SystemDetails extends State<SystemDetails> {
onLoading: () { onLoading: () {
queryMessage(); queryMessage();
}, },
child: child: Container(
Container(
child: SingleChildScrollView( child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: child: Container(
Container(
child: Column( child: Column(
children: [ children: [
if(msgType == 2) if (msgType == 2) orderMessage(),
orderMessage(), if (msgType == 3) rechargeMessage(),
if(msgType == 3) if (msgType == 5) fabulousMessage(),
rechargeMessage(), if (msgType == 6) commentMessage(),
if(msgType == 5) if (msgType == 4) followMessage(),
fabulousMessage(),
if(msgType == 6)
commentMessage(),
if(msgType == 4)
followMessage(),
], ],
), ),
), ),
@ -187,12 +188,13 @@ class _SystemDetails extends State<SystemDetails> {
} }
/// ///
Widget orderMessage(){ Widget orderMessage() {
return Container( return Container(
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top:10.h,bottom:20.h,left: 20.w,right: 20.w), padding:
child:Column( EdgeInsets.only(top: 10.h, bottom: 20.h, left: 20.w, right: 20.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -221,14 +223,13 @@ class _SystemDetails extends State<SystemDetails> {
); );
}), }),
], ],
) ));
);
} }
Widget orderMessageItem(Message message) { Widget orderMessageItem(Message message) {
return Container( return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: child: Column(
Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -248,7 +249,7 @@ class _SystemDetails extends State<SystemDetails> {
height: 24.h, height: 24.h,
), ),
SizedBox( SizedBox(
width:8.w, width: 8.w,
), ),
Text( Text(
(message.typed == 1) (message.typed == 1)
@ -275,22 +276,24 @@ class _SystemDetails extends State<SystemDetails> {
), ),
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(left:30.w, top:20.h), margin: EdgeInsets.only(left: 30.w, top: 20.h),
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded(child: Text( Expanded(
child: Text(
message.content, message.content,
maxLines: 2, maxLines: 2,
overflow:TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
),), ),
),
Icon( Icon(
Icons.keyboard_arrow_right, Icons.keyboard_arrow_right,
color: Colors.black, color: Colors.black,
@ -312,18 +315,19 @@ class _SystemDetails extends State<SystemDetails> {
} }
/// ///
Widget rechargeMessage(){ Widget rechargeMessage() {
return Container( return Container(
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top:10.h,bottom:20.h,left: 20.w,right: 20.w), padding:
child:Column( EdgeInsets.only(top: 10.h, bottom: 20.h, left: 20.w, right: 20.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(messages == null || messages.length == 0) (messages == null || messages.length == 0)
? NoDataView( ? NoDataView(
src:"assets/image/icon_empty.webp", src: "assets/image/icon_empty.webp",
isShowBtn: false, isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi, text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp, fontSize: 16.sp,
@ -346,14 +350,13 @@ class _SystemDetails extends State<SystemDetails> {
); );
}), }),
], ],
) ));
);
} }
Widget rechargeMessageItem(Message message) { Widget rechargeMessageItem(Message message) {
return Container( return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: child: Column(
Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -373,7 +376,7 @@ class _SystemDetails extends State<SystemDetails> {
height: 24.h, height: 24.h,
), ),
SizedBox( SizedBox(
width:8.w, width: 8.w,
), ),
Text( Text(
(message.typed == 1) (message.typed == 1)
@ -400,7 +403,7 @@ class _SystemDetails extends State<SystemDetails> {
), ),
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(left:30.w, top:20.h), margin: EdgeInsets.only(left: 30.w, top: 20.h),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -413,20 +416,24 @@ class _SystemDetails extends State<SystemDetails> {
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
), ),
SizedBox(height:8.h,), SizedBox(
height: 8.h,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded(child: Text( Expanded(
child: Text(
message.content, message.content,
maxLines: 2, maxLines: 2,
overflow:TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
),), ),
),
Icon( Icon(
Icons.keyboard_arrow_right, Icons.keyboard_arrow_right,
color: Colors.black, color: Colors.black,
@ -448,18 +455,18 @@ class _SystemDetails extends State<SystemDetails> {
} }
/// ///
Widget fabulousMessage(){ Widget fabulousMessage() {
return Container( return Container(
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w), padding: EdgeInsets.only(bottom: 20.h, left: 20.w, right: 20.w),
child:Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(messages == null || messages.length == 0) (messages == null || messages.length == 0)
? NoDataView( ? NoDataView(
src:"assets/image/icon_empty.webp", src: "assets/image/icon_empty.webp",
isShowBtn: false, isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi, text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp, fontSize: 16.sp,
@ -476,8 +483,11 @@ class _SystemDetails extends State<SystemDetails> {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/community_details', '/router/community_details',
arguments: { arguments: {
"businessId":jsonDecode(messages[position].relational)["businessId"].toString(), "businessId":
"mid":messages[position].mid jsonDecode(messages[position].relational)[
"businessId"]
.toString(),
"mid": messages[position].mid
}, },
); );
}, },
@ -485,14 +495,13 @@ class _SystemDetails extends State<SystemDetails> {
); );
}), }),
], ],
) ));
);
} }
Widget fabulousMessageItem(Message message) { Widget fabulousMessageItem(Message message) {
var messageRelational = jsonDecode(message.relational); var messageRelational = jsonDecode(message.relational);
return Container( return Container(
child: child: Row(
Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -505,24 +514,27 @@ class _SystemDetails extends State<SystemDetails> {
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: 8,), SizedBox(
Expanded(child:Column( width: 8,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
Text( Text(messageRelational["nickname"] ?? "",
messageRelational["nickname"] ?? "",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF1A1A1A)) color: Color(0xFF1A1A1A))),
SizedBox(
width: 8.w,
), ),
SizedBox(width:8.w,),
Text( Text(
"点赞了", "点赞了",
style:TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF32A060), color: Color(0xFF32A060),
@ -530,7 +542,9 @@ class _SystemDetails extends State<SystemDetails> {
), ),
], ],
), ),
SizedBox(height: 8,), SizedBox(
height: 8,
),
Text( Text(
message.updateTime, message.updateTime,
style: TextStyle( style: TextStyle(
@ -538,11 +552,13 @@ class _SystemDetails extends State<SystemDetails> {
color: Color(0xFFA29E9E), color: Color(0xFFA29E9E),
), ),
), ),
SizedBox(height:12.h,), SizedBox(
height: 12.h,
),
Container( Container(
width: double.infinity, width: double.infinity,
color:Color(0xFFF2F2F2), color: Color(0xFFF2F2F2),
padding:EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -557,7 +573,7 @@ class _SystemDetails extends State<SystemDetails> {
// ), // ),
// ), // ),
MImage( MImage(
messageRelational["nickname"] , messageRelational["nickname"],
width: 38, width: 38,
height: 38, height: 38,
isCircle: true, isCircle: true,
@ -566,23 +582,25 @@ class _SystemDetails extends State<SystemDetails> {
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:2.w), SizedBox(width: 2.w),
Expanded(child:Text( Expanded(
child: Text(
messageRelational["content"] ?? "", messageRelational["content"] ?? "",
maxLines: 2, maxLines: 2,
overflow:TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
height: 1.3, height: 1.3,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFF808080), color: Color(0xFF808080),
), ),
),) ),
)
], ],
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 16.h,bottom:16.h), margin: EdgeInsets.only(top: 16.h, bottom: 16.h),
height: 1.h, height: 1.h,
width: double.infinity, width: double.infinity,
color: Color(0xFFF7F7F7), color: Color(0xFFF7F7F7),
@ -595,18 +613,18 @@ class _SystemDetails extends State<SystemDetails> {
} }
/// ///
Widget commentMessage(){ Widget commentMessage() {
return Container( return Container(
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w), padding: EdgeInsets.only(bottom: 20.h, left: 20.w, right: 20.w),
child:Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(messages == null || messages.length == 0) (messages == null || messages.length == 0)
? NoDataView( ? NoDataView(
src:"assets/image/icon_empty.webp", src: "assets/image/icon_empty.webp",
isShowBtn: false, isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi, text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp, fontSize: 16.sp,
@ -623,23 +641,25 @@ class _SystemDetails extends State<SystemDetails> {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/community_details', '/router/community_details',
arguments: { arguments: {
"businessId":jsonDecode(messages[position].relational)["businessId"].toString(), "businessId":
"mid":messages[position].mid jsonDecode(messages[position].relational)[
"businessId"]
.toString(),
"mid": messages[position].mid
}, },
); );
}, },
child: commentMessageItem(messages[position],position), child: commentMessageItem(messages[position], position),
); );
}), }),
], ],
) ));
);
} }
Widget commentMessageItem(Message message,index) {
Widget commentMessageItem(Message message, index) {
var messageRelational = jsonDecode(message.relational); var messageRelational = jsonDecode(message.relational);
return Container( return Container(
child: child: Row(
Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -652,8 +672,11 @@ class _SystemDetails extends State<SystemDetails> {
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: 8,), SizedBox(
Expanded(child:Column( width: 8,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -661,23 +684,24 @@ class _SystemDetails extends State<SystemDetails> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded(child: Column( Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
Text( Text(messageRelational["nickname"],
messageRelational["nickname"],
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF1A1A1A)) color: Color(0xFF1A1A1A))),
SizedBox(
width: 8.w,
), ),
SizedBox(width:8.w,),
Text( Text(
"评论了", "评论了",
style:TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF32A060), color: Color(0xFF32A060),
@ -685,7 +709,9 @@ class _SystemDetails extends State<SystemDetails> {
), ),
], ],
), ),
SizedBox(height: 8,), SizedBox(
height: 8,
),
Text( Text(
message.updateTime, message.updateTime,
style: TextStyle( style: TextStyle(
@ -694,9 +720,10 @@ class _SystemDetails extends State<SystemDetails> {
), ),
), ),
], ],
),), ),
),
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
setState(() { setState(() {
indexMsg = index; indexMsg = index;
showDeleteDialog(); showDeleteDialog();
@ -704,9 +731,9 @@ class _SystemDetails extends State<SystemDetails> {
}); });
}, },
child: Container( child: Container(
height:22.h, height: 22.h,
width: 40.w, width: 40.w,
padding:EdgeInsets.only(left:2,right:2), padding: EdgeInsets.only(left: 2, right: 2),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11), borderRadius: BorderRadius.circular(11),
@ -728,7 +755,9 @@ class _SystemDetails extends State<SystemDetails> {
) )
], ],
), ),
SizedBox(height:8.h,), SizedBox(
height: 8.h,
),
// Text( // Text(
// messageRelational["content"], // messageRelational["content"],
// maxLines: 2, // maxLines: 2,
@ -785,8 +814,8 @@ class _SystemDetails extends State<SystemDetails> {
// ), // ),
Container( Container(
width: double.infinity, width: double.infinity,
color:Color(0xFFF2F2F2), color: Color(0xFFF2F2F2),
padding:EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -810,23 +839,25 @@ class _SystemDetails extends State<SystemDetails> {
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:2.w), SizedBox(width: 2.w),
Expanded(child:Text( Expanded(
child: Text(
messageRelational["content"], messageRelational["content"],
maxLines: 2, maxLines: 2,
overflow:TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
height: 1.3, height: 1.3,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFF808080), color: Color(0xFF808080),
), ),
),) ),
)
], ],
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 16.h,bottom:16.h), margin: EdgeInsets.only(top: 16.h, bottom: 16.h),
height: 1.h, height: 1.h,
width: double.infinity, width: double.infinity,
color: Color(0xFFF7F7F7), color: Color(0xFFF7F7F7),
@ -839,18 +870,18 @@ class _SystemDetails extends State<SystemDetails> {
} }
/// ///
Widget followMessage(){ Widget followMessage() {
return Container( return Container(
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w), padding: EdgeInsets.only(bottom: 20.h, left: 20.w, right: 20.w),
child:Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(messages == null || messages.length == 0) (messages == null || messages.length == 0)
? NoDataView( ? NoDataView(
src:"assets/image/icon_empty.webp", src: "assets/image/icon_empty.webp",
isShowBtn: false, isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi, text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp, fontSize: 16.sp,
@ -873,19 +904,17 @@ class _SystemDetails extends State<SystemDetails> {
); );
}), }),
], ],
) ));
);
} }
Widget followMessageItem(Message message) { Widget followMessageItem(Message message) {
var messageRelational = jsonDecode(message.relational); var messageRelational = jsonDecode(message.relational);
if(message.relational.startsWith("{")) if (message.relational.startsWith("{"))
return Container( return Container(
child: child: Row(
Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
MImage( MImage(
messageRelational["avatar"], messageRelational["avatar"],
width: 44, width: 44,
@ -895,8 +924,11 @@ class _SystemDetails extends State<SystemDetails> {
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: 8,), SizedBox(
Expanded(child:Column( width: 8,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -904,23 +936,24 @@ class _SystemDetails extends State<SystemDetails> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded(child: Column( Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
Text( Text(messageRelational["nickname"],
messageRelational["nickname"],
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF1A1A1A)) color: Color(0xFF1A1A1A))),
SizedBox(
width: 8.w,
), ),
SizedBox(width:8.w,),
Text( Text(
"关注了你", "关注了你",
style:TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF32A060), color: Color(0xFF32A060),
@ -928,7 +961,9 @@ class _SystemDetails extends State<SystemDetails> {
), ),
], ],
), ),
SizedBox(height: 8,), SizedBox(
height: 8,
),
Text( Text(
message.updateTime, message.updateTime,
style: TextStyle( style: TextStyle(
@ -937,17 +972,18 @@ class _SystemDetails extends State<SystemDetails> {
), ),
), ),
], ],
),), ),
),
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
setState(() { setState(() {
_vipFollow(messageRelational["mid"].toString(),message?.followed ?? false); _vipFollow(messageRelational["mid"].toString(),
message?.followed ?? false);
}); });
}, },
child: child: RoundButton(
RoundButton(
height: 21.h, height: 21.h,
width:56.w, width: 56.w,
padding: EdgeInsets.all(2), padding: EdgeInsets.all(2),
backgroup: (message?.followed ?? false) backgroup: (message?.followed ?? false)
? Color(0xFFE6E6E6) ? Color(0xFFE6E6E6)
@ -956,12 +992,12 @@ class _SystemDetails extends State<SystemDetails> {
? Color(0xFF808080) ? Color(0xFF808080)
: Colors.white, : Colors.white,
text: (message?.followed ?? false) ? "已关注" : "回关", text: (message?.followed ?? false) ? "已关注" : "回关",
radius:20, radius: 20,
icons: Icon( icons: Icon(
(message?.followed ?? false) (message?.followed ?? false)
? Icons.check ? Icons.check
: Icons.add, : Icons.add,
color: (message?.followed?? false) color: (message?.followed ?? false)
? Color(0xFF808080) ? Color(0xFF808080)
: Colors.white, : Colors.white,
size: 12, size: 12,
@ -1009,9 +1045,11 @@ class _SystemDetails extends State<SystemDetails> {
), ),
], ],
), ),
SizedBox(height:8.h,), SizedBox(
height: 8.h,
),
Container( Container(
margin: EdgeInsets.only(top: 16.h,bottom:16.h), margin: EdgeInsets.only(top: 16.h, bottom: 16.h),
height: 1.h, height: 1.h,
width: double.infinity, width: double.infinity,
color: Color(0xFFF7F7F7), color: Color(0xFFF7F7F7),
@ -1061,11 +1099,11 @@ class _SystemDetails extends State<SystemDetails> {
child: TextField( child: TextField(
maxLines: 8, maxLines: 8,
minLines: 1, minLines: 1,
focusNode:commentFocus, focusNode: commentFocus,
controller:commentTextController, controller: commentTextController,
decoration: InputDecoration( decoration: InputDecoration(
border: InputBorder.none, border: InputBorder.none,
hintText:hintText, hintText: hintText,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF868686), color: Color(0xFF868686),

1
lib/message/system_message.dart

@ -176,6 +176,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
child: SingleChildScrollView( child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( child: Container(
padding: EdgeInsets.only(bottom: 30.h),
child: Column( child: Column(
children: [ children: [
Container( Container(

43
lib/mine/mine_page.dart

@ -78,6 +78,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
super.initState(); super.initState();
querySocialInfo(); querySocialInfo();
queryMsgStats(); queryMsgStats();
queryCoupon();
// queryCard(); // queryCard();
eventBus.on<EventType>().listen((event) { eventBus.on<EventType>().listen((event) {
@ -118,22 +119,6 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
ranks.addAll(rankData.data); ranks.addAll(rankData.data);
} }
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCard({
"centre": true,
"pageNum": 1,
"pageSize": 10,
"searchKey": "",
"state": 1
}).catchError((error) {
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
couponNum = baseData.data.total;
_refreshController.refreshCompleted();
} else {
_refreshController.refreshFailed();
}
BaseData<UserInfo> baseDate = BaseData<UserInfo> baseDate =
await apiService.queryInfo().catchError((onError) { await apiService.queryInfo().catchError((onError) {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
@ -152,8 +137,34 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
// EasyLoading.dismiss(); // EasyLoading.dismiss();
} }
queryCoupon()async{
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: false,
);
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCard({
"centre": true,
"pageNum": 1,
"pageSize": 10,
"searchKey": "",
"state": 1
}).catchError((error) {
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
couponNum = baseData.data.total;
_refreshController.refreshCompleted();
} else {
_refreshController.refreshFailed();
}
}
_onRefresh() { _onRefresh() {
// queryUserInfo(); // queryUserInfo();
queryCoupon();
querySocialInfo(); querySocialInfo();
queryMsgStats(); queryMsgStats();
} }

6
lib/order/order_detail_page.dart

@ -119,6 +119,8 @@ class _OrderDetailPage extends State<OrderDetailPage> {
setState(() { setState(() {
statusTitle(); statusTitle();
}); });
}else{
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
} }
} }
@ -172,7 +174,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
), ),
/// ///
if(orderInfo != null) if(orderInfo != null && orderInfo.addressExt != null)
OrderAddress( OrderAddress(
orderStatus, orderStatus,
isTakeOut, isTakeOut,
@ -521,6 +523,8 @@ class _OrderDetailPage extends State<OrderDetailPage> {
// Future.delayed(Duration(milliseconds:450), () { // Future.delayed(Duration(milliseconds:450), () {
queryDetails(); queryDetails();
// }); // });
}else{
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
} }
} }

5
lib/order/order_history_page.dart

@ -364,7 +364,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
], ],
), ),
Container( Container(
margin: EdgeInsets.only(left: 12.w), margin: EdgeInsets.only(left: 12.w,top:3.h),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -614,6 +614,9 @@ class _OrderHistoryList extends State<OrderHistoryList>
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("订单取消成功"); SmartDialog.showToast("订单取消成功");
_onRefresh(); _onRefresh();
}else{
if(baseData.msg != null)
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
} }
} }

9
lib/retrofit/data/order_product_vo.dart

@ -1,3 +1,5 @@
import 'package:huixiang/retrofit/data/shoppingCart.dart';
class OrderProductVOList { class OrderProductVOList {
OrderProductVOList({ OrderProductVOList({
ActInfo actInfo, ActInfo actInfo,
@ -17,6 +19,7 @@ class OrderProductVOList {
String skuId, String skuId,
String skuImg, String skuImg,
String skuNameStr, String skuNameStr,
List<SetMealDataList> setMealDataList
}) { }) {
this.actInfo = actInfo; this.actInfo = actInfo;
this.additionalComment = additionalComment; this.additionalComment = additionalComment;
@ -35,6 +38,7 @@ class OrderProductVOList {
this.skuId = skuId; this.skuId = skuId;
this.skuImg = skuImg; this.skuImg = skuImg;
this.skuNameStr = skuNameStr; this.skuNameStr = skuNameStr;
this.setMealDataList = setMealDataList;
} }
OrderProductVOList.fromJson(dynamic json) { OrderProductVOList.fromJson(dynamic json) {
@ -59,6 +63,9 @@ class OrderProductVOList {
this.skuId = json['skuId']; this.skuId = json['skuId'];
this.skuImg = json['skuImg']; this.skuImg = json['skuImg'];
this.skuNameStr = json['skuNameStr']; this.skuNameStr = json['skuNameStr'];
this.setMealDataList = []..addAll(
(json['setMealDataList'] as List ?? [])
.map((o) => SetMealDataList.fromJson(o)));
} }
ActInfo actInfo; ActInfo actInfo;
@ -78,6 +85,7 @@ class OrderProductVOList {
String skuId; String skuId;
String skuImg; String skuImg;
String skuNameStr; String skuNameStr;
List<SetMealDataList> setMealDataList;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -105,6 +113,7 @@ class OrderProductVOList {
map['skuId'] = this.skuId; map['skuId'] = this.skuId;
map['skuImg'] = this.skuImg; map['skuImg'] = this.skuImg;
map['skuNameStr'] = this.skuNameStr; map['skuNameStr'] = this.skuNameStr;
map['setMealDataList']=this.setMealDataList;
return map; return map;
} }

132
lib/retrofit/data/shoppingCart.dart

@ -18,8 +18,8 @@ class ShoppingCart {
int selectDiscount; int selectDiscount;
String storeName; String storeName;
String tableId; String tableId;
List<PromotionInfoListBean> promotionInfoList; List<PromotionInfoListBeans> promotionInfoList;
List<CouponListBean> couponList; List<CouponListBeans> couponList;
static ShoppingCart fromJson(Map<String, dynamic> map) { static ShoppingCart fromJson(Map<String, dynamic> map) {
if (map == null) return null; if (map == null) return null;
@ -35,10 +35,10 @@ class ShoppingCart {
shoppingCartBean.selectDiscount = map['selectDiscount']; shoppingCartBean.selectDiscount = map['selectDiscount'];
shoppingCartBean.tableId = map['tableId']; shoppingCartBean.tableId = map['tableId'];
shoppingCartBean.promotionInfoList = List()..addAll( shoppingCartBean.promotionInfoList = List()..addAll(
(map['promotionInfoList'] as List ?? []).map((o) => PromotionInfoListBean.fromJson(o)) (map['promotionInfoList'] as List ?? []).map((o) => PromotionInfoListBeans.fromJson(o))
); );
shoppingCartBean.couponList = List()..addAll( shoppingCartBean.couponList = List()..addAll(
(map['couponList'] as List ?? []).map((o) => CouponListBean.fromJson(o)) (map['couponList'] as List ?? []).map((o) => CouponListBeans.fromJson(o))
); );
return shoppingCartBean; return shoppingCartBean;
} }
@ -308,7 +308,7 @@ class ProductInfoList {
/// isMaxPromotion : true /// isMaxPromotion : true
/// promotionProuctList : null /// promotionProuctList : null
class PromotionInfoListBean { class PromotionInfoListBeans {
String id; String id;
String createTime; String createTime;
String createUser; String createUser;
@ -339,43 +339,43 @@ class PromotionInfoListBean {
bool isMaxPromotion; bool isMaxPromotion;
dynamic promotionProuctList; dynamic promotionProuctList;
static PromotionInfoListBean fromJson(Map<String, dynamic> map) { static PromotionInfoListBeans fromJson(Map<String, dynamic> map) {
if (map == null) return null; if (map == null) return null;
PromotionInfoListBean promotionInfoListBean = PromotionInfoListBean(); PromotionInfoListBeans promotionInfoListBeans = PromotionInfoListBeans();
promotionInfoListBean.id = map['id']; promotionInfoListBeans.id = map['id'];
promotionInfoListBean.createTime = map['createTime']; promotionInfoListBeans.createTime = map['createTime'];
promotionInfoListBean.createUser = map['createUser']; promotionInfoListBeans.createUser = map['createUser'];
promotionInfoListBean.updateTime = map['updateTime']; promotionInfoListBeans.updateTime = map['updateTime'];
promotionInfoListBean.updateUser = map['updateUser']; promotionInfoListBeans.updateUser = map['updateUser'];
promotionInfoListBean.storeId = map['storeId']; promotionInfoListBeans.storeId = map['storeId'];
promotionInfoListBean.name = map['name']; promotionInfoListBeans.name = map['name'];
promotionInfoListBean.image = map['image']; promotionInfoListBeans.image = map['image'];
promotionInfoListBean.description = map['description']; promotionInfoListBeans.description = map['description'];
promotionInfoListBean.status = map['status']; promotionInfoListBeans.status = map['status'];
promotionInfoListBean.applyStartTime = map['applyStartTime']; promotionInfoListBeans.applyStartTime = map['applyStartTime'];
promotionInfoListBean.applyEndTime = map['applyEndTime']; promotionInfoListBeans.applyEndTime = map['applyEndTime'];
promotionInfoListBean.activityStartTime = map['activityStartTime']; promotionInfoListBeans.activityStartTime = map['activityStartTime'];
promotionInfoListBean.activityEndTime = map['activityEndTime']; promotionInfoListBeans.activityEndTime = map['activityEndTime'];
promotionInfoListBean.doStartTime = map['doStartTime']; promotionInfoListBeans.doStartTime = map['doStartTime'];
promotionInfoListBean.doEndTime = map['doEndTime']; promotionInfoListBeans.doEndTime = map['doEndTime'];
promotionInfoListBean.isNeedSecurityDeposit = map['isNeedSecurityDeposit']; promotionInfoListBeans.isNeedSecurityDeposit = map['isNeedSecurityDeposit'];
promotionInfoListBean.securityDeposit = map['securityDeposit']; promotionInfoListBeans.securityDeposit = map['securityDeposit'];
promotionInfoListBean.tag = map['tag']; promotionInfoListBeans.tag = map['tag'];
promotionInfoListBean.promotionType = map['promotionType']; promotionInfoListBeans.promotionType = map['promotionType'];
promotionInfoListBean.promotionPlan = map['promotionPlan']; promotionInfoListBeans.promotionPlan = map['promotionPlan'];
promotionInfoListBean.promotionDetail = List()..addAll( promotionInfoListBeans.promotionDetail = List()..addAll(
(map['promotionDetail'] as List ?? []).map((o) => PromotionDetailBean.fromJson(o)) (map['promotionDetail'] as List ?? []).map((o) => PromotionDetailBean.fromJson(o))
); );
promotionInfoListBean.channels = List()..addAll( promotionInfoListBeans.channels = List()..addAll(
(map['channels'] as List ?? []).map((o) => o.toString()) (map['channels'] as List ?? []).map((o) => o.toString())
); );
promotionInfoListBean.isVip = map['isVip']; promotionInfoListBeans.isVip = map['isVip'];
promotionInfoListBean.isDelete = map['isDelete']; promotionInfoListBeans.isDelete = map['isDelete'];
promotionInfoListBean.tenantCode = map['tenantCode']; promotionInfoListBeans.tenantCode = map['tenantCode'];
promotionInfoListBean.canPartake = map['canPartake']; promotionInfoListBeans.canPartake = map['canPartake'];
promotionInfoListBean.isMaxPromotion = map['isMaxPromotion']; promotionInfoListBeans.isMaxPromotion = map['isMaxPromotion'];
promotionInfoListBean.promotionProuctList = map['promotionProuctList']; promotionInfoListBeans.promotionProuctList = map['promotionProuctList'];
return promotionInfoListBean; return promotionInfoListBeans;
} }
Map toJson() => { Map toJson() => {
@ -437,7 +437,7 @@ class PromotionInfoListBean {
/// isMaxCoupon:true /// isMaxCoupon:true
/// productList : null /// productList : null
class CouponListBean { class CouponListBeans {
String id; String id;
String storeId; String storeId;
int bizType; int bizType;
@ -466,35 +466,35 @@ class CouponListBean {
bool isEx; bool isEx;
static CouponListBean fromJson(Map<String, dynamic> map) { static CouponListBeans fromJson(Map<String, dynamic> map) {
if (map == null) return null; if (map == null) return null;
CouponListBean couponListBean = CouponListBean(); CouponListBeans couponListBeans = CouponListBeans();
couponListBean.id = map['id']; couponListBeans.id = map['id'];
couponListBean.storeId = map['storeId']; couponListBeans.storeId = map['storeId'];
couponListBean.bizType = map['bizType']; couponListBeans.bizType = map['bizType'];
couponListBean.fullAmount = map['fullAmount']; couponListBeans.fullAmount = map['fullAmount'];
couponListBean.discountAmount = map['discountAmount']; couponListBeans.discountAmount = map['discountAmount'];
couponListBean.fullNumber = map['fullNumber']; couponListBeans.fullNumber = map['fullNumber'];
couponListBean.discountPercent = map['discountPercent']; couponListBeans.discountPercent = map['discountPercent'];
couponListBean.bizId = map['bizId']; couponListBeans.bizId = map['bizId'];
couponListBean.publishStartTime = map['publishStartTime']; couponListBeans.publishStartTime = map['publishStartTime'];
couponListBean.publishEndTime = map['publishEndTime']; couponListBeans.publishEndTime = map['publishEndTime'];
couponListBean.useStartTime = map['useStartTime']; couponListBeans.useStartTime = map['useStartTime'];
couponListBean.useEndTime = map['useEndTime']; couponListBeans.useEndTime = map['useEndTime'];
couponListBean.promotionId = map['promotionId']; couponListBeans.promotionId = map['promotionId'];
couponListBean.mid = map['mid']; couponListBeans.mid = map['mid'];
couponListBean.couponId = map['couponId']; couponListBeans.couponId = map['couponId'];
couponListBean.receiveTime = map['receiveTime']; couponListBeans.receiveTime = map['receiveTime'];
couponListBean.useTime = map['useTime']; couponListBeans.useTime = map['useTime'];
couponListBean.status = map['status']; couponListBeans.status = map['status'];
couponListBean.tenantCode = map['tenantCode']; couponListBeans.tenantCode = map['tenantCode'];
couponListBean.type = map['type']; couponListBeans.type = map['type'];
couponListBean.promotionName = map['promotionName']; couponListBeans.promotionName = map['promotionName'];
couponListBean.usable = map['usable']; couponListBeans.usable = map['usable'];
couponListBean.allProduct = map['allProduct']; couponListBeans.allProduct = map['allProduct'];
couponListBean.isMaxCoupon = map['isMaxCoupon']; couponListBeans.isMaxCoupon = map['isMaxCoupon'];
couponListBean.productList = map['productList']; couponListBeans.productList = map['productList'];
return couponListBean; return couponListBeans;
} }
Map toJson() => { Map toJson() => {

2
lib/retrofit/min_api.dart

@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
const localBaseUrl = "https://pos.api.lotus-wallet.com/app/";/// const localBaseUrl = "http://192.168.10.78:8765/app/";///
// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";/// // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线

2
lib/retrofit/retrofit_api.dart

@ -64,7 +64,7 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const localBaseUrl = "https://pos.platform.lotus-wallet.com/app/";/// const localBaseUrl = "http://192.168.10.78:8766/app/";///
// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";/// // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线

9
lib/settlement/settlement.dart

@ -33,11 +33,10 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/min.dart'; import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:huixiang/view_widget/tips_dialog.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/shoppingCart.dart';
import '../view_widget/settlement_tips_dialog.dart'; import '../view_widget/settlement_tips_dialog.dart';
class Settlement extends StatefulWidget { class Settlement extends StatefulWidget {
@ -85,6 +84,7 @@ class _Settlement extends State<Settlement> {
bool useVipPriceSelect = true; bool useVipPriceSelect = true;
bool showVipTips = false; bool showVipTips = false;
bool isRaiseChannel = false; bool isRaiseChannel = false;
ShoppingCart shopCarGoods;
@override @override
void initState() { void initState() {
@ -107,6 +107,8 @@ class _Settlement extends State<Settlement> {
productSkuId = widget.arguments["productSkuId"]; productSkuId = widget.arguments["productSkuId"];
count1 = widget.arguments["buyNum"]; count1 = widget.arguments["buyNum"];
productId = widget.arguments["productId"]; productId = widget.arguments["productId"];
shopCarGoods = widget.arguments["shoppingCart"];
if (tableId == 0) { if (tableId == 0) {
placeOrder = true; placeOrder = true;
} }
@ -516,6 +518,9 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.storeId = storeInfo.id; placeOrderFirst.storeId = storeInfo.id;
placeOrderFirst.subcribeTime = null; placeOrderFirst.subcribeTime = null;
placeOrderFirst.tableId = "$tableId"; placeOrderFirst.tableId = "$tableId";
for(int i = 0;i<placeOrderFirst.shoppingCartSkuItemList.length;i++){
placeOrderFirst.shoppingCartSkuItemList[i].setMealDataList = shopCarGoods.shoppingCartSkuItemList[i].setMealDataList;
}
if (tableId == 0) { if (tableId == 0) {
/// ///

2
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -76,7 +76,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
if(!(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false)) if( !(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false) && widget.placeOrder)
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

72
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -21,13 +21,18 @@ class SettlementOrderCommodity extends StatefulWidget {
final bool showVipTips; final bool showVipTips;
SettlementOrderCommodity( SettlementOrderCommodity(
this.isTakeOut, this.settleOrderInfo, this.minOrderInfo,this.tableId,this.pageType,this.useVipPriceSelect,this.showVipTips); this.isTakeOut,
this.settleOrderInfo,
this.minOrderInfo,
this.tableId,
this.pageType,
this.useVipPriceSelect,
this.showVipTips);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _SettlementOrderCommodity(); return _SettlementOrderCommodity();
} }
} }
class _SettlementOrderCommodity extends State<SettlementOrderCommodity> { class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
@ -105,14 +110,19 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
); );
} }
if(widget.useVipPriceSelect && widget.settleOrderInfo.memberVO.isVip && (!widget.settleOrderInfo.isRaise) && (widget?.settleOrderInfo?.discountAmount!= "0")){ if (widget.useVipPriceSelect &&
widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", widget?.settleOrderInfo?.discountAmount ?? "")); widget.settleOrderInfo.memberVO.isVip &&
(!widget.settleOrderInfo.isRaise) &&
(widget?.settleOrderInfo?.discountAmount != "0")) {
widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠",
widget?.settleOrderInfo?.discountAmount ?? ""));
} }
if(widget.showVipTips){ if (widget.showVipTips) {
widgets.add(GestureDetector(child: Container( widgets.add(GestureDetector(
child: Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child:Text.rich( child: Text.rich(
TextSpan( TextSpan(
children: [ children: [
TextSpan( TextSpan(
@ -133,10 +143,14 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
), ),
], ],
), ),
),),onTap: (){ ),
Navigator.of(context) ),
.pushNamedAndRemoveUntil('/router/main_page', (route) => false,arguments: {"index":2}); onTap: () {
},)); Navigator.of(context).pushNamedAndRemoveUntil(
'/router/main_page', (route) => false,
arguments: {"index": 2});
},
));
} }
widgets.add(Container( widgets.add(Container(
@ -154,7 +168,6 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
return widgets; return widgets;
} }
Widget commodityItem(OrderProductVOList productList) { Widget commodityItem(OrderProductVOList productList) {
return Container( return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
@ -173,7 +186,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
flex: 1, flex: 1,
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left:8.w, left: 8.w,
), ),
// height: 44.h, // height: 44.h,
child: Column( child: Column(
@ -190,7 +203,9 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
), ),
SizedBox(height: 4.h,), SizedBox(
height: 4.h,
),
Text( Text(
productList.skuNameStr != null productList.skuNameStr != null
? "${productList.skuNameStr ?? ""}" ? "${productList.skuNameStr ?? ""}"
@ -208,7 +223,6 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
color: Color(0xFF727272), color: Color(0xFF727272),
), ),
), ),
], ],
), ),
), ),
@ -218,16 +232,16 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Text(
productList.buyNum > 1? productList.buyNum > 1
S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - AppUtils.stringAsFixedDouble2(double.tryParse(productList.discountAmount ?? "0")/productList.buyNum))) ? S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - AppUtils.stringAsFixedDouble2((double.tryParse(productList.discountAmount ?? "0") / productList.buyNum))))
:S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - double.tryParse(productList.discountAmount ?? "0"))), : S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - double.tryParse(productList.discountAmount ?? "0"))),
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF4C4C4C), color: Color(0xFF4C4C4C),
), ),
), ),
if(productList.discountAmount != null) if (productList.discountAmount != null)
Text( Text(
S.of(context).yuan_(productList.sellPrice), S.of(context).yuan_(productList.sellPrice),
style: TextStyle( style: TextStyle(
@ -405,13 +419,13 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
); );
} }
String countAllGoods(){ String countAllGoods() {
int count = 0; int count = 0;
if(widget.minOrderInfo != null){ if (widget.minOrderInfo != null) {
widget.minOrderInfo.orderProductVOList.forEach((element) { widget.minOrderInfo.orderProductVOList.forEach((element) {
count += element.buyNum; count += element.buyNum;
}); });
}else if(widget.settleOrderInfo != null){ } else if (widget.settleOrderInfo != null) {
widget.settleOrderInfo.orderProductList.forEach((element) { widget.settleOrderInfo.orderProductList.forEach((element) {
count += element.buyNum; count += element.buyNum;
}); });
@ -452,7 +466,6 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
SizedBox( SizedBox(
width: 15.w, width: 15.w,
), ),
Container( Container(
child: Text( child: Text(
S.of(context).jiesuanjine, S.of(context).jiesuanjine,
@ -481,12 +494,15 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
); );
} }
String discountPrice(){ String discountPrice() {
if(widget.minOrderInfo != null){ if (widget.minOrderInfo != null) {
return AppUtils.calculateDouble(double.tryParse(widget.minOrderInfo?.couponSubPrice ?? "0") + double.tryParse(widget.settleOrderInfo?.benefitDiscountAmount ?? "0")); return AppUtils.calculateDouble(
}else if(widget.tableId < 0){ double.tryParse(widget.minOrderInfo?.couponSubPrice ?? "0") +
double.tryParse(
widget.settleOrderInfo?.benefitDiscountAmount ?? "0"));
} else if (widget.tableId < 0) {
return "0"; return "0";
}else { } else {
return widget?.settleOrderInfo?.discountAmount ?? "0"; return widget?.settleOrderInfo?.discountAmount ?? "0";
} }
} }

3
lib/union/location_map_page.dart

@ -76,7 +76,8 @@ class _LocationMap extends State<LocationMap> {
leadingColor: Colors.black, leadingColor: Colors.black,
), ),
body: Container( body: Container(
child: BMFMapWidget( //BMFMapWidget ,BMFTextureMapWidget不会强制遮盖其他控件
child: BMFTextureMapWidget(
mapOptions: BMFMapOptions( mapOptions: BMFMapOptions(
center: BMFCoordinate( center: BMFCoordinate(
double.tryParse(widget.arguments["lat"]), double.tryParse(widget.arguments["lat"]),

1
lib/union/union_list.dart

@ -121,6 +121,7 @@ class _UnionList extends State<UnionList> {
child: TextField( child: TextField(
textInputAction: TextInputAction.search, textInputAction: TextInputAction.search,
onEditingComplete: () { onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
widget.queryStore(editingController.text); widget.queryStore(editingController.text);
}, },
controller: editingController, controller: editingController,

62
lib/utils/location.dart

@ -2,11 +2,15 @@ import 'dart:io';
import 'package:android_intent_plus/android_intent.dart'; import 'package:android_intent_plus/android_intent.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bmflocation/flutter_bmflocation.dart'; import 'package:flutter_bmflocation/flutter_bmflocation.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/request_permission.dart'; import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'font_weight.dart';
BaiduLocationAndroidOption initAndroidOptions() { BaiduLocationAndroidOption initAndroidOptions() {
BaiduLocationAndroidOption options = BaiduLocationAndroidOption( BaiduLocationAndroidOption options = BaiduLocationAndroidOption(
@ -99,14 +103,18 @@ class Location {
} }
return true; return true;
} else if (await Permission.location.isUndetermined) { } else if (await Permission.location.isUndetermined) {
showAlertDialog(context);
await Permission.location.request(); await Permission.location.request();
Navigator.of(context).pop();
return false; return false;
} else { } else {
if (Platform.isIOS) { if (Platform.isIOS) {
// //
requestDialog(context, locationCallback); requestDialog(context, locationCallback);
} else { } else {
showAlertDialog(context);
await Permission.location.request(); await Permission.location.request();
Navigator.of(context).pop();
} }
return false; return false;
} }
@ -162,4 +170,58 @@ class Location {
}, },
); );
} }
///
showAlertDialog(context) {
//
showDialog(
context: context,
builder: (BuildContext context) {
return SimpleDialog(
titlePadding: EdgeInsets.all(10),
backgroundColor: Colors.transparent,
elevation: 0,
alignment: Alignment.topCenter,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
children: <Widget>[
Container(
width: double.infinity,
height: 120.h,
padding: EdgeInsets.all(16),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child:Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"访问精确地理位置信息权限说明",
style: TextStyle(
fontSize: 15.sp,
fontWeight:MyFontWeight.regular,
color: Colors.black,
),
),
SizedBox(height: 3.h,),
Text(
"为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息,不授权该权限不影响app正常使用。",
style: TextStyle(
fontSize: 13.sp,
height: 1.3.h,
fontWeight:MyFontWeight.regular,
color: Colors.black,
),
),
],
),
),
],
);
},
);
}
} }

71
lib/view_widget/activity_poster.dart

@ -1,17 +1,18 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/data/activity_pos.dart'; import 'package:huixiang/retrofit/data/activity_pos.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/login_info.dart';
import 'custom_image.dart'; import 'custom_image.dart';
import 'new_people_reward.dart';
class ActivityPoster extends StatefulWidget { class ActivityPoster extends StatefulWidget {
final ActivityPos activityPos; final ActivityPos activityPos;
final List<FirstLoginCouponList> firstLoginCouponList;
ActivityPoster(this.activityPos); ActivityPoster(this.activityPos, this.firstLoginCouponList);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -20,31 +21,39 @@ class ActivityPoster extends StatefulWidget {
} }
class _ActivityPoster extends State<ActivityPoster> { class _ActivityPoster extends State<ActivityPoster> {
bool showNew = false;
@override
void initState() {
super.initState();
if (widget.firstLoginCouponList != null &&
widget.firstLoginCouponList.length > 0) showNew = true;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return WillPopScope(
onWillPop: () async => false, onWillPop: () async => false,
child:Container( child: Container(
width: double.infinity, width: double.infinity,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only( margin: EdgeInsets.only(
left:27.w, left: 27.w,
right:27.w, right: 27.w,
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
jumpClick(widget.activityPos); jumpClick(widget.activityPos);
}, },
child: child: Container(
Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
child:MImage( child: MImage(
widget?.activityPos?.showImage ?? "", widget?.activityPos?.showImage ?? "",
aspectRatio: 0.75, aspectRatio: 0.75,
fit: BoxFit.cover, fit: BoxFit.cover,
@ -52,14 +61,19 @@ class _ActivityPoster extends State<ActivityPoster> {
radius: BorderRadius.all(Radius.circular(12)), radius: BorderRadius.all(Radius.circular(12)),
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",
),), ),
),
), ),
Container( Container(
margin: EdgeInsets.only(top:35.h,right: 8.w,bottom:8.w), margin: EdgeInsets.only(top: 35.h, right: 8.w, bottom: 8.w),
child:GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: (){ onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
if (showNew) {
newShowAlertDialog(widget.firstLoginCouponList);
showNew = false;
}
}, },
child: Image.asset( child: Image.asset(
"assets/image/yq_qx.webp", "assets/image/yq_qx.webp",
@ -67,13 +81,23 @@ class _ActivityPoster extends State<ActivityPoster> {
height: 40, height: 40,
fit: BoxFit.cover, fit: BoxFit.cover,
color: Colors.white, color: Colors.white,
) )))
) )
], ],
), ),
)); ));
} }
///
newShowAlertDialog(newUserCouponList) {
//
showDialog(
context: context,
builder: (BuildContext context) {
return NewPeopleReward(newUserCouponList);
},
);
}
/// contentType 0123,4:,5: /// contentType 0123,4:,5:
jumpClick(ActivityPos activityPos) async { jumpClick(ActivityPos activityPos) async {
switch (activityPos.jumpType) { switch (activityPos.jumpType) {
@ -82,31 +106,28 @@ class _ActivityPoster extends State<ActivityPoster> {
arguments: {"goodsId": widget.activityPos.jumpUrl}); arguments: {"goodsId": widget.activityPos.jumpUrl});
break; break;
case 2: case 2:
Navigator.of(context) Navigator.of(context).pushNamed('/router/web_page', arguments: {
.pushNamed('/router/web_page', arguments: {
"activityId": widget.activityPos.jumpUrl, "activityId": widget.activityPos.jumpUrl,
}); });
break; break;
case 3: case 3:
Navigator.of(context) Navigator.of(context).pushNamed('/router/web_page', arguments: {
.pushNamed('/router/web_page', arguments: {
"articleId": widget.activityPos.jumpUrl, "articleId": widget.activityPos.jumpUrl,
}); });
break; break;
case 4: case 4:
String router = widget.activityPos.jumpUrl; String router = widget.activityPos.jumpUrl;
// String router = "/router/store_order?{\"id\":\"1333246101343436800\",\"tenant\":\"1175\",\"storeName\":\"海峡姐妹茶(汉街店)\"}";
if (router.contains("?")) { if (router.contains("?")) {
String params = router.substring(router.indexOf("?")); String params = router.substring(router.indexOf("?")+1);
params = params.replaceAll("?", "");
Map map = jsonDecode(params); Map map = jsonDecode(params);
Navigator.of(context).pushNamed(router, arguments: map); Navigator.of(context).pushNamed(router.substring(0,router.indexOf("?")), arguments: map);
} else { } else {
Navigator.of(context).pushNamed(router); Navigator.of(context).pushNamed(router);
} }
break; break;
case 5: case 5:
Navigator.of(context) Navigator.of(context).pushNamed('/router/class_details', arguments: {
.pushNamed('/router/class_details', arguments: {
"id": widget.activityPos.jumpUrl, "id": widget.activityPos.jumpUrl,
}); });
break; break;

5
lib/view_widget/new_coupon_widget.dart

@ -43,7 +43,7 @@ class NewCouponWidget extends StatelessWidget {
// } // }
return Container( return Container(
height: (coupon != null && coupon.isEx) ? 155.h : 135.h, height: (coupon != null && coupon.isEx) ? 160.h : 140.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),
padding: EdgeInsets.only(right: 5), padding: EdgeInsets.only(right: 5),
@ -83,11 +83,12 @@ class NewCouponWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"券名称:${coupon != null ? coupon.couponName ?? "" : ""}", "${coupon != null ? coupon.couponName ?? "" : ""}",
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 15.sp, fontSize: 15.sp,
height: 1.2.h,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF0D0D0D), color: Color(0xFF0D0D0D),
), ),

2
lib/view_widget/new_people_reward.dart

@ -42,7 +42,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
SmartDialog.showToast("领取成功"); SmartDialog.showToast("领取成功",alignment: Alignment.center);
}, },
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(

300
pubspec.lock

File diff suppressed because it is too large Load Diff

4
pubspec.yaml

@ -3,7 +3,7 @@ description: 一心回乡.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 3.2.0+41 version: 3.2.4+48
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"
@ -103,6 +103,8 @@ dependencies:
emoji_picker_flutter: ^1.4.1 emoji_picker_flutter: ^1.4.1
mqtt_client: ^9.6.8
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter

Loading…
Cancel
Save