调整缘分匹配显示城市优先级,发送验证码成功提示文本

This commit is contained in:
CYH 2023-08-14 10:07:16 +03:00
parent 39cc3a830f
commit b6cef16f35
2 changed files with 20 additions and 9 deletions

View File

@ -6,6 +6,7 @@ import 'package:circle_app/util/util.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart';
@ -60,8 +61,9 @@ class LoginLogic extends GetxController {
var data = await DioManager.instance.post(
url: Api.sendCode, params: {"phone": phoneEditingController.text});
var bean = BaseResponse<Data>.fromJson(data, (data) => Data.fromJson(data));
showOKToast(bean.msg);
if (bean.code == 200) {
showOKToast('发送成功!');
if (kDebugMode) {
print("验证码:${bean.data!.code}");
// codeEditingController.text = bean.data!.code.toString();
@ -77,6 +79,8 @@ class LoginLogic extends GetxController {
}
update();
});
} else {
showOKToast(bean.msg);
}
}
@ -100,10 +104,12 @@ class LoginLogic extends GetxController {
showOKToast('请勾选同意用户协议和隐私协议');
return;
}
SmartDialog.showLoading(msg: '正在登录中...');
var data = await DioManager.instance.post(url: Api.login, params: {
"phone": phoneEditingController.text,
"code": codeEditingController.text
});
SmartDialog.dismiss();
var bean = BaseResponse<LoginData>.fromJson(
data, (data) => LoginData.fromJson(data));
if (bean.code == 200) {

View File

@ -112,14 +112,9 @@ createCustomMsg(String userId, String imId) async {
);
if (data['code'] == 200) {
String desc = '';
String cityStr = '';
Map<String, dynamic> info = {};
if (data['data']['both_cities'] != null) {
List city = data['data']['both_cities'];
print('城市'+city.toString());
if (city.isNotEmpty) {
desc = '你们都在$city留下过足迹';
}
}
if (data['data']['both_interests'] != null) {
List<dynamic> both_interests = data['data']['both_interests'];
List<String> circleList = [];
@ -134,9 +129,19 @@ createCustomMsg(String userId, String imId) async {
}
}
}
if (data['data']['both_cities'] != null) {
List city = data['data']['both_cities'];
print('城市'+city.toString());
if (city.isNotEmpty) {
desc = '你们都在${city.length > 1 ? city.join(''): city.first}留下过足迹';
cityStr = '你们都在${city.length > 1 ? city.join(''): city.first}留下过足迹';
}
}
if (desc.isNotEmpty) {
if (data['data']['both_cities'] != null) {
info['city'] = desc;
info['city'] = cityStr;
}
info['interests'] = data['data']['interests'] ?? [];
info['guide_text'] = data['data']['guide_text'] ?? '';