调整缘分匹配显示城市优先级,发送验证码成功提示文本
This commit is contained in:
parent
39cc3a830f
commit
b6cef16f35
@ -6,6 +6,7 @@ import 'package:circle_app/util/util.dart';
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter_native_splash/flutter_native_splash.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:get/get.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
@ -60,8 +61,9 @@ class LoginLogic extends GetxController {
|
|||||||
var data = await DioManager.instance.post(
|
var data = await DioManager.instance.post(
|
||||||
url: Api.sendCode, params: {"phone": phoneEditingController.text});
|
url: Api.sendCode, params: {"phone": phoneEditingController.text});
|
||||||
var bean = BaseResponse<Data>.fromJson(data, (data) => Data.fromJson(data));
|
var bean = BaseResponse<Data>.fromJson(data, (data) => Data.fromJson(data));
|
||||||
showOKToast(bean.msg);
|
|
||||||
if (bean.code == 200) {
|
if (bean.code == 200) {
|
||||||
|
showOKToast('发送成功!');
|
||||||
if (kDebugMode) {
|
if (kDebugMode) {
|
||||||
print("验证码:${bean.data!.code}");
|
print("验证码:${bean.data!.code}");
|
||||||
// codeEditingController.text = bean.data!.code.toString();
|
// codeEditingController.text = bean.data!.code.toString();
|
||||||
@ -77,6 +79,8 @@ class LoginLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
showOKToast(bean.msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,10 +104,12 @@ class LoginLogic extends GetxController {
|
|||||||
showOKToast('请勾选同意用户协议和隐私协议');
|
showOKToast('请勾选同意用户协议和隐私协议');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
SmartDialog.showLoading(msg: '正在登录中...');
|
||||||
var data = await DioManager.instance.post(url: Api.login, params: {
|
var data = await DioManager.instance.post(url: Api.login, params: {
|
||||||
"phone": phoneEditingController.text,
|
"phone": phoneEditingController.text,
|
||||||
"code": codeEditingController.text
|
"code": codeEditingController.text
|
||||||
});
|
});
|
||||||
|
SmartDialog.dismiss();
|
||||||
var bean = BaseResponse<LoginData>.fromJson(
|
var bean = BaseResponse<LoginData>.fromJson(
|
||||||
data, (data) => LoginData.fromJson(data));
|
data, (data) => LoginData.fromJson(data));
|
||||||
if (bean.code == 200) {
|
if (bean.code == 200) {
|
||||||
|
|||||||
@ -112,14 +112,9 @@ createCustomMsg(String userId, String imId) async {
|
|||||||
);
|
);
|
||||||
if (data['code'] == 200) {
|
if (data['code'] == 200) {
|
||||||
String desc = '';
|
String desc = '';
|
||||||
|
String cityStr = '';
|
||||||
Map<String, dynamic> info = {};
|
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) {
|
if (data['data']['both_interests'] != null) {
|
||||||
List<dynamic> both_interests = data['data']['both_interests'];
|
List<dynamic> both_interests = data['data']['both_interests'];
|
||||||
List<String> circleList = [];
|
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 (desc.isNotEmpty) {
|
||||||
if (data['data']['both_cities'] != null) {
|
if (data['data']['both_cities'] != null) {
|
||||||
info['city'] = desc;
|
info['city'] = cityStr;
|
||||||
}
|
}
|
||||||
info['interests'] = data['data']['interests'] ?? [];
|
info['interests'] = data['data']['interests'] ?? [];
|
||||||
info['guide_text'] = data['data']['guide_text'] ?? '';
|
info['guide_text'] = data['data']['guide_text'] ?? '';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user