Commit f0d1c0ef authored by 关振斌's avatar 关振斌

update

parent 3699105f
def localProperties = new Properties() def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties') def localPropertiesFile = rootProject.file('local.properties')
def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties() def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
if (localPropertiesFile.exists()) { if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader -> localPropertiesFile.withReader('UTF-8') { reader ->
...@@ -58,25 +60,38 @@ android { ...@@ -58,25 +60,38 @@ android {
versionName flutterVersionName versionName flutterVersionName
} }
signingConfigs { // signingConfigs {
release { // release {
keyAlias keystoreProperties['keyAlias'] // keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword'] // keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile']) // storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword'] // storePassword keystoreProperties['storePassword']
} // }
} // }
signingConfigs {
buildTypes { release {
release { keyAlias keystoreProperties['keyAlias']
signingConfig signingConfigs.debug keyPassword keystoreProperties['keyPassword']
// signingConfig signingConfigs.release //TODO storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
// TODO: Add your own signing config for the release build. storePassword keystoreProperties['storePassword']
// Signing with the debug keys for now, so `flutter run --release` works. }
// }
buildTypes {
release {
signingConfig signingConfigs.release
}
}
// buildTypes {
// // release {
// // signingConfig signingConfigs.debug
// // // signingConfig signingConfigs.release //TODO
// // // TODO: Add your own signing config for the release build.
// // // Signing with the debug keys for now, so `flutter run --release` works.
// // //
} // // }
} // }
} }
flutter { flutter {
......
buildscript { buildscript {
ext.kotlin_version = '1.6.10' ext.kotlin_version = '1.6.20'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
......
{ {
"images" : [ "images" : [
{ {
"filename" : "logo-removebg-preview (4) 1.png", "filename" : "launchimag.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "logo-removebg-preview (4) 2.png", "filename" : "launchimag2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "logo-removebg-preview (4).png", "filename" : "launchimag3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
...@@ -21,7 +21,9 @@ class UserStore extends GetxController { ...@@ -21,7 +21,9 @@ class UserStore extends GetxController {
// 令牌 token // 令牌 token
String token = ''; String token = '';
// 用户 profile // 用户 profile
final _profile = IntegralEntity(id: '', token: '', username: '').obs; final _profile = IntegralEntity(
id: '', token: '', username: '', integral: 0, expireTime: null)
.obs;
bool get isLogin => _isLogin.value; bool get isLogin => _isLogin.value;
IntegralEntity get profile => _profile.value; IntegralEntity get profile => _profile.value;
...@@ -34,8 +36,21 @@ class UserStore extends GetxController { ...@@ -34,8 +36,21 @@ class UserStore extends GetxController {
var profileOffline = StorageService.to.getString(STORAGE_USER_PROFILE_KEY); var profileOffline = StorageService.to.getString(STORAGE_USER_PROFILE_KEY);
if (profileOffline.isNotEmpty) { if (profileOffline.isNotEmpty) {
var l = jsonDecode(profileOffline); var l = jsonDecode(profileOffline);
Map<String, dynamic> map = json.decode(l);
_profile.value = _profile(IntegralEntity.fromMap(map)); final copiedMap = Map.from(l);
// Map<String, dynamic> map = json.decode(l);
copiedMap.update("expireTime",
(value) => value == null ? null : DateTime?.parse(value));
// copiedMap
final value = IntegralEntity(
expireTime: copiedMap['expireTime'],
id: copiedMap['id'],
token: copiedMap['token'],
username: copiedMap['username'],
integral: copiedMap['integral']);
_profile.value = _profile(value);
if (profile.id != '') { if (profile.id != '') {
_isLogin.value = true; _isLogin.value = true;
...@@ -49,8 +64,13 @@ class UserStore extends GetxController { ...@@ -49,8 +64,13 @@ class UserStore extends GetxController {
handleLogin(IntegralEntity res) async { handleLogin(IntegralEntity res) async {
await setToken(res.token); await setToken(res.token);
// IntegralEntity userInfo = await UserAPI.getUserIntegral(); // IntegralEntity userInfo = await UserAPI.getUserIntegral();
await getUserInfo( await getUserInfo(IntegralEntity(
IntegralEntity(id: res.id, username: res.username, token: res.token)); id: res.id,
username: res.username,
token: res.token,
integral: res.integral,
expireTime: res.expireTime,
));
_isLogin.value = true; _isLogin.value = true;
Get.back(); Get.back();
// Get.put(ApplicationController()); // Get.put(ApplicationController());
...@@ -59,7 +79,7 @@ class UserStore extends GetxController { ...@@ -59,7 +79,7 @@ class UserStore extends GetxController {
getUserInfo(IntegralEntity userInfo) async { getUserInfo(IntegralEntity userInfo) async {
await setToken(userInfo.token); await setToken(userInfo.token);
_profile.value = userInfo;
await saveProfile(userInfo); await saveProfile(userInfo);
// token = StorageService.to.getString(STORAGE_USER_TOKEN_KEY); // token = StorageService.to.getString(STORAGE_USER_TOKEN_KEY);
...@@ -95,7 +115,13 @@ class UserStore extends GetxController { ...@@ -95,7 +115,13 @@ class UserStore extends GetxController {
// 保存 profile // 保存 profile
Future<void> saveProfile(IntegralEntity profile) async { Future<void> saveProfile(IntegralEntity profile) async {
StorageService.to.setString(STORAGE_USER_PROFILE_KEY, jsonEncode(profile)); _profile.value = profile;
var copiedMap = Map.from(profile.toMap());
copiedMap.update("expireTime", (value) => value?.toIso8601String());
StorageService.to
.setString(STORAGE_USER_PROFILE_KEY, jsonEncode(copiedMap));
} }
// // 保存 profile // // 保存 profile
// Future<void> saveProfile(UserLoginResponseEntity profile) async { // Future<void> saveProfile(UserLoginResponseEntity profile) async {
...@@ -109,9 +135,8 @@ class UserStore extends GetxController { ...@@ -109,9 +135,8 @@ class UserStore extends GetxController {
await StorageService.to.remove(STORAGE_USER_TOKEN_KEY); await StorageService.to.remove(STORAGE_USER_TOKEN_KEY);
_isLogin.value = false; _isLogin.value = false;
token = ''; token = '';
saveProfile(IntegralEntity(
_profile.value = IntegralEntity(id: '', username: '', token: ''); id: '', username: '', token: '', expireTime: null, integral: 0));
saveProfile(IntegralEntity(id: '', username: '', token: ''));
Get.toNamed(AppRoutes.Application); Get.toNamed(AppRoutes.Application);
} }
} }
// baidu yapi // baidu yapi
// const SERVER_API_URL = 'https://yapi.baidu.com/mock/41008'; // const SERVER_API_URL = 'https://yapi.baidu.com/mock/41008';
// const SERVER_API_URL = 'https://yapi.ducafecat.tech/mock/11'; // const SERVER_API_URL = 'https://yapi.ducafecat.tech/mock/11';
const SERVER_API_URL = 'http://101.34.153.228:8083/api'; const SERVER_API_URL = 'http://101.34.153.228:8083/api';//线上
// const SERVER_API_URL = 'http://192.168.2.178:8083/api'; // const SERVER_API_URL = 'http://192.168.2.178:8083/api';
// const SERVER_API_URL = 'http://192.168.110.57:8083/api'; // const SERVER_API_URL = 'http://192.168.110.57:8083/api';
// //
......
...@@ -5,26 +5,42 @@ ...@@ -5,26 +5,42 @@
import 'dart:convert'; import 'dart:convert';
class LoginEntity { class LoginEntity {
LoginEntity({required this.username, required this.id, required this.token}); var expireTime;
LoginEntity(
{required this.username,
required this.id,
required this.integral,
required this.token,
this.expireTime});
final String username; final String username;
final int id; final int id;
final String token; final String token;
// final DateTime expireTime;
final int integral;
factory LoginEntity.fromJson(String str) => factory LoginEntity.fromJson(String str) =>
LoginEntity.fromMap(json.decode(str)); LoginEntity.fromMap(json.decode(str));
String toJson() => json.encode(toMap()); String toJson() => json.encode(toMap());
// jsonData['uploadedDate'] != null
// ? DateTime.parse(jsonData['uploadedDate'].toString()).toLocal()
// : null,
factory LoginEntity.fromMap(Map<String, dynamic> json) => LoginEntity( factory LoginEntity.fromMap(Map<String, dynamic> json) => LoginEntity(
username: json["username"], username: json["username"],
id: json["id"], id: json["id"],
token: json['token'], token: json['token'],
integral: json['integral'],
expireTime: json['expireTime'] != null
? DateTime.parse(json["expireTime"])
: null,
); );
Map<String, dynamic> toMap() => { Map<String, dynamic> toMap() => {
"username": username, "username": username,
"id": id, "id": id,
"token": token, "token": token,
"expireTime": expireTime,
"integral": integral
}; };
} }
...@@ -103,11 +103,19 @@ class UserEntity { ...@@ -103,11 +103,19 @@ class UserEntity {
class IntegralEntity { class IntegralEntity {
IntegralEntity( IntegralEntity(
{required this.id, required this.username, required this.token}); {required this.id,
required this.username,
required this.token,
required this.expireTime,
required this.integral});
final dynamic id; final dynamic id;
final String username; final String username;
final String token; final String token;
final dynamic expireTime;
final int integral;
// expireTime: res.expireTime,
// integral: res.integral
factory IntegralEntity.fromJson(String str) => factory IntegralEntity.fromJson(String str) =>
IntegralEntity.fromMap(json.decode(str)); IntegralEntity.fromMap(json.decode(str));
...@@ -115,10 +123,19 @@ class IntegralEntity { ...@@ -115,10 +123,19 @@ class IntegralEntity {
String toJson() => json.encode(toMap()); String toJson() => json.encode(toMap());
factory IntegralEntity.fromMap(Map<String, dynamic> json) => IntegralEntity( factory IntegralEntity.fromMap(Map<String, dynamic> json) => IntegralEntity(
id: json["id"], username: json["username"], token: json['token']); id: json["id"],
username: json["username"],
token: json['token'],
integral: json['integral'],
expireTime: DateTime.parse(json["expireTime"]));
Map<String, dynamic> toMap() => Map<String, dynamic> toMap() => {
{"id": id, "username": username, "token": token}; "id": id,
"username": username,
"token": token,
"integral": integral,
"expireTime": expireTime
};
} }
// To parse this JSON data, do // To parse this JSON data, do
......
...@@ -79,7 +79,6 @@ class PayListController extends GetxController { ...@@ -79,7 +79,6 @@ class PayListController extends GetxController {
_purchaseUpdatedSubscription = _purchaseUpdatedSubscription =
FlutterInappPurchase.purchaseUpdated.listen((productItem) async { FlutterInappPurchase.purchaseUpdated.listen((productItem) async {
print("支付1次");
ApplePayEntity? res = await UserAPI.notifyApplePay({ ApplePayEntity? res = await UserAPI.notifyApplePay({
'receipt': productItem?.transactionReceipt, 'receipt': productItem?.transactionReceipt,
'userId': UserStore.to.profile.id, 'userId': UserStore.to.profile.id,
...@@ -91,8 +90,23 @@ class PayListController extends GetxController { ...@@ -91,8 +90,23 @@ class PayListController extends GetxController {
EasyLoading.showSuccess('${res?.message}'); EasyLoading.showSuccess('${res?.message}');
Vibrate.feedback(FeedbackType.success); Vibrate.feedback(FeedbackType.success);
EasyLoading.dismiss(); EasyLoading.dismiss();
// equired this.id,
// required this.username,
// required this.token,
// required this.expireTime,
// required this.integral
// DateTime.parse(json["expireTime"]))
await UserStore.to.saveProfile(IntegralEntity(
expireTime: res.data['expireTime'] == null
? null
: DateTime.parse(res.data["expireTime"]),
username: res.data['username'],
id: res.data['id'],
integral: res.data['integral'],
token: UserStore.to.token));
Get.back(); Get.back();
await FlutterInappPurchase.instance.clearTransactionIOS();
// Get.offAndToNamed(AppRoutes.Application); // Get.offAndToNamed(AppRoutes.Application);
// Get.put(ApplicationController()); // Get.put(ApplicationController());
} else { } else {
......
...@@ -10,6 +10,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; ...@@ -10,6 +10,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart'; import 'package:glassmorphism/glassmorphism.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
// import 'package:markdown_widget/markdown_widget.dart';
import 'index.dart'; import 'index.dart';
import 'widgets/widgets.dart'; import 'widgets/widgets.dart';
...@@ -168,14 +170,15 @@ class ProductPage extends GetView<ProductController> { ...@@ -168,14 +170,15 @@ class ProductPage extends GetView<ProductController> {
) )
], ],
) )
: Text( : Markdown(data: "${idx.text}");
"${idx.text}", // Text(
style: TextStyle( // "${idx.text}",
fontSize: 18, // style: TextStyle(
color: Colors.white, // fontSize: 18,
// fontWeight: FontWeight.bold // color: Colors.white,
), // // fontWeight: FontWeight.bold
); // ),
// );
return text; return text;
}).toList(), }).toList(),
......
...@@ -11,6 +11,7 @@ import 'package:chart/common/widgets/widgets.dart'; ...@@ -11,6 +11,7 @@ import 'package:chart/common/widgets/widgets.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:social_login_buttons/social_login_buttons.dart'; import 'package:social_login_buttons/social_login_buttons.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
// import 'package:fluwx/fluwx.dart';
import '../../../entity/login_entity.dart'; import '../../../entity/login_entity.dart';
import '../../../entity/user_entity.dart'; import '../../../entity/user_entity.dart';
...@@ -46,6 +47,10 @@ class SignInController extends GetxController { ...@@ -46,6 +47,10 @@ class SignInController extends GetxController {
// 密码的控制器 // 密码的控制器
final TextEditingController passController = TextEditingController(); final TextEditingController passController = TextEditingController();
// final a = registerWxApi(
// appId: "wxd930ea5d5a228f5f",
// universalLink: "https://your.univerallink.com/link/");
// print("aaaa");
// final MyRepository repository; // final MyRepository repository;
// SignInController({@required this.repository}) : assert(repository != null); // SignInController({@required this.repository}) : assert(repository != null);
...@@ -69,26 +74,50 @@ class SignInController extends GetxController { ...@@ -69,26 +74,50 @@ class SignInController extends GetxController {
EasyLoading.show(status: '登录中...'); EasyLoading.show(status: '登录中...');
// Map<String, dynamic> routeParams = // Map<String, dynamic> routeParams =
// ModalRoute.of(context)!.settings?.arguments as Map<String, dynamic>; // ModalRoute.of(context)!.settings?.arguments as Map<String, dynamic>;
// final DateTime expireTime;
// final int integral;
try { try {
LoginEntity? res = await UserAPI.login({ LoginEntity? res = await UserAPI.login({
"smsCode": codeController.text, "smsCode": codeController.text,
"phone": mobileMemberController.text, "phone": mobileMemberController.text,
// "id": UserStore.to.profile.id, // "id": UserStore.to.profile.id,
}); });
Vibrate.feedback(FeedbackType.success);
EasyLoading.showSuccess("登录成功");
if (res?.token != null) {
// UserStore.to.handleLogin(res);
EasyLoading.showSuccess("登录成功!");
// Navigator.of(context).pushNamed('/');
} else {
EasyLoading.showError("登录失败");
}
EasyLoading.dismiss(); EasyLoading.dismiss();
UserStore.to.handleLogin(IntegralEntity(
id: res.id,
username: res.username,
token: res.token,
expireTime: res.expireTime,
integral: res.integral));
// appLogin
} catch (e) { } catch (e) {
Vibrate.feedback(FeedbackType.error);
EasyLoading.showError("登录失败"); EasyLoading.showError("登录失败");
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
// try {
// LoginEntity? res = await UserAPI.login({
// "smsCode": codeController.text,
// "phone": mobileMemberController.text,
// // "id": UserStore.to.profile.id,
// });
// if (res?.token != null) {
// // UserStore.to.handleLogin(res);
// EasyLoading.showSuccess("登录成功!");
// // Navigator.of(context).pushNamed('/');
// } else {
// EasyLoading.showError("登录失败");
// }
// EasyLoading.dismiss();
// } catch (e) {
// EasyLoading.showError("登录失败");
// EasyLoading.dismiss();
// }
// UserLoginRequestEntity params = UserLoginRequestEntity( // UserLoginRequestEntity params = UserLoginRequestEntity(
// email: emailController.value.text, // email: emailController.value.text,
...@@ -232,8 +261,12 @@ class SignInController extends GetxController { ...@@ -232,8 +261,12 @@ class SignInController extends GetxController {
EasyLoading.showSuccess("登录成功"); EasyLoading.showSuccess("登录成功");
EasyLoading.dismiss(); EasyLoading.dismiss();
UserStore.to.handleLogin( UserStore.to.handleLogin(IntegralEntity(
IntegralEntity(id: res.id, username: res.username, token: res.token)); id: res.id,
username: res.username,
token: res.token,
expireTime: res.expireTime,
integral: res.integral));
// appLogin // appLogin
} catch (e) { } catch (e) {
......
import 'dart:io';
import 'package:chart/common/routers/routes.dart'; import 'package:chart/common/routers/routes.dart';
import 'package:chart/pages/application/index.dart'; import 'package:chart/pages/application/index.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
...@@ -8,6 +10,7 @@ import 'package:flutter/services.dart'; ...@@ -8,6 +10,7 @@ import 'package:flutter/services.dart';
// import 'package:flutter_icons/flutter_icons.dart'; // import 'package:flutter_icons/flutter_icons.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:social_login_buttons/social_login_buttons.dart'; import 'package:social_login_buttons/social_login_buttons.dart';
import 'index.dart'; import 'index.dart';
...@@ -96,115 +99,144 @@ class SignInPage extends GetView<SignInController> { ...@@ -96,115 +99,144 @@ class SignInPage extends GetView<SignInController> {
// 登录表单 // 登录表单
Widget _buildInputForm() { Widget _buildInputForm() {
return Container( return GlassmorphicContainer(
width: 295.w, height: 280,
// height: 204, width: double.infinity,
margin: EdgeInsets.only(top: 49.h), // flex: 1,
child: Column( borderRadius: 16,
children: [ padding: EdgeInsets.only(bottom: 16),
// email input blur: 14,
inputTextEdit( alignment: Alignment.bottomCenter,
controller: controller.mobileMemberController, border: 2,
keyboardType: TextInputType.phone, linearGradient: LinearGradient(
hintText: "手机号", begin: Alignment.topLeft,
marginTop: 0, end: Alignment.bottomRight,
// autofocus: true, colors: [
), Color(0xFF0FFFF).withOpacity(0.2),
// password input Color(0xFF0FFFF).withOpacity(0.2),
inputTextEdit( ],
controller: controller.codeController, ),
keyboardType: TextInputType.number, margin: EdgeInsets.only(bottom: 16.h),
hintText: "验证码", borderGradient: LinearGradient(
suffixIcon: InkWell( begin: Alignment.topLeft,
onTap: () => controller.chageCodeStatus(), end: Alignment.bottomRight,
child: Obx(() => Container( colors: [
// height: 20, Color(0xFF0FFFF).withOpacity(1),
width: 100, Color(0xFFFFFFF),
// padding: EdgeInsets.all(5.0), Color(0xFF0FFFF).withOpacity(1),
decoration: BoxDecoration( ],
// color: Colors.red, ),
// border: Border.all(
// color: controller.codeEnable.value child: Container(
// ? Color(0xFF0165B8) width: 295.w,
// : Colors.white), // height: 204,
), margin: EdgeInsets.only(top: 49.h),
child: Center( child: Column(
child: Text( children: [
controller.verifyStr.value, // email input
style: TextStyle( inputTextEdit(
color: controller.codeEnable.value controller: controller.mobileMemberController,
? Color(0xFF0165B8) keyboardType: TextInputType.phone,
: Color(0xFFACB1B6)), hintText: "手机号",
marginTop: 0,
// autofocus: true,
),
// password input
inputTextEdit(
controller: controller.codeController,
keyboardType: TextInputType.number,
hintText: "验证码",
suffixIcon: InkWell(
onTap: () => controller.chageCodeStatus(),
child: Obx(() => Container(
// height: 20,
width: 100,
// padding: EdgeInsets.all(5.0),
decoration: BoxDecoration(
// color: Colors.red,
// border: Border.all(
// color: controller.codeEnable.value
// ? Color(0xFF0165B8)
// : Colors.white),
),
child: Center(
child: Text(
controller.verifyStr.value,
style: TextStyle(
color: controller.codeEnable.value
? Color(0xFF0165B8)
: Color(0xFFACB1B6)),
)),
)), )),
)), ),
// isPassword: true,
), ),
// isPassword: true, // TextFormField(
), // controller: controller.mobileMemberController,
// TextFormField( // inputFormatters: <TextInputFormatter>[
// controller: controller.mobileMemberController, // LengthLimitingTextInputFormatter(11)
// inputFormatters: <TextInputFormatter>[ // ],
// LengthLimitingTextInputFormatter(11) // textInputAction: TextInputAction.next,
// ], // keyboardType: TextInputType.number,
// textInputAction: TextInputAction.next, // decoration: InputDecoration(
// keyboardType: TextInputType.number, // labelText: '请输入手机号',
// decoration: InputDecoration( // labelStyle: TextStyle(color: Color(0xFF898E92)),
// labelText: '请输入手机号', // enabledBorder: InputBorder.none,
// labelStyle: TextStyle(color: Color(0xFF898E92)), // focusedBorder: InputBorder.none,
// enabledBorder: InputBorder.none, // suffixIcon: Obx(() => Visibility(
// focusedBorder: InputBorder.none, // visible: controller.showClear.value,
// suffixIcon: Obx(() => Visibility( // child: IconButton(
// visible: controller.showClear.value, // icon: Icon(
// child: IconButton( // Icons.add,
// icon: Icon( // color: Color(0xFFCBD0D4),
// Icons.add, // ),
// color: Color(0xFFCBD0D4), // onPressed: controller.clearField))))),
// ),
// onPressed: controller.clearField))))),
// SocialLoginButton(
// backgroundColor: Colors.amber,
// height: 50,
// text: 'SignIn',
// borderRadius: 20,
// fontSize: 25,
// buttonType: SocialLoginButtonType.generalLogin,
// imageWidth: 20,
// // imagepath: "assets/file.png",
// imageURL: "URL",
// onPressed: () {},
// ),
// 注册、登录 横向布局
// Container(
// height: 44.h,
// margin: EdgeInsets.only(top: 15.h),
// child: btnFlatButtonWidget(
// onPressed: controller.signInWithApple,
// // controller.handleSignIn,
// gbColor: AppColors.primaryElement,
// title: "登录",
// ),
// ),
// Spacer(),
// Fogot password // SocialLoginButton(
Padding( // backgroundColor: Colors.amber,
padding: EdgeInsets.only(top: 8.0), // height: 50,
child: TextButton( // text: 'SignIn',
onPressed: controller.handleFogotPassword, // borderRadius: 20,
child: Text( // fontSize: 25,
"忘记密码", // buttonType: SocialLoginButtonType.generalLogin,
textAlign: TextAlign.center, // imageWidth: 20,
style: TextStyle( // // imagepath: "assets/file.png",
color: AppColors.secondaryElementText, // imageURL: "URL",
fontFamily: "Avenir", // onPressed: () {},
fontWeight: FontWeight.w400, // ),
fontSize: 16.sp, // 注册、登录 横向布局
height: 1, // 设置下行高,否则字体下沉 Container(
), height: 44.h,
margin: EdgeInsets.only(top: 15.h),
child: btnFlatButtonWidget(
onPressed: controller.handleSignIn,
// controller.handleSignIn,
gbColor: AppColors.primaryElement,
title: "登录",
), ),
), ),
), // Spacer(),
],
// Fogot password
// Padding(
// padding: EdgeInsets.only(top: 8.0),
// child: TextButton(
// onPressed: controller.handleFogotPassword,
// child: Text(
// "忘记密码",
// textAlign: TextAlign.center,
// style: TextStyle(
// color: AppColors.secondaryElementText,
// fontFamily: "Avenir",
// fontWeight: FontWeight.w400,
// fontSize: 16.sp,
// height: 1, // 设置下行高,否则字体下沉
// ),
// ),
// ),
// ),
],
),
), ),
); );
} }
...@@ -277,155 +309,180 @@ class SignInPage extends GetView<SignInController> { ...@@ -277,155 +309,180 @@ class SignInPage extends GetView<SignInController> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
body: Container( body: Platform.isIOS
width: double.infinity, ? Container(
height: double.infinity, width: double.infinity,
// ignore: sort_child_properties_last height: double.infinity,
child: Column( // ignore: sort_child_properties_last
children: [ child: Column(
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
_buildLogo(), Expanded(
],
)),
Expanded(
child: Center(
child: Padding(
padding: EdgeInsets.only(top: 90),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
SocialLoginButton( _buildLogo(),
text: "通过 Apple 登录", ],
buttonType: SocialLoginButtonType.apple, )),
onPressed: () { Expanded(
Get.bottomSheet( child: Center(
Container( child: Padding(
padding: EdgeInsets.all(14), padding: EdgeInsets.only(top: 90),
decoration: BoxDecoration( child: Column(
// topLeft: Radius.circular(30), topRight: Radius.circular(30))) mainAxisAlignment: MainAxisAlignment.center,
borderRadius: BorderRadius.only( children: [
topLeft: Radius.circular(15), SocialLoginButton(
topRight: Radius.circular(15)), text: "通过 Apple 登录",
color: Colors.white, buttonType: SocialLoginButtonType.apple,
), onPressed: () {
height: 260, Get.bottomSheet(
child: Column(children: [ Container(
Text( padding: EdgeInsets.all(14),
"请阅读并同意以下条款", decoration: BoxDecoration(
style: TextStyle( // topLeft: Radius.circular(30), topRight: Radius.circular(30)))
fontSize: 16, borderRadius: BorderRadius.only(
fontWeight: FontWeight.bold), topLeft: Radius.circular(15),
), topRight: Radius.circular(15)),
SizedBox( color: Colors.white,
height: 20,
),
Padding(
padding:
EdgeInsets.symmetric(vertical: 20),
child: RichText(
text: TextSpan(
style: DefaultTextStyle.of(context)
.style,
children: [
TextSpan(
text: '《用户协议》',
recognizer:
TapGestureRecognizer()
..onTap = () {
Get.toNamed(AppRoutes
.USER_PRIVACT);
},
style: TextStyle(
fontWeight:
FontWeight.bold,
color: AppColors
.primaryElement)),
TextSpan(
text: '《隐私权限》',
recognizer:
TapGestureRecognizer()
..onTap = () {
Get.toNamed(AppRoutes
.PRIVACT);
},
style: TextStyle(
fontWeight:
FontWeight.bold,
color: AppColors
.primaryElement)),
],
),
), ),
height: 260,
child: Column(children: [
Text(
"请阅读并同意以下条款",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold),
),
SizedBox(
height: 20,
),
Padding(
padding: EdgeInsets.symmetric(
vertical: 20),
child: RichText(
text: TextSpan(
style:
DefaultTextStyle.of(context)
.style,
children: [
TextSpan(
text: '《用户协议》',
recognizer:
TapGestureRecognizer()
..onTap = () {
Get.toNamed(AppRoutes
.USER_PRIVACT);
},
style: TextStyle(
fontWeight:
FontWeight.bold,
color: AppColors
.primaryElement)),
TextSpan(
text: '《隐私权限》',
recognizer:
TapGestureRecognizer()
..onTap = () {
Get.toNamed(
AppRoutes
.PRIVACT);
},
style: TextStyle(
fontWeight:
FontWeight.bold,
color: AppColors
.primaryElement)),
],
),
),
),
SizedBox(
height: 20,
),
btnFlatButtonWidget(
onPressed: () {
Get.back();
controller.signInWithApple();
},
width: 294,
gbColor: AppColors.primaryElement,
fontColor:
AppColors.primaryBackground,
title: "同意并登录",
fontWeight: FontWeight.w500,
fontSize: 16,
)
// Text(
// "请阅读并同意以下条款",
// style: TextStyle(
// fontSize: 16,
// color: Colors.blue[900],
// fontWeight: FontWeight.bold),
// ),
]),
), ),
SizedBox( // backgroundColor: Colors.white,
height: 20, );
), // controller.signInWithApple
btnFlatButtonWidget( },
onPressed: () { ),
Get.back();
controller.signInWithApple();
},
width: 294,
gbColor: AppColors.primaryElement,
fontColor: AppColors.primaryBackground,
title: "同意并继续",
fontWeight: FontWeight.w500,
fontSize: 16,
)
// Text(
// "请阅读并同意以下条款",
// style: TextStyle(
// fontSize: 16,
// color: Colors.blue[900],
// fontWeight: FontWeight.bold),
// ),
]),
),
// backgroundColor: Colors.white,
);
// controller.signInWithApple
},
),
SizedBox(
height: 20,
),
SocialLoginButton(
text: "不登录使用",
buttonType: SocialLoginButtonType.generalLogin,
backgroundColor: AppColors.thirdElement,
onPressed: () async {
Get.back();
}),
// Get.put(ApplicationController());
// await Get.offAndToNamed(
// AppRoutes.Application);
// }),
],
)),
),
)
],
),
padding: EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/bg2.png").image,
fit: BoxFit.cover),
))
// child: Column(
// children: <Widget>[
// _buildLogo(),
// _buildInputForm(),
// Spacer(),
// _buildThirdPartyLogin(),
// // _buildSignupButton(),
// ],
// ),
); SizedBox(
height: 20,
),
SocialLoginButton(
text: "不登录使用",
buttonType:
SocialLoginButtonType.generalLogin,
backgroundColor: AppColors.thirdElement,
onPressed: () async {
Get.back();
}),
// Get.put(ApplicationController());
// await Get.offAndToNamed(
// AppRoutes.Application);
// }),
// SizedBox(
// height: 20,
// ),
// SocialLoginButton(
// text: "微信登录",
// buttonType:
// SocialLoginButtonType.generalLogin,
// backgroundColor: AppColors.thirdElement,
// onPressed: () async {
// Get.back();
// }),
],
)),
),
)
],
),
padding: EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/bg2.png").image,
fit: BoxFit.cover),
))
: Container(
padding: EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/bg2.png").image,
fit: BoxFit.cover),
),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_buildInputForm(),
// _buildLogo(),
// _buildInputForm(),
// Spacer(),
// _buildThirdPartyLogin(),
// _buildSignupButton(),
],
)),
));
} }
} }
...@@ -66,126 +66,127 @@ class SiperBannerWidget extends GetView<MainController> { ...@@ -66,126 +66,127 @@ class SiperBannerWidget extends GetView<MainController> {
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
child: GlassmorphicContainer( child: GlassmorphicContainer(
borderRadius: 16, borderRadius: 16,
padding: EdgeInsets.only(bottom: 16), padding: EdgeInsets.only(bottom: 16),
blur: 14, blur: 14,
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
border: 2, border: 2,
linearGradient: LinearGradient( linearGradient: LinearGradient(
begin: Alignment.topLeft, begin: Alignment.topLeft,
end: Alignment.bottomRight, end: Alignment.bottomRight,
colors: [ colors: [
Color(0xFF0FFFF).withOpacity(0.2), Color(0xFF0FFFF).withOpacity(0.2),
Color(0xFF0FFFF).withOpacity(0.2), Color(0xFF0FFFF).withOpacity(0.2),
], ],
), ),
borderGradient: LinearGradient( borderGradient: LinearGradient(
begin: Alignment.topLeft, begin: Alignment.topLeft,
end: Alignment.bottomRight, end: Alignment.bottomRight,
colors: [ colors: [
Color(0xFF0FFFF).withOpacity(1), Color(0xFF0FFFF).withOpacity(1),
Color(0xFFFFFFF), Color(0xFFFFFFF),
Color(0xFF0FFFF).withOpacity(1), Color(0xFF0FFFF).withOpacity(1),
], ],
), ),
height: 70, height: 70,
width: double.infinity, width: Get.mediaQuery.size.width,
child: Padding( child: Container(
padding: const EdgeInsets.symmetric(horizontal: 14), padding: EdgeInsets.symmetric(horizontal: 16),
child: GestureDetector( child: GestureDetector(
// onTap: () => { onTap: () {
// // Navigator.of(context).pushNamed("/chat", Vibrate.feedback(FeedbackType.impact);
// // arguments: {"question": message.question}) // message.question
Chat.ChatUser _user = Chat.ChatUser(
// // Navigator.push(context, MaterialPageRoute(builder: (context) { id: '1',
// // return ChatPage(); // firstName: 'Charles',
// // })) // lastName: 'Leclerc',
// // Navigator.of(context).pop({'id': "1"}) );
// // print("${message.question}")
// },
child: InkWell(
onTap: () {
Vibrate.feedback(FeedbackType.impact);
// message.question
Chat.ChatUser _user = Chat.ChatUser(
id: '1',
// firstName: 'Charles',
// lastName: 'Leclerc',
);
Get.toNamed(
"${AppRoutes.CHAT_PAGE}?question=${message.question}");
c.sendMessage(Chat.ChatMessage( Get.toNamed(
text: "${message.question}", "${AppRoutes.CHAT_PAGE}?question=${message.question}");
user: _user,
createdAt: DateTime.now(),
));
},
child: Row(
children: [
Container(
padding: const EdgeInsets.all(14),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
kCategoriesPrimaryColor[index],
kCategoriesSecondryColor[index],
],
),
borderRadius: BorderRadius.circular(16)),
child: const Icon(
Icons.headset_mic,
size: 20,
color: Colors.white,
),
),
const SizedBox(width: 11),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 15),
Text(
message.question,
// ignore: prefer_const_constructors
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Colors.white),
),
const SizedBox(height: 5),
Expanded(
child: SizedBox(
width: 200,
child: Text(
message.resp,
maxLines: 1,
// ignore: prefer_const_constructors
style: TextStyle(
fontSize: 14,
decoration: TextDecoration.none,
color: Colors.white,
),
overflow: TextOverflow.ellipsis, c.sendMessage(Chat.ChatMessage(
// softWrap: true, text: "${message.question}",
// textAlign: TextAlign.left, user: _user,
// overflow: TextOverflow.ellipsis, createdAt: DateTime.now(),
// maxLines: 1, ));
// style: TextStyle( },
// color: Colors.black.withOpacity(0.48), fontSize: 12), // child: Expanded(
)), // child: Row(
), // mainAxisAlignment: MainAxisAlignment.center,
], // children: [
), // Container(
], // padding: const EdgeInsets.all(14),
), // margin: const EdgeInsets.only(right: 14),
), // decoration: BoxDecoration(
)), // gradient: LinearGradient(
), // begin: Alignment.topLeft,
// end: Alignment.bottomRight,
// colors: [
// kCategoriesPrimaryColor[index],
// kCategoriesSecondryColor[index],
// ],
// ),
// borderRadius: BorderRadius.circular(16)),
// child: const Icon(
// Icons.headset_mic,
// size: 20,
// color: Colors.white,
// ),
// ),
// Expanded(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// SizedBox(
// height: 10,
// ),
// Expanded(
// child: Container(
// padding: const EdgeInsets.only(right: 10),
// child: Text(
// message.question,
// softWrap: true,
// textAlign: TextAlign.left,
// overflow: TextOverflow.ellipsis,
// // ignore: prefer_const_constructors
// style: TextStyle(
// fontSize: 14,
// fontWeight: FontWeight.bold,
// color: Colors.white),
// ),
// )),
// Expanded(
// child: SizedBox(
// child: Text(
// message.resp,
// softWrap: true,
// textAlign: TextAlign.left,
// overflow: TextOverflow.ellipsis,
// maxLines: 1,
// // ignore: prefer_const_constructors
// style: TextStyle(
// fontSize: 14,
// decoration: TextDecoration.none,
// color: Colors.white,
// ),
// // softWrap: true,
// // textAlign: TextAlign.left,
// // overflow: TextOverflow.ellipsis,
// // maxLines: 1,
// // style: TextStyle(
// // color: Colors.black.withOpacity(0.48), fontSize: 12),
// )),
// ),
// ],
// ),
// )
// ],
// ),
// ),
),
)),
); );
} }
} }
......
...@@ -101,7 +101,7 @@ class UserDetailPage extends GetView<UserDetailController> { ...@@ -101,7 +101,7 @@ class UserDetailPage extends GetView<UserDetailController> {
height: 1.5, height: 1.5,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
margin: EdgeInsets.only(right: 16), // margin: EdgeInsets.only(right: 16),
)), )),
Container( Container(
width: 60, width: 60,
...@@ -116,70 +116,98 @@ class UserDetailPage extends GetView<UserDetailController> { ...@@ -116,70 +116,98 @@ class UserDetailPage extends GetView<UserDetailController> {
), ),
) )
]), ]),
Row(children: [ Row(
Container( mainAxisAlignment: MainAxisAlignment.center,
// width: 80, children: [
height: 25, Obx(() => Container(
padding: EdgeInsets.symmetric( // width: 80,
horizontal: 10, vertical: 4), // height: 25,
margin: EdgeInsets.only(top: 16), padding: EdgeInsets.symmetric(
decoration: BoxDecoration( horizontal: 10, vertical: 4),
// rgba(233, 234, 244, 1.00) margin: EdgeInsets.only(top: 16),
color: Color.fromRGBO(255, 255, 255, .2), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20), // rgba(233, 234, 244, 1.00)
// image: DecorationImage(
// image: Image.asset("assets/images/vip6.png")
// .image,
// fit: BoxFit.contain),
),
child: Row(children: [
Image.asset(
"assets/images/jifen.png",
fit: BoxFit.cover,
),
Container(
margin: EdgeInsets.only(left: 5),
child: Text(
"100",
style: TextStyle(
color:
Color.fromRGBO(255, 255, 255, 1)),
),
)
]),
),
Container(
// width: 80,
height: 25,
padding: EdgeInsets.symmetric(
horizontal: 10, vertical: 4),
margin: EdgeInsets.only(top: 16, left: 16),
decoration: BoxDecoration(
// rgba(233, 234, 244, 1.00)
color: Color.fromRGBO(255, 255, 255, .2),
borderRadius: BorderRadius.circular(20),
// image: DecorationImage(
// image: Image.asset("assets/images/vip6.png")
// .image,
// fit: BoxFit.contain),
),
child: Row(children: [
Image.asset(
"assets/images/jifen1.png",
fit: BoxFit.cover,
),
Container(
margin: EdgeInsets.only(left: 5),
child: Text(
"300",
style: TextStyle(
color: color:
Color.fromRGBO(255, 255, 255, 1)), Color.fromRGBO(255, 255, 255, .2),
), borderRadius: BorderRadius.circular(20),
) // image: DecorationImage(
]), // image: Image.asset("assets/images/vip6.png")
) // .image,
]) // fit: BoxFit.contain),
),
child: c.profile.expireTime != null
? Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Image.asset(
"assets/images/jifen.png",
fit: BoxFit.cover,
height: 20,
),
Text(
"会员日期至:${c.profile.expireTime.year}-${c.profile.expireTime.month}-${c.profile.expireTime.day}",
style: TextStyle(
color: Color.fromRGBO(
255, 255, 255, 1)),
)
],
)
: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Image.asset(
"assets/images/jifen1.png",
fit: BoxFit.cover,
height: 20,
),
Text(
"积分剩余:",
style: TextStyle(
color: Color.fromRGBO(
255, 255, 255, 1)),
),
Text(
"${c.profile.integral}",
style: TextStyle(
color: Color.fromRGBO(
255, 255, 255, 1)),
),
]),
)),
// Container(
// // width: 80,
// height: 25,
// padding: EdgeInsets.symmetric(
// horizontal: 10, vertical: 4),
// margin: EdgeInsets.only(top: 16, left: 16),
// decoration: BoxDecoration(
// // rgba(233, 234, 244, 1.00)
// color: Color.fromRGBO(255, 255, 255, .2),
// borderRadius: BorderRadius.circular(20),
// // image: DecorationImage(
// // image: Image.asset("assets/images/vip6.png")
// // .image,
// // fit: BoxFit.contain),
// ),
// child: Row(children: [
// Image.asset(
// "assets/images/jifen1.png",
// fit: BoxFit.cover,
// ),
// Container(
// margin: EdgeInsets.only(left: 5),
// child: Text(
// "300",
// style: TextStyle(
// color:
// Color.fromRGBO(255, 255, 255, 1)),
// ),
// )
// ]),
// )
])
], ],
), ),
], ],
......
...@@ -438,6 +438,13 @@ packages: ...@@ -438,6 +438,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.2.0" version: "3.2.0"
flutter_markdown:
dependency: "direct main"
description:
name: flutter_markdown
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.14"
flutter_parsed_text: flutter_parsed_text:
dependency: transitive dependency: transitive
description: description:
...@@ -686,6 +693,13 @@ packages: ...@@ -686,6 +693,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.0.1"
markdown:
dependency: transitive
description:
name: markdown
url: "https://pub.dartlang.org"
source: hosted
version: "7.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
......
...@@ -110,6 +110,8 @@ dependencies: ...@@ -110,6 +110,8 @@ dependencies:
sign_in_with_apple: ^4.3.0 sign_in_with_apple: ^4.3.0
flutter_vibrate: ^1.3.0 flutter_vibrate: ^1.3.0
social_login_buttons: ^1.0.7 social_login_buttons: ^1.0.7
flutter_markdown: ^0.6.14
# package:bubble/bubble.dart # package:bubble/bubble.dart
dev_dependencies: dev_dependencies:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment