Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
YangYuhao 2023-07-10 09:23:57 +08:00
commit 998090ac78
4 changed files with 27 additions and 21 deletions

View File

@ -126,13 +126,14 @@ class _CirclePageState extends State<CirclePage>
),
);
}
if (logic.statistics != null) {
if (logic.statistics != null && widgets.isNotEmpty) {
widgets.add(Positioned(
left: 15.sp * urlList.length,
child: circleWidget(logic.statistics!['visit_count'].toString()),
),
);
}
return Container(
width: Get.width,
padding: EdgeInsets.only(left: 18.sp, right: 18.sp),

View File

@ -170,13 +170,22 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
}
void pushMsgPage(Lists bean, String cicleId) async {
if (widget.bean.is_limit) {
showJoinCiclePiker(cicleId,widget.bean.amount.toString(),widget.bean.oldAmount.toString(),2);
// if (widget.bean.is_limit) {
// showJoinCiclePiker(cicleId,widget.bean.amount.toString(),widget.bean.oldAmount.toString(),2);
// return;
// }
var sp = await SharedPreferencesHelper.getInstance();
String myUserId = sp.getMyUserId();
if (bean.user!.id.toString().contains(myUserId)) {
showToast('无法与自己私聊');
return;
}
// if ()
var data = await DioManager.instance.get(
url: "/up-service/callout/$circleId/chat",);
url: "/up-service/callout/${bean.id}/chat",);
if (data["code"] == 200) {
pushChatPage(data['data']['account_id'], bean.user!.nickname!);
}
@ -523,8 +532,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
left: 12.sp * index,
child: GestureDetector(
onTap: () {
pushOtherPeopleHomePage(element.id.toString());
// pushOtherPeopleHomePage(element.id.toString());
},
child: circleWidget(element.avatar!,element.id.toString(), width: 24),
),
@ -618,10 +626,10 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
),
GestureDetector(
onTap: () {
// if (widget.bean.is_limit) {
// showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1);
// return;
// }
if (widget.bean.is_limit) {
showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1);
return;
}
pushHomePage(lists, lists.id.toString());
},
child: ClipOval(
@ -843,11 +851,6 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
left: 12.sp * index,
child: GestureDetector(
onTap: () {
// if (widget.bean.is_limit) {
// showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1);
// return;
// }
// pushOtherPeopleHomePage(element.id.toString());
},
child: circleWidget(element.avatar!,element.id.toString(), width: 24),
),
@ -913,10 +916,10 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
),
GestureDetector(
onTap: () {
// if (widget.bean.is_limit) {
// showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1);
// return;
// }
if (widget.bean.is_limit) {
showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1);
return;
}
pushHomePage(
lists, widget.bean.id.toString());
},

View File

@ -203,7 +203,7 @@ class DioManager {
// json转model
String jsonStr = json.encode(response.data);
Map<String, dynamic> responseMap = json.decode(jsonStr);
if (responseMap["code"] == 5003) {
if (responseMap["code"] == 5003 || responseMap["code"] == 30003) {
pushLoginPage();
}
return responseMap;

View File

@ -52,7 +52,9 @@ class SharedPreferencesHelper {
return prefs?.getString(key) ?? '';
}
String getMyUserId() {
return preferences?.getInt(SharedPreferencesHelper.USERID).toString() ?? '';
}
bool? getBool(String key) {
final prefs = preferences;