Browse Source

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

# Conflicts:
#	lib/retrofit/retrofit_api.g.dart
remove_uniapp
fmk 3 years ago
parent
commit
b72cc3a851
  1. 2
      android/app/build.gradle
  2. BIN
      assets/image/2x/icon_mine_online_service.webp
  3. BIN
      assets/image/2x/recharge.png
  4. BIN
      assets/image/3x/icon_mine_online_service.webp
  5. BIN
      assets/image/3x/recharge.png
  6. BIN
      assets/image/icon_mine_online_service.webp
  7. BIN
      assets/image/recharge.png
  8. 18
      lib/community/community_page.dart
  9. 123
      lib/community/community_view/community_dynamic.dart
  10. 254
      lib/community/report/report_page.dart
  11. 2
      lib/generated/intl/messages_en.dart
  12. 2
      lib/generated/intl/messages_zh_CN.dart
  13. 2
      lib/generated/intl/messages_zh_Hans_CN.dart
  14. 2
      lib/generated/intl/messages_zh_Hant_CN.dart
  15. 2
      lib/generated/intl/messages_zh_TW.dart
  16. 4
      lib/generated/l10n.dart
  17. 2
      lib/l10n/intl_en.arb
  18. 2
      lib/l10n/intl_zh_CN.arb
  19. 2
      lib/l10n/intl_zh_Hans_CN.arb
  20. 2
      lib/l10n/intl_zh_Hant_CN.arb
  21. 2
      lib/l10n/intl_zh_TW.arb
  22. 42
      lib/main.dart
  23. 56
      lib/main_page.dart
  24. 16
      lib/message/system_details.dart
  25. 19
      lib/mine/mine_view/mine_item.dart
  26. 54
      lib/mine/mine_view/wallet_coupon_view.dart
  27. 692
      lib/mine/recharge_page.dart
  28. 3
      lib/retrofit/data/coupon.dart
  29. 78
      lib/retrofit/data/recharge_list.dart
  30. 23
      lib/retrofit/retrofit_api.dart
  31. 104
      lib/retrofit/retrofit_api.g.dart
  32. 22
      lib/setting/help_feedback_page.dart
  33. 14
      lib/utils/flutter_utils.dart
  34. 3
      lib/view_widget/new_coupon_widget.dart

2
android/app/build.gradle

@ -143,7 +143,7 @@ android {
ndk { ndk {
/// .so /// .so
abiFilters 'armeabi-v7a' abiFilters 'armeabi-v7a','arm64-v8a','x86'
} }
} }
debug { debug {

BIN
assets/image/2x/icon_mine_online_service.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 B

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
assets/image/2x/recharge.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

BIN
assets/image/3x/icon_mine_online_service.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
assets/image/3x/recharge.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/icon_mine_online_service.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/image/recharge.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

18
lib/community/community_page.dart

@ -24,10 +24,10 @@ class _CommunityPage extends State<CommunityPage>
List<String> lables = [ List<String> lables = [
"关注", "关注",
"推荐", "分享健康",
"头条", "了解健康",
"课程", "学习健康",
"关于我们", "关于回乡",
// "直播", // "直播",
]; ];
@ -94,16 +94,16 @@ class _CommunityPage extends State<CommunityPage>
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: lables.map((e) { children: lables.map((e) {
if (e == "关于我们") { if (e == "关于回乡") {
return BrandPage(); return BrandPage();
}else if(e == "头条"){ }else if(e == "了解健康"){
return ArticlePage(); return ArticlePage();
}else if(e == "课程"){ }else if(e == "学习健康"){
return CommunityCourse(); return CommunityCourse();
} }
else if(e == "推荐"){ else if(e == "分享健康"){
if (tuijian == null){ if (tuijian == null){
tuijian = CommunityChildPage("推荐"); tuijian = CommunityChildPage("分享健康");
} }
return tuijian; return tuijian;
}else if(e == "关注"){ }else if(e == "关注"){

123
lib/community/community_view/community_dynamic.dart

@ -410,25 +410,27 @@ class _CommunityDynamic extends State<CommunityDynamic> {
], ],
), ),
), ),
// Expanded( if (widget?.article?.author != widget.userId ?? "")
// child: GestureDetector( Expanded(
// behavior: HitTestBehavior.opaque, child: GestureDetector(
// onTap: () { behavior: HitTestBehavior.opaque,
// setState(() { onTap: () {
// choiceShowBottomSheet(); setState(() {
// }); choiceShowBottomSheet();
// }, });
// child: Container( },
// alignment: Alignment.center, child: Container(
// child: Text( padding: EdgeInsets.only(top:3),
// "...", alignment: Alignment.center,
// style: TextStyle( child: Text(
// fontSize: 18.sp, "...",
// fontWeight: MyFontWeight.medium, style: TextStyle(
// color: Colors.black, fontSize: 18.sp,
// ), fontWeight: MyFontWeight.medium,
// ), color: Colors.black,
// ))), ),
),
))),
], ],
), ),
], ],
@ -772,50 +774,53 @@ class _CommunityDynamic extends State<CommunityDynamic> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
GestureDetector( // GestureDetector(
onTap: () { // onTap: () {
setState(() { // setState(() {
Navigator.of(context).pop(); // Navigator.of(context).pop();
share(); // share();
}); // });
}, // },
child: Container( // child: Container(
child: Row( // child: Row(
children: [ // children: [
SizedBox( // SizedBox(
width: 4, // width: 4,
), // ),
Image.asset( // Image.asset(
"assets/image/icon_share.webp", // "assets/image/icon_share.webp",
fit: BoxFit.cover, // fit: BoxFit.cover,
width: 25, // width: 25,
height: 25, // height: 25,
color: Color(0xff515151), // color: Color(0xff515151),
), // ),
SizedBox( // SizedBox(
width: 12, // width: 12,
), // ),
Text( // Text(
"分享", // "分享",
style: TextStyle( // style: TextStyle(
fontSize: 17.sp, // fontSize: 17.sp,
fontWeight: MyFontWeight.medium, // fontWeight: MyFontWeight.medium,
color: Color(0xFF1A1A1A), // color: Color(0xFF1A1A1A),
), // ),
), // ),
], // ],
), // ),
)), // )),
Container( // Container(
margin: EdgeInsets.symmetric(vertical: 12), // margin: EdgeInsets.symmetric(vertical: 12),
height: 1.h, // height: 1.h,
color: Color(0xFFF7F7F7), // color: Color(0xFFF7F7F7),
), // ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
Navigator.of(context) Navigator.of(context)
.popAndPushNamed('/router/report_page'); .popAndPushNamed('/router/report_page',arguments: {
"userName":widget?.article?.authorName ?? "",
"authorId":widget?.article?.author ?? "",
});
}); });
}, },
child: Row( child: Row(

254
lib/community/report/report_page.dart

@ -1,13 +1,16 @@
import 'dart:ui'; import 'dart:ui';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
class ReportPage extends StatefulWidget { class ReportPage extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
@ -24,10 +27,35 @@ class _ReportPage extends State<ReportPage> {
ApiService apiService; ApiService apiService;
int textLength = 0; int textLength = 0;
final TextEditingController editingController = TextEditingController(); final TextEditingController editingController = TextEditingController();
String textCon;
String userName;
String authorId;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
userName = widget.arguments['userName'];
authorId = widget.arguments['authorId'];
}
report() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.complaint({
"content": checkIndex == 9 ? editingController.text : textCon,
"informationId": authorId,
}).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
Navigator.of(context).popAndPushNamed('/router/report_success');
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
} }
@override @override
@ -67,7 +95,7 @@ class _ReportPage extends State<ReportPage> {
), ),
), ),
TextSpan( TextSpan(
text: "@百花谷", text: "@${userName.toString()}",
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
@ -86,41 +114,42 @@ class _ReportPage extends State<ReportPage> {
), ),
), ),
), ),
report(), reportContent(),
SizedBox(height: 12), SizedBox(height: 12),
Container( if (checkIndex == 9)
width: double.infinity, Container(
height: 186.h, width: double.infinity,
margin: EdgeInsets.only(right: 16,left:40,bottom:100), height: 186.h,
decoration: new BoxDecoration( margin:
color: Color(0xFFF7F7F7), EdgeInsets.only(right: 16, left: 40, bottom: 100),
borderRadius: BorderRadius.circular(4.0), decoration: new BoxDecoration(
), color: Color(0xFFF7F7F7),
child: Container( borderRadius: BorderRadius.circular(4.0),
margin: EdgeInsets.fromLTRB(20.w, 5.h, 20.w, 0),
alignment: Alignment.topLeft,
child: TextField(
maxLines: 5,
controller: editingController,
onChanged: (value) {
setState(() {
textLength = value.length;
});
},
maxLength: 100,
decoration: InputDecoration(
border: InputBorder.none,
hintText: "请输入举报原因,以便我们更快定位问题,快速处理",
hintStyle: TextStyle(
fontSize: 12.sp,
height: 1.2,
fontWeight: MyFontWeight.regular,
color: Color(0xFF999999),
),
), ),
), child: Container(
) margin: EdgeInsets.fromLTRB(20.w, 5.h, 20.w, 0),
) alignment: Alignment.topLeft,
child: TextField(
maxLines: 5,
controller: editingController,
onChanged: (value) {
setState(() {
textLength = value.length;
});
},
maxLength: 100,
decoration: InputDecoration(
border: InputBorder.none,
hintText: "请输入举报原因,以便我们更快定位问题,快速处理",
hintStyle: TextStyle(
fontSize: 12.sp,
height: 1.2,
fontWeight: MyFontWeight.regular,
color: Color(0xFF999999),
),
),
),
))
], ],
), ),
), ),
@ -128,7 +157,7 @@ class _ReportPage extends State<ReportPage> {
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: Container( child: Container(
width: double.infinity, width: double.infinity,
height:95, height: 95,
child: Column( child: Column(
children: [ children: [
GestureDetector( GestureDetector(
@ -138,7 +167,7 @@ class _ReportPage extends State<ReportPage> {
}, },
child: Container( child: Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(bottom:25), margin: EdgeInsets.only(bottom: 25),
child: Text( child: Text(
"投诉须知", "投诉须知",
style: TextStyle( style: TextStyle(
@ -148,15 +177,20 @@ class _ReportPage extends State<ReportPage> {
), ),
), ),
)), )),
Expanded(child: Expanded(
GestureDetector( child: GestureDetector(
onTap: (){ onTap: () {
Navigator.of(context) if(checkIndex == 9 && editingController.text == ""){
.pushNamed('/router/report_success'); SmartDialog.showToast("请输入举报原因", alignment: Alignment.center);
}, return;
child: Container( }
report();
},
child: Opacity(
opacity: checkIndex == 0 ? 0.3 : 0.9,
child: Container(
width: double.infinity, width: double.infinity,
height:double.infinity, height: double.infinity,
color: Color(0xFF319E5F), color: Color(0xFF319E5F),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
@ -167,7 +201,9 @@ class _ReportPage extends State<ReportPage> {
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
), ),
), ),
),)) ),
),
))
], ],
), ),
)) ))
@ -177,55 +213,95 @@ class _ReportPage extends State<ReportPage> {
); );
} }
Widget report() { Widget reportContent() {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16), width: double.infinity,
child: padding: EdgeInsets.only(left: 16, right: 16, top: 20),
// (articles == null || articles.length == 0) child: Column(
// ? NoDataView(
// src: "assets/image/dong_tai.webp",
// isShowBtn: false,
// text: "目前暂无发布动态,要把开心的事讲出来哦~",
// fontSize: 16.sp,
// margin: EdgeInsets.only(left: 60.w, right: 60.w),
// ) :
ListView.builder(
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: reportList(),
);
},
itemCount: 9,
),
);
}
Widget reportList() {
return Container(
padding: EdgeInsets.only(top: 18, bottom: 20),
color: Color(0xFFFFFFFF),
child: Row(
children: [ children: [
Image.asset( content("色情低俗", 1),
"assets/image/icon_radio_unselected.webp", SizedBox(
width: 16, height: 18,
height: 16,
), ),
content("政治宗教", 2),
SizedBox( SizedBox(
width: 8, height: 18,
), ),
Expanded( content("广告骚扰", 3),
child: Text( SizedBox(
"色情低俗", height: 18,
style: TextStyle( ),
color: Color(0xFF353535), content("虚假欺骗", 4),
fontSize: 14.sp, SizedBox(
fontWeight: MyFontWeight.regular), height: 18,
)) ),
content("侵权(诽谤、抄袭、冒用)", 5),
SizedBox(
height: 18,
),
content("不良封面/标题", 6),
SizedBox(
height: 18,
),
content("赌博诈骗", 7),
SizedBox(
height: 18,
),
content("违禁内容(暴利恐怖、令人不适、宣言仇恨)", 8),
SizedBox(
height: 18,
),
content("其他", 9),
], ],
)); ));
} }
var checkIndex = 0;
Widget checkView(var index) {
return Container(
padding: EdgeInsets.only(right: 16.w, left: 5),
alignment: Alignment.center,
// color: Colors.red,
child: Image.asset(
checkIndex != index
? "assets/image/icon_radio_unselected.webp"
: "assets/image/icon_radio_selected.webp",
width: 20.w,
height: 20.h,
),
);
}
Widget content(textContext, var index) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = index;
textCon = textContext;
});
},
child: Container(
alignment: Alignment.center,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
checkView(index),
Container(),
Expanded(
child: Text(
textContext,
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF353535),
fontWeight: MyFontWeight.regular,
),
),
)
],
),
));
}
} }

2
lib/generated/intl/messages_en.dart

@ -290,7 +290,7 @@ class MessageLookup extends MessageLookupByLibrary {
"jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("积分的计算说明"), "jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("积分的计算说明"),
"jifendidaogao" : MessageLookupByLibrary.simpleMessage("积分从低到高"), "jifendidaogao" : MessageLookupByLibrary.simpleMessage("积分从低到高"),
"jifengaodaodi" : MessageLookupByLibrary.simpleMessage("积分从高到低"), "jifengaodaodi" : MessageLookupByLibrary.simpleMessage("积分从高到低"),
"jifenshangcheng" : MessageLookupByLibrary.simpleMessage("积分商城"), "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("净弼积分商城"),
"jifenxiangqing" : MessageLookupByLibrary.simpleMessage("积分详情"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("积分详情"),
"jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("净弼联盟会员店"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("净弼联盟会员店"),
"jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"),

2
lib/generated/intl/messages_zh_CN.dart

@ -288,7 +288,7 @@ class MessageLookup extends MessageLookupByLibrary {
"jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("积分的计算说明"), "jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("积分的计算说明"),
"jifendidaogao" : MessageLookupByLibrary.simpleMessage("积分从低到高"), "jifendidaogao" : MessageLookupByLibrary.simpleMessage("积分从低到高"),
"jifengaodaodi" : MessageLookupByLibrary.simpleMessage("积分从高到低"), "jifengaodaodi" : MessageLookupByLibrary.simpleMessage("积分从高到低"),
"jifenshangcheng" : MessageLookupByLibrary.simpleMessage("积分商城"), "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("净弼积分商城"),
"jifenxiangqing" : MessageLookupByLibrary.simpleMessage("积分详情"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("积分详情"),
"jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("净弼联盟会员店"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("净弼联盟会员店"),
"jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"),

2
lib/generated/intl/messages_zh_Hans_CN.dart

@ -288,7 +288,7 @@ class MessageLookup extends MessageLookupByLibrary {
"jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("积分的计算说明"), "jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("积分的计算说明"),
"jifendidaogao" : MessageLookupByLibrary.simpleMessage("积分从低到高"), "jifendidaogao" : MessageLookupByLibrary.simpleMessage("积分从低到高"),
"jifengaodaodi" : MessageLookupByLibrary.simpleMessage("积分从高到低"), "jifengaodaodi" : MessageLookupByLibrary.simpleMessage("积分从高到低"),
"jifenshangcheng" : MessageLookupByLibrary.simpleMessage("积分商城"), "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("净弼积分商城"),
"jifenxiangqing" : MessageLookupByLibrary.simpleMessage("积分详情"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("积分详情"),
"jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("净弼联盟会员店"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("净弼联盟会员店"),
"jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"),

2
lib/generated/intl/messages_zh_Hant_CN.dart

@ -288,7 +288,7 @@ class MessageLookup extends MessageLookupByLibrary {
"jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("積分的計算説明"), "jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("積分的計算説明"),
"jifendidaogao" : MessageLookupByLibrary.simpleMessage("積分從低到高"), "jifendidaogao" : MessageLookupByLibrary.simpleMessage("積分從低到高"),
"jifengaodaodi" : MessageLookupByLibrary.simpleMessage("積分從高到低"), "jifengaodaodi" : MessageLookupByLibrary.simpleMessage("積分從高到低"),
"jifenshangcheng" : MessageLookupByLibrary.simpleMessage("積分商城"), "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("淨弼積分商城"),
"jifenxiangqing" : MessageLookupByLibrary.simpleMessage("積分詳情"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("積分詳情"),
"jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("淨弼聯盟會員店"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("淨弼聯盟會員店"),
"jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"),

2
lib/generated/intl/messages_zh_TW.dart

@ -288,7 +288,7 @@ class MessageLookup extends MessageLookupByLibrary {
"jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("積分的計算説明"), "jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("積分的計算説明"),
"jifendidaogao" : MessageLookupByLibrary.simpleMessage("積分從低到高"), "jifendidaogao" : MessageLookupByLibrary.simpleMessage("積分從低到高"),
"jifengaodaodi" : MessageLookupByLibrary.simpleMessage("積分從高到低"), "jifengaodaodi" : MessageLookupByLibrary.simpleMessage("積分從高到低"),
"jifenshangcheng" : MessageLookupByLibrary.simpleMessage("積分商城"), "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("淨弼積分商城"),
"jifenxiangqing" : MessageLookupByLibrary.simpleMessage("積分詳情"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("積分詳情"),
"jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("淨弼聯盟會員店"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("淨弼聯盟會員店"),
"jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"),

4
lib/generated/l10n.dart

@ -225,10 +225,10 @@ class S {
); );
} }
/// `` /// ``
String get jifenshangcheng { String get jifenshangcheng {
return Intl.message( return Intl.message(
'积分商城', '净弼积分商城',
name: 'jifenshangcheng', name: 'jifenshangcheng',
desc: '', desc: '',
args: [], args: [],

2
lib/l10n/intl_en.arb

@ -18,7 +18,7 @@
"main_menu4": "我的", "main_menu4": "我的",
"shouye": "首页", "shouye": "首页",
"huodongliebiao": "活动列表", "huodongliebiao": "活动列表",
"jifenshangcheng": "积分商城", "jifenshangcheng": "净弼积分商城",
"jinrihuiyuanrenwu": "今日会员任务", "jinrihuiyuanrenwu": "今日会员任务",
"renwuzhongxin": "任务中心", "renwuzhongxin": "任务中心",
"qiandaolingqujinfen": "签到领取积分", "qiandaolingqujinfen": "签到领取积分",

2
lib/l10n/intl_zh_CN.arb

@ -18,7 +18,7 @@
"main_menu4": "我的", "main_menu4": "我的",
"shouye": "首页", "shouye": "首页",
"huodongliebiao": "活动列表", "huodongliebiao": "活动列表",
"jifenshangcheng": "积分商城", "jifenshangcheng": "净弼积分商城",
"jinrihuiyuanrenwu": "今日会员任务", "jinrihuiyuanrenwu": "今日会员任务",
"renwuzhongxin": "任务中心", "renwuzhongxin": "任务中心",
"qiandaolingqujinfen": "签到领取积分", "qiandaolingqujinfen": "签到领取积分",

2
lib/l10n/intl_zh_Hans_CN.arb

@ -18,7 +18,7 @@
"main_menu4": "我的", "main_menu4": "我的",
"shouye": "首页", "shouye": "首页",
"huodongliebiao": "活动列表", "huodongliebiao": "活动列表",
"jifenshangcheng": "积分商城", "jifenshangcheng": "净弼积分商城",
"jinrihuiyuanrenwu": "今日会员任务", "jinrihuiyuanrenwu": "今日会员任务",
"renwuzhongxin": "任务中心", "renwuzhongxin": "任务中心",
"qiandaolingqujinfen": "签到领取积分", "qiandaolingqujinfen": "签到领取积分",

2
lib/l10n/intl_zh_Hant_CN.arb

@ -18,7 +18,7 @@
"main_menu4": "我的", "main_menu4": "我的",
"shouye": "首頁", "shouye": "首頁",
"huodongliebiao": "活動列表", "huodongliebiao": "活動列表",
"jifenshangcheng": "積分商城", "jifenshangcheng": "淨弼積分商城",
"jinrihuiyuanrenwu": "今日會員任務", "jinrihuiyuanrenwu": "今日會員任務",
"renwuzhongxin": "任務中心", "renwuzhongxin": "任務中心",
"qiandaolingqujinfen": "簽到領取積分", "qiandaolingqujinfen": "簽到領取積分",

2
lib/l10n/intl_zh_TW.arb

@ -18,7 +18,7 @@
"main_menu4": "我的", "main_menu4": "我的",
"shouye": "首頁", "shouye": "首頁",
"huodongliebiao": "活動列表", "huodongliebiao": "活動列表",
"jifenshangcheng": "積分商城", "jifenshangcheng": "淨弼積分商城",
"jinrihuiyuanrenwu": "今日會員任務", "jinrihuiyuanrenwu": "今日會員任務",
"renwuzhongxin": "任務中心", "renwuzhongxin": "任務中心",
"qiandaolingqujinfen": "簽到領取積分", "qiandaolingqujinfen": "簽到領取積分",

42
lib/main.dart

@ -116,7 +116,7 @@ void main() async {
locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH'); locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH');
} }
ImgCachePath(); ImgCachePath();
initSdk(); // initSdk();
bool isFirst = sharedPreferences.getBool("isFirst"); bool isFirst = sharedPreferences.getBool("isFirst");
runApp(MyApp(locale, isFirst)); runApp(MyApp(locale, isFirst));
@ -127,47 +127,7 @@ void main() async {
final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin();
initSdk() async {
///ios startXg前需要调用此方法
xgFlutterPlugin.configureClusterDomainName("tpns.sh.tencent.com");
xgFlutterPlugin.setEnableDebug(true);
///iOS的appID信息Android信息在build.gradle文件中
xgFlutterPlugin.startXg("1680005688", "IYIB3R2XRE22");
if (Platform.isAndroid) {
XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi();
//
androidApi.setMiPushAppId(appId: "2882303761520050452");
androidApi.setMiPushAppKey(appKey: "5582005091452");
androidApi.enableOtherPush();
androidApi.regPush();
}
ShareSDKRegister shareSDKRegister = ShareSDKRegister();
shareSDKRegister.setupWechat(
"wx3b269e795ed23e5f",
"64020361b8ec4c99936c0e3999a9f249",
"https://hx.lotus-wallet.com/app/",
);
shareSDKRegister.setupFacebook(
"523308712059457",
"d3a1b6377100871799d8973fbe84794a",
"一心回乡",
);
SharesdkPlugin.regist(shareSDKRegister);
if (Platform.isIOS) {
LocationFlutterPlugin.setApiKey("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR");
BMFMapSDK.setApiKeyAndCoordType(
'ylW2QPlsbERkho7jOgU4GQSeawmdUIoR',
BMF_COORD_TYPE.COMMON,
);
} else if (Platform.isAndroid) {
BMFMapSDK.setCoordType(BMF_COORD_TYPE.COMMON);
}
}
EventBus eventBus = EventBus(sync: true); EventBus eventBus = EventBus(sync: true);

56
lib/main_page.dart

@ -2,6 +2,8 @@ import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:huixiang/community/community_page.dart'; import 'package:huixiang/community/community_page.dart';
@ -20,6 +22,9 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/native_event_handler.dart'; import 'package:huixiang/utils/native_event_handler.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:sharesdk_plugin/sharesdk_interface.dart';
import 'package:sharesdk_plugin/sharesdk_register.dart';
import 'package:tpns_flutter_plugin/android/xg_android_api.dart';
import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
import 'community/order_page.dart'; import 'community/order_page.dart';
@ -81,6 +86,9 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
..userInteractions = false ..userInteractions = false
..dismissOnTap = false; ..dismissOnTap = false;
initSdk();
pushRoute(); pushRoute();
String invite = ""; String invite = "";
@ -130,11 +138,53 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
}); });
queryUserInfo(); queryUserInfo();
}
initSdk() async {
///ios startXg前需要调用此方法
xgFlutterPlugin.configureClusterDomainName("tpns.sh.tencent.com");
xgFlutterPlugin.setEnableDebug(true);
///iOS的appID信息Android信息在build.gradle文件中
xgFlutterPlugin.startXg("1680005688", "IYIB3R2XRE22");
if (Platform.isAndroid) {
XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi();
//
androidApi.setMiPushAppId(appId: "2882303761520050452");
androidApi.setMiPushAppKey(appKey: "5582005091452");
androidApi.enableOtherPush();
androidApi.regPush();
}
ShareSDKRegister shareSDKRegister = ShareSDKRegister();
shareSDKRegister.setupWechat(
"wx3b269e795ed23e5f",
"64020361b8ec4c99936c0e3999a9f249",
"https://hx.lotus-wallet.com/app/",
);
shareSDKRegister.setupFacebook(
"523308712059457",
"d3a1b6377100871799d8973fbe84794a",
"一心回乡",
);
SharesdkPlugin.regist(shareSDKRegister);
if (Platform.isIOS) {
LocationFlutterPlugin.setApiKey("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR");
BMFMapSDK.setApiKeyAndCoordType(
'ylW2QPlsbERkho7jOgU4GQSeawmdUIoR',
BMF_COORD_TYPE.COMMON,
);
} else if (Platform.isAndroid) {
BMFMapSDK.setCoordType(BMF_COORD_TYPE.COMMON);
}
if (Platform.isAndroid) { if (Platform.isAndroid) {
xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler( xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler(
MyNativeEventHandler( MyNativeEventHandler(
(String title, String message, String customContent, int type) { (String title, String message, String customContent, int type) {
print("xgPushClickAction2: $customContent"); print("xgPushClickAction2: $customContent");
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
value.setString("pushData", customContent); value.setString("pushData", customContent);
@ -151,7 +201,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
if (Platform.isAndroid if (Platform.isAndroid
? (event["actionType"] == 0) ? (event["actionType"] == 0)
: (event["xg"]["msgtype"] == 1) && : (event["xg"]["msgtype"] == 1) &&
event[Platform.isAndroid ? "customMessage" : "custom"] != null) { event[Platform.isAndroid ? "customMessage" : "custom"] != null) {
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
value.setString("pushData", value.setString("pushData",
event[Platform.isAndroid ? "customMessage" : "custom"]); event[Platform.isAndroid ? "customMessage" : "custom"]);
@ -307,7 +357,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
// bottomNavigationBigItem(S.of(context).pinpai, 0), // bottomNavigationBigItem(S.of(context).pinpai, 0),
bottomNavigationItem(S.of(context).main_menu1, 0), bottomNavigationItem(S.of(context).main_menu1, 0),
bottomNavigationItem(S.of(context).main_menu2, 1), bottomNavigationItem(S.of(context).main_menu2, 1),
bottomNavigationItem((Theme.of(context).platform == TargetPlatform.android) ? "订单" :S.of(context).main_menu3 , 2), bottomNavigationItem(S.of(context).main_menu3 , 2),
bottomNavigationItem(S.of(context).main_menu4, 3), bottomNavigationItem(S.of(context).main_menu4, 3),
], ],
), ),

16
lib/message/system_details.dart

@ -198,7 +198,7 @@ class _SystemDetails extends State<SystemDetails> {
children: [ children: [
(messages == null || messages.length == 0) (messages == null || messages.length == 0)
? NoDataView( ? NoDataView(
src: "assets/image/icon_empty.png", 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,
@ -323,7 +323,7 @@ class _SystemDetails extends State<SystemDetails> {
children: [ children: [
(messages == null || messages.length == 0) (messages == null || messages.length == 0)
? NoDataView( ? NoDataView(
src:"assets/image/icon_empty.png", 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,
@ -365,10 +365,10 @@ class _SystemDetails extends State<SystemDetails> {
children: [ children: [
Image.asset( Image.asset(
(message.typed == 1) (message.typed == 1)
? "assets/image/icon_system_message.png" ? "assets/image/icon_system_message.webp"
: (message.typed == 2) : (message.typed == 2)
? "assets/image/icon_system_message.png" ? "assets/image/icon_system_message.webp"
: "assets/image/c_z.png", : "assets/image/c_z.webp",
width: 24.w, width: 24.w,
height: 24.h, height: 24.h,
), ),
@ -459,7 +459,7 @@ class _SystemDetails extends State<SystemDetails> {
children: [ children: [
(messages == null || messages.length == 0) (messages == null || messages.length == 0)
? NoDataView( ? NoDataView(
src:"assets/image/icon_empty.png", 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,
@ -606,7 +606,7 @@ class _SystemDetails extends State<SystemDetails> {
children: [ children: [
(messages == null || messages.length == 0) (messages == null || messages.length == 0)
? NoDataView( ? NoDataView(
src:"assets/image/icon_empty.png", 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,
@ -850,7 +850,7 @@ class _SystemDetails extends State<SystemDetails> {
children: [ children: [
(messages == null || messages.length == 0) (messages == null || messages.length == 0)
? NoDataView( ? NoDataView(
src:"assets/image/icon_empty.png", 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,

19
lib/mine/mine_view/mine_item.dart

@ -157,16 +157,15 @@ class _MineItem extends State<MineItem> {
), ),
),), ),),
/// ///
// Expanded(child: InkWell( Expanded(child: InkWell(
// onTap: () { onTap: () {
// showCallMobile(); showCallMobile();
// }, },
// child: mineItem( child: mineItem(
// "联系客服", "联系客服",
// "assets/image/icon_mine_online_service.png", "assets/image/icon_mine_online_service.webp",
// ), ),
// ),), ),),
Expanded(child:Container()),
Expanded(child:Container()), Expanded(child:Container()),
Expanded(child:Container()) Expanded(child:Container())
], ],

54
lib/mine/mine_view/wallet_coupon_view.dart

@ -31,59 +31,7 @@ class _WalletCoupon extends State<WalletCoupon> {
), ),
], ],
), ),
child: (Theme.of(context).platform == TargetPlatform.android) child: Row(
? GestureDetector(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/roll_center_page');
});
},
child: Row(
children: [
Image.asset(
"assets/image/icon_mine_invoice_assistant.webp",
width: 48.h,
height: 48.h,
),
SizedBox(
width: 12.w,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).lingquanzhongxin,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 3,
),
Text(
"联盟下单享不停、海量优惠券等你来领!",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 12.sp,
color: Color(0xFF7B7B7B),
),
),
],
),
)
],
))
: Row(
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,

692
lib/mine/recharge_page.dart

@ -9,10 +9,13 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart'; import 'package:fluwx/fluwx.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/recharge_list.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/data/vip_benefit_list.dart'; import 'package:huixiang/retrofit/data/vip_benefit_list.dart';
import 'package:huixiang/retrofit/data/vip_rule_details.dart'; import 'package:huixiang/retrofit/data/vip_rule_details.dart';
import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/min.dart'; import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/item_input_widget.dart'; import 'package:huixiang/view_widget/item_input_widget.dart';
@ -35,6 +38,10 @@ class _RechargePage extends State<RechargePage> {
List<VipBenefitList> vipBenefitList = []; List<VipBenefitList> vipBenefitList = [];
Color color = Colors.black; Color color = Colors.black;
double discount = 100; double discount = 100;
List<RechargeList> rechargeA;
int selectIndex = 0;
UserInfo userInfo;
dynamic mBalance;
@override @override
void initState() { void initState() {
@ -45,11 +52,13 @@ class _RechargePage extends State<RechargePage> {
context: context, token: value.getString("token"), pay: true); context: context, token: value.getString("token"), pay: true);
queryBenefitList(); queryBenefitList();
queryRuleDetails(); queryRuleDetails();
queryRechargeList();
queryUserBalance();
}); });
weChatResponseEventHandler.listen((event) async { weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}"); print("payCallback: ${event.errCode}");
if(event.errCode == 0){ if (event.errCode == 0) {
Navigator.of(context).pop(); queryUserBalance();
SmartDialog.showToast("充值成功", alignment: Alignment.center); SmartDialog.showToast("充值成功", alignment: Alignment.center);
} }
// else{ // else{
@ -59,29 +68,40 @@ class _RechargePage extends State<RechargePage> {
}); });
} }
/// ///
queryBenefitList() async { queryBenefitList() async {
BaseData<List<VipBenefitList>> baseData = await apiService.benefitList().catchError((onError) {}); BaseData<List<VipBenefitList>> baseData =
await apiService.benefitList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
vipBenefitList.clear(); vipBenefitList.clear();
vipBenefitList.addAll(baseData.data); vipBenefitList.addAll(baseData.data);
vipBenefitList.forEach((element) { vipBenefitList.forEach((element) {
if(element.have && element.config != null && element.code == "RECHARGE"){ if (element.have &&
element.config != null &&
element.code == "RECHARGE") {
discount = double.parse(element.config); discount = double.parse(element.config);
} }
}); });
}); });
} }
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
queryUserBalance() async {
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
mBalance = double.tryParse(userInfo?.money ?? "0");
if (mounted) setState(() {});
}
}
////// //////
queryRuleDetails() async { queryRuleDetails() async {
BaseData<VipRuleDetails> baseData = BaseData<VipRuleDetails> baseData =
await apiService.vipBenefit().catchError((onError) {}); await apiService.vipBenefit().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
vipRuleDetails = baseData.data; vipRuleDetails = baseData.data;
@ -90,6 +110,25 @@ class _RechargePage extends State<RechargePage> {
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
///
queryRechargeList() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<List<RechargeList>> baseData = await apiService.rechargeAct().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
rechargeA = baseData.data;
});
}
EasyLoading.dismiss();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -100,266 +139,391 @@ class _RechargePage extends State<RechargePage> {
background: Color(0xFFFFFFFF), background: Color(0xFFFFFFFF),
leadingColor: Colors.black, leadingColor: Colors.black,
), ),
body:Stack( body: Container(
children: [ color: Color(0xFFFFFFFF),
SingleChildScrollView( child: Stack(
physics: BouncingScrollPhysics(), children: [
child: Container( SingleChildScrollView(
child: Column( physics: BouncingScrollPhysics(),
children: [ child: Container(
Container( margin: EdgeInsets.only(left: 16, right: 16),
child: Column(children: [ child: Column(
ItemInputWidget( children: [
S.of(context).qingshuruchongzhijine, Column(
hintText: "",
controller: controller,
padding: EdgeInsets.all(20),
errorText: S.of(context).chongzhizuixiaojine(100),
titleColor: Color(0xFF727272),
errorTextColor: Color(0xFF32A060),
radius: 8,
discount: discount/10,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 27.sp,
color: color,
),
inputLimit: 6,
textInputType: TextInputType.number,
textInputFormatter: FilteringTextInputFormatter.digitsOnly,
onChanged: (value) {
if (value != null &&
value != "" &&
double.tryParse(value) < 100) {
color = Colors.red;
} else {
color = Colors.black;
}
setState(() {});
},
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
if (vipRuleDetails?.recharge != null &&
vipRuleDetails.recharge != "")
Expanded(child:Container(
color: Colors.white,
padding: EdgeInsets.only(left: 8),
child: Html(
data: "注意:${vipRuleDetails?.recharge??""}",
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
),)
],
),
],),
),
Container(
width: double.infinity,
margin: EdgeInsets.only(
left: 0.w,
right: 0.w,
top: 16.h,
bottom: 4.h,
),
padding: EdgeInsets.only(
left: 20.w,
right: 16.w,
top: 20.h,
bottom: 20.h,
),
decoration: BoxDecoration(
color: Colors.white,
// borderRadius: BorderRadius.circular(4),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
// ItemInputWidget(
// S.of(context).qingshuruchongzhijine,
// hintText: "",
// controller: controller,
// padding: EdgeInsets.all(20),
// errorText: S.of(context).chongzhizuixiaojine(100),
// titleColor: Color(0xFF727272),
// errorTextColor: Color(0xFF32A060),
// radius: 8,
// discount: discount / 10,
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 27.sp,
// color: color,
// ),
// inputLimit: 6,
// textInputType: TextInputType.number,
// textInputFormatter:
// FilteringTextInputFormatter.digitsOnly,
// onChanged: (value) {
// if (value != null &&
// value != "" &&
// double.tryParse(value) < 100) {
// color = Colors.red;
// } else {
// color = Colors.black;
// }
// setState(() {});
// },
// ),
Padding( Padding(
padding: EdgeInsets.only(bottom: 16.h), padding: EdgeInsets.only(top: 26, bottom: 28),
child: Text( child: Text(
S.of(context).zhifufangshi, S.of(context).chongzhi,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 28.sp,
color: Colors.black, color: Color(0xFF181818),
fontWeight: FontWeight.bold, fontWeight: MyFontWeight.semi_bold),
),
), ),
), ),
GestureDetector( Row(
onTap: () { children: [
setState(() { Expanded(
checkIndex = 1; child: Text(
}); S.of(context).zhanghuyue,
}, style: TextStyle(
child: Row( fontSize: 15.sp,
mainAxisAlignment: MainAxisAlignment.start, color: Color(0xFF181818),
crossAxisAlignment: CrossAxisAlignment.start, fontWeight: MyFontWeight.semi_bold),
children: [ )),
Image.asset("assets/image/icon_we_chat.webp"), Text.rich(
TextSpan(children: [
TextSpan(
text: "$mBalance",
style: TextStyle(
fontSize: 26.sp,
color: Color(0xFF181818),
fontWeight: MyFontWeight.semi_bold),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 15.sp,
color: Color(0xFF181818),
fontWeight: MyFontWeight.semi_bold),
),
]),
),
],
),
SizedBox(height: 28),
rechargeList(),
SizedBox(height:22),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
if (vipRuleDetails?.recharge != null &&
vipRuleDetails.recharge != "")
Expanded( Expanded(
flex: 1, child: Container(
child: Padding( color: Colors.white,
padding: EdgeInsets.only(left: 8.w), child: Html(
child: Text( data: "注意:${vipRuleDetails?.recharge ?? ""}",
S.of(context).weixinzhifu, customImageRenders: {
style: TextStyle( networkSourceMatcher(): networkImageRender(
fontSize: 14.sp, loadingWidget: () {
color: Color(0xff353535), return Container();
), },
),
},
), ),
), ),
), )
checkView(1), ],
],
),
),
],
),
),
// InkWell(
// onTap: () {
// recharge();
// },
// child: Container(
// // margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 26.h),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// RoundButton(
// width: double.infinity,
// height: 46.h,
// text: S.of(context).querenchongzhi,
// textColor: Colors.white,
// fontSize: 14.sp,
// backgroup: Color(0xff32A060),
// fontWeight: FontWeight.bold,
// ),
// ],
// ),
// ),
// ),
],
),
),
),
Align(alignment: Alignment.bottomCenter,child:
Container(
height: 56.h,
color: Colors.white,
child: Row(
children: [
Expanded(child:Container(
padding:EdgeInsets.only(top: 7.h,left:16),
child:Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
S.of(context).heji,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
Text(
controller.text,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),
), ),
], ],
), ),
if(controller.text != "") Container(
Text.rich( width: double.infinity,
TextSpan( margin: EdgeInsets.only(
children: [ top: 16.h,
TextSpan( bottom: 4.h,
text: "充值", ),
style: TextStyle( padding: EdgeInsets.only(
fontSize:12.sp, top: 20.h,
fontWeight: MyFontWeight.regular, bottom: 20.h,
color: Color(0xFFADADAD), ),
), // decoration: BoxDecoration(
), // color: Colors.white,
TextSpan( // borderRadius: BorderRadius.circular(4),
text:"¥${controller.text}", // ),
style: TextStyle( child: Column(
fontSize: 12.sp, mainAxisAlignment: MainAxisAlignment.spaceAround,
fontWeight: MyFontWeight.regular, crossAxisAlignment: CrossAxisAlignment.start,
color:Color(0xff3541C9), children: [
), Padding(
), padding: EdgeInsets.only(bottom: 16.h),
TextSpan( child: Text(
text: "赠送", S.of(context).zhifufangshi,
style: TextStyle( style: TextStyle(
fontSize:12.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.regular, color: Colors.black,
color: Color(0xFFADADAD), fontWeight: FontWeight.bold,
), ),
), ),
TextSpan( ),
text:"${((double.tryParse(controller.text)??0) - ((double.tryParse(controller.text)??0) * (discount/100))).toStringAsFixed(2)}", GestureDetector(
style: TextStyle( onTap: () {
fontSize: 12.sp, setState(() {
fontWeight: MyFontWeight.regular, checkIndex = 1;
color: Color(0xff3541C9), });
), },
),TextSpan( child: Row(
text: "", mainAxisAlignment: MainAxisAlignment.start,
style: TextStyle( crossAxisAlignment: CrossAxisAlignment.start,
fontSize:12.sp, children: [
fontWeight: MyFontWeight.regular, Image.asset("assets/image/icon_we_chat.webp"),
color: Color(0xFFADADAD), Expanded(
), flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).weixinzhifu,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
),
),
),
),
checkView(1),
],
), ),
], ),
), ],
), ),
),
], ],
))
), ),
GestureDetector( ),
onTap: () { ),
recharge(); Align(
}, alignment: Alignment.bottomCenter,
child: RoundButton( child: GestureDetector(
width: 103.w, onTap: (){
height: 54.h, recharge();
text: S.of(context).chongzhi, },
textColor: Colors.white, child: Container(
fontWeight: MyFontWeight.regular, height: 56.h,
backgroup: Color(0xFF32A060), width: double.infinity,
radius: 0, alignment: Alignment.center,
fontSize: 16.sp, decoration: BoxDecoration(
padding: EdgeInsets.symmetric(vertical: 5.h), color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(27),
),
margin: EdgeInsets.only(left: 16,right: 16,bottom: 21),
child: Text(
S.of(context).querenchongzhi,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
), ),
), ),
], ),
),
))
],
),
// Container(
// height: 56.h,
// color: Colors.white,
// child: Row(
// children: [
// Expanded(child:Container(
// padding:EdgeInsets.only(top: 7.h,left:16),
// child:Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// children: [
// Text(
// S.of(context).heji,
// style: TextStyle(
// fontSize: 14.sp,
// fontWeight: MyFontWeight.regular,
// color: Colors.black,
// ),
// ),
// Text(
// controller.text,
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.medium,
// color: Color(0xFF32A060),
// ),
// ),
// ],
// ),
// if(controller.text != "")
// Text.rich(
// TextSpan(
// children: [
// TextSpan(
// text: "充值",
// style: TextStyle(
// fontSize:12.sp,
// fontWeight: MyFontWeight.regular,
// color: Color(0xFFADADAD),
// ),
// ),
// TextSpan(
// text:"¥${controller.text}",
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// color:Color(0xff3541C9),
// ),
// ),
// TextSpan(
// text: "赠送",
// style: TextStyle(
// fontSize:12.sp,
// fontWeight: MyFontWeight.regular,
// color: Color(0xFFADADAD),
// ),
// ),
// TextSpan(
// text:"${((double.tryParse(controller.text)??0) - ((double.tryParse(controller.text)??0) * (discount/100))).toStringAsFixed(2)}",
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// color: Color(0xff3541C9),
// ),
// ),TextSpan(
// text: "",
// style: TextStyle(
// fontSize:12.sp,
// fontWeight: MyFontWeight.regular,
// color: Color(0xFFADADAD),
// ),
// ),
// ],
// ),
// ),
// ],
// ))
// ),
// GestureDetector(
// onTap: () {
// recharge();
// },
// child: RoundButton(
// width: 103.w,
// height: 54.h,
// text: S.of(context).chongzhi,
// textColor: Colors.white,
// fontWeight: MyFontWeight.regular,
// backgroup: Color(0xFF32A060),
// radius: 0,
// fontSize: 16.sp,
// padding: EdgeInsets.symmetric(vertical: 5.h),
// ),
// ),
// ],
// ),
// )
)
],
),
),
); );
} }
var checkIndex = 1; var checkIndex = 1;
Widget rechargeList() {
return 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),
);
},
);
}
Widget rechargeItem(RechargeList rechargeA,index) {
return Container(
child: Stack(
alignment: Alignment.bottomRight,
children: [
Container(
alignment: Alignment.center,
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,
children: [
Text(
"${AppUtils.calculateDouble(double.tryParse(rechargeA.rechargeMoney)??0)}",
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFF868686),
fontWeight: MyFontWeight.medium,
fontSize:18.sp,
),
),
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,
style: TextStyle(
color: Color(0xFF868686),
fontWeight: MyFontWeight.regular,
fontSize:10.sp,
),
),
],
),
),
if(selectIndex == index)
Image.asset(
"assets/image/recharge.png",
width: 20,
height:20,
),
],
));
}
Widget checkView(var index) { Widget checkView(var index) {
return Container( return Container(
padding: EdgeInsets.only(right: 16.w), padding: EdgeInsets.only(right: 16.w),
@ -375,30 +539,31 @@ class _RechargePage extends State<RechargePage> {
} }
recharge() async { recharge() async {
String money = controller.text; // String money = controller.text;
if (money == null || money == "") { // if (money == null || money == "") {
SmartDialog.showToast(S.of(context).qingshuruchongzhijine, // SmartDialog.showToast(S.of(context).qingshuruchongzhijine,
alignment: Alignment.center); // alignment: Alignment.center);
return; // return;
} // }
int amount = int.tryParse(money); // int amount = int.tryParse(money);
if (checkIndex == 1) { // if (checkIndex == 1) {
if (amount < 100) { // if (amount < 100) {
SmartDialog.showToast(S.of(context).chongzhizuixiaojine(100), // SmartDialog.showToast(S.of(context).chongzhizuixiaojine(100),
alignment: Alignment.center); // alignment: Alignment.center);
return; // return;
} // }
if(Platform.isAndroid){ if (Platform.isAndroid) {
if (!(await Min.isInitialize())) { if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调 // app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针 // getPackage空指针
// //
await Min.initialize(); await Min.initialize();
}} }
}
BaseData<dynamic> baseData = BaseData<dynamic> baseData = await apiService.recharge(
await apiService.recharge({"amount": amount, "rechargeType": 2}).catchError((error) {}); {"amount": 0,"rechargeActId":rechargeA[selectIndex].id, "rechargeType": 2}).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
WxPay wxPay = WxPay.fromJson(baseData.data); WxPay wxPay = WxPay.fromJson(baseData.data);
await registerWxApi( await registerWxApi(
@ -415,10 +580,9 @@ class _RechargePage extends State<RechargePage> {
timeStamp: int.tryParse(wxPay.timeStamp), timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign, sign: wxPay.sign,
); );
} } else {
else{
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
} }
} // }
} }

3
lib/retrofit/data/coupon.dart

@ -21,6 +21,7 @@ class Coupon {
String useEndTime; String useEndTime;
String promotionId; String promotionId;
bool centreDisplay; bool centreDisplay;
bool allProduct;
String tenantCode; String tenantCode;
String tenantName; String tenantName;
int isDelete; int isDelete;
@ -52,6 +53,7 @@ class Coupon {
..useEndTime = json['useEndTime'] as String ..useEndTime = json['useEndTime'] as String
..promotionId = json['promotionId'] as String ..promotionId = json['promotionId'] as String
..centreDisplay = json['centreDisplay'] as bool ..centreDisplay = json['centreDisplay'] as bool
..allProduct = json['allProduct'] as bool
..tenantCode = json['tenantCode'] as String ..tenantCode = json['tenantCode'] as String
..tenantName = json['tenantName'] as String ..tenantName = json['tenantName'] as String
..isDelete = json['isDelete'] as int ..isDelete = json['isDelete'] as int
@ -84,6 +86,7 @@ class Coupon {
'useEndTime': this.useEndTime, 'useEndTime': this.useEndTime,
'promotionId': this.promotionId, 'promotionId': this.promotionId,
'centreDisplay': this.centreDisplay, 'centreDisplay': this.centreDisplay,
'allProduct' : this.allProduct,
'tenantCode': this.tenantCode, 'tenantCode': this.tenantCode,
'tenantName': this.tenantName, 'tenantName': this.tenantName,
'isDelete': this.isDelete, 'isDelete': this.isDelete,

78
lib/retrofit/data/recharge_list.dart

@ -0,0 +1,78 @@
/// id : "1494622230208839681"
/// rechargeMoney : "100.00"
/// giftdMoney : "0.00"
/// gitfdCouponId : null
/// tenantCode : "admin"
/// createTime : "2022-03-23 10:53:37"
/// isDeleted : 0
/// rechargeType : 0
/// remark : "充充充"
class RechargeList {
RechargeList({
String id,
String rechargeMoney,
String giftdMoney,
dynamic gitfdCouponId,
String tenantCode,
String createTime,
int isDeleted,
int rechargeType,
String remark,}){
_id = id;
_rechargeMoney = rechargeMoney;
_giftdMoney = giftdMoney;
_gitfdCouponId = gitfdCouponId;
_tenantCode = tenantCode;
_createTime = createTime;
_isDeleted = isDeleted;
_rechargeType = rechargeType;
_remark = remark;
}
RechargeList.fromJson(dynamic json) {
_id = json['id'];
_rechargeMoney = json['rechargeMoney'];
_giftdMoney = json['giftdMoney'];
_gitfdCouponId = json['gitfdCouponId'];
_tenantCode = json['tenantCode'];
_createTime = json['createTime'];
_isDeleted = json['isDeleted'];
_rechargeType = json['rechargeType'];
_remark = json['remark'];
}
String _id;
String _rechargeMoney;
String _giftdMoney;
dynamic _gitfdCouponId;
String _tenantCode;
String _createTime;
int _isDeleted;
int _rechargeType;
String _remark;
String get id => _id;
String get rechargeMoney => _rechargeMoney;
String get giftdMoney => _giftdMoney;
dynamic get gitfdCouponId => _gitfdCouponId;
String get tenantCode => _tenantCode;
String get createTime => _createTime;
int get isDeleted => _isDeleted;
int get rechargeType => _rechargeType;
String get remark => _remark;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['rechargeMoney'] = _rechargeMoney;
map['giftdMoney'] = _giftdMoney;
map['gitfdCouponId'] = _gitfdCouponId;
map['tenantCode'] = _tenantCode;
map['createTime'] = _createTime;
map['isDeleted'] = _isDeleted;
map['rechargeType'] = _rechargeType;
map['remark'] = _remark;
return map;
}
}

23
lib/retrofit/retrofit_api.dart

@ -43,6 +43,7 @@ import 'data/message.dart';
import 'data/msg_stats.dart'; import 'data/msg_stats.dart';
import 'data/page.dart'; import 'data/page.dart';
import 'data/rank.dart'; import 'data/rank.dart';
import 'data/recharge_list.dart';
import 'data/second_card_list.dart'; import 'data/second_card_list.dart';
import 'data/sign_info.dart'; import 'data/sign_info.dart';
import 'data/social_info.dart'; import 'data/social_info.dart';
@ -57,14 +58,14 @@ import 'data/vip_rule_details.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/"; /// // const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; /// // const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const base_url = "http://192.168.10.236:8766/app/"; /// const base_url = "http://192.168.10.236:8776/app/"; ///
// const baseUrl = "http://192.168.10.236:8766/app/"; /// const baseUrl = "http://192.168.10.236:8776/app/"; ///
// const base_url = "http://192.168.10.37:8766/app/"; // const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";
@ -218,6 +219,10 @@ abstract class ApiService {
@POST("/wallet/recharge") @POST("/wallet/recharge")
Future<BaseData<dynamic>> recharge(@Body() Map<String, dynamic> param); Future<BaseData<dynamic>> recharge(@Body() Map<String, dynamic> param);
///
@GET("/wallet/rechargeAct")
Future<BaseData<List<RechargeList>>> rechargeAct();
/// ///
@GET("/coupon/receive?couponId={couponId}") @GET("/coupon/receive?couponId={couponId}")
Future<BaseData> receiveCoupon(@Path("couponId") String couponId); Future<BaseData> receiveCoupon(@Path("couponId") String couponId);
@ -380,9 +385,9 @@ abstract class ApiService {
@Path("shipperCode") String shipperCode, @Path("shipperCode") String shipperCode,
@Path("logisticCode") String logisticCode); @Path("logisticCode") String logisticCode);
/// // ///
@POST("/other/report") // @POST("/other/report")
Future<BaseData<bool>> report(@Body() Map<String, String> map); // Future<BaseData<dynamic>> report(@Body() Map<String, String> map);
/// ///
@GET("/order/cancel/{id}") @GET("/order/cancel/{id}")
@ -512,4 +517,8 @@ abstract class ApiService {
@GET("/member/deleteMine") @GET("/member/deleteMine")
Future<BaseData> deleteMine(); Future<BaseData> deleteMine();
////
@POST("/information/complaint")
Future<BaseData> complaint(@Body() Map<String, dynamic> param);
} }

104
lib/retrofit/retrofit_api.g.dart

@ -298,6 +298,27 @@ class _ApiService implements ApiService {
return value; return value;
} }
@override
Future<BaseData<List<RechargeList>>> rechargeAct() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/wallet/rechargeAct',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<RechargeList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<RechargeList>((i) => RechargeList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override @override
Future<BaseData<dynamic>> receiveCoupon(couponId) async { Future<BaseData<dynamic>> receiveCoupon(couponId) async {
ArgumentError.checkNotNull(couponId, 'couponId'); ArgumentError.checkNotNull(couponId, 'couponId');
@ -1166,27 +1187,27 @@ class _ApiService implements ApiService {
return value; return value;
} }
@override // @override
Future<BaseData<bool>> report(map) async { // Future<BaseData<dynamic>> report(map) async {
ArgumentError.checkNotNull(map, 'map'); // ArgumentError.checkNotNull(map, 'map');
const _extra = <String, dynamic>{}; // const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; // final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; // final _data = <String, dynamic>{};
_data.addAll(map ?? <String, dynamic>{}); // _data.addAll(map ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/other/report', // final _result = await _dio.request<Map<String, dynamic>>('/other/report',
queryParameters: queryParameters, // queryParameters: queryParameters,
options: RequestOptions( // options: RequestOptions(
method: 'POST', // method: 'POST',
headers: <String, dynamic>{}, // headers: <String, dynamic>{},
extra: _extra, // extra: _extra,
baseUrl: baseUrl), // baseUrl: baseUrl),
data: _data); // data: _data);
final value = BaseData<bool>.fromJson( // final value = BaseData<dynamic>.fromJson(
_result.data, // _result.data,
(json) => json as bool, // (json) => json as bool,
); // );
return value; // return value;
} // }
@override @override
Future<BaseData<dynamic>> orderCancel(id) async { Future<BaseData<dynamic>> orderCancel(id) async {
@ -1837,7 +1858,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/coupon/detail/', final _result = await _dio.request<Map<String, dynamic>>('coupon/detail/',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',
@ -1858,8 +1879,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>( final _result = await _dio.request<Map<String, dynamic>>('/member/detail/$id',
'/member/detail/$id',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',
@ -1869,17 +1889,19 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<MemberInfor>.fromJson( final value = BaseData<MemberInfor>.fromJson(
_result.data, _result.data,
(json) => MemberInfor.fromJson(json), (json) => MemberInfor.fromJson(json),
); );
return value; return value;
} }
@override @override
Future<BaseData<ActivityPos>> appPopup() async { Future<BaseData<ActivityPos>> appPopup() async {
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/home/appPopup', final _result = await _dio.request<Map<String, dynamic>>(
'/home/appPopup',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',
@ -1889,7 +1911,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<ActivityPos>.fromJson( final value = BaseData<ActivityPos>.fromJson(
_result.data, _result.data,
(json) => ActivityPos.fromJson(json), (json) => ActivityPos.fromJson(json),
); );
return value; return value;
} }
@ -1899,8 +1921,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>( final _result = await _dio.request<Map<String, dynamic>>('/member/deleteMine',
'/member/deleteMine',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',
@ -1910,8 +1931,31 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<dynamic>> complaint(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/information/complaint',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
); );
return value; return value;
} }
} }

22
lib/setting/help_feedback_page.dart

@ -140,6 +140,10 @@ class _HelpFeedbackPage extends State<HelpFeedbackPage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
if(phoneController.text == ""){
SmartDialog.showToast("请输入有效手机号码", alignment: Alignment.center);
return;
}
report(); report();
}, },
child: Container( child: Container(
@ -162,17 +166,23 @@ class _HelpFeedbackPage extends State<HelpFeedbackPage> {
} }
report() async { report() async {
var content = editingController.text; if (apiService == null) {
var phone = phoneController.text; SharedPreferences value = await SharedPreferences.getInstance();
BaseData baseData = await apiService.report({ apiService = ApiService(
"mobile": phone, Dio(),
"reportContent": content, context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.complaint({
"content": phoneController.text,
"informationId":0,
}).catchError((onError) {}); }).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("反馈成功"); SmartDialog.showToast("反馈成功");
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
SmartDialog.showToast("反馈失败"); SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
} }
} }

14
lib/utils/flutter_utils.dart

@ -15,6 +15,20 @@ class AppUtils {
return "${numberFormat.format(mi / 1000)}"; return "${numberFormat.format(mi / 1000)}";
} }
static String trimEnd(String resString,String char){
while(resString.endsWith(char)){
resString = resString.substring(0,resString.length - 1);
}
return resString;
}
////
static String calculateDouble(double res){
String resString = res.toStringAsFixed(2);
resString = trimEnd(resString, "0");
resString = trimEnd(resString, ".");
return resString;
}
static Future<BMFCoordinate> coordConvert(BMFCoordinate latLng) async { static Future<BMFCoordinate> coordConvert(BMFCoordinate latLng) async {
return BMFCalculateUtils.coordConvert( return BMFCalculateUtils.coordConvert(

3
lib/view_widget/new_coupon_widget.dart

@ -120,7 +120,8 @@ class NewCouponWidget extends StatelessWidget {
children: [ children: [
Visibility( Visibility(
child: Text( child: Text(
S.of(context).quanchangtongyong, // S.of(context).quanchangtongyong,
(coupon?.allProduct ?? false) ? S.of(context).quanchangtongyong :"",
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), color: Color(0xFF353535),
fontSize: 12.sp, fontSize: 12.sp,

Loading…
Cancel
Save