Browse Source

签到更改,

头条合集列表更改;
vip更改;
ff_new
w-R 3 years ago
parent
commit
e2b61d43a5
  1. 2
      lib/community/community_course.dart
  2. 5
      lib/community/headlines/article_list.dart
  3. 6
      lib/community/headlines/article_page.dart
  4. 2
      lib/community/headlines/headlines_collection.dart
  5. 73
      lib/community/headlines/headlines_column_details.dart
  6. 4
      lib/integral/integral_page.dart
  7. 161
      lib/integral/intergra_view/integral_vip.dart
  8. 70
      lib/mine/mine_vip/mine_vip_core.dart
  9. 3
      lib/retrofit/data/activity.dart
  10. 5
      lib/retrofit/data/article.dart
  11. 8
      lib/retrofit/retrofit_api.dart
  12. 2
      lib/retrofit/retrofit_api.g.dart
  13. 5
      lib/view_widget/mine_vip_view.dart

2
lib/community/community_course.dart

@ -214,7 +214,7 @@ class _CommunityCourse extends State<CommunityCourse>
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: false,
header: MyHeader(), header: MyHeader(),
physics: ClampingScrollPhysics(), physics: BouncingScrollPhysics(),
onRefresh: _onRefresh, onRefresh: _onRefresh,
scrollController: scrollController, scrollController: scrollController,
child: Container( child: Container(

5
lib/community/headlines/article_list.dart

@ -124,10 +124,7 @@ class _ArticleList extends State<ArticleList> {
Row( Row(
children: [ children: [
Text( Text(
(widget.articles[position] != null && widget.articles != null?widget.articles[position]?.author?.name??"":"",
widget.articles[position].author != null)
? widget.articles[position].author.name
: "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,

6
lib/community/headlines/article_page.dart

@ -20,6 +20,7 @@ import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/store_title_tab.dart'; import 'package:huixiang/view_widget/store_title_tab.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -164,8 +165,7 @@ class _ArticlePage extends State<ArticlePage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
return return Stack(
Stack(
children: [ children: [
Positioned( Positioned(
child: Container( child: Container(
@ -174,7 +174,7 @@ class _ArticlePage extends State<ArticlePage>
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: false,
header: MyHeader(), header: MyHeader(),
physics: ClampingScrollPhysics(), physics: BouncingScrollPhysics(),
onRefresh: _onRefresh, onRefresh: _onRefresh,
scrollController: scrollController, scrollController: scrollController,
child: Container( child: Container(

2
lib/community/headlines/headlines_collection.dart

@ -48,7 +48,7 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
onTap: () { onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/headlines_column_details', '/router/headlines_column_details',
arguments: {"id":widget.headlines[position].id, arguments: {"categoryId":widget.articles[position].categoryId,
"articles":widget.articles}); "articles":widget.articles});
}, },
child: headlinesCollectionItem(widget.headlines[position]), child: headlinesCollectionItem(widget.headlines[position]),

73
lib/community/headlines/headlines_column_details.dart

@ -6,10 +6,13 @@ import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/headlines_list.dart'; import 'package:huixiang/retrofit/data/headlines_list.dart';
import 'package:huixiang/retrofit/data/headlines_list_details.dart'; import 'package:huixiang/retrofit/data/headlines_list_details.dart';
import 'package:huixiang/retrofit/data/page.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/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
class HeadlinesColumnDetails extends StatefulWidget { class HeadlinesColumnDetails extends StatefulWidget {
@ -29,14 +32,17 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
List<Article> articles; List<Article> articles;
HeadlinesListDetails headlinesListDetails; HeadlinesListDetails headlinesListDetails;
List<HeadlinesList> headlines = []; List<HeadlinesList> headlines = [];
final RefreshController refreshController = RefreshController();
int pageNum = 1;
final ScrollController scrollController = ScrollController();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
articles = widget.arguments["articles"]; articles = widget.arguments["articles"];
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
queryHeadlinesDetails(widget.arguments["id"]); queryHeadlinesDetails(widget.arguments["categoryId"]);
queryHeadlinesList(widget.arguments["id"]); queryArticleList(widget.arguments["categoryId"]);
} }
/// ///
@ -58,8 +64,8 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
} }
} }
/// ///
queryHeadlinesList(id) async { queryArticleList(categoryId) async {
if (apiService == null) { if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService( apiService = ApiService(
@ -68,24 +74,54 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
token: value.getString("token"), token: value.getString("token"),
); );
} }
BaseData<List<HeadlinesList>> baseData = await apiService.headlinesList().catchError((onError) {}); BaseData<PageInfo<Article>> baseData = await apiService.queryArticle({
"pageNum": pageNum,
"pageSize": 10,
"searchKey": "",
"state": 1,
"type": 2,
"categoryId":widget.arguments["categoryId"]
}).catchError((onError){
refreshController.refreshFailed();
refreshController.loadFailed();
});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { refreshController.refreshCompleted();
headlines.clear(); refreshController.loadComplete();
headlines.addAll(baseData.data); if(pageNum == 1) {
headlines.forEach((element) { articles.clear();
// collectCourse(element.id); }
}); articles.addAll(baseData.data.list);
}); if (baseData.data.pageNum == baseData.data.pages) {
refreshController.loadNoData();
} else {
pageNum += 1;
}
setState(() {});
} else {
refreshController.refreshFailed();
refreshController.loadFailed();
} }
EasyLoading.dismiss(); }
_onRefresh(){
queryHeadlinesDetails(widget.arguments["categoryId"]);
queryArticleList(widget.arguments["categoryId"]);//
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: Container( body: Container(
child: Column( child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: ClampingScrollPhysics(),
onRefresh: _onRefresh,
scrollController: scrollController,
child:Column(
children: [ children: [
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
@ -215,7 +251,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
), ),
ListView.builder( ListView.builder(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemCount:headlines == null ? 0 : headlines.length, itemCount:articles.length,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -240,7 +276,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
), ),
], ],
), ),
), ),)
); );
} }
@ -289,10 +325,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
Row( Row(
children: [ children: [
Text( Text(
(articles != null && articles?.author?.name ?? "",
articles.author != null)
? articles.author.name
: "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,

4
lib/integral/integral_page.dart

@ -127,7 +127,9 @@ class _IntegralPage extends State<IntegralPage> {
return Column( return Column(
children: [ children: [
/// VIP等级显示 /// VIP等级显示
IntegralVip(rankLevel, signInfo, userInfo), IntegralVip(rankLevel, signInfo, userInfo,"${ (signInfo?.signInList?.length ) ?? "0"}",
((signInfo?.rewardList != null && signInfo.rewardList.length > (signInfo?.signInList?.length ?? 0)) ?
signInfo.rewardList[signInfo?.signInList?.length ?? 0]:0).toString()),
/// ///
InForPoints(signInfo, _signIn), InForPoints(signInfo, _signIn),

161
lib/integral/intergra_view/integral_vip.dart

@ -4,14 +4,17 @@ import 'package:huixiang/retrofit/data/sign_info.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/custom_image.dart';
class IntegralVip extends StatefulWidget { class IntegralVip extends StatefulWidget {
final SignInfo signInfo; final SignInfo signInfo;
final UserInfo userinfo; final UserInfo userinfo;
final rankLevel; final rankLevel;
final String day;
final String integral;
IntegralVip(this.rankLevel, this.signInfo, this.userinfo); IntegralVip(this.rankLevel, this.signInfo, this.userinfo,this.day,this.integral);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -25,83 +28,119 @@ class _IntegralVip extends State<IntegralVip> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 16.h), padding: EdgeInsets.symmetric(vertical: 16.h,horizontal: 16.w),
child: Row( child: Row(
children: [ children: [
MImage(
widget.userinfo != null ? widget.userinfo.headimg : "",
width: 50,
height: 50,
isCircle: true,
fit: BoxFit.cover,
errorSrc: "assets/image/default_user.png",
fadeSrc: "assets/image/default_user.png",
),
Expanded( Expanded(
flex: 1, child: Container(
child: Column( margin: EdgeInsets.only(left: 15.w),
mainAxisAlignment: MainAxisAlignment.center, height: 50.h,
crossAxisAlignment: CrossAxisAlignment.center, child: Column(
children: [ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Text( crossAxisAlignment: CrossAxisAlignment.start,
widget.signInfo != null ? "${widget.signInfo.point}" : "0", children: [
style: TextStyle( Text(
fontWeight: MyFontWeight.medium, S.of(context).ninyilianxuqiandaotian(widget.day),
fontSize: 21.sp, style: TextStyle(
color: Colors.white, fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
), ),
), Text(
SizedBox( "明日签到可获得${widget.integral}积分",
height: 6.h, style: TextStyle(
), fontSize: 12.sp,
Text( fontWeight: MyFontWeight.regular,
S.of(context).wodejifenzhi, color: Colors.white,
style: TextStyle( ),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFF2F2F2),
), ),
) ],
], ),
), ),
flex: 1,
), ),
Container( Container(
width: 2.w, margin: EdgeInsets.only(left: 15.w),
height: 32.h, height: 50.h,
color: Color(0xFFFFFFFF), child: Row(
), mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Image.asset(
"assets/image/icon_gold_coin.png",
width: 20,
height: 20,
),
SizedBox(
width:6.w,
),
Text( Text(
(widget?.signInfo?.rank?.rankName != null) widget?.userinfo?.points ?? "",
? "${widget.signInfo.rank.rankName.replaceAll("会员", "")}"
: "",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontSize: 14.sp,
fontSize: 21.sp,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.bold,
), ),
), ),
SizedBox(
height: 6.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).wodehuiyuandengji,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFF2F2F2),
),
),
// Icon(
// Icons.keyboard_arrow_right,
// color: Colors.white,
// size: 15,
// ),
],
),
], ],
), ),
), )
// Container(
// width: 2.w,
// height: 32.h,
// color: Color(0xFFFFFFFF),
// ),
// Expanded(
// flex: 1,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text(
// (widget?.signInfo?.rank?.rankName != null)
// ? "${widget.signInfo.rank.rankName.replaceAll("会员", "")}"
// : "",
// style: TextStyle(
// fontWeight: MyFontWeight.medium,
// fontSize: 21.sp,
// color: Colors.white,
// ),
// ),
// SizedBox(
// height: 6.h,
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text(
// S.of(context).wodehuiyuandengji,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// color: Color(0xFFF2F2F2),
// ),
// ),
// // Icon(
// // Icons.keyboard_arrow_right,
// // color: Colors.white,
// // size: 15,
// // ),
// ],
// ),
// ],
// ),
// ),
], ],
), ),
); );

70
lib/mine/mine_vip/mine_vip_core.dart

@ -520,39 +520,6 @@ class _MineVipCore extends State<MineVipCore> {
], ],
), ),
), ),
if (ranks.length > checkIndex &&
widget.arguments["rankLevel"] < ranks[checkIndex].level &&
ranks[checkIndex].price != "0.00")
InkWell(
onTap: () {
setState(() {
buyRank();
});
},
child: Container(
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color(0xFFFFDCA1),
Color(0xFFFAE4C0),
]),
),
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(16),
height: 54,
alignment: Alignment.center,
child: Text(
"${S.of(context).lijikaitong}${ranks.length > checkIndex ? ranks[checkIndex].price : ""}/永久",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16.sp,
color: Color(0xFF4A4748),
),
),
),
),
], ],
), ),
), ),
@ -561,6 +528,43 @@ class _MineVipCore extends State<MineVipCore> {
)), )),
], ],
), ),
if (ranks.length > checkIndex &&
widget.arguments["rankLevel"] < ranks[checkIndex].level &&
ranks[checkIndex].price != "0.00")
Align(
alignment: Alignment.bottomCenter,
child: InkWell(
onTap: () {
setState(() {
buyRank();
});
},
child: Container(
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color(0xFFFFDCA1),
Color(0xFFFAE4C0),
]),
),
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(16),
height: 54,
alignment: Alignment.center,
child: Text(
"${S.of(context).lijikaitong}${ranks.length > checkIndex ? ranks[checkIndex].price : ""}/永久",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16.sp,
color: Color(0xFF4A4748),
),
),
),
),
)
], ],
); );

3
lib/retrofit/data/activity.dart

@ -13,6 +13,7 @@ class Activity {
String coverImg; String coverImg;
String startTime; String startTime;
String endTime; String endTime;
String categoryId;
int state; int state;
int isDelete; int isDelete;
int likes; int likes;
@ -33,6 +34,7 @@ class Activity {
..coverImg = json['coverImg'] ..coverImg = json['coverImg']
..startTime = json['startTime'] ..startTime = json['startTime']
..endTime = json['endTime'] ..endTime = json['endTime']
..categoryId = json['categoryId']
..state = json['state'] ..state = json['state']
..isDelete = json['isDelete'] ..isDelete = json['isDelete']
..likes = json["likes"] ..likes = json["likes"]
@ -53,6 +55,7 @@ class Activity {
'coverImg': this.coverImg, 'coverImg': this.coverImg,
'startTime': this.startTime, 'startTime': this.startTime,
'endTime': this.endTime, 'endTime': this.endTime,
'categoryId': this.categoryId,
'state': this.state, 'state': this.state,
'isDelete': this.isDelete, 'isDelete': this.isDelete,
'likes': this.likes, 'likes': this.likes,

5
lib/retrofit/data/article.dart

@ -17,6 +17,7 @@ class Article {
Author _author; Author _author;
int _type; int _type;
String _startTime; String _startTime;
String _categoryId;
String _endTime; String _endTime;
int _state; int _state;
int _isDelete; int _isDelete;
@ -41,6 +42,7 @@ class Article {
Author get author => _author; Author get author => _author;
int get type => _type; int get type => _type;
String get startTime => _startTime; String get startTime => _startTime;
String get categoryId => _categoryId;
String get endTime => _endTime; String get endTime => _endTime;
int get state => _state; int get state => _state;
int get isDelete => _isDelete; int get isDelete => _isDelete;
@ -102,6 +104,7 @@ class Article {
_author = author; _author = author;
_type = type; _type = type;
_startTime = startTime; _startTime = startTime;
_categoryId = categoryId;
_endTime = endTime; _endTime = endTime;
_state = state; _state = state;
_isDelete = isDelete; _isDelete = isDelete;
@ -127,6 +130,7 @@ class Article {
_author = json["author"] == null ? null : Author.fromJson(jsonDecode(json["author"])); _author = json["author"] == null ? null : Author.fromJson(jsonDecode(json["author"]));
_type = json["type"]; _type = json["type"];
_startTime = json["startTime"]; _startTime = json["startTime"];
_categoryId = json["categoryId"];
_endTime = json["endTime"]; _endTime = json["endTime"];
_state = json["state"]; _state = json["state"];
_isDelete = json["isDelete"]; _isDelete = json["isDelete"];
@ -153,6 +157,7 @@ class Article {
map["author"] = _author.toJson(); map["author"] = _author.toJson();
map["type"] = _type; map["type"] = _type;
map["startTime"] = _startTime; map["startTime"] = _startTime;
map["categoryId"] = _categoryId;
map["endTime"] = _endTime; map["endTime"] = _endTime;
map["state"] = _state; map["state"] = _state;
map["isDelete"] = _isDelete; map["isDelete"] = _isDelete;

8
lib/retrofit/retrofit_api.dart

@ -53,11 +53,11 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const base_url = "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 baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// const base_url = "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 baseUrl = "http://192.168.10.236:8766/app/"; ///
// const base_url = "http://192.168.10.37:8766/app/"; // const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";

2
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService { class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) { _ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; baseUrl ??= 'http://192.168.10.236:8766/app/';
} }
final Dio _dio; final Dio _dio;

5
lib/view_widget/mine_vip_view.dart

@ -244,9 +244,9 @@ class MineVipView extends StatelessWidget {
color: textColor, color: textColor,
), ),
), ),
if(vipLevel == 3) if(vipLevel == 3 && !(showRank??true))
TextSpan( TextSpan(
text: "${S.of(context).lijikaitong}${price??""}/永久", text: "${price??""}/永久" ,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -289,7 +289,6 @@ class MineVipView extends StatelessWidget {
(createTime != null && createTime != "") (createTime != null && createTime != "")
? createTime.split(" ")[0] ? createTime.split(" ")[0]
: "$createTime" : "$createTime"
// createTime ?? ""
), ),
style: TextStyle( style: TextStyle(
color: textColor, color: textColor,

Loading…
Cancel
Save