关注和访客记录 列表 个人中心

This commit is contained in:
YangYuhao 2023-07-04 09:23:30 +08:00
parent eebdf6a442
commit 303a47604a
9 changed files with 747 additions and 320 deletions

View File

@ -1,7 +1,153 @@
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../../network/api.dart';
import '../../network/dio_manager.dart';
import 'state.dart'; import 'state.dart';
class FriendslistLogic extends GetxController { class FriendslistLogic extends GetxController {
final RefreshController refreshController = RefreshController();
final FriendslistState state = FriendslistState(); final FriendslistState state = FriendslistState();
final type = Get.arguments as String;
int page = 1;
int isVip = 0;
List<UserInfo> lists = [];
@override
void onInit() async{
super.onInit();
initList();
}
initList() async{
if(page==1){
lists.clear();
}
switch(type){
case "0":
var data =
await DioManager.instance.get(url: Api.followList, params: {
'page':page
});
var bean = BaseResponse<User>.fromJson(data, (data) => User.fromJson(data));
if (bean.isSuccess()) {
lists.addAll(bean.data.lists);
}
update();
if(page == 1){
refreshController.refreshCompleted();
}else{
refreshController.loadComplete();
}
return ;
case "1":
var data =
await DioManager.instance.get(url: Api.fansList, params: {
'page':page
});
var bean = BaseResponse<User>.fromJson(data, (data) => User.fromJson(data));
if (bean.isSuccess()) {
lists.addAll(bean.data.lists);
}
update();
if(page == 1){
refreshController.refreshCompleted();
}else{
refreshController.loadComplete();
}
return ;
case "2":
var data =
await DioManager.instance.get(url: Api.visitList, params: {
'page':page
});
var bean = BaseResponse<User>.fromJson(data, (data) => User.fromJson(data));
if (bean.isSuccess()) {
lists.addAll(bean.data.lists);
}
update();
if(page == 1){
refreshController.refreshCompleted();
}else{
refreshController.loadComplete();
}
return ;
}
}
} }
class User {
final List<UserInfo> lists;
final int total;
User({required this.lists, required this.total});
factory User.fromJson(Map<String, dynamic> json) {
final List<dynamic> userList = json['lists'];
final List<UserInfo> users = userList.map((user) => UserInfo.fromJson(user)).toList();
final int total = json['total'];
return User(lists: users, total: total);
}
}
class UserInfo {
final int id;
final String nickname;
final String avatar;
final String signature;
final String birthday;
final int age;
final int vip;
final int gender;
final int role;
final int orientation;
final double lng;
final double lat;
final String city;
final String avatarThumb;
UserInfo({
required this.id,
required this.nickname,
required this.avatar,
required this.signature,
required this.birthday,
required this.age,
required this.vip,
required this.gender,
required this.role,
required this.orientation,
required this.lng,
required this.lat,
required this.city,
required this.avatarThumb,
});
factory UserInfo.fromJson(Map<String, dynamic> json) {
return UserInfo(
id: json['id'],
nickname: json['nickname'],
avatar: json['avatar'],
signature: json['signature'],
birthday: json['birthday'],
age: json['age'],
vip: json['vip'],
gender: json['gender'],
role: json['role'],
orientation: json['orientation'],
lng: json['lng'],
lat: json['lat'],
city: json['city'],
avatarThumb: json['avatar_thumb'],
);
}
}

View File

@ -1,9 +1,11 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../../components/my_app_bar.dart'; import '../../components/my_app_bar.dart';
import '../../router/app_routers.dart';
import '../../util/util.dart'; import '../../util/util.dart';
import 'logic.dart'; import 'logic.dart';
@ -15,39 +17,162 @@ class FriendslistPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final type = Get.arguments as String; return GetBuilder<FriendslistLogic>(builder: (logic) {
return Container(
return Container( decoration: BoxDecoration(
decoration: BoxDecoration( image: DecorationImage(
image: DecorationImage( image: AssetImage(getBaseImage("home_back")),
image: AssetImage(getBaseImage("home_back")), fit: BoxFit.cover,
fit: BoxFit.cover,
),
),
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: MyAppBar(centerTitle: _getTitleName(type),),
body: SafeArea(
child: SmartRefresher(
controller: _refreshController,
child: ListView.builder(
padding: EdgeInsets.all(16.sp),
itemCount: itemCount,
itemBuilder: (context, index) {
return ListTile(
title: Text('Item $index'),
);
},
),
onRefresh: _onRefresh,
onLoading: _onLoading,
), ),
),), ),
); child: Scaffold(
backgroundColor: Colors.transparent,
appBar: MyAppBar(
centerTitle: _getTitleName(logic.type),
),
body: SafeArea(
child: SmartRefresher(
controller: logic.refreshController,
onRefresh: _onRefresh,
onLoading: _onLoading,
child: ListView.builder(
padding: EdgeInsets.all(16.sp),
itemCount: logic.lists.length,
itemBuilder: (context, index) {
return ListItem(logic.lists[index]);
},
),
),
),
),
);
});
}
Widget ListItem(UserInfo item) {
return GestureDetector(
onTap: (){
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id);
},
child: Container(
margin: EdgeInsets.only(bottom: 21),
child: Row(
children: [
Stack(children: [
ClipOval(
child: GestureDetector(
onTap: () {
var imgList = <String>[];
imgList.add(item.avatar);
Get.toNamed(AppRoutes.Swiper, arguments: {
'imaglist': imgList,
'index': 0
});
},
child: CachedNetworkImage(
imageUrl: item.avatar,
width: 53.sp,
height: 53.sp,
),
),
),
Positioned(
right: 0,
left: 0,
bottom: 0,
child: item.vip>0 ?
Image(
image: AssetImage(getBaseImage("vip")),
width: 44.sp,
height: 18.sp,
):Container(),)
],),
SizedBox(width: 10.sp),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
item.nickname,
style: const TextStyle(color :Colors.white70,fontSize: 14, fontWeight: FontWeight.bold),
),
SizedBox(width: 4.sp),
// SizedBox(height: 8.sp),
_buildInfoRow(item),
// Placeholder image
],
),
SizedBox(height: 8.sp),
Container(
width: 150.sp,
child: Text(
item.signature,
style: TextStyle(fontSize: 12.sp, color: Color(0xFFB7BECC)),
),
),
],
),
// Pla
Spacer(),
GestureDetector(onTap: (){
showToast("私聊");
},
child: Container(
width: 60,
height: 28,
decoration: BoxDecoration(
color: Color(0xFFFF4D7C),
borderRadius: BorderRadius.circular(14),
),
child: Center(
child: Text(
"私聊",
style: TextStyle(fontSize: 14, color: Colors.white),
),
),
),),
],
),
),);
} }
Widget _buildInfoRow(UserInfo userInfoBean) {
String ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age,
userInfoBean!.role, userInfoBean!.orientation);
return Row(
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17),
gradient: LinearGradient(
colors: [
Color.fromRGBO(141, 255, 248, 1.0),
Color.fromRGBO(181, 211, 255, 1.0),
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
),
padding: EdgeInsets.only(
top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp),
child: Text(
ageMsg ,
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
),
),
SizedBox(width: 6.sp),
],
);
}
String _getTitleName(String type) { String _getTitleName(String type) {
switch (type) { switch (type) {
case "0": case "0":
@ -61,23 +186,13 @@ class FriendslistPage extends StatelessWidget {
} }
} }
final RefreshController _refreshController = RefreshController();
int itemCount = 20;
void _onRefresh() async { void _onRefresh() async {
// Perform your refresh logic here logic.page = 1;
// For example, make an API call to fetch new data logic.initList();
await Future.delayed(Duration(seconds: 2));
itemCount = 20;
_refreshController.refreshCompleted();
} }
void _onLoading() async { void _onLoading() async {
// Perform your loading logic here logic.page = logic.page + 1;
// For example, make an API call to fetch more data logic.initList();
await Future.delayed(Duration(seconds: 2));
itemCount += 10;
_refreshController.loadComplete();
} }
} }

View File

@ -1,70 +1,95 @@
import 'dart:ffi';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../network/api.dart'; import '../../network/api.dart';
import '../../network/dio_manager.dart'; import '../../network/dio_manager.dart';
import '../../router/app_routers.dart'; import '../../router/app_routers.dart';
import '../../util/util.dart'; import '../../util/util.dart';
import '../userinfo/logic.dart';
import 'state.dart'; import 'state.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
class MinefragmentLogic extends GetxController { class MinefragmentLogic extends GetxController {
final MinefragmentState state = MinefragmentState(); final MinefragmentState state = MinefragmentState();
UserData? userInfoBean = null; User? userInfoBean = null;
String ageMsg = ""; String ageMsg = "";
var isVip = 0; var isVip = 0;
var like_count = "0";
var like_me_count = "0";
var recent_visit_count = "0";
num like_me_count_new = 0;
num recent_visit_count_new = 0;
@override @override
void onInit() async{ void onInit() async {
super.onInit(); super.onInit();
var data = await DioManager.instance var data = await DioManager.instance.get(url: Api.getUserMine);
.get(url: Api.getUserMine); var bean = BaseResponse<ResponseBean>.fromJson(
var bean = BaseResponse<UserData>.fromJson( data, (data) => ResponseBean.fromJson(data));
data, (data) => UserData.fromJson(data)); if (bean.isSuccess()) {
if(bean.isSuccess()){ SharedPreferences prefs = await SharedPreferences.getInstance();
userInfoBean = bean.data; int likeMeCount = prefs.getInt("likeMeCount") ?? 0;
if(userInfoBean!=null){ int recentVisitCount = prefs.getInt("recentVisitCount") ?? 0;
like_count = bean.data.likeCount.toString();
like_me_count = bean.data.likeMeCount.toString();
recent_visit_count = bean.data.recentVisitCount.toString();
// like_me_count_new = recentVisitCount.toInt() - bean.data.likeMeCount.toInt();
like_me_count_new = (likeMeCount as int) - (bean.data.likeMeCount).toInt();
recent_visit_count_new = recentVisitCount-bean.data.recentVisitCount;
prefs.setInt("likeMeCount", bean.data.likeMeCount);
prefs.setInt("recentVisitCount", bean.data.recentVisitCount);
userInfoBean = bean.data.user;
if (userInfoBean != null) {
isVip = userInfoBean!.vip; isVip = userInfoBean!.vip;
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setInt('vip', isVip); prefs.setInt('vip', isVip);
prefs.setInt('userId', userInfoBean!.id); prefs.setInt('userId', userInfoBean!.id);
ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age, userInfoBean!.role, userInfoBean!.orientation); ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age,
userInfoBean!.role, userInfoBean!.orientation);
} }
update(); update();
}else{ } else {
showToast(bean.msg); showToast(bean.msg);
} }
} }
jumpSetUp() { jumpSetUp() {
Get.toNamed(AppRoutes.SetUpActivity); Get.toNamed(AppRoutes.SetUpActivity);
} }
} }
class UserData {
final int id;
final String nickname;
final String avatar;
final String birthday;
final int age;
final int vip;
final int gender;
final int role;
final int orientation;
final double lng;
final double lat;
final String city;
UserData({ class User {
int id;
String nickname;
String avatar;
String signature;
String birthday;
int age;
int vip;
int gender;
int role;
int orientation;
double lng;
double lat;
String city;
String avatarThumb;
User({
required this.id, required this.id,
required this.nickname, required this.nickname,
required this.avatar, required this.avatar,
required this.signature,
required this.birthday, required this.birthday,
required this.age, required this.age,
required this.vip, required this.vip,
@ -74,42 +99,54 @@ class UserData {
required this.lng, required this.lng,
required this.lat, required this.lat,
required this.city, required this.city,
required this.avatarThumb,
}); });
factory UserData.fromJson(Map<String, dynamic> json) { factory User.fromJson(Map<String, dynamic> json) {
return UserData( return User(
id: json['user']['id'], id: json['id'],
nickname: json['user']['nickname'], nickname: json['nickname'],
avatar: json['user']['avatar'], avatar: json['avatar'],
birthday: json['user']['birthday'], signature: json['signature'],
age: json['user']['age'], birthday: json['birthday'],
vip: json['user']['vip'], age: json['age'],
gender: json['user']['gender'], vip: json['vip'],
role: json['user']['role'], gender: json['gender'],
orientation: json['user']['orientation'], role: json['role'],
lng: json['user']['lng'], orientation: json['orientation'],
lat: json['user']['lat'], lng: json['lng'],
city: json['user']['city'], lat: json['lat'],
city: json['city'],
avatarThumb: json['avatar_thumb'],
); );
} }
} }
class UserResponse { class ResponseBean {
final int code; User user;
final String msg; int likeCount;
final UserData data; int likeMeCount;
int recentVisitCount;
String? vipExpireDate;
int? vipExpireDays;
UserResponse({ ResponseBean({
required this.code, required this.user,
required this.msg, required this.likeCount,
required this.data, required this.likeMeCount,
required this.recentVisitCount,
this.vipExpireDate,
this.vipExpireDays,
}); });
factory UserResponse.fromJson(Map<String, dynamic> json) { factory ResponseBean.fromJson(Map<String, dynamic> json) {
return UserResponse( return ResponseBean(
code: json['code'], user: User.fromJson(json['user']),
msg: json['msg'], likeCount: json['like_count'],
data: UserData.fromJson(json['data']), likeMeCount: json['like_me_count'],
recentVisitCount: json['recent_visit_count'],
vipExpireDate: json['vip_expire_date'],
vipExpireDays: json['vip_expire_days'],
); );
} }
} }

View File

@ -43,7 +43,7 @@ class MinefragmentPage extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
_buildAvatarRow(logic), _buildAvatarRow(logic),
_FriendsRow(), _FriendsRow(logic),
Container( Container(
child: Image( child: Image(
image: AssetImage(getHomeImage("icon_vip")), image: AssetImage(getHomeImage("icon_vip")),
@ -194,7 +194,7 @@ class MinefragmentPage extends StatelessWidget {
); );
} }
Widget _FriendsRow() { Widget _FriendsRow(MinefragmentLogic logic) {
return Center( return Center(
child: Container( child: Container(
width: Get.width, width: Get.width,
@ -214,7 +214,7 @@ class MinefragmentPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
"0", logic.like_count,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16.sp, fontSize: 16.sp,
@ -254,7 +254,7 @@ class MinefragmentPage extends StatelessWidget {
children: [ children: [
Container( Container(
child: Text( child: Text(
"0", logic.like_me_count,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16.sp, fontSize: 16.sp,
@ -287,7 +287,7 @@ class MinefragmentPage extends StatelessWidget {
right: 0.sp, right: 0.sp,
top: 15.sp, top: 15.sp,
child: Text( child: Text(
"+123", logic.like_me_count_new>0 ? logic.like_me_count_new.toString():"",
style: TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)), style: TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)),
), ),
) )
@ -309,7 +309,7 @@ class MinefragmentPage extends StatelessWidget {
children: [ children: [
Container( Container(
child: Text( child: Text(
"0", logic.recent_visit_count,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16.sp, fontSize: 16.sp,
@ -342,7 +342,7 @@ class MinefragmentPage extends StatelessWidget {
right: 0.sp, right: 0.sp,
top: 15.sp, top: 15.sp,
child: Text( child: Text(
"+123", logic.recent_visit_count_new>0 ? logic.recent_visit_count_new.toString():"",
style: TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)), style: TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)),
), ),
) )

View File

@ -1,3 +1,4 @@
import 'package:circle_app/util/util.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -7,10 +8,13 @@ import '../../common/config.dart';
import '../../network/api.dart'; import '../../network/api.dart';
import '../../network/dio_manager.dart'; import '../../network/dio_manager.dart';
import '../../util/qiniu.dart'; import '../../util/qiniu.dart';
import '../call_out/logic.dart';
import 'state.dart'; import 'state.dart';
class ReportLogic extends GetxController { class ReportLogic extends GetxController {
final ReportState state = ReportState(); final ReportState state = ReportState();
var userId = Get.arguments["userId"] ?? "";
int myPosition = -1;
TextEditingController textEditingController = TextEditingController(); TextEditingController textEditingController = TextEditingController();
List<MyObject> arrList = <MyObject>[ List<MyObject> arrList = <MyObject>[
MyObject("涉嫌欺诈", false), MyObject("涉嫌欺诈", false),
@ -26,6 +30,33 @@ class ReportLogic extends GetxController {
List<MyObject> getItemList() { List<MyObject> getItemList() {
return arrList; return arrList;
} }
onSubmit()async{
if(myPosition== -1){
showToast("请选择举报类目");
return;
}
List myBean = [];
state.imaglist.forEach((element) {
myBean.add(MyBean(type: 1, url: element).toJson());
});
var data = await DioManager.instance.post(url: Api.postReport, params: {
"user_id" : userId,
"words" : textEditingController.text,
"obj_type" :1,
"obj_id":userId,
"reason":arrList[myPosition].name,
"album" :myBean
});
var bean = BaseResponse<String>.fromJson(data, (data) => data);
if(bean.isSuccess()){
Get.back();
}
showToast(bean.msg);
}
final ImagePicker _picker = ImagePicker(); final ImagePicker _picker = ImagePicker();
var quToken = ''; var quToken = '';

View File

@ -32,7 +32,7 @@ class ReportPage extends StatelessWidget {
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
onPressed: () { onPressed: () {
showToast("提交"); logic.onSubmit();
}, },
), ),
body: Column( body: Column(
@ -112,7 +112,7 @@ class ReportPage extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
right: 15.sp, // right: 1.sp,
top: 160.sp, top: 160.sp,
child: Text( child: Text(
'${controller.textEditingController.text.length}/200', '${controller.textEditingController.text.length}/200',
@ -169,8 +169,11 @@ class ReportPage extends StatelessWidget {
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
controller.arrList[index].isSelect = if(controller.myPosition != -1){
!controller.arrList[index].isSelect; controller.arrList[controller.myPosition].isSelect = false;
}
controller.myPosition = index;
controller.arrList[index].isSelect = true;
controller.update(); controller.update();
}, },
child: _getItemSelect(controller.arrList[index]), child: _getItemSelect(controller.arrList[index]),

View File

@ -1,6 +1,6 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
@ -28,8 +28,8 @@ class UserinfoLogic extends GetxController {
bool isUrgeStatus = false; bool isUrgeStatus = false;
bool isOnline = false; bool isOnline = false;
bool isShowAlbum = true; bool isShowAlbum = true;
bool isLike = false;
@override @override
void onInit() async { void onInit() async {
@ -56,18 +56,16 @@ class UserinfoLogic extends GetxController {
showToast(bean.msg); showToast(bean.msg);
} }
var myAlbumData = await DioManager.instance.get(url: Api.getMyAlbum,); var myAlbumData = await DioManager.instance.get(
var myAlbumBean = BaseResponse<AlbumResponseBean>.fromJson( url: Api.getMyAlbum,
myAlbumData, (myAlbumData) => AlbumResponseBean.fromJson(myAlbumData)); );
if(myAlbumBean.isSuccess()){ var myAlbumBean = BaseResponse<AlbumResponseBean>.fromJson(myAlbumData,
(myAlbumData) => AlbumResponseBean.fromJson(myAlbumData));
if (myAlbumBean.isSuccess()) {
myAlbumBean.data.lists.forEach((element) { myAlbumBean.data.lists.forEach((element) {
state.imaglist.add(element); state.imaglist.add(element);
}); });
} }
} else { } else {
isMe = false; isMe = false;
var data = await DioManager.instance var data = await DioManager.instance
@ -75,10 +73,11 @@ class UserinfoLogic extends GetxController {
var bean = BaseResponse<ResponseBean>.fromJson( var bean = BaseResponse<ResponseBean>.fromJson(
data, (data) => ResponseBean.fromJson(data)); data, (data) => ResponseBean.fromJson(data));
if (bean.isSuccess()) { if (bean.isSuccess()) {
isLikeFoMsg = isLike = bean.data.is_follow;
"${bean.data.imageUrgeCount}位圈友感兴趣,其中${bean.data.likeMeCount}位已催您更新"; isLikeFoMsg = "${bean.data.imageUrgeCount}位圈友感兴趣,其中${bean.data.likeMeCount}位已催您更新";
userInfoBean = bean.data!.user; userInfoBean = bean.data!.user;
isVip = userInfoBean!.vip; isVip = userInfoBean!.vip;
onLineCity = userInfoBean!.isOnline == true ? "在线" : "离线"; onLineCity = userInfoBean!.isOnline == true ? "在线" : "离线";
if (userInfoBean!.city != null) { if (userInfoBean!.city != null) {
onLineCity = "$onLineCity·${userInfoBean!.city}"; onLineCity = "$onLineCity·${userInfoBean!.city}";
@ -90,22 +89,24 @@ class UserinfoLogic extends GetxController {
showToast(bean.msg); showToast(bean.msg);
} }
var myAlbumData = await DioManager.instance
var myAlbumData = await DioManager.instance.get(url: Api.getTaAlbum+userId+"/albums"); .get(url: Api.getTaAlbum + userId + "/albums");
var myAlbumBean = BaseResponse<AlbumResponseBean>.fromJson( var myAlbumBean = BaseResponse<AlbumResponseBean>.fromJson(myAlbumData,
myAlbumData, (myAlbumData) => AlbumResponseBean.fromJson(myAlbumData)); (myAlbumData) => AlbumResponseBean.fromJson(myAlbumData));
if(myAlbumBean.isSuccess()){ if (myAlbumBean.isSuccess()) {
myAlbumBean.data.lists.forEach((element) { myAlbumBean.data.lists.forEach((element) {
state.imaglist.add(AlbumListItem(id: element.id,type: element.type,url:element.url)); state.imaglist.add(AlbumListItem(
id: element.id, type: element.type, url: element.url));
}); });
} }
var urgedata = await DioManager.instance
.get(url: Api.getUrgeStatus + userId + "/urge/album/status");
var urgedata = await DioManager.instance.get(url: Api.getUrgeStatus+userId+"/urge/album/status");
var urgeBean = BaseResponse<UrgentStatus>.fromJson( var urgeBean = BaseResponse<UrgentStatus>.fromJson(
urgedata, (urgedata) => UrgentStatus.fromJson(urgedata)); urgedata, (urgedata) => UrgentStatus.fromJson(urgedata));
isUrgeStatus = urgeBean.data.isUrgent; //if(urgedata.isSuccess()){
isUrgeStatus = urgeBean.data.isUrgent;
//}
} }
update(); update();
@ -119,26 +120,51 @@ class UserinfoLogic extends GetxController {
} }
} }
urgeChange() async{ urgeChange() async {
var data = await DioManager.instance.post(url: Api.urgeAlbum+userId+"/urge/album"); var data = await DioManager.instance
.post(url: "${Api.urgeAlbum + userId}/urge/album");
var bean = BaseResponse<String>.fromJson(data, (data) => data); var bean = BaseResponse<String>.fromJson(data, (data) => data);
if(bean.isSuccess()){ if (bean.isSuccess()) {
showToast("催更成功"); showToast("催更成功");
isUrgeStatus = true; isUrgeStatus = true;
update(); update();
} }
}
delAlbumImage(int index) async {
var data = await DioManager.instance
.get(url: Api.deleteAlbum + state.imaglist[index].id.toString());
var bean = BaseResponse<String>.fromJson(data, (data) => data);
if (bean.code == 200) {
state.imaglist.removeAt(index);
Navigator.pop(Get.context!);
update();
}
}
setLike() async {
var data = await DioManager.instance
.post(url: "${Api.setBlock + userId}/follow", params: {
'status': isLike?"0":"1"
});
var bean = BaseResponse<dynamic>.fromJson(data, (jsonData) => jsonData,);
if(bean.isSuccess()){
isLike = !isLike;
update();
}
showToast(bean.msg);
} }
delAlbumImage(int index) async{ setBlock() async {
var data = await DioManager.instance.delete(url: Api.deleteAlbum+state.imaglist[index].id.toString()); var data = await DioManager.instance
var bean = BaseResponse<String>.fromJson(data, (data) => data); .post(url: "${Api.setBlock + userId}/block", params: {});
if(bean.code == 200){ var bean = BaseResponse<dynamic>.fromJson(data, (jsonData) => jsonData,);
state.imaglist.removeAt(index); if(bean.isSuccess()){
Navigator.pop(Get.context!);
update(); update();
} }
showToast(bean.msg);
} }
Future getImageFile() async { Future getImageFile() async {
@ -152,23 +178,22 @@ class UserinfoLogic extends GetxController {
SmartDialog.showLoading(); SmartDialog.showLoading();
upDataImage(quToken, pickedFile, CONFIG.USER_ALBUM_IMAGE, (result) async { upDataImage(quToken, pickedFile, CONFIG.USER_ALBUM_IMAGE, (result) async {
var data = await DioManager.instance.post(url: Api.updataAlbum,params: { var data = await DioManager.instance
"type" :1, .post(url: Api.updataAlbum, params: {"type": 1, "url": result});
"url": result
});
var myAlbumBean = BaseResponse<AddAlbum>.fromJson( var myAlbumBean = BaseResponse<AddAlbum>.fromJson(
data, (data) => AddAlbum.fromJson(data)); data, (data) => AddAlbum.fromJson(data));
if (myAlbumBean.code == 200) { if (myAlbumBean.code == 200) {
SmartDialog.dismiss(); SmartDialog.dismiss();
state.imaglist.add(AlbumListItem(id:myAlbumBean.data.id,type:myAlbumBean.data.type,url: result)); state.imaglist.add(AlbumListItem(
id: myAlbumBean.data.id,
type: myAlbumBean.data.type,
url: result));
update(); update();
} }
}); });
} catch (e) {} } catch (e) {}
} }
} }
class UserBean { class UserBean {
@ -258,11 +283,13 @@ class ResponseBean {
UserBean user; UserBean user;
int likeMeCount; int likeMeCount;
int imageUrgeCount; int imageUrgeCount;
bool is_follow;
ResponseBean({ ResponseBean({
required this.user, required this.user,
required this.likeMeCount, required this.likeMeCount,
required this.imageUrgeCount, required this.imageUrgeCount,
required this.is_follow
}); });
factory ResponseBean.fromJson(Map<String, dynamic> json) { factory ResponseBean.fromJson(Map<String, dynamic> json) {
@ -270,6 +297,7 @@ class ResponseBean {
user: UserBean.fromJson(json['user']), user: UserBean.fromJson(json['user']),
likeMeCount: json['like_me_count'], likeMeCount: json['like_me_count'],
imageUrgeCount: json['image_urge_count'], imageUrgeCount: json['image_urge_count'],
is_follow: json['is_follow'],
); );
} }
} }
@ -285,7 +313,8 @@ class AlbumResponseBean {
factory AlbumResponseBean.fromJson(Map<String, dynamic> json) { factory AlbumResponseBean.fromJson(Map<String, dynamic> json) {
return AlbumResponseBean( return AlbumResponseBean(
lists: List<AlbumListItem>.from(json['lists'].map((x) => AlbumListItem.fromJson(x))), lists: List<AlbumListItem>.from(
json['lists'].map((x) => AlbumListItem.fromJson(x))),
total: json['total'], total: json['total'],
); );
} }
@ -311,7 +340,6 @@ class AlbumListItem {
} }
} }
class AddAlbum { class AddAlbum {
int id; int id;
int type; int type;
@ -345,5 +373,3 @@ class UrgentStatus {
); );
} }
} }

View File

@ -23,12 +23,13 @@ class _MyTabbedScreenState extends State<UserinfoPage>
ScrollController scrollController = ScrollController(); ScrollController scrollController = ScrollController();
bool isShowBlackTitle = false; bool isShowBlackTitle = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_tabController = TabController(length: 2, vsync: this,animationDuration: Duration(seconds: 0)); _tabController = TabController(
_tabController.addListener(_handleTabChange); length: 2, vsync: this, animationDuration: Duration(milliseconds: 200));
_tabController.animation!.addListener(_handleTabChange);
// _tabController.addListener(_handleTabChange);
// _tabController // _tabController
} }
@ -47,6 +48,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
_tabController.dispose(); _tabController.dispose();
super.dispose(); super.dispose();
} }
void _onScroll(offset) { void _onScroll(offset) {
if (offset > 100) { if (offset > 100) {
setState(() { setState(() {
@ -79,7 +81,9 @@ class _MyTabbedScreenState extends State<UserinfoPage>
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar( appBar: MyAppBar(
centerTitle: logic.userInfoBean!=null? logic.userInfoBean!.nickname+"的主页":"个人主页", centerTitle: logic.userInfoBean != null
? logic.userInfoBean!.nickname + "的主页"
: "个人主页",
), ),
body: Stack( body: Stack(
children: [ children: [
@ -89,7 +93,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
Positioned( Positioned(
bottom: 27.sp, bottom: 27.sp,
width: Get.width, width: Get.width,
child: _MeInfoButton(logic), child: logic.isShowAlbum ? _MeInfoButton(logic) : Container(),
) )
], ],
), ),
@ -98,38 +102,8 @@ class _MyTabbedScreenState extends State<UserinfoPage>
} }
Widget _MeInfoButton(UserinfoLogic controller) { Widget _MeInfoButton(UserinfoLogic controller) {
if (controller.userId == "") { if (controller.isMe) {
return GestureDetector( return Container();
onTap: () {
// showToast("完善资料");
Get.toNamed(AppRoutes.Complete_materialPage, arguments: "user");
// controller.onInit();
},
child: Center(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17),
gradient: LinearGradient(
colors: [
Color(0xFF06F9FA),
Color(0xFFDC5BFD),
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
),
padding: EdgeInsets.only(
top: 10.sp, bottom: 10.sp, left: 55.sp, right: 55.sp),
child: Text(
"完善个人形象",
style: TextStyle(
color: Colors.white,
fontSize: 12,
),
),
),
),
);
} else { } else {
return Container( return Container(
margin: EdgeInsets.only(left: 18.sp, right: 18.sp), margin: EdgeInsets.only(left: 18.sp, right: 18.sp),
@ -149,9 +123,11 @@ class _MyTabbedScreenState extends State<UserinfoPage>
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
showToast("喜欢"); logic.setLike();
}, },
child: Container( child: Container(
width: 130.sp,
height: 34.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.sp), borderRadius: BorderRadius.circular(17.sp),
gradient: LinearGradient( gradient: LinearGradient(
@ -163,13 +139,13 @@ class _MyTabbedScreenState extends State<UserinfoPage>
end: Alignment.centerRight, end: Alignment.centerRight,
), ),
), ),
padding: EdgeInsets.only( child: Center(
top: 10.sp, bottom: 10.sp, left: 52.sp, right: 52.sp), child: Text(
child: Text( logic.isLike ? "取消喜欢" : "喜欢",
"喜欢", style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontSize: 12.sp,
fontSize: 12.sp, ),
), ),
), ),
), ),
@ -179,6 +155,8 @@ class _MyTabbedScreenState extends State<UserinfoPage>
showToast("私聊"); showToast("私聊");
}, },
child: Container( child: Container(
width: 130.sp,
height: 34.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.sp), borderRadius: BorderRadius.circular(17.sp),
gradient: LinearGradient( gradient: LinearGradient(
@ -190,13 +168,13 @@ class _MyTabbedScreenState extends State<UserinfoPage>
end: Alignment.centerRight, end: Alignment.centerRight,
), ),
), ),
padding: EdgeInsets.only( child: Center(
top: 10.sp, bottom: 10.sp, left: 52.sp, right: 52.sp), child: Text(
child: Text( "私聊",
"私聊", style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontSize: 12.sp,
fontSize: 12.sp, ),
), ),
), ),
), ),
@ -226,7 +204,9 @@ class _MyTabbedScreenState extends State<UserinfoPage>
Row( Row(
children: [ children: [
Text( Text(
controller.userInfoBean!=null ?controller.userInfoBean!.nickname:"" , controller.userInfoBean != null
? controller.userInfoBean!.nickname
: "",
style: TextStyle( style: TextStyle(
color: Color.fromRGBO(247, 250, 250, 1.0), color: Color.fromRGBO(247, 250, 250, 1.0),
fontSize: 16, fontSize: 16,
@ -240,16 +220,21 @@ class _MyTabbedScreenState extends State<UserinfoPage>
children: [ children: [
Container( Container(
margin: EdgeInsets.only(right: 5.sp), margin: EdgeInsets.only(right: 5.sp),
width:5.sp, width: 5.sp,
height: 5.sp, height: 5.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: logic.isOnline? Color(0xFF00FFF4): Color(0xFF787575), color: logic.isOnline
? Color(0xFF00FFF4)
: Color(0xFF787575),
), ),
), ),
Text( Text(
controller.onLineCity, controller.onLineCity,
style: TextStyle(color: logic.isOnline? Color(0xFF00FFF4): Color(0xFF787575)), style: TextStyle(
color: logic.isOnline
? Color(0xFF00FFF4)
: Color(0xFF787575)),
) )
], ],
), ),
@ -259,7 +244,9 @@ class _MyTabbedScreenState extends State<UserinfoPage>
// margin: EdgeInsets.only(top: 18.sp, bottom: 18.sp), // margin: EdgeInsets.only(top: 18.sp, bottom: 18.sp),
height: 59.sp, height: 59.sp,
child: ListView.builder( child: ListView.builder(
itemCount: controller.userInfoBean==null ? 0 : controller.userInfoBean!.interests.length, itemCount: controller.userInfoBean == null
? 0
: controller.userInfoBean!.interests.length,
// item // item
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
// //
@ -283,7 +270,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
margin: EdgeInsets.all(0.2.sp), margin: EdgeInsets.all(0.2.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0), borderRadius: BorderRadius.circular(17.0),
// shape: BoxShape.circle, // shape: BoxShape.circle,
color: Color(0xFF392D53), color: Color(0xFF392D53),
), ),
child: Padding( child: Padding(
@ -306,14 +293,6 @@ class _MyTabbedScreenState extends State<UserinfoPage>
), ),
), ),
titleTab(controller), titleTab(controller),
Visibility(
visible: logic.isShowAlbum,
child: Container(
margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp),
child: controller.isMe? Text(
controller.isLikeFoMsg,
style: TextStyle(color: Colors.white30),
) :Container())) ,
Expanded( Expanded(
child: Container( child: Container(
// color: Colors.blue, // color: Colors.blue,
@ -329,7 +308,8 @@ class _MyTabbedScreenState extends State<UserinfoPage>
), ),
); );
} }
Widget titleTab(UserinfoLogic controller){
Widget titleTab(UserinfoLogic controller) {
return Container( return Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
height: 27.sp, height: 27.sp,
@ -351,15 +331,17 @@ class _MyTabbedScreenState extends State<UserinfoPage>
Tab(text: "喊话") Tab(text: "喊话")
], ],
), ),
GestureDetector(
GestureDetector(onTap: (){ onTap: () {
controller.isMe? controller.isEdit = !controller.isEdit : controller.urgeChange(); controller.isMe
controller.update(); ? controller.isEdit = !controller.isEdit
// controller.updataImage(); : controller.urgeChange();
}, controller.update();
child: Visibility( // controller.updataImage();
visible: logic.isShowAlbum, },
child: Container( child: Visibility(
visible: logic.isShowAlbum,
child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17), borderRadius: BorderRadius.circular(17),
gradient: const LinearGradient( gradient: const LinearGradient(
@ -374,65 +356,128 @@ class _MyTabbedScreenState extends State<UserinfoPage>
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 2.sp, bottom: 2.sp, left: 12.sp, right: 12.sp), top: 2.sp, bottom: 2.sp, left: 12.sp, right: 12.sp),
child: Text( child: Text(
controller.isMe? controller.isEdit?"完成": "管理" : controller.isUrgeStatus? "已催更":"催更", controller.isMe
? controller.isEdit
? "完成"
: "管理"
: controller.isUrgeStatus
? "已催更"
: "催更",
style: const TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,
), ),
), ),
),),), ),
),
),
], ],
)); ));
} }
Widget _imageAdapter(UserinfoLogic controller) {
return GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, //
),
itemCount:controller.isMe?
controller.isEdit? controller.state.imaglist.length+1 : controller.state.imaglist.length:
controller.state.imaglist.length, //
itemBuilder: (BuildContext context, int index) {
if(controller.isMe&&controller.isEdit){
if (index == 0) {
//
return GestureDetector(
onTap: () {
controller.getImageFile();
Widget _imageAdapter(UserinfoLogic controller) {
return Stack(children: [
Container(
child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp),
child: controller.isMe
? Text(
controller.isLikeFoMsg,
style: const TextStyle(color: Colors.white30),
)
: Container()),
GridView.builder(
shrinkWrap: true,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, //
),
itemCount: controller.isMe
? controller.isEdit
? controller.state.imaglist.length + 1
: controller.state.imaglist.length
: controller.state.imaglist.length, //
itemBuilder: (BuildContext context, int index) {
if (controller.isMe && controller.isEdit) {
if (index == 0) {
//
return GestureDetector(
onTap: () {
controller.getImageFile();
},
child: Container(
margin: EdgeInsets.all(5.sp),
child: Image(
image: AssetImage(getMineImage("icon_img_add")),
),
),
);
} else {
return Container(
margin: EdgeInsets.all(5.sp),
child: Center(
child: _buildImageItem(
controller.state.imaglist[index - 1].url,
controller,
index - 1)),
);
}
} else {
return Container(
margin: EdgeInsets.all(5.sp),
child: Center(
child: _buildImageItem(
controller.state.imaglist[index].url,
controller,
index)),
);
}
}, },
)
],
),
),
Positioned(
left: 0,
right: 0,
bottom: 27.sp,
child: GestureDetector(
onTap: () {
// showToast("完善资料");
Get.toNamed(AppRoutes.Complete_materialPage, arguments: "user");
// controller.onInit();
},
child: Center(
child: Container( child: Container(
margin: EdgeInsets.all(5.sp), decoration: BoxDecoration(
child: Image( borderRadius: BorderRadius.circular(17),
image: AssetImage(getMineImage("icon_img_add")), gradient: LinearGradient(
colors: [
Color(0xFF06F9FA),
Color(0xFFDC5BFD),
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
),
padding: EdgeInsets.only(
top: 10.sp, bottom: 10.sp, left: 55.sp, right: 55.sp),
child: Text(
"完善个人形象",
style: TextStyle(
color: Colors.white,
fontSize: 12,
),
), ),
), ),
); ),
} else { ))
return Container( ],);
margin: EdgeInsets.all(5.sp),
child: Center(
child: _buildImageItem(
controller.state.imaglist[index-1].url,
controller,index-1)),
);
}
}else{
return Container(
margin: EdgeInsets.all(5.sp),
child: Center(
child: _buildImageItem(
controller.state.imaglist[index].url,
controller,index)),
);
}
},
);
} }
Widget _buildInfoRow(UserinfoLogic controller) { Widget _buildInfoRow(UserinfoLogic controller) {
@ -453,7 +498,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp), top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp),
child: Text( child: Text(
controller.ageMsg , controller.ageMsg,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10,
@ -461,12 +506,13 @@ class _MyTabbedScreenState extends State<UserinfoPage>
), ),
), ),
SizedBox(width: 6.sp), SizedBox(width: 6.sp),
controller.isVip>0 ? controller.isVip > 0
Image( ? Image(
image: AssetImage(getBaseImage("vip")), image: AssetImage(getBaseImage("vip")),
width: 44.sp, width: 44.sp,
height: 18.sp, height: 18.sp,
):Container(), )
: Container(),
], ],
); );
} }
@ -485,7 +531,9 @@ class _MyTabbedScreenState extends State<UserinfoPage>
margin: EdgeInsets.only(left: 24.sp), margin: EdgeInsets.only(left: 24.sp),
child: Center( child: Center(
child: Text( child: Text(
controller.userInfoBean!=null ? controller.userInfoBean!.signature:"", controller.userInfoBean != null
? controller.userInfoBean!.signature
: "",
maxLines: 2, maxLines: 2,
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
@ -521,24 +569,22 @@ class _MyTabbedScreenState extends State<UserinfoPage>
} }
Widget _buildAvatar1(UserinfoLogic controller) { Widget _buildAvatar1(UserinfoLogic controller) {
if(controller.userInfoBean==null){ if (controller.userInfoBean == null) {
return Container( return Container(
width: 66.sp, width: 66.sp,
height: 66.sp, height: 66.sp,
); );
}else { } else {
return ClipOval( return ClipOval(
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
var imgList = <String>[]; var imgList = <String>[];
imgList.add(controller.userInfoBean!.avatar); imgList.add(controller.userInfoBean!.avatar);
Get.toNamed(AppRoutes.Swiper, arguments: { Get.toNamed(AppRoutes.Swiper,
'imaglist': imgList, arguments: {'imaglist': imgList, 'index': 0});
'index': 0
});
}, },
child: CachedNetworkImage( child: CachedNetworkImage(
imageUrl: controller.userInfoBean != null imageUrl: controller.userInfoBean != null
? controller.userInfoBean!.avatar ? controller.userInfoBean!.avatar
: "", : "",
width: 66.sp, width: 66.sp,
@ -549,7 +595,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
} }
} }
Widget _buildImageItem(String url, UserinfoLogic controller,int index) { Widget _buildImageItem(String url, UserinfoLogic controller, int index) {
return Stack( return Stack(
children: [ children: [
Container( Container(
@ -563,10 +609,8 @@ class _MyTabbedScreenState extends State<UserinfoPage>
controller.state.imaglist.forEach((element) { controller.state.imaglist.forEach((element) {
imaglist.add(element.url); imaglist.add(element.url);
}); });
Get.toNamed(AppRoutes.Swiper, arguments: { Get.toNamed(AppRoutes.Swiper,
'imaglist':imaglist, arguments: {'imaglist': imaglist, 'index': index});
'index':index
});
}, },
child: Image.network( child: Image.network(
fit: BoxFit.cover, fit: BoxFit.cover,
@ -581,15 +625,16 @@ class _MyTabbedScreenState extends State<UserinfoPage>
right: 0, right: 0,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
// showToast("删除"); // showToast("删除");
_showDelImgDialog(context,controller,index); _showDelImgDialog(context, controller, index);
}, },
child:controller.isEdit? Image( child: controller.isEdit
image: AssetImage(getMineImage("icon_img_del")), ? Image(
width: 20.sp, image: AssetImage(getMineImage("icon_img_del")),
height: 20.sp, width: 20.sp,
):Container(), height: 20.sp,
)
: Container(),
)) ))
], ],
); );
@ -626,7 +671,8 @@ class _MyTabbedScreenState extends State<UserinfoPage>
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
Get.toNamed(AppRoutes.ReportActivity); Get.toNamed(AppRoutes.ReportActivity,
arguments: {"userId": logic.userId});
}, },
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -677,9 +723,8 @@ class _MyTabbedScreenState extends State<UserinfoPage>
); );
} }
void _showDelImgDialog(
BuildContext context, UserinfoLogic controller, int index) {
void _showDelImgDialog(BuildContext context,UserinfoLogic controller,int index) {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
@ -721,7 +766,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
child: Text( child: Text(
"提示", "提示",
style: style:
TextStyle(color: Colors.white, fontSize: 16.sp), TextStyle(color: Colors.white, fontSize: 16.sp),
), ),
), ),
Container( Container(
@ -775,9 +820,6 @@ class _MyTabbedScreenState extends State<UserinfoPage>
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
controller.delAlbumImage(index); controller.delAlbumImage(index);
}, },
child: Container( child: Container(
margin: EdgeInsets.only(top: 24.sp), margin: EdgeInsets.only(top: 24.sp),
@ -819,10 +861,6 @@ class _MyTabbedScreenState extends State<UserinfoPage>
); );
} }
void _showReportDialog(BuildContext context) { void _showReportDialog(BuildContext context) {
showDialog( showDialog(
context: context, context: context,
@ -925,7 +963,9 @@ class _MyTabbedScreenState extends State<UserinfoPage>
), ),
SizedBox(width: 24.sp), SizedBox(width: 24.sp),
GestureDetector( GestureDetector(
onTap: () {}, onTap: () {
logic.setBlock();
},
child: Container( child: Container(
margin: EdgeInsets.only(top: 24.sp), margin: EdgeInsets.only(top: 24.sp),
decoration: BoxDecoration( decoration: BoxDecoration(

View File

@ -86,6 +86,35 @@ class Api {
static const getUrgeStatus = 'up-service/user/'; static const getUrgeStatus = 'up-service/user/';
//
static const setBlock = 'user-service/user/';
//
static const setLike = 'user-service/user/';
//
static const followList = 'user-service/follow/users';
//
static const fansList = 'user-service/fans/users';
//
static const visitList = 'user-service/visit/users';
//
static const postReport = 'up-service/report';