# Conflicts: # lib/community/community_details.dart # lib/main.dart # lib/message/system_details.dart # lib/mine/coupons_page.dart # lib/mine/fans_page.dart # lib/mine/follow_page.dart # lib/mine/manage_address_page.dart # lib/mine/mine_view/mine_item.dart # lib/mine/mine_wallet_page.dart # lib/mine/roll_center_page.dart # lib/mine/vip_balance_page.dart # lib/mine/vip_card_page.dart # lib/order/logistics_information_page.dart # lib/retrofit/min_api.dart # lib/retrofit/retrofit_api.dart # lib/store/store_order.dartzyh
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 707 B |
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,195 @@
|
||||
import 'dart:ui'; |
||||
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter/rendering.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
class ReportPage extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
ReportPage({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _ReportPage(); |
||||
} |
||||
} |
||||
|
||||
class _ReportPage extends State<ReportPage> { |
||||
ApiService apiService; |
||||
int checkIndex = 0; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
appBar: MyAppBar( |
||||
background: Color(0xFFFFFFFFF), |
||||
leadingColor: Colors.black, |
||||
title: "举报", |
||||
titleSize: 18, |
||||
titleColor: Colors.black, |
||||
), |
||||
body: Container( |
||||
height: double.infinity, |
||||
color: Color(0xFFFFFFFF), |
||||
child: Stack( |
||||
children: [ |
||||
SingleChildScrollView( |
||||
physics: BouncingScrollPhysics(), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.spaceAround, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Container( |
||||
width: double.infinity, |
||||
color: Color(0XFFFFFFFF), |
||||
padding: EdgeInsets.only(bottom: 4, left: 16, right: 16), |
||||
child: Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "举报", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF1A1A1A), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "@百花谷", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF319E5F), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "的动态", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF1A1A1A), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
report(), |
||||
], |
||||
), |
||||
), |
||||
Align( |
||||
alignment: Alignment.bottomCenter, |
||||
child: Container( |
||||
width: double.infinity, |
||||
height:95, |
||||
child: Column( |
||||
children: [ |
||||
GestureDetector( |
||||
onTap: () { |
||||
Navigator.of(context) |
||||
.pushNamed('/router/report_notice'); |
||||
}, |
||||
child: Container( |
||||
alignment: Alignment.bottomCenter, |
||||
margin: EdgeInsets.only(bottom:25), |
||||
child: Text( |
||||
"投诉须知", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF3C425C), |
||||
), |
||||
), |
||||
)), |
||||
Expanded(child: |
||||
GestureDetector( |
||||
onTap: (){ |
||||
Navigator.of(context) |
||||
.pushNamed('/router/report_success'); |
||||
}, |
||||
child: Container( |
||||
width: double.infinity, |
||||
height:double.infinity, |
||||
color: Color(0xFF319E5F), |
||||
alignment: Alignment.center, |
||||
child: Text( |
||||
"提交", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFFFFFFFF), |
||||
), |
||||
), |
||||
),)) |
||||
], |
||||
), |
||||
)) |
||||
], |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget report() { |
||||
return Container( |
||||
padding: EdgeInsets.only(left: 16, right: 16), |
||||
child: |
||||
// (articles == null || articles.length == 0) |
||||
// ? NoDataView( |
||||
// src: "assets/image/dong_tai.png", |
||||
// isShowBtn: false, |
||||
// text: "目前暂无发布动态,要把开心的事讲出来哦~", |
||||
// fontSize: 16.sp, |
||||
// margin: EdgeInsets.only(left: 60.w, right: 60.w), |
||||
// ) : |
||||
ListView.builder( |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () {}, |
||||
child: reportList(), |
||||
); |
||||
}, |
||||
itemCount: 9, |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget reportList() { |
||||
return Container( |
||||
padding: EdgeInsets.only(top: 18, bottom: 20), |
||||
color: Color(0xFFFFFFFF), |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/icon_radio_unselected.png", |
||||
width: 16, |
||||
height: 16, |
||||
), |
||||
SizedBox( |
||||
width: 8, |
||||
), |
||||
Expanded( |
||||
child: Text( |
||||
"色情低俗", |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.regular), |
||||
)) |
||||
], |
||||
)); |
||||
} |
||||
} |
@ -0,0 +1,51 @@
|
||||
import 'dart:ui'; |
||||
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter/rendering.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
class ReportSuccess extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _ReportSuccess(); |
||||
} |
||||
} |
||||
|
||||
class _ReportSuccess extends State<ReportSuccess> { |
||||
ApiService apiService; |
||||
int checkIndex = 0; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
appBar: MyAppBar( |
||||
background: Color(0xFFFFFFFFF), |
||||
leadingColor: Colors.black, |
||||
title: "", |
||||
titleSize: 18, |
||||
titleColor: Colors.black, |
||||
), |
||||
body: Container( |
||||
width: double.infinity, |
||||
color: Color(0xFFFFFFFFF), |
||||
padding: EdgeInsets.only(left: 16, top: 10, right: 16), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.spaceAround, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
], |
||||
), |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,99 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter/services.dart'; |
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
class EditSignature extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
EditSignature({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _EditSignature(); |
||||
} |
||||
} |
||||
|
||||
class _EditSignature extends State<EditSignature> { |
||||
TextEditingController _controller = TextEditingController(); |
||||
int textLength = 0; |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
appBar: MyAppBar( |
||||
title: "个性签名", |
||||
titleColor: Colors.black, |
||||
leadingColor: Colors.black, |
||||
action: Container( |
||||
alignment: Alignment.center, |
||||
margin: EdgeInsets.only(right: 16.w), |
||||
child: GestureDetector( |
||||
onTap: () { |
||||
String signature = _controller.text; |
||||
if (signature != null && signature != "") { |
||||
Navigator.of(context).pop(signature); |
||||
} else { |
||||
SmartDialog.showToast("请输入个性签名~", alignment: Alignment.center); |
||||
} |
||||
}, |
||||
child:Container( |
||||
width: 46.w, |
||||
height: 24.h, |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF319E5F), |
||||
borderRadius: BorderRadius.all(Radius.circular(4))), |
||||
child: Text( |
||||
"保存", |
||||
style: TextStyle( |
||||
color: Colors.white, |
||||
fontSize:14.sp, |
||||
fontWeight: FontWeight.bold), |
||||
), |
||||
), |
||||
), |
||||
), |
||||
), |
||||
body: Container( |
||||
margin: EdgeInsets.all(16), |
||||
child: Column( |
||||
children: [ |
||||
TextField( |
||||
maxLines: 5, |
||||
controller: _controller, |
||||
keyboardType: TextInputType.text, |
||||
onChanged: (value) { |
||||
setState(() { |
||||
textLength = value.length; |
||||
}); |
||||
}, |
||||
maxLength: 50, |
||||
decoration: InputDecoration( |
||||
errorBorder: InputBorder.none, |
||||
focusedBorder: InputBorder.none, |
||||
enabledBorder: InputBorder.none, |
||||
hintText: widget.arguments['signature'], |
||||
// contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12), |
||||
hintStyle: TextStyle( |
||||
fontSize: 10.sp, |
||||
color: Color(0xFFA29E9E), |
||||
), |
||||
), |
||||
textInputAction: TextInputAction.next, |
||||
), |
||||
Container( |
||||
height: 1.h, |
||||
color: Color(0xFFD8D8D8), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,748 @@
|
||||
import 'dart:convert'; |
||||
import 'dart:io'; |
||||
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||
import 'package:huixiang/community/community_view/community_dynamic.dart'; |
||||
import 'package:huixiang/community/photo_view_gallery_screen.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/retrofit/data/article.dart'; |
||||
import 'package:huixiang/retrofit/data/base_data.dart'; |
||||
import 'package:huixiang/retrofit/data/comunity_comment.dart'; |
||||
import 'package:huixiang/retrofit/data/member_Infor.dart'; |
||||
import 'package:huixiang/retrofit/data/page.dart'; |
||||
import 'package:huixiang/retrofit/data/social_info.dart'; |
||||
import 'package:huixiang/retrofit/data/upload_result.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:huixiang/view_widget/custom_image.dart'; |
||||
import 'package:huixiang/view_widget/my_footer.dart'; |
||||
import 'package:huixiang/view_widget/no_data_view.dart'; |
||||
import 'package:image_pickers/image_pickers.dart'; |
||||
import 'package:permission_handler/permission_handler.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:shared_preferences/shared_preferences.dart'; |
||||
|
||||
class PersonalPage extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
PersonalPage({this.arguments}); |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _PersonalPage(); |
||||
} |
||||
} |
||||
|
||||
class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver { |
||||
ApiService apiService; |
||||
final RefreshController refreshController = RefreshController(); |
||||
final ScrollController scrollController = ScrollController(); |
||||
var isShrink = false; |
||||
int pageNum = 1; |
||||
String userId; |
||||
List<Article> articles = []; |
||||
MemberInfor memberInfor; |
||||
String filePath; |
||||
bool isLoadMore = false; |
||||
String memberId; |
||||
Map<String, dynamic> modifyInfo = { |
||||
"background": "" |
||||
}; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
memberId = widget.arguments["memberId"]; |
||||
WidgetsBinding.instance.addObserver(this); |
||||
SharedPreferences.getInstance().then((value) => { |
||||
apiService = ApiService(Dio(), |
||||
context: context, token: value.getString('token')), |
||||
_onRefresh(), |
||||
}); |
||||
} |
||||
|
||||
_onRefresh() async { |
||||
queryCommunity(); |
||||
queryMember(memberId); |
||||
} |
||||
|
||||
///查询会员信息 |
||||
queryMember(id) async { |
||||
if (apiService == null) { |
||||
SharedPreferences value = await SharedPreferences.getInstance(); |
||||
apiService = ApiService( |
||||
Dio(), |
||||
context: context, |
||||
token: value.getString("token"), |
||||
); |
||||
} |
||||
BaseData<MemberInfor> baseData = |
||||
await apiService.memberDetail(id).catchError((error) { |
||||
refreshController.refreshFailed(); |
||||
}); |
||||
if (baseData != null && baseData.isSuccess) { |
||||
setState(() { |
||||
memberInfor = baseData.data; |
||||
}); |
||||
refreshController.refreshCompleted(); |
||||
}else { |
||||
refreshController.refreshFailed(); |
||||
} |
||||
} |
||||
|
||||
///动态列表 |
||||
queryCommunity() async { |
||||
if (apiService == null) { |
||||
SharedPreferences value = await SharedPreferences.getInstance(); |
||||
userId = value.getString('userId'); |
||||
apiService = ApiService( |
||||
Dio(), |
||||
context: context, |
||||
token: value.getString("token"), |
||||
); |
||||
} |
||||
if(isLoadMore){ |
||||
pageNum += 1; |
||||
isLoadMore = false; |
||||
} |
||||
else pageNum = 1; |
||||
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({ |
||||
"mid":memberId == "0" ? userId : memberId, |
||||
"onlyFollow": false, |
||||
"onlyMe": true, |
||||
"pageNum": pageNum, |
||||
"pageSize": 10, |
||||
"searchKey": "" |
||||
}).catchError((error) { |
||||
refreshController.refreshFailed(); |
||||
refreshController.loadFailed(); |
||||
}); |
||||
if (baseData.isSuccess) { |
||||
refreshController.refreshCompleted(); |
||||
refreshController.loadComplete(); |
||||
if (pageNum == 1) { |
||||
articles.clear(); |
||||
} |
||||
baseData.data.list.forEach((element) { |
||||
var article = Article(); |
||||
article.id = element.id; |
||||
article.content = jsonEncode(element.subjectInfo); |
||||
article.mainTitle = element.subject; |
||||
article.followed = element.selfFollow; |
||||
article.authorHeadImg = element.memberInfo?.avatar; |
||||
article.authorName = element.memberInfo?.nickname; |
||||
article.location = element.location; |
||||
article.createTime = element.createTime; |
||||
article.author = element.memberInfo?.mid; |
||||
article.viewers = element?.viewers; |
||||
article.likes = element?.likes; |
||||
article.comments = element?.comments; |
||||
articles.add(article); |
||||
}); |
||||
// print("comments: ${comments.length}"); |
||||
if (int.tryParse(baseData.data.total) < (pageNum * 10)) { |
||||
refreshController.loadNoData(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
///去编辑个人资料 |
||||
_toUserInfo() async { |
||||
SharedPreferences shared = await SharedPreferences.getInstance(); |
||||
if (shared.getString("token") == null || shared.getString("token") == "") { |
||||
Navigator.of(context) |
||||
.pushNamed('/router/login_page', arguments: {"login": "login"}); |
||||
return; |
||||
} |
||||
await Navigator.of(context).pushNamed('/router/user_info_page').then((value) { |
||||
_onRefresh(); |
||||
setState(() {}); |
||||
}); |
||||
setState(() {}); |
||||
} |
||||
|
||||
///显示图片选择方式 |
||||
showImagePicker() { |
||||
showCupertinoModalPopup( |
||||
context: context, |
||||
builder: (contetx) { |
||||
return CupertinoActionSheet( |
||||
title: Text(S.of(context).genghuantouxiang), |
||||
actions: [ |
||||
CupertinoActionSheetAction( |
||||
child: Text(S.of(context).paizhao), |
||||
onPressed: () { |
||||
openCamera(); |
||||
Navigator.of(context).pop(); |
||||
}, |
||||
isDefaultAction: true, |
||||
isDestructiveAction: false, |
||||
), |
||||
CupertinoActionSheetAction( |
||||
child: Text(S.of(context).xiangce), |
||||
onPressed: () { |
||||
openStorage(); |
||||
Navigator.of(context).pop(); |
||||
}, |
||||
isDefaultAction: true, |
||||
isDestructiveAction: false, |
||||
), |
||||
], |
||||
cancelButton: CupertinoActionSheetAction( |
||||
onPressed: () { |
||||
Navigator.of(context).pop(); |
||||
}, |
||||
child: Text(S.of(context).quxiao), |
||||
isDestructiveAction: true, |
||||
), |
||||
); |
||||
}); |
||||
} |
||||
|
||||
///拍照 |
||||
openCamera() async { |
||||
if (await Permission.camera.isGranted) { |
||||
Media medias = await ImagePickers.openCamera( |
||||
cameraMimeType: CameraMimeType.photo, |
||||
cropConfig: CropConfig( |
||||
enableCrop: true, |
||||
width: 200, |
||||
height: 200, |
||||
), |
||||
compressSize: 500, |
||||
); |
||||
if (medias == null) return; |
||||
filePath = medias.path; |
||||
fileUpload(); |
||||
} else { |
||||
await Permission.camera.request(); |
||||
openCamera(); |
||||
} |
||||
} |
||||
|
||||
///打开相册 |
||||
openStorage() async { |
||||
if (await Permission.storage.isGranted) { |
||||
List<Media> medias = await ImagePickers.pickerPaths( |
||||
galleryMode: GalleryMode.image, |
||||
selectCount: 1, |
||||
showGif: true, |
||||
showCamera: false, |
||||
compressSize: 500, |
||||
uiConfig: UIConfig( |
||||
uiThemeColor: Color(0xFFFFFFFF), |
||||
), |
||||
cropConfig: CropConfig( |
||||
enableCrop: true, |
||||
width: 200, |
||||
height: 200, |
||||
), |
||||
); |
||||
if (medias == null || medias.length == 0) return; |
||||
filePath = medias[0].path; |
||||
setState(() {}); |
||||
fileUpload(); |
||||
} else { |
||||
await Permission.storage.request(); |
||||
openStorage(); |
||||
} |
||||
} |
||||
|
||||
///调用修改用户信息接口 |
||||
modifyInfos() async { |
||||
var info = await apiService.editInfo(modifyInfo).catchError((onError) {}); |
||||
if (info.isSuccess) { |
||||
setState(() { |
||||
SmartDialog.showToast("用户信息修改成功", alignment: Alignment.center); |
||||
}); |
||||
_onRefresh(); |
||||
} |
||||
} |
||||
|
||||
///文件上传 |
||||
fileUpload() async { |
||||
if (filePath != null && filePath != "" && await File(filePath).exists()) { |
||||
BaseData<UploadResult> baseData = await apiService.upload(File(filePath), 123123123,false).catchError((onError) {}); |
||||
if (baseData != null && baseData.isSuccess) { |
||||
UploadResult uploadResult = baseData.data; |
||||
modifyInfo["background"] = uploadResult.url; |
||||
modifyInfos(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return SmartRefresher( |
||||
controller: refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: true, |
||||
header: MyHeader(), |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: _onRefresh, |
||||
onLoading: () { |
||||
isLoadMore = true; |
||||
setState(() { |
||||
_onRefresh(); |
||||
}); |
||||
}, |
||||
physics: BouncingScrollPhysics(), |
||||
scrollController: scrollController, |
||||
child: SingleChildScrollView( |
||||
physics: BouncingScrollPhysics(), |
||||
child:Column( |
||||
mainAxisAlignment: MainAxisAlignment.spaceAround, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Container( |
||||
height: 248, |
||||
color: Color(0xFFFFFFFF), |
||||
// color: Colors.red, |
||||
child: |
||||
Stack( |
||||
// alignment: Alignment.bottomLeft, |
||||
children: [ |
||||
Positioned( |
||||
top:0, |
||||
left: 0, |
||||
bottom: 36, |
||||
right: 0, |
||||
child:Stack( |
||||
alignment: Alignment.bottomRight, |
||||
children: [ |
||||
Container( |
||||
color: Colors.black, |
||||
child: Opacity( |
||||
opacity: 0.9, |
||||
child: MImage( |
||||
memberInfor?.background ?? "", |
||||
width: double.infinity, |
||||
height: 260.h, |
||||
fit: BoxFit.cover, |
||||
errorSrc: |
||||
"assets/image/default_1.png", |
||||
fadeSrc: |
||||
"assets/image/default_1.png", |
||||
))), |
||||
Container( |
||||
margin: EdgeInsets.only( |
||||
top: 50.h, left: 16.w, right: 16.w), |
||||
alignment: Alignment.topLeft, |
||||
decoration: BoxDecoration( |
||||
color: Colors.transparent, |
||||
), |
||||
child: Column( |
||||
mainAxisAlignment: |
||||
MainAxisAlignment.spaceBetween, |
||||
crossAxisAlignment: |
||||
CrossAxisAlignment.center, |
||||
children: [ |
||||
GestureDetector( |
||||
child: Image.asset( |
||||
"assets/image/integral_return.png", |
||||
width: 24, |
||||
height: 24, |
||||
), |
||||
onTap: () { |
||||
Navigator.of(context).pop(); |
||||
}, |
||||
), |
||||
], |
||||
), |
||||
), |
||||
if(memberId == "0") |
||||
Positioned( |
||||
bottom: 9, |
||||
right: 16.w, |
||||
child:GestureDetector( |
||||
onTap: (){ |
||||
showImagePicker(); |
||||
}, |
||||
child:Container( |
||||
padding: EdgeInsets.only(left: 2, right: 2), |
||||
width: 59.w, |
||||
height: 23.h, |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
color: Color(0x80000000), |
||||
), |
||||
child: Text( |
||||
"更换背景", |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFFFFFFFF), |
||||
), |
||||
), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
homeInfo(), |
||||
], |
||||
), |
||||
), |
||||
Container( |
||||
color: Color(0xFFFFFFFF), |
||||
child: |
||||
Column( |
||||
mainAxisAlignment: MainAxisAlignment.spaceAround, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Container( |
||||
margin: EdgeInsets.only( |
||||
left: 86, top: 12, right: 16), |
||||
child: GestureDetector( |
||||
onTap: () { |
||||
setState(() { |
||||
isShrink = !isShrink; |
||||
}); |
||||
}, |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.end, |
||||
children: [ |
||||
Expanded( |
||||
flex: 1, |
||||
child: Text( |
||||
memberId == "0" ? ((memberInfor?.signature == "") ? "还未编辑个性签名~" : memberInfor?.signature ?? "") |
||||
:"个性签名: ${(memberInfor?.signature == "") ? "还未编辑个性签名~" :memberInfor?.signature ?? ""}", |
||||
overflow: isShrink |
||||
? TextOverflow.visible |
||||
: TextOverflow.ellipsis, |
||||
maxLines: isShrink ? 10 : 2, |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF868686), |
||||
fontWeight: |
||||
MyFontWeight.regular, |
||||
height: 1.5), |
||||
)), |
||||
Icon( |
||||
(isShrink != null && !isShrink) |
||||
? Icons.chevron_right |
||||
: Icons.keyboard_arrow_up, |
||||
color: Colors.black, |
||||
size: 18, |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
Container( |
||||
margin: EdgeInsets.only(left: 16, right: 16), |
||||
child: Row( |
||||
mainAxisAlignment: |
||||
MainAxisAlignment.spaceAround, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Expanded( |
||||
child: GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: Container( |
||||
color: Colors.transparent, |
||||
padding: EdgeInsets.all(16), |
||||
child: Column( |
||||
children: [ |
||||
Text( |
||||
memberInfor != null ? memberInfor.follow.toString() : "0", |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontSize: 16.sp, |
||||
fontWeight: |
||||
MyFontWeight.semi_bold, |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 4, |
||||
), |
||||
Text( |
||||
S.of(context).guanzhu, |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontSize: 12.sp, |
||||
fontWeight: |
||||
MyFontWeight.regular, |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
), |
||||
), |
||||
Expanded( |
||||
child: GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: Container( |
||||
color: Colors.transparent, |
||||
padding: EdgeInsets.all(16), |
||||
child: Column( |
||||
children: [ |
||||
Text( |
||||
memberInfor != null ? memberInfor.fans.toString() : "0", |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontSize: 16.sp, |
||||
fontWeight: |
||||
MyFontWeight.semi_bold, |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 4, |
||||
), |
||||
Text( |
||||
S.of(context).fensi, |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontSize: 12.sp, |
||||
fontWeight: |
||||
MyFontWeight.regular, |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
), |
||||
), |
||||
Expanded( |
||||
child: GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: Container( |
||||
color: Colors.transparent, |
||||
padding: EdgeInsets.all(16), |
||||
child: Column( |
||||
children: [ |
||||
Text( |
||||
(memberInfor?.trendTotal??0).toString(), |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontSize: 16.sp, |
||||
fontWeight: |
||||
MyFontWeight.semi_bold, |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 4, |
||||
), |
||||
Text( |
||||
"动态", |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontSize: 12.sp, |
||||
fontWeight: |
||||
MyFontWeight.regular, |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
), |
||||
), |
||||
Expanded( |
||||
child: GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: Container( |
||||
color: Colors.transparent, |
||||
padding: EdgeInsets.all(16), |
||||
child: Column( |
||||
children: [ |
||||
Text( |
||||
(memberInfor?.gainLikeTotal ?? 0).toString(), |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontSize: 16.sp, |
||||
fontWeight: |
||||
MyFontWeight.semi_bold, |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 4, |
||||
), |
||||
Text( |
||||
"获赞", |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontSize: 12.sp, |
||||
fontWeight: |
||||
MyFontWeight.regular, |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
Container( |
||||
margin: EdgeInsets.all(16), |
||||
height: 1.h, |
||||
color: Color(0xFFF7F7F7), |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(left: 16), |
||||
child: Text( |
||||
memberId != "0" ? |
||||
"TA的动态": |
||||
"我的动态", |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
), |
||||
)), |
||||
dynamicList() |
||||
], |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
); |
||||
} |
||||
|
||||
Widget homeInfo() { |
||||
return Positioned( |
||||
top: 0, |
||||
bottom: 0, |
||||
left: 0, |
||||
right: 0, |
||||
child: Container( |
||||
padding: EdgeInsets.only( |
||||
left: 16, |
||||
right: 16, |
||||
), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.end, |
||||
children: [ |
||||
GestureDetector( |
||||
onTap: (){ |
||||
Navigator.push( |
||||
context, |
||||
MaterialPageRoute( |
||||
builder: (context) => PhotoViewGalleryScreen( |
||||
images: [(memberInfor?.headimg ?? "").isEmpty? |
||||
"https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg":memberInfor?.headimg |
||||
], //传入图片list |
||||
index: 0, //传入当前点击的图片的index |
||||
), |
||||
)); |
||||
}, |
||||
child: MImage( |
||||
memberInfor?.headimg ?? "", |
||||
isCircle: true, |
||||
width: 66, |
||||
height: 66, |
||||
fit: BoxFit.cover, |
||||
errorSrc: "assets/image/default_user.png", |
||||
fadeSrc: "assets/image/default_user.png", |
||||
), |
||||
), |
||||
SizedBox(width: 10.w), |
||||
Text( |
||||
memberInfor?.nickname ?? "", |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF353535), |
||||
), |
||||
), |
||||
SizedBox(width: 4.w), |
||||
Image.asset( |
||||
"assets/image/vip_yk.png", |
||||
width: 20, |
||||
height: 20, |
||||
), |
||||
Spacer(), |
||||
if(memberId == "0") |
||||
GestureDetector( |
||||
onTap: () { |
||||
setState(() { |
||||
_toUserInfo(); |
||||
}); |
||||
}, |
||||
child: Container( |
||||
height: 23, |
||||
padding: EdgeInsets.only(left: 6, right: 6, bottom: 2, top: 2), |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(100), |
||||
border: Border.all( |
||||
width: 1, |
||||
color: Color(0xFF353535), |
||||
style: BorderStyle.solid, |
||||
), |
||||
), |
||||
child: Text( |
||||
"编辑个人资料", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF353535), |
||||
), |
||||
), |
||||
), |
||||
) |
||||
], |
||||
),)); |
||||
} |
||||
|
||||
Widget dynamicList() { |
||||
return Container( |
||||
child: (articles == null || articles.length == 0)? NoDataView( |
||||
src: "assets/image/dong_tai.png", |
||||
isShowBtn: false, |
||||
text: "目前暂无发布动态,要把开心的事讲出来哦~", |
||||
fontSize: 16.sp, |
||||
margin: EdgeInsets.only(left: 60.w,right: 60.w), |
||||
):ListView.builder( |
||||
physics: NeverScrollableScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return InkWell( |
||||
child: CommunityDynamic( |
||||
articles[position], |
||||
memberId == "0" ? 1 : 0, |
||||
exitFull: () { |
||||
setState(() { |
||||
_onRefresh(); |
||||
}); |
||||
}, |
||||
removalDynamic: () { |
||||
setState(() { |
||||
_onRefresh(); |
||||
}); |
||||
}, |
||||
), |
||||
onTap: () { |
||||
Navigator.of(context).pushNamed( |
||||
'/router/community_details', |
||||
arguments: { |
||||
"businessId": articles[position].id, |
||||
"userId": userId, |
||||
}, |
||||
).then((value) { |
||||
_onRefresh(); |
||||
}); |
||||
}, |
||||
); |
||||
}, |
||||
itemCount: articles.length, |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,50 @@
|
||||
/// enabled : true |
||||
/// code : "1111" |
||||
/// showImage : "https://pos.upload.gznl.top/0000/2022/03/4ca95160-aa19-46e5-ad07-8a16ca11c697.jpg" |
||||
/// jumpType : 1 |
||||
/// jumpUrl : "1417675188681572352" |
||||
|
||||
class ActivityPos { |
||||
ActivityPos({ |
||||
bool enabled, |
||||
String code, |
||||
String showImage, |
||||
int jumpType, |
||||
String jumpUrl,}){ |
||||
_enabled = enabled; |
||||
_code = code; |
||||
_showImage = showImage; |
||||
_jumpType = jumpType; |
||||
_jumpUrl = jumpUrl; |
||||
} |
||||
|
||||
ActivityPos.fromJson(dynamic json) { |
||||
_enabled = json['enabled']; |
||||
_code = json['code']; |
||||
_showImage = json['showImage']; |
||||
_jumpType = json['jumpType']; |
||||
_jumpUrl = json['jumpUrl']; |
||||
} |
||||
bool _enabled; |
||||
String _code; |
||||
String _showImage; |
||||
int _jumpType; |
||||
String _jumpUrl; |
||||
|
||||
bool get enabled => _enabled; |
||||
String get code => _code; |
||||
String get showImage => _showImage; |
||||
int get jumpType => _jumpType; |
||||
String get jumpUrl => _jumpUrl; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['enabled'] = _enabled; |
||||
map['code'] = _code; |
||||
map['showImage'] = _showImage; |
||||
map['jumpType'] = _jumpType; |
||||
map['jumpUrl'] = _jumpUrl; |
||||
return map; |
||||
} |
||||
|
||||
} |
@ -1,269 +1,359 @@
|
||||
import 'dart:convert'; |
||||
|
||||
import 'package:huixiang/retrofit/data/author.dart'; |
||||
|
||||
import 'author.dart'; |
||||
|
||||
/// id : "1498607093517647872" |
||||
/// createTime : "2022-03-01 18:32:29" |
||||
/// createUser : "1495959790726152192" |
||||
/// updateTime : "2022-03-01 18:45:04" |
||||
/// updateUser : "1495959790726152192" |
||||
/// storeId : "0" |
||||
/// categoryId : "0" |
||||
/// mainTitle : "哈哈哈哈" |
||||
/// viceTitle : null |
||||
/// content : "{\"images\":[],\"video\":\"\",\"type\":\"text\"}" |
||||
/// coverImg : "" |
||||
/// author : "1495959790726152192" |
||||
/// type : 3 |
||||
/// likes : 0 |
||||
/// viewers : 2 |
||||
/// startTime : "2022-03-01 18:32:28" |
||||
/// endTime : "2121-03-01 18:32:28" |
||||
/// isHot : false |
||||
/// state : 1 |
||||
/// location : "" |
||||
/// longitude : "0.000000" |
||||
/// latitude : "0.000000" |
||||
/// remark : "" |
||||
/// isDelete : 0 |
||||
/// tenantCode : "" |
||||
/// storeName : null |
||||
/// liked : false |
||||
/// followed : false |
||||
/// comments : null |
||||
/// authorName : "小帽子" |
||||
/// authorHeadImg : "https://pos.upload.gznl.top/admin/2022/02/5877a3fe-0d25-405b-a86b-7bac293ab048.jpeg" |
||||
|
||||
class Article { |
||||
Article({ |
||||
String id, |
||||
String createTime, |
||||
String createUser, |
||||
String updateTime, |
||||
String updateUser, |
||||
String storeId, |
||||
String categoryId, |
||||
String mainTitle, |
||||
dynamic viceTitle, |
||||
String content, |
||||
String coverImg, |
||||
dynamic author, |
||||
int type, |
||||
int likes, |
||||
int viewers, |
||||
String startTime, |
||||
String endTime, |
||||
bool isHot, |
||||
int state, |
||||
String location, |
||||
String longitude, |
||||
String latitude, |
||||
String remark, |
||||
int isDelete, |
||||
String tenantCode, |
||||
dynamic storeName, |
||||
bool liked, |
||||
bool followed, |
||||
dynamic comments, |
||||
String authorName, |
||||
String authorHeadImg,}){ |
||||
_id = id; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_updateTime = updateTime; |
||||
_updateUser = updateUser; |
||||
_storeId = storeId; |
||||
_categoryId = categoryId; |
||||
_mainTitle = mainTitle; |
||||
_viceTitle = viceTitle; |
||||
_content = content; |
||||
_coverImg = coverImg; |
||||
_author = author; |
||||
_type = type; |
||||
_likes = likes; |
||||
_viewers = viewers; |
||||
_startTime = startTime; |
||||
_endTime = endTime; |
||||
_isHot = isHot; |
||||
_state = state; |
||||
_location = location; |
||||
_longitude = longitude; |
||||
_latitude = latitude; |
||||
_remark = remark; |
||||
_isDelete = isDelete; |
||||
_tenantCode = tenantCode; |
||||
_storeName = storeName; |
||||
_liked = liked; |
||||
_followed = followed; |
||||
_comments = comments; |
||||
_authorName = authorName; |
||||
_authorHeadImg = authorHeadImg; |
||||
} |
||||
|
||||
Article.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_updateTime = json['updateTime']; |
||||
_updateUser = json['updateUser']; |
||||
_storeId = json['storeId']; |
||||
_categoryId = json['categoryId']; |
||||
_mainTitle = json['mainTitle']; |
||||
_viceTitle = json['viceTitle']; |
||||
_content = json['content']; |
||||
_coverImg = json['coverImg']; |
||||
_author = json["author"] == null ? author : json["author"].toString().startsWith("{") ? Author.fromJson(jsonDecode(json["author"])):json["author"]; |
||||
_type = json['type']; |
||||
_likes = json['likes']; |
||||
_viewers = json['viewers']; |
||||
_startTime = json['startTime']; |
||||
_endTime = json['endTime']; |
||||
_isHot = json['isHot']; |
||||
_state = json['state']; |
||||
_location = json['location']; |
||||
_longitude = json['longitude']; |
||||
_latitude = json['latitude']; |
||||
_remark = json['remark']; |
||||
_isDelete = json['isDelete']; |
||||
_tenantCode = json['tenantCode']; |
||||
_storeName = json['storeName']; |
||||
_liked = json['liked']; |
||||
_followed = json['followed']; |
||||
_comments = json['comments']; |
||||
_authorName = json['authorName']; |
||||
_authorHeadImg = json['authorHeadImg']; |
||||
} |
||||
String _id; |
||||
String _createTime; |
||||
dynamic _createUser; |
||||
String _createUser; |
||||
String _updateTime; |
||||
dynamic _updateUser; |
||||
String _updateUser; |
||||
String _storeId; |
||||
String _categoryId; |
||||
String _mainTitle; |
||||
dynamic _viceTitle; |
||||
String _content; |
||||
String _coverImg; |
||||
dynamic _author; |
||||
int _type; |
||||
int _likes; |
||||
int _viewers; |
||||
String _startTime; |
||||
String _categoryId; |
||||
String _endTime; |
||||
bool _isHot; |
||||
int _state; |
||||
String _location; |
||||
String _longitude; |
||||
String _latitude; |
||||
String _remark; |
||||
int _isDelete; |
||||
int _likes; |
||||
bool _isHot; |
||||
String _tenantCode; |
||||
dynamic _storeName; |
||||
bool _liked; |
||||
int _viewers; |
||||
int _comments; |
||||
bool _followed; |
||||
dynamic _comments; |
||||
String _authorName; |
||||
String _authorHeadImg; |
||||
bool isFollow; |
||||
dynamic _storeName; |
||||
|
||||
String get id => _id; |
||||
String get createTime => _createTime; |
||||
dynamic get createUser => _createUser; |
||||
String get createUser => _createUser; |
||||
String get updateTime => _updateTime; |
||||
dynamic get updateUser => _updateUser; |
||||
String get updateUser => _updateUser; |
||||
String get storeId => _storeId; |
||||
String get categoryId => _categoryId; |
||||
String get mainTitle => _mainTitle; |
||||
dynamic get viceTitle => _viceTitle; |
||||
String get content => _content; |
||||
String get coverImg => _coverImg; |
||||
dynamic get author => _author; |
||||
int get type => _type; |
||||
int get likes => _likes; |
||||
int get viewers => _viewers; |
||||
String get startTime => _startTime; |
||||
String get categoryId => _categoryId; |
||||
String get endTime => _endTime; |
||||
bool get isHot => _isHot; |
||||
int get state => _state; |
||||
String get location => _location; |
||||
String get longitude => _longitude; |
||||
String get latitude => _latitude; |
||||
String get remark => _remark; |
||||
int get isDelete => _isDelete; |
||||
int get likes => _likes; |
||||
bool get isHot => _isHot; |
||||
String get tenantCode => _tenantCode; |
||||
dynamic get storeName => _storeName; |
||||
bool get liked => _liked; |
||||
int get viewers => _viewers; |
||||
int get comments => _comments; |
||||
bool get followed => _followed; |
||||
dynamic get comments => _comments; |
||||
String get authorName => _authorName; |
||||
String get authorHeadImg => _authorHeadImg; |
||||
dynamic get storeName => _storeName; |
||||
|
||||
set id(String value) { |
||||
_id = value; |
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['createTime'] = _createTime; |
||||
map['createUser'] = _createUser; |
||||
map['updateTime'] = _updateTime; |
||||
map['updateUser'] = _updateUser; |
||||
map['storeId'] = _storeId; |
||||
map['categoryId'] = _categoryId; |
||||
map['mainTitle'] = _mainTitle; |
||||
map['viceTitle'] = _viceTitle; |
||||
map['content'] = _content; |
||||
map['coverImg'] = _coverImg; |
||||
map["author"] = _author.toJson() ?? _author; |
||||
map['type'] = _type; |
||||
map['likes'] = _likes; |
||||
map['viewers'] = _viewers; |
||||
map['startTime'] = _startTime; |
||||
map['endTime'] = _endTime; |
||||
map['isHot'] = _isHot; |
||||
map['state'] = _state; |
||||
map['location'] = _location; |
||||
map['longitude'] = _longitude; |
||||
map['latitude'] = _latitude; |
||||
map['remark'] = _remark; |
||||
map['isDelete'] = _isDelete; |
||||
map['tenantCode'] = _tenantCode; |
||||
map['storeName'] = _storeName; |
||||
map['liked'] = _liked; |
||||
map['followed'] = _followed; |
||||
map['comments'] = _comments; |
||||
map['authorName'] = _authorName; |
||||
map['authorHeadImg'] = _authorHeadImg; |
||||
return map; |
||||
} |
||||
|
||||
set likes(int value) { |
||||
_likes = value; |
||||
set authorHeadImg(String value) { |
||||
_authorHeadImg = value; |
||||
} |
||||
|
||||
set authorName(String value) { |
||||
_authorName = value; |
||||
} |
||||
|
||||
set comments(dynamic value) { |
||||
_comments = value; |
||||
} |
||||
|
||||
set followed(bool value) { |
||||
_followed = value; |
||||
} |
||||
|
||||
set liked(bool value) { |
||||
_liked = value; |
||||
} |
||||
|
||||
set viewers(int value) { |
||||
_viewers = value; |
||||
set storeName(dynamic value) { |
||||
_storeName = value; |
||||
} |
||||
|
||||
set comments(int value) { |
||||
_comments = value; |
||||
set tenantCode(String value) { |
||||
_tenantCode = value; |
||||
} |
||||
|
||||
set authorName(String value) { |
||||
_authorName = value; |
||||
set isDelete(int value) { |
||||
_isDelete = value; |
||||
} |
||||
|
||||
set authorHeadImg(String value) { |
||||
_authorHeadImg = value; |
||||
set remark(String value) { |
||||
_remark = value; |
||||
} |
||||
|
||||
Article({ |
||||
String id, |
||||
String createTime, |
||||
dynamic createUser, |
||||
String updateTime, |
||||
dynamic updateUser, |
||||
String storeId, |
||||
String mainTitle, |
||||
dynamic viceTitle, |
||||
String content, |
||||
String coverImg, |
||||
Author author, |
||||
int type, |
||||
String startTime, |
||||
String endTime, |
||||
int state, |
||||
int isDelete, |
||||
int likes, |
||||
bool isHot, |
||||
int viewers, |
||||
int comments, |
||||
String authorName, |
||||
String authorHeadImg, |
||||
|
||||
dynamic storeName}){ |
||||
_id = id; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_updateTime = updateTime; |
||||
_updateUser = updateUser; |
||||
_storeId = storeId; |
||||
_mainTitle = mainTitle; |
||||
_viceTitle = viceTitle; |
||||
_content = content; |
||||
_coverImg = coverImg; |
||||
_author = author; |
||||
_type = type; |
||||
_startTime = startTime; |
||||
_categoryId = categoryId; |
||||
_endTime = endTime; |
||||
_state = state; |
||||
_isDelete = isDelete; |
||||
_likes = likes; |
||||
_isHot = isHot; |
||||
_liked = liked; |
||||
_viewers = viewers; |
||||
_comments = comments; |
||||
_authorName = authorName; |
||||
_authorHeadImg = authorHeadImg; |
||||
_storeName = storeName; |
||||
set latitude(String value) { |
||||
_latitude = value; |
||||
} |
||||
|
||||
Article.fromJson(dynamic json) { |
||||
_id = json["id"]; |
||||
_createTime = json["createTime"]; |
||||
_createUser = json["createUser"]; |
||||
_updateTime = json["updateTime"]; |
||||
_updateUser = json["updateUser"]; |
||||
_storeId = json["storeId"]; |
||||
_mainTitle = json["mainTitle"]; |
||||
_viceTitle = json["viceTitle"]; |
||||
_content = json["content"]; |
||||
_coverImg = json["coverImg"]; |
||||
_author = json["author"] == null ? null : json["author"].toString().startsWith("{") ? Author.fromJson(jsonDecode(json["author"])):null; |
||||
_type = json["type"]; |
||||
_startTime = json["startTime"]; |
||||
_categoryId = json["categoryId"]; |
||||
_endTime = json["endTime"]; |
||||
_state = json["state"]; |
||||
_isDelete = json["isDelete"]; |
||||
_likes = json["likes"]; |
||||
_isHot = json["isHot"]; |
||||
_liked = json["liked"]; |
||||
_viewers = json["viewers"]; |
||||
_comments = json["comments"]; |
||||
_authorName = json["authorName"]; |
||||
_authorHeadImg = json["authorHeadImg"]; |
||||
_storeName = json["storeName"]; |
||||
set longitude(String value) { |
||||
_longitude = value; |
||||
} |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
var map = <String, dynamic>{}; |
||||
map["id"] = _id; |
||||
map["createTime"] = _createTime; |
||||
map["createUser"] = _createUser; |
||||
map["updateTime"] = _updateTime; |
||||
map["updateUser"] = _updateUser; |
||||
map["storeId"] = _storeId; |
||||
map["mainTitle"] = _mainTitle; |
||||
map["viceTitle"] = _viceTitle; |
||||
map["content"] = _content; |
||||
map["coverImg"] = _coverImg; |
||||
map["author"] = _author.toJson(); |
||||
map["type"] = _type; |
||||
map["startTime"] = _startTime; |
||||
map["categoryId"] = _categoryId; |
||||
map["endTime"] = _endTime; |
||||
map["state"] = _state; |
||||
map["isDelete"] = _isDelete; |
||||
map["likes"] = _likes; |
||||
map["isHot"] = _isHot; |
||||
map["liked"] = _liked; |
||||
map["viewers"] = _viewers; |
||||
map["comments"] = _comments; |
||||
map["authorName"] = _authorName; |
||||
map["authorHeadImg"] = _authorHeadImg; |
||||
map["storeName"] = _storeName; |
||||
return map; |
||||
set location(String value) { |
||||
_location = value; |
||||
} |
||||
|
||||
set createTime(String value) { |
||||
_createTime = value; |
||||
set state(int value) { |
||||
_state = value; |
||||
} |
||||
|
||||
set createUser(dynamic value) { |
||||
_createUser = value; |
||||
set isHot(bool value) { |
||||
_isHot = value; |
||||
} |
||||
|
||||
set updateTime(String value) { |
||||
_updateTime = value; |
||||
set endTime(String value) { |
||||
_endTime = value; |
||||
} |
||||
|
||||
set updateUser(dynamic value) { |
||||
_updateUser = value; |
||||
set startTime(String value) { |
||||
_startTime = value; |
||||
} |
||||
|
||||
set storeId(String value) { |
||||
_storeId = value; |
||||
set viewers(int value) { |
||||
_viewers = value; |
||||
} |
||||
|
||||
set mainTitle(String value) { |
||||
_mainTitle = value; |
||||
set likes(int value) { |
||||
_likes = value; |
||||
} |
||||
|
||||
set viceTitle(dynamic value) { |
||||
_viceTitle = value; |
||||
set type(int value) { |
||||
_type = value; |
||||
} |
||||
|
||||
set content(String value) { |
||||
_content = value; |
||||
set author(dynamic value) { |
||||
_author = value; |
||||
} |
||||
|
||||
set coverImg(String value) { |
||||
_coverImg = value; |
||||
} |
||||
|
||||
set author(dynamic value) { |
||||
_author = value; |
||||
set content(String value) { |
||||
_content = value; |
||||
} |
||||
|
||||
set type(int value) { |
||||
_type = value; |
||||
set viceTitle(dynamic value) { |
||||
_viceTitle = value; |
||||
} |
||||
|
||||
set startTime(String value) { |
||||
_startTime = value; |
||||
set mainTitle(String value) { |
||||
_mainTitle = value; |
||||
} |
||||
|
||||
set categoryId(String value) { |
||||
_categoryId = value; |
||||
} |
||||
|
||||
set endTime(String value) { |
||||
_endTime = value; |
||||
set storeId(String value) { |
||||
_storeId = value; |
||||
} |
||||
|
||||
set state(int value) { |
||||
_state = value; |
||||
set updateUser(String value) { |
||||
_updateUser = value; |
||||
} |
||||
|
||||
set isDelete(int value) { |
||||
_isDelete = value; |
||||
set updateTime(String value) { |
||||
_updateTime = value; |
||||
} |
||||
|
||||
set isHot(bool value) { |
||||
_isHot = value; |
||||
set createUser(String value) { |
||||
_createUser = value; |
||||
} |
||||
|
||||
set storeName(dynamic value) { |
||||
_storeName = value; |
||||
set createTime(String value) { |
||||
_createTime = value; |
||||
} |
||||
|
||||
set id(String value) { |
||||
_id = value; |
||||
} |
||||
} |
@ -0,0 +1,134 @@
|
||||
/// id : "1379254113602109440" |
||||
/// nickname : "哈哈哈" |
||||
/// headimg : "https://pos.upload.gznl.top/admin/2021/08/1f8d55ed-85d2-42a2-b155-6737a66226e8.jpg" |
||||
/// userType : true |
||||
/// sex : "0" |
||||
/// level : 1 |
||||
/// remark : "" |
||||
/// createTime : "2021-04-06 10:06:21" |
||||
/// birth : "1998-09-17" |
||||
/// organic : 0 |
||||
/// age : 23 |
||||
/// signature : "" |
||||
/// background : "" |
||||
/// follow : 1 |
||||
/// fans : 0 |
||||
/// trendTotal : 4 |
||||
/// gainLikeTotal : 9 |
||||
|
||||
class MemberInfor { |
||||
MemberInfor({ |
||||
String id, |
||||
String nickname, |
||||
String headimg, |
||||
bool userType, |
||||
String sex, |
||||
int level, |
||||
String remark, |
||||
String createTime, |
||||
String birth, |
||||
int organic, |
||||
int age, |
||||
String signature, |
||||
String background, |
||||
int follow, |
||||
int fans, |
||||
int trendTotal, |
||||
int gainLikeTotal,}){ |
||||
_id = id; |
||||
_nickname = nickname; |
||||
_headimg = headimg; |
||||
_userType = userType; |
||||
_sex = sex; |
||||
_level = level; |
||||
_remark = remark; |
||||
_createTime = createTime; |
||||
_birth = birth; |
||||
_organic = organic; |
||||
_age = age; |
||||
_signature = signature; |
||||
_background = background; |
||||
_follow = follow; |
||||
_fans = fans; |
||||
_trendTotal = trendTotal; |
||||
_gainLikeTotal = gainLikeTotal; |
||||
} |
||||
|
||||
MemberInfor.fromJson(dynamic json) { |
||||
_id = json['id']; |
||||
_nickname = json['nickname']; |
||||
_headimg = json['headimg']; |
||||
_userType = json['userType']; |
||||
_sex = json['sex']; |
||||
_level = json['level']; |
||||
_remark = json['remark']; |
||||
_createTime = json['createTime']; |
||||
_birth = json['birth']; |
||||
_organic = json['organic']; |
||||
_age = json['age']; |
||||
_signature = json['signature']; |
||||
_background = json['background']; |
||||
_follow = json['follow']; |
||||
_fans = json['fans']; |
||||
_trendTotal = json['trendTotal']; |
||||
_gainLikeTotal = json['gainLikeTotal']; |
||||
} |
||||
String _id; |
||||
String _nickname; |
||||
String _headimg; |
||||
bool _userType; |
||||
String _sex; |
||||
int _level; |
||||
String _remark; |
||||
String _createTime; |
||||
String _birth; |
||||
int _organic; |
||||
int _age; |
||||
String _signature; |
||||
String _background; |
||||
int _follow; |
||||
int _fans; |
||||
int _trendTotal; |
||||
int _gainLikeTotal; |
||||
|
||||
String get id => _id; |
||||
String get nickname => _nickname; |
||||
String get headimg => _headimg; |
||||
bool get userType => _userType; |
||||
String get sex => _sex; |
||||
int get level => _level; |
||||
String get remark => _remark; |
||||
String get createTime => _createTime; |
||||
String get birth => _birth; |
||||
int get organic => _organic; |
||||
int get age => _age; |
||||
String get signature => _signature; |
||||
String get background => _background; |
||||
int get follow => _follow; |
||||
int get fans => _fans; |
||||
int get trendTotal => _trendTotal; |
||||
int get gainLikeTotal => _gainLikeTotal; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['id'] = _id; |
||||
map['nickname'] = _nickname; |
||||
map['headimg'] = _headimg; |
||||
map['userType'] = _userType; |
||||
map['sex'] = _sex; |
||||
map['level'] = _level; |
||||
map['remark'] = _remark; |
||||
map['createTime'] = _createTime; |
||||
map['birth'] = _birth; |
||||
map['organic'] = _organic; |
||||
map['age'] = _age; |
||||
map['signature'] = _signature; |
||||
map['background'] = _background; |
||||
map['follow'] = _follow; |
||||
map['fans'] = _fans; |
||||
map['trendTotal'] = _trendTotal; |
||||
map['gainLikeTotal'] = _gainLikeTotal; |
||||
return map; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,113 @@
|
||||
|
||||
|
||||
import 'dart:convert'; |
||||
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/retrofit/data/activity_pos.dart'; |
||||
|
||||
import 'custom_image.dart'; |
||||
|
||||
class ActivityPoster extends StatefulWidget { |
||||
final ActivityPos activityPos; |
||||
|
||||
ActivityPoster(this.activityPos); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _ActivityPoster(); |
||||
} |
||||
} |
||||
|
||||
class _ActivityPoster extends State<ActivityPoster> { |
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Container( |
||||
width: double.infinity, |
||||
height: 289, |
||||
alignment: Alignment.center, |
||||
margin: EdgeInsets.only( |
||||
left:37, |
||||
right:37, |
||||
), |
||||
child: Stack( |
||||
children: [ |
||||
GestureDetector( |
||||
onTap: (){ |
||||
jumpClick(widget.activityPos); |
||||
}, |
||||
child: |
||||
Container( |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(12), |
||||
), |
||||
child:MImage( |
||||
widget?.activityPos?.showImage ?? "", |
||||
width: double.infinity, |
||||
height: MediaQuery.of(context).size.height / 2, |
||||
fit: BoxFit.cover, |
||||
radius: BorderRadius.all(Radius.circular(12)), |
||||
errorSrc: "assets/image/default_1.png", |
||||
fadeSrc: "assets/image/default_1.png", |
||||
),), |
||||
), |
||||
Container( |
||||
padding: EdgeInsets.only(top: 8,right: 8,bottom:8), |
||||
child:GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
Navigator.of(context).pop(); |
||||
}, |
||||
child: Row(children: [ |
||||
Spacer(), |
||||
Image.asset( |
||||
"assets/image/cancel.png", |
||||
width: 24, |
||||
height: 24, |
||||
color: Colors.white, |
||||
) |
||||
],) |
||||
) ) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
/// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) |
||||
jumpClick(ActivityPos activityPos) async { |
||||
switch (activityPos.jumpType) { |
||||
case 1: |
||||
Navigator.of(context).pushNamed('/router/integral_store_page', |
||||
arguments: {"goodsId": widget.activityPos.jumpUrl}); |
||||
break; |
||||
case 2: |
||||
Navigator.of(context) |
||||
.pushNamed('/router/web_page', arguments: { |
||||
"activityId": widget.activityPos.jumpUrl, |
||||
}); |
||||
break; |
||||
case 3: |
||||
Navigator.of(context) |
||||
.pushNamed('/router/web_page', arguments: { |
||||
"articleId": widget.activityPos.jumpUrl, |
||||
}); |
||||
break; |
||||
case 4: |
||||
String router = widget.activityPos.jumpUrl; |
||||
if (router.contains("?")) { |
||||
String params = router.substring(router.indexOf("?")); |
||||
params = params.replaceAll("?", ""); |
||||
Map map = jsonDecode(params); |
||||
Navigator.of(context).pushNamed(router, arguments: map); |
||||
} else { |
||||
Navigator.of(context).pushNamed(router); |
||||
} |
||||
break; |
||||
case 5: |
||||
Navigator.of(context) |
||||
.pushNamed('/router/class_details', arguments: { |
||||
"id": widget.activityPos.jumpUrl, |
||||
}); |
||||
break; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,73 @@
|
||||
import 'dart:io'; |
||||
import 'dart:ui'; |
||||
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter/rendering.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:shared_preferences/shared_preferences.dart'; |
||||
import 'package:webview_flutter/webview_flutter.dart'; |
||||
import 'package:flutter/cupertino.dart'; |
||||
|
||||
class WebTurntableActivity extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
///转盘活动 |
||||
WebTurntableActivity({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _WebTurntableActivity(); |
||||
} |
||||
} |
||||
|
||||
class _WebTurntableActivity extends State<WebTurntableActivity> with WidgetsBindingObserver { |
||||
final ScrollController scrollController = ScrollController(); |
||||
String token; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
WidgetsBinding.instance.addObserver(this); |
||||
|
||||
SharedPreferences.getInstance().then((value) => { |
||||
token = value.getString('token'), |
||||
}); |
||||
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); |
||||
|
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
appBar: MyAppBar( |
||||
action: Container( |
||||
margin: EdgeInsets.only(right: 10), |
||||
child: GestureDetector( |
||||
onTap: () { |
||||
// share(); |
||||
}, |
||||
child: Icon( |
||||
Icons.share, |
||||
size: 24, |
||||
color: Colors.black, |
||||
), |
||||
), |
||||
), |
||||
title: "", |
||||
background: Color(0xFFFFFFFFF), |
||||
leadingColor: Colors.black, |
||||
), |
||||
body: Container( |
||||
width: MediaQuery.of(context).size.width, |
||||
height: MediaQuery.of(context).size.height, |
||||
alignment: Alignment.center, |
||||
child: |
||||
WebView( |
||||
initialUrl: "http://192.168.10.90:5500/lottery.html?token=${token}", |
||||
javascriptMode: JavascriptMode.unrestricted, |
||||
)), |
||||
); |
||||
} |
||||
} |