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:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/community/community_view/community_dynamic.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/base_data.dart';
import 'package:huixiang/retrofit/data/comunity_comment.dart'; import 'package:huixiang/retrofit/data/comunity_comment.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
@ -27,7 +30,7 @@ class _CommunityChildPage extends State<CommunityChildPage> {
int pageNum = 0; int pageNum = 0;
String userId; String userId;
List<ComunityComment> comments = []; List<Article> articles = [];
@override @override
void initState() { void initState() {
@ -67,11 +70,25 @@ class _CommunityChildPage extends State<CommunityChildPage> {
refreshController.loadComplete(); refreshController.loadComplete();
if (baseData.isSuccess) { if (baseData.isSuccess) {
if (pageNum == 1) { if (pageNum == 1) {
comments.clear(); articles.clear();
} }
comments.addAll(baseData.data.list); baseData.data.list.forEach((element) {
var article = Article();
article.id = element.id;
article.content = jsonEncode(element.subjectInfo);
article.mainTitle =element.subject;
article.liked = element.selfFollow;
article.authorHeadImg = element.memberInfo?.avatar;
article.authorName = element.memberInfo?.nickname;
article.createTime = element.createTime;
article.updateUser = element.memberInfo?.mid;
article.viewers = element?.viewers;
article.likes = element?.likes;
article.comments = element?.comments;
articles.add(article);
});
// comments.sort((a,b)=>b.createTime.compareTo(a.createTime)); // 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)) { if (int.tryParse(baseData.data.total) < (pageNum * 10)) {
refreshController.loadNoData(); refreshController.loadNoData();
} }
@ -103,7 +120,7 @@ class _CommunityChildPage extends State<CommunityChildPage> {
itemBuilder: (context, position) { itemBuilder: (context, position) {
return InkWell( return InkWell(
child: CommunityDynamic( child: CommunityDynamic(
comments[position], articles[position],
0, 0,
userId: userId, userId: userId,
isList: true, isList: true,
@ -117,14 +134,14 @@ class _CommunityChildPage extends State<CommunityChildPage> {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/community_details', '/router/community_details',
arguments: { arguments: {
"comment": comments[position], "businessId": articles[position].id,
"userId": userId, "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 { class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObserver {
double height = 0; double height = 0;
double commentHeight = 60.h; double commentHeight = 60.h;
ComunityComment comunity; // ComunityComment comunity;
String parenId = "0"; String parenId = "0";
final GlobalKey commentKey = GlobalKey(); final GlobalKey commentKey = GlobalKey();
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
@ -43,6 +43,8 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
bool isKeyBoardShow = false; bool isKeyBoardShow = false;
int commentTotal = 0; int commentTotal = 0;
Article article; Article article;
String businessId;
@override @override
void didChangeMetrics() { void didChangeMetrics() {
@ -72,15 +74,16 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
@override @override
void initState() { void initState() {
super.initState(); super.initState();
comunity = widget.arguments["comment"]; // comunity = widget.arguments["comment"];
businessId = widget.arguments["businessId"];
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
_queryMemberCommentList(); _queryMemberCommentList();
queryDetails(); queryDetails(businessId);
} }
/// ///
queryDetails() async { queryDetails(id) async {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null) if (apiService == null)
apiService = ApiService( apiService = ApiService(
@ -88,11 +91,15 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
); );
BaseData<Article> baseData = await apiService.informationInfo(comunity.id) BaseData<Article> baseData = await apiService.informationInfo(id)
.catchError((onError) { .catchError((onError) {
debugPrint(onError.toString()); debugPrint(onError.toString());
}); });
if (baseData != null && baseData.isSuccess) {} if (baseData != null && baseData.isSuccess) {
setState(() {
article = baseData.data;
});
}
} }
@override @override
@ -114,13 +121,14 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Column( child: Column(
children: [ children: [
if(article != null)
CommunityDynamic( CommunityDynamic(
comunity, article,
0, 0,
exitFull: () { exitFull: () {
setState(() {}); setState(() {});
}, },
userId:widget.arguments["userId"], userId:widget.arguments !=null ? widget.arguments["userId"] :widget.arguments["mid"],
itemCount: 3, itemCount: 3,
isDetails: true, isDetails: true,
heightFun: (height) { heightFun: (height) {
@ -136,9 +144,9 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
), ),
CommentList( CommentList(
commentKey, commentKey,
comunity?.likes ?? comunity?.likes.toString() ?? 0, article?.likes ?? 0,
comunity.id, businessId,
1, 4,
isKeyBoardShow, isKeyBoardShow,
_reply, _reply,
_delCommentTips, _delCommentTips,
@ -154,8 +162,7 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
margin: EdgeInsets.only(top: 40), margin: EdgeInsets.only(top: 40),
padding: EdgeInsets.all(22.h), padding: EdgeInsets.all(22.h),
child: Text( child: Text(
S S.of(context)
.of(context)
.zanwupinglun, .zanwupinglun,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
@ -180,7 +187,7 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
_toComment, _toComment,
_queryMemberComment, _queryMemberComment,
_queryInformationLikes, _queryInformationLikes,
isLike: comunity.selfLike, isLike: article?.liked ?? false,
), ),
], ],
), ),
@ -190,15 +197,15 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
//// ////
_queryInformationLikes() async { _queryInformationLikes() async {
BaseData baseData = await apiService.informationLikes(comunity.id).catchError((onError) {}); BaseData baseData = await apiService.informationLikes(businessId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
commentKey.currentState.setState(() {}); commentKey.currentState.setState(() {});
setState(() { setState(() {
if (comunity.selfLike ?? false) if (article?.liked ?? false)
comunity.likes -= 1; article?.likes -= 1;
else else
comunity.likes += 1; article?.likes += 1;
comunity.selfLike = !comunity.selfLike ?? false; article?.liked = !(article.liked ?? false);
}); });
} else { } else {
// SmartDialog.showToast(baseData.msg, alignment: Alignment.center); // SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
@ -210,8 +217,8 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
BaseData baseData = await apiService.memberComment({ BaseData baseData = await apiService.memberComment({
"content": content, "content": content,
"parentId": parenId, "parentId": parenId,
"relationalId": comunity.id, "relationalId": businessId,
"relationalType":1 "relationalType":4
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
CommentListState state = commentKey.currentState; CommentListState state = commentKey.currentState;
@ -295,8 +302,8 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
await apiService.memberCommentList({ await apiService.memberCommentList({
"pageNum": 1, "pageNum": 1,
"pageSize": 100, "pageSize": 100,
"relationalId": comunity.id, "relationalId": businessId,
"relationalType":1, "relationalType":4,
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
commentTotal = baseData.data.size; commentTotal = baseData.data.size;

94
lib/community/community_view/community_dynamic.dart

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

95
lib/community/headlines/headlines_collection.dart

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

24
lib/community/headlines/headlines_column_details.dart

@ -142,14 +142,20 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
Stack( Stack(
children: [ children: [
Positioned( Positioned(
child: MImage( child: Container(
headlinesListDetails?.bannerImg ?? "", color: Colors.black,
width: double.infinity, child:Opacity(
height: 260.h, opacity:0.75,
fit: BoxFit.cover, child: MImage(
errorSrc: "assets/image/default_1.png", headlinesListDetails?.bannerImg ?? "",
fadeSrc: "assets/image/default_1.png", width: double.infinity,
), height: 260.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
)
)
)
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
@ -194,7 +200,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.circular(2), BorderRadius.circular(2),
color: Color(0xFF32A060), color: Color(0xFF007EFF),
), ),
child: Text( 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.dart';
import 'package:huixiang/retrofit/data/goods_category.dart'; import 'package:huixiang/retrofit/data/goods_category.dart';
import 'package:huixiang/retrofit/data/login_info.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/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.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/classic_header.dart';
import 'package:huixiang/view_widget/invite_success_dialog.dart'; import 'package:huixiang/view_widget/invite_success_dialog.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/new_people_reward.dart'; import 'package:huixiang/view_widget/new_people_reward.dart';
import 'package:huixiang/view_widget/request_permission.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:permission_handler/permission_handler.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';
@ -42,7 +45,8 @@ class HomePage extends StatefulWidget {
final List<InterviewCouponList> interviewCouponList; final List<InterviewCouponList> interviewCouponList;
final List<NewUserCouponList> newUserCouponList; final List<NewUserCouponList> newUserCouponList;
HomePage(this.changeTab, {this.invite,this.interviewCouponList,this.newUserCouponList}); HomePage(this.changeTab,
{this.invite, this.interviewCouponList, this.newUserCouponList});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -63,21 +67,21 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
} }
}); });
if((widget.invite??"") != "" || widget.interviewCouponList != null if ((widget.invite ?? "") != "" ||
&& widget.interviewCouponList.length > 0) widget.interviewCouponList != null &&
showInvite = true; widget.interviewCouponList.length > 0) showInvite = true;
if(widget.newUserCouponList != null && widget.newUserCouponList.length > 0) if (widget.newUserCouponList != null && widget.newUserCouponList.length > 0)
showNew = true; showNew = true;
} }
/// ///
inviteShowAlertDialog(invite,InterviewCouponList interviewCouponList) { inviteShowAlertDialog(invite, InterviewCouponList interviewCouponList) {
// //
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext 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 = []; List<Goods> gooods = [];
Founder founder; Founder founder;
bool isSigned = false; bool isSigned = false;
int totalMsg = 0;
queryHome() async { queryHome() async {
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai);
@ -231,16 +236,43 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
refreshController.refreshFailed(); refreshController.refreshFailed();
} }
EasyLoading.dismiss(); EasyLoading.dismiss();
if(showInvite){ if (showInvite) {
inviteShowAlertDialog(widget.invite,widget.interviewCouponList[0]); inviteShowAlertDialog(widget.invite, widget.interviewCouponList[0]);
showInvite = false; showInvite = false;
} }
if(showNew){ if (showNew) {
newShowAlertDialog(widget.newUserCouponList); newShowAlertDialog(widget.newUserCouponList);
showNew = false; 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 @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
@ -259,17 +291,55 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
leading: false, leading: false,
actions: [ actions: [
Container( Container(
margin: EdgeInsets.only(right: 12.w), height: 24,
child: GestureDetector( alignment: Alignment.center,
onTap: () { margin: EdgeInsets.only(
Navigator.of(context).pushNamed('/router/system_msg_page'); right: 12.w,
},
child: SvgPicture.asset(
"assets/svg/tixing.svg",
width: 24,
height: 24,
),
), ),
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( Container(
margin: EdgeInsets.only(right: 16.w), margin: EdgeInsets.only(right: 16.w),
@ -300,7 +370,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
child: SingleChildScrollView( child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
child: FutureBuilder( child: FutureBuilder(
future: queryHome(), future: _onRefresh(),
builder: (context, snapshot) { builder: (context, snapshot) {
return Column( return Column(
children: [ children: [
@ -308,14 +378,16 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
HomeBanner(bannerData, controller), HomeBanner(bannerData, controller),
/// ///
ShortcutOperation((){ ShortcutOperation(() {
widget.changeTab(1); widget.changeTab(1);
}), }),
/// ///
SignView(isSigned,(value){setState(() { SignView(isSigned, (value) {
isSigned = value; setState(() {
});}), isSigned = value;
});
}),
// /// // ///
// HotArticle(articles), // HotArticle(articles),
@ -330,12 +402,16 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
/// ///
// CouponView(), // CouponView(),
/// SizedBox(
HomeIntegralStore(gooods), height: 28,
),
/// ///
FeaturedActivity(), FeaturedActivity(),
///
HomeIntegralStore(gooods),
///Tab ///Tab
PointsGoodsTitle( PointsGoodsTitle(
gooodsCategorys, gooodsCategorys,
@ -384,7 +460,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
S.of(context).ninxiangjiquanxianweikaiqi, S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang, S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian, S.of(context).kaiqiquanxian,
(result) async { (result) async {
if (result) { if (result) {
await openAppSettings(); await openAppSettings();
} }
@ -400,7 +476,12 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
String tableId = uri.queryParameters["tableId"]; String tableId = uri.queryParameters["tableId"];
String tenantCode = uri.queryParameters["tenantCode"]; String tenantCode = uri.queryParameters["tenantCode"];
String shopId = uri.queryParameters["shopId"]; 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( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {
@ -412,7 +493,22 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
); );
} }
} else { } 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]), child: stackItem(18.sp, activityList[0]),
margin: EdgeInsets.symmetric(horizontal: 5.w), margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2, width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h, height: 125.h,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(6),
color: Colors.red, color: Colors.red,
image: DecorationImage( image: DecorationImage(
image: NetworkImage( image: NetworkImage(
@ -106,9 +106,9 @@ class _FeaturedActivity extends State<FeaturedActivity> {
child: stackItem(12.sp, activityList[1]), child: stackItem(12.sp, activityList[1]),
margin: EdgeInsets.symmetric(horizontal: 5.w), margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2, width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h / 2, height:125.h,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(6),
color: Colors.green, color: Colors.green,
image: DecorationImage( image: DecorationImage(
image: NetworkImage( image: NetworkImage(
@ -122,28 +122,28 @@ class _FeaturedActivity extends State<FeaturedActivity> {
SizedBox( SizedBox(
height: 5, height: 5,
), ),
GestureDetector( // GestureDetector(
onTap: () { // onTap: () {
Navigator.of(context).pushNamed('/router/web_page', // Navigator.of(context).pushNamed('/router/web_page',
arguments: {"activityId": activityList[2].id}); // arguments: {"activityId": activityList[2].id});
}, // },
child: Container( // child: Container(
child: stackItem(12.sp, activityList[2]), // child: stackItem(12.sp, activityList[2]),
margin: EdgeInsets.symmetric(horizontal: 5.w), // margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2, // width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h / 2, // height: 190.h / 2,
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), // borderRadius: BorderRadius.circular(4),
color: Colors.blue, // color: Colors.blue,
image: DecorationImage( // image: DecorationImage(
image: NetworkImage( // image: NetworkImage(
activityList[2].coverImg, // activityList[2].coverImg,
), // ),
fit: BoxFit.fill, // fit: BoxFit.fill,
), // ),
), // ),
), // ),
), // ),
], ],
), ),
), ),
@ -160,7 +160,10 @@ class _FeaturedActivity extends State<FeaturedActivity> {
Widget stackItem(double textSize, Activity activity) { Widget stackItem(double textSize, Activity activity) {
return Container( return Container(
color: Color.fromARGB(80, 0, 0, 0), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Color.fromARGB(80, 0, 0, 0),
),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -176,7 +179,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
maxLines: 1, maxLines: 1,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: textSize, fontSize: 14.sp,
color: Colors.white, color: Colors.white,
), ),
), ),
@ -195,7 +198,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
), ),
), ),
Container( Container(
width: 58.w, width: 48.w,
margin: EdgeInsets.only(left: 8, bottom: 8), margin: EdgeInsets.only(left: 8, bottom: 8),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 4.h, vertical: 4.h,

2
lib/home/home_view/quick_order.dart

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

41
lib/home/home_view/shortcut_operation.dart

@ -46,7 +46,18 @@ class _ShortcutOperation extends State<ShortcutOperation> {
}, },
child: Container( child: Container(
width: 106, 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), margin: EdgeInsets.only(right:10),
padding: EdgeInsets.only(top: 8,bottom: 8), padding: EdgeInsets.only(top: 8,bottom: 8),
child: Column( child: Column(
@ -84,7 +95,18 @@ class _ShortcutOperation extends State<ShortcutOperation> {
}, },
child: Container( child: Container(
width: 106, 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), margin: EdgeInsets.only(right:10),
padding: EdgeInsets.only(top: 8,bottom: 8), padding: EdgeInsets.only(top: 8,bottom: 8),
child: Column( child: Column(
@ -99,7 +121,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
), ),
SizedBox(height: 5), SizedBox(height: 5),
Text( Text(
"充值送会员!", "会员享有赠送",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 12.sp, fontSize: 12.sp,
@ -122,7 +144,18 @@ class _ShortcutOperation extends State<ShortcutOperation> {
}, },
child:Container( child:Container(
width: 106, 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), padding: EdgeInsets.only(top: 8,bottom: 8),
child: Column( child: Column(
children: [ 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/retrofit/data/goods_category.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/item_title.dart';
import 'package:huixiang/view_widget/my_tab.dart'; import 'package:huixiang/view_widget/my_tab.dart';
class PointsGoodsTitle extends StatefulWidget { class PointsGoodsTitle extends StatefulWidget {
@ -41,6 +42,10 @@ class _PointsGoodsTitle extends State<PointsGoodsTitle> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
ItemTitle(
text: S.of(context).jifenshangcheng,
imgPath: "assets/image/icon_points_mall.png",
),
// ItemTitle( // ItemTitle(
// text: S.of(context).jifenshangcheng, // text: S.of(context).jifenshangcheng,
// imgPath: "assets/image/icon_points_mall.png", // 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( Container(
mainAxisAlignment: MainAxisAlignment.end, height: MediaQuery.of(context).size.height * 0.78,
crossAxisAlignment: CrossAxisAlignment.center, margin: EdgeInsets.only(top: 56.h),
children: [ alignment: Alignment.topCenter,
Image.asset( child:Image.asset(
"assets/image/icon_login_logo.png", "assets/image/icon_login_logo.png",
width: 91.w, width: 91.w,
height: 91.h, height: 91.h,
), ),
SizedBox( )
height: 0.596.sh,
),
],
),
], ],
), ),
), ),

3
lib/main.dart

@ -74,6 +74,7 @@ import 'community/photo_view_gallery_screen.dart';
import 'home/guide_page.dart'; import 'home/guide_page.dart';
import 'home/home_view/activity_list.dart'; import 'home/home_view/activity_list.dart';
import 'main_page.dart'; import 'main_page.dart';
import 'message/system_details.dart';
import 'mine/manage_address_page.dart'; import 'mine/manage_address_page.dart';
import 'mine/mine_view/community_follow.dart'; import 'mine/mine_view/community_follow.dart';
import 'mine/mine_vip/binding_assistant_card.dart'; import 'mine/mine_vip/binding_assistant_card.dart';
@ -328,4 +329,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
HeadlinesColumnDetails(arguments: arguments), HeadlinesColumnDetails(arguments: arguments),
'/router/photo_view_gallery_screen': (context, {arguments}) => '/router/photo_view_gallery_screen': (context, {arguments}) =>
PhotoViewGalleryScreen(), 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:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/message.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/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';
@ -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_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/no_data_view.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:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -23,6 +26,18 @@ class SystemMessagePage extends StatefulWidget {
class _SystemMessagePage extends State<SystemMessagePage> { class _SystemMessagePage extends State<SystemMessagePage> {
ApiService apiService; 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 @override
void initState() { void initState() {
@ -32,15 +47,14 @@ class _SystemMessagePage extends State<SystemMessagePage> {
apiService = apiService =
ApiService(Dio(), token: value.getString("token"), context: context); ApiService(Dio(), token: value.getString("token"), context: context);
queryMessage(); queryMessage();
queryMsgStats();
}); });
} }
int pageNum = 1;
List<Message> messages = [];
_refresh() { _refresh() {
pageNum = 1; pageNum = 1;
queryMessage(); queryMessage();
queryMsgStats();
} }
queryMessage() async { queryMessage() async {
@ -59,7 +73,13 @@ class _SystemMessagePage extends State<SystemMessagePage> {
if (pageNum == 1) { if (pageNum == 1) {
messages.clear(); 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.loadComplete();
_refreshController.refreshCompleted(); _refreshController.refreshCompleted();
if (mounted) setState(() {}); 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(); RefreshController _refreshController = RefreshController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
background: Color(0xFFF7F7F7), background: Colors.white,
leadingColor: Colors.black, leadingColor: Colors.black,
title: S.of(context).xitongxiaoxi, title: S.of(context).xiaoxi,
titleSize: 18.sp, titleSize: 18.sp,
titleColor: Colors.black, 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( body: SmartRefresher(
enablePullDown: true, enablePullDown: true,
@ -94,159 +161,490 @@ class _SystemMessagePage extends State<SystemMessagePage> {
footer: CustomFooter( footer: CustomFooter(
loadStyle: LoadStyle.ShowWhenLoading, loadStyle: LoadStyle.ShowWhenLoading,
builder: (BuildContext context, LoadStatus mode) { builder: (BuildContext context, LoadStatus mode) {
return MyFooter(mode); return (messages.length == 0)?Container():MyFooter(mode);
}, },
), ),
controller: _refreshController, controller: _refreshController,
onRefresh: _refresh, onRefresh: _refresh,
onLoading: () { onLoading: () {
queryMessage(); setState(() {
_refresh();
});
}, },
child: (messages == null || messages.length == 0) child: Container(
? NoDataView( child: SingleChildScrollView(
isShowBtn: false, physics: BouncingScrollPhysics(),
text: S.of(context).haimeiyouxiaoxi, child: Container(
fontSize: 16.sp, child: Column(
margin: EdgeInsets.only(top: 120.h), children: [
) newsSurvey(),
: ListView.builder( SizedBox(height: 16.h,),
padding: EdgeInsets.only(top: 16), buildMessage(),
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]),
);
}),
), ),
); );
} }
Widget buildMessageItem(Message message) { Widget newsSurvey(){
return Container( return Container(
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 8.h), color: Colors.white,
padding: EdgeInsets.all(20.w), padding: EdgeInsets.only(top: 16.h,bottom: 16.h),
decoration: BoxDecoration( child: Row(
color: Colors.white, children: [
boxShadow: [ Expanded(child: GestureDetector(
BoxShadow( onTap: (){
color: Colors.black.withAlpha(12), Navigator.of(context)
offset: Offset(0, 3), .pushNamed('/router/system_details',arguments: {"msgType":5});
blurRadius: 14, },
spreadRadius: 0, 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( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Image.asset(
children: [ (message.typed == 1)
Image.asset( ? "assets/image/icon_system_message.png"
(message.typed == 1) : (message.typed == 2)
? "assets/image/icon_system_notices.png" ? "assets/image/icon_system_message.png"
: (message.typed == 2) : "assets/image/c_z.png",
? "assets/image/icon_system_order.png" width: 40.w,
: "assets/image/icon_system_recharge.png", height: 40.h,
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( SizedBox(
message.updateTime, width:12.w,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
), ),
], Expanded(child:Column(
),
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, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Row(
S.of(context).chakangengduo, children: [
style: TextStyle( Expanded(child:Text(
fontSize: 12.sp, (message.typed == 1)
fontWeight: FontWeight.bold, ? S.of(context).xitongtongzhi
color: Color(0xFF353535), : (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( Container(
margin: EdgeInsets.only(left: 28.w, top: 22.h), margin: EdgeInsets.only(top: 16.h,bottom:8.h),
child: Text( height: 1.h,
message.content, width: double.infinity,
style: TextStyle( color: Color(0xFFF7F7F7),
fontSize: 10.sp, ),
color: Color(0xFF353535),
),
),
),
], ],
), ),
// 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等级信息 /// VIP等级信息
MineVipView( MineVipView(
tag: "vip", tag: "vip",
@ -214,6 +211,9 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
), ),
), ),
/////
attention(),
/// ///
WalletCoupon(), WalletCoupon(),
@ -311,7 +311,20 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
///// /////
Widget attention(){ Widget attention(){
return Container( 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( child:GestureDetector(
onTap:(){ onTap:(){
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
@ -331,23 +344,23 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
); );
}, },
child: child:
Row( Column(
children: [ children: [
Text( Text(
S.of(context).guanzhu, infoNumber != null ?infoNumber.follow.toString() :"0",
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 14.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.medium,
), ),
), ),
SizedBox(width: 5,), SizedBox(height:4,),
Text( Text(
infoNumber != null ?infoNumber.follow.toString() :"0", S.of(context).guanzhu,
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 15.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.regular,
), ),
), ),
], ],
@ -361,23 +374,23 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
); );
}, },
child: child:
Row( Column(
children: [ children: [
Text( Text(
S.of(context).fensi, infoNumber != null ?infoNumber.fans.toString() :"0",
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 14.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.medium,
), ),
), ),
SizedBox(width: 5,), SizedBox(height:4,),
Text( Text(
infoNumber != null ?infoNumber.fans.toString() :"0", S.of(context).fensi,
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 15.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.regular,
), ),
), ),
], ],
@ -391,23 +404,23 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
); );
}, },
child: child:
Row( Column(
children: [ children: [
Text( Text(
"成就", infoNumber != null ?infoNumber.achievementNumber.toString() :"0",
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 14.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.medium,
), ),
), ),
SizedBox(width: 5,), SizedBox(height:4,),
Text( Text(
infoNumber != null ?infoNumber.achievementNumber.toString() :"0", "成就",
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 15.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.regular,
), ),
), ),
], ],

179
lib/mine/mine_view/mine_item.dart

@ -17,7 +17,7 @@ class _MineItem extends State<MineItem> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.fromLTRB(16.w, 10.h, 16.w, 28.h), 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( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
@ -50,7 +50,7 @@ class _MineItem extends State<MineItem> {
// ), // ),
// ), // ),
Container( Container(
padding: EdgeInsets.symmetric(vertical: 4.h), padding: EdgeInsets.only(left: 16,top:16,bottom:4),
child: Text( child: Text(
S.of(context).wodegongju, S.of(context).wodegongju,
style: TextStyle( style: TextStyle(
@ -60,74 +60,79 @@ class _MineItem extends State<MineItem> {
), ),
), ),
), ),
InkWell( Row(
onTap: () { children: [
SharedPreferences.getInstance().then((value) { Expanded(child: InkWell(
if (value.getString("token") == null || onTap: () {
value.getString("token") == "") { SharedPreferences.getInstance().then((value) {
LoginTipsDialog().show(context); if (value.getString("token") == null ||
return; value.getString("token") == "") {
} LoginTipsDialog().show(context);
Navigator.of(context) return;
.pushNamed('/router/releasePage', }
arguments: {}); Navigator.of(context)
}); .pushNamed('/router/releasePage',
}, arguments: {});
child: mineItem( });
S.of(context).wodedongtai, },
"assets/image/dynamic.png", child: mineItem(
), S.of(context).wodedongtai,
), "assets/image/dynamic.png",
InkWell( ),
onTap: () { ),),
SharedPreferences.getInstance().then((value) { Expanded(child: InkWell(
if (value.getString("token") == null || onTap: () {
value.getString("token") == "") { SharedPreferences.getInstance().then((value) {
LoginTipsDialog().show(context); if (value.getString("token") == null ||
return; value.getString("token") == "") {
} LoginTipsDialog().show(context);
Navigator.of(context) return;
.pushNamed('/router/exchange_history_page'); }
}); Navigator.of(context)
}, .pushNamed('/router/exchange_history_page');
child: mineItem( });
S.of(context).duihuanlishi, },
"assets/image/icon_mine_records_of_consumption.png", child: mineItem(
), S.of(context).duihuanlishi,
), "assets/image/icon_mine_records_of_consumption.png",
InkWell( ),
onTap: () { ),),
SharedPreferences.getInstance().then((value) { Expanded(child: InkWell(
if (value.getString("token") == null || onTap: () {
value.getString("token") == "") { SharedPreferences.getInstance().then((value) {
LoginTipsDialog().show(context); if (value.getString("token") == null ||
return; value.getString("token") == "") {
} LoginTipsDialog().show(context);
Navigator.of(context).pushNamed('/router/mine_card'); return;
}); }
}, Navigator.of(context).pushNamed('/router/mine_card');
child: mineItem( });
S.of(context).wodekaquan, },
"assets/image/icon_mine_card.png", 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( Padding(padding:EdgeInsets.only(left:24),
onTap: () { child: InkWell(
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: () { onTap: () {
Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); Navigator.of(context).pushNamed('/router/qr_share', arguments: {});
}, },
@ -135,7 +140,8 @@ class _MineItem extends State<MineItem> {
S.of(context).tuiguangma, S.of(context).tuiguangma,
"assets/image/icon_mine_promotion_code.png", "assets/image/icon_mine_promotion_code.png",
), ),
), ),)
// mineItem( // mineItem(
// S.of(context).bangzhuyufankui, // S.of(context).bangzhuyufankui,
// "assets/image/icon_mine_feedback.png", // "assets/image/icon_mine_feedback.png",
@ -150,34 +156,31 @@ class _MineItem extends State<MineItem> {
return Container( return Container(
color: Colors.white, color: Colors.white,
margin: EdgeInsets.symmetric(vertical: 6.h), margin: EdgeInsets.symmetric(vertical: 6.h),
child: Row( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
icon, icon,
width: 28.w, width: 32.w,
height: 28.h, height: 32.w,
), ),
SizedBox( SizedBox(
width: 8.w, height: 2.h,
), ),
Expanded( Text(
flex: 1, text,
child: Text( style: TextStyle(
text, fontWeight: MyFontWeight.medium,
style: TextStyle( fontSize: 12.sp,
fontWeight: MyFontWeight.medium, color: Color(0xFF353535),
fontSize: 16.sp,
color: Color(0xFF353535),
),
), ),
), ),
Icon( // Icon(
Icons.keyboard_arrow_right, // Icons.keyboard_arrow_right,
size: 20, // size: 20,
color: Colors.black, // 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), padding: EdgeInsets.all(8.h),
child: Image.asset( child: Image.asset(
"assets/image/icon_scan_qr_code.png", "assets/image/icon_scan_qr_code.png",
width: 24.w, width:32.w,
height: 24.h, height: 32.h,
), ),
), ),
), ),
@ -56,8 +56,8 @@ class _MineView extends State<MineView> {
margin: EdgeInsets.only(right: 12.w), margin: EdgeInsets.only(right: 12.w),
child: Image.asset( child: Image.asset(
"assets/image/icon_mine_setting.png", "assets/image/icon_mine_setting.png",
width: 24.w, width: 32.w,
height: 24.h, 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/classic_header.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.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:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -57,7 +58,8 @@ class _MineWalletPage extends State<MineWalletPage> {
} }
queryUserBalance() async { queryUserBalance() async {
BaseData<UserInfo> baseData = await apiService.queryInfo().catchError((onError) {}); BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data; userInfo = baseData.data;
mBalance = double.tryParse(userInfo.money); mBalance = double.tryParse(userInfo.money);
@ -168,14 +170,21 @@ class _MineWalletPage extends State<MineWalletPage> {
), ),
Container( Container(
margin: EdgeInsets.only(top: 14.h), margin: EdgeInsets.only(top: 14.h),
child: ListView.builder( child: (userBills == null || userBills.length == 0)
itemCount: userBills != null ? userBills.length : 0, ? NoDataView(
shrinkWrap: true, isShowBtn: false,
padding: EdgeInsets.only(bottom: 20.h), text: "目前暂未记录哦",
physics: NeverScrollableScrollPhysics(), fontSize: 16.sp,
itemBuilder: (context, position) { margin: EdgeInsets.only(top: 120.h),
return historyItem(userBills[position], position); )
}), : 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( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: 34.h, // height: 34.h,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

34
lib/mine/release_page.dart

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

130
lib/retrofit/data/article.dart

@ -14,7 +14,7 @@ class Article {
dynamic _viceTitle; dynamic _viceTitle;
String _content; String _content;
String _coverImg; String _coverImg;
Author _author; dynamic _author;
int _type; int _type;
String _startTime; String _startTime;
String _categoryId; String _categoryId;
@ -26,6 +26,8 @@ class Article {
bool _liked; bool _liked;
int _viewers; int _viewers;
int _comments; int _comments;
String _authorName;
String _authorHeadImg;
bool isFollow; bool isFollow;
dynamic _storeName; dynamic _storeName;
@ -39,7 +41,7 @@ class Article {
dynamic get viceTitle => _viceTitle; dynamic get viceTitle => _viceTitle;
String get content => _content; String get content => _content;
String get coverImg => _coverImg; String get coverImg => _coverImg;
Author get author => _author; dynamic 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 categoryId => _categoryId;
@ -51,8 +53,14 @@ class Article {
bool get liked => _liked; bool get liked => _liked;
int get viewers => _viewers; int get viewers => _viewers;
int get comments => _comments; int get comments => _comments;
String get authorName => _authorName;
String get authorHeadImg => _authorHeadImg;
dynamic get storeName => _storeName; dynamic get storeName => _storeName;
set id(String value) {
_id = value;
}
set likes(int value) { set likes(int value) {
_likes = value; _likes = value;
} }
@ -69,27 +77,38 @@ class Article {
_comments = value; _comments = value;
} }
set authorName(String value) {
_authorName = value;
}
set authorHeadImg(String value) {
_authorHeadImg = value;
}
Article({ Article({
String id, String id,
String createTime, String createTime,
dynamic createUser, dynamic createUser,
String updateTime, String updateTime,
dynamic updateUser, dynamic updateUser,
String storeId, String storeId,
String mainTitle, String mainTitle,
dynamic viceTitle, dynamic viceTitle,
String content, String content,
String coverImg, String coverImg,
Author author, Author author,
int type, int type,
String startTime, String startTime,
String endTime, String endTime,
int state, int state,
int isDelete, int isDelete,
int likes, int likes,
bool isHot, bool isHot,
int viewers, int viewers,
int comments, int comments,
String authorName,
String authorHeadImg,
dynamic storeName}){ dynamic storeName}){
_id = id; _id = id;
_createTime = createTime; _createTime = createTime;
@ -113,6 +132,8 @@ class Article {
_liked = liked; _liked = liked;
_viewers = viewers; _viewers = viewers;
_comments = comments; _comments = comments;
_authorName = authorName;
_authorHeadImg = authorHeadImg;
_storeName = storeName; _storeName = storeName;
} }
@ -127,7 +148,7 @@ class Article {
_viceTitle = json["viceTitle"]; _viceTitle = json["viceTitle"];
_content = json["content"]; _content = json["content"];
_coverImg = json["coverImg"]; _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"]; _type = json["type"];
_startTime = json["startTime"]; _startTime = json["startTime"];
_categoryId = json["categoryId"]; _categoryId = json["categoryId"];
@ -139,6 +160,8 @@ class Article {
_liked = json["liked"]; _liked = json["liked"];
_viewers = json["viewers"]; _viewers = json["viewers"];
_comments = json["comments"]; _comments = json["comments"];
_authorName = json["authorName"];
_authorHeadImg = json["authorHeadImg"];
_storeName = json["storeName"]; _storeName = json["storeName"];
} }
@ -166,8 +189,81 @@ class Article {
map["liked"] = _liked; map["liked"] = _liked;
map["viewers"] = _viewers; map["viewers"] = _viewers;
map["comments"] = _comments; map["comments"] = _comments;
map["authorName"] = _authorName;
map["authorHeadImg"] = _authorHeadImg;
map["storeName"] = _storeName; map["storeName"] = _storeName;
return map; 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" /// id : "1483062749750624256"
/// createTime : "2021-07-28 10:58:26" /// createTime : "2022-01-17 21:04:48"
/// createUser : "0" /// createUser : "0"
/// updateTime : "2021-07-28 10:58:29" /// updateTime : "2022-01-17 21:04:48"
/// updateUser : "0" /// updateUser : "0"
/// mid : "1406879717390286848" /// mid : "1478548672881885184"
/// title : "充值成功" /// title : "粉丝关注"
/// content : "你于2021-07-28 10:52:02充值0.01元,当前余额:0.08元。" /// content : "哈哈哈关注了你!"
/// typed : 3 /// typed : 4
/// relational : "" /// 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 : 1 /// state : 0
/// isDelete : 0 /// isDelete : 0
/// followed : false
class Message { 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({ Message({
String id, String id,
String createTime, String createTime,
@ -51,7 +25,8 @@ class Message {
int typed, int typed,
String relational, String relational,
int state, int state,
int isDelete}){ int isDelete,
bool followed,}){
_id = id; _id = id;
_createTime = createTime; _createTime = createTime;
_createUser = createUser; _createUser = createUser;
@ -64,37 +39,67 @@ class Message {
_relational = relational; _relational = relational;
_state = state; _state = state;
_isDelete = isDelete; _isDelete = isDelete;
_followed = followed;
} }
Message.fromJson(dynamic json) { Message.fromJson(dynamic json) {
_id = json["id"]; _id = json['id'];
_createTime = json["createTime"]; _createTime = json['createTime'];
_createUser = json["createUser"]; _createUser = json['createUser'];
_updateTime = json["updateTime"]; _updateTime = json['updateTime'];
_updateUser = json["updateUser"]; _updateUser = json['updateUser'];
_mid = json["mid"]; _mid = json['mid'];
_title = json["title"]; _title = json['title'];
_content = json["content"]; _content = json['content'];
_typed = json["typed"]; _typed = json['typed'];
_relational = json["relational"]; _relational = json['relational'];
_state = json["state"]; _state = json['state'];
_isDelete = json["isDelete"]; _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() { Map<String, dynamic> toJson() {
var map = <String, dynamic>{}; final map = <String, dynamic>{};
map["id"] = _id; map['id'] = _id;
map["createTime"] = _createTime; map['createTime'] = _createTime;
map["createUser"] = _createUser; map['createUser'] = _createUser;
map["updateTime"] = _updateTime; map['updateTime'] = _updateTime;
map["updateUser"] = _updateUser; map['updateUser'] = _updateUser;
map["mid"] = _mid; map['mid'] = _mid;
map["title"] = _title; map['title'] = _title;
map["content"] = _content; map['content'] = _content;
map["typed"] = _typed; map['typed'] = _typed;
map["relational"] = _relational; map['relational'] = _relational;
map["state"] = _state; map['state'] = _state;
map["isDelete"] = _isDelete; map['isDelete'] = _isDelete;
map['followed'] = _followed;
return map; 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") @POST("store/getStore")
Future<BaseData> queryStoreInfo1(@Body() Map<String, dynamic> param); Future<BaseData> queryStoreInfo1(@Body() Map<String, dynamic> param);
// ///
@GET("order/getParentInfo?tableId={tableId}") @GET("order/getParentInfo?tableId={tableId}")
Future<BaseData> getParentInfo(@Path("tableId") String 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/logistics.dart';
import 'data/member_comment_list.dart'; import 'data/member_comment_list.dart';
import 'data/message.dart'; import 'data/message.dart';
import 'data/msg_stats.dart';
import 'data/page.dart'; import 'data/page.dart';
import 'data/rank.dart'; import 'data/rank.dart';
import 'data/second_card_list.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 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.159:8766/app/"; ///
// const baseUrl = "http://192.168.10.159: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/";
@ -345,6 +349,10 @@ abstract class ApiService {
@GET("/app-msg/{id}") @GET("/app-msg/{id}")
Future<BaseData> queryMsg(@Path("id") String id); Future<BaseData> queryMsg(@Path("id") String id);
///App消息
@GET("/app-msg/stats")
Future<BaseData<List<MsgStats>>> stats();
//// ////
@GET("/information/likes/{id}") @GET("/information/likes/{id}")
Future<BaseData> informationLikes(@Path("id") String id); Future<BaseData> informationLikes(@Path("id") String id);
@ -396,7 +404,6 @@ abstract class ApiService {
@POST("/member/follow/list") @POST("/member/follow/list")
Future<BaseData<PageInfo<ListData>>> followList(@Body() Map<String, dynamic> map); Future<BaseData<PageInfo<ListData>>> followList(@Body() Map<String, dynamic> map);
//// ////
@PUT("/member/follow/{followId}") @PUT("/member/follow/{followId}")
Future<BaseData> follow(@Path("followId") String 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; 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 @override
Future<BaseData<dynamic>> informationLikes(id) async { Future<BaseData<dynamic>> informationLikes(id) async {
ArgumentError.checkNotNull(id, 'id'); 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( margin: EdgeInsets.only(
left: 16.w, left: 16.w,
), ),
height: 44.h, // height: 44.h,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, 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, bottom: 0,
left: 0, left: 0,
right: 0, right: 0,

2
lib/store/store_view/store_info.dart

@ -30,7 +30,7 @@ class _StoreInfoView extends State<StoreInfoView> {
top: 5.h, top: 5.h,
bottom: 6.h, bottom: 6.h,
), ),
height: 138.h, height: 140.h,
padding: EdgeInsets.all(12.w), padding: EdgeInsets.all(12.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, 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), margin: EdgeInsets.only(left: 5, bottom: 12.h),
), ),
Container( Container(
height: 0.035.sh, // height: 0.035.sh,
margin: EdgeInsets.only(bottom:10.h),
child: TextField( child: TextField(
controller: controller, controller: controller,
style: style, style: style,

8
lib/view_widget/request_permission.dart

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

Loading…
Cancel
Save