Commit c8abf95b authored by DatHV's avatar DatHV
Browse files

update screen logic

parent fda33894
[
{
"id": 1,
"name": "",
"type": "QUICK_BUTTONS",
"layout": "CAROUSEL",
"slider_speed": 0,
"note": "",
"order": 1,
"api_list": "/product/api/v2.1/quick-buttons",
"button_view_all": {
"text": "Xem tất cả",
"click_action_type": ""
}
},
{
"id": 2,
"name": "",
"type": "BANNERS",
"layout": "SLIDER",
"slider_speed": 5,
"note": "",
"order": 2,
"api_list": "/product/api/v2.1/banners?mode=search&limit=10",
"button_view_all": {
"text": "Xem tất cả",
"click_action_type": ""
}
},
{
"id": 3,
"name": "Thương hiệu tích - tiêu điểm",
"type": "BRANDS",
"layout": "CAROUSEL",
"slider_speed": 0,
"note": "",
"order": 3,
"api_list": "/product/api/v2.1/brands?mode=newest&limit=5",
"button_view_all": {
"text": "Xem tất cả",
"click_action_type": "APP_SCREEN_BRAND_LIST"
}
},
{
"id": 4,
"name": "Mua sắm hoàn điểm",
"type": "POINT_PARTNERS",
"layout": "CAROUSEL",
"slider_speed": 0,
"note": "",
"order": 4,
"api_list": "/product/api/v2.1/point-partners?mode=newest&limit=5",
"button_view_all": {
"text": "Xem tất cả",
"click_action_type": "APP_SCREEN_POINTBACK"
}
},
{
"id": 5,
"name": "Thử thách trúng quà",
"type": "CAMPAIGNS",
"layout": "CAROUSEL",
"slider_speed": 0,
"note": "",
"order": 5,
"api_list": "/product/api/v2.1/achievements?mode=newest&limit=5",
"button_view_all": {
"text": "Xem tất cả",
"click_action_type": "APP_SCREEN_GIFTS"
}
},
{
"id": 6,
"name": "Săn ưu đãi",
"type": "PRODUCTS",
"layout": "LIST",
"slider_speed": 0,
"note": "",
"order": 6,
"api_list": "/product/api/v2.0/products?size=10&index=0&catalog_code=HOT&type=PRODUCT_TYPE_VOUCHER",
"button_view_all": {
"text": "Xem tất cả",
"click_action_type": "APP_SCREEN_ALL_VOUCHER"
}
},
{
"id": 7,
"name": "MyPoint có gì hot?",
"type": "MYPOINT_HOT",
"layout": "LIST",
"slider_speed": 0,
"note": "",
"order": 7,
"api_list": "/product/api/v2.1/mypoint-hot?limit=5",
"button_view_all": {
"text": "Xem tất cả",
"click_action_type": "APP_SCREEN_NEWS"
}
}
]
......@@ -14,7 +14,7 @@
"event_describle" : "+1%",
"ios_version_condition" : null,
"service_icon" : "",
"service_code" : "Topup"
"service_code" : "Topup"
},
{
"ios_version" : null,
......
{
"data": {
"levels": [
{
"id": "10",
"membership_level_code": "DONG",
"membership_level_rank": "1",
"membership_level_name": "Hạng Đồng",
"membership_level_description": "Đồng",
"membership_level_content": "",
"membership_level_term_and_condition": "<p style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><strong>&lt;ic_membership_voucher&gt; Ưu đãi từ Mobifone<br /></strong></span></p><ul style=\"margin: 0px;\"> <li><span style=\"font-size: 12pt;\"> <span style=\"font-weight: 400;\">Tích điểm 1% khi nạp thẻ trên mọi hình thức (MyPoint, ngân hàng, MyMobiFone, thẻ cào,...)</span> </span></li> </ul>",
"logo": "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/D21B72F4E31E03AB0C4A4D50436E2356/1673231765",
"upgrage_type": "PAG",
"refresh_level_after_months_from_start_date": "6",
"upgrade_when_counter_is_greater_or_equal": "100000.00",
"upgrade_when_counter_gmv_is_greater_or_equal": "1000000.00",
"upgrade_to_membership_level_id": "13",
"downgrade_level_when_counter_is_less_than": "0.00",
"downgrade_level_when_counter_gmv_is_less_than": "0.00",
"downgrade_to_membership_level_id": "0",
"accumulated_counter": {
"counter_point_value": "20",
"counter_gmv_value": "0"
},
"accumulated_gmv_counter_id": "85",
"level_text_color": "#872415",
"level_background_color": "#FFFFFF",
"images": [],
"membership_level_term_and_conditions": [
{
"icon": "ic_membership_voucher",
"title": "Ưu đãi từ Mobifone",
"content": "<ul style=\"margin: 0px;\"> <li><span style=\"font-size: 12pt;\"> <span style=\"font-weight: 400;\">Tích điểm 1% khi nạp thẻ trên mọi hình thức (MyPoint, ngân hàng, MyMobiFone, thẻ cào,...)</span> </span></li> </ul>"
}
],
"level_end_at_date": "30/06/2025",
"level_start_at_date": "2024-12-05"
},
{
"id": "13",
"membership_level_code": "HANG_BAC",
"membership_level_rank": "2",
"membership_level_name": "Hạng Bạc",
"membership_level_description": "Bạc",
"membership_level_content": "",
"membership_level_term_and_condition": "<p style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><strong>&lt;ic_membership_voucher&gt; Ưu đãi từ Mobifone<br /></strong></span></p><ul style=\"font-size: 12pt; font-weight: 400;\"><li>Tích điểm 1% khi nạp thẻ trên mọi hình thức (MyPoint, ngân hàng, MyMobiFone, thẻ cào,...)</li></ul><p>=====</p><p style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><strong>&lt;ic_membership_promotion&gt; Ưu đãi thăng hạng<br /></strong></span></p><ul style=\"font-size: 12pt; font-weight: 400;\"><li>Cộng 5.000 điểm vào tài khoản MyPoint</li></ul><p>=====</p><p style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><strong>&lt;ic_membership_cashback&gt; Ưu đãi hoàn điểm<br /></strong></span></p><ul style=\"font-size: 12pt; font-weight: 400;\"><li>Hoàn thêm 1.000 điểm cho các giao dịch trên 1 triệu</li></ul>",
"logo": "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/02966D62A8E4A4443AAD3DF8C7CBB0C7/1672388594",
"upgrage_type": "PAG",
"refresh_level_after_months_from_start_date": "6",
"upgrade_when_counter_is_greater_or_equal": "600000.00",
"upgrade_when_counter_gmv_is_greater_or_equal": "3000000.00",
"upgrade_to_membership_level_id": "16",
"downgrade_level_when_counter_is_less_than": "100000.00",
"downgrade_level_when_counter_gmv_is_less_than": "1000000.00",
"downgrade_to_membership_level_id": "10",
"accumulated_gmv_counter_id": "85",
"level_text_color": "#353546",
"level_background_color": "#FFFFFF",
"images": [
{
"type": "BACKGROUND",
"caption": "",
"image_url": "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/C65C9C99B2380470E4E7C3993C4C2D58/1672813121"
}
],
"membership_level_term_and_conditions": [
{
"icon": "ic_membership_voucher",
"title": "Ưu đãi từ Mobifone",
"content": "<ul style=\"font-size: 12pt; font-weight: 400;\"><li>Tích điểm 1% khi nạp thẻ trên mọi hình thức (MyPoint, ngân hàng, MyMobiFone, thẻ cào,...)</li></ul>"
},
{
"icon": "ic_membership_promotion",
"title": "Ưu đãi thăng hạng",
"content": "<ul style=\"font-size: 12pt; font-weight: 400;\"><li>Cộng 5.000 điểm vào tài khoản MyPoint</li></ul>"
},
{
"icon": "ic_membership_cashback",
"title": "Ưu đãi hoàn điểm",
"content": "<ul style=\"font-size: 12pt; font-weight: 400;\"><li>Hoàn thêm 1.000 điểm cho các giao dịch trên 1 triệu</li></ul>"
}
],
"level_end_at_date": "30/06/2025"
},
{
"id": "16",
"membership_level_code": "HANG_VANG",
"membership_level_rank": "3",
"membership_level_name": "Hạng Vàng",
"membership_level_description": "Vàng",
"membership_level_content": "",
"membership_level_term_and_condition": "<p style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><strong>&lt;ic_membership_voucher&gt; Ưu đãi từ Mobifone<br /></strong></span></p> <ul> <li><span style=\"font-size: 12pt;\"><span style=\"font-weight: 400;\">Tích điểm 1% khi nạp thẻ trên mọi hình thức (MyPoint, ngân hàng, MyMobiFone, thẻ cào,...)</span></span></li> </ul> <p>=====</p> <p style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><strong>&lt;ic_membership_promotion&gt; Ưu đãi thăng hạng<br /></strong></span></p> <ul> <li><span style=\"font-size: 12pt;\"><span style=\"font-weight: 400;\">Cộng 10.000 điểm vào tài khoản Mypoint</span></span></li> </ul> <p>=====</p> <p style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><strong>&lt;ic_membership_cashback&gt; Ưu đãi hoàn điểm<br /></strong></span></p> <ul> <li style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><span style=\"font-weight: 400;\">Hoàn thêm 2.000 điểm cho các giao dịch trên 1 triệu</span></span></li> </ul>",
"logo": "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/914959AF1BCB1AAD2CC0C1D4ADD93954/1672389218",
"upgrage_type": "PAG",
"refresh_level_after_months_from_start_date": "6",
"upgrade_when_counter_is_greater_or_equal": "1000000.00",
"upgrade_when_counter_gmv_is_greater_or_equal": "5000000.00",
"upgrade_to_membership_level_id": "19",
"downgrade_level_when_counter_is_less_than": "1000000.00",
"downgrade_level_when_counter_gmv_is_less_than": "3000000.00",
"downgrade_to_membership_level_id": "13",
"accumulated_gmv_counter_id": "85",
"level_text_color": "#C97108",
"level_background_color": "#FFFFFF",
"images": [
{
"type": "BACKGROUND",
"caption": "",
"image_url": "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/E08C495249C39294BB245319462843F1/1672396844"
}
],
"membership_level_term_and_conditions": [
{
"icon": "ic_membership_voucher",
"title": "Ưu đãi từ Mobifone",
"content": " <ul> <li><span style=\"font-size: 12pt;\"><span style=\"font-weight: 400;\">Tích điểm 1% khi nạp thẻ trên mọi hình thức (MyPoint, ngân hàng, MyMobiFone, thẻ cào,...)</span></span></li> </ul> "
},
{
"icon": "ic_membership_promotion",
"title": "Ưu đãi thăng hạng",
"content": " <ul> <li><span style=\"font-size: 12pt;\"><span style=\"font-weight: 400;\">Cộng 10.000 điểm vào tài khoản Mypoint</span></span></li> </ul> "
},
{
"icon": "ic_membership_cashback",
"title": "Ưu đãi hoàn điểm",
"content": " <ul> <li style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><span style=\"font-weight: 400;\">Hoàn thêm 2.000 điểm cho các giao dịch trên 1 triệu</span></span></li> </ul>"
}
],
"level_end_at_date": "30/06/2025"
},
{
"id": "19",
"membership_level_code": "KIM_CUONG",
"membership_level_rank": "4",
"membership_level_name": "Hạng Kim Cương",
"membership_level_description": "Kim Cương",
"membership_level_content": "",
"membership_level_term_and_condition": "<p style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><strong>&lt;ic_membership_voucher&gt; Ưu đãi từ Mobifone<br /></strong></span></p> <ul> <li><span style=\"font-size: 12pt;\"><span style=\"font-weight: 400;\">Tích điểm 1% khi nạp thẻ trên mọi hình thức (MyPoint, ngân hàng, MyMobiFone, thẻ cào,...)</span></span></li> </ul> <p>=====</p> <p style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><strong>&lt;ic_membership_promotion&gt; Ưu đãi thăng hạng<br /></strong></span></p> <ul> <li><span style=\"font-size: 12pt;\"><span style=\"font-weight: 400;\">Cộng 50.000 điểm vào tài khoản Mypoint</span></span></li> </ul> <p>=====</p> <p style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><strong>&lt;ic_membership_cashback&gt; Ưu đãi hoàn điểm<br /></strong></span></p> <ul> <li style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><span style=\"font-weight: 400;\">Hoàn thêm 5.000 điểm cho các giao dịch trên 1 triệu</span></span></li> </ul>",
"logo": "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/1991F2B477B5C1D6239DD4B8720414D0/1672389305",
"upgrage_type": "PAG",
"refresh_level_after_months_from_start_date": "6",
"upgrade_when_counter_is_greater_or_equal": "2000000.00",
"upgrade_when_counter_gmv_is_greater_or_equal": "5000000.00",
"upgrade_to_membership_level_id": "0",
"downgrade_level_when_counter_is_less_than": "2000000.00",
"downgrade_level_when_counter_gmv_is_less_than": "5000000.00",
"downgrade_to_membership_level_id": "16",
"accumulated_gmv_counter_id": "85",
"level_text_color": "#0D0D0D",
"level_background_color": "#FFFFFFF",
"images": [
{
"type": "BACKGROUND",
"caption": "",
"image_url": "https://api.mypoint.com.vn/8854/gup2start/rest/photoReader/1.0.0/38806D88D7F201FB41AD2A39E18BD640/1672396855"
}
],
"membership_level_term_and_conditions": [
{
"icon": "ic_membership_voucher",
"title": "Ưu đãi từ Mobifone",
"content": " <ul> <li><span style=\"font-size: 12pt;\"><span style=\"font-weight: 400;\">Tích điểm 1% khi nạp thẻ trên mọi hình thức (MyPoint, ngân hàng, MyMobiFone, thẻ cào,...)</span></span></li> </ul> "
},
{
"icon": "ic_membership_promotion",
"title": "Ưu đãi thăng hạng",
"content": " <ul> <li><span style=\"font-size: 12pt;\"><span style=\"font-weight: 400;\">Cộng 50.000 điểm vào tài khoản Mypoint</span></span></li> </ul> "
},
{
"icon": "ic_membership_cashback",
"title": "Ưu đãi hoàn điểm",
"content": " <ul> <li style=\"text-align: justify;\"><span style=\"font-size: 12pt;\"><span style=\"font-weight: 400;\">Hoàn thêm 5.000 điểm cho các giao dịch trên 1 triệu</span></span></li> </ul>"
}
],
"level_end_at_date": "30/06/2025"
}
],
"membership_rule": "17629"
}
}
\ No newline at end of file
......@@ -17,7 +17,6 @@ abstract class BaseScreen extends StatefulWidget {
}
abstract class BaseState<Screen extends BaseScreen> extends State<Screen> {
@override
void initState() {
super.initState();
......@@ -89,4 +88,4 @@ abstract class BaseState<Screen extends BaseScreen> extends State<Screen> {
Widget? createBottomBar() {
return null;
}
}
\ No newline at end of file
}
import 'package:flutter/material.dart';
import 'base_screen.dart';
......
......@@ -58,4 +58,9 @@ class APIPaths {
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";
static const String getCustomerProducts = "/product/api/v2.0/customer/products";
static const String updateWorkerSiteProfile = "/workerSiteProfileUpdate/2.0.0";
static const String locationDistrictGetList = "/locationDistrictGetList/1.0.0";
static const String locationProvinceGetList = "/locationProvinceGetList/1.0.0";
static const String getMembershipLevelInfo = "/primaryMembershipLevelGetList/2.0.0";
}
\ No newline at end of file
......@@ -93,6 +93,8 @@ enum DirectionalScreenName {
introduction,
listPaymentOfElectric,
favorite,
pointHunting,
orderMenu,
unknown,
}
......@@ -105,10 +107,14 @@ extension DirectionalScreenRouterExtension on DirectionalScreenName {
return notificationScreen;
case DirectionalScreenName.home:
return mainScreen;
case DirectionalScreenName.productOwnVoucher:
return voucherDetailScreen;
case DirectionalScreenName.productOwnVoucher:
return voucherDetailScreen;
case DirectionalScreenName.customerSupport:
return supportScreen;
case DirectionalScreenName.pointHunting:
return achievementListScreen;
case DirectionalScreenName.orderMenu:
return orderMenuScreen;
default:
return '';
}
......@@ -302,14 +308,18 @@ extension DirectionalScreenNameExtension on DirectionalScreenName {
return "APP_SCREEN_LIST_PAYMENT_OF_ELECTRIC";
case DirectionalScreenName.favorite:
return "APP_SCREEN_CATEGORY_TAB_FAVORITE";
case DirectionalScreenName.pointHunting:
return "APP_SCREEN_POINT_HUNTING";
case DirectionalScreenName.unknown:
return "UNKNOWN";
case DirectionalScreenName.orderMenu:
return "APP_SCREEN_ORDER_MENU";
}
}
static DirectionalScreenName fromRawValue(String rawValue) {
return DirectionalScreenName.values.firstWhere(
(e) => e.rawValue == rawValue,
(e) => e.rawValue == rawValue,
orElse: () => DirectionalScreenName.unknown,
);
}
......
......@@ -50,6 +50,24 @@ class DirectionalScreen {
case DirectionalScreenName.gameCenter:
Get.toNamed(vplayGameCenterScreen);
return true;
case DirectionalScreenName.viewAllVoucher:
Get.toNamed(vouchersScreen, arguments: {"enableSearch": true});
return true;
case DirectionalScreenName.news:
Get.toNamed(newsListScreen);
return true;
case DirectionalScreenName.gifts:
Get.toNamed(achievementListScreen);
return true;
case DirectionalScreenName.pointHunting:
Get.toNamed(achievementListScreen, arguments: true);
return true;
case DirectionalScreenName.myPurchaseItems || DirectionalScreenName.myPurchaseItemsWaitingList:
Get.toNamed(myVoucherListScreen);
return true;
case DirectionalScreenName.orderMenu:
Get.toNamed(orderMenuScreen);
return true;
default:
print("Không nhận diện được action type: $clickActionType");
return false;
......
extension SafeListAccess<T> on List<T> {
T? safe(int index) {
if (index < 0 || index >= length) return null;
return this[index];
}
}
\ No newline at end of file
......@@ -32,6 +32,7 @@ enum CurrencyUnit {
usd(' USD'),
eur(' EUR'),
none(' '),
noneSpace(''),
point(' điểm');
final String symbol;
......
......@@ -15,6 +15,13 @@ extension StringConvert on String {
var digest1 = sha256.convert(bytes1);
return digest1.toString();
}
String capitalizeWords() {
return split(' ').map((word) {
if (word.isEmpty) return word;
return word[0].toUpperCase() + word.substring(1).toLowerCase();
}).join(' ');
}
}
/// Hàm parse hex -> Color
......@@ -80,4 +87,9 @@ extension ParseInt on String {
return 0;
}
}
}
\ No newline at end of file
}
bool isHttpUrl(String? url) {
if (url == null) return false;
return url.startsWith('http://') || url.startsWith('https://');
}
import 'package:json_annotation/json_annotation.dart';
import 'package:mypoint_flutter_app/model/auth/customer_balance_model.dart';
import '../../screen/membership/models/membership_level_model.dart';
part 'working_site_model.g.dart';
@JsonSerializable()
class WorkingSiteModel {
final String? id;
final String? name;
// final String? name;
final String? avatar;
@JsonKey(name: 'primary_membership')
final PrimaryMembershipModel? primaryMembership;
WorkingSiteModel({
this.id,
this.name,
// this.name,
this.avatar,
this.primaryMembership,
});
factory WorkingSiteModel.fromJson(Map<String, dynamic> json) => _$WorkingSiteModelFromJson(json);
Map<String, dynamic> toJson() => _$WorkingSiteModelToJson(this);
}
@JsonSerializable()
class PrimaryMembershipModel {
@JsonKey(name: 'membership_level')
final MembershipLevelShortModel? membershipLevel;
PrimaryMembershipModel({
this.membershipLevel,
});
factory PrimaryMembershipModel.fromJson(Map<String, dynamic> json) => _$PrimaryMembershipModelFromJson(json);
Map<String, dynamic> toJson() => _$PrimaryMembershipModelToJson(this);
}
@JsonSerializable()
class MembershipLevelShortModel {
final String? levelId;
@JsonKey(name: 'level_code')
final String? levelCode;
@JsonKey(name: 'level_name')
final String? levelName;
@JsonKey(name: 'level_logo')
final String? levelLogo;
MembershipLevelShortModel({
this.levelId,
this.levelCode,
this.levelName,
this.levelLogo,
});
factory MembershipLevelShortModel.fromJson(Map<String, dynamic> json) => _$MembershipLevelShortModelFromJson(json);
Map<String, dynamic> toJson() => _$MembershipLevelShortModelToJson(this);
}
\ No newline at end of file
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