Commit fda33894 authored by DatHV's avatar DatHV
Browse files

cap nhat giao dien

parent 75178f29
{
"status" : "success",
"data" : [
{
"images" : [
{
"id" : "181",
"image_type" : "COVER",
"image_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/6A4B1C7EBC63C07BC19EAB8FDC58A86F/1733913751"
}
],
"id" : "196",
"achievement_name" : "Chương trình tặng quà bạn mới tháng 12.2024",
"achievement_icon_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/6A4B1C7EBC63C07BC19EAB8FDC58A86F/1735639708",
"apply_for_group" : "",
"click_action_param" : "18721",
"click_action_type" : "VIEW_WEBSITE_PAGE"
},
{
"images" : [
{
"id" : "179",
"image_type" : "COVER",
"image_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/9528B426658451B707E09A08EF06714E/1733381413"
}
],
"id" : "194",
"achievement_name" : "Gói cước bundle nhận 2GB",
"achievement_icon_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/9528B426658451B707E09A08EF06714E/1735195967",
"apply_for_group" : "",
"click_action_param" : "18732",
"click_action_type" : "VIEW_WEBSITE_PAGE"
},
{
"images" : [
{
"id" : "129",
"image_type" : "COVER",
"image_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/DED0F855CB537AB47C5043937DFD6FBD/1730254240"
}
],
"id" : "141",
"achievement_name" : "Khảo sát khách hàng",
"achievement_icon_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/DED0F855CB537AB47C5043937DFD6FBD/1730376862",
"apply_for_group" : "",
"click_action_param" : "https://tichdiem.mypoint.com.vn/khaosatungdung2024",
"click_action_type" : "VIEW_LINK"
}
],
"code" : 200
}
{
"status" : "success",
"data" : [
{
"ios_version" : null,
"android_version_condition" : null,
"event_color" : "#5800d4",
"phone_number" : "",
"click_action_param" : "APP_SCREEN_PRODUCT_MOBILE_TOPUP",
"service_name" : "Nạp tiền điện thoại",
"image_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/campaign-service-v3/api/v3.0/imageReader/F6A38CA6BCE66097D00855296F7DF8FFD4A0362D953D21B61274EC293CB2EAC6359F1B8975D551D7B610D89C7AB2532A86B361A991FAFF07295065D61FDB57BD/3486955098",
"android_version" : null,
"click_action_type" : "VIEW_APP_SCREEN",
"event_describle" : "+1%",
"ios_version_condition" : null,
"service_icon" : "",
"service_code" : "Topup"
},
{
"ios_version" : null,
"android_version_condition" : null,
"event_color" : "#c62a2a",
"phone_number" : "",
"click_action_param" : "APP_SCREEN_SIM_SERVICE",
"service_name" : "Gói cước nhà mạng",
"image_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/campaign-service-v3/api/v3.0/imageReader/F6A38CA6BCE66097D00855296F7DF8FFB2877AADA2577FE35AC65C48B861F046AFC362121B94BE73237BBE955FE84DEE/3485776902",
"android_version" : null,
"click_action_type" : "VIEW_APP_SCREEN",
"event_describle" : "HOT",
"ios_version_condition" : null,
"service_icon" : "",
"service_code" : "GCNM"
},
{
"ios_version" : null,
"android_version_condition" : null,
"event_color" : "#d13333",
"phone_number" : "",
"click_action_param" : "APP_SCREEN_POINTBACK",
"service_name" : "Mua sắm tích điểm",
"image_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/campaign-service-v3/api/v3.0/imageReader/F6A38CA6BCE66097D00855296F7DF8FF0453D2FA21F047DCC7FFE1F331CD5E14BCFF10055A29A4116DDA7AE3242E8047/3485776940",
"android_version" : null,
"click_action_type" : "VIEW_APP_SCREEN",
"event_describle" : "30%",
"ios_version_condition" : null,
"service_icon" : "",
"service_code" : "HD"
},
{
"ios_version" : "1.21.0",
"android_version_condition" : ">",
"event_color" : "#fad900",
"phone_number" : "",
"click_action_param" : "APP_SCREEN_GAME_BUNDLE",
"service_name" : "Game có thưởng",
"image_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/campaign-service-v3/api/v3.0/imageReader/F6A38CA6BCE66097D00855296F7DF8FF0A40EF554F9782FD0B01841B092E70305AB966ED36F39B311FA34CA3529BB5E3/3485776974",
"android_version" : "1.21.3",
"click_action_type" : "VIEW_APP_SCREEN",
"event_describle" : "Mới",
"ios_version_condition" : ">",
"service_icon" : "",
"service_code" : "GAMEBUNDLE"
},
{
"ios_version" : null,
"android_version_condition" : null,
"event_color" : null,
"phone_number" : "",
"click_action_param" : "APP_SCREEN_MOBILE_TOPUP_DATA",
"service_name" : "Điểm đổi Data",
"image_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/campaign-service-v3/api/v3.0/imageReader/F6A38CA6BCE66097D00855296F7DF8FF790F21B0AD1C117C554F60943AB9C1782974A7F8CB494DD2364C8435579AFD31451AD20EEC43461B9FA6BA09E969A183/3485777004",
"android_version" : null,
"click_action_type" : "VIEW_APP_SCREEN",
"event_describle" : "",
"ios_version_condition" : null,
"service_icon" : "",
"service_code" : "TDT"
},
{
"ios_version" : null,
"android_version_condition" : null,
"event_color" : null,
"phone_number" : "",
"click_action_param" : "20613",
"service_name" : "Thẻ Sức Khỏe",
"image_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/campaign-service-v3/api/v3.0/imageReader/F6A38CA6BCE66097D00855296F7DF8FF1C5862DD7A52AD835423B11AE44FFFBEBA20AF7A7E6AAA6714FE7904BA2DC27D6D46EA06E08D47756F833BE5010EF3C1/3486955618",
"android_version" : null,
"click_action_type" : "APP_SCREEN_CARD_FAMILY_MEDON",
"event_describle" : "",
"ios_version_condition" : null,
"service_icon" : "",
"service_code" : "MEDON"
},
{
"ios_version" : null,
"android_version_condition" : null,
"event_color" : "#1e0ab2",
"phone_number" : "",
"click_action_param" : "APP_SCREEN_CUSTOMER_DAILY_CHECKIN",
"service_name" : "Check-in tích điểm",
"image_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/campaign-service-v3/api/v3.0/imageReader/F6A38CA6BCE66097D00855296F7DF8FFF23510242CAACD9DFB499AD3B178E2D1EEDD78330DD72BB1B988CC538BDAF02F/3486955490",
"android_version" : null,
"click_action_type" : "VIEW_APP_SCREEN",
"event_describle" : "+10Đ",
"ios_version_condition" : null,
"service_icon" : "",
"service_code" : "SD"
},
{
"ios_version" : null,
"android_version_condition" : null,
"event_color" : "#fad000",
"phone_number" : null,
"click_action_param" : "APP_SCREEN_NEWS",
"service_name" : "Tin tức MyPoint",
"image_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/81056048804BFCE6FD28AA2078537E24/1704275512",
"android_version" : null,
"click_action_type" : "VIEW_APP_SCREEN",
"event_describle" : "Mới",
"ios_version_condition" : null,
"service_icon" : "",
"service_code" : ""
},
{
"ios_version" : "",
"android_version_condition" : null,
"event_color" : null,
"phone_number" : "",
"click_action_param" : "20765",
"service_name" : "Cứu hộ giao thông",
"image_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/campaign-service-v3/api/v3.0/imageReader/F6A38CA6BCE66097D00855296F7DF8FF74AFF39D8838527272F3762B93A88CB860B810A47ABB945FEA09A209065317C0/3486955678",
"android_version" : "",
"click_action_type" : "APP_SCREEN_VNTRA_PACKAGE",
"event_describle" : "",
"ios_version_condition" : null,
"service_icon" : "",
"service_code" : "VNTRA"
},
{
"ios_version" : null,
"android_version_condition" : null,
"event_color" : null,
"phone_number" : "",
"click_action_param" : "18593",
"service_name" : "ezTicket",
"image_url" : "https://api.mypoint.com.vn/8854/gup2start/rest/campaign-service-v3/api/v3.0/imageReader/F6A38CA6BCE66097D00855296F7DF8FFB1203C75DA6116911D50CF123237DD2AFAEC88358EB52D8FD06807A94DD2201F/3486955718",
"android_version" : null,
"click_action_type" : "VIEW_WEBSITE_PAGE",
"event_describle" : "",
"ios_version_condition" : null,
"service_icon" : "",
"service_code" : "EZCLOUD"
}
],
"code" : 200
}
\ No newline at end of file
class APIPaths {
static const String baseUrl = "https://api.sandbox.mypoint.com.vn/8854/gup2start/rest";
static const String baseUrl = "https://api.mypoint.com.vn/8854/gup2start/rest";
static const String checkUpdate = "/version-management-service/api/v1.0/check-customer-software-update";
static const String getOnboardingInfo = "/resource/api/v2.0/intro-screen";
static const String checkPhoneNumber = "/user/api/v2.0/account/users/checkPhoneNumber";
......@@ -52,4 +52,10 @@ class APIPaths {
static const String notificationMarkAsSeen = "/notificationMarkAsSeen/1.0.0";
static const String notificationGetDetail = "/notificationGetDetail/1.0.0";
static const String getCustomerProductDetail = "/product/api/v2.0/customer/products/%@";
static const String getPipiDetail = "/pipiGetDetail/1.0.0";
static const String getSectionLayoutHome = "/dynamic-home/api/v1.0/sections";
static const String achievementGetList = "/achievementGetList/1.0.0";
static const String getIconPiPiHome = "/campaign/api/v3.0/icon";
static const String getNotificationUnread = "/notificationUnread/1.0.0";
static const String getDynamicHeaderHome = "/dynamic-home/api/v1.0/header-home";
}
\ No newline at end of file
......@@ -96,18 +96,6 @@ enum DirectionalScreenName {
unknown,
}
// const splashScreen = '/splash';
// const onboardingScreen = '/onboarding';
// const loginScreen = '/login';
// const mainScreen = '/main';
// const vouchersScreen = '/vouchers';
// const gameCardScreen = '/gameCardScreen';
// const registerFormInputScreen = '/registerFormInputScreen';
// const transactionDetailScreen = '/transactionDetailScreen';
// const baseWebViewScreen = '/baseWebViewScreen';
// const paymentWebViewScreen = '/paymentWebViewScreen';
// const transactionHistoryDetailScreen = '/transactionHistoryDetailScreen';
extension DirectionalScreenRouterExtension on DirectionalScreenName {
String get router {
switch (this) {
......
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:json_annotation/json_annotation.dart';
import '../screen/pageDetail/campaign_detail_screen.dart';
import '../screen/webview/web_view_screen.dart';
import '../shared/router_gage.dart';
import 'directional_action_type.dart';
part 'directional_screen.g.dart';
@JsonSerializable()
class DirectionalScreen {
@JsonKey(name: "click_action_type")
final String? clickActionType;
@JsonKey(name: "click_action_param")
final String? clickActionParam;
DirectionalScreen({this.clickActionType, this.clickActionParam});
const DirectionalScreen._({this.clickActionType, this.clickActionParam});
static DirectionalScreen? build({String? clickActionType, String? clickActionParam}) {
if (clickActionType == null || clickActionType.isEmpty) return null;
return DirectionalScreen(clickActionType: clickActionType, clickActionParam: clickActionParam);
if ((clickActionType ?? "").isEmpty) return null;
if (clickActionType == "VIEW_APP_SCREEN") {
return DirectionalScreen._(clickActionType: clickActionParam, clickActionParam: null);
}
return DirectionalScreen._(clickActionType: clickActionType, clickActionParam: clickActionParam);
}
factory DirectionalScreen.fromJson(Map<String, dynamic> json) => _$DirectionalScreenFromJson(json);
Map<String, dynamic> toJson() => _$DirectionalScreenToJson(this);
factory DirectionalScreen.fromJson(Map<String, dynamic> json) => DirectionalScreen._(
clickActionType: json['click_action_type'] as String?,
clickActionParam: json['click_action_param'] as String?,
);
@immutable
bool begin() {
......@@ -38,6 +37,19 @@ class DirectionalScreen {
case DirectionalScreenName.productOwnVoucher:
Get.toNamed(voucherDetailScreen, arguments: {"customerProductId": int.parse(clickActionParam ?? "")});
return true;
case DirectionalScreenName.customerSupport:
Get.toNamed(supportScreen);
return true;
case DirectionalScreenName.viewDeepLink || DirectionalScreenName.link:
BaseWebViewInput input = BaseWebViewInput(url: clickActionParam ?? "");
Get.toNamed(baseWebViewScreen, arguments: input);
return true;
case DirectionalScreenName.website:
Get.toNamed(campaignDetailScreen, arguments: {"id": clickActionParam ?? ""});
return true;
case DirectionalScreenName.gameCenter:
Get.toNamed(vplayGameCenterScreen);
return true;
default:
print("Không nhận diện được action type: $clickActionType");
return false;
......
......@@ -15,6 +15,11 @@ import '../model/update_response_model.dart';
import '../preference/point/header_home_model.dart';
import '../screen/faqs/faqs_model.dart';
import '../screen/game/models/game_bundle_item_model.dart';
import '../screen/home/models/achievement_model.dart';
import '../screen/home/models/hover_data_model.dart';
import '../screen/home/models/main_section_config_model.dart';
import '../screen/home/models/notification_unread_model.dart';
import '../screen/home/models/pipi_detail_model.dart';
import '../screen/notification/models/category_notify_item_model.dart';
import '../screen/notification/models/notification_detail_model.dart';
import '../screen/notification/models/notification_list_data_model.dart';
......@@ -170,7 +175,8 @@ extension RestfullAPIClientAllApi on RestfulAPIClient {
}
Future<BaseResponseModel<CampaignDetailResponseModel>> websitePageGetDetail(String id) async {
final body = {"website_page_id": id};
String? token = DataPreference.instance.token ?? "";
final body = {"website_page_id": id, "access_token": token};
return requestNormal(
APIPaths.websitePageGetDetail,
Method.POST,
......@@ -189,8 +195,7 @@ extension RestfullAPIClientAllApi on RestfulAPIClient {
);
}
Future<BaseResponseModel<FAQItemModelResponse>> websiteFolderGetPageList() async {
final body = {"folder_uri": "FAQ"};
Future<BaseResponseModel<FAQItemModelResponse>> websiteFolderGetPageList(Json body) async {
return requestNormal(
APIPaths.websiteFolderGetPageList,
Method.POST,
......@@ -484,4 +489,50 @@ extension RestfullAPIClientAllApi on RestfulAPIClient {
return OrderProductPaymentResponseModel.fromJson(data as Json);
});
}
}
Future<BaseResponseModel<PipiDetailResponseModel>> getPipiDetail() async {
String? token = DataPreference.instance.token ?? "";
final body = {"access_token": token};
return requestNormal(APIPaths.getPipiDetail, Method.POST, body, (data) {
return PipiDetailResponseModel.fromJson(data as Json);
});
}
Future<BaseResponseModel<List<MainSectionConfigModel>>> getSectionLayoutHome() async {
return requestNormal(APIPaths.getSectionLayoutHome, Method.GET, {}, (data) {
final list = data as List<dynamic>;
return list.map((e) => MainSectionConfigModel.fromJson(e)).toList();
});
}
Future<BaseResponseModel<AchievementListResponse>> getAchievementList() async {
String? token = DataPreference.instance.token ?? "";
final body = {
"access_token": token,
"achievement_type": "Earn_Point",
"start": 0,
"limit": 1000,
};
return requestNormal(APIPaths.achievementGetList, Method.POST, body, (data) {
return AchievementListResponse.fromJson(data as Json);
});
}
Future<BaseResponseModel<HoverDataModel>> getDataPiPiHome() async {
return requestNormal(APIPaths.getIconPiPiHome, Method.GET, {}, (data) {
return HoverDataModel.fromJson(data as Json);
});
}
Future<BaseResponseModel<NotificationUnreadData>> getNotificationUnread() async {
return requestNormal(APIPaths.getNotificationUnread, Method.POST, {}, (data) {
return NotificationUnreadData.fromJson(data as Json);
});
}
Future<BaseResponseModel<HeaderHomeModel>> getDynamicHeaderHome() async {
return requestNormal(APIPaths.getDynamicHeaderHome, Method.POST, {}, (data) {
return HeaderHomeModel.fromJson(data as Json);
});
}
}
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:mypoint_flutter_app/widgets/image_loader.dart';
import '../../widgets/custom_navigation_bar.dart';
import 'achievement_viewmodel.dart';
class AchievementListScreen extends StatelessWidget {
const AchievementListScreen({super.key});
@override
Widget build(BuildContext context) {
final viewModel = Get.put(AchievementViewModel());
return Scaffold(
appBar: CustomNavigationBar(title: "Thử thách trúng quà"),
body: Obx(() {
final items = viewModel.achievements;
return Padding(
padding: const EdgeInsets.all(16.0),
child: GridView.builder(
itemCount: items.length,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 12,
mainAxisSpacing: 12,
childAspectRatio: 4/3,
),
itemBuilder: (context, index) {
final item = items[index];
return GestureDetector(
onTap: () {
item.directionScreen?.begin();
},
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: loadNetworkImage(
url: item.urlBackground ?? '',
placeholderAsset: 'assets/images/bg_default_34.png',
),
),
);
},
),
);
}),
);
}
}
import 'package:get/get.dart';
import 'package:mypoint_flutter_app/networking/restful_api_request.dart';
import '../../base/restful_api_viewmodel.dart';
import '../home/models/achievement_model.dart';
class AchievementViewModel extends RestfulApiViewModel {
var achievements = <AchievementModel>[].obs;
@override
void onInit() {
super.onInit();
fetchAchievements();
}
Future<void> fetchAchievements() async {
showLoading();
try {
final response = await client.getAchievementList();
if (response.data != null) {
achievements.value = response.data?.achievements ?? [];
}
} catch (error) {
print("Error fetching achievements: $error");
} finally {
hideLoading();
}
}
}
\ No newline at end of file
......@@ -58,7 +58,7 @@ class SignUpCreatePasswordRepository extends RestfulApiViewModel implements ICre
if (await _biometricManager.canCheckBiometrics()) {
Get.to(BiometricAuthScreen());
} else {
Get.to(MainTabScreen());
Get.toNamed(mainScreen);
}
} else {
DataPreference.instance.clearLoginToken();
......
......@@ -156,6 +156,6 @@ class _DeleteAccountDialogState extends State<DeleteAccountDialog> {
}
void _onTermConditionPressed() {
Get.to(CampaignDetailScreen(type: DetailPageRuleType.policyDeleteAccount));
Get.toNamed(campaignDetailScreen, arguments: {"type": DetailPageRuleType.policyDeleteAccount});
}
}
......@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'faqs_model.dart';
class FAQDetailScreen extends StatelessWidget {
final FAQItemModel faqItem;
final PageItemModel faqItem;
const FAQDetailScreen({super.key, required this.faqItem});
......
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