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. 105
      lib/community/community_child_page.dart
  3. 2
      lib/community/community_course.dart
  4. 6
      lib/community/community_page.dart
  5. 85
      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. 958
      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. 52
      lib/view_widget/update_dialog.dart
  31. 85
      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_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 87; CURRENT_PROJECT_VERSION = 93;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -666,7 +666,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 1.0.87; MARKETING_VERSION = 1.0.93;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
@ -816,7 +816,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 87; CURRENT_PROJECT_VERSION = 93;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -866,7 +866,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 1.0.87; MARKETING_VERSION = 1.0.93;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
@ -907,7 +907,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 87; CURRENT_PROJECT_VERSION = 93;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -957,7 +957,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 1.0.87; MARKETING_VERSION = 1.0.93;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",

105
lib/community/community_child_page.dart

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

2
lib/community/community_course.dart

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

6
lib/community/community_page.dart

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

85
lib/community/community_view/community_dynamic.dart

@ -159,10 +159,10 @@ class _CommunityDynamic extends State<CommunityDynamic> {
return Column( return Column(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 2), margin: EdgeInsets.only(top: 2.h),
key: globalKey, key: globalKey,
alignment: Alignment.topCenter, 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( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
boxShadow: [ boxShadow: [
@ -184,7 +184,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
height: 44, // height: 44.h,
child: Row( child: Row(
children: [ children: [
GestureDetector( GestureDetector(
@ -213,7 +213,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
), ),
), ),
SizedBox( SizedBox(
width: 8, width: 8.w,
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -222,7 +222,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
Text( Text(
widget?.article?.authorName ?? "", widget?.article?.authorName ?? "",
style: TextStyle( style: TextStyle(
fontSize: 15.sp, fontSize: MediaQuery.of(context).size.width >= 650 ? 12.sp :15.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF1A1A1A), color: Color(0xFF1A1A1A),
), ),
@ -230,7 +230,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
Text( Text(
widget?.article?.createTime ?? "", widget?.article?.createTime ?? "",
style: TextStyle( style: TextStyle(
fontSize: 13.sp, fontSize: MediaQuery.of(context).size.width >= 650 ? 10.sp :13.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFF808080), color: Color(0xFF808080),
), ),
@ -317,29 +317,30 @@ class _CommunityDynamic extends State<CommunityDynamic> {
height:8.h, height:8.h,
), ),
if (widget.article.location != "") if (widget.article.location != "")
Row( Padding(padding:EdgeInsets.only(bottom:7),
children: [ child: Row(
Icon( children: [
Icons.place, Icon(
size: 16, Icons.place,
color: Color(0xFFB3B2B2), size: 16,
), color: Color(0xFFB3B2B2),
SizedBox( ),
width: 2, SizedBox(
), width: 2,
Expanded( ),
child: Text( Expanded(
widget?.article?.location ?? "", child: Text(
overflow: TextOverflow.ellipsis, widget?.article?.location ?? "",
maxLines: 1, overflow: TextOverflow.ellipsis,
style: TextStyle( maxLines: 1,
fontSize: 12.sp, style: TextStyle(
fontWeight: MyFontWeight.medium, fontSize: 12.sp,
color: Color(0xFFB3B2B2), fontWeight: MyFontWeight.medium,
), color: Color(0xFFB3B2B2),
)), ),
], )),
), ],
),),
if (!widget.isDetails) if (!widget.isDetails)
SizedBox( SizedBox(
height: 5.h, height: 5.h,
@ -353,7 +354,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsets.only(bottom: 16), padding: EdgeInsets.only(bottom: 16.h),
child:Row( child:Row(
// mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
@ -364,7 +365,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
height: 16, height: 16,
), ),
SizedBox( SizedBox(
width: 5, width: 5.w,
), ),
Text( Text(
(widget.article != null) (widget.article != null)
@ -381,7 +382,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
), ),
Expanded( Expanded(
child:Container( child:Container(
padding: EdgeInsets.only(bottom: 16), padding: EdgeInsets.only(bottom: 16.h),
child:Row( child:Row(
// mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
@ -392,7 +393,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
height: 16, height: 16,
), ),
SizedBox( SizedBox(
width: 5, width: 5.w,
), ),
Text( Text(
"${widget.article.comments ?? 0}", "${widget.article.comments ?? 0}",
@ -406,7 +407,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
))), ))),
Expanded( Expanded(
child:Container( child:Container(
padding: EdgeInsets.only(bottom: 16), padding: EdgeInsets.only(bottom: 16.h),
child:Row( child:Row(
// mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
@ -417,7 +418,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
height: 16, height: 16,
), ),
SizedBox( SizedBox(
width: 5, width: 5.w,
), ),
Text( Text(
"${widget.article.likes ?? 0}", "${widget.article.likes ?? 0}",
@ -440,7 +441,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
}); });
}, },
child: Container( child: Container(
padding: EdgeInsets.only(top:3,bottom: 16), padding: EdgeInsets.only(top:3.h,bottom: 16.h),
alignment: Alignment.center, alignment: Alignment.center,
// color: Colors.red, // color: Colors.red,
child: Icon( child: Icon(
@ -454,7 +455,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
), ),
), ),
Container( Container(
height: 16, height: 16.h,
color: Color(0xFFF7F7F7), color: Color(0xFFF7F7F7),
), ),
], ],
@ -789,7 +790,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: 10, height: 10.h,
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -802,7 +803,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
child: Row( child: Row(
children: [ children: [
SizedBox( SizedBox(
width: 4, width: 4.w,
), ),
Image.asset( Image.asset(
"assets/image/icon_share.webp", "assets/image/icon_share.webp",
@ -812,7 +813,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
color: Color(0xff515151), color: Color(0xff515151),
), ),
SizedBox( SizedBox(
width: 12, width: 12.w,
), ),
Text( Text(
S.of(context).fenxiang, S.of(context).fenxiang,
@ -843,7 +844,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
child: Row( child: Row(
children: [ children: [
SizedBox( SizedBox(
width: 4, width: 4.w,
), ),
SvgPicture.asset( SvgPicture.asset(
"assets/svg/ju_b.svg", "assets/svg/ju_b.svg",
@ -851,7 +852,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
height: 20, height: 20,
), ),
SizedBox( SizedBox(
width: 15, width: 15.w,
), ),
Text( Text(
S.of(context).jubaogaineirong, 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) { Widget collectItem(CollectClassList collectList) {
return Container( return Container(
width: 168, width: 168.w,
// height: 250, // height: 250,
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 6.w, horizontal: 6.w,
@ -58,7 +58,7 @@ class _HomeClass extends State<HomeClass> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(left: 16, top: 5), padding: EdgeInsets.only(left: 16.w, top: 5.h),
child: Text( child: Text(
collectList.name, collectList.name,
style: TextStyle( style: TextStyle(
@ -70,11 +70,11 @@ class _HomeClass extends State<HomeClass> {
), ),
Container( Container(
height: 195, height: 195,
margin: EdgeInsets.only(top: 10), margin: EdgeInsets.only(top: 10.h),
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
padding: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric(horizontal: 10.w),
itemCount: widget.collectMap[collectList.id] == null itemCount: widget.collectMap[collectList.id] == null
? 0 ? 0
: widget.collectMap[collectList.id].length, : widget.collectMap[collectList.id].length,
@ -105,8 +105,8 @@ class _HomeClass extends State<HomeClass> {
Widget classItem(CourseList collect) { Widget classItem(CourseList collect) {
return Container( return Container(
width: 168, width: 168.w,
height: 195, height: 195.h,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
bottom: Radius.circular(4), bottom: Radius.circular(4),
@ -122,7 +122,7 @@ class _HomeClass extends State<HomeClass> {
color: Colors.white, color: Colors.white,
), ),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 6, horizontal: 6.w,
), ),
child: Column( child: Column(
children: [ children: [
@ -154,7 +154,7 @@ class _HomeClass extends State<HomeClass> {
child: MImage( child: MImage(
collect.coverImg, collect.coverImg,
width: double.infinity, width: double.infinity,
height: 120, height: 120.h,
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",
@ -179,7 +179,7 @@ class _HomeClass extends State<HomeClass> {
height: 16.h, height: 16.h,
color: Colors.white, color: Colors.white,
), ),
SizedBox(width: 5), SizedBox(width: 5.w),
Text( Text(
collect.viewers.toString(), collect.viewers.toString(),
style: TextStyle( style: TextStyle(
@ -190,7 +190,7 @@ class _HomeClass extends State<HomeClass> {
), ),
], ],
), ),
SizedBox(width: 8), SizedBox(width: 8.w),
// Row( // Row(
// children: [ // children: [
// Image.asset( // Image.asset(
@ -219,8 +219,8 @@ class _HomeClass extends State<HomeClass> {
children: [ children: [
Spacer(), Spacer(),
Container( Container(
margin: EdgeInsets.only(top: 8, right: 8), margin: EdgeInsets.only(top: 8.h, right: 8.w),
padding: EdgeInsets.only(left: 2, right: 2), padding: EdgeInsets.only(left: 2.w, right: 2.w),
height: 20.h, height: 20.h,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -245,7 +245,7 @@ class _HomeClass extends State<HomeClass> {
), ),
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8.w),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -268,7 +268,7 @@ class _HomeClass extends State<HomeClass> {
), ),
], ],
), ),
SizedBox(height: 2), SizedBox(height: 2.h),
Text( Text(
"${S.of(context).jiangshi}:${collect.author.name}", "${S.of(context).jiangshi}:${collect.author.name}",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,

14
lib/community/headlines/article_list.dart

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

8
lib/community/release_dynamic.dart

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

4
lib/home/guide_page.dart

@ -309,7 +309,7 @@ class _GuidePage extends State<GuidePage> {
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
SizedBox( SizedBox(
height: 66.h, height: MediaQuery.of(context).size.width >= 650 ? 20.h :66.h,
), ),
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -323,7 +323,7 @@ class _GuidePage extends State<GuidePage> {
), ),
), ),
SizedBox( SizedBox(
height: 23.h, height: MediaQuery.of(context).size.width >= 650 ? 15.h :23.h,
), ),
Padding( Padding(
padding: EdgeInsets.only(left: 52.w, right: 52.w), 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; break;
case 4: case 4:
String router = bannerData.content; String router = bannerData.content;
// String router = "/router/store_order?{\"id\":\"1512378184161558528\",\"tenant\":\"1188\",\"storeName\":\"农场煮意\"}";
if (router.contains("?")) { if (router.contains("?")) {
String params = router.substring(router.indexOf("?")); String params = router.substring(router.indexOf("?")+1);
params = params.replaceAll("?", "");
Map map = jsonDecode(params); Map map = jsonDecode(params);
Navigator.of(context).pushNamed(router, arguments: map); Navigator.of(context).pushNamed(router.substring(0,router.indexOf("?")), arguments: map);
} else { } else {
Navigator.of(context).pushNamed(router); Navigator.of(context).pushNamed(router);
} }

18
lib/login/login_page.dart

@ -1066,7 +1066,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return SimpleDialog( return SimpleDialog(
titlePadding: EdgeInsets.all(10), titlePadding: EdgeInsets.all(10.h),
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
elevation: 0, elevation: 0,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -1079,7 +1079,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
width: double.infinity, 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), padding: EdgeInsets.only(left: 16.w, right: 16.w),
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Colors.white, color: Colors.white,
@ -1105,7 +1105,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 14.sp, fontSize: 14.sp,
height: 1.3.h, height: 1.2.h,
color: Color(0xff727272), color: Color(0xff727272),
), ),
), ),
@ -1124,14 +1124,14 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
]), ]),
), ),
SizedBox( SizedBox(
height: 10.h, height: 5.h,
), ),
Text( Text(
S.of(context).yinsizhengce2, S.of(context).yinsizhengce2,
style: TextStyle( style: TextStyle(
color: Color(0xff727272), color: Color(0xff727272),
fontSize: 14.sp, fontSize: 14.sp,
height: 1.3.h, height: 1.2.h,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
), ),
), ),
@ -1155,8 +1155,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
margin: EdgeInsets.only(bottom: 20.h), margin: EdgeInsets.only(bottom: 20.h),
child: BorderText( child: BorderText(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 10.h, top: 5.h,
bottom: 10.h, bottom: 5.h,
left: 36.w, left: 36.w,
right: 36.w, right: 36.w,
), ),
@ -1192,8 +1192,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
); );
}, },
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 10.h, top: 5.h,
bottom: 10.h, bottom: 5.h,
left: 21.5.w, left: 21.5.w,
right: 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_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart'; import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:huixiang/community/community_page.dart'; import 'package:huixiang/community/community_page.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/home/home_page.dart'; import 'package:huixiang/home/home_page.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
import 'package:huixiang/mine/mine_page.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/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.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:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/utils/bridge.dart'; import 'package:huixiang/utils/bridge.dart';
import 'package:huixiang/utils/event_type.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/font_weight.dart';
import 'package:huixiang/utils/native_event_handler.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:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:sharesdk_plugin/sharesdk_interface.dart'; import 'package:sharesdk_plugin/sharesdk_interface.dart';
@ -47,6 +52,8 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
final GlobalKey homePageKey = GlobalKey(); final GlobalKey homePageKey = GlobalKey();
final GlobalKey minePageKey = GlobalKey(); final GlobalKey minePageKey = GlobalKey();
// List<String> iconn; // List<String> iconn;
ApiService apiService;
@override @override
void dispose() { void dispose() {
@ -74,7 +81,6 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
EasyLoading.instance EasyLoading.instance
..indicatorType = EasyLoadingIndicatorType.circle ..indicatorType = EasyLoadingIndicatorType.circle
// ..indicatorType = EasyLoadingIndicatorType.wave // ..indicatorType = EasyLoadingIndicatorType.wave
@ -139,6 +145,8 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
}); });
queryUserInfo(); queryUserInfo();
appAutoUpdate();
} }
final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin();
initSdk() async { 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); final PageController pageController = PageController(initialPage: 0);
@override @override

958
lib/mine/personal_page.dart

File diff suppressed because it is too large Load Diff

4
lib/mine/recharge_page.dart

@ -41,7 +41,7 @@ class _RechargePage extends State<RechargePage> {
List<RechargeList> rechargeA; List<RechargeList> rechargeA;
int selectIndex = 0; int selectIndex = 0;
UserInfo userInfo; UserInfo userInfo;
dynamic mBalance; String mBalance = "0";
@override @override
void initState() { void initState() {
@ -93,7 +93,7 @@ class _RechargePage extends State<RechargePage> {
await apiService.queryInfo().catchError((onError) {}); await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data; userInfo = baseData.data;
mBalance = double.tryParse(userInfo?.money ?? "0"); mBalance = userInfo?.money ?? "0";
if (mounted) setState(() {}); 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/data/order_info.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -41,7 +40,6 @@ class _OrderDetailPage extends State<OrderDetailPage> {
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
showLoading: true,
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
); );
@ -68,7 +66,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
); );
minService = MinApiService( minService = MinApiService(
Dio(), Dio(),
showLoading: true, // showLoading:true,
context: context, context: context,
token: minToken, token: minToken,
tenant: tenant, tenant: tenant,
@ -86,6 +84,15 @@ class _OrderDetailPage extends State<OrderDetailPage> {
int refundStatus = 0; int refundStatus = 0;
queryDetails() async { 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 BaseData<OrderInfo> baseData = await apiService
.orderDetail(widget.arguments["id"]) .orderDetail(widget.arguments["id"])
.catchError((error) {}); .catchError((error) {});
@ -209,7 +216,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
payResult(BaseData baseData) { payResult(BaseData baseData) {
queryDetails(); queryDetails();
SmartDialog.showToast("订单支付成功"); SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center);
} }
statusTitle() { statusTitle() {

1
lib/order/order_view/order_info.dart

@ -102,6 +102,7 @@ class _OrderInfoView extends State<OrderInfoView> {
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
), ),
SizedBox(width:10.w),
Expanded( Expanded(
child: Text( child: Text(
rightText, 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/achievement_detail_list.dart';
import 'data/activity_pos.dart'; import 'data/activity_pos.dart';
import 'data/address.dart'; import 'data/address.dart';
import 'data/app_update.dart';
import 'data/banner.dart'; import 'data/banner.dart';
import 'data/brand_data.dart'; import 'data/brand_data.dart';
import 'data/category_select_list.dart'; import 'data/category_select_list.dart';
@ -88,8 +89,8 @@ abstract class ApiService {
headers["Environment"] = "app"; headers["Environment"] = "app";
} }
dio.options = BaseOptions( dio.options = BaseOptions(
connectTimeout: 20000, connectTimeout: 60000,
receiveTimeout: 20000, receiveTimeout: 60000,
headers: headers, headers: headers,
responseType: ResponseType.json, responseType: ResponseType.json,
); );
@ -177,7 +178,7 @@ abstract class ApiService {
/// ///
@POST("/auth/platform/memberLogin") @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}") @GET("/auth/sendVerify/{mobile}")
@ -519,4 +520,8 @@ abstract class ApiService {
@POST("/information/complaint") @POST("/information/complaint")
Future<BaseData> complaint(@Body() Map<String, dynamic> param); 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); data: _data);
final value = BaseData<OrderInfo>.fromJson( final value = BaseData<OrderInfo>.fromJson(
_result.data, _result.data,
(json) => OrderInfo.fromJson(json), (json) => json==null?null:OrderInfo.fromJson(json),
); );
return value; return value;
} }
@ -1959,4 +1959,25 @@ class _ApiService implements ApiService {
return value; 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> { class _AboutPage extends State<AboutPage> {
String version = "1.0.0"; String version = "";
@override @override
void initState() { void initState() {
@ -89,7 +89,6 @@ class _AboutPage extends State<AboutPage> {
onTap: () { onTap: () {
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/help_feedback_page'); .pushNamed('/router/help_feedback_page');
// showAlertDialog(version);
}, },
child: textItem(S.of(context).shiyongbangzhu), child: textItem(S.of(context).shiyongbangzhu),
), ),
@ -103,7 +102,6 @@ class _AboutPage extends State<AboutPage> {
alignment: Alignment.center); alignment: Alignment.center);
} }
}); });
// showAlertDialog(version);
}, },
), ),
GestureDetector( 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: [
BoxShadow( BoxShadow(
color: Color(0x0D000000), color: Color(0x0D000000),
offset: Offset(0, 3), offset: Offset(0, 1),
blurRadius: 14, blurRadius: 8,
spreadRadius: 0, spreadRadius: 0,
), ),
], ],
@ -58,6 +58,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
left: 16, left: 16,
right: 16, right: 16,
top: 15, top: 15,
bottom: 14
), ),
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 16, left: 16,

6
lib/settlement/settlement_view/pay_method.dart

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

5
lib/settlement/settlement_view/settlement_order_commodity.dart

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

17
lib/store/store_order.dart

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

1
lib/store/store_view/shop_goods.dart

@ -57,6 +57,7 @@ class _ShopGoods extends State<ShopGoods> {
: ""), : ""),
width: 70, width: 70,
height: 70, height: 70,
radius: BorderRadius.circular(4),
fit: BoxFit.cover, fit: BoxFit.cover,
radius: BorderRadius.circular(4), radius: BorderRadius.circular(4),
errorSrc: "assets/image/default_1.webp", 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, top: 5.h,
bottom: 6.h, bottom: 6.h,
), ),
height: 154.h, height: MediaQuery.of(context).size.width >= 650 ? 180.h :154.h,
padding: EdgeInsets.all(12.w), padding: EdgeInsets.all(12.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -125,7 +125,7 @@ class _StoreInfoView extends State<StoreInfoView> {
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child:Text( child:Text(

8
lib/union/union_view/union_coupon.dart

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

13
lib/utils/flutter_utils.dart

@ -16,6 +16,19 @@ class AppUtils {
return "${numberFormat.format(mi / 1000)}"; 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){ static String trimEnd(String resString,String char){
while(resString.endsWith(char)){ while(resString.endsWith(char)){
resString = resString.substring(0,resString.length - 1); 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: Center(
child: Container( child: Container(
width: MediaQuery.of(context).size.width - 80.w, width: MediaQuery.of(context).size.width - 80.w,
height: 146.h, height: 165.h,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
@ -32,13 +32,13 @@ class _Tips extends State<Tips> {
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,
height: 90.h, height:109.h,
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Text( child: Text(
widget.text ?? S.of(context).querenyaoshanchudangqianpinglunma, widget.text ?? S.of(context).querenyaoshanchudangqianpinglunma,
style: TextStyle( style: TextStyle(
fontSize: 17.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
@ -57,6 +57,7 @@ class _Tips extends State<Tips> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
SmartDialog.dismiss(); SmartDialog.dismiss();
widget.tips();
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
@ -65,7 +66,7 @@ class _Tips extends State<Tips> {
child: Text( child: Text(
S.of(context).quxiao, S.of(context).quxiao,
style: TextStyle( style: TextStyle(
fontSize: 17.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
@ -91,7 +92,7 @@ class _Tips extends State<Tips> {
child: Text( child: Text(
S.of(context).queren, S.of(context).queren,
style: TextStyle( style: TextStyle(
fontSize: 17.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060), color: Color(0xFF32A060),
), ),

52
lib/view_widget/update_dialog.dart

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

85
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'; import 'package:shared_preferences/shared_preferences.dart';
class CommentList extends StatefulWidget { class CommentList extends StatefulWidget {
final bool isKeyBoardShow; final bool isKeyBoardShow;
final Function reply; final Function reply;
final Function delCommentTips; final Function delCommentTips;
@ -26,8 +25,9 @@ class CommentList extends StatefulWidget {
final int like; final int like;
final Function requestApiFinish; final Function requestApiFinish;
CommentList(Key key, this.like, this.relationalId,this.relationalType, 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); : super(key: key);
@override @override
@ -59,7 +59,6 @@ class CommentListState extends State<CommentList> {
} else { } else {
element.likes += 1; element.likes += 1;
element.liked = true; element.liked = true;
} }
} }
}); });
@ -121,8 +120,8 @@ class CommentListState extends State<CommentList> {
color: Colors.white, color: Colors.white,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
showPressMenu(memberList[position].createUser, // showPressMenu(memberList[position].createUser,
memberList[position]); // memberList[position]);
}, },
child: commentItem(memberList[position]), child: commentItem(memberList[position]),
), ),
@ -190,8 +189,7 @@ class CommentListState extends State<CommentList> {
// //
queryMemberCommentList() async { queryMemberCommentList() async {
if(widget?.relationalId == null || widget.relationalId.isEmpty) if (widget?.relationalId == null || widget.relationalId.isEmpty) return;
return;
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (apiService == null) if (apiService == null)
apiService = ApiService( apiService = ApiService(
@ -255,14 +253,26 @@ class CommentListState extends State<CommentList> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
MImage( GestureDetector(
memberList.userAvatarUrl ?? "", onTap: () {
fit: BoxFit.cover, setState(() {
isCircle: true, Navigator.of(context)
width: 40, .pushNamed('/router/personal_page', arguments: {
height: 40, "memberId": memberList.createUser,
fadeSrc: "assets/image/default_user.webp", });
errorSrc: "assets/image/default_user.webp", });
},
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( SizedBox(
width: 12.w, width: 12.w,
@ -358,24 +368,33 @@ class CommentListState extends State<CommentList> {
], ],
), ),
), ),
Container( GestureDetector(
padding: EdgeInsets.only( behavior: HitTestBehavior.opaque,
left: 68.w, onTap: () {
right: 16.w, setState(() {
top: 16.h, showPressMenu(memberList.createUser,
bottom: 16.h, memberList);
), });
child: Align( },
alignment: Alignment.centerLeft, child:
child: Text( Container(
memberList.content, padding: EdgeInsets.only(
style: TextStyle( left: 68.w,
fontSize: widget.fontSize + 2, right: 16.w,
color: Color(0xff1A1A1A), top: 16.h,
bottom: 16.h,
), ),
), child: Align(
), alignment: Alignment.centerLeft,
), child: Text(
memberList.content,
style: TextStyle(
fontSize: widget.fontSize + 2,
color: Color(0xff1A1A1A),
),
),
),
)),
SizedBox( SizedBox(
height: 12.h, 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 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: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save