1,上架审核类注释

2,注册页面隐私协议勾选框及逻辑修改
This commit is contained in:
Daisy 2024-03-08 13:55:47 +08:00
parent 61803e2c42
commit ad8cdc279b
9 changed files with 74 additions and 65 deletions

View File

@ -198,7 +198,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
child: SizedBox(
width: 10.sp,
)),
//Google暂时屏蔽
// Google暂时屏蔽
// GestureDetector(
// child: SizedBox(
// // width: 150.w,

View File

@ -1,8 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../tools/store_service.dart';
class StarLockLoginState {
var passwordShow = true.obs;
var agree = false.obs;

View File

@ -30,11 +30,11 @@ class StarLockRegisterLogic extends BaseGetXController {
void register() async {
var entity = await ApiRepository.to.register(
receiverType:state.isIphoneType.value == true ? 1 : 2,
countryCode:state.countryCode.value,
account:state.phoneOrEmailStr.value,
password:state.pwd.value,
verificationCode:state.verificationCode.value);
receiverType: state.isIphoneType.value == true ? 1 : 2,
countryCode: state.countryCode.value,
account: state.phoneOrEmailStr.value,
password: state.pwd.value,
verificationCode: state.verificationCode.value);
if (entity.errorCode!.codeIsSuccessful) {
// await loginSuccess(loginEntity: entity);
// Toast.show(msg: "注册成功");
@ -46,16 +46,18 @@ class StarLockRegisterLogic extends BaseGetXController {
void sendValidationCode() async {
var entity = await ApiRepository.to.sendValidationCode(
// state.countryCode.value,
countryCode:state.countryCode.value.toString(),
account:state.phoneOrEmailStr.value,
channel:state.isIphoneType.value ? "1" : "2",
codeType:'1',
xWidth:state.xWidth.value.toString());
countryCode: state.countryCode.value.toString(),
account: state.phoneOrEmailStr.value,
channel: state.isIphoneType.value ? "1" : "2",
codeType: '1',
xWidth: state.xWidth.value.toString());
if (entity.errorCode!.codeIsSuccessful) {
_startTimer();
} else {
} else {}
}
}
void changeAgreeState() {
_resetCanSub();
}
void checkNext(TextEditingController controller) {

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -51,7 +50,12 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
isDisabled: state.canSub.value,
onClick: state.canSub.value
? () {
logic.register();
if (state.agree.value == false) {
logic.showToast('请先同意用户协议及隐私政策');
return;
} else {
logic.register();
}
}
: null);
}),
@ -294,7 +298,8 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
"countryCode": state.countryCode,
"account": state.phoneOrEmailStr.value
});
state.xWidth.value = (result as Map<String, dynamic>)['xWidth'];
state.xWidth.value =
(result as Map<String, dynamic>)['xWidth'];
logic.sendValidationCode();
}
: null,
@ -303,7 +308,9 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
height: 60.h,
padding: EdgeInsets.all(5.h),
decoration: BoxDecoration(
color: state.phoneOrEmailStrIsOK.value ? AppColors.mainColor : Colors.grey,
color: state.phoneOrEmailStrIsOK.value
? AppColors.mainColor
: Colors.grey,
borderRadius: BorderRadius.circular(5)),
child: Center(
child: Text(state.btnText.value,
@ -326,15 +333,18 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset(
'images/icon_select_circle.png',
width: 28.w,
height: 28.w,
),
// SizedBox(
// height: 20.h,
// width: 26.w,
// child: Checkbox(value: false, onChanged: (value) {})),
Obx(() => GestureDetector(
onTap: () {
state.agree.value = !state.agree.value;
logic.changeAgreeState();
},
child: Image.asset(
state.agree.value
? 'images/icon_round_select.png'
: 'images/icon_round_unSelect.png',
width: 30.w,
height: 30.w,
))),
SizedBox(
width: 15.w,
),
@ -352,11 +362,10 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
style: TextStyle(
color: AppColors.mainColor, fontSize: 20.sp)),
onTap: () {
Get.toNamed(Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.userAgreementURL,
"title": '用户协议'
});
Get.toNamed(Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.userAgreementURL,
"title": '用户协议'
});
},
)),
WidgetSpan(
@ -368,9 +377,9 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
color: AppColors.mainColor, fontSize: 20.sp)),
onTap: () {
Get.toNamed(Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.privacyPolicyURL,
"title": '隐私政策'
});
"url": XSConstantMacro.privacyPolicyURL,
"title": '隐私政策'
});
},
)),
],

View File

@ -21,6 +21,7 @@ class StarLockRegisterState {
var xWidth = ''.obs; //
var isIphoneType = true.obs;
var canSub = false.obs;
var agree = false.obs;
bool get isEmail => RegexUtil.isEmail(phoneOrEmailStr.value);
bool get isIphone => RegexUtil.isMobileSimple(phoneOrEmailStr.value);

View File

@ -36,6 +36,7 @@ Future _initTranslation() async => TranslationLoader.loadTranslation(
Future _setCommonServices() async {
await Get.putAsync(() => StoreService().init());
await Get.putAsync(() => PlatformInfoService().init());
//
// await Get.putAsync(() => DeviceInfoService().init());
// Get.log(PlatformInfoService.to.info.version);
}

View File

@ -198,7 +198,7 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
SizedBox(
height: 160.h,
),
//Google暂时屏蔽
// Google暂时屏蔽
// SubmitBtn(
// btnName: '演示模式',
// onClick: () {

View File

@ -184,30 +184,31 @@ class _MineSetPageState extends State<MineSetPage> {
SizedBox(
height: 10.h,
),
CommonItem(
leftTitel: "Amazon Alexa",
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
logic.showToast("功能暂未开放");
}),
CommonItem(
leftTitel: "Google Home",
rightTitle: "",
isHaveLine: true,
isHaveDirection: true,
action: () {
logic.showToast("功能暂未开放");
}),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.xiaomiIOTPlatform!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
logic.showToast("功能暂未开放");
}),
//
// CommonItem(
// leftTitel: "Amazon Alexa",
// rightTitle: "",
// isHaveLine: true,
// isHaveDirection: true,
// action: () {
// logic.showToast("功能暂未开放");
// }),
// CommonItem(
// leftTitel: "Google Home",
// rightTitle: "",
// isHaveLine: true,
// isHaveDirection: true,
// action: () {
// logic.showToast("功能暂未开放");
// }),
// CommonItem(
// leftTitel: TranslationLoader.lanKeys!.xiaomiIOTPlatform!.tr,
// rightTitle: "",
// isHaveLine: false,
// isHaveDirection: true,
// action: () {
// logic.showToast("功能暂未开放");
// }),
// CommonItem(leftTitel:TranslationLoader.lanKeys!.valueAddedServices!.tr, rightTitle:"", isHaveDirection: true, action: (){
//
// }),

View File

@ -4,16 +4,13 @@ import 'package:get/get.dart';
import 'package:get/get_connect/http/src/request/request.dart';
import 'package:star_lock/login/login/entity/LoginData.dart';
import '../login/login/entity/LoginData.dart';
import '../login/login/entity/LoginEntity.dart';
import '../tools/platform_info_services.dart';
import '../tools/storage.dart';
import '../tools/store_service.dart';
FutureOr<Request> requestInterceptor(Request request) async {
request.headers['User-Agent'] =
'StarLock/${PlatformInfoService.to.info.version}/${PlatformInfoService.to.info.buildNumber}/${GetPlatform.isAndroid ? 'Android' : 'iOS'}';
request.headers['Accept-Language'] = 'zh_CN';
request.headers['Accept-Language'] = 'zh-CN';
// request.headers['Content-Type'] = 'application/json';
// request.headers['token'] = StoreService.to.userToken!;
// print("11111${StoreService.to.userToken}");