Browse Source

Merge remote-tracking branch 'origin/remove_uniapp' into remove_uniapp

ff_new
fmk 3 years ago
parent
commit
b51bdae912
  1. BIN
      assets/image/2x/c_z.png
  2. BIN
      assets/image/2x/icon_gz.png
  3. BIN
      assets/image/2x/icon_pl.png
  4. BIN
      assets/image/2x/icon_z.png
  5. BIN
      assets/image/3x/c_z.png
  6. BIN
      assets/image/3x/icon_gz.png
  7. BIN
      assets/image/3x/icon_pl.png
  8. BIN
      assets/image/3x/icon_z.png
  9. BIN
      assets/image/c_z.png
  10. BIN
      assets/image/icon_gz.png
  11. BIN
      assets/image/icon_pl.png
  12. BIN
      assets/image/icon_z.png
  13. 31
      lib/community/community_child_page.dart
  14. 53
      lib/community/community_details.dart
  15. 94
      lib/community/community_view/community_dynamic.dart
  16. 95
      lib/community/headlines/headlines_collection.dart
  17. 24
      lib/community/headlines/headlines_column_details.dart
  18. 156
      lib/home/home_page.dart
  19. 61
      lib/home/home_view/featured_acticvity.dart
  20. 2
      lib/home/home_view/quick_order.dart
  21. 41
      lib/home/home_view/shortcut_operation.dart
  22. 5
      lib/home/points_mall_view/points_goods_title.dart
  23. 24
      lib/login/login_page.dart
  24. 3
      lib/main.dart
  25. 1108
      lib/message/system_details.dart
  26. 658
      lib/message/system_message.dart
  27. 69
      lib/mine/mine_page.dart
  28. 179
      lib/mine/mine_view/mine_item.dart
  29. 8
      lib/mine/mine_view/mine_view.dart
  30. 29
      lib/mine/mine_wallet_page.dart
  31. 34
      lib/mine/release_page.dart
  32. 2
      lib/order/order_view/order_commodity.dart
  33. 130
      lib/retrofit/data/article.dart
  34. 129
      lib/retrofit/data/message.dart
  35. 29
      lib/retrofit/data/msg_stats.dart
  36. 2
      lib/retrofit/min_api.dart
  37. 9
      lib/retrofit/retrofit_api.dart
  38. 22
      lib/retrofit/retrofit_api.g.dart
  39. 2
      lib/settlement/settlement_view/settlement_order_commodity.dart
  40. 2
      lib/store/store_order.dart
  41. 2
      lib/store/store_view/store_info.dart
  42. 3
      lib/view_widget/item_input_widget.dart
  43. 8
      lib/view_widget/request_permission.dart

BIN
assets/image/2x/c_z.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
assets/image/2x/icon_gz.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
assets/image/2x/icon_pl.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
assets/image/2x/icon_z.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
assets/image/3x/c_z.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
assets/image/3x/icon_gz.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
assets/image/3x/icon_pl.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
assets/image/3x/icon_z.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets/image/c_z.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 955 B

BIN
assets/image/icon_gz.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
assets/image/icon_pl.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/image/icon_z.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

31
lib/community/community_child_page.dart

@ -1,6 +1,9 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/community/community_view/community_dynamic.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/comunity_comment.dart';
import 'package:huixiang/retrofit/data/page.dart';
@ -27,7 +30,7 @@ class _CommunityChildPage extends State<CommunityChildPage> {
int pageNum = 0;
String userId;
List<ComunityComment> comments = [];
List<Article> articles = [];
@override
void initState() {
@ -67,11 +70,25 @@ class _CommunityChildPage extends State<CommunityChildPage> {
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);
});
// comments.sort((a,b)=>b.createTime.compareTo(a.createTime));
print("comments: ${comments.length}");
// print("comments: ${comments.length}");
if (int.tryParse(baseData.data.total) < (pageNum * 10)) {
refreshController.loadNoData();
}
@ -103,7 +120,7 @@ class _CommunityChildPage extends State<CommunityChildPage> {
itemBuilder: (context, position) {
return InkWell(
child: CommunityDynamic(
comments[position],
articles[position],
0,
userId: userId,
isList: true,
@ -117,14 +134,14 @@ class _CommunityChildPage extends State<CommunityChildPage> {
Navigator.of(context).pushNamed(
'/router/community_details',
arguments: {
"comment": comments[position],
"businessId": articles[position].id,
"userId": userId,
},
);
},
);
},
itemCount: comments.length,
itemCount: articles.length,
),
);
},

53
lib/community/community_details.dart

@ -30,7 +30,7 @@ class CommunityDetails extends StatefulWidget {
class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObserver {
double height = 0;
double commentHeight = 60.h;
ComunityComment comunity;
// ComunityComment comunity;
String parenId = "0";
final GlobalKey commentKey = GlobalKey();
final ScrollController scrollController = ScrollController();
@ -43,6 +43,8 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
bool isKeyBoardShow = false;
int commentTotal = 0;
Article article;
String businessId;
@override
void didChangeMetrics() {
@ -72,15 +74,16 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
@override
void initState() {
super.initState();
comunity = widget.arguments["comment"];
// comunity = widget.arguments["comment"];
businessId = widget.arguments["businessId"];
WidgetsBinding.instance.addObserver(this);
_queryMemberCommentList();
queryDetails();
queryDetails(businessId);
}
///
queryDetails() async {
queryDetails(id) async {
SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null)
apiService = ApiService(
@ -88,11 +91,15 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
context: context,
token: value.getString("token"),
);
BaseData<Article> baseData = await apiService.informationInfo(comunity.id)
BaseData<Article> baseData = await apiService.informationInfo(id)
.catchError((onError) {
debugPrint(onError.toString());
});
if (baseData != null && baseData.isSuccess) {}
if (baseData != null && baseData.isSuccess) {
setState(() {
article = baseData.data;
});
}
}
@override
@ -114,13 +121,14 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
physics: BouncingScrollPhysics(),
child: Column(
children: [
if(article != null)
CommunityDynamic(
comunity,
article,
0,
exitFull: () {
setState(() {});
},
userId:widget.arguments["userId"],
userId:widget.arguments !=null ? widget.arguments["userId"] :widget.arguments["mid"],
itemCount: 3,
isDetails: true,
heightFun: (height) {
@ -136,9 +144,9 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
),
CommentList(
commentKey,
comunity?.likes ?? comunity?.likes.toString() ?? 0,
comunity.id,
1,
article?.likes ?? 0,
businessId,
4,
isKeyBoardShow,
_reply,
_delCommentTips,
@ -154,8 +162,7 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
margin: EdgeInsets.only(top: 40),
padding: EdgeInsets.all(22.h),
child: Text(
S
.of(context)
S.of(context)
.zanwupinglun,
style: TextStyle(
fontSize: 12,
@ -180,7 +187,7 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
_toComment,
_queryMemberComment,
_queryInformationLikes,
isLike: comunity.selfLike,
isLike: article?.liked ?? false,
),
],
),
@ -190,15 +197,15 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
////
_queryInformationLikes() async {
BaseData baseData = await apiService.informationLikes(comunity.id).catchError((onError) {});
BaseData baseData = await apiService.informationLikes(businessId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
commentKey.currentState.setState(() {});
setState(() {
if (comunity.selfLike ?? false)
comunity.likes -= 1;
if (article?.liked ?? false)
article?.likes -= 1;
else
comunity.likes += 1;
comunity.selfLike = !comunity.selfLike ?? false;
article?.likes += 1;
article?.liked = !(article.liked ?? false);
});
} else {
// SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
@ -210,8 +217,8 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
BaseData baseData = await apiService.memberComment({
"content": content,
"parentId": parenId,
"relationalId": comunity.id,
"relationalType":1
"relationalId": businessId,
"relationalType":4
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
CommentListState state = commentKey.currentState;
@ -295,8 +302,8 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
await apiService.memberCommentList({
"pageNum": 1,
"pageSize": 100,
"relationalId": comunity.id,
"relationalType":1,
"relationalId": businessId,
"relationalType":4,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
commentTotal = baseData.data.size;

94
lib/community/community_view/community_dynamic.dart

@ -1,10 +1,11 @@
import 'dart:convert';
import 'dart:ui';
import 'package:chewie/chewie.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/comunity_comment.dart';
import 'package:chewie/src/chewie_progress_colors.dart' as chewie;
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
@ -13,8 +14,6 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:image_pickers/image_pickers.dart';
import 'package:photo_view/photo_view.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:video_player/video_player.dart';
@ -29,11 +28,11 @@ class CommunityDynamic extends StatefulWidget {
final Function removalDynamic;
final Function exitFull;
final bool isList;
final ComunityComment comment;
final Article article;
final String userId;
CommunityDynamic(
this.comment,
this.article,
this.commentType, {
Key key,
this.itemCount = 9,
@ -78,15 +77,18 @@ class _CommunityDynamic extends State<CommunityDynamic> {
String filePath;
initVideo() async {
if (widget.comment.subjectInfo.type == "video" &&
widget.comment.subjectInfo.video.isNotEmpty) {
if(widget?.article?.content == null)
return;
var cnt = jsonDecode(widget.article.content);
if (cnt["type"] == "video" &&
cnt["video"] != null) {
if (widget.isList) {
videoPlayerController = VideoPlayerController.network(
widget.comment.subjectInfo.video,
cnt["video"],
)..initialize().then((value) {});
} else {
videoPlayerController = VideoPlayerController.network(
widget.comment.subjectInfo.video,
cnt["video"],
)..initialize().then((value) {
chewieAudioController = ChewieController(
videoPlayerController: videoPlayerController,
@ -172,13 +174,17 @@ class _CommunityDynamic extends State<CommunityDynamic> {
children: [
GestureDetector(
onTap: (){
if(widget?.article?.authorHeadImg == ""){
SmartDialog.showToast("用户暂未设置头像", alignment: Alignment.center);
return;
}
Navigator.push(context, MaterialPageRoute( builder: (context) => PhotoViewGalleryScreen(
images:[widget?.comment?.memberInfo?.avatar ?? ""],//list
images:[widget?.article?.authorHeadImg ?? ""],//list
index: 0,//index
), ), );
), ));
},
child: MImage(
widget?.comment?.memberInfo?.avatar ?? "",
widget?.article?.authorHeadImg ?? "",
width: 44,
height: 44,
isCircle: true,
@ -195,7 +201,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget?.comment?.memberInfo?.nickname ?? "",
widget?.article?.authorName ?? "",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
@ -203,7 +209,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
),
),
Text(
widget?.comment?.createTime ?? "",
widget?.article?.createTime ?? "",
style: TextStyle(
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
@ -215,14 +221,14 @@ class _CommunityDynamic extends State<CommunityDynamic> {
],
),
),
if (widget?.comment?.memberInfo?.mid != widget.userId ?? "")
if (widget?.article?.updateUser != widget.userId ?? "")
GestureDetector(
onTap: () {
setState(() {
if (widget.commentType == 0) {
widget.comment.selfFollow =
!(widget.comment.selfFollow ?? false);
_vipFollow(widget.comment.memberInfo?.mid,widget.comment.selfFollow ?? false);
widget.article.liked =
!(widget.article.liked ?? false);
_vipFollow(widget.article.updateUser,widget.article.liked ?? false);
} else {
showDeleteDialog();
}
@ -235,21 +241,21 @@ class _CommunityDynamic extends State<CommunityDynamic> {
alignment: Alignment.center,
child: RoundButton(
height: 25.h,
backgroup: (widget.comment.selfFollow ?? false)
backgroup: (widget?.article?.liked ?? false)
? Color(0xFFE6E6E6)
: Color(0xFF32A060),
textColor: (widget.comment.selfFollow ?? false)
textColor: (widget?.article?.liked ?? false)
? Color(0xFF808080)
: Colors.white,
text: (widget.comment.selfFollow ?? false)
text: (widget?.article?.liked ?? false)
? "已关注"
: "关注",
radius: 20,
icons: Icon(
(widget.comment.selfFollow ?? false)
(widget?.article?.liked ?? false)
? Icons.check
: Icons.add,
color: (widget.comment.selfFollow ?? false)
color: (widget?.article?.liked ?? false)
? Color(0xFF808080)
: Colors.white,
size: 15,
@ -267,7 +273,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
height: 12.h,
),
Text(
widget.comment.subject ?? "",
widget?.article?.mainTitle ?? "",
maxLines: 5,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -276,7 +282,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
fontSize: 15.sp,
),
),
buildMedia(widget.comment.subjectInfo),
buildMedia(widget?.article?.content),
if (!widget.isDetails)
SizedBox(
height: 12.h,
@ -287,8 +293,8 @@ class _CommunityDynamic extends State<CommunityDynamic> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
IconText(
(widget.comment != null)
? "${widget.comment.viewers}"
(widget.article != null)
? "${widget.article.viewers}"
: "",
space: 4.w,
leftImage: "assets/svg/liulanliang.svg",
@ -298,7 +304,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
),
),
IconText(
"${widget.comment.comments ?? 0}",
"${widget.article.comments ?? 0}",
space: 4.w,
leftImage: "assets/svg/pinglun.svg",
iconSize: 16,
@ -309,7 +315,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
GestureDetector(
onTap: () {},
child: IconText(
"${widget.comment.likes ?? 0}",
"${widget.article.likes ?? 0}",
space: 4.w,
leftImage: "assets/svg/xihuan.svg",
iconSize: 16,
@ -332,24 +338,25 @@ class _CommunityDynamic extends State<CommunityDynamic> {
}
///
Widget buildMedia(SubjectInfo subjectInfo) {
if (subjectInfo == null) {
Widget buildMedia(String subjectInfo) {
if (subjectInfo == null || !subjectInfo.startsWith("{")) {
return Container();
}
var cnt = jsonDecode(subjectInfo);
Widget itemWidget = Container();
if (subjectInfo.type == "image" && subjectInfo.images.length > 0) {
if (subjectInfo.images.length == 1) {
if (cnt["type"] == "image"&& cnt["images"] != null && cnt["images"].length > 0) {
if (cnt["images"].length == 1) {
itemWidget = Container(
child: InkWell(
onTap: () {
// ImagePickers.previewImages(subjectInfo.images,0);
Navigator.push(context, MaterialPageRoute( builder: (context) => PhotoViewGalleryScreen(
images:subjectInfo.images,//list
images:cnt["images"],//list
index: 0,//index
), ), );
},
child: MImage(
subjectInfo.images[0],
cnt["images"][0],
fit: BoxFit.cover,
radius: BorderRadius.circular(2),
width: MediaQuery.of(context).size.width / 1.5,
@ -361,8 +368,8 @@ class _CommunityDynamic extends State<CommunityDynamic> {
} else {
itemWidget = GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: (subjectInfo.images.length == 2 ||
subjectInfo.images.length == 4)
crossAxisCount: (cnt["images"].length == 2 ||
cnt["images"].length == 4)
? 2
: 3,
crossAxisSpacing: 12.w,
@ -378,12 +385,12 @@ class _CommunityDynamic extends State<CommunityDynamic> {
onTap: () {
// ImagePickers.previewImages(subjectInfo.images, position);
Navigator.push(context, MaterialPageRoute( builder: (context) => PhotoViewGalleryScreen(
images:subjectInfo.images,//list
images:cnt["images"],//list
index: position,//index
), ), );
},
child: MImage(
subjectInfo.images[position],
cnt["images"][position],
fit: BoxFit.cover,
aspectRatio: 1,
radius: BorderRadius.circular(1),
@ -393,17 +400,18 @@ class _CommunityDynamic extends State<CommunityDynamic> {
),
);
},
itemCount: subjectInfo.images.length,
itemCount: cnt["images"].length,
);
}
} else if (subjectInfo.type == "video" && subjectInfo.video.isNotEmpty) {
}
else if (cnt["type"] == "video" && cnt["video"]!= null && cnt["video"].isNotEmpty) {
itemWidget = videoWidget(
MediaQuery.of(context).size.width - 32,
videoPlayerController != null
? (MediaQuery.of(context).size.width - 32) /
videoPlayerController.value.aspectRatio
: MediaQuery.of(context).size.width / 2,
!widget.isList ? subjectInfo.video : widget.comment.coverImg,
!widget.isList ? cnt["video"] : widget.article.coverImg,
);
}
return Column(
@ -551,7 +559,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
fontWeight: FontWeight.bold,
),
onTap: () {
_deleteDynamic(widget.comment.id);
_deleteDynamic(widget.article.id);
Navigator.of(context).pop();
},
),

95
lib/community/headlines/headlines_collection.dart

@ -37,7 +37,7 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
@override
Widget build(BuildContext context) {
return Container(
height: 60.h,
height: 100.h,
margin: EdgeInsets.only(top:10),
child: ListView.builder(
scrollDirection: Axis.horizontal,
@ -61,7 +61,7 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
Widget headlinesCollectionItem(HeadlinesList headlines) {
return Container(
width: 225.w,
height:60.h,
height:100.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
boxShadow: [
@ -85,7 +85,7 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
child: MImage(
headlines?.coverImg ?? "",
width: 225.w,
height: 60.h,
height: 100.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
@ -97,69 +97,40 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
),
),
Container(
padding: EdgeInsets.only(left:12.w,right: 12.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(child: Row(
children: [
Container(
margin: EdgeInsets.only(right:4),
padding:EdgeInsets.only(left:2,right:2),
height:22.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
color: Color(0xFF32A060),
),
child: Text(
"专栏",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
padding: EdgeInsets.only(left:12.w,right: 12.w,bottom: 8),
alignment: Alignment.bottomLeft,
child: Row(
children: [
Container(
margin: EdgeInsets.only(right:4),
padding:EdgeInsets.only(left:2,right:2),
height:22.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
color: Color(0xFF007EFF),
),
Expanded(child:Text(
headlines?.name ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
child: Text(
"专栏",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),),
],)),
// Row(
// children: [
// Expanded(child:Text(
// "更新3篇",
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.medium,
// color: Colors.white,
// ),
// )),
// Text(
// "查看专栏",
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// color: Colors.white,
// ),
// ),
// SizedBox(width: 2),
// Image.asset(
// "assets/image/t_right.png",
// width: 14,
// height: 14,
// ),
// ],),
],),
),
),
Expanded(child:Text(
headlines?.name ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.white,
),
),),
],)
),
],
),

24
lib/community/headlines/headlines_column_details.dart

@ -142,14 +142,20 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
Stack(
children: [
Positioned(
child: MImage(
headlinesListDetails?.bannerImg ?? "",
width: double.infinity,
height: 260.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
child: Container(
color: Colors.black,
child:Opacity(
opacity:0.75,
child: MImage(
headlinesListDetails?.bannerImg ?? "",
width: double.infinity,
height: 260.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
)
)
)
),
Container(
margin: EdgeInsets.only(
@ -194,7 +200,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
color: Color(0xFF32A060),
color: Color(0xFF007EFF),
),
child: Text(
"专栏",

156
lib/home/home_page.dart

@ -21,14 +21,17 @@ import 'package:huixiang/retrofit/data/founder.dart';
import 'package:huixiang/retrofit/data/goods.dart';
import 'package:huixiang/retrofit/data/goods_category.dart';
import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/retrofit/data/msg_stats.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/invite_success_dialog.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/new_people_reward.dart';
import 'package:huixiang/view_widget/request_permission.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
@ -42,7 +45,8 @@ class HomePage extends StatefulWidget {
final List<InterviewCouponList> interviewCouponList;
final List<NewUserCouponList> newUserCouponList;
HomePage(this.changeTab, {this.invite,this.interviewCouponList,this.newUserCouponList});
HomePage(this.changeTab,
{this.invite, this.interviewCouponList, this.newUserCouponList});
@override
State<StatefulWidget> createState() {
@ -63,21 +67,21 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
}
});
if((widget.invite??"") != "" || widget.interviewCouponList != null
&& widget.interviewCouponList.length > 0)
showInvite = true;
if ((widget.invite ?? "") != "" ||
widget.interviewCouponList != null &&
widget.interviewCouponList.length > 0) showInvite = true;
if(widget.newUserCouponList != null && widget.newUserCouponList.length > 0)
if (widget.newUserCouponList != null && widget.newUserCouponList.length > 0)
showNew = true;
}
///
inviteShowAlertDialog(invite,InterviewCouponList interviewCouponList) {
inviteShowAlertDialog(invite, InterviewCouponList interviewCouponList) {
//
showDialog(
context: context,
builder: (BuildContext context) {
return InviteSuccessDialog(invite,interviewCouponList);
return InviteSuccessDialog(invite, interviewCouponList);
},
);
}
@ -114,6 +118,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
List<Goods> gooods = [];
Founder founder;
bool isSigned = false;
int totalMsg = 0;
queryHome() async {
EasyLoading.show(status: S.of(context).zhengzaijiazai);
@ -231,16 +236,43 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
refreshController.refreshFailed();
}
EasyLoading.dismiss();
if(showInvite){
inviteShowAlertDialog(widget.invite,widget.interviewCouponList[0]);
if (showInvite) {
inviteShowAlertDialog(widget.invite, widget.interviewCouponList[0]);
showInvite = false;
}
if(showNew){
if (showNew) {
newShowAlertDialog(widget.newUserCouponList);
showNew = false;
}
}
queryMsgStats() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<List<MsgStats>> baseData = await apiService.stats().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
baseData.data.forEach((element) {
totalMsg += element.number;
});
});
refreshController.loadComplete();
refreshController.refreshCompleted();
}
EasyLoading.dismiss();
}
_onRefresh(){
queryHome();
queryMsgStats();
}
@override
void dispose() {
super.dispose();
@ -259,17 +291,55 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
leading: false,
actions: [
Container(
margin: EdgeInsets.only(right: 12.w),
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/system_msg_page');
},
child: SvgPicture.asset(
"assets/svg/tixing.svg",
width: 24,
height: 24,
),
height: 24,
alignment: Alignment.center,
margin: EdgeInsets.only(
right: 12.w,
),
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/system_msg_page');
},
child: Container(
height: 24,
alignment:Alignment.center,
child:Stack(
children: [
SvgPicture.asset(
"assets/svg/tixing.svg",
width: 24,
height: 24,
),
if(totalMsg != 0)
Container(
width:36,
alignment: Alignment.topRight,
child:Container(
width:22,
height:14,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color:Color(0xFFFF441A),
),
child:RoundButton(
text:totalMsg.toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:8.sp,
radius: 100,
)
),
)
],
),
)
)
),
Container(
margin: EdgeInsets.only(right: 16.w),
@ -300,7 +370,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: FutureBuilder(
future: queryHome(),
future: _onRefresh(),
builder: (context, snapshot) {
return Column(
children: [
@ -308,14 +378,16 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
HomeBanner(bannerData, controller),
///
ShortcutOperation((){
ShortcutOperation(() {
widget.changeTab(1);
}),
///
SignView(isSigned,(value){setState(() {
isSigned = value;
});}),
SignView(isSigned, (value) {
setState(() {
isSigned = value;
});
}),
// ///
// HotArticle(articles),
@ -330,12 +402,16 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
///
// CouponView(),
///
HomeIntegralStore(gooods),
SizedBox(
height: 28,
),
///
FeaturedActivity(),
///
HomeIntegralStore(gooods),
///Tab
PointsGoodsTitle(
gooodsCategorys,
@ -384,7 +460,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian,
(result) async {
(result) async {
if (result) {
await openAppSettings();
}
@ -400,7 +476,12 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
String tableId = uri.queryParameters["tableId"];
String tenantCode = uri.queryParameters["tenantCode"];
String shopId = uri.queryParameters["shopId"];
if (tableId != null && tableId != "" && tenantCode != null && tenantCode != "" && shopId != null && shopId != "") {
if (tableId != null &&
tableId != "" &&
tenantCode != null &&
tenantCode != "" &&
shopId != null &&
shopId != "") {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
@ -412,7 +493,22 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
);
}
} else {
await Permission.camera.request();
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_camera_permission_tips.png",
S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian,
(result) async {
if (result) {
await Permission.camera.request();
}
},
heightRatioWithWidth: 0.82,
);
});
}
}

61
lib/home/home_view/featured_acticvity.dart

@ -78,9 +78,9 @@ class _FeaturedActivity extends State<FeaturedActivity> {
child: stackItem(18.sp, activityList[0]),
margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h,
height: 125.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
borderRadius: BorderRadius.circular(6),
color: Colors.red,
image: DecorationImage(
image: NetworkImage(
@ -106,9 +106,9 @@ class _FeaturedActivity extends State<FeaturedActivity> {
child: stackItem(12.sp, activityList[1]),
margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h / 2,
height:125.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
borderRadius: BorderRadius.circular(6),
color: Colors.green,
image: DecorationImage(
image: NetworkImage(
@ -122,28 +122,28 @@ class _FeaturedActivity extends State<FeaturedActivity> {
SizedBox(
height: 5,
),
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/web_page',
arguments: {"activityId": activityList[2].id});
},
child: Container(
child: stackItem(12.sp, activityList[2]),
margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h / 2,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Colors.blue,
image: DecorationImage(
image: NetworkImage(
activityList[2].coverImg,
),
fit: BoxFit.fill,
),
),
),
),
// GestureDetector(
// onTap: () {
// Navigator.of(context).pushNamed('/router/web_page',
// arguments: {"activityId": activityList[2].id});
// },
// child: Container(
// child: stackItem(12.sp, activityList[2]),
// margin: EdgeInsets.symmetric(horizontal: 5.w),
// width: (MediaQuery.of(context).size.width - 42) / 2,
// height: 190.h / 2,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(4),
// color: Colors.blue,
// image: DecorationImage(
// image: NetworkImage(
// activityList[2].coverImg,
// ),
// fit: BoxFit.fill,
// ),
// ),
// ),
// ),
],
),
),
@ -160,7 +160,10 @@ class _FeaturedActivity extends State<FeaturedActivity> {
Widget stackItem(double textSize, Activity activity) {
return Container(
color: Color.fromARGB(80, 0, 0, 0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Color.fromARGB(80, 0, 0, 0),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
@ -176,7 +179,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
maxLines: 1,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: textSize,
fontSize: 14.sp,
color: Colors.white,
),
),
@ -195,7 +198,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
),
),
Container(
width: 58.w,
width: 48.w,
margin: EdgeInsets.only(left: 8, bottom: 8),
padding: EdgeInsets.symmetric(
vertical: 4.h,

2
lib/home/home_view/quick_order.dart

@ -160,7 +160,7 @@ class _QuickOrder extends State<QuickOrder> {
children: [
ItemTitle(
text: "店铺推荐",
imgPath: "assets/image/icon_points_mall.png",
imgPath: "assets/image/icon_shop.png",
),
Container(
height: 170,

41
lib/home/home_view/shortcut_operation.dart

@ -46,7 +46,18 @@ class _ShortcutOperation extends State<ShortcutOperation> {
},
child: Container(
width: 106,
color: Colors.white,
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(4),
),
margin: EdgeInsets.only(right:10),
padding: EdgeInsets.only(top: 8,bottom: 8),
child: Column(
@ -84,7 +95,18 @@ class _ShortcutOperation extends State<ShortcutOperation> {
},
child: Container(
width: 106,
color: Colors.white,
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(4),
),
margin: EdgeInsets.only(right:10),
padding: EdgeInsets.only(top: 8,bottom: 8),
child: Column(
@ -99,7 +121,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
),
SizedBox(height: 5),
Text(
"充值送会员!",
"会员享有赠送",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
@ -122,7 +144,18 @@ class _ShortcutOperation extends State<ShortcutOperation> {
},
child:Container(
width: 106,
color: Colors.white,
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(4),
),
padding: EdgeInsets.only(top: 8,bottom: 8),
child: Column(
children: [

5
lib/home/points_mall_view/points_goods_title.dart

@ -3,6 +3,7 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/goods_category.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/item_title.dart';
import 'package:huixiang/view_widget/my_tab.dart';
class PointsGoodsTitle extends StatefulWidget {
@ -41,6 +42,10 @@ class _PointsGoodsTitle extends State<PointsGoodsTitle> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ItemTitle(
text: S.of(context).jifenshangcheng,
imgPath: "assets/image/icon_points_mall.png",
),
// ItemTitle(
// text: S.of(context).jifenshangcheng,
// imgPath: "assets/image/icon_points_mall.png",

24
lib/login/login_page.dart

@ -512,20 +512,16 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
),
),
),
Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/icon_login_logo.png",
width: 91.w,
height: 91.h,
),
SizedBox(
height: 0.596.sh,
),
],
),
Container(
height: MediaQuery.of(context).size.height * 0.78,
margin: EdgeInsets.only(top: 56.h),
alignment: Alignment.topCenter,
child:Image.asset(
"assets/image/icon_login_logo.png",
width: 91.w,
height: 91.h,
),
)
],
),
),

3
lib/main.dart

@ -74,6 +74,7 @@ import 'community/photo_view_gallery_screen.dart';
import 'home/guide_page.dart';
import 'home/home_view/activity_list.dart';
import 'main_page.dart';
import 'message/system_details.dart';
import 'mine/manage_address_page.dart';
import 'mine/mine_view/community_follow.dart';
import 'mine/mine_vip/binding_assistant_card.dart';
@ -328,4 +329,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
HeadlinesColumnDetails(arguments: arguments),
'/router/photo_view_gallery_screen': (context, {arguments}) =>
PhotoViewGalleryScreen(),
'/router/system_details': (context, {arguments}) =>
SystemDetails(arguments:arguments),
};

1108
lib/message/system_details.dart

File diff suppressed because it is too large Load Diff

658
lib/message/system_message.dart

@ -1,8 +1,10 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/message.dart';
import 'package:huixiang/retrofit/data/msg_stats.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
@ -10,6 +12,7 @@ import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -23,6 +26,18 @@ class SystemMessagePage extends StatefulWidget {
class _SystemMessagePage extends State<SystemMessagePage> {
ApiService apiService;
int pageNum = 1;
List<Message> messages = [];
List<MsgStats> msgStats = [];
Map <String,int> msgNumber = {
"1":0,
"2":0,
"3":0,
"4":0,
"5":0,
"6":0,
};
int state = 0;
@override
void initState() {
@ -32,15 +47,14 @@ class _SystemMessagePage extends State<SystemMessagePage> {
apiService =
ApiService(Dio(), token: value.getString("token"), context: context);
queryMessage();
queryMsgStats();
});
}
int pageNum = 1;
List<Message> messages = [];
_refresh() {
pageNum = 1;
queryMessage();
queryMsgStats();
}
queryMessage() async {
@ -59,7 +73,13 @@ class _SystemMessagePage extends State<SystemMessagePage> {
if (pageNum == 1) {
messages.clear();
}
messages.addAll(baseData.data.list);
List<Message> message = [];
message.addAll(baseData.data.list);
message.forEach((element) {
if(element.typed==2 || element.typed==3){
messages.add(element);
}
});
_refreshController.loadComplete();
_refreshController.refreshCompleted();
if (mounted) setState(() {});
@ -74,17 +94,64 @@ class _SystemMessagePage extends State<SystemMessagePage> {
}
}
queryMsgStats() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<List<MsgStats>> baseData = await apiService.stats().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
msgStats.clear();
msgStats = baseData.data;
msgStats.forEach((element) {
if(msgNumber.containsKey(element.name)){
msgNumber[element.name] = element.number;
}
});
});
_refreshController.loadComplete();
_refreshController.refreshCompleted();
}
EasyLoading.dismiss();
}
RefreshController _refreshController = RefreshController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
background: Color(0xFFF7F7F7),
background: Colors.white,
leadingColor: Colors.black,
title: S.of(context).xitongxiaoxi,
title: S.of(context).xiaoxi,
titleSize: 18.sp,
titleColor: Colors.black,
actions: [
Container(
margin: EdgeInsets.only(right: 16.w),
alignment: Alignment.centerRight,
child: GestureDetector(
onTap: () {
setState(() {
queryMsgStats();
});
},
child: Text(
"标为已读",
style: TextStyle(
fontSize: 16.sp,
fontWeight:MyFontWeight.semi_bold,
color: Color(0xFF353535),
),
),
),
),
],
),
body: SmartRefresher(
enablePullDown: true,
@ -94,159 +161,490 @@ class _SystemMessagePage extends State<SystemMessagePage> {
footer: CustomFooter(
loadStyle: LoadStyle.ShowWhenLoading,
builder: (BuildContext context, LoadStatus mode) {
return MyFooter(mode);
return (messages.length == 0)?Container():MyFooter(mode);
},
),
controller: _refreshController,
onRefresh: _refresh,
onLoading: () {
queryMessage();
setState(() {
_refresh();
});
},
child: (messages == null || messages.length == 0)
? NoDataView(
isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
)
: ListView.builder(
padding: EdgeInsets.only(top: 16),
itemCount: messages.length,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
if (messages[position].typed == 2) {
Navigator.of(context)
.pushNamed('/router/exchange_order_details');
}
},
child: buildMessageItem(messages[position]),
);
}),
child: Container(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
child: Column(
children: [
newsSurvey(),
SizedBox(height: 16.h,),
buildMessage(),
],
),
),
),
),
),
);
}
Widget buildMessageItem(Message message) {
Widget newsSurvey(){
return Container(
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 8.h),
padding: EdgeInsets.all(20.w),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
color: Colors.white,
padding: EdgeInsets.only(top: 16.h,bottom: 16.h),
child: Row(
children: [
Expanded(child: GestureDetector(
onTap: (){
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":5});
},
child:Column(
children: [
Stack(
children: [
Image.asset(
"assets/image/icon_z.png",
width: 40,
height: 40,
),
if(msgNumber["5"].toString() != "0")
Container(
width:48,
alignment: Alignment.topRight,
child:Container(
width:20,
height:17,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color:Color(0xFFFF441A),
),
child:RoundButton(
text:msgNumber["5"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:8.sp,
radius: 100,
)
),
)
],
),
SizedBox(height: 6.h),
Text(
"点赞",
style: TextStyle(
fontSize: 14.sp,
fontWeight:MyFontWeight.medium,
color: Color(0xFF060606),
),
)
],
)
)
),
Expanded(child:
GestureDetector(
onTap: (){
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":6});
},
child: Column(
children: [
Stack(
children: [
Image.asset(
"assets/image/icon_pl.png",
width: 40,
height: 40,
),
if(msgNumber["6"].toString() != "0")
Container(
width:48,
alignment: Alignment.topRight,
child:Container(
width:16,
height:16,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color:Color(0xFFFF441A),
),
child:RoundButton(
text: msgNumber["6"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:8.sp,
radius: 100,
)
),
)
],
),
SizedBox(height: 6.h),
Text(
S.of(context).pinglun,
style: TextStyle(
fontSize: 14.sp,
fontWeight:MyFontWeight.medium,
color: Color(0xFF060606),
),
),
],
)
)),
Expanded(child:
GestureDetector(
onTap: (){
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":4});
},
child:Column(
children: [
Stack(
children: [
Image.asset(
"assets/image/icon_gz.png",
width: 40,
height: 40,
),
if(msgNumber["4"].toString() != "0")
Container(
width:48,
alignment: Alignment.topRight,
child:Container(
width:16,
height:16,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color:Color(0xFFFF441A),
),
child:RoundButton(
text: msgNumber["4"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:8.sp,
radius: 100,
)
),
)
],
),
SizedBox(height: 6.h),
Text(
S.of(context).guanzhu,
style: TextStyle(
fontSize: 14.sp,
fontWeight:MyFontWeight.medium,
color: Color(0xFF060606),
),
),
],
)
)
),
],
borderRadius: BorderRadius.circular(8),
),
);
}
Widget buildMessage(){
return Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.all(20.w),
child:Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).xitongxiaoxi,
style: TextStyle(
fontSize: 16.sp,
fontWeight:MyFontWeight.semi_bold,
color: Colors.black,
),
),
(messages == null || messages.length == 0)
? NoDataView(
isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
)
:ListView.builder(
padding: EdgeInsets.only(top: 16),
itemCount: messages.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
if(messages[position].typed == 2)
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":2});
else if(messages[position].typed == 3)
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":3});
},
child: buildMessageItem(messages[position]),
);
}),
],
)
);
}
Widget buildMessageItem(Message message) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
// margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 8.h),
// padding: EdgeInsets.all(20.w),
// decoration: BoxDecoration(
// color: Colors.white,
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// )
// ],
// borderRadius: BorderRadius.circular(8),
// ),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Image.asset(
(message.typed == 1)
? "assets/image/icon_system_notices.png"
: (message.typed == 2)
? "assets/image/icon_system_order.png"
: "assets/image/icon_system_recharge.png",
width: 24.w,
height: 24.h,
),
SizedBox(
width: 4.w,
),
Text(
(message.typed == 1)
? S.of(context).xitongtongzhi
: (message.typed == 2)
? S.of(context).dingdanxiaoxi
: S.of(context).chongzhixiaoxi,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF060606),
),
)
],
Image.asset(
(message.typed == 1)
? "assets/image/icon_system_message.png"
: (message.typed == 2)
? "assets/image/icon_system_message.png"
: "assets/image/c_z.png",
width: 40.w,
height: 40.h,
),
Text(
message.updateTime,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
SizedBox(
width:12.w,
),
],
),
if (message.typed != 3)
Container(
margin: EdgeInsets.only(left: 28.w, top: 12.h),
child: Text(
S.of(context).ninyouyigexindedingdan,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),
)
else
Container(
margin: EdgeInsets.only(left: 28.w, top: 18.h),
child: Text(
message.title,
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535),
),
),
),
if (message.typed != 3)
Container(
margin: EdgeInsets.only(left: 28.w, top: 22.h),
child: Row(
Expanded(child:Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).chakangengduo,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF353535),
),
Row(
children: [
Expanded(child:Text(
(message.typed == 1)
? S.of(context).xitongtongzhi
: (message.typed == 2)
? S.of(context).dingdanxiaoxi
: S.of(context).chongzhixiaoxi,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF060606),
),
)),
Text(
message.updateTime,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
],
),
SizedBox(height:4.h,),
(message.typed != 3) ?
Row(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child:
Text(
S.of(context).ninyouyigexindedingdan,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),),
if(msgNumber["2"].toString() != "0")
RoundButton(
width: 16,
height: 16,
text:msgNumber["2"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:10.sp,
radius: 100,
),
],
):
Row(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child:
Text(
message.content,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
)),
if(msgNumber["3"].toString() != "0")
RoundButton(
width: 16,
height: 16,
text:msgNumber["3"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:10.sp,
radius: 100,
),
],
),
Icon(
Icons.keyboard_arrow_right,
color: Colors.black,
)
],
),
)
else
Container(
margin: EdgeInsets.only(left: 28.w, top: 22.h),
child: Text(
message.content,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),
),
)),
],
),
Container(
margin: EdgeInsets.only(top: 16.h,bottom:8.h),
height: 1.h,
width: double.infinity,
color: Color(0xFFF7F7F7),
),
],
),
// Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Row(
// children: [
// Image.asset(
// (message.typed == 1)
// ? "assets/image/icon_system_notices.png"
// : (message.typed == 2)
// ? "assets/image/icon_system_order.png"
// : "assets/image/icon_system_recharge.png",
// width: 24.w,
// height: 24.h,
// ),
// SizedBox(
// width: 4.w,
// ),
// Text(
// (message.typed == 1)
// ? S.of(context).xitongtongzhi
// : (message.typed == 2)
// ? S.of(context).dingdanxiaoxi
// : S.of(context).chongzhixiaoxi,
// style: TextStyle(
// fontSize: 14.sp,
// fontWeight: FontWeight.bold,
// color: Color(0xFF060606),
// ),
// )
// ],
// ),
// Text(
// message.updateTime,
// style: TextStyle(
// fontSize: 10.sp,
// color: Color(0xFFA29E9E),
// ),
// ),
// ],
// ),
// if (message.typed != 3)
// Container(
// margin: EdgeInsets.only(left: 28.w, top: 12.h),
// child: Text(
// S.of(context).ninyouyigexindedingdan,
// style: TextStyle(
// fontSize: 10.sp,
// color: Color(0xFF353535),
// ),
// ),
// )
// else
// Container(
// margin: EdgeInsets.only(left: 28.w, top: 18.h),
// child: Text(
// message.title,
// style: TextStyle(
// fontSize: 20.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFF353535),
// ),
// ),
// ),
// if (message.typed != 3)
// Container(
// margin: EdgeInsets.only(left: 28.w, top: 22.h),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text(
// S.of(context).chakangengduo,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: FontWeight.bold,
// color: Color(0xFF353535),
// ),
// ),
// Icon(
// Icons.keyboard_arrow_right,
// color: Colors.black,
// )
// ],
// ),
// )
// else
// Container(
// margin: EdgeInsets.only(left: 28.w, top: 22.h),
// child: Text(
// message.content,
// style: TextStyle(
// fontSize: 10.sp,
// color: Color(0xFF353535),
// ),
// ),
// ),
// ],
// ),
);
}
}

69
lib/mine/mine_page.dart

@ -198,9 +198,6 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
},
),
/////
attention(),
/// VIP等级信息
MineVipView(
tag: "vip",
@ -214,6 +211,9 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
),
),
/////
attention(),
///
WalletCoupon(),
@ -311,7 +311,20 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
/////
Widget attention(){
return Container(
margin: EdgeInsets.only(left: 16,top: 10),
margin: EdgeInsets.only(left: 16,top: 10,right: 16),
padding: EdgeInsets.only(top: 16,bottom: 16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child:GestureDetector(
onTap:(){
Navigator.of(context).pushNamed(
@ -331,23 +344,23 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
);
},
child:
Row(
Column(
children: [
Text(
S.of(context).guanzhu,
infoNumber != null ?infoNumber.follow.toString() :"0",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(width: 5,),
SizedBox(height:4,),
Text(
infoNumber != null ?infoNumber.follow.toString() :"0",
S.of(context).guanzhu,
style: TextStyle(
color: Color(0xFF000000),
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
],
@ -361,23 +374,23 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
);
},
child:
Row(
Column(
children: [
Text(
S.of(context).fensi,
infoNumber != null ?infoNumber.fans.toString() :"0",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(width: 5,),
SizedBox(height:4,),
Text(
infoNumber != null ?infoNumber.fans.toString() :"0",
S.of(context).fensi,
style: TextStyle(
color: Color(0xFF000000),
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
],
@ -391,23 +404,23 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
);
},
child:
Row(
Column(
children: [
Text(
"成就",
infoNumber != null ?infoNumber.achievementNumber.toString() :"0",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(width: 5,),
SizedBox(height:4,),
Text(
infoNumber != null ?infoNumber.achievementNumber.toString() :"0",
"成就",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
],

179
lib/mine/mine_view/mine_item.dart

@ -17,7 +17,7 @@ class _MineItem extends State<MineItem> {
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.fromLTRB(16.w, 10.h, 16.w, 28.h),
padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h),
// padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
@ -50,7 +50,7 @@ class _MineItem extends State<MineItem> {
// ),
// ),
Container(
padding: EdgeInsets.symmetric(vertical: 4.h),
padding: EdgeInsets.only(left: 16,top:16,bottom:4),
child: Text(
S.of(context).wodegongju,
style: TextStyle(
@ -60,74 +60,79 @@ class _MineItem extends State<MineItem> {
),
),
),
InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context)
.pushNamed('/router/releasePage',
arguments: {});
});
},
child: mineItem(
S.of(context).wodedongtai,
"assets/image/dynamic.png",
),
),
InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context)
.pushNamed('/router/exchange_history_page');
});
},
child: mineItem(
S.of(context).duihuanlishi,
"assets/image/icon_mine_records_of_consumption.png",
),
),
InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/mine_card');
});
},
child: mineItem(
S.of(context).wodekaquan,
"assets/image/icon_mine_card.png",
),
Row(
children: [
Expanded(child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context)
.pushNamed('/router/releasePage',
arguments: {});
});
},
child: mineItem(
S.of(context).wodedongtai,
"assets/image/dynamic.png",
),
),),
Expanded(child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context)
.pushNamed('/router/exchange_history_page');
});
},
child: mineItem(
S.of(context).duihuanlishi,
"assets/image/icon_mine_records_of_consumption.png",
),
),),
Expanded(child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/mine_card');
});
},
child: mineItem(
S.of(context).wodekaquan,
"assets/image/icon_mine_card.png",
),
),),
Expanded(child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/manage_address_page');
});
},
child: mineItem(
S.of(context).guanlidizhi,
"assets/image/icon_location_address.png",
),
),)
],
),
InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/manage_address_page');
});
},
child: mineItem(
S.of(context).guanlidizhi,
"assets/image/icon_location_address.png",
),
),
InkWell(
Padding(padding:EdgeInsets.only(left:24),
child: InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/qr_share', arguments: {});
},
@ -135,7 +140,8 @@ class _MineItem extends State<MineItem> {
S.of(context).tuiguangma,
"assets/image/icon_mine_promotion_code.png",
),
),
),)
// mineItem(
// S.of(context).bangzhuyufankui,
// "assets/image/icon_mine_feedback.png",
@ -150,34 +156,31 @@ class _MineItem extends State<MineItem> {
return Container(
color: Colors.white,
margin: EdgeInsets.symmetric(vertical: 6.h),
child: Row(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
icon,
width: 28.w,
height: 28.h,
width: 32.w,
height: 32.w,
),
SizedBox(
width: 8.w,
height: 2.h,
),
Expanded(
flex: 1,
child: Text(
text,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Color(0xFF353535),
),
Text(
text,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 12.sp,
color: Color(0xFF353535),
),
),
Icon(
Icons.keyboard_arrow_right,
size: 20,
color: Colors.black,
)
// Icon(
// Icons.keyboard_arrow_right,
// size: 20,
// color: Colors.black,
// )
],
),
);

8
lib/mine/mine_view/mine_view.dart

@ -42,8 +42,8 @@ class _MineView extends State<MineView> {
padding: EdgeInsets.all(8.h),
child: Image.asset(
"assets/image/icon_scan_qr_code.png",
width: 24.w,
height: 24.h,
width:32.w,
height: 32.h,
),
),
),
@ -56,8 +56,8 @@ class _MineView extends State<MineView> {
margin: EdgeInsets.only(right: 12.w),
child: Image.asset(
"assets/image/icon_mine_setting.png",
width: 24.w,
height: 24.h,
width: 32.w,
height: 32.h,
),
),
),

29
lib/mine/mine_wallet_page.dart

@ -12,6 +12,7 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -57,7 +58,8 @@ class _MineWalletPage extends State<MineWalletPage> {
}
queryUserBalance() async {
BaseData<UserInfo> baseData = await apiService.queryInfo().catchError((onError) {});
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
mBalance = double.tryParse(userInfo.money);
@ -168,14 +170,21 @@ class _MineWalletPage extends State<MineWalletPage> {
),
Container(
margin: EdgeInsets.only(top: 14.h),
child: ListView.builder(
itemCount: userBills != null ? userBills.length : 0,
shrinkWrap: true,
padding: EdgeInsets.only(bottom: 20.h),
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return historyItem(userBills[position], position);
}),
child: (userBills == null || userBills.length == 0)
? NoDataView(
isShowBtn: false,
text: "目前暂未记录哦",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
)
: ListView.builder(
itemCount: userBills != null ? userBills.length : 0,
shrinkWrap: true,
padding: EdgeInsets.only(bottom: 20.h),
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return historyItem(userBills[position], position);
}),
),
],
),
@ -200,7 +209,7 @@ class _MineWalletPage extends State<MineWalletPage> {
Expanded(
flex: 1,
child: Container(
height: 34.h,
// height: 34.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,

34
lib/mine/release_page.dart

@ -1,8 +1,11 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/community/community_view/community_dynamic.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/comunity_comment.dart';
import 'package:huixiang/retrofit/data/page.dart';
@ -26,7 +29,7 @@ class _ReleasePage extends State<ReleasePage> {
int pageNum = 0;
String userId;
List<ComunityComment> comments = [];
List<Article> articles = [];
@override
void initState() {
@ -66,10 +69,24 @@ class _ReleasePage extends State<ReleasePage> {
refreshController.loadComplete();
if (baseData.isSuccess) {
if (pageNum == 1) {
comments.clear();
articles.clear();
}
comments.addAll(baseData.data.list);
print("comments: ${comments.length}");
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();
}
@ -109,8 +126,9 @@ class _ReleasePage extends State<ReleasePage> {
itemBuilder: (context, position) {
return InkWell(
child: CommunityDynamic(
comments[position],
1,exitFull: (){setState(() {
articles[position],
1,
exitFull: (){setState(() {
_onRefresh();
});},
removalDynamic: () {
@ -121,13 +139,13 @@ class _ReleasePage extends State<ReleasePage> {
Navigator.of(context).pushNamed(
'/router/community_details',
arguments: {
"comment": comments[position],"userId":userId,
"businessId": articles[position].id,"userId":userId,
},
);
},
);
},
itemCount: comments.length,
itemCount: articles.length,
)),
);
},

2
lib/order/order_view/order_commodity.dart

@ -169,7 +169,7 @@ class _OrderCommodity extends State<OrderCommodity> {
margin: EdgeInsets.only(
left: 16.w,
),
height: 44.h,
// height: 44.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,

130
lib/retrofit/data/article.dart

@ -14,7 +14,7 @@ class Article {
dynamic _viceTitle;
String _content;
String _coverImg;
Author _author;
dynamic _author;
int _type;
String _startTime;
String _categoryId;
@ -26,6 +26,8 @@ class Article {
bool _liked;
int _viewers;
int _comments;
String _authorName;
String _authorHeadImg;
bool isFollow;
dynamic _storeName;
@ -39,7 +41,7 @@ class Article {
dynamic get viceTitle => _viceTitle;
String get content => _content;
String get coverImg => _coverImg;
Author get author => _author;
dynamic get author => _author;
int get type => _type;
String get startTime => _startTime;
String get categoryId => _categoryId;
@ -51,8 +53,14 @@ class Article {
bool get liked => _liked;
int get viewers => _viewers;
int get comments => _comments;
String get authorName => _authorName;
String get authorHeadImg => _authorHeadImg;
dynamic get storeName => _storeName;
set id(String value) {
_id = value;
}
set likes(int value) {
_likes = value;
}
@ -69,27 +77,38 @@ class Article {
_comments = value;
}
set authorName(String value) {
_authorName = value;
}
set authorHeadImg(String value) {
_authorHeadImg = value;
}
Article({
String id,
String createTime,
dynamic createUser,
String updateTime,
dynamic updateUser,
String storeId,
String mainTitle,
dynamic viceTitle,
String content,
String id,
String createTime,
dynamic createUser,
String updateTime,
dynamic updateUser,
String storeId,
String mainTitle,
dynamic viceTitle,
String content,
String coverImg,
Author author,
int type,
String startTime,
String endTime,
int state,
int isDelete,
int type,
String startTime,
String endTime,
int state,
int isDelete,
int likes,
bool isHot,
int viewers,
int comments,
String authorName,
String authorHeadImg,
dynamic storeName}){
_id = id;
_createTime = createTime;
@ -113,6 +132,8 @@ class Article {
_liked = liked;
_viewers = viewers;
_comments = comments;
_authorName = authorName;
_authorHeadImg = authorHeadImg;
_storeName = storeName;
}
@ -127,7 +148,7 @@ class Article {
_viceTitle = json["viceTitle"];
_content = json["content"];
_coverImg = json["coverImg"];
_author = json["author"] == null ? null : Author.fromJson(jsonDecode(json["author"]));
_author = json["author"] == null ? null : json["author"].toString().startsWith("{") ? Author.fromJson(jsonDecode(json["author"])):null;
_type = json["type"];
_startTime = json["startTime"];
_categoryId = json["categoryId"];
@ -139,6 +160,8 @@ class Article {
_liked = json["liked"];
_viewers = json["viewers"];
_comments = json["comments"];
_authorName = json["authorName"];
_authorHeadImg = json["authorHeadImg"];
_storeName = json["storeName"];
}
@ -166,8 +189,81 @@ class Article {
map["liked"] = _liked;
map["viewers"] = _viewers;
map["comments"] = _comments;
map["authorName"] = _authorName;
map["authorHeadImg"] = _authorHeadImg;
map["storeName"] = _storeName;
return map;
}
set createTime(String value) {
_createTime = value;
}
set createUser(dynamic value) {
_createUser = value;
}
set updateTime(String value) {
_updateTime = value;
}
set updateUser(dynamic value) {
_updateUser = value;
}
set storeId(String value) {
_storeId = value;
}
set mainTitle(String value) {
_mainTitle = value;
}
set viceTitle(dynamic value) {
_viceTitle = value;
}
set content(String value) {
_content = value;
}
set coverImg(String value) {
_coverImg = value;
}
set author(dynamic value) {
_author = value;
}
set type(int value) {
_type = value;
}
set startTime(String value) {
_startTime = value;
}
set categoryId(String value) {
_categoryId = value;
}
set endTime(String value) {
_endTime = value;
}
set state(int value) {
_state = value;
}
set isDelete(int value) {
_isDelete = value;
}
set isHot(bool value) {
_isHot = value;
}
set storeName(dynamic value) {
_storeName = value;
}
}

129
lib/retrofit/data/message.dart

@ -1,44 +1,18 @@
/// id : "1420215467561189376"
/// createTime : "2021-07-28 10:58:26"
/// id : "1483062749750624256"
/// createTime : "2022-01-17 21:04:48"
/// createUser : "0"
/// updateTime : "2021-07-28 10:58:29"
/// updateTime : "2022-01-17 21:04:48"
/// updateUser : "0"
/// mid : "1406879717390286848"
/// title : "充值成功"
/// content : "你于2021-07-28 10:52:02充值0.01元,当前余额:0.08元。"
/// typed : 3
/// relational : ""
/// state : 1
/// mid : "1478548672881885184"
/// title : "粉丝关注"
/// content : "哈哈哈关注了你!"
/// typed : 4
/// relational : "{\"businessId\":1483062749356359680,\"mid\":1379254113602109440,\"avatar\":\"https://pos.upload.gznl.top/admin/2021/08/1f8d55ed-85d2-42a2-b155-6737a66226e8.jpg\",\"typed\":\"MEMBER\",\"nickname\":\"哈哈哈\",\"action\":\"FOLLOW\",\"receiveMid\":1478548672881885184}"
/// state : 0
/// isDelete : 0
/// followed : false
class Message {
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _mid;
String _title;
String _content;
int _typed;
String _relational;
int _state;
int _isDelete;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get mid => _mid;
String get title => _title;
String get content => _content;
int get typed => _typed;
String get relational => _relational;
int get state => _state;
int get isDelete => _isDelete;
Message({
String id,
String createTime,
@ -51,7 +25,8 @@ class Message {
int typed,
String relational,
int state,
int isDelete}){
int isDelete,
bool followed,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
@ -64,37 +39,67 @@ class Message {
_relational = relational;
_state = state;
_isDelete = isDelete;
_followed = followed;
}
Message.fromJson(dynamic json) {
_id = json["id"];
_createTime = json["createTime"];
_createUser = json["createUser"];
_updateTime = json["updateTime"];
_updateUser = json["updateUser"];
_mid = json["mid"];
_title = json["title"];
_content = json["content"];
_typed = json["typed"];
_relational = json["relational"];
_state = json["state"];
_isDelete = json["isDelete"];
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_mid = json['mid'];
_title = json['title'];
_content = json['content'];
_typed = json['typed'];
_relational = json['relational'];
_state = json['state'];
_isDelete = json['isDelete'];
_followed = json['followed'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _mid;
String _title;
String _content;
int _typed;
String _relational;
int _state;
int _isDelete;
bool _followed;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get mid => _mid;
String get title => _title;
String get content => _content;
int get typed => _typed;
String get relational => _relational;
int get state => _state;
int get isDelete => _isDelete;
bool get followed => _followed;
Map<String, dynamic> toJson() {
var map = <String, dynamic>{};
map["id"] = _id;
map["createTime"] = _createTime;
map["createUser"] = _createUser;
map["updateTime"] = _updateTime;
map["updateUser"] = _updateUser;
map["mid"] = _mid;
map["title"] = _title;
map["content"] = _content;
map["typed"] = _typed;
map["relational"] = _relational;
map["state"] = _state;
map["isDelete"] = _isDelete;
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['mid'] = _mid;
map['title'] = _title;
map['content'] = _content;
map['typed'] = _typed;
map['relational'] = _relational;
map['state'] = _state;
map['isDelete'] = _isDelete;
map['followed'] = _followed;
return map;
}

29
lib/retrofit/data/msg_stats.dart

@ -0,0 +1,29 @@
/// name : "4"
/// number : 8
class MsgStats {
MsgStats({
String name,
int number,}){
_name = name;
_number = number;
}
MsgStats.fromJson(dynamic json) {
_name = json['name'];
_number = json['number'];
}
String _name;
int _number;
String get name => _name;
int get number => _number;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['name'] = _name;
map['number'] = _number;
return map;
}
}

2
lib/retrofit/min_api.dart

@ -201,7 +201,7 @@ abstract class MinApiService {
@POST("store/getStore")
Future<BaseData> queryStoreInfo1(@Body() Map<String, dynamic> param);
//
///
@GET("order/getParentInfo?tableId={tableId}")
Future<BaseData> getParentInfo(@Path("tableId") String tableId);

9
lib/retrofit/retrofit_api.dart

@ -36,6 +36,7 @@ import 'data/headlines_list_details.dart';
import 'data/logistics.dart';
import 'data/member_comment_list.dart';
import 'data/message.dart';
import 'data/msg_stats.dart';
import 'data/page.dart';
import 'data/rank.dart';
import 'data/second_card_list.dart';
@ -62,6 +63,9 @@ 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.159:8766/app/"; ///
// const baseUrl = "http://192.168.10.159:8766/app/"; ///
// const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/";
@ -345,6 +349,10 @@ abstract class ApiService {
@GET("/app-msg/{id}")
Future<BaseData> queryMsg(@Path("id") String id);
///App消息
@GET("/app-msg/stats")
Future<BaseData<List<MsgStats>>> stats();
////
@GET("/information/likes/{id}")
Future<BaseData> informationLikes(@Path("id") String id);
@ -396,7 +404,6 @@ abstract class ApiService {
@POST("/member/follow/list")
Future<BaseData<PageInfo<ListData>>> followList(@Body() Map<String, dynamic> map);
////
@PUT("/member/follow/{followId}")
Future<BaseData> follow(@Path("followId") String followId);

22
lib/retrofit/retrofit_api.g.dart

@ -1032,6 +1032,28 @@ class _ApiService implements ApiService {
return value;
}
@override
Future<BaseData<List<MsgStats>>> stats() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/app-msg/stats',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<MsgStats>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<MsgStats>((i) => MsgStats.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<dynamic>> informationLikes(id) async {
ArgumentError.checkNotNull(id, 'id');

2
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -134,7 +134,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
margin: EdgeInsets.only(
left: 16.w,
),
height: 44.h,
// height: 44.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,

2
lib/store/store_order.dart

@ -313,7 +313,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
],
),
),
top: 110.h,
top: 100.h,
bottom: 0,
left: 0,
right: 0,

2
lib/store/store_view/store_info.dart

@ -30,7 +30,7 @@ class _StoreInfoView extends State<StoreInfoView> {
top: 5.h,
bottom: 6.h,
),
height: 138.h,
height: 140.h,
padding: EdgeInsets.all(12.w),
decoration: BoxDecoration(
color: Colors.white,

3
lib/view_widget/item_input_widget.dart

@ -147,7 +147,8 @@ class ItemInputWidget extends StatelessWidget {
margin: EdgeInsets.only(left: 5, bottom: 12.h),
),
Container(
height: 0.035.sh,
// height: 0.035.sh,
margin: EdgeInsets.only(bottom:10.h),
child: TextField(
controller: controller,
style: style,

8
lib/view_widget/request_permission.dart

@ -37,7 +37,9 @@ class _RequestPermission extends State<RequestPermission> {
type: MaterialType.transparency,
child: Center(
child: Container(
width: widget.width ?? 0.7867.sw,
// width: widget.width ?? 0.7867.sw,
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 24.w),
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w),
decoration: BoxDecoration(
color: Colors.white,
@ -50,8 +52,8 @@ class _RequestPermission extends State<RequestPermission> {
children: [
Image.asset(
widget.src,
width: 0.7867.sw * 0.6,
height: 0.7867.sw * 0.6 * 0.7,
// width: 0.7867.sw * 0.6,
// height: 0.7867.sw * 0.6 * 0.7,
fit: BoxFit.fill,
),
SizedBox(

Loading…
Cancel
Save