Browse Source

Merge branch 'remove_uniapp' into new_revision_app

# Conflicts:
#	lib/community/community_child_page.dart
#	lib/community/community_page.dart
#	lib/home/home_view/home_banner.dart
#	lib/main_page.dart
#	lib/mine/mine_view/mine_view.dart
#	lib/mine/recharge_page.dart
#	lib/order/order_detail_page.dart
#	lib/retrofit/min_api.dart
#	lib/retrofit/retrofit_api.dart
#	lib/settlement/settlement.dart
#	lib/store/store_order.dart
#	lib/store/store_view/product_sku.dart
zyh
w-R 3 years ago
parent
commit
bb580cbaa7
  1. 12
      ios/Runner.xcodeproj/project.pbxproj
  2. 51
      lib/community/community_child_page.dart
  3. 2
      lib/community/community_course.dart
  4. 6
      lib/community/community_page.dart
  5. 43
      lib/community/community_view/community_dynamic.dart
  6. 28
      lib/community/community_view/home_class.dart
  7. 14
      lib/community/headlines/article_list.dart
  8. 8
      lib/community/release_dynamic.dart
  9. 4
      lib/home/guide_page.dart
  10. 6
      lib/home/huixiang_view/huixiang_banner.dart
  11. 18
      lib/login/login_page.dart
  12. 48
      lib/main_page.dart
  13. 172
      lib/mine/personal_page.dart
  14. 4
      lib/mine/recharge_page.dart
  15. 15
      lib/order/order_detail_page.dart
  16. 1
      lib/order/order_view/order_info.dart
  17. 58
      lib/retrofit/data/app_update.dart
  18. 11
      lib/retrofit/retrofit_api.dart
  19. 23
      lib/retrofit/retrofit_api.g.dart
  20. 15
      lib/setting/about_page.dart
  21. 5
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  22. 6
      lib/settlement/settlement_view/pay_method.dart
  23. 5
      lib/settlement/settlement_view/settlement_order_commodity.dart
  24. 17
      lib/store/store_order.dart
  25. 1
      lib/store/store_view/shop_goods.dart
  26. 4
      lib/store/store_view/store_info.dart
  27. 8
      lib/union/union_view/union_coupon.dart
  28. 13
      lib/utils/flutter_utils.dart
  29. 11
      lib/view_widget/tips_dialog.dart
  30. 50
      lib/view_widget/update_dialog.dart
  31. 37
      lib/web/web_view/comment_list.dart
  32. 2
      pubspec.yaml

12
ios/Runner.xcodeproj/project.pbxproj

@ -616,7 +616,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 87;
CURRENT_PROJECT_VERSION = 93;
DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@ -666,7 +666,7 @@
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 1.0.87;
MARKETING_VERSION = 1.0.93;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
@ -816,7 +816,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 87;
CURRENT_PROJECT_VERSION = 93;
DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@ -866,7 +866,7 @@
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 1.0.87;
MARKETING_VERSION = 1.0.93;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
@ -907,7 +907,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 87;
CURRENT_PROJECT_VERSION = 93;
DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@ -957,7 +957,7 @@
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 1.0.87;
MARKETING_VERSION = 1.0.93;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",

51
lib/community/community_child_page.dart

@ -34,8 +34,9 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe
int pageNum = 1;
String userId;
bool isLoadMore = false;
bool isRefresh = true;
bool isLoadingData = false;
ScrollController sc = ScrollController();
List<Article> articles = [];
@override
@ -52,7 +53,15 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe
}
///
queryCommunity() async {
queryCommunity(String searchKey) async {
if(!isRefresh){
isRefresh = true;
return;
}
if(isLoadingData){
return;
}
isLoadingData = true;
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
userId = value.getString('userId');
@ -60,28 +69,53 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe
Dio(),
context: context,
token: value.getString("token"),
showLoading: false
);
}
if(isLoadMore){
pageNum += 1;
isLoadMore = false;
}
else pageNum = 1;
else if(searchKey == null)pageNum = 1;
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({
"mid":"",
"onlyFollow": widget.typeStr == "关注" ? true : false,
"onlyMe": false,
"pageNum": pageNum,
"pageNum": searchKey == null?pageNum:1,
"pageSize": 10,
"searchKey": ""
"searchKey": searchKey??""
}).catchError((error) {
if(searchKey == null) {
refreshController.refreshFailed();
refreshController.loadFailed();
}
});
if(searchKey == null) {
refreshController.refreshCompleted();
refreshController.loadComplete();
}
if (baseData.isSuccess) {
if(searchKey != null){
if(baseData?.data?.list != null && baseData.data.list.isNotEmpty)
articles.forEach((element) {
if(element.id == searchKey){
element.content = jsonEncode(baseData.data.list[0].subjectInfo);
element.mainTitle =baseData.data.list[0].subject;
element.followed = baseData.data.list[0].selfFollow;
element.authorHeadImg = baseData.data.list[0].memberInfo?.avatar;
element.authorName = baseData.data.list[0].memberInfo?.nickname;
element.location = baseData.data.list[0].location;
element.createTime = baseData.data.list[0].createTime;
element.author = baseData.data.list[0].memberInfo?.mid;
element.viewers = baseData.data.list[0]?.viewers;
element.likes = baseData.data.list[0]?.likes;
element.comments = baseData.data.list[0]?.comments;
this.isRefresh = false;
setState(() {
});
}
});
}else{
if (pageNum == 1) {
articles.clear();
}
@ -109,11 +143,14 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe
}
}
isLoadingData = false;
}
@override
Widget build(BuildContext context) {
super.build(context);
return FutureBuilder(
future: queryCommunity(),
future: queryCommunity(null),
builder: (context, position) {
return SmartRefresher(
controller: refreshController,

2
lib/community/community_course.dart

@ -253,7 +253,7 @@ class _CommunityCourse extends State<CommunityCourse>
///banner
CourseBanner(bannerData,),
SizedBox(height: 28),
SizedBox(height: 28.h),
///
HomeClass(collectMap,collectList,),

6
lib/community/community_page.dart

@ -80,7 +80,7 @@ class _CommunityPage extends State<CommunityPage>
leading: false,
titleChild: PreferredSize(
preferredSize: Size(
MediaQuery.of(context).size.width - 60,
MediaQuery.of(context).size.width - 60.w,
38.h,
),
child: TabBar(
@ -92,12 +92,12 @@ class _CommunityPage extends State<CommunityPage>
labelPadding: EdgeInsets.only(left: 8.w, right: 8.w),
indicatorSize: TabBarIndicatorSize.label,
unselectedLabelStyle: TextStyle(
fontSize: 15.sp,
fontSize: MediaQuery.of(context).size.width >= 650 ? 10.sp : 15.sp,
fontWeight: FontWeight.w400,
),
labelStyle: TextStyle(
color: Colors.black,
fontSize: 18.sp,
fontSize: MediaQuery.of(context).size.width >= 650 ? 12.sp : 18.sp,
fontWeight: FontWeight.bold,
),
labelColor: Colors.black,

43
lib/community/community_view/community_dynamic.dart

@ -159,10 +159,10 @@ class _CommunityDynamic extends State<CommunityDynamic> {
return Column(
children: [
Container(
margin: EdgeInsets.only(top: 2),
margin: EdgeInsets.only(top: 2.h),
key: globalKey,
alignment: Alignment.topCenter,
padding: EdgeInsets.only(left: 16,top: 16,right: 16),
padding: EdgeInsets.only(left: 16.w,top: 16.h,right: 16.w),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
@ -184,7 +184,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
height: 44,
// height: 44.h,
child: Row(
children: [
GestureDetector(
@ -213,7 +213,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
),
),
SizedBox(
width: 8,
width: 8.w,
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -222,7 +222,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
Text(
widget?.article?.authorName ?? "",
style: TextStyle(
fontSize: 15.sp,
fontSize: MediaQuery.of(context).size.width >= 650 ? 12.sp :15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF1A1A1A),
),
@ -230,7 +230,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
Text(
widget?.article?.createTime ?? "",
style: TextStyle(
fontSize: 13.sp,
fontSize: MediaQuery.of(context).size.width >= 650 ? 10.sp :13.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF808080),
),
@ -317,7 +317,8 @@ class _CommunityDynamic extends State<CommunityDynamic> {
height:8.h,
),
if (widget.article.location != "")
Row(
Padding(padding:EdgeInsets.only(bottom:7),
child: Row(
children: [
Icon(
Icons.place,
@ -339,7 +340,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
),
)),
],
),
),),
if (!widget.isDetails)
SizedBox(
height: 5.h,
@ -353,7 +354,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
children: [
Expanded(
child: Container(
padding: EdgeInsets.only(bottom: 16),
padding: EdgeInsets.only(bottom: 16.h),
child:Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
@ -364,7 +365,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
height: 16,
),
SizedBox(
width: 5,
width: 5.w,
),
Text(
(widget.article != null)
@ -381,7 +382,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
),
Expanded(
child:Container(
padding: EdgeInsets.only(bottom: 16),
padding: EdgeInsets.only(bottom: 16.h),
child:Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
@ -392,7 +393,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
height: 16,
),
SizedBox(
width: 5,
width: 5.w,
),
Text(
"${widget.article.comments ?? 0}",
@ -406,7 +407,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
))),
Expanded(
child:Container(
padding: EdgeInsets.only(bottom: 16),
padding: EdgeInsets.only(bottom: 16.h),
child:Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
@ -417,7 +418,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
height: 16,
),
SizedBox(
width: 5,
width: 5.w,
),
Text(
"${widget.article.likes ?? 0}",
@ -440,7 +441,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
});
},
child: Container(
padding: EdgeInsets.only(top:3,bottom: 16),
padding: EdgeInsets.only(top:3.h,bottom: 16.h),
alignment: Alignment.center,
// color: Colors.red,
child: Icon(
@ -454,7 +455,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
),
),
Container(
height: 16,
height: 16.h,
color: Color(0xFFF7F7F7),
),
],
@ -789,7 +790,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
child: Column(
children: [
SizedBox(
height: 10,
height: 10.h,
),
GestureDetector(
onTap: () {
@ -802,7 +803,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
child: Row(
children: [
SizedBox(
width: 4,
width: 4.w,
),
Image.asset(
"assets/image/icon_share.webp",
@ -812,7 +813,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
color: Color(0xff515151),
),
SizedBox(
width: 12,
width: 12.w,
),
Text(
S.of(context).fenxiang,
@ -843,7 +844,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
child: Row(
children: [
SizedBox(
width: 4,
width: 4.w,
),
SvgPicture.asset(
"assets/svg/ju_b.svg",
@ -851,7 +852,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
height: 20,
),
SizedBox(
width: 15,
width: 15.w,
),
Text(
S.of(context).jubaogaineirong,

28
lib/community/community_view/home_class.dart

@ -48,7 +48,7 @@ class _HomeClass extends State<HomeClass> {
Widget collectItem(CollectClassList collectList) {
return Container(
width: 168,
width: 168.w,
// height: 250,
margin: EdgeInsets.symmetric(
horizontal: 6.w,
@ -58,7 +58,7 @@ class _HomeClass extends State<HomeClass> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 16, top: 5),
padding: EdgeInsets.only(left: 16.w, top: 5.h),
child: Text(
collectList.name,
style: TextStyle(
@ -70,11 +70,11 @@ class _HomeClass extends State<HomeClass> {
),
Container(
height: 195,
margin: EdgeInsets.only(top: 10),
margin: EdgeInsets.only(top: 10.h),
child: ListView.builder(
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.symmetric(horizontal: 10),
padding: EdgeInsets.symmetric(horizontal: 10.w),
itemCount: widget.collectMap[collectList.id] == null
? 0
: widget.collectMap[collectList.id].length,
@ -105,8 +105,8 @@ class _HomeClass extends State<HomeClass> {
Widget classItem(CourseList collect) {
return Container(
width: 168,
height: 195,
width: 168.w,
height: 195.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(4),
@ -122,7 +122,7 @@ class _HomeClass extends State<HomeClass> {
color: Colors.white,
),
margin: EdgeInsets.symmetric(
horizontal: 6,
horizontal: 6.w,
),
child: Column(
children: [
@ -154,7 +154,7 @@ class _HomeClass extends State<HomeClass> {
child: MImage(
collect.coverImg,
width: double.infinity,
height: 120,
height: 120.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
@ -179,7 +179,7 @@ class _HomeClass extends State<HomeClass> {
height: 16.h,
color: Colors.white,
),
SizedBox(width: 5),
SizedBox(width: 5.w),
Text(
collect.viewers.toString(),
style: TextStyle(
@ -190,7 +190,7 @@ class _HomeClass extends State<HomeClass> {
),
],
),
SizedBox(width: 8),
SizedBox(width: 8.w),
// Row(
// children: [
// Image.asset(
@ -219,8 +219,8 @@ class _HomeClass extends State<HomeClass> {
children: [
Spacer(),
Container(
margin: EdgeInsets.only(top: 8, right: 8),
padding: EdgeInsets.only(left: 2, right: 2),
margin: EdgeInsets.only(top: 8.h, right: 8.w),
padding: EdgeInsets.only(left: 2.w, right: 2.w),
height: 20.h,
alignment: Alignment.center,
decoration: BoxDecoration(
@ -245,7 +245,7 @@ class _HomeClass extends State<HomeClass> {
),
Expanded(
child: Container(
padding: EdgeInsets.all(8),
padding: EdgeInsets.all(8.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
@ -268,7 +268,7 @@ class _HomeClass extends State<HomeClass> {
),
],
),
SizedBox(height: 2),
SizedBox(height: 2.h),
Text(
"${S.of(context).jiangshi}:${collect.author.name}",
overflow: TextOverflow.ellipsis,

14
lib/community/headlines/article_list.dart

@ -38,13 +38,13 @@ class _ArticleList extends State<ArticleList> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top: 20, left: 16, right: 16),
margin: EdgeInsets.only(top: 20.h, left: 16.w, right: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Padding(
padding: EdgeInsets.only(bottom: 12),
padding: EdgeInsets.only(bottom: 12.h),
child: Text(
S.of(context).zuixinwenzhang,
overflow: TextOverflow.ellipsis,
@ -82,7 +82,7 @@ class _ArticleList extends State<ArticleList> {
return Container(
width: double.infinity,
padding: EdgeInsets.all(16),
margin: EdgeInsets.only(bottom: 12),
margin: EdgeInsets.only(bottom: 12.h),
color: Colors.white,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
@ -90,7 +90,7 @@ class _ArticleList extends State<ArticleList> {
children: [
Expanded(
child: Container(
height: 105,
height: MediaQuery.of(context).size.width >= 650 ? 133.h :105,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -105,11 +105,11 @@ class _ArticleList extends State<ArticleList> {
color: Colors.black,
),
),
SizedBox(height:5),
SizedBox(height:5.h),
Text(
widget?.articles[position]?.viceTitle ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 3,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
@ -132,7 +132,7 @@ class _ArticleList extends State<ArticleList> {
),
),
),
SizedBox(width: 8),
SizedBox(width: 8.w),
Image.asset(
"assets/image/browse.webp",
width: 14,

8
lib/community/release_dynamic.dart

@ -103,7 +103,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
fontSize: 14.sp,
color: Colors.red,
),
),
@ -117,8 +117,8 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Colors.black,
fontSize: 12.sp,
color: Color(0xFFB3B2B2),
),
),
)
@ -164,7 +164,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
SmartDialog.showToast("请输入您此刻的想法!");
return;
}
EasyLoading.show(status: S.of(context).zhengzaijiazai);
EasyLoading.show(status: "上传中");
fileUpload().then((value) async {
String subjectType = "text";

4
lib/home/guide_page.dart

@ -309,7 +309,7 @@ class _GuidePage extends State<GuidePage> {
fit: BoxFit.fill,
),
SizedBox(
height: 66.h,
height: MediaQuery.of(context).size.width >= 650 ? 20.h :66.h,
),
Container(
alignment: Alignment.center,
@ -323,7 +323,7 @@ class _GuidePage extends State<GuidePage> {
),
),
SizedBox(
height: 23.h,
height: MediaQuery.of(context).size.width >= 650 ? 15.h :23.h,
),
Padding(
padding: EdgeInsets.only(left: 52.w, right: 52.w),

6
lib/home/huixiang_view/huixiang_banner.dart

@ -83,11 +83,11 @@ class _HuiXiangBanner extends State<HuiXiangBanner> {
break;
case 4:
String router = bannerData.content;
// String router = "/router/store_order?{\"id\":\"1512378184161558528\",\"tenant\":\"1188\",\"storeName\":\"农场煮意\"}";
if (router.contains("?")) {
String params = router.substring(router.indexOf("?"));
params = params.replaceAll("?", "");
String params = router.substring(router.indexOf("?")+1);
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(router, arguments: map);
Navigator.of(context).pushNamed(router.substring(0,router.indexOf("?")), arguments: map);
} else {
Navigator.of(context).pushNamed(router);
}

18
lib/login/login_page.dart

@ -1066,7 +1066,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
context: context,
builder: (BuildContext context) {
return SimpleDialog(
titlePadding: EdgeInsets.all(10),
titlePadding: EdgeInsets.all(10.h),
backgroundColor: Colors.transparent,
elevation: 0,
shape: RoundedRectangleBorder(
@ -1079,7 +1079,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
Container(
alignment: Alignment.center,
width: double.infinity,
height: 305.h,
height: MediaQuery.of(context).size.width >= 650 ? 410.h :305.h,
padding: EdgeInsets.only(left: 16.w, right: 16.w),
decoration: new BoxDecoration(
color: Colors.white,
@ -1105,7 +1105,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
height: 1.3.h,
height: 1.2.h,
color: Color(0xff727272),
),
),
@ -1124,14 +1124,14 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
]),
),
SizedBox(
height: 10.h,
height: 5.h,
),
Text(
S.of(context).yinsizhengce2,
style: TextStyle(
color: Color(0xff727272),
fontSize: 14.sp,
height: 1.3.h,
height: 1.2.h,
fontWeight: MyFontWeight.medium,
),
),
@ -1155,8 +1155,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
margin: EdgeInsets.only(bottom: 20.h),
child: BorderText(
padding: EdgeInsets.only(
top: 10.h,
bottom: 10.h,
top: 5.h,
bottom: 5.h,
left: 36.w,
right: 36.w,
),
@ -1192,8 +1192,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
);
},
padding: EdgeInsets.only(
top: 10.h,
bottom: 10.h,
top: 5.h,
bottom: 5.h,
left: 21.5.w,
right: 21.5.w,
),

48
lib/main_page.dart

@ -5,12 +5,14 @@ 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_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:huixiang/community/community_page.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/home/home_page.dart';
import 'package:huixiang/main.dart';
import 'package:huixiang/mine/mine_page.dart';
import 'package:huixiang/retrofit/data/app_update.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
@ -18,8 +20,11 @@ import 'package:huixiang/union/union_page.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/utils/bridge.dart';
import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/native_event_handler.dart';
import 'package:huixiang/view_widget/update_dialog.dart';
import 'package:package_info/package_info.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:sharesdk_plugin/sharesdk_interface.dart';
@ -47,6 +52,8 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
final GlobalKey homePageKey = GlobalKey();
final GlobalKey minePageKey = GlobalKey();
// List<String> iconn;
ApiService apiService;
@override
void dispose() {
@ -74,7 +81,6 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
EasyLoading.instance
..indicatorType = EasyLoadingIndicatorType.circle
// ..indicatorType = EasyLoadingIndicatorType.wave
@ -139,6 +145,8 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
});
queryUserInfo();
appAutoUpdate();
}
final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin();
initSdk() async {
@ -320,6 +328,44 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
}
}
///app自动更新
appAutoUpdate() async {
SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null) {
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
PackageInfo packageInfo = await PackageInfo.fromPlatform();
BaseData<AppUpdate> baseData = await apiService.appVersion().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
baseData.data.appLastVersion = "1.0.4";
baseData.data.appLastVersionUp = "1.0.1";
if(AppUtils.versionCompare(packageInfo.version,baseData.data?.appLastVersion)
&& AppUtils.versionCompare(value.getString("appLastVersion")??"1.0.0",baseData.data?.appLastVersion)){
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return WillPopScope(
child:UpdateDialog(packageInfo.version,baseData.data),
onWillPop: () async {
return Future.value(false);
});
},
);
}else{
return;
}
}else{
SmartDialog.showToast(baseData.msg,
alignment: Alignment.center);
Navigator.of(context).pop();
}
}
final PageController pageController = PageController(initialPage: 0);
@override

172
lib/mine/personal_page.dart

@ -30,6 +30,7 @@ class PersonalPage extends StatefulWidget {
final Map<String, dynamic> arguments;
PersonalPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _PersonalPage();
@ -47,10 +48,10 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
MemberInfor memberInfor;
String filePath;
bool isLoadMore = false;
bool isRefresh = true;
bool isLoadingData = false;
String memberId;
Map<String, dynamic> modifyInfo = {
"background": ""
};
Map<String, dynamic> modifyInfo = {"background": ""};
@override
void initState() {
@ -59,13 +60,15 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
WidgetsBinding.instance.addObserver(this);
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
context: context,
token: value.getString('token'),
showLoading: true),
_onRefresh(),
});
}
_onRefresh() async {
queryCommunity();
queryCommunity(null);
queryMember(memberId);
}
@ -94,7 +97,15 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
}
///
queryCommunity() async {
queryCommunity(String searchKey) async {
if(!isRefresh){
isRefresh = true;
return;
}
if(isLoadingData){
return;
}
isLoadingData = true;
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
userId = value.getString('userId');
@ -102,27 +113,54 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
Dio(),
context: context,
token: value.getString("token"),
showLoading: false
);
}
if(isLoadMore){
pageNum += 1;
isLoadMore = false;
}
else pageNum = 1;
else if(searchKey == null)pageNum = 1;
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({
"mid": memberId == "0" ? userId : memberId,
"onlyFollow": false,
"onlyMe": true,
"pageNum": pageNum,
"pageNum": searchKey == null?pageNum:1,
"pageSize": 10,
"searchKey": ""
"searchKey": searchKey??""
}).catchError((error) {
if(searchKey == null) {
refreshController.refreshFailed();
refreshController.loadFailed();
}
});
if (baseData.isSuccess) {
if(searchKey == null){
refreshController.refreshCompleted();
refreshController.loadComplete();
}
if (baseData.isSuccess) {
if(searchKey != null){
if(baseData?.data?.list != null && baseData.data.list.isNotEmpty)
articles.forEach((element) {
if(element.id == searchKey){
element.content = jsonEncode(baseData.data.list[0].subjectInfo);
element.mainTitle =baseData.data.list[0].subject;
element.followed = baseData.data.list[0].selfFollow;
element.authorHeadImg = baseData.data.list[0].memberInfo?.avatar;
element.authorName = baseData.data.list[0].memberInfo?.nickname;
element.location = baseData.data.list[0].location;
element.createTime = baseData.data.list[0].createTime;
element.author = baseData.data.list[0].memberInfo?.mid;
element.viewers = baseData.data.list[0]?.viewers;
element.likes = baseData.data.list[0]?.likes;
element.comments = baseData.data.list[0]?.comments;
this.isRefresh = false;
setState(() {
});
}
});
}
else{
if (pageNum == 1) {
articles.clear();
}
@ -142,6 +180,9 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
article.comments = element?.comments;
articles.add(article);
});
setState(() {
});
// comments.sort((a,b)=>b.createTime.compareTo(a.createTime));
// print("comments: ${comments.length}");
if (int.tryParse(baseData.data.total) < (pageNum * 10)) {
refreshController.loadNoData();
@ -149,6 +190,9 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
}
}
isLoadingData = false;
}
///
_toUserInfo() async {
SharedPreferences shared = await SharedPreferences.getInstance();
@ -157,7 +201,9 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
.pushNamed('/router/new_login_page', arguments: {"login": "login"});
return;
}
await Navigator.of(context).pushNamed('/router/user_info_page').then((value) {
await Navigator.of(context)
.pushNamed('/router/user_info_page')
.then((value) {
_onRefresh();
setState(() {});
});
@ -265,7 +311,9 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
///
fileUpload() async {
if (filePath != null && filePath != "" && await File(filePath).exists()) {
BaseData<UploadResult> baseData = await apiService.upload(File(filePath), 123123123,false).catchError((onError) {});
BaseData<UploadResult> baseData = await apiService
.upload(File(filePath), 123123123, false)
.catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
UploadResult uploadResult = baseData.data;
modifyInfo["background"] = uploadResult.url;
@ -305,8 +353,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
height: 248,
color: Color(0xFFFFFFFF),
// color: Colors.red,
child:
Stack(
child: Stack(
// alignment: Alignment.bottomLeft,
children: [
Positioned(
@ -326,10 +373,8 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
width: double.infinity,
height: 260.h,
fit: BoxFit.cover,
errorSrc:
"assets/image/default_1.webp",
fadeSrc:
"assets/image/default_1.webp",
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
))),
Container(
margin: EdgeInsets.only(
@ -339,10 +384,8 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
color: Colors.transparent,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
child: Image.asset(
@ -395,14 +438,12 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
),
Container(
color: Color(0xFFFFFFFF),
child:
Column(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(
left: 86, top: 12, right: 16),
margin: EdgeInsets.only(left: 86, top: 12, right: 16),
child: GestureDetector(
onTap: () {
setState(() {
@ -416,7 +457,10 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
Expanded(
flex: 1,
child: Text(
memberId == "0" ? ((memberInfor?.signature == "") ? "还未编辑个性签名~" : memberInfor?.signature ?? "")
memberId == "0"
? ((memberInfor?.signature == "")
? "还未编辑个性签名~"
: memberInfor?.signature ?? "")
: "个性签名: ${(memberInfor?.signature == "") ? "还未编辑个性签名~" : memberInfor?.signature ?? ""}",
overflow: isShrink
? TextOverflow.visible
@ -425,8 +469,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
fontWeight:
MyFontWeight.regular,
fontWeight: MyFontWeight.regular,
height: 1.5),
)),
Icon(
@ -442,8 +485,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
Container(
margin: EdgeInsets.only(left: 16, right: 16),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
@ -456,12 +498,13 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
child: Column(
children: [
Text(
memberInfor != null ? memberInfor.follow.toString() : "0",
memberInfor != null
? memberInfor.follow.toString()
: "0",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight:
MyFontWeight.semi_bold,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
@ -472,8 +515,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight:
MyFontWeight.regular,
fontWeight: MyFontWeight.regular,
),
),
],
@ -490,12 +532,13 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
child: Column(
children: [
Text(
memberInfor != null ? memberInfor.fans.toString() : "0",
memberInfor != null
? memberInfor.fans.toString()
: "0",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight:
MyFontWeight.semi_bold,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
@ -506,8 +549,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight:
MyFontWeight.regular,
fontWeight: MyFontWeight.regular,
),
),
],
@ -524,12 +566,12 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
child: Column(
children: [
Text(
(memberInfor?.trendTotal??0).toString(),
(memberInfor?.trendTotal ?? 0)
.toString(),
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight:
MyFontWeight.semi_bold,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
@ -540,8 +582,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight:
MyFontWeight.regular,
fontWeight: MyFontWeight.regular,
),
),
],
@ -558,12 +599,12 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
child: Column(
children: [
Text(
(memberInfor?.gainLikeTotal ?? 0).toString(),
(memberInfor?.gainLikeTotal ?? 0)
.toString(),
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight:
MyFontWeight.semi_bold,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
@ -574,8 +615,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight:
MyFontWeight.regular,
fontWeight: MyFontWeight.regular,
),
),
],
@ -593,9 +633,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
Padding(
padding: EdgeInsets.only(left: 16),
child: Text(
memberId != "0" ?
"TA的动态":
"我的动态",
memberId != "0" ? "TA的动态" : "我的动态",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 15.sp,
@ -632,8 +670,10 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
context,
MaterialPageRoute(
builder: (context) => PhotoViewGalleryScreen(
images: [(memberInfor?.headimg ?? "").isEmpty?
"https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg":memberInfor?.headimg
images: [
(memberInfor?.headimg ?? "").isEmpty
? "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg"
: memberInfor?.headimg
], //list
index: 0, //index
),
@ -675,7 +715,8 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
},
child: Container(
height: 23,
padding: EdgeInsets.only(left: 6, right: 6, bottom: 2, top: 2),
padding:
EdgeInsets.only(left: 6, right: 6, bottom: 2, top: 2),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
@ -696,18 +737,21 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
),
)
],
),));
),
));
}
Widget dynamicList() {
return Container(
child: (articles == null || articles.length == 0)? NoDataView(
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(
)
: ListView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
@ -716,9 +760,9 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
articles[position],
memberId == "0" ? 1 : 0,
exitFull: () {
setState(() {
_onRefresh();
});
// setState(() {
// _onRefresh();
// });
},
removalDynamic: () {
setState(() {
@ -734,7 +778,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
"userId": userId,
},
).then((value) {
_onRefresh();
queryCommunity(articles[position].id);
});
},
);

4
lib/mine/recharge_page.dart

@ -41,7 +41,7 @@ class _RechargePage extends State<RechargePage> {
List<RechargeList> rechargeA;
int selectIndex = 0;
UserInfo userInfo;
dynamic mBalance;
String mBalance = "0";
@override
void initState() {
@ -93,7 +93,7 @@ class _RechargePage extends State<RechargePage> {
await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
mBalance = double.tryParse(userInfo?.money ?? "0");
mBalance = userInfo?.money ?? "0";
if (mounted) setState(() {});
}
}

15
lib/order/order_detail_page.dart

@ -11,7 +11,6 @@ import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:shared_preferences/shared_preferences.dart';
@ -41,7 +40,6 @@ class _OrderDetailPage extends State<OrderDetailPage> {
SharedPreferences.getInstance().then((value) {
apiService = ApiService(
Dio(),
showLoading: true,
context: context,
token: value.getString("token"),
);
@ -68,7 +66,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
);
minService = MinApiService(
Dio(),
showLoading: true,
// showLoading:true,
context: context,
token: minToken,
tenant: tenant,
@ -86,6 +84,15 @@ class _OrderDetailPage extends State<OrderDetailPage> {
int refundStatus = 0;
queryDetails() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
}
BaseData<OrderInfo> baseData = await apiService
.orderDetail(widget.arguments["id"])
.catchError((error) {});
@ -209,7 +216,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
payResult(BaseData baseData) {
queryDetails();
SmartDialog.showToast("订单支付成功");
SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center);
}
statusTitle() {

1
lib/order/order_view/order_info.dart

@ -102,6 +102,7 @@ class _OrderInfoView extends State<OrderInfoView> {
color: Color(0xFF353535),
),
),
SizedBox(width:10.w),
Expanded(
child: Text(
rightText,

58
lib/retrofit/data/app_update.dart

@ -0,0 +1,58 @@
/// appLastVersion : "1.0.0"
/// appLastVersionUrl : ""
/// appLastVersionUp : "1.0.0"
/// appLastVersionExplain : "优化更新"
class AppUpdate {
AppUpdate({
String appLastVersion,
String appLastVersionUrl,
String appLastVersionUp,
String appLastVersionExplain,}){
_appLastVersion = appLastVersion;
_appLastVersionUrl = appLastVersionUrl;
_appLastVersionUp = appLastVersionUp;
_appLastVersionExplain = appLastVersionExplain;
}
AppUpdate.fromJson(dynamic json) {
_appLastVersion = json['appLastVersion'];
_appLastVersionUrl = json['appLastVersionUrl'];
_appLastVersionUp = json['appLastVersionUp'];
_appLastVersionExplain = json['appLastVersionExplain'];
}
String _appLastVersion;
String _appLastVersionUrl;
String _appLastVersionUp;
String _appLastVersionExplain;
String get appLastVersion => _appLastVersion;
String get appLastVersionUrl => _appLastVersionUrl;
String get appLastVersionUp => _appLastVersionUp;
String get appLastVersionExplain => _appLastVersionExplain;
set appLastVersion(String value) {
_appLastVersion = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['appLastVersion'] = _appLastVersion;
map['appLastVersionUrl'] = _appLastVersionUrl;
map['appLastVersionUp'] = _appLastVersionUp;
map['appLastVersionExplain'] = _appLastVersionExplain;
return map;
}
set appLastVersionUrl(String value) {
_appLastVersionUrl = value;
}
set appLastVersionUp(String value) {
_appLastVersionUp = value;
}
set appLastVersionExplain(String value) {
_appLastVersionExplain = value;
}
}

11
lib/retrofit/retrofit_api.dart

@ -21,6 +21,7 @@ import 'package:retrofit/retrofit.dart';
import 'data/achievement_detail_list.dart';
import 'data/activity_pos.dart';
import 'data/address.dart';
import 'data/app_update.dart';
import 'data/banner.dart';
import 'data/brand_data.dart';
import 'data/category_select_list.dart';
@ -88,8 +89,8 @@ abstract class ApiService {
headers["Environment"] = "app";
}
dio.options = BaseOptions(
connectTimeout: 20000,
receiveTimeout: 20000,
connectTimeout: 60000,
receiveTimeout: 60000,
headers: headers,
responseType: ResponseType.json,
);
@ -177,7 +178,7 @@ abstract class ApiService {
///
@POST("/auth/platform/memberLogin")
Future<BaseData> memberLogin(@Body() Map<String, dynamic> param);
Future<BaseData<LoginInfo>> memberLogin(@Body() Map<String, dynamic> param);
///
@GET("/auth/sendVerify/{mobile}")
@ -519,4 +520,8 @@ abstract class ApiService {
@POST("/information/complaint")
Future<BaseData> complaint(@Body() Map<String, dynamic> param);
///app自动更新
@GET("/home/version")
Future<BaseData<AppUpdate>> appVersion();
}

23
lib/retrofit/retrofit_api.g.dart

@ -888,7 +888,7 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<OrderInfo>.fromJson(
_result.data,
(json) => OrderInfo.fromJson(json),
(json) => json==null?null:OrderInfo.fromJson(json),
);
return value;
}
@ -1959,4 +1959,25 @@ class _ApiService implements ApiService {
return value;
}
@override
Future<BaseData<AppUpdate>> appVersion() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/home/version',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<AppUpdate>.fromJson(
_result.data,
(json) => AppUpdate.fromJson(json),
);
return value;
}
}

15
lib/setting/about_page.dart

@ -19,7 +19,7 @@ class AboutPage extends StatefulWidget {
}
class _AboutPage extends State<AboutPage> {
String version = "1.0.0";
String version = "";
@override
void initState() {
@ -89,7 +89,6 @@ class _AboutPage extends State<AboutPage> {
onTap: () {
Navigator.of(context)
.pushNamed('/router/help_feedback_page');
// showAlertDialog(version);
},
child: textItem(S.of(context).shiyongbangzhu),
),
@ -103,7 +102,6 @@ class _AboutPage extends State<AboutPage> {
alignment: Alignment.center);
}
});
// showAlertDialog(version);
},
),
GestureDetector(
@ -279,15 +277,4 @@ class _AboutPage extends State<AboutPage> {
),
);
}
///app更新弹窗
showAlertDialog(version) {
//
showDialog(
context: context,
builder: (BuildContext context) {
return UpdateDialog(version);
},
);
}
}

5
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -46,8 +46,8 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
boxShadow: [
BoxShadow(
color: Color(0x0D000000),
offset: Offset(0, 3),
blurRadius: 14,
offset: Offset(0, 1),
blurRadius: 8,
spreadRadius: 0,
),
],
@ -58,6 +58,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
left: 16,
right: 16,
top: 15,
bottom: 14
),
padding: EdgeInsets.only(
left: 16,

6
lib/settlement/settlement_view/pay_method.dart

@ -41,7 +41,7 @@ class _PayMethod extends State<PayMethod> {
left: 16.w,
right: 16.w,
top: 12.h,
bottom: 4.h,
bottom: 16.h,
),
padding: EdgeInsets.only(
left: 16.w,
@ -53,8 +53,8 @@ class _PayMethod extends State<PayMethod> {
boxShadow: [
BoxShadow(
color: Color(0x000000).withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12.0,
offset: Offset(0, 2),
blurRadius: 3,
),
],
color: Colors.white,

5
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -127,6 +127,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
width: 44,
height: 44,
fit: BoxFit.cover,
radius: BorderRadius.circular(4),
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
@ -261,8 +262,8 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12,
offset: Offset(0, 2),
blurRadius: 3,
spreadRadius: 0,
)
],

17
lib/store/store_order.dart

@ -251,8 +251,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
height: double.infinity,
color: Colors.transparent,
alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 10),
padding: EdgeInsets.all(10),
margin: EdgeInsets.only(left: 10.w),
padding: EdgeInsets.all(10.h),
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
@ -354,7 +354,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
bottom: PreferredSize(
preferredSize: Size(
MediaQuery.of(context).size.width,
38,
38.h,
),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
@ -508,8 +508,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
right: 5,
// top: 14,
child: RoundButton(
width: 17,
height: 17,
width: 17.w,
height: 17.h,
text: "${count()}",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
@ -618,7 +618,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
Widget buildSwiper() {
return Container(
width: double.infinity,
height: 235.h,
height: 180.h,
child: Swiper(
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
@ -785,6 +785,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
setState(() {});
});
}
else {
SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center);
}
}
}
@ -998,7 +1001,7 @@ class _Title extends State<Title> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(bottom: 38),
margin: EdgeInsets.only(bottom: 38.h),
child: Text(
widget.title ?? "",
style: TextStyle(

1
lib/store/store_view/shop_goods.dart

@ -57,6 +57,7 @@ class _ShopGoods extends State<ShopGoods> {
: ""),
width: 70,
height: 70,
radius: BorderRadius.circular(4),
fit: BoxFit.cover,
radius: BorderRadius.circular(4),
errorSrc: "assets/image/default_1.webp",

4
lib/store/store_view/store_info.dart

@ -30,7 +30,7 @@ class _StoreInfoView extends State<StoreInfoView> {
top: 5.h,
bottom: 6.h,
),
height: 154.h,
height: MediaQuery.of(context).size.width >= 650 ? 180.h :154.h,
padding: EdgeInsets.all(12.w),
decoration: BoxDecoration(
color: Colors.white,
@ -125,7 +125,7 @@ class _StoreInfoView extends State<StoreInfoView> {
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child:Text(

8
lib/union/union_view/union_coupon.dart

@ -62,7 +62,7 @@ class _UnionCoupon extends State<UnionCoupon> {
Widget buildCoupon() {
return Container(
height: 109.h,
height: 116.h,
child: ListView.builder(
itemCount: (widget.storeInfo != null && widget.storeInfo.couponVOList != null)
? widget.storeInfo.couponVOList.length
@ -126,7 +126,7 @@ class _UnionCoupon extends State<UnionCoupon> {
.bizType ==
5)
? S.of(context).duihuanquan
: "${widget.storeInfo.couponVOList[position].discountPercent ~/ 10}",
: "${widget.storeInfo.couponVOList[position].discountPercent / 10.0}",
style: TextStyle(
fontSize: 36.sp,
color: Color(0xFFFF7A1A),
@ -193,7 +193,7 @@ class _UnionCoupon extends State<UnionCoupon> {
: S.of(context).quanchangzhe(widget
.storeInfo
.couponVOList[position]
.discountPercent))
.discountPercent /10.0))
: "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -258,7 +258,7 @@ class _UnionCoupon extends State<UnionCoupon> {
? Colors.grey
: Color(0xFF32A060),
padding: EdgeInsets.symmetric(
horizontal: 8.w, vertical: 4.h),
horizontal: 8.w, vertical:2.h),
fontSize: 12.sp,
),
),

13
lib/utils/flutter_utils.dart

@ -16,6 +16,19 @@ class AppUtils {
return "${numberFormat.format(mi / 1000)}";
}
///
static bool versionCompare(String localVersion,String serverVersion){
try{
var localVersionArr = localVersion.split(".");
var serverVersionArr = serverVersion.split(".");
if((int.tryParse(localVersionArr[0]) < int.tryParse(serverVersionArr[0]))
|| (int.tryParse(localVersionArr[1]) < int.tryParse(serverVersionArr[1]))
|| (int.tryParse(localVersionArr[2]) < int.tryParse(serverVersionArr[2])))
return true;
}catch(ex){ }
return false;
}
static String trimEnd(String resString,String char){
while(resString.endsWith(char)){
resString = resString.substring(0,resString.length - 1);

11
lib/view_widget/tips_dialog.dart

@ -23,7 +23,7 @@ class _Tips extends State<Tips> {
child: Center(
child: Container(
width: MediaQuery.of(context).size.width - 80.w,
height: 146.h,
height: 165.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
@ -32,13 +32,13 @@ class _Tips extends State<Tips> {
children: [
Container(
width: double.infinity,
height: 90.h,
height:109.h,
alignment: Alignment.center,
padding: EdgeInsets.all(10),
child: Text(
widget.text ?? S.of(context).querenyaoshanchudangqianpinglunma,
style: TextStyle(
fontSize: 17.sp,
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF353535),
),
@ -57,6 +57,7 @@ class _Tips extends State<Tips> {
child: InkWell(
onTap: () {
SmartDialog.dismiss();
widget.tips();
},
child: Container(
width: double.infinity,
@ -65,7 +66,7 @@ class _Tips extends State<Tips> {
child: Text(
S.of(context).quxiao,
style: TextStyle(
fontSize: 17.sp,
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF353535),
),
@ -91,7 +92,7 @@ class _Tips extends State<Tips> {
child: Text(
S.of(context).queren,
style: TextStyle(
fontSize: 17.sp,
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),

50
lib/view_widget/update_dialog.dart

@ -2,14 +2,19 @@ import 'dart:io';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/data/app_update.dart';
import 'package:huixiang/utils/bridge.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:path_provider/path_provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';
class UpdateDialog extends StatefulWidget {
final String version;
final AppUpdate appUpdate;
UpdateDialog(this.version);
UpdateDialog(this.version,this.appUpdate);
@override
State<StatefulWidget> createState() {
@ -40,19 +45,20 @@ class _UpdateDialog extends State<UpdateDialog> {
child: Column(
children: [
Text(
"检测到新版本 v${widget.version}",
"检测到新版本 v${widget.appUpdate.appLastVersion}",
style: TextStyle(
fontSize: 18.sp,
fontSize: 17.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535),
color: Color(0xFF000000),
),
),
SizedBox(height: 12,),
Text(
"是否需要更新到最新版本?",
style: TextStyle(
fontSize: 14.sp,
fontSize: 17.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
color: Color(0xFF333333),
),
),
],
@ -67,10 +73,11 @@ class _UpdateDialog extends State<UpdateDialog> {
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
if(!AppUtils.versionCompare(widget.version,widget.appUpdate.appLastVersionUp))
Expanded(
child: InkWell(
onTap:() {
Navigator.of(context).pop();
doNotUpdate();
},
child: Container(
width: double.infinity,
@ -80,8 +87,8 @@ class _UpdateDialog extends State<UpdateDialog> {
"下次再说",
style: TextStyle(
fontSize: 17.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF353535),
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF8C8C8C),
),
),
),
@ -95,9 +102,10 @@ class _UpdateDialog extends State<UpdateDialog> {
Expanded(
child: InkWell(
onTap: () {
Bridge.toAppStore().then((value) {
(Theme.of(context).platform == TargetPlatform.android) ?
androidUpdate():Bridge.toAppStore().then((value) {
});
Navigator.of(context).pop();
// Navigator.of(context).pop();
},
child: Container(
width: double.infinity,
@ -107,7 +115,7 @@ class _UpdateDialog extends State<UpdateDialog> {
"立即更新",
style: TextStyle(
fontSize: 17.sp,
fontWeight: MyFontWeight.medium,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
@ -125,13 +133,19 @@ class _UpdateDialog extends State<UpdateDialog> {
);
}
Future<String> _findLocalPath(BuildContext context) async {
final directory = Theme.of(context).platform == TargetPlatform.android
? await getExternalStorageDirectory()
: await getApplicationDocumentsDirectory();
return directory.path;
doNotUpdate() async {
SharedPreferences value = await SharedPreferences.getInstance();
value.setString("appLastVersion", widget.appUpdate.appLastVersion);
Navigator.of(context).pop();
}
androidUpdate() async {
String url = "http://application.lotus-wallet.com/huixaing?release_id=627cadff23389f2fe6d57cb1";
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
}

37
lib/web/web_view/comment_list.dart

@ -16,7 +16,6 @@ import 'package:like_button/like_button.dart';
import 'package:shared_preferences/shared_preferences.dart';
class CommentList extends StatefulWidget {
final bool isKeyBoardShow;
final Function reply;
final Function delCommentTips;
@ -27,7 +26,8 @@ class CommentList extends StatefulWidget {
final Function requestApiFinish;
CommentList(Key key, this.like, this.relationalId, this.relationalType,
this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize,{this.requestApiFinish})
this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize,
{this.requestApiFinish})
: super(key: key);
@override
@ -59,7 +59,6 @@ class CommentListState extends State<CommentList> {
} else {
element.likes += 1;
element.liked = true;
}
}
});
@ -121,8 +120,8 @@ class CommentListState extends State<CommentList> {
color: Colors.white,
child: InkWell(
onTap: () {
showPressMenu(memberList[position].createUser,
memberList[position]);
// showPressMenu(memberList[position].createUser,
// memberList[position]);
},
child: commentItem(memberList[position]),
),
@ -190,8 +189,7 @@ class CommentListState extends State<CommentList> {
//
queryMemberCommentList() async {
if(widget?.relationalId == null || widget.relationalId.isEmpty)
return;
if (widget?.relationalId == null || widget.relationalId.isEmpty) return;
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (apiService == null)
apiService = ApiService(
@ -255,15 +253,27 @@ class CommentListState extends State<CommentList> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
MImage(
GestureDetector(
onTap: () {
setState(() {
Navigator.of(context)
.pushNamed('/router/personal_page', arguments: {
"memberId": memberList.createUser,
});
});
},
behavior: HitTestBehavior.opaque,
child: MImage(
memberList.userAvatarUrl ?? "",
fit: BoxFit.cover,
isCircle: true,
width: 40,
height: 40,
radius: BorderRadius.circular(4),
fadeSrc: "assets/image/default_user.webp",
errorSrc: "assets/image/default_user.webp",
),
),
SizedBox(
width: 12.w,
),
@ -358,6 +368,15 @@ class CommentListState extends State<CommentList> {
],
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
showPressMenu(memberList.createUser,
memberList);
});
},
child:
Container(
padding: EdgeInsets.only(
left: 68.w,
@ -375,7 +394,7 @@ class CommentListState extends State<CommentList> {
),
),
),
),
)),
SizedBox(
height: 12.h,
),

2
pubspec.yaml

@ -3,7 +3,7 @@ description: 一心回乡.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
version: 1.0.1+2
environment:
sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save