修改圈子发现接口
This commit is contained in:
parent
303a47604a
commit
21bd31452d
BIN
circle_app/assets/images/circle/delete.png
Normal file
BIN
circle_app/assets/images/circle/delete.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@ -1,5 +1,5 @@
|
||||
import 'package:dio/dio.dart';
|
||||
// import 'package:flutter_install_app/flutter_install_app.dart';
|
||||
import 'package:flutter_install_app/flutter_install_app.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@ -42,7 +42,7 @@ class AboutappLogic extends GetxController {
|
||||
// SmartDialog.dismiss();
|
||||
// print(error);
|
||||
// });
|
||||
// await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import 'package:circle_app/router/app_routers.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -11,6 +12,8 @@ class CircleLogic extends GetxController {
|
||||
PageController(initialPage: 1, viewportFraction: 0.8);
|
||||
InterestsBean circle = InterestsBean(lists: []);
|
||||
final CircleState state = CircleState();
|
||||
|
||||
Map? statistics;
|
||||
int page = 1;
|
||||
|
||||
@override
|
||||
@ -25,6 +28,7 @@ class CircleLogic extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
loadCirclePeopleData();
|
||||
}
|
||||
|
||||
loadMore() async {
|
||||
@ -52,10 +56,24 @@ class CircleLogic extends GetxController {
|
||||
showToast(bean.msg);
|
||||
}
|
||||
|
||||
//访问我的圈子人数
|
||||
loadCirclePeopleData() async {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getInterestsCount);
|
||||
if (data['code'] == 200) {
|
||||
statistics = data['data'];
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
Circle getCircleIndex() {
|
||||
return circle.lists[state.index];
|
||||
}
|
||||
|
||||
void pushHome(String userId) {
|
||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: userId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -41,10 +41,6 @@ class _CirclePageState extends State<CirclePage>
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(getBaseImage('home_back')))),
|
||||
// child: Image.asset(
|
||||
// getBaseImage('bg'),
|
||||
// fit: BoxFit.fill,
|
||||
// ),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: SafeArea(
|
||||
@ -106,20 +102,42 @@ class _CirclePageState extends State<CirclePage>
|
||||
}
|
||||
|
||||
navigatorItem() {
|
||||
List<String> urlList = [
|
||||
'https://p3-passport.byteimg.com/img/user-avatar/eb429d4dbb3c246f580a6f7894f2b246~100x100.awebp',
|
||||
'https://p3-passport.byteimg.com/img/user-avatar/eb429d4dbb3c246f580a6f7894f2b246~100x100.awebp',
|
||||
'https://p3-passport.byteimg.com/img/user-avatar/eb429d4dbb3c246f580a6f7894f2b246~100x100.awebp'
|
||||
];
|
||||
List<String> urlList = [];
|
||||
List infoList = [];
|
||||
if (logic.statistics != null) {
|
||||
infoList = logic.statistics!["users"];
|
||||
if (infoList.isNotEmpty) {
|
||||
for (var element in infoList) {
|
||||
urlList.add(element["avatar"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<Widget> widgets = [];
|
||||
int index = 0;
|
||||
urlList.forEach((element) {
|
||||
|
||||
for (int i = 0 ; i < urlList.length; i++) {
|
||||
var element = urlList[i];
|
||||
widgets.add(Positioned(
|
||||
left: 15.sp * index,
|
||||
child: circleWidget(element),
|
||||
left: 15.sp * i,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
logic.pushHome(infoList[i]['id'].toString());
|
||||
},
|
||||
child: circleWidget(element),
|
||||
),
|
||||
));
|
||||
index++;
|
||||
});
|
||||
}
|
||||
if (urlList.length == 3) {
|
||||
widgets.add(Positioned(
|
||||
left: 15.sp * 3,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
|
||||
},
|
||||
child: circleWidget(logic.statistics!['total'].toString()),
|
||||
),
|
||||
));
|
||||
}
|
||||
return Container(
|
||||
width: Get.width,
|
||||
padding: EdgeInsets.only(left: 18.sp, right: 18.sp),
|
||||
@ -182,14 +200,14 @@ class _CirclePageState extends State<CirclePage>
|
||||
getCircleImage('avatar_bg'),
|
||||
width: width.sp,
|
||||
),
|
||||
ClipOval(
|
||||
url.contains("http") ? ClipOval(
|
||||
child: Image.network(
|
||||
url,
|
||||
width: (width - 1).sp,
|
||||
height: (width - 1).sp,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
)
|
||||
) : Text(url,style: TextStyle(color: Color(0xffF756FF),fontSize: 12.sp),)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
@ -206,8 +206,10 @@ class _InfoListViewState extends State<InfoListView> {
|
||||
return normalDynamicItem(lists);
|
||||
}
|
||||
} else {
|
||||
return loaddingWidget(
|
||||
listLogic.callOutMore);
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: listLogic.callOutMore ? 0 : 10.sp),
|
||||
child: loaddingWidget(
|
||||
listLogic.callOutMore));
|
||||
}
|
||||
}),
|
||||
),
|
||||
|
||||
@ -93,8 +93,11 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
|
||||
return normalDynamicItem(lists);
|
||||
}
|
||||
} else {
|
||||
return loaddingWidget(
|
||||
listLogic.callOutMore);
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: listLogic.callOutMore ? 0 : 10.sp),
|
||||
child: loaddingWidget(
|
||||
listLogic.callOutMore),
|
||||
);
|
||||
}
|
||||
}),
|
||||
),
|
||||
@ -333,7 +336,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
|
||||
onTap: () {
|
||||
showTipPiker(lists.id!.toString(), listsLg!.lists.indexOf(lists));
|
||||
},
|
||||
child: Text('删除',style: TextStyle(color: Colors.red, fontSize: 13.sp),))
|
||||
child: Image.asset(getCircleImage('delete'),width: 14.sp,))
|
||||
],
|
||||
))
|
||||
],
|
||||
@ -571,7 +574,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
|
||||
onTap: () {
|
||||
showTipPiker(lists.id!.toString(), listsLg!.lists.indexOf(lists));
|
||||
},
|
||||
child: Text('删除',style: TextStyle(color: Colors.red, fontSize: 13.sp),))
|
||||
child: Image.asset(getCircleImage('delete'),width: 14.sp,))
|
||||
],
|
||||
))
|
||||
],
|
||||
|
||||
@ -148,10 +148,10 @@ class Api {
|
||||
|
||||
|
||||
|
||||
//发现页统计
|
||||
static const getInterestsCount = 'up-service/interest/statistics';
|
||||
|
||||
|
||||
|
||||
|
||||
// /up-service/my/interests
|
||||
// /up-service/my/interests /up-service/interest/statistics
|
||||
static const getMyCircleInterests = 'up-service/my/interests';
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user