Browse Source

推送更改

ff_new
w-R 3 years ago
parent
commit
d0851ab24d
  1. 16
      lib/community/community_view/community_dynamic.dart
  2. 8
      lib/home/home_page.dart
  3. 10
      lib/home/main_home_page.dart
  4. 10
      lib/login/login_page.dart
  5. 2
      lib/main.dart
  6. 15
      lib/main_page.dart
  7. 2
      lib/message/system_details.dart
  8. 74
      lib/mine/release_page.dart
  9. 2
      lib/settlement/settlement_view/pay_method.dart

16
lib/community/community_view/community_dynamic.dart

@ -227,10 +227,10 @@ class _CommunityDynamic extends State<CommunityDynamic> {
onTap: () { onTap: () {
setState(() { setState(() {
if (widget.commentType == 0) { if (widget.commentType == 0) {
widget.article.liked = widget.article.isFollow =
!(widget.article.liked ?? false); !(widget.article.isFollow ?? false);
_vipFollow(widget.article.updateUser, _vipFollow(widget.article.updateUser,
widget.article.liked ?? false); widget.article.isFollow ?? false);
} else { } else {
showDeleteDialog(); showDeleteDialog();
} }
@ -243,21 +243,21 @@ class _CommunityDynamic extends State<CommunityDynamic> {
alignment: Alignment.center, alignment: Alignment.center,
child: RoundButton( child: RoundButton(
height: 25.h, height: 25.h,
backgroup: (widget?.article?.liked ?? false) backgroup: (widget?.article?.isFollow ?? false)
? Color(0xFFE6E6E6) ? Color(0xFFE6E6E6)
: Color(0xFF32A060), : Color(0xFF32A060),
textColor: (widget?.article?.liked ?? false) textColor: (widget?.article?.isFollow ?? false)
? Color(0xFF808080) ? Color(0xFF808080)
: Colors.white, : Colors.white,
text: (widget?.article?.liked ?? false) text: (widget?.article?.isFollow ?? false)
? "已关注" ? "已关注"
: "关注", : "关注",
radius: 20, radius: 20,
icons: Icon( icons: Icon(
(widget?.article?.liked ?? false) (widget?.article?.isFollow ?? false)
? Icons.check ? Icons.check
: Icons.add, : Icons.add,
color: (widget?.article?.liked ?? false) color: (widget?.article?.isFollow ?? false)
? Color(0xFF808080) ? Color(0xFF808080)
: Colors.white, : Colors.white,
size: 15, size: 15,

8
lib/home/home_page.dart

@ -49,16 +49,16 @@ class HomePage extends StatefulWidget {
final List<InterviewCouponList> interviewCouponList; final List<InterviewCouponList> interviewCouponList;
final List<FirstLoginCouponList> firstLoginCouponList; final List<FirstLoginCouponList> firstLoginCouponList;
HomePage(this.changeTab, HomePage(Key key, this.changeTab,
{this.invite, this.interviewCouponList, this.firstLoginCouponList}); {this.invite, this.interviewCouponList, this.firstLoginCouponList}): super(key: key);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _HomePage(); return HomePageState();
} }
} }
class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin { class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
ApiService apiService; ApiService apiService;
@override @override

10
lib/home/main_home_page.dart

@ -28,11 +28,11 @@ class _MainHomePage extends State<MainHomePage>
tabcontroller = TabController(length: 3, vsync: this); tabcontroller = TabController(length: 3, vsync: this);
_widgetOptions = <Widget>[ _widgetOptions = <Widget>[
HomePage(() { // HomePage(() {
setState(() { // setState(() {
tabcontroller.index = 2; // tabcontroller.index = 2;
}); // });
}), // }),
ActivityListPage(), ActivityListPage(),
PointsMallPage() PointsMallPage()
]; ];

10
lib/login/login_page.dart

@ -526,11 +526,11 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
controller: scrollController, controller: scrollController,
physics: PageScrollPhysics().applyTo(ClampingScrollPhysics()), physics: PageScrollPhysics().applyTo(ClampingScrollPhysics()),
child: SizedBox( child: SizedBox(
height: MediaQuery.of(context).size.height * 1.47, height: MediaQuery.of(context).size.height * 1.50,
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.6244, height: MediaQuery.of(context).size.height * 0.5980,
), ),
Expanded( Expanded(
child: Container( child: Container(
@ -706,7 +706,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
), ),
), ),
Container( Container(
height:35.h, height:25.h,
width: MediaQuery.of(context).size.width - 80.h, width: MediaQuery.of(context).size.width - 80.h,
// margin: EdgeInsets.only(top: 12.h), // margin: EdgeInsets.only(top: 12.h),
child: TextField( child: TextField(
@ -773,7 +773,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
), ),
), ),
Container( Container(
height:35.h, height:25.h,
width: MediaQuery.of(context).size.width - 80.h, width: MediaQuery.of(context).size.width - 80.h,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
@ -923,7 +923,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
), ),
), ),
Container( Container(
height:35.h, height:25.h,
width: MediaQuery.of(context).size.width - 80.h, width: MediaQuery.of(context).size.width - 80.h,
child: TextField( child: TextField(
style: TextStyle( style: TextStyle(

2
lib/main.dart

@ -112,7 +112,7 @@ void main() async {
runApp(MyApp(locale, isFirst)); runApp(MyApp(locale, isFirst));
// FlutterBugly.postCatchedException((){ // FlutterBugly.postCatchedException((){
// }); // });
// FlutterBugly.init(androidAppId: "85ed24e0ec",iOSAppId: "b8a258b0bc"); // FlutterBugly.init(androidAppId: "204f207673",iOSAppId: "8bb92ba0f6");
} }
final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin();

15
lib/main_page.dart

@ -37,6 +37,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
List<Widget> _widgetOptions; List<Widget> _widgetOptions;
List<String> icons; List<String> icons;
final GlobalKey homePageKey = GlobalKey();
// List<String> iconn; // List<String> iconn;
@override @override
@ -95,7 +96,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
_widgetOptions = <Widget>[ _widgetOptions = <Widget>[
// BrandPage(), // BrandPage(),
HomePage((index) { HomePage(homePageKey,(index) {
setState(() { setState(() {
pageController.jumpToPage(index); pageController.jumpToPage(index);
}); });
@ -140,7 +141,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
); );
} }
/// @typed: 1 2 3 4 5 /// @typed: 1 2 3 4 5 6
xgFlutterPlugin.addEventHandler(xgPushClickAction: (event) async { xgFlutterPlugin.addEventHandler(xgPushClickAction: (event) async {
print("xgPushClickAction1: $event"); print("xgPushClickAction1: $event");
if (event["actionType"] == 2) return event; if (event["actionType"] == 2) return event;
@ -162,6 +163,12 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
} }
return event; return event;
}, onReceiveNotificationResponse: (event) async { }, onReceiveNotificationResponse: (event) async {
try{
if(jsonDecode(event["customMessage"])["typed"] == 6){
HomePageState state = homePageKey.currentState;
state.queryMsgStats();
}
}catch(ex){}
print("onReceiveNotificationResponse: ${event.toString()}"); print("onReceiveNotificationResponse: ${event.toString()}");
return event; return event;
}, onReceiveMessage: (event) async { }, onReceiveMessage: (event) async {
@ -215,6 +222,10 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
routeName = "/router/order_details"; routeName = "/router/order_details";
params["id"] = pushMap["info"]; params["id"] = pushMap["info"];
break; break;
case 6:
routeName = "/router/community_details";
params["businessId"] = pushMap["info"];
break;
} }
sharedPreferences.setString("pushData", ""); sharedPreferences.setString("pushData", "");
print("xgPushClickAction: routeName: $routeName"); print("xgPushClickAction: routeName: $routeName");

2
lib/message/system_details.dart

@ -565,7 +565,7 @@ class _SystemDetails extends State<SystemDetails> {
), ),
SizedBox(width:2.w), SizedBox(width:2.w),
Expanded(child:Text( Expanded(child:Text(
messageRelational["content"], messageRelational["content"] ?? "",
maxLines: 2, maxLines: 2,
overflow:TextOverflow.ellipsis, overflow:TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(

74
lib/mine/release_page.dart

@ -3,7 +3,6 @@ import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/community/community_list.dart';
import 'package:huixiang/community/community_view/community_dynamic.dart'; import 'package:huixiang/community/community_view/community_dynamic.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/article.dart';
@ -26,25 +25,24 @@ class ReleasePage extends StatefulWidget {
class _ReleasePage extends State<ReleasePage> { class _ReleasePage extends State<ReleasePage> {
RefreshController refreshController = RefreshController(); RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
ApiService apiService; ApiService apiService;
int pageNum = 0; int pageNum = 0;
String userId; String userId;
bool isLoadMore = false;
List<ComunityComment> comments = []; List<Article> articles = [];
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_onRefresh(); _onRefresh();
} }
_onRefresh() async { _onRefresh() async {
queryCommunity(); pageNum = 0;
setState(() {});
} }
///
queryCommunity() async { queryCommunity() async {
if (apiService == null) { if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
@ -55,10 +53,7 @@ class _ReleasePage extends State<ReleasePage> {
token: value.getString("token"), token: value.getString("token"),
); );
} }
if(isLoadMore){
pageNum += 1; pageNum += 1;
isLoadMore = false;
}else pageNum = 1;
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({ BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({
"onlyFollow": false, "onlyFollow": false,
"onlyMe": true, "onlyMe": true,
@ -74,9 +69,23 @@ class _ReleasePage extends State<ReleasePage> {
refreshController.loadComplete(); refreshController.loadComplete();
if (baseData.isSuccess) { if (baseData.isSuccess) {
if (pageNum == 1) { if (pageNum == 1) {
comments.clear(); articles.clear();
} }
comments.addAll(baseData.data.list); baseData.data.list.forEach((element) {
var article = Article();
article.id = element.id;
article.content = jsonEncode(element.subjectInfo);
article.mainTitle =element.subject;
article.liked = element.selfFollow;
article.authorHeadImg = element.memberInfo?.avatar;
article.authorName = element.memberInfo?.nickname;
article.createTime = element.createTime;
article.updateUser = element.memberInfo?.mid;
article.viewers = element?.viewers;
article.likes = element?.likes;
article.comments = element?.comments;
articles.add(article);
});
// print("comments: ${comments.length}"); // print("comments: ${comments.length}");
if (int.tryParse(baseData.data.total) < (pageNum * 10)) { if (int.tryParse(baseData.data.total) < (pageNum * 10)) {
refreshController.loadNoData(); refreshController.loadNoData();
@ -110,35 +119,34 @@ class _ReleasePage extends State<ReleasePage> {
), ),
onRefresh: _onRefresh, onRefresh: _onRefresh,
onLoading: () { onLoading: () {
isLoadMore = true; setState(() {});
_onRefresh();
}, },
scrollController: scrollController, child: ListView.builder(
child: Container( physics: NeverScrollableScrollPhysics(),
child: SingleChildScrollView( itemBuilder: (context, position) {
physics: BouncingScrollPhysics(), return InkWell(
child: Container( child: CommunityDynamic(
// color: Color(0xFFF7F7F7), articles[position],
// margin: EdgeInsets.only(top: 16.h),
child: Column(
children: [
CommunityList(
comments,
userId,
1, 1,
isList: true, exitFull: (){setState(() {
exitFull: () {
_onRefresh(); _onRefresh();
}, });},
removalDynamic: () { removalDynamic: () {
_onRefresh(); _onRefresh();
}, },
), ),
], onTap: () {
), Navigator.of(context).pushNamed(
), '/router/community_details',
), arguments: {
),), "businessId": articles[position].id,"userId":userId,
},
);
},
);
},
itemCount: articles.length,
)),
); );
}, },
); );

2
lib/settlement/settlement_view/pay_method.dart

@ -190,7 +190,7 @@ class _PayMethod extends State<PayMethod> {
); );
} }
var checkIndex = 1; var checkIndex = 3;
Widget checkView(var index) { Widget checkView(var index) {
return Container( return Container(

Loading…
Cancel
Save