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 {
/// .so
abiFilters 'armeabi-v7a'
abiFilters 'armeabi-v7a','arm64-v8a','x86'
}
}
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 = [
"关注",
"推荐",
"头条",
"课程",
"关于我们",
"分享健康",
"了解健康",
"学习健康",
"关于回乡",
// "直播",
];
@ -94,16 +94,16 @@ class _CommunityPage extends State<CommunityPage>
child: TabBarView(
physics: BouncingScrollPhysics(),
children: lables.map((e) {
if (e == "关于我们") {
if (e == "关于回乡") {
return BrandPage();
}else if(e == "头条"){
}else if(e == "了解健康"){
return ArticlePage();
}else if(e == "课程"){
}else if(e == "学习健康"){
return CommunityCourse();
}
else if(e == "推荐"){
else if(e == "分享健康"){
if (tuijian == null){
tuijian = CommunityChildPage("推荐");
tuijian = CommunityChildPage("分享健康");
}
return tuijian;
}else if(e == "关注"){

123
lib/community/community_view/community_dynamic.dart

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

254
lib/community/report/report_page.dart

@ -1,13 +1,16 @@
import 'dart:ui';
import 'package:dio/dio.dart';
import 'package:flutter/material.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/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
class ReportPage extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -24,10 +27,35 @@ class _ReportPage extends State<ReportPage> {
ApiService apiService;
int textLength = 0;
final TextEditingController editingController = TextEditingController();
String textCon;
String userName;
String authorId;
@override
void 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
@ -67,7 +95,7 @@ class _ReportPage extends State<ReportPage> {
),
),
TextSpan(
text: "@百花谷",
text: "@${userName.toString()}",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
@ -86,41 +114,42 @@ class _ReportPage extends State<ReportPage> {
),
),
),
report(),
reportContent(),
SizedBox(height: 12),
Container(
width: double.infinity,
height: 186.h,
margin: EdgeInsets.only(right: 16,left:40,bottom:100),
decoration: new BoxDecoration(
color: Color(0xFFF7F7F7),
borderRadius: BorderRadius.circular(4.0),
),
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),
),
if (checkIndex == 9)
Container(
width: double.infinity,
height: 186.h,
margin:
EdgeInsets.only(right: 16, left: 40, bottom: 100),
decoration: new BoxDecoration(
color: Color(0xFFF7F7F7),
borderRadius: BorderRadius.circular(4.0),
),
),
)
)
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,
child: Container(
width: double.infinity,
height:95,
height: 95,
child: Column(
children: [
GestureDetector(
@ -138,7 +167,7 @@ class _ReportPage extends State<ReportPage> {
},
child: Container(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(bottom:25),
margin: EdgeInsets.only(bottom: 25),
child: Text(
"投诉须知",
style: TextStyle(
@ -148,15 +177,20 @@ class _ReportPage extends State<ReportPage> {
),
),
)),
Expanded(child:
GestureDetector(
onTap: (){
Navigator.of(context)
.pushNamed('/router/report_success');
},
child: Container(
Expanded(
child: GestureDetector(
onTap: () {
if(checkIndex == 9 && editingController.text == ""){
SmartDialog.showToast("请输入举报原因", alignment: Alignment.center);
return;
}
report();
},
child: Opacity(
opacity: checkIndex == 0 ? 0.3 : 0.9,
child: Container(
width: double.infinity,
height:double.infinity,
height: double.infinity,
color: Color(0xFF319E5F),
alignment: Alignment.center,
child: Text(
@ -167,7 +201,9 @@ class _ReportPage extends State<ReportPage> {
color: Color(0xFFFFFFFF),
),
),
),))
),
),
))
],
),
))
@ -177,55 +213,95 @@ class _ReportPage extends State<ReportPage> {
);
}
Widget report() {
Widget reportContent() {
return Container(
padding: EdgeInsets.only(left: 16, right: 16),
child:
// (articles == null || articles.length == 0)
// ? 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(
width: double.infinity,
padding: EdgeInsets.only(left: 16, right: 16, top: 20),
child: Column(
children: [
Image.asset(
"assets/image/icon_radio_unselected.webp",
width: 16,
height: 16,
content("色情低俗", 1),
SizedBox(
height: 18,
),
content("政治宗教", 2),
SizedBox(
width: 8,
height: 18,
),
Expanded(
child: Text(
"色情低俗",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular),
))
content("广告骚扰", 3),
SizedBox(
height: 18,
),
content("虚假欺骗", 4),
SizedBox(
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("积分的计算说明"),
"jifendidaogao" : MessageLookupByLibrary.simpleMessage("积分从低到高"),
"jifengaodaodi" : MessageLookupByLibrary.simpleMessage("积分从高到低"),
"jifenshangcheng" : MessageLookupByLibrary.simpleMessage("积分商城"),
"jifenshangcheng" : MessageLookupByLibrary.simpleMessage("净弼积分商城"),
"jifenxiangqing" : MessageLookupByLibrary.simpleMessage("积分详情"),
"jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("净弼联盟会员店"),
"jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"),

2
lib/generated/intl/messages_zh_CN.dart

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

2
lib/generated/intl/messages_zh_TW.dart

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

4
lib/generated/l10n.dart

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

2
lib/l10n/intl_en.arb

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

2
lib/l10n/intl_zh_CN.arb

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

2
lib/l10n/intl_zh_Hans_CN.arb

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

2
lib/l10n/intl_zh_Hant_CN.arb

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

2
lib/l10n/intl_zh_TW.arb

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

42
lib/main.dart

@ -116,7 +116,7 @@ void main() async {
locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH');
}
ImgCachePath();
initSdk();
// initSdk();
bool isFirst = sharedPreferences.getBool("isFirst");
runApp(MyApp(locale, isFirst));
@ -127,47 +127,7 @@ void main() async {
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);

56
lib/main_page.dart

@ -2,6 +2,8 @@ import 'dart:convert';
import 'dart:io';
import 'package:dio/dio.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_svg/flutter_svg.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:permission_handler/permission_handler.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 'community/order_page.dart';
@ -81,6 +86,9 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
..userInteractions = false
..dismissOnTap = false;
initSdk();
pushRoute();
String invite = "";
@ -130,11 +138,53 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
});
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) {
xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler(
MyNativeEventHandler(
(String title, String message, String customContent, int type) {
(String title, String message, String customContent, int type) {
print("xgPushClickAction2: $customContent");
SharedPreferences.getInstance().then((value) {
value.setString("pushData", customContent);
@ -151,7 +201,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
if (Platform.isAndroid
? (event["actionType"] == 0)
: (event["xg"]["msgtype"] == 1) &&
event[Platform.isAndroid ? "customMessage" : "custom"] != null) {
event[Platform.isAndroid ? "customMessage" : "custom"] != null) {
SharedPreferences.getInstance().then((value) {
value.setString("pushData",
event[Platform.isAndroid ? "customMessage" : "custom"]);
@ -307,7 +357,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
// bottomNavigationBigItem(S.of(context).pinpai, 0),
bottomNavigationItem(S.of(context).main_menu1, 0),
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),
],
),

16
lib/message/system_details.dart

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

19
lib/mine/mine_view/mine_item.dart

@ -157,16 +157,15 @@ class _MineItem extends State<MineItem> {
),
),),
///
// Expanded(child: InkWell(
// onTap: () {
// showCallMobile();
// },
// child: mineItem(
// "联系客服",
// "assets/image/icon_mine_online_service.png",
// ),
// ),),
Expanded(child:Container()),
Expanded(child: InkWell(
onTap: () {
showCallMobile();
},
child: mineItem(
"联系客服",
"assets/image/icon_mine_online_service.webp",
),
),),
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)
? 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(
child: Row(
children: [
Expanded(
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:huixiang/generated/l10n.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_rule_details.dart';
import 'package:huixiang/retrofit/data/wx_pay.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/min.dart';
import 'package:huixiang/view_widget/item_input_widget.dart';
@ -35,6 +38,10 @@ class _RechargePage extends State<RechargePage> {
List<VipBenefitList> vipBenefitList = [];
Color color = Colors.black;
double discount = 100;
List<RechargeList> rechargeA;
int selectIndex = 0;
UserInfo userInfo;
dynamic mBalance;
@override
void initState() {
@ -45,11 +52,13 @@ class _RechargePage extends State<RechargePage> {
context: context, token: value.getString("token"), pay: true);
queryBenefitList();
queryRuleDetails();
queryRechargeList();
queryUserBalance();
});
weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
if(event.errCode == 0){
Navigator.of(context).pop();
if (event.errCode == 0) {
queryUserBalance();
SmartDialog.showToast("充值成功", alignment: Alignment.center);
}
// else{
@ -59,29 +68,40 @@ class _RechargePage extends State<RechargePage> {
});
}
///
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) {
setState(() {
vipBenefitList.clear();
vipBenefitList.addAll(baseData.data);
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);
}
});
});
}
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 {
BaseData<VipRuleDetails> baseData =
await apiService.vipBenefit().catchError((onError) {});
await apiService.vipBenefit().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
vipRuleDetails = baseData.data;
@ -90,6 +110,25 @@ class _RechargePage extends State<RechargePage> {
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
Widget build(BuildContext context) {
return Scaffold(
@ -100,266 +139,391 @@ class _RechargePage extends State<RechargePage> {
background: Color(0xFFFFFFFF),
leadingColor: Colors.black,
),
body:Stack(
children: [
SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
child: Column(
children: [
Container(
child: Column(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(() {});
},
),
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,
body: Container(
color: Color(0xFFFFFFFF),
child: Stack(
children: [
SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: 16, right: 16),
child: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
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: EdgeInsets.only(bottom: 16.h),
padding: EdgeInsets.only(top: 26, bottom: 28),
child: Text(
S.of(context).zhifufangshi,
S.of(context).chongzhi,
style: TextStyle(
fontSize: 16.sp,
color: Colors.black,
fontWeight: FontWeight.bold,
),
fontSize: 28.sp,
color: Color(0xFF181818),
fontWeight: MyFontWeight.semi_bold),
),
),
GestureDetector(
onTap: () {
setState(() {
checkIndex = 1;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset("assets/image/icon_we_chat.webp"),
Row(
children: [
Expanded(
child: Text(
S.of(context).zhanghuyue,
style: TextStyle(
fontSize: 15.sp,
color: Color(0xFF181818),
fontWeight: MyFontWeight.semi_bold),
)),
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(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).weixinzhifu,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
),
child: Container(
color: Colors.white,
child: Html(
data: "注意:${vipRuleDetails?.recharge ?? ""}",
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
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 != "")
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: "赠送",
Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 16.h,
bottom: 4.h,
),
padding: EdgeInsets.only(
top: 20.h,
bottom: 20.h,
),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(4),
// ),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 16.h),
child: Text(
S.of(context).zhifufangshi,
style: TextStyle(
fontSize:12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFADADAD),
fontSize: 16.sp,
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
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: () {
setState(() {
checkIndex = 1;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset("assets/image/icon_we_chat.webp"),
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();
},
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),
),
),
Align(
alignment: Alignment.bottomCenter,
child: GestureDetector(
onTap: (){
recharge();
},
child: Container(
height: 56.h,
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
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;
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) {
return Container(
padding: EdgeInsets.only(right: 16.w),
@ -375,30 +539,31 @@ class _RechargePage extends State<RechargePage> {
}
recharge() async {
String money = controller.text;
if (money == null || money == "") {
SmartDialog.showToast(S.of(context).qingshuruchongzhijine,
alignment: Alignment.center);
return;
}
int amount = int.tryParse(money);
if (checkIndex == 1) {
if (amount < 100) {
SmartDialog.showToast(S.of(context).chongzhizuixiaojine(100),
alignment: Alignment.center);
return;
}
// String money = controller.text;
// if (money == null || money == "") {
// SmartDialog.showToast(S.of(context).qingshuruchongzhijine,
// alignment: Alignment.center);
// return;
// }
// int amount = int.tryParse(money);
// if (checkIndex == 1) {
// if (amount < 100) {
// SmartDialog.showToast(S.of(context).chongzhizuixiaojine(100),
// alignment: Alignment.center);
// return;
// }
if(Platform.isAndroid){
if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针
//
await Min.initialize();
}}
if (Platform.isAndroid) {
if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针
//
await Min.initialize();
}
}
BaseData<dynamic> baseData =
await apiService.recharge({"amount": amount, "rechargeType": 2}).catchError((error) {});
BaseData<dynamic> baseData = await apiService.recharge(
{"amount": 0,"rechargeActId":rechargeA[selectIndex].id, "rechargeType": 2}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
WxPay wxPay = WxPay.fromJson(baseData.data);
await registerWxApi(
@ -415,10 +580,9 @@ class _RechargePage extends State<RechargePage> {
timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign,
);
}
else{
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
}
// }
}

3
lib/retrofit/data/coupon.dart

@ -21,6 +21,7 @@ class Coupon {
String useEndTime;
String promotionId;
bool centreDisplay;
bool allProduct;
String tenantCode;
String tenantName;
int isDelete;
@ -52,6 +53,7 @@ class Coupon {
..useEndTime = json['useEndTime'] as String
..promotionId = json['promotionId'] as String
..centreDisplay = json['centreDisplay'] as bool
..allProduct = json['allProduct'] as bool
..tenantCode = json['tenantCode'] as String
..tenantName = json['tenantName'] as String
..isDelete = json['isDelete'] as int
@ -84,6 +86,7 @@ class Coupon {
'useEndTime': this.useEndTime,
'promotionId': this.promotionId,
'centreDisplay': this.centreDisplay,
'allProduct' : this.allProduct,
'tenantCode': this.tenantCode,
'tenantName': this.tenantName,
'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/page.dart';
import 'data/rank.dart';
import 'data/recharge_list.dart';
import 'data/second_card_list.dart';
import 'data/sign_info.dart';
import 'data/social_info.dart';
@ -57,14 +58,14 @@ import 'data/vip_rule_details.dart';
part 'retrofit_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
const baseUrl = "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 base_url = "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 baseUrl = "http://192.168.10.236:8766/app/"; ///
const base_url = "http://192.168.10.236:8776/app/"; ///
const baseUrl = "http://192.168.10.236:8776/app/"; ///
// const base_url = "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")
Future<BaseData<dynamic>> recharge(@Body() Map<String, dynamic> param);
///
@GET("/wallet/rechargeAct")
Future<BaseData<List<RechargeList>>> rechargeAct();
///
@GET("/coupon/receive?couponId={couponId}")
Future<BaseData> receiveCoupon(@Path("couponId") String couponId);
@ -380,9 +385,9 @@ abstract class ApiService {
@Path("shipperCode") String shipperCode,
@Path("logisticCode") String logisticCode);
///
@POST("/other/report")
Future<BaseData<bool>> report(@Body() Map<String, String> map);
// ///
// @POST("/other/report")
// Future<BaseData<dynamic>> report(@Body() Map<String, String> map);
///
@GET("/order/cancel/{id}")
@ -512,4 +517,8 @@ abstract class ApiService {
@GET("/member/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;
}
@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
Future<BaseData<dynamic>> receiveCoupon(couponId) async {
ArgumentError.checkNotNull(couponId, 'couponId');
@ -1166,27 +1187,27 @@ class _ApiService implements ApiService {
return value;
}
@override
Future<BaseData<bool>> report(map) async {
ArgumentError.checkNotNull(map, 'map');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(map ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/other/report',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<bool>.fromJson(
_result.data,
(json) => json as bool,
);
return value;
}
// @override
// Future<BaseData<dynamic>> report(map) async {
// ArgumentError.checkNotNull(map, 'map');
// const _extra = <String, dynamic>{};
// final queryParameters = <String, dynamic>{};
// final _data = <String, dynamic>{};
// _data.addAll(map ?? <String, dynamic>{});
// final _result = await _dio.request<Map<String, dynamic>>('/other/report',
// 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 bool,
// );
// return value;
// }
@override
Future<BaseData<dynamic>> orderCancel(id) async {
@ -1837,7 +1858,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{};
final queryParameters = <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,
options: RequestOptions(
method: 'GET',
@ -1858,8 +1879,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/member/detail/$id',
final _result = await _dio.request<Map<String, dynamic>>('/member/detail/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
@ -1869,17 +1889,19 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<MemberInfor>.fromJson(
_result.data,
(json) => MemberInfor.fromJson(json),
(json) => MemberInfor.fromJson(json),
);
return value;
}
@override
Future<BaseData<ActivityPos>> appPopup() async {
const _extra = <String, dynamic>{};
final queryParameters = <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,
options: RequestOptions(
method: 'GET',
@ -1889,7 +1911,7 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<ActivityPos>.fromJson(
_result.data,
(json) => ActivityPos.fromJson(json),
(json) => ActivityPos.fromJson(json),
);
return value;
}
@ -1899,8 +1921,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/member/deleteMine',
final _result = await _dio.request<Map<String, dynamic>>('/member/deleteMine',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
@ -1910,8 +1931,31 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<dynamic>.fromJson(
_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;
}
}

22
lib/setting/help_feedback_page.dart

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

3
lib/view_widget/new_coupon_widget.dart

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

Loading…
Cancel
Save