附近板块
This commit is contained in:
parent
491900a054
commit
8e1fd067f5
@ -15,28 +15,31 @@ import '../../network/api.dart';
|
||||
import '../../network/dio_manager.dart';
|
||||
import '../../util/eventBus.dart';
|
||||
import '../select_circle/logic.dart';
|
||||
import '../userinfo/logic.dart';
|
||||
import 'state.dart';
|
||||
import 'package:scroll_to_index/scroll_to_index.dart';
|
||||
|
||||
class CircleLogic extends GetxController {
|
||||
|
||||
PageController pageController =
|
||||
PageController(initialPage: 1, viewportFraction: 0.8);
|
||||
SwiperController swiperController = SwiperController();
|
||||
final RefreshController refreshController = RefreshController();
|
||||
InterestsBean circle = InterestsBean(lists: []);
|
||||
final CircleState state = CircleState();
|
||||
var statistics = Rx<DataModel>(DataModel(visitCount: 0, lastVisitUsers: [], likeMeCount: 0));
|
||||
var statistics = Rx<DataModel>(
|
||||
DataModel(visitCount: 0, lastVisitUsers: [], likeMeCount: 0));
|
||||
|
||||
//Map? statistics;
|
||||
int page = 1;
|
||||
|
||||
int vicinityPage = 1;
|
||||
|
||||
bool isMore = true;
|
||||
int myVip = 0;
|
||||
bool isShowCircle = true;
|
||||
String cityName = "全国";
|
||||
String cityName = "";
|
||||
|
||||
|
||||
var bannerList = ["http://pics5.baidu.com/feed/622762d0f703918f751ba5e950ce8d915beec4c1.jpeg?token=ed435fd18c71cf7ca7a011acb70460f7"];
|
||||
List<BannerItem> bannerList = [];
|
||||
|
||||
AutoScrollController scrollController = AutoScrollController();
|
||||
ScrollController listScrollController = ScrollController();
|
||||
@ -44,8 +47,8 @@ class CircleLogic extends GetxController {
|
||||
@override
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getCircleInterests, params: {"page": page,'page_size':20});
|
||||
var data = await DioManager.instance.get(
|
||||
url: Api.getCircleInterests, params: {"page": page, 'page_size': 20});
|
||||
var bean = BaseResponse<InterestsBean>.fromJson(
|
||||
data, (data) => InterestsBean.fromJson(data));
|
||||
if (bean.data is InterestsBean && bean.isSuccess()) {
|
||||
@ -59,13 +62,16 @@ class CircleLogic extends GetxController {
|
||||
loadCirclePeopleData();
|
||||
initGerder();
|
||||
getCityList();
|
||||
|
||||
getBanner();
|
||||
getNearByList();
|
||||
|
||||
EventBusManager.on<CommentVipEvent>().listen((event) {
|
||||
myVip = event.vip;
|
||||
// update();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
List<MyConfigData> genderList = [];
|
||||
|
||||
List<MyConfigData> orientationList = [];
|
||||
@ -90,16 +96,12 @@ class CircleLogic extends GetxController {
|
||||
configBean.roleMap.forEach((key, value) {
|
||||
roleList.add(MyConfigData(key, value, false));
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
List<Province> provinceList = [];
|
||||
|
||||
|
||||
Map cityMap = {};
|
||||
|
||||
|
||||
getCityList() async {
|
||||
try {
|
||||
String jsonString = await rootBundle.loadString('assets/province.json');
|
||||
@ -111,14 +113,11 @@ class CircleLogic extends GetxController {
|
||||
Map areaMap = {};
|
||||
for (int c = 0; c < provinceList[i].city.length; c++) {
|
||||
String cityName = provinceList[i].city[c].name;
|
||||
List<String> cityAreaList = [];
|
||||
provinceList[i].city[c].area.forEach((element) {
|
||||
cityAreaList.add(element);
|
||||
});
|
||||
areaMap[cityName] = cityAreaList;
|
||||
areaMap[cityName] = []; // 不再存储区域列表,直接设置为空列表
|
||||
}
|
||||
cityMap[provinceList[i].name] = areaMap;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
print('Error loading JSON file: $e');
|
||||
}
|
||||
@ -127,21 +126,19 @@ class CircleLogic extends GetxController {
|
||||
loadMore() async {
|
||||
if (!isMore) return;
|
||||
page = page + 1;
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getCircleInterests, params: {"page": page,'page_size':20});
|
||||
var data = await DioManager.instance.get(
|
||||
url: Api.getCircleInterests, params: {"page": page, 'page_size': 20});
|
||||
var bean = BaseResponse<InterestsBean>.fromJson(
|
||||
data, (data) => InterestsBean.fromJson(data));
|
||||
|
||||
InterestsBean newcircle = bean.data!;
|
||||
if (newcircle.lists.isNotEmpty) {
|
||||
|
||||
if (newcircle.lists.length < 20) {
|
||||
isMore = false;
|
||||
}
|
||||
circle.lists.addAll(newcircle.lists);
|
||||
update();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
outCircle(String interest_id, bool isStatus) async {
|
||||
@ -180,8 +177,7 @@ class CircleLogic extends GetxController {
|
||||
|
||||
//访问我的圈子人数
|
||||
loadCirclePeopleData() async {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getInterestsCount);
|
||||
var data = await DioManager.instance.get(url: Api.getInterestsCount);
|
||||
var myAlbumBean = BaseResponse<DataModel>.fromJson(
|
||||
data, (data) => DataModel.fromJson(data));
|
||||
|
||||
@ -200,11 +196,12 @@ class CircleLogic extends GetxController {
|
||||
}
|
||||
|
||||
void getPipeiData() async {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getMatch);
|
||||
var data = await DioManager.instance.get(url: Api.getMatch);
|
||||
if (data['code'] == 200) {
|
||||
//发送消息
|
||||
bool isSuccess = await createCustomMsg(data['data']['account_id'].toString().split('_').last,data['data']['account_id']);
|
||||
bool isSuccess = await createCustomMsg(
|
||||
data['data']['account_id'].toString().split('_').last,
|
||||
data['data']['account_id']);
|
||||
if (!isSuccess) {
|
||||
await sendTextMsg(data['data']['account_id']);
|
||||
}
|
||||
@ -224,21 +221,231 @@ class CircleLogic extends GetxController {
|
||||
),
|
||||
isScrollControlled: true,
|
||||
enableDrag: false);
|
||||
}
|
||||
|
||||
void getBanner() async {
|
||||
bannerList.clear();
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.getNearbyBeanner, params: {});
|
||||
var bean = BaseResponse<BannerList>.fromJson(
|
||||
data, (data) => BannerList.fromJson(data));
|
||||
bannerList.addAll(bean.data.banners);
|
||||
cityName = bean.data.city;
|
||||
}
|
||||
|
||||
int offset = 0;
|
||||
int deep = 0;
|
||||
List<VicinityItemBean> vicinityList = [];
|
||||
|
||||
void getNearByList() async {
|
||||
List<String> genders = [];
|
||||
genderList.forEach((element) {
|
||||
if (element.isSelect) {
|
||||
genders.add(element.id);
|
||||
}
|
||||
});
|
||||
List<String> roles = [];
|
||||
roleList.forEach((element) {
|
||||
if (element.isSelect) roles.add(element.id);
|
||||
});
|
||||
|
||||
List<String> orientations = [];
|
||||
orientationList.forEach((element) {
|
||||
if (element.isSelect) orientations.add(element.id);
|
||||
});
|
||||
|
||||
// getBanner();
|
||||
var data = await DioManager.instance.post(url: Api.postNearbyList, params: {
|
||||
"offset": offset,
|
||||
'deep': deep,
|
||||
'city': cityName,
|
||||
"genders": genders,
|
||||
"roles": roles,
|
||||
"orientations": orientations
|
||||
});
|
||||
var bean = BaseResponse<VicinityBean>.fromJson(
|
||||
data, (data) => VicinityBean.fromJson(data));
|
||||
try {
|
||||
offset = bean.data.offset;
|
||||
deep = bean.data.deep;
|
||||
} catch (Exception) {}
|
||||
|
||||
if (vicinityPage == 1) {
|
||||
vicinityList.clear();
|
||||
}
|
||||
try{
|
||||
vicinityList.addAll(bean.data.users);
|
||||
} catch(Exception){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (vicinityPage == 1) {
|
||||
refreshController.refreshCompleted();
|
||||
} else {
|
||||
refreshController.loadComplete();
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
class VicinityBean {
|
||||
String city;
|
||||
int offset;
|
||||
int deep;
|
||||
List<VicinityItemBean> users;
|
||||
|
||||
VicinityBean(
|
||||
{required this.city,
|
||||
required this.users,
|
||||
required this.offset,
|
||||
required this.deep});
|
||||
|
||||
factory VicinityBean.fromJson(Map<String, dynamic> json) {
|
||||
List<dynamic> listsJson = json['users'];
|
||||
List<VicinityItemBean> lists =
|
||||
listsJson.map((e) => VicinityItemBean.fromJson(e)).toList();
|
||||
return VicinityBean(
|
||||
users: lists,
|
||||
city: json['city'],
|
||||
offset: json['offset'],
|
||||
deep: json['deep']);
|
||||
}
|
||||
}
|
||||
|
||||
class VicinityItemBean {
|
||||
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 List<Interest> interests;
|
||||
final List<String> images;
|
||||
final String avatarThumb;
|
||||
final String genderName;
|
||||
final String roleName;
|
||||
final String orientationName;
|
||||
final String bgPicUrl;
|
||||
final String onlineFlag;
|
||||
final bool isOnline;
|
||||
|
||||
VicinityItemBean({
|
||||
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.interests,
|
||||
required this.images,
|
||||
required this.avatarThumb,
|
||||
required this.genderName,
|
||||
required this.roleName,
|
||||
required this.orientationName,
|
||||
required this.bgPicUrl,
|
||||
required this.onlineFlag,
|
||||
required this.isOnline,
|
||||
});
|
||||
|
||||
factory VicinityItemBean.fromJson(Map<String, dynamic> json) {
|
||||
var interestList = json['interests'] as List;
|
||||
List<Interest> interests =
|
||||
interestList.map((interest) => Interest.fromJson(interest)).toList();
|
||||
|
||||
return VicinityItemBean(
|
||||
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'],
|
||||
interests: interests,
|
||||
images: List<String>.from(json['images']),
|
||||
avatarThumb: json['avatar_thumb'],
|
||||
genderName: json['genderName'],
|
||||
roleName: json['roleName'],
|
||||
orientationName: json['orientationName'],
|
||||
bgPicUrl: json['bgPicUrl'],
|
||||
onlineFlag: json['onlineFlag'],
|
||||
isOnline: json['isOnline'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// class Interest {
|
||||
// final int id;
|
||||
// final String title;
|
||||
// final String intro;
|
||||
// final String image;
|
||||
// final double amount;
|
||||
// final double oldAmount;
|
||||
// final String iosItem;
|
||||
// final DateTime lastCalloutTime;
|
||||
// final DateTime lastJoinTime;
|
||||
// final bool isJoin;
|
||||
// final bool isLike;
|
||||
// final bool isLimit;
|
||||
// final int viewTotal;
|
||||
// final int joinTotal;
|
||||
//
|
||||
// Interest({
|
||||
// required this.id,
|
||||
// required this.title,
|
||||
// required this.intro,
|
||||
// required this.image,
|
||||
// required this.amount,
|
||||
// required this.oldAmount,
|
||||
// required this.iosItem,
|
||||
// required this.lastCalloutTime,
|
||||
// required this.lastJoinTime,
|
||||
// required this.isJoin,
|
||||
// required this.isLike,
|
||||
// required this.isLimit,
|
||||
// required this.viewTotal,
|
||||
// required this.joinTotal,
|
||||
// });
|
||||
// factory Interest.fromJson(Map<String, dynamic> json) {
|
||||
// return Interest(
|
||||
// id: json['id'],
|
||||
// title: json['title'],
|
||||
// intro: json['intro'],
|
||||
// image: json['image'],
|
||||
// amount: json['amount'],
|
||||
// oldAmount: json['oldAmount'],
|
||||
// iosItem: json['iosItem'],
|
||||
// lastCalloutTime: DateTime.parse(json['lastCalloutTime']),
|
||||
// lastJoinTime: DateTime.parse(json['lastJoinTime']),
|
||||
// isJoin: json['isJoin'],
|
||||
// isLike: json['isLike'],
|
||||
// isLimit: json['isLimit'],
|
||||
// viewTotal: json['viewTotal'],
|
||||
// joinTotal: json['joinTotal'],
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
class InterestsBean {
|
||||
List<Circle> lists;
|
||||
|
||||
@ -355,7 +562,10 @@ class DataModel {
|
||||
|
||||
int likeMeCount = 0;
|
||||
|
||||
DataModel({required this.visitCount, required this.lastVisitUsers, required this.likeMeCount});
|
||||
DataModel(
|
||||
{required this.visitCount,
|
||||
required this.lastVisitUsers,
|
||||
required this.likeMeCount});
|
||||
|
||||
factory DataModel.fromJson(Map<String, dynamic> json) {
|
||||
return DataModel(
|
||||
@ -366,8 +576,6 @@ class DataModel {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class Province {
|
||||
String name;
|
||||
List<CityBean> city;
|
||||
@ -408,3 +616,44 @@ class CityBean {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BannerItem {
|
||||
final String name;
|
||||
final int type;
|
||||
final String? param;
|
||||
final String scene;
|
||||
final String picUrl;
|
||||
|
||||
BannerItem({
|
||||
required this.name,
|
||||
required this.type,
|
||||
this.param,
|
||||
required this.scene,
|
||||
required this.picUrl,
|
||||
});
|
||||
|
||||
factory BannerItem.fromJson(Map<String, dynamic> json) {
|
||||
return BannerItem(
|
||||
name: json['name'],
|
||||
type: json['type'],
|
||||
param: json['param'],
|
||||
scene: json['scene'],
|
||||
picUrl: json['pic_url'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BannerList {
|
||||
final String city;
|
||||
final List<BannerItem> banners;
|
||||
|
||||
BannerList({required this.banners, required this.city});
|
||||
|
||||
factory BannerList.fromJson(Map<String, dynamic> json) {
|
||||
final bannerList = json['banners'] as List<dynamic>;
|
||||
final banners =
|
||||
bannerList.map((item) => BannerItem.fromJson(item)).toList();
|
||||
|
||||
return BannerList(banners: banners, city: json['city']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,7 +91,6 @@ class _CirclePageState extends State<CirclePage>
|
||||
]),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 45.sp),
|
||||
child: Expanded(
|
||||
child: PageView(
|
||||
controller: _pageController,
|
||||
onPageChanged: (index) {
|
||||
@ -104,7 +103,6 @@ class _CirclePageState extends State<CirclePage>
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
logic.isShowCircle
|
||||
? Positioned(
|
||||
bottom: 36.sp,
|
||||
@ -138,18 +136,18 @@ class _CirclePageState extends State<CirclePage>
|
||||
controller: logic.refreshController,
|
||||
onRefresh: _onRefresh,
|
||||
onLoading: _onLoading,
|
||||
enablePullUp: true,
|
||||
enablePullUp: logic.myVip>0,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.all(10.sp),
|
||||
itemCount: logic.myVip == 0 ? 5 + 2 : 10 + 1,
|
||||
itemCount: logic.myVip == 0 ? logic.vicinityList.length + 2 : logic.vicinityList.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
return bannerView(controller);
|
||||
} else {
|
||||
if (logic.myVip == 0 && index == 6) {
|
||||
if (logic.myVip == 0 && index == logic.vicinityList.length+1) {
|
||||
return showVipView();
|
||||
} else {
|
||||
return ListItem("", index);
|
||||
return ListItem(logic.vicinityList[index-1], index-1);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -160,7 +158,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
Widget showVipView() {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
color: Color(0xB30B011B),
|
||||
color: const Color(0xB30B011B),
|
||||
padding: EdgeInsets.symmetric(vertical: 14.sp, horizontal: 20.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
@ -212,8 +210,12 @@ class _CirclePageState extends State<CirclePage>
|
||||
));
|
||||
}
|
||||
|
||||
Widget ListItem(String item, int index) {
|
||||
return Container(
|
||||
Widget ListItem(VicinityItemBean item, int index) {
|
||||
return GestureDetector(
|
||||
onTap: (){
|
||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString());
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
// padding: EdgeInsets.only( left: 8.sp, right: 8.sp),
|
||||
width: Get.width,
|
||||
@ -233,12 +235,12 @@ class _CirclePageState extends State<CirclePage>
|
||||
topLeft: Radius.circular(10.sp),
|
||||
topRight: Radius.circular(10.sp),
|
||||
),
|
||||
child: Image(
|
||||
child: item.images.length==0? Image(
|
||||
image: AssetImage(getCircleImage("icon_list_null")),
|
||||
width: Get.width,
|
||||
fit: BoxFit.fill,
|
||||
height: 92.sp,
|
||||
),
|
||||
):Container(),
|
||||
),
|
||||
),
|
||||
Column(children: [
|
||||
@ -265,7 +267,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
padding: EdgeInsets.all(2.sp),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
child: Image.network(logic.bannerList[0],
|
||||
child: Image.network(item.avatarThumb,
|
||||
width: 88.sp, height: 88.sp, fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
@ -277,8 +279,13 @@ class _CirclePageState extends State<CirclePage>
|
||||
margin: EdgeInsets.only(top: 6.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
for (int i = 0; i < 5; i++)
|
||||
ListAlbumItem(logic.bannerList[0], i),
|
||||
for (int i = 0; i < item.images.length; i++)
|
||||
GestureDetector(
|
||||
onTap: (){
|
||||
Get.toNamed(AppRoutes.Swiper,
|
||||
arguments: {'imaglist': item.images, 'index': i});
|
||||
},
|
||||
child: ListAlbumItem(item.images[i], i)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -292,7 +299,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
"nickname",
|
||||
item.nickname,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: const Color.fromRGBO(247, 250, 250, 1.0),
|
||||
@ -300,17 +307,17 @@ class _CirclePageState extends State<CirclePage>
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8.sp),
|
||||
_buildInfoRow(),
|
||||
_buildInfoRow(item),
|
||||
const Spacer(),
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 8.sp),
|
||||
child: Text(
|
||||
child:item.isOnline==1? Text(
|
||||
"当前在线",
|
||||
style: TextStyle(
|
||||
color: const Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
):Container(),
|
||||
),
|
||||
|
||||
|
||||
@ -324,7 +331,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft, // 文本左对齐,垂直居中
|
||||
child: Text(
|
||||
"123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123",
|
||||
item.signature,
|
||||
maxLines: 2,
|
||||
style: TextStyle(color: Colors.white,fontSize: 14.sp),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@ -334,14 +341,17 @@ class _CirclePageState extends State<CirclePage>
|
||||
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 8.sp,right: 3.sp),
|
||||
child: _buildInterestsListView([Interest(id: 0,title: "圈子名称"),Interest(id: 0,title: "圈子名称"),Interest(id: 0,title: "圈子名称"),Interest(id: 0,title: "圈子名称"),Interest(id: 0,title: "圈子名称"),Interest(id: 0,title: "圈子名称")]))
|
||||
child: _buildInterestsListView(item.interests))
|
||||
]),
|
||||
],
|
||||
));
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInterestsListView(List<Interest> interests) {
|
||||
return SingleChildScrollView(
|
||||
return Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
children: [
|
||||
@ -391,12 +401,15 @@ class _CirclePageState extends State<CirclePage>
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Widget _buildInfoRow() {
|
||||
Widget _buildInfoRow(VicinityItemBean item) {
|
||||
String ageMsg = getAgeCOntent(item!.gender, item!.age,
|
||||
item!.role, item!.orientation);
|
||||
return Row(
|
||||
children: [
|
||||
Container(
|
||||
@ -418,7 +431,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
right: 10.sp,
|
||||
),
|
||||
child: Text(
|
||||
"agm",
|
||||
ageMsg,
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 10,
|
||||
@ -426,9 +439,9 @@ class _CirclePageState extends State<CirclePage>
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
// if (controller.isVip > 0)
|
||||
if (item.vip > 0)
|
||||
Image(
|
||||
image: AssetImage(getBaseImage(1 == 1 ? "vip" : 'year_vip')),
|
||||
image: AssetImage(getBaseImage(item.vip == 1 ? "vip" : 'year_vip')),
|
||||
width: 44.sp,
|
||||
height: 18.sp,
|
||||
),
|
||||
@ -439,25 +452,27 @@ class _CirclePageState extends State<CirclePage>
|
||||
Widget ListAlbumItem(String item, int index) {
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 2.sp),
|
||||
child: Image.network(item, width: 88.sp, height: 88.sp, fit: BoxFit.cover),
|
||||
child: CachedNetworkImage( width: 88.sp, height: 88.sp, fit: BoxFit.cover, imageUrl: item+"?imageView2/1/w/176/h/176/q/75",),
|
||||
);
|
||||
}
|
||||
|
||||
void _onRefresh() async {
|
||||
logic.page = 1;
|
||||
// logic.initList();
|
||||
logic.refreshController.refreshCompleted();
|
||||
logic.vicinityPage = 1;
|
||||
logic.offset = 0;
|
||||
logic.getNearByList();
|
||||
// logic.refreshController.refreshCompleted();
|
||||
|
||||
}
|
||||
// if (page == 1) {
|
||||
// refreshController.refreshCompleted();
|
||||
// } else {
|
||||
// refreshController.loadComplete();
|
||||
// }
|
||||
|
||||
void _onLoading() async {
|
||||
logic.page = logic.page + 1;
|
||||
if(logic.myVip>0){
|
||||
logic.vicinityPage = logic.vicinityPage + 1;
|
||||
//
|
||||
logic.getNearByList();
|
||||
}else{
|
||||
logic.refreshController.loadComplete();
|
||||
// logic.initList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Widget bannerView(CircleLogic controller) {
|
||||
@ -472,13 +487,19 @@ class _CirclePageState extends State<CirclePage>
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
// print(index);
|
||||
return GestureDetector(
|
||||
onTap: () async {},
|
||||
onTap: () async {
|
||||
print(logic.bannerList[index].param);
|
||||
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
|
||||
'title': "",
|
||||
"url": logic.bannerList[index].param.toString()
|
||||
});
|
||||
},
|
||||
child: SizedBox(
|
||||
width: Get.width,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(15.sp),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: logic.bannerList[index],
|
||||
imageUrl: logic.bannerList[index].picUrl,
|
||||
fit: BoxFit.fill,
|
||||
width: Get.width,
|
||||
),
|
||||
@ -502,8 +523,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
}
|
||||
|
||||
Widget circleList(CircleLogic controller) {
|
||||
return Expanded(
|
||||
child: Swiper(
|
||||
return Swiper(
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var bean = logic.circle.lists[index];
|
||||
// final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
|
||||
@ -524,7 +544,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
key: UniqueKey(),
|
||||
// pagination: new SwiperPagination(),//如果不填则不显示指示点
|
||||
// control: new SwiperControl(),//如果不填则不显示左右按钮
|
||||
));
|
||||
);
|
||||
}
|
||||
|
||||
Widget navigatorItem(DataModel statistics) {
|
||||
@ -739,7 +759,10 @@ class _CirclePageState extends State<CirclePage>
|
||||
genderList: logic.genderList,
|
||||
orientationList: logic.orientationList,
|
||||
roleList: logic.roleList,
|
||||
callback: (genderList, orientationList, roleList) {},
|
||||
callback: (genderList, orientationList, roleList) {
|
||||
logic.offset = 0;
|
||||
logic.getNearByList();
|
||||
},
|
||||
); // Use your custom widget here
|
||||
},
|
||||
);
|
||||
@ -972,14 +995,16 @@ class _CirclePageState extends State<CirclePage>
|
||||
|
||||
showCityPiker(context) {
|
||||
Pickers.showMultiLinkPicker(context,
|
||||
pickerStyle: DefaultPickerStyle.dark(), data: logic.cityMap, columeNum: 3,
|
||||
pickerStyle: DefaultPickerStyle.dark(), data: logic.cityMap, columeNum: 2,
|
||||
onConfirm: (List res, List<int> position){
|
||||
print(res);
|
||||
print(logic.cityMap[res[0]][res[1]][0]);
|
||||
// print(logic.cityMap[res[0]][res[1]][0]);
|
||||
// controller.state.city = controller.cityMap[res[0]][res[1]][0];
|
||||
// logic.state.city = res[1];
|
||||
logic.cityName = res[2];
|
||||
logic.update();
|
||||
logic.cityName = res[1];
|
||||
|
||||
logic.offset = 0;
|
||||
logic.getNearByList();
|
||||
// logic.getSuccess();
|
||||
// logic.update();
|
||||
}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -5,6 +7,7 @@ import 'package:get/get.dart';
|
||||
|
||||
import '../../common/Widgets/open_vip_tip/view.dart';
|
||||
import '../../util/device.dart';
|
||||
import '../../util/eventBus.dart';
|
||||
import '../../util/util.dart';
|
||||
import '../select_circle/logic.dart';
|
||||
|
||||
@ -41,9 +44,21 @@ class _ScreenBottomSheetDialogState extends State<ScreenBottomSheetDialog> {
|
||||
super.initState();
|
||||
initGerder();
|
||||
}
|
||||
|
||||
StreamSubscription? subscription = null;
|
||||
void initGerder() async {
|
||||
myVip = await getVip();
|
||||
subscription = EventBusManager.on<CommentVipEvent>().listen((event) {
|
||||
myVip = event.vip;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
if (null != subscription) {
|
||||
EventBusManager.cancelSubscription(subscription!);
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
@ -95,6 +110,7 @@ class _ScreenBottomSheetDialogState extends State<ScreenBottomSheetDialog> {
|
||||
onTap: (){
|
||||
|
||||
widget.callback([],[],[]);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(right: 16.sp),
|
||||
|
||||
@ -7,6 +7,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_swiper/flutter_swiper.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../util/eventBus.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class Open_vip_tipPage extends StatelessWidget {
|
||||
@ -71,6 +72,7 @@ class Open_vip_tipPage extends StatelessWidget {
|
||||
right: 12.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
// EventBusManager.fire(CommentVipEvent(1));
|
||||
Get.back();
|
||||
},
|
||||
child: Image.asset(
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
|
||||
|
||||
class Api {
|
||||
static const baseUrl = 'https://leyuan666.com/zuul-service/';
|
||||
// static const baseUrl = 'https://leyuan666.com/zuul-service/';
|
||||
|
||||
// static const baseUrl = 'http://192.168.3.55:2000/' ;
|
||||
static const baseUrl = 'http://192.168.3.55:2000/' ;
|
||||
|
||||
|
||||
// 获取验证码
|
||||
@ -192,12 +192,14 @@ class Api {
|
||||
|
||||
|
||||
|
||||
//附近banner
|
||||
static const getNearbyBeanner = 'user-service/nearby/banner';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//附近列表
|
||||
static const postNearbyList = 'user-service/nearby/queryNearByUserList';
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user