Commit 682ab1de authored by DatHV's avatar DatHV
Browse files

fix bug.

parent 1edd930e
{ {
"flavor":"pro", "flavor":"dev",
"baseUrl":"https://api.mypoint.com.vn/8854/gup2start/rest", "baseUrl":"https://api.sandbox.mypoint.com.vn/8854/gup2start/rest",
"t3Token":"runner-env-t3Token-pro", "t3Token":"runner-env-flavor-dev",
"enableLogging":false "enableLogging":true
} }
...@@ -738,6 +738,7 @@ ...@@ -738,6 +738,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
...@@ -753,7 +754,7 @@ ...@@ -753,7 +754,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.icom.vn.MyPoint; PRODUCT_BUNDLE_IDENTIFIER = com.icom.vn.MyPoint;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "MyPoint development"; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "MyPoint Adhoc Distribution";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
......
...@@ -114,10 +114,13 @@ extension RestfulAPIClientAllRequest on RestfulAPIClient { ...@@ -114,10 +114,13 @@ extension RestfulAPIClientAllRequest on RestfulAPIClient {
); );
} }
Future<BaseResponseModel<CreateOTPResponseModel>> verifyDeleteAccount(String otp) async { Future<BaseResponseModel<OTPVerifyResponseModel>> verifyDeleteAccount(String otp) async {
String? token = DataPreference.instance.token ?? "";
return requestNormal(APIPaths.verifyDeleteAccount, Method.POST, { return requestNormal(APIPaths.verifyDeleteAccount, Method.POST, {
"otp": otp, "otp": otp,
}, (data) => CreateOTPResponseModel.fromJson(data as Json)); "access_token": token,
"lang": "vi",
}, (data) => OTPVerifyResponseModel.fromJson(data as Json));
} }
Future<BaseResponseModel<EmptyCodable>> signup(String phone, String password) async { Future<BaseResponseModel<EmptyCodable>> signup(String phone, String password) async {
......
...@@ -80,7 +80,7 @@ class XAppSDKService { ...@@ -80,7 +80,7 @@ class XAppSDKService {
final errorMessage = message?.toString(); final errorMessage = message?.toString();
final tokenString = data?.toString().orEmpty ?? ''; final tokenString = data?.toString().orEmpty ?? '';
final isPlaceholder = tokenString.trim().toLowerCase().contains("tokenex.tokenex"); final isPlaceholder = tokenString.trim().toLowerCase().contains("tokenex.tokenex");
print('🔍 XAppSDKService: getToken result - status: $status, token length: ${tokenString}, isPlaceholder: $isPlaceholder'); print('🔍 XAppSDKService: getToken result - status: $status, token: ${tokenString}, isPlaceholder: $isPlaceholder');
if (status == 'success' && data != null && tokenString.isNotEmpty && !isPlaceholder) { if (status == 'success' && data != null && tokenString.isNotEmpty && !isPlaceholder) {
_cachedToken = tokenString; _cachedToken = tokenString;
_lastError = null; _lastError = null;
......
...@@ -34,7 +34,7 @@ class _AffiliateTabScreenState extends BaseState<AffiliateTabScreen> with BasicS ...@@ -34,7 +34,7 @@ class _AffiliateTabScreenState extends BaseState<AffiliateTabScreen> with BasicS
super.initState(); super.initState();
final args = Get.arguments; final args = Get.arguments;
if (args is Map) { if (args is Map) {
_canBackButton = args['can_back_button'] as bool; _canBackButton = args['can_back_button'] as bool? ?? false;
} }
viewModel.onShowAffiliateBrandPopup = (data) { viewModel.onShowAffiliateBrandPopup = (data) {
if (!mounted) return; if (!mounted) return;
......
...@@ -21,6 +21,7 @@ class CreatePasswordScreen extends StatelessWidget { ...@@ -21,6 +21,7 @@ class CreatePasswordScreen extends StatelessWidget {
return Scaffold( return Scaffold(
body: SafeArea( body: SafeArea(
top: false,
child: Stack( child: Stack(
children: [ children: [
GestureDetector( GestureDetector(
......
...@@ -21,6 +21,10 @@ class CreatePasswordViewModel extends GetxController { ...@@ -21,6 +21,10 @@ class CreatePasswordViewModel extends GetxController {
} }
void _validate() { void _validate() {
if (newPassword.value.length != 6) {
isButtonEnabled.value = false;
return;
}
if (newPassword.value.isEmpty || confirmPassword.value.isEmpty) { if (newPassword.value.isEmpty || confirmPassword.value.isEmpty) {
errorMessage.value = ""; errorMessage.value = "";
isButtonEnabled.value = false; isButtonEnabled.value = false;
......
...@@ -10,7 +10,7 @@ class DailyCheckInViewModel extends RestfulApiViewModel { ...@@ -10,7 +10,7 @@ class DailyCheckInViewModel extends RestfulApiViewModel {
void Function(SubmitCheckInData? data)? submitDataResponse; void Function(SubmitCheckInData? data)? submitDataResponse;
bool get todayIsChecked { bool get todayIsChecked {
final counter = checkInData.value?.counters?.first; final counter = checkInData.value?.dailyCounter;
final items = counter?.values ?? []; final items = counter?.values ?? [];
return (items.firstOrNull?.counterValue ?? '') == '1'; return (items.firstOrNull?.counterValue ?? '') == '1';
} }
......
...@@ -60,8 +60,9 @@ class _DeviceManagerScreenState extends BaseState<DeviceManagerScreen> with Basi ...@@ -60,8 +60,9 @@ class _DeviceManagerScreenState extends BaseState<DeviceManagerScreen> with Basi
if (logoutDisplayDevices.isNotEmpty) if (logoutDisplayDevices.isNotEmpty)
Center( Center(
child: TextButton( child: TextButton(
onPressed: () { onPressed: () async {
Get.to(() => LoggedOutDeviceScreen()); await Get.to(() => LoggedOutDeviceScreen());
_refresh();
}, },
child: Text( child: Text(
'Xem tất cả thiết bị đã đăng xuất (${logoutDevices.length})', 'Xem tất cả thiết bị đã đăng xuất (${logoutDevices.length})',
......
...@@ -32,7 +32,7 @@ class _GameTabScreenState extends BaseState<GameTabScreen> with BasicState, Popu ...@@ -32,7 +32,7 @@ class _GameTabScreenState extends BaseState<GameTabScreen> with BasicState, Popu
super.initState(); super.initState();
final args = Get.arguments; final args = Get.arguments;
if (args is Map) { if (args is Map) {
_canBackButton = args['can_back_button'] as bool; _canBackButton = args['can_back_button'] as bool? ?? false;
} }
_viewModel.getGames(); _viewModel.getGames();
_viewModel.onShowAlertError = (message) { _viewModel.onShowAlertError = (message) {
......
...@@ -66,13 +66,18 @@ class HomeGreetingHeader extends StatelessWidget { ...@@ -66,13 +66,18 @@ class HomeGreetingHeader extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
GestureDetector( Expanded(
onTap: _onProfileTap, child: GestureDetector(
child: Text( onTap: _onProfileTap,
'Xin chào $name!', child: Text(
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: Colors.black87), 'Xin chào $name!',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: Colors.black87),
),
), ),
), ),
const SizedBox(width: 8),
Row( Row(
children: [ children: [
GestureDetector( GestureDetector(
......
...@@ -94,4 +94,5 @@ class HeaderHomeViewModel extends GetxController { ...@@ -94,4 +94,5 @@ class HeaderHomeViewModel extends GetxController {
} }
Future<void> freshData() => _repository._load(withLoading: false); Future<void> freshData() => _repository._load(withLoading: false);
Future<void> fetchNotificationUnread() => _repository._fetchNotificationUnread();
} }
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:mypoint_flutter_app/shared/navigation/directional_screen.dart';
import '../../features/home/custom_widget/header_home_widget.dart'; import '../../features/home/custom_widget/header_home_widget.dart';
import '../../features/home/custom_widget/product_grid_widget.dart'; import '../../features/home/custom_widget/product_grid_widget.dart';
import '../../features/pipi/pipi_detail_screen.dart'; import '../../features/pipi/pipi_detail_screen.dart';
...@@ -203,6 +204,8 @@ class _HomeScreenState extends BaseState<HomeScreen> with PopupOnInit, BasicStat ...@@ -203,6 +204,8 @@ class _HomeScreenState extends BaseState<HomeScreen> with PopupOnInit, BasicStat
} }
void _handleHoverViewTap() { void _handleHoverViewTap() {
// final direction = DirectionalScreen.buildByName(name: DirectionalScreenName.campaignSevenDayScreen, clickActionParam: "0");
// direction?.begin();
final result = _viewModel.hoverData.value?.direction?.begin(); final result = _viewModel.hoverData.value?.direction?.begin();
if (result != true) { if (result != true) {
showModalBottomSheet( showModalBottomSheet(
...@@ -250,6 +253,7 @@ class _HomeScreenState extends BaseState<HomeScreen> with PopupOnInit, BasicStat ...@@ -250,6 +253,7 @@ class _HomeScreenState extends BaseState<HomeScreen> with PopupOnInit, BasicStat
@override @override
void onRouteDidAppear() { void onRouteDidAppear() {
super.onRouteDidAppear(); super.onRouteDidAppear();
_headerHomeVM.fetchNotificationUnread();
if (_viewModel.hoverDismissed) return; if (_viewModel.hoverDismissed) return;
_viewModel.loadDataPiPiHome(); _viewModel.loadDataPiPiHome();
} }
......
...@@ -106,6 +106,8 @@ class _InterestCategoriesScreenState extends BaseState<InterestCategoriesScreen> ...@@ -106,6 +106,8 @@ class _InterestCategoriesScreenState extends BaseState<InterestCategoriesScreen>
} }
Widget _buildBottomButton() { Widget _buildBottomButton() {
final bool hasSelection = _viewModel.selectedIds.isNotEmpty;
final bool canSubmit = _onChange && hasSelection;
return Container( return Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
decoration: const BoxDecoration( decoration: const BoxDecoration(
...@@ -116,13 +118,13 @@ class _InterestCategoriesScreenState extends BaseState<InterestCategoriesScreen> ...@@ -116,13 +118,13 @@ class _InterestCategoriesScreenState extends BaseState<InterestCategoriesScreen>
top: false, top: false,
child: ElevatedButton( child: ElevatedButton(
onPressed: onPressed:
_onChange canSubmit
? () { ? () {
_viewModel.submitInterestedCategories(); _viewModel.submitInterestedCategories();
} }
: null, : null,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: _onChange ? BaseColor.primary500 : Colors.grey, backgroundColor: canSubmit ? BaseColor.primary500 : Colors.grey,
minimumSize: const Size.fromHeight(52), minimumSize: const Size.fromHeight(52),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
), ),
...@@ -130,7 +132,7 @@ class _InterestCategoriesScreenState extends BaseState<InterestCategoriesScreen> ...@@ -130,7 +132,7 @@ class _InterestCategoriesScreenState extends BaseState<InterestCategoriesScreen>
'Cập nhật', 'Cập nhật',
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: _onChange ? Colors.white : Colors.black87, color: canSubmit ? Colors.white : Colors.black87,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
...@@ -169,9 +171,10 @@ class _InterestCard extends StatelessWidget { ...@@ -169,9 +171,10 @@ class _InterestCard extends StatelessWidget {
Positioned( Positioned(
bottom: 10, bottom: 10,
left: 12, left: 12,
right: 12,
child: Text( child: Text(
title, title,
maxLines: 2, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: const TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w700), style: const TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w700),
), ),
......
...@@ -29,6 +29,13 @@ class _MainTabScreenState extends State<MainTabScreen> { ...@@ -29,6 +29,13 @@ class _MainTabScreenState extends State<MainTabScreen> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
final args = Get.arguments;
if (args is Map) {
final requestedIndex = args['tabIndex'];
if (requestedIndex is int && requestedIndex >= 0 && requestedIndex < _pages.length) {
_currentIndex = requestedIndex;
}
}
final viewModel = Get.put(HeaderHomeViewModel()); final viewModel = Get.put(HeaderHomeViewModel());
viewModel.freshData(); viewModel.freshData();
} }
......
...@@ -46,24 +46,28 @@ class MemberLevelHeaderWidget extends StatelessWidget { ...@@ -46,24 +46,28 @@ class MemberLevelHeaderWidget extends StatelessWidget {
placeholderAsset: "assets/images/ic_logo_rank_member.png", placeholderAsset: "assets/images/ic_logo_rank_member.png",
), ),
const SizedBox(width: 6), const SizedBox(width: 6),
Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Text( children: [
name.toUpperCase(), Text(
style: const TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: Colors.white), name.toUpperCase(),
), maxLines: 1,
const SizedBox(height: 4), overflow: TextOverflow.ellipsis,
if ((level?.levelName ?? "").isNotEmpty) style: const TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: Colors.white),
Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20)),
child: Text(
(level?.levelName ?? "").capitalizeWords(),
style: TextStyle(color: BaseColor.primary800, fontSize: 14, fontWeight: FontWeight.bold),
),
), ),
], const SizedBox(height: 4),
if ((level?.levelName ?? "").isNotEmpty)
Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20)),
child: Text(
(level?.levelName ?? "").capitalizeWords(),
style: TextStyle(color: BaseColor.primary800, fontSize: 14, fontWeight: FontWeight.bold),
),
),
],
),
), ),
], ],
), ),
......
...@@ -65,6 +65,7 @@ class _NewsListScreenState extends State<NewsListScreen> { ...@@ -65,6 +65,7 @@ class _NewsListScreenState extends State<NewsListScreen> {
); );
}), }),
), ),
const SizedBox(height: 16),
], ],
), ),
); );
......
...@@ -157,7 +157,7 @@ class _NotificationScreenState extends BaseState<NotificationScreen> with BasicS ...@@ -157,7 +157,7 @@ class _NotificationScreenState extends BaseState<NotificationScreen> with BasicS
void _confirmDeleteAllNotifications() { void _confirmDeleteAllNotifications() {
final dataAlert = DataAlertModel( final dataAlert = DataAlertModel(
title: "Xoá tất cả", // title: "Xoá tất cả",
description: "Bạn có muốn xoá hết tất cả thông báo không? \nLưu ý: bạn sẽ không thể xem lại thông báo đã xoá", description: "Bạn có muốn xoá hết tất cả thông báo không? \nLưu ý: bạn sẽ không thể xem lại thông báo đã xoá",
localHeaderImage: "assets/images/ic_pipi_03.png", localHeaderImage: "assets/images/ic_pipi_03.png",
buttons: [ buttons: [
......
...@@ -51,6 +51,7 @@ class NotificationViewModel extends RestfulApiViewModel { ...@@ -51,6 +51,7 @@ class NotificationViewModel extends RestfulApiViewModel {
onShowAlertError?.call(msg); onShowAlertError?.call(msg);
}, },
onComplete: () { onComplete: () {
isLoading.value = false;
fetchNotifications(refresh: true); fetchNotifications(refresh: true);
}, },
); );
......
Supports Markdown
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