Browse Source

社群更改

master
w-R 3 years ago
parent
commit
919bf10296
  1. BIN
      assets/image/2x/dynamic.png
  2. BIN
      assets/image/3x/dynamic.png
  3. BIN
      assets/image/dynamic.png
  4. 1
      lib/community/community_child_page.dart
  5. 30
      lib/community/community_details.dart
  6. 183
      lib/community/community_view/community_dynamic.dart
  7. 6
      lib/community/release_dynamic.dart
  8. 3
      lib/generated/intl/messages_en.dart
  9. 3
      lib/generated/intl/messages_zh_CN.dart
  10. 3
      lib/generated/intl/messages_zh_Hans_CN.dart
  11. 3
      lib/generated/intl/messages_zh_Hant_CN.dart
  12. 3
      lib/generated/intl/messages_zh_TW.dart
  13. 30
      lib/generated/l10n.dart
  14. 3
      lib/l10n/intl_en.arb
  15. 3
      lib/l10n/intl_zh_CN.arb
  16. 3
      lib/l10n/intl_zh_Hans_CN.arb
  17. 3
      lib/l10n/intl_zh_Hant_CN.arb
  18. 3
      lib/l10n/intl_zh_TW.arb
  19. 1
      lib/mine/manage_address_page.dart
  20. 56
      lib/mine/mine_page.dart
  21. 6
      lib/mine/mine_view/community_follow.dart
  22. 17
      lib/mine/mine_view/mine_item.dart
  23. 77
      lib/mine/release_page.dart
  24. 12
      lib/retrofit/data/article.dart
  25. 37
      lib/retrofit/data/social_info.dart
  26. 9
      lib/retrofit/retrofit_api.dart
  27. 43
      lib/retrofit/retrofit_api.g.dart
  28. 163
      lib/view_widget/hot_item.dart
  29. 7
      lib/web/web_page.dart
  30. 4
      lib/web/web_view/comment_list.dart

BIN
assets/image/2x/dynamic.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
assets/image/3x/dynamic.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
assets/image/dynamic.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

1
lib/community/community_child_page.dart

@ -40,6 +40,7 @@ class _CommunityChildPage extends State<CommunityChildPage> {
setState(() {}); setState(() {});
} }
///
queryCommunity() async { queryCommunity() async {
if (apiService == null) { if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();

30
lib/community/community_details.dart

@ -5,6 +5,8 @@ import 'package:huixiang/community/community_view/community_comment.dart';
import 'package:huixiang/community/community_view/community_dynamic.dart'; import 'package:huixiang/community/community_view/community_dynamic.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/data/activity.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/member_comment_list.dart'; import 'package:huixiang/retrofit/data/member_comment_list.dart';
@ -14,6 +16,7 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/comment_menu.dart'; import 'package:huixiang/view_widget/comment_menu.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:huixiang/view_widget/tips_dialog.dart'; import 'package:huixiang/view_widget/tips_dialog.dart';
import 'package:huixiang/web/web_view/comment_list.dart';
import 'package:huixiang/web/web_view/input_comment.dart'; import 'package:huixiang/web/web_view/input_comment.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -43,8 +46,9 @@ class _CommunityDetails extends State<CommunityDetails>
String hintText = S.current.liuxianinjingcaidepinglunba; String hintText = S.current.liuxianinjingcaidepinglunba;
bool isKeyBoardShow = false; bool isKeyBoardShow = false;
int commentTotal = 0; int commentTotal = 0;
Article article;
@override @override
void didChangeMetrics() { void didChangeMetrics() {
@ -73,13 +77,20 @@ class _CommunityDetails extends State<CommunityDetails>
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
_queryMemberCommentList(); _queryMemberCommentList();
SharedPreferences.getInstance().then((value) { queryDetails();
apiService = ApiService( }
Dio(),
context: context, ///
token: value.getString("token"), queryDetails() async {
); SharedPreferences value = await SharedPreferences.getInstance();
}); if (apiService == null)
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
BaseData<Article> baseData = await apiService
.informationInfo(comunity.id)
.catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
}
} }
@override @override
@ -280,7 +291,8 @@ class _CommunityDetails extends State<CommunityDetails>
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
// commentKey.currentState.initState(); // commentKey.currentState.initState();
commentTextController.text = ""; commentTextController.text = "";
_toComment(); FocusScope.of(context).unfocus();
_queryMemberCommentList();
} }
} }

183
lib/community/community_view/community_dynamic.dart

@ -5,6 +5,7 @@ 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/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/custom_image.dart'; 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';
@ -16,16 +17,18 @@ class CommunityDynamic extends StatefulWidget {
final Function(double height) heightFun; final Function(double height) heightFun;
final bool isDetails; final bool isDetails;
final int commentType; final int commentType;
final Function removalDynamic;
final ComunityComment comment; final ComunityComment comment;
CommunityDynamic( CommunityDynamic(
this.comment, this.comment,
this.commentType,{ this.commentType, {
Key key, Key key,
this.itemCount = 9, this.itemCount = 9,
this.heightFun, this.heightFun,
this.isDetails = false, this.isDetails = false,
this.removalDynamic,
}) : super(key: key); }) : super(key: key);
@override @override
@ -33,6 +36,7 @@ class CommunityDynamic extends StatefulWidget {
return _CommunityDynamic(); return _CommunityDynamic();
} }
} }
class _CommunityDynamic extends State<CommunityDynamic> { class _CommunityDynamic extends State<CommunityDynamic> {
GlobalKey globalKey = GlobalKey(); GlobalKey globalKey = GlobalKey();
double height = 0; double height = 0;
@ -42,16 +46,29 @@ class _CommunityDynamic extends State<CommunityDynamic> {
void initState() { void initState() {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString('token')), context: context, token: value.getString('token')),
}); });
} }
//// ////
_vipFollow(followId) async { _vipFollow(followId) async {
BaseData baseData = await apiService.follow(followId); BaseData baseData = await apiService.follow(followId);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("关注成功"); SmartDialog.showToast("关注成功", alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
///
_deleteDynamic(id) async {
BaseData baseData = await apiService.deleteTrend(id);
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("删除成功", alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
} }
@ -60,6 +77,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
return Column( return Column(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 2),
key: globalKey, key: globalKey,
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
@ -88,7 +106,9 @@ class _CommunityDynamic extends State<CommunityDynamic> {
child: Row( child: Row(
children: [ children: [
MImage( MImage(
widget.comment != null ? widget.comment.memberInfo.avatar : "", widget.comment != null
? widget.comment.memberInfo.avatar
: "",
width: 44, width: 44,
height: 44, height: 44,
isCircle: true, isCircle: true,
@ -104,7 +124,9 @@ class _CommunityDynamic extends State<CommunityDynamic> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
widget.comment != null ? widget.comment.memberInfo.nickname : "", widget.comment != null
? widget.comment.memberInfo.nickname
: "",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
@ -112,7 +134,9 @@ class _CommunityDynamic extends State<CommunityDynamic> {
), ),
), ),
Text( Text(
widget.comment != null ? widget.comment.createTime : "", widget.comment != null
? widget.comment.createTime
: "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -125,35 +149,48 @@ class _CommunityDynamic extends State<CommunityDynamic> {
), ),
), ),
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
setState(() { setState(() {
if(widget.commentType == 0){ if (widget.commentType == 0) {
widget.comment.selfFollow = !(widget.comment.selfFollow??false); widget.comment.selfFollow =
!(widget.comment.selfFollow ?? false);
_vipFollow(widget.comment.memberInfo.mid); _vipFollow(widget.comment.memberInfo.mid);
}else{ } else {
SmartDialog.showToast("删除成功", alignment: Alignment.center); showDeleteDialog();
} }
}); });
}, },
child: (widget.commentType == 0)?RoundButton( child: (widget.commentType == 0)
padding: EdgeInsets.symmetric( ? RoundButton(
horizontal: 8, padding: EdgeInsets.symmetric(
vertical: 3, horizontal: 8,
), vertical: 3,
backgroup: (widget.comment.selfFollow??false) ? Color(0xFFE6E6E6) : Color(0xFF32A060), ),
textColor: (widget.comment.selfFollow??false) ? Color(0xFF808080):Colors.white , backgroup: (widget.comment.selfFollow ?? false)
text:(widget.comment.selfFollow??false) ? "已关注":"关注", ? Color(0xFFE6E6E6)
radius: 20, : Color(0xFF32A060),
icons: Icon( textColor: (widget.comment.selfFollow ?? false)
(widget.comment.selfFollow??false) ? Icons.check: Icons.add, ? Color(0xFF808080)
color:(widget.comment.selfFollow??false) ? Color(0xFF808080):Colors.white , : Colors.white,
size: 14, text: (widget.comment.selfFollow ?? false)
), ? "已关注"
):Icon( : "关注",
Icons.close, radius: 20,
color:Colors.black, icons: Icon(
size: 16, (widget.comment.selfFollow ?? false)
), ? Icons.check
: Icons.add,
color: (widget.comment.selfFollow ?? false)
? Color(0xFF808080)
: Colors.white,
size: 14,
),
)
: Icon(
Icons.close,
color: Colors.black,
size: 16,
),
), ),
], ],
), ),
@ -162,7 +199,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
), ),
Text( Text(
widget.comment.subject ?? "", widget.comment.subject ?? "",
maxLines: 5, // maxLines: 5,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: Color(0xFF1A1A1A), color: Color(0xFF1A1A1A),
@ -181,7 +218,10 @@ class _CommunityDynamic extends State<CommunityDynamic> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
IconText( IconText(
"${widget.comment.viewers ?? 0}", (widget.comment != null)
? "${widget.comment.viewers}"
: "",
// "${widget.comment.viewers ?? 0}",
space: 4.w, space: 4.w,
leftImage: "assets/svg/liulanliang.svg", leftImage: "assets/svg/liulanliang.svg",
iconSize: 16, iconSize: 16,
@ -280,6 +320,81 @@ class _CommunityDynamic extends State<CommunityDynamic> {
); );
} }
///
showDeleteDialog() {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Container(
width: MediaQuery.of(context).size.width - 84,
height: 110.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"确定要删除这条动态?",
style: TextStyle(
fontSize: 17.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
SizedBox(
height: 30.h,
),
Row(
children: [
Expanded(
child: InkWell(
child: BorderText(
text: "取消",
textColor: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
borderColor: Color(0xFF32A060),
radius: 4,
padding: EdgeInsets.all(12),
borderWidth: 1,
),
onTap: () {
Navigator.of(context).pop();
},
),
flex: 1,
),
SizedBox(
width: 16.w,
),
Expanded(
child: InkWell(
child: RoundButton(
text: "确定",
textColor: Colors.white,
radius: 4,
padding: EdgeInsets.all(12),
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
onTap: () {
_deleteDynamic(widget.comment.id);
Navigator.of(context).pop();
},
),
flex: 1,
),
],
)
],
),
),
);
},
);
}
@override @override
void didChangeDependencies() { void didChangeDependencies() {
if (widget.heightFun != null) if (widget.heightFun != null)

6
lib/community/release_dynamic.dart

@ -30,6 +30,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
TextEditingController textEditingController = TextEditingController(); TextEditingController textEditingController = TextEditingController();
ApiService apiService; ApiService apiService;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -118,7 +119,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
releaseDynamic() async { releaseDynamic() async {
String dynamicText = textEditingController.text; String dynamicText = textEditingController.text;
if (dynamicText == null || dynamicText == "") { if (dynamicText == null || dynamicText == "") {
SmartDialog.showToast("请输入您此刻的想法!"); SmartDialog.showToast("请输入您此刻的想法!");
return; return;
} }
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai);
@ -152,7 +153,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
EasyLoading.dismiss(); EasyLoading.dismiss();
}); });
if (baseData.isSuccess) { if (baseData.isSuccess) {
SmartDialog.showToast("发布成功!"); SmartDialog.showToast("发布成功!");
Future.delayed(Duration(seconds: 1), () { Future.delayed(Duration(seconds: 1), () {
Navigator.of(context).pop(true); Navigator.of(context).pop(true);
}); });
@ -367,6 +368,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
), ),
child: TextField( child: TextField(
controller: textEditingController, controller: textEditingController,
maxLines:5,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,

3
lib/generated/intl/messages_en.dart

@ -200,6 +200,7 @@ class MessageLookup extends MessageLookupByLibrary {
"faxingshijian" : m4, "faxingshijian" : m4,
"feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换吗"), "feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换吗"),
"feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到卡包即可使用!"), "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到卡包即可使用!"),
"fensi" : MessageLookupByLibrary.simpleMessage("粉丝"),
"fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"),
"fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接点击右上方的分享给到你想要邀请的人。"), "fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接点击右上方的分享给到你想要邀请的人。"),
"fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"), "fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"),
@ -218,6 +219,7 @@ class MessageLookup extends MessageLookupByLibrary {
"guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"), "guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"),
"guanyu" : MessageLookupByLibrary.simpleMessage("关于"), "guanyu" : MessageLookupByLibrary.simpleMessage("关于"),
"guanyuchuangshiren" : MessageLookupByLibrary.simpleMessage("关于创始人"), "guanyuchuangshiren" : MessageLookupByLibrary.simpleMessage("关于创始人"),
"guanzhu" : MessageLookupByLibrary.simpleMessage("关注"),
"guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"),
"haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"), "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"),
"haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("还没有优惠券可以领取~"), "haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("还没有优惠券可以领取~"),
@ -491,6 +493,7 @@ class MessageLookup extends MessageLookupByLibrary {
"wenzhang" : MessageLookupByLibrary.simpleMessage("文章"), "wenzhang" : MessageLookupByLibrary.simpleMessage("文章"),
"wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章详情"), "wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章详情"),
"weulingqu" : MessageLookupByLibrary.simpleMessage("未领取"), "weulingqu" : MessageLookupByLibrary.simpleMessage("未领取"),
"wodedongtai" : MessageLookupByLibrary.simpleMessage("我的动态"),
"wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"),
"wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"),
"wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"),

3
lib/generated/intl/messages_zh_CN.dart

@ -200,6 +200,7 @@ class MessageLookup extends MessageLookupByLibrary {
"faxingshijian" : m4, "faxingshijian" : m4,
"feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换吗"), "feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换吗"),
"feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到卡包即可使用!"), "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到卡包即可使用!"),
"fensi" : MessageLookupByLibrary.simpleMessage("粉丝"),
"fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"),
"fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接点击右上方的分享给到你想要邀请的人。"), "fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接点击右上方的分享给到你想要邀请的人。"),
"fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"), "fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"),
@ -217,6 +218,7 @@ class MessageLookup extends MessageLookupByLibrary {
"gouxuanxieyi" : MessageLookupByLibrary.simpleMessage("请勾选同意隐私服务和一心回乡服务协议"), "gouxuanxieyi" : MessageLookupByLibrary.simpleMessage("请勾选同意隐私服务和一心回乡服务协议"),
"guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"), "guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"),
"guanyu" : MessageLookupByLibrary.simpleMessage("关于"), "guanyu" : MessageLookupByLibrary.simpleMessage("关于"),
"guanzhu" : MessageLookupByLibrary.simpleMessage("关注"),
"guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"),
"haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"), "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"),
"haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("还没有优惠券可以领取~"), "haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("还没有优惠券可以领取~"),
@ -490,6 +492,7 @@ class MessageLookup extends MessageLookupByLibrary {
"wenzhang" : MessageLookupByLibrary.simpleMessage("文章"), "wenzhang" : MessageLookupByLibrary.simpleMessage("文章"),
"wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章详情"), "wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章详情"),
"weulingqu" : MessageLookupByLibrary.simpleMessage("未领取"), "weulingqu" : MessageLookupByLibrary.simpleMessage("未领取"),
"wodedongtai" : MessageLookupByLibrary.simpleMessage("我的动态"),
"wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"),
"wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"),
"wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"),

3
lib/generated/intl/messages_zh_Hans_CN.dart

@ -200,6 +200,7 @@ class MessageLookup extends MessageLookupByLibrary {
"faxingshijian" : m4, "faxingshijian" : m4,
"feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换吗"), "feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换吗"),
"feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到卡包即可使用!"), "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到卡包即可使用!"),
"fensi" : MessageLookupByLibrary.simpleMessage("粉丝"),
"fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"),
"fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接点击右上方的分享给到你想要邀请的人。"), "fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接点击右上方的分享给到你想要邀请的人。"),
"fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"), "fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"),
@ -217,6 +218,7 @@ class MessageLookup extends MessageLookupByLibrary {
"gouxuanxieyi" : MessageLookupByLibrary.simpleMessage("请勾选同意隐私服务和一心回乡服务协议"), "gouxuanxieyi" : MessageLookupByLibrary.simpleMessage("请勾选同意隐私服务和一心回乡服务协议"),
"guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"), "guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"),
"guanyu" : MessageLookupByLibrary.simpleMessage("关于"), "guanyu" : MessageLookupByLibrary.simpleMessage("关于"),
"guanzhu" : MessageLookupByLibrary.simpleMessage("关注"),
"guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"),
"haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"), "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"),
"haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("还没有优惠券可以领取~"), "haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("还没有优惠券可以领取~"),
@ -490,6 +492,7 @@ class MessageLookup extends MessageLookupByLibrary {
"wenzhang" : MessageLookupByLibrary.simpleMessage("文章"), "wenzhang" : MessageLookupByLibrary.simpleMessage("文章"),
"wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章详情"), "wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章详情"),
"weulingqu" : MessageLookupByLibrary.simpleMessage("未领取"), "weulingqu" : MessageLookupByLibrary.simpleMessage("未领取"),
"wodedongtai" : MessageLookupByLibrary.simpleMessage("我的动态"),
"wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"),
"wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"),
"wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"),

3
lib/generated/intl/messages_zh_Hant_CN.dart

@ -200,6 +200,7 @@ class MessageLookup extends MessageLookupByLibrary {
"faxingshijian" : m4, "faxingshijian" : m4,
"feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非實物兌換碼"), "feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非實物兌換碼"),
"feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非實物商品!"), "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非實物商品!"),
"fensi" : MessageLookupByLibrary.simpleMessage("粉絲"),
"fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"),
"fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接點擊右上方的分享給到你想要邀請的人。"), "fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接點擊右上方的分享給到你想要邀請的人。"),
"fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"), "fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"),
@ -217,6 +218,7 @@ class MessageLookup extends MessageLookupByLibrary {
"gouxuanxieyi" : MessageLookupByLibrary.simpleMessage("請勾選同意隱私服務和一心回鄉服務協定"), "gouxuanxieyi" : MessageLookupByLibrary.simpleMessage("請勾選同意隱私服務和一心回鄉服務協定"),
"guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"), "guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"),
"guanyu" : MessageLookupByLibrary.simpleMessage("關於"), "guanyu" : MessageLookupByLibrary.simpleMessage("關於"),
"guanzhu" : MessageLookupByLibrary.simpleMessage("關注"),
"guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("過健康有機生活"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("過健康有機生活"),
"haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("還沒有消息~"), "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("還沒有消息~"),
"haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("還沒有優惠券可以領取~"), "haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("還沒有優惠券可以領取~"),
@ -490,6 +492,7 @@ class MessageLookup extends MessageLookupByLibrary {
"wenzhang" : MessageLookupByLibrary.simpleMessage("文章"), "wenzhang" : MessageLookupByLibrary.simpleMessage("文章"),
"wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章詳情"), "wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章詳情"),
"weulingqu" : MessageLookupByLibrary.simpleMessage("未領取"), "weulingqu" : MessageLookupByLibrary.simpleMessage("未領取"),
"wodedongtai" : MessageLookupByLibrary.simpleMessage("我的動態"),
"wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"),
"wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的會員等級"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的會員等級"),
"wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的積分值"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的積分值"),

3
lib/generated/intl/messages_zh_TW.dart

@ -200,6 +200,7 @@ class MessageLookup extends MessageLookupByLibrary {
"faxingshijian" : m4, "faxingshijian" : m4,
"feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非實物兌換碼"), "feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非實物兌換碼"),
"feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非實物商品!"), "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非實物商品!"),
"fensi" : MessageLookupByLibrary.simpleMessage("粉絲"),
"fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"),
"fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接點擊右上方的分享給到你想要邀請的人。"), "fenxiangyaoqing" : MessageLookupByLibrary.simpleMessage("也可以直接點擊右上方的分享給到你想要邀請的人。"),
"fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"), "fenxiangzhiweixin" : MessageLookupByLibrary.simpleMessage("分享至微信"),
@ -217,6 +218,7 @@ class MessageLookup extends MessageLookupByLibrary {
"gouxuanxieyi" : MessageLookupByLibrary.simpleMessage("請勾選同意隱私服務和一心回鄉服務協定"), "gouxuanxieyi" : MessageLookupByLibrary.simpleMessage("請勾選同意隱私服務和一心回鄉服務協定"),
"guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"), "guanlidizhi" : MessageLookupByLibrary.simpleMessage("管理地址"),
"guanyu" : MessageLookupByLibrary.simpleMessage("關於"), "guanyu" : MessageLookupByLibrary.simpleMessage("關於"),
"guanzhu" : MessageLookupByLibrary.simpleMessage("關注"),
"guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("過健康有機生活"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("過健康有機生活"),
"haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("還沒有消息~"), "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("還沒有消息~"),
"haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("還沒有優惠券可以領取~"), "haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("還沒有優惠券可以領取~"),
@ -490,6 +492,7 @@ class MessageLookup extends MessageLookupByLibrary {
"wenzhang" : MessageLookupByLibrary.simpleMessage("文章"), "wenzhang" : MessageLookupByLibrary.simpleMessage("文章"),
"wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章詳情"), "wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章詳情"),
"weulingqu" : MessageLookupByLibrary.simpleMessage("未領取"), "weulingqu" : MessageLookupByLibrary.simpleMessage("未領取"),
"wodedongtai" : MessageLookupByLibrary.simpleMessage("我的動態"),
"wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"),
"wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的會員等級"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的會員等級"),
"wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的積分值"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的積分值"),

30
lib/generated/l10n.dart

@ -5145,6 +5145,36 @@ class S {
); );
} }
/// ``
String get fensi {
return Intl.message(
'粉丝',
name: 'fensi',
desc: '',
args: [],
);
}
/// ``
String get guanzhu {
return Intl.message(
'关注',
name: 'guanzhu',
desc: '',
args: [],
);
}
/// ``
String get wodedongtai {
return Intl.message(
'我的动态',
name: 'wodedongtai',
desc: '',
args: [],
);
}
/// `使` /// `使`
String get privacy_policy4 { String get privacy_policy4 {
return Intl.message( return Intl.message(

3
lib/l10n/intl_en.arb

@ -534,6 +534,9 @@
"yuanjia": "原价", "yuanjia": "原价",
"xuanguige": "选规格", "xuanguige": "选规格",
"chaojiyouhuiquan": "超值优惠券", "chaojiyouhuiquan": "超值优惠券",
"fensi": "粉丝",
"guanzhu": "关注",
"wodedongtai": "我的动态",

3
lib/l10n/intl_zh_CN.arb

@ -534,6 +534,9 @@
"yuanjia": "原价", "yuanjia": "原价",
"xuanguige": "选规格", "xuanguige": "选规格",
"chaojiyouhuiquan": "超值优惠券", "chaojiyouhuiquan": "超值优惠券",
"fensi": "粉丝",
"guanzhu": "关注",
"wodedongtai": "我的动态",

3
lib/l10n/intl_zh_Hans_CN.arb

@ -534,6 +534,9 @@
"yuanjia": "原价", "yuanjia": "原价",
"xuanguige": "选规格", "xuanguige": "选规格",
"chaojiyouhuiquan": "超值优惠券", "chaojiyouhuiquan": "超值优惠券",
"fensi": "粉丝",
"guanzhu": "关注",
"wodedongtai": "我的动态",

3
lib/l10n/intl_zh_Hant_CN.arb

@ -529,6 +529,9 @@
"yuanjia": "原價", "yuanjia": "原價",
"xuanguige": "選規格", "xuanguige": "選規格",
"chaojiyouhuiquan": "超值优惠券", "chaojiyouhuiquan": "超值优惠券",
"fensi": "粉絲",
"guanzhu": "關注",
"wodedongtai": "我的動態",

3
lib/l10n/intl_zh_TW.arb

@ -528,6 +528,9 @@
"yuanjia": "原價", "yuanjia": "原價",
"xuanguige": "選規格", "xuanguige": "選規格",
"chaojiyouhuiquan": "超值优惠券", "chaojiyouhuiquan": "超值优惠券",
"fensi": "粉絲",
"guanzhu": "關注",
"wodedongtai": "我的動態",

1
lib/mine/manage_address_page.dart

@ -261,6 +261,7 @@ class _ManageAddressPage extends State<ManageAddressPage> {
); );
} }
///
showDeleteDialog(position) { showDeleteDialog(position) {
showDialog( showDialog(
context: context, context: context,

56
lib/mine/mine_page.dart

@ -8,6 +8,8 @@ import 'package:huixiang/main.dart';
import 'package:huixiang/mine/mine_view/mine_order.dart'; import 'package:huixiang/mine/mine_view/mine_order.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/rank.dart'; import 'package:huixiang/retrofit/data/rank.dart';
import 'package:huixiang/retrofit/data/sign_info.dart';
import 'package:huixiang/retrofit/data/social_info.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.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';
@ -35,6 +37,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
ApiService apiService; ApiService apiService;
UserInfo userInfo; UserInfo userInfo;
List<Rank> ranks = []; List<Rank> ranks = [];
SocialInfo infoNumber;
final RefreshController _refreshController = RefreshController(); final RefreshController _refreshController = RefreshController();
_toUserInfo() async { _toUserInfo() async {
@ -58,6 +61,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
querySocialInfo();
eventBus.on<EventType>().listen((event) { eventBus.on<EventType>().listen((event) {
print("EventType: ${event.type}"); print("EventType: ${event.type}");
@ -112,6 +116,24 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
///(/)
querySocialInfo() async {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: false,
);
BaseData<SocialInfo> baseData =
await apiService.socialInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
infoNumber = baseData.data;
}
EasyLoading.dismiss();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
@ -282,10 +304,10 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
); );
} }
///// ////
Widget attention(){ Widget attention(){
return Container( return Container(
margin: EdgeInsets.only(left: 16,right: 17,top: 10), margin: EdgeInsets.only(left: 16,top: 10),
child:GestureDetector( child:GestureDetector(
onTap:(){ onTap:(){
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
@ -294,33 +316,13 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
); );
}, },
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
Text( Text(
"关注", S.of(context).guanzhu,
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
Text(
"45",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
),
),
],
),
Row(
children: [
Text(
"粉丝",
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 14.sp, fontSize: 14.sp,
@ -328,7 +330,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
), ),
), ),
Text( Text(
"666", "(" + (infoNumber != null ?infoNumber.follow.toString() :"()") +")",
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 15.sp, fontSize: 15.sp,
@ -340,7 +342,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
Row( Row(
children: [ children: [
Text( Text(
"发布", S.of(context).fensi,
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 14.sp, fontSize: 14.sp,
@ -348,7 +350,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
), ),
), ),
Text( Text(
"666", "(" + (infoNumber != null ?infoNumber.fans.toString() :"()") +")",
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 15.sp, fontSize: 15.sp,

6
lib/mine/mine_view/community_follow.dart

@ -1,7 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/mine/follow_page.dart'; import 'package:huixiang/mine/follow_page.dart';
import 'package:huixiang/mine/release_page.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -31,7 +30,7 @@ class _CommunityFollow extends State<CommunityFollow>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return DefaultTabController( return DefaultTabController(
length: 3, length: 2,
child: Scaffold( child: Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
title: "", title: "",
@ -59,12 +58,11 @@ class _CommunityFollow extends State<CommunityFollow>
tabs: <Widget>[ tabs: <Widget>[
MyTab(text:"关注(0)",), MyTab(text:"关注(0)",),
MyTab(text: "粉丝(0)"), MyTab(text: "粉丝(0)"),
MyTab(text: "发布(0)"),
], ],
), ),
), ),
body: TabBarView( body: TabBarView(
children: [FollowPage(),FansPage(),ReleasePage()], children: [FollowPage(),FansPage()],
), ),
), ),
); );

17
lib/mine/mine_view/mine_item.dart

@ -60,6 +60,23 @@ class _MineItem extends State<MineItem> {
), ),
), ),
), ),
InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context)
.pushNamed('/router/releasePage');
});
},
child: mineItem(
S.of(context).wodedongtai,
"assets/image/dynamic.png",
),
),
InkWell( InkWell(
onTap: () { onTap: () {
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {

77
lib/mine/release_page.dart

@ -2,11 +2,13 @@ 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: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';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.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_footer.dart'; import 'package:huixiang/view_widget/my_footer.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';
@ -77,38 +79,53 @@ class _ReleasePage extends State<ReleasePage> {
return FutureBuilder( return FutureBuilder(
future: queryCommunity(), future: queryCommunity(),
builder: (context, position) { builder: (context, position) {
return SmartRefresher( return Scaffold(
controller: refreshController, appBar: MyAppBar(
enablePullDown: true, background: Color(0xFFFFFFFF),
enablePullUp: true, leadingColor: Colors.black,
physics: BouncingScrollPhysics(), title: "动态",
header: MyHeader(), titleColor: Colors.black,
footer: CustomFooter( titleSize: 18.sp,
builder: (context, mode) { ),
return MyFooter(mode); body: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
physics: BouncingScrollPhysics(),
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onLoading: () {
setState(() {});
}, },
), child: ListView.builder(
onRefresh: _onRefresh, physics: NeverScrollableScrollPhysics(),
onLoading: () { itemBuilder: (context, position) {
setState(() {}); return InkWell(
}, child: CommunityDynamic(
child: ListView.builder( comments[position],
physics: NeverScrollableScrollPhysics(), 1,
itemBuilder: (context, position) { removalDynamic: () {
return InkWell( _onRefresh();
child: CommunityDynamic(comments[position],1),
onTap: () {
Navigator.of(context).pushNamed(
'/router/community_details',
arguments: {
"comment": comments[position],
}, },
); ),
}, onTap: () {
); Navigator.of(context).pushNamed(
}, '/router/community_details',
itemCount: comments.length, arguments: {
)); "comment": comments[position],
},
);
},
);
},
itemCount: comments.length,
)),
);
}, },
); );
} }

12
lib/retrofit/data/article.dart

@ -24,6 +24,7 @@ class Article {
bool _isHot; bool _isHot;
bool _liked; bool _liked;
int _viewers; int _viewers;
int _comments;
bool isFollow; bool isFollow;
dynamic _storeName; dynamic _storeName;
@ -47,6 +48,7 @@ class Article {
bool get isHot => _isHot; bool get isHot => _isHot;
bool get liked => _liked; bool get liked => _liked;
int get viewers => _viewers; int get viewers => _viewers;
int get comments => _comments;
dynamic get storeName => _storeName; dynamic get storeName => _storeName;
set likes(int value) { set likes(int value) {
@ -61,6 +63,10 @@ class Article {
_viewers = value; _viewers = value;
} }
set comments(int value) {
_comments = value;
}
Article({ Article({
String id, String id,
String createTime, String createTime,
@ -72,7 +78,7 @@ class Article {
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,
@ -81,6 +87,7 @@ class Article {
int likes, int likes,
bool isHot, bool isHot,
int viewers, int viewers,
int comments,
dynamic storeName}){ dynamic storeName}){
_id = id; _id = id;
_createTime = createTime; _createTime = createTime;
@ -102,6 +109,7 @@ class Article {
_isHot = isHot; _isHot = isHot;
_liked = liked; _liked = liked;
_viewers = viewers; _viewers = viewers;
_comments = comments;
_storeName = storeName; _storeName = storeName;
} }
@ -126,6 +134,7 @@ class Article {
_isHot = json["isHot"]; _isHot = json["isHot"];
_liked = json["liked"]; _liked = json["liked"];
_viewers = json["viewers"]; _viewers = json["viewers"];
_comments = json["comments"];
_storeName = json["storeName"]; _storeName = json["storeName"];
} }
@ -151,6 +160,7 @@ class Article {
map["isHot"] = _isHot; map["isHot"] = _isHot;
map["liked"] = _liked; map["liked"] = _liked;
map["viewers"] = _viewers; map["viewers"] = _viewers;
map["comments"] = _comments;
map["storeName"] = _storeName; map["storeName"] = _storeName;
return map; return map;
} }

37
lib/retrofit/data/social_info.dart

@ -0,0 +1,37 @@
/// fans : 0
/// follow : 0
class SocialInfo {
SocialInfo({
int fans,
int follow,}){
_fans = fans;
_follow = follow;
}
SocialInfo.fromJson(dynamic json) {
_fans = json['fans'];
_follow = json['follow'];
}
int _fans;
int _follow;
int get fans => _fans;
int get follow => _follow;
set fans(int value) {
_fans = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['fans'] = _fans;
map['follow'] = _follow;
return map;
}
set follow(int value) {
_follow = value;
}
}

9
lib/retrofit/retrofit_api.dart

@ -30,6 +30,7 @@ import 'data/message.dart';
import 'data/page.dart'; import 'data/page.dart';
import 'data/rank.dart'; import 'data/rank.dart';
import 'data/sign_info.dart'; import 'data/sign_info.dart';
import 'data/social_info.dart';
import 'data/store.dart'; import 'data/store.dart';
import 'data/upload_result.dart'; import 'data/upload_result.dart';
import 'data/user_bill.dart'; import 'data/user_bill.dart';
@ -382,4 +383,12 @@ abstract class ApiService {
@PUT("/member/follow/{followId}") @PUT("/member/follow/{followId}")
Future<BaseData> follow(@Path("followId") String followId); Future<BaseData> follow(@Path("followId") String followId);
///
@DELETE("/information/trend/{id}")
Future<BaseData> deleteTrend(@Path("id") String id);
///(/)
@GET("/member/socialInfo")
Future<BaseData<SocialInfo>> socialInfo();
} }

43
lib/retrofit/retrofit_api.g.dart

@ -1303,4 +1303,47 @@ class _ApiService implements ApiService {
); );
return value; return value;
} }
@override
Future<BaseData<dynamic>> deleteTrend(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/information/trend/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'DELETE',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<SocialInfo>> socialInfo() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/member/socialInfo',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<SocialInfo>.fromJson(
_result.data,
(json) => SocialInfo.fromJson(json),
);
return value;
}
} }

163
lib/view_widget/hot_item.dart

@ -61,6 +61,7 @@ class _HotArticleItem extends State<HotArticleItem> {
setState(() {}); setState(() {});
} }
Widget hotItem(BuildContext context) { Widget hotItem(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.all((widget.isHot == null || !widget.isHot) ? 4 : 0), padding: EdgeInsets.all((widget.isHot == null || !widget.isHot) ? 4 : 0),
@ -79,87 +80,88 @@ class _HotArticleItem extends State<HotArticleItem> {
child: (widget.isHot == null || !widget.isHot) child: (widget.isHot == null || !widget.isHot)
? Column( ? Column(
children: [ children: [
Row( // Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ // children: [
Container( // Container(
margin: EdgeInsets.only(left: 5), // margin: EdgeInsets.only(left: 5),
child: Row( // child: Row(
children: [ // children: [
MImage( // MImage(
(widget.article != null && // (widget.article != null &&
widget.article.author != null) // widget.article.author != null)
? widget.article.author.avatar // ? widget.article.author.avatar
: "", // : "",
width: 44, // width: 44,
height: 44, // height: 44,
isCircle: true, // isCircle: true,
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",
), // ),
SizedBox( // SizedBox(
width: 8, // width: 8,
), // ),
Column( // Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
Text( // Text(
(widget.article != null && // (widget.article != null &&
widget.article.author != null) // widget.article.author != null)
? widget.article.author.name // ? widget.article.author.name
: "", // : "",
style: TextStyle( // style: TextStyle(
fontSize: 14.sp, // fontSize: 14.sp,
fontWeight: MyFontWeight.medium, // fontWeight: MyFontWeight.medium,
color: Color(0xFF1A1A1A), // color: Color(0xFF1A1A1A),
), // ),
), // ),
Text( // Text(
widget.article != null // widget.article != null
? (widget.article.createTime.split(" ")[0]) // ? (widget.article.createTime.split(" ")[0])
: "", // : "",
style: TextStyle( // style: TextStyle(
fontSize: 12.sp, // fontSize: 12.sp,
fontWeight: MyFontWeight.regular, // fontWeight: MyFontWeight.regular,
color: Color(0xFF808080), // color: Color(0xFF808080),
), // ),
), // ),
], // ],
), // ),
], // ],
), // ),
), // ),
GestureDetector( // GestureDetector(
onTap: (){ // onTap: (){
setState(() { // setState(() {
widget.article.isFollow = !(widget.article.isFollow??false); // widget.article.isFollow = !(widget.article.isFollow??false);
_vipFollow(widget.article.updateUser); // _vipFollow(widget.article.updateUser);
}); // });
}, // },
child: RoundButton( // child: RoundButton(
padding: EdgeInsets.symmetric( // padding: EdgeInsets.symmetric(
horizontal: 8, // horizontal: 8,
vertical: 3, // vertical: 3,
), // ),
backgroup: (widget.article.isFollow??false) ? Color(0xFFE6E6E6) : Color(0xFF32A060), // backgroup: (widget.article.isFollow??false) ? Color(0xFFE6E6E6) : Color(0xFF32A060),
textColor: (widget.article.isFollow??false) ? Color(0xFF808080):Colors.white , // textColor: (widget.article.isFollow??false) ? Color(0xFF808080):Colors.white ,
text:(widget.article.isFollow??false) ? "已关注":"关注", // text:(widget.article.isFollow??false) ? "已关注":"关注",
radius: 20, // radius: 20,
icons: Icon( // icons: Icon(
(widget.article.isFollow??false) ? Icons.check: Icons.add, // (widget.article.isFollow??false) ? Icons.check: Icons.add,
color:(widget.article.isFollow??false) ? Color(0xFF808080):Colors.white , // color:(widget.article.isFollow??false) ? Color(0xFF808080):Colors.white ,
size: 14, // size: 14,
), // ),
), // ),
), // ),
], // ],
), // ),
Expanded(child:Row( Expanded(child:Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox(height: 5.h),
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.only(left: 12.w), margin: EdgeInsets.only(left: 12.w),
@ -192,6 +194,7 @@ class _HotArticleItem extends State<HotArticleItem> {
], ],
), ),
), ),
SizedBox(width:5.w,),
], ],
)), )),
SizedBox(height: 10.h,) SizedBox(height: 10.h,)
@ -327,7 +330,7 @@ class _HotArticleItem extends State<HotArticleItem> {
), ),
Text( Text(
(widget.article != null) (widget.article != null)
? "${widget.article.viewers}" ? "${widget.article.comments}"
: "", : "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
@ -494,7 +497,7 @@ class _HotArticleItem extends State<HotArticleItem> {
), ),
Text( Text(
(widget.article != null) (widget.article != null)
? "${widget.article.viewers}" ? "${widget.article.comments}"
: "", : "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,

7
lib/web/web_page.dart

@ -123,8 +123,10 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
"relationalType": 1 "relationalType": 1
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
commentKey.currentState.initState(); CommentListState _commentList = commentKey.currentState;
_commentList.queryMemberCommentList();
commentTextController.text = ""; commentTextController.text = "";
FocusScope.of(context).unfocus();
_toComment(); _toComment();
} }
} }
@ -310,7 +312,8 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
BaseData baseData = await apiService.delComment( BaseData baseData = await apiService.delComment(
widget.arguments["activityId"] ?? widget.arguments["articleId"]); widget.arguments["activityId"] ?? widget.arguments["articleId"]);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
commentKey.currentState.initState(); CommentListState _commentList = commentKey.currentState;
_commentList.queryMemberCommentList();
} }
} }

4
lib/web/web_view/comment_list.dart

@ -30,11 +30,11 @@ class CommentList extends StatefulWidget {
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _CommentList(); return CommentListState();
} }
} }
class _CommentList extends State<CommentList> { class CommentListState extends State<CommentList> {
int commentTotal = 0; int commentTotal = 0;
List<MemberCommentList> memberList = []; List<MemberCommentList> memberList = [];
ApiService apiService; ApiService apiService;

Loading…
Cancel
Save