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

8
lib/home/home_page.dart

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

10
lib/home/main_home_page.dart

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

10
lib/login/login_page.dart

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

2
lib/main.dart

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

15
lib/main_page.dart

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

2
lib/message/system_details.dart

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

74
lib/mine/release_page.dart

@ -3,7 +3,6 @@ import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/community/community_list.dart';
import 'package:huixiang/community/community_view/community_dynamic.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/data/article.dart';
@ -26,25 +25,24 @@ class ReleasePage extends StatefulWidget {
class _ReleasePage extends State<ReleasePage> {
RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
ApiService apiService;
int pageNum = 0;
String userId;
bool isLoadMore = false;
List<ComunityComment> comments = [];
List<Article> articles = [];
@override
void initState() {
super.initState();
_onRefresh();
}
_onRefresh() async {
queryCommunity();
pageNum = 0;
setState(() {});
}
///
queryCommunity() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
@ -55,10 +53,7 @@ class _ReleasePage extends State<ReleasePage> {
token: value.getString("token"),
);
}
if(isLoadMore){
pageNum += 1;
isLoadMore = false;
}else pageNum = 1;
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({
"onlyFollow": false,
"onlyMe": true,
@ -74,9 +69,23 @@ class _ReleasePage extends State<ReleasePage> {
refreshController.loadComplete();
if (baseData.isSuccess) {
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}");
if (int.tryParse(baseData.data.total) < (pageNum * 10)) {
refreshController.loadNoData();
@ -110,35 +119,34 @@ class _ReleasePage extends State<ReleasePage> {
),
onRefresh: _onRefresh,
onLoading: () {
isLoadMore = true;
_onRefresh();
setState(() {});
},
scrollController: scrollController,
child: Container(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
// color: Color(0xFFF7F7F7),
// margin: EdgeInsets.only(top: 16.h),
child: Column(
children: [
CommunityList(
comments,
userId,
child: ListView.builder(
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return InkWell(
child: CommunityDynamic(
articles[position],
1,
isList: true,
exitFull: () {
exitFull: (){setState(() {
_onRefresh();
},
});},
removalDynamic: () {
_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) {
return Container(

Loading…
Cancel
Save