diff --git a/assets/image/2x/activity_hot.png b/assets/image/2x/activity_hot.png new file mode 100644 index 00000000..99d96f82 Binary files /dev/null and b/assets/image/2x/activity_hot.png differ diff --git a/assets/image/3x/activity_hot.png b/assets/image/3x/activity_hot.png new file mode 100644 index 00000000..65abff9d Binary files /dev/null and b/assets/image/3x/activity_hot.png differ diff --git a/assets/image/activity_hot.png b/assets/image/activity_hot.png new file mode 100644 index 00000000..c7eb44da Binary files /dev/null and b/assets/image/activity_hot.png differ diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index 892b62e6..7cfbf095 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -200,7 +200,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { Row( children: [ Container( - height: 22.h, + // height: 22.h, padding:EdgeInsets.only(left:2,right:2), alignment: Alignment.center, decoration: BoxDecoration( @@ -216,6 +216,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { course.tags.length > 0) ? course.tags[0] : "", + overflow:TextOverflow.ellipsis, style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.medium, diff --git a/lib/community/community_view/home_class.dart b/lib/community/community_view/home_class.dart index 52acdfc8..78435916 100644 --- a/lib/community/community_view/home_class.dart +++ b/lib/community/community_view/home_class.dart @@ -220,7 +220,7 @@ class _HomeClass extends State { Container( margin: EdgeInsets.only(top: 8, right: 8), padding: EdgeInsets.only(left: 2, right: 2), - height: 16.h, + height: 20.h, alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(2), @@ -230,8 +230,9 @@ class _HomeClass extends State { (collect?.tags != null && collect.tags.length > 0) ? collect.tags[0] : "", + overflow:TextOverflow.ellipsis, style: TextStyle( - fontSize: 12.sp, + fontSize: 11.sp, fontWeight: MyFontWeight.medium, color: Color(0xFF634815), ), diff --git a/lib/community/headlines/activity_top_list.dart b/lib/community/headlines/activity_top_list.dart new file mode 100644 index 00000000..e744c6aa --- /dev/null +++ b/lib/community/headlines/activity_top_list.dart @@ -0,0 +1,165 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; +import 'package:huixiang/retrofit/data/article.dart'; +import 'package:huixiang/retrofit/data/collect_class_list.dart'; +import 'package:huixiang/retrofit/data/course_list.dart'; +import 'package:huixiang/retrofit/data/headlines_list.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/new_people_reward.dart'; + +class ActivityTopList extends StatefulWidget { + final List
articleTop; + + ActivityTopList(this.articleTop); + + @override + State createState() { + return _ActivityTopList(); + } +} + +class _ActivityTopList extends State { + ApiService apiService; + BMFCoordinate latLng; + + final TextEditingController editingController = TextEditingController(); + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + height: 220.h, + margin: EdgeInsets.only(top: 10), + child: ListView.builder( + scrollDirection: Axis.horizontal, + physics: BouncingScrollPhysics(), + padding: EdgeInsets.symmetric(horizontal: 10), + itemCount: widget.articleTop == null ? 0 : widget.articleTop.length, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed( + '/router/headlines_column_details', + arguments: {"id": widget.articleTop[position].id}); + }, + child: headlinesCollectionItem(widget.articleTop[position], position), + ); + }, + ), + ); + } + + Widget headlinesCollectionItem(Article articles, index) { + return Container( + width: 320.w, + height: 220.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(10), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.black, + ), + margin: EdgeInsets.symmetric( + horizontal: 6, + ), + child: Stack( + alignment: Alignment.bottomLeft, + children: [ + Stack( + children: [ + ClipRRect( + child: Opacity( + opacity: 0.8, + child: MImage( + widget?.articleTop[index]?.coverImg ?? "", + width: 320.w, + height: 220.h, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ), + ), + borderRadius: BorderRadius.vertical( + top: Radius.circular(4), + bottom: Radius.circular(4), + ), + ), + Container( + padding: EdgeInsets.only(left: 12.w, right: 12.w, top: 8), + alignment: Alignment.topLeft, + child: Row( + children: [ + Image.asset( + "assets/image/activity_hot.png", + width: 20, + height: 20, + fit: BoxFit.fill, + ), + SizedBox( + width: 4.w, + ), + Expanded( + child: Text( + "精选好文", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + ), + ], + )), + ], + ), + Positioned( + top:130, + left: 12, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget?.articleTop[index]?.mainTitle ?? "", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + Text( + widget?.articleTop[index]?.viceTitle ?? "", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + ], + )) + + ], + ), + ); + } +} diff --git a/lib/community/headlines/article_page.dart b/lib/community/headlines/article_page.dart index 6c6f928d..25e7f92c 100644 --- a/lib/community/headlines/article_page.dart +++ b/lib/community/headlines/article_page.dart @@ -25,6 +25,7 @@ import 'package:huixiang/view_widget/store_title_tab.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'activity_top_list.dart'; import 'article_list.dart'; class ArticlePage extends StatefulWidget { @@ -44,6 +45,7 @@ class _ArticlePage extends State List brands = []; List bannerData = []; List
articles = []; + List
articleTop = []; List headlines = []; int pageNum = 1; @@ -57,7 +59,8 @@ class _ArticlePage extends State setState(() {}); } }); - queryArticleList(); + queryArticleList(false); + queryArticleList(true); queryHeadlinesBanner(); queryHeadlinesList(); } @@ -95,7 +98,7 @@ class _ArticlePage extends State } ///文章列表 - queryArticleList() async { + queryArticleList(bool isHot) async { if (apiService == null) { SharedPreferences value = await SharedPreferences.getInstance(); apiService = ApiService( @@ -109,7 +112,9 @@ class _ArticlePage extends State "pageSize": 10, "searchKey": "", "state": 1, - "type": 2 + "type": 2, + "storeId":"", + "isHot":isHot }).catchError((onError) { refreshController.refreshFailed(); refreshController.loadFailed(); @@ -118,9 +123,15 @@ class _ArticlePage extends State refreshController.refreshCompleted(); refreshController.loadComplete(); if (pageNum == 1) { + if(!isHot) articles.clear(); + else + articleTop.clear(); } + if(!isHot) articles.addAll(baseData.data.list); + else + articleTop.addAll(baseData.data.list); if (baseData.data.pageNum == baseData.data.pages) { refreshController.loadNoData(); } else { @@ -160,7 +171,8 @@ class _ArticlePage extends State _onRefresh() { queryHeadlinesBanner(); queryHeadlinesList(); //分类列表 - queryArticleList(); + queryArticleList(false); + queryArticleList(true); } @override @@ -182,7 +194,7 @@ class _ArticlePage extends State ), onRefresh: _onRefresh, onLoading: () { - queryArticleList(); + queryArticleList(false); }, physics: BouncingScrollPhysics(), scrollController: scrollController, @@ -227,9 +239,11 @@ class _ArticlePage extends State List classChildItem() { var widgets = [ ///文章banner - HeadlinesBanner( - bannerData, - ), + // HeadlinesBanner( + // bannerData, + // ), + + ActivityTopList(articleTop), SizedBox(height: 28), diff --git a/lib/community/headlines/headlines_column_details.dart b/lib/community/headlines/headlines_column_details.dart index ebf21fd3..0d8e875e 100644 --- a/lib/community/headlines/headlines_column_details.dart +++ b/lib/community/headlines/headlines_column_details.dart @@ -78,7 +78,8 @@ class _HeadlinesColumnDetails extends State "searchKey": "", "state": 1, "type": 2, - "categoryId": categoryId + "categoryId": categoryId, + "isHot":"", }).catchError((onError) { refreshController.refreshFailed(); refreshController.loadFailed(); diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 3e436c43..4b3e26db 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -66,6 +66,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { setState(() {}); } }); + queryMsgStats(); if ((widget.invite ?? "") != "" || widget.interviewCouponList != null && @@ -259,12 +260,13 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { BaseData> baseData = await apiService.stats().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { + totalMsg = 0; baseData.data.forEach((element) { totalMsg += element.number; }); }); - refreshController.loadComplete(); - refreshController.refreshCompleted(); + // refreshController.loadComplete(); + // refreshController.refreshCompleted(); } EasyLoading.dismiss(); } diff --git a/lib/message/system_details.dart b/lib/message/system_details.dart index d6efc02d..4c474773 100644 --- a/lib/message/system_details.dart +++ b/lib/message/system_details.dart @@ -37,13 +37,14 @@ class _SystemDetails extends State { int pageNum = 1; List messages = []; int msgType = 0; - String parenId = "0"; + // String parenId = "0"; var commentFocus = FocusNode(); String hintText = S.current.liuxianinjingcaidepinglunba; bool isKeyBoardShow = false; final GlobalKey commentKey = GlobalKey(); final GlobalKey inputKey = GlobalKey(); final TextEditingController commentTextController = TextEditingController(); + int indexMsg = 0; @override @@ -108,17 +109,18 @@ class _SystemDetails extends State { ///评论 回复 _reply(messageRelational) { - var messageRelational = jsonDecode(messages[0].relational), - parenId = messageRelational["mid"].toString(); + var messageRelational = jsonDecode(messages[indexMsg].relational); + messageRelational["mid"].toString(); hintText = S.of(context).huifu_("${messageRelational["nickname"]}"); } ///动态发布评论 _queryMemberComment(String content) async { + var messageRelational = jsonDecode(messages[indexMsg].relational); BaseData baseData = await apiService.memberComment({ "content": content, - "parentId": parenId, - "relationalId": messages[0].mid, + "parentId": messageRelational["mid"].toString(), + "relationalId":messageRelational["businessId"].toString(), "relationalType":4 }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { @@ -130,7 +132,7 @@ class _SystemDetails extends State { SmartDialog.showToast("发布成功", alignment: Alignment.center); } else{ - SmartDialog.showToast("发布失败", alignment: Alignment.center); + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } @@ -627,14 +629,14 @@ class _SystemDetails extends State { }, ); }, - child: commentMessageItem(messages[position]), + child: commentMessageItem(messages[position],position), ); }), ], ) ); } - Widget commentMessageItem(Message message) { + Widget commentMessageItem(Message message,index) { var messageRelational = jsonDecode(message.relational); return Container( child: @@ -697,6 +699,7 @@ class _SystemDetails extends State { GestureDetector( onTap: (){ setState(() { + indexMsg = index; showDeleteDialog(); _reply(messageRelational); }); diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index 9be81392..f8276451 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -28,7 +28,6 @@ class _SystemMessagePage extends State { ApiService apiService; int pageNum = 1; List messages = []; - List msgStats = []; Map msgNumber = { "1":0, "2":0, @@ -106,9 +105,10 @@ class _SystemMessagePage extends State { BaseData> baseData = await apiService.stats().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { - msgStats.clear(); - msgStats = baseData.data; - msgStats.forEach((element) { + msgNumber.forEach((key, value) { + msgNumber[key] = 0; + }); + baseData.data.forEach((element) { if(msgNumber.containsKey(element.name)){ msgNumber[element.name] = element.number; } diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 24fa7fba..b08fd3cd 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -54,14 +54,14 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 -// const base_url = "http://192.168.10.236:8766/app/"; ///费韬 -// const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 +const base_url = "http://192.168.10.236:8766/app/"; ///费韬 +const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const base_url = "http://192.168.10.159:8766/app/"; ///费韬 // const baseUrl = "http://192.168.10.159:8766/app/"; ///费韬 diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 5735110a..71083690 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; + baseUrl ??= 'http://192.168.10.236:8766/app/'; } final Dio _dio;