修改发布喊话无法选择圈子问题

This commit is contained in:
yangyuhao 2023-09-07 17:17:59 +08:00
parent 8f6e0c5aab
commit c799e6702e
4 changed files with 31 additions and 19 deletions

View File

@ -54,7 +54,10 @@ class Call_outLogic extends GetxController {
if (myConfigData != null) { if (myConfigData != null) {
// print(myConfigData.name); // print(myConfigData.name);
numbers.addAll(myConfigData); numbers.addAll(myConfigData);
if(numbers.length>0){
circleName = numbers[0].name; circleName = numbers[0].name;
}
SharedPreferencesHelper.getInstance().then((sharedPreferences) { SharedPreferencesHelper.getInstance().then((sharedPreferences) {
vip = sharedPreferences.getInt(SharedPreferencesHelper.VIP); vip = sharedPreferences.getInt(SharedPreferencesHelper.VIP);
print(vip); print(vip);

View File

@ -17,6 +17,9 @@ class Select_circleLogic extends GetxController {
for (var entry in entries.asMap().entries) { for (var entry in entries.asMap().entries) {
MyConfigData bean = MyConfigData(entry.value.key, entry.value.value, false); MyConfigData bean = MyConfigData(entry.value.key, entry.value.value, false);
if(selectCircle.isEmpty){
arrList.add(bean);
}else{
selectCircle.forEach((element) { selectCircle.forEach((element) {
if(entry.value.key==element.id){ if(entry.value.key==element.id){
bean.isSelect = true; bean.isSelect = true;
@ -25,6 +28,8 @@ class Select_circleLogic extends GetxController {
arrList.add(bean); arrList.add(bean);
}); });
} }
}
}else{ }else{
interestMap.forEach((key, value) { interestMap.forEach((key, value) {
MyConfigData bean = MyConfigData(key, value, false); MyConfigData bean = MyConfigData(key, value, false);
@ -36,7 +41,7 @@ class Select_circleLogic extends GetxController {
arrList.add(bean); arrList.add(bean);
}); });
} }
print(arrList.length.toString());
update(); update();
} }

View File

@ -375,6 +375,17 @@ class MyTabbedScreenState extends State<UserinfoPage>
} }
Widget titleTab(UserinfoLogic controller) { Widget titleTab(UserinfoLogic controller) {
String buttonText = "";
if (controller.isMe) {
if (logic.isShowAlbum) {
buttonText = controller.isEdit ? "完成" : "管理";
} else {
buttonText = "发布喊话";
}
} else {
buttonText = controller.isUrgeStatus ? "已催更" : "催更";
}
return Container( return Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(horizontal: 10.sp), padding: EdgeInsets.symmetric(horizontal: 10.sp),
@ -414,7 +425,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
), ),
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): GestureDetector( logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): GestureDetector(
onTap: () { onTap: () {
if(!logic.isShowAlbum){ if(!logic.isShowAlbum&&controller.isMe){
List<MyConfigData> numbers = []; List<MyConfigData> numbers = [];
var data = Get.toNamed(AppRoutes.Call_out, arguments: {'numbers': numbers}); var data = Get.toNamed(AppRoutes.Call_out, arguments: {'numbers': numbers});
return ; return ;
@ -445,14 +456,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
horizontal: 12.sp, horizontal: 12.sp,
), ),
child: Text( child: Text(
logic.isShowAlbum? buttonText,
controller.isMe
? controller.isEdit
? "完成"
: "管理"
: controller.isUrgeStatus
? "已催更"
: "催更":"发布喊话",
style: const TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,
@ -523,7 +527,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
? controller.state.imaglist.length+1 ? controller.state.imaglist.length+1
: controller.state.imaglist.length , : controller.state.imaglist.length ,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
print("123123123123"); // print("123123123123");
if (controller.isMe ) { if (controller.isMe ) {
if (index == 0) { if (index == 0) {
return GestureDetector( return GestureDetector(

View File

@ -255,7 +255,7 @@ class DioManager {
// String? errorMsg = isNetworkConnected // String? errorMsg = isNetworkConnected
// ? e.requestOptions.extra["errorMsg"] // ? e.requestOptions.extra["errorMsg"]
// : "网络连接断开,请检查网络设置"; // : "网络连接断开,请检查网络设置";
return {'code': 500, 'msg': '加载中${e.message}'}; return {'code': 500, 'msg': '加载中'};
} catch (e) { } catch (e) {
// //
return {'code': 500, 'msg': '加载中...'}; return {'code': 500, 'msg': '加载中...'};