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. 71
      lib/community/headlines/headlines_column_details.dart
  6. 4
      lib/integral/integral_page.dart
  7. 133
      lib/integral/intergra_view/integral_vip.dart
  8. 22
      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,
enablePullUp: false,
header: MyHeader(),
physics: ClampingScrollPhysics(),
physics: BouncingScrollPhysics(),
onRefresh: _onRefresh,
scrollController: scrollController,
child: Container(

5
lib/community/headlines/article_list.dart

@ -124,10 +124,7 @@ class _ArticleList extends State<ArticleList> {
Row(
children: [
Text(
(widget.articles[position] != null &&
widget.articles[position].author != null)
? widget.articles[position].author.name
: "",
widget.articles != null?widget.articles[position]?.author?.name??"":"",
style: TextStyle(
fontSize: 12.sp,
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/view_widget/classic_header.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:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
@ -164,8 +165,7 @@ class _ArticlePage extends State<ArticlePage>
@override
Widget build(BuildContext context) {
super.build(context);
return
Stack(
return Stack(
children: [
Positioned(
child: Container(
@ -174,7 +174,7 @@ class _ArticlePage extends State<ArticlePage>
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: ClampingScrollPhysics(),
physics: BouncingScrollPhysics(),
onRefresh: _onRefresh,
scrollController: scrollController,
child: Container(

2
lib/community/headlines/headlines_collection.dart

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

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

4
lib/integral/integral_page.dart

@ -127,7 +127,9 @@ class _IntegralPage extends State<IntegralPage> {
return Column(
children: [
/// 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),

133
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/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/custom_image.dart';
class IntegralVip extends StatefulWidget {
final SignInfo signInfo;
final UserInfo userinfo;
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
State<StatefulWidget> createState() {
@ -25,83 +28,119 @@ class _IntegralVip extends State<IntegralVip> {
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(vertical: 16.h),
padding: EdgeInsets.symmetric(vertical: 16.h,horizontal: 16.w),
child: Row(
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(
flex: 1,
child: Container(
margin: EdgeInsets.only(left: 15.w),
height: 50.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.signInfo != null ? "${widget.signInfo.point}" : "0",
S.of(context).ninyilianxuqiandaotian(widget.day),
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
fontSize: 21.sp,
color: Colors.white,
),
),
SizedBox(
height: 6.h,
),
Text(
S.of(context).wodejifenzhi,
"明日签到可获得${widget.integral}积分",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFF2F2F2),
color: Colors.white,
),
),
)
],
),
),
Container(
width: 2.w,
height: 32.h,
color: Color(0xFFFFFFFF),
),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
),
Container(
margin: EdgeInsets.only(left: 15.w),
height: 50.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
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,
),
Image.asset(
"assets/image/icon_gold_coin.png",
width: 20,
height: 20,
),
SizedBox(
height: 6.h,
width:6.w,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).wodehuiyuandengji,
widget?.userinfo?.points ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFF2F2F2),
),
fontSize: 14.sp,
color: Colors.white,
fontWeight: FontWeight.bold,
),
// 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,
// // ),
// ],
// ),
// ],
// ),
// ),
],
),
);

22
lib/mine/mine_vip/mine_vip_core.dart

@ -520,10 +520,20 @@ class _MineVipCore extends State<MineVipCore> {
],
),
),
],
),
),
],
),
)),
],
),
if (ranks.length > checkIndex &&
widget.arguments["rankLevel"] < ranks[checkIndex].level &&
ranks[checkIndex].price != "0.00")
InkWell(
Align(
alignment: Alignment.bottomCenter,
child: InkWell(
onTap: () {
setState(() {
buyRank();
@ -553,14 +563,8 @@ class _MineVipCore extends State<MineVipCore> {
),
),
),
],
),
),
],
),
)),
],
),
)
],
);

3
lib/retrofit/data/activity.dart

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

5
lib/retrofit/data/article.dart

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

8
lib/retrofit/retrofit_api.dart

@ -53,11 +53,11 @@ 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://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.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 {
_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;

5
lib/view_widget/mine_vip_view.dart

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

Loading…
Cancel
Save