diff --git a/h5/assets/loading-C5mRJwKD-1776148661447.webp b/h5/assets/loading-C5mRJwKD-1776148661447.webp deleted file mode 100644 index 974165c..0000000 Binary files a/h5/assets/loading-C5mRJwKD-1776148661447.webp and /dev/null differ diff --git a/h5/assets/yumi-ranking/Ranking/Overall.zip b/h5/assets/yumi-ranking/Ranking/Overall.zip new file mode 100644 index 0000000..50d1723 Binary files /dev/null and b/h5/assets/yumi-ranking/Ranking/Overall.zip differ diff --git a/h5/assets/yumi-ranking/Ranking/Overall/da.png b/h5/assets/yumi-ranking/Ranking/Overall/da.png new file mode 100644 index 0000000..3705cf9 Binary files /dev/null and b/h5/assets/yumi-ranking/Ranking/Overall/da.png differ diff --git a/h5/assets/yumi-ranking/Ranking/da.png b/h5/assets/yumi-ranking/Ranking/da.png new file mode 100644 index 0000000..3705cf9 Binary files /dev/null and b/h5/assets/yumi-ranking/Ranking/da.png differ diff --git a/h5/bd-center/bd-center.css b/h5/bd-center/bd-center.css new file mode 100644 index 0000000..a793c6b --- /dev/null +++ b/h5/bd-center/bd-center.css @@ -0,0 +1,320 @@ +@font-face { + font-family: "Baloo 2"; + src: url("/assets/BalooDa2-Regular-Da9EMwmM-1776148661447.ttf") format("truetype"); + font-weight: 400; + font-style: normal; + font-display: swap; +} + +@font-face { + font-family: "Baloo 2"; + src: url("/assets/BalooDa2-SemiBold-B7mlaStc-1776148661447.ttf") format("truetype"); + font-weight: 600; + font-style: normal; + font-display: swap; +} + +* { + box-sizing: border-box; + margin: 0; + padding: 0; + font-family: "Baloo 2", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; + line-height: 1.4; +} + +html, +body { + width: 100%; + min-height: 100%; + -webkit-font-smoothing: antialiased; + -webkit-text-size-adjust: 100%; + -webkit-overflow-scrolling: touch; + -webkit-tap-highlight-color: transparent; + overflow-x: hidden; +} + +body { + color: #21342a; + background: #edf8f1; +} + +button { + border: 0; + background: transparent; + color: inherit; + font: inherit; +} + +.bd-center { + min-height: 100vh; + overflow-y: auto; + background-color: #edf8f1; + background-image: none; +} + +.bd-center::-webkit-scrollbar { + display: none; +} + +.page-header { + position: sticky; + top: 0; + z-index: 10; + display: grid; + grid-template-columns: 44px 1fr 54px; + align-items: center; + width: 100%; + min-height: calc(48px + env(safe-area-inset-top)); + padding: env(safe-area-inset-top) 10px 0; + background: #f8fff9; + border-bottom: 1px solid #cce9d7; + box-shadow: 0 4px 14px rgba(75, 137, 95, 0.14); +} + +.page-header h1 { + min-width: 0; + font-size: 1.4em; + font-weight: 600; + text-align: center; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: #153d28; +} + +.icon-button, +.language-button { + min-width: 36px; + height: 36px; + display: flex; + align-items: center; + justify-content: center; + font-weight: 600; + color: #1f6f46; +} + +.icon-button span { + display: block; + font-size: 2em; + line-height: 1; +} + +.language-button { + font-size: 0.9em; + border-radius: 999px; + background: #dff5e7; + color: #24724a; +} + +.content { + position: relative; + z-index: 2; + display: flex; + flex-direction: column; + gap: 14px; + padding: 16px; +} + +.surface-card { + position: relative; + border: 1px solid #b7e0c6; + border-radius: 18px; + background: #ffffff; + box-shadow: 0 8px 20px rgba(69, 129, 89, 0.12); +} + +.salary-card { + margin-bottom: 12px; + padding: 18px; + background: #f8fff9; + border-color: #94d9ae; + overflow: hidden; +} + +.salary-card::after { + content: ""; + position: absolute; + right: 18px; + bottom: 18px; + width: 64px; + height: 64px; + border-radius: 20px; + background: #d7f5e2; + border: 10px solid #ecfbf1; + opacity: 0.9; +} + +.salary-title { + position: relative; + z-index: 1; + display: flex; + justify-content: space-between; + gap: 8px; + margin-bottom: 5px; +} + +.salary-title span { + min-width: 0; + font-weight: 600; + color: #244735; +} + +.salary-title button { + flex-shrink: 0; + padding: 4px 10px; + border-radius: 999px; + background: #fff3c8; + color: #846216; + font-weight: 600; +} + +.salary-amount { + position: relative; + z-index: 1; + font-size: 1.5em; + font-weight: 600; + color: #105c36; +} + +.menu-card { + margin: 0 1% 12px; + padding: 10px; + background: #fbfffc; +} + +.menu-row { + width: 100%; + min-height: 4.8em; + display: flex; + justify-content: space-between; + align-items: center; + gap: 10px; + padding: 10px 12px; + border-radius: 14px; + text-align: left; +} + +.menu-row:nth-of-type(1) { + background: #eefbf3; +} + +.menu-row:nth-of-type(2) { + background: #f7fbec; +} + +.menu-row:nth-of-type(3) { + background: #eef7fb; +} + +.menu-row:nth-of-type(4) { + background: #fff5ed; +} + +.menu-row:nth-of-type(5) { + background: #eefbf3; +} + +.menu-label { + flex: 1; + min-width: 0; + display: flex; + align-items: center; + gap: 12px; +} + +.menu-label img { + display: block; + width: 2.7em; + padding: 0.55em; + aspect-ratio: 1 / 1; + flex-shrink: 0; + border-radius: 14px; + background: #d7f5e2; + border: 1px solid #bce5ca; +} + +.menu-row:nth-of-type(3) .menu-label img { + background: #dff2fb; + border-color: #c0e1f1; +} + +.menu-row:nth-of-type(4) .menu-label img { + background: #ffe6d6; + border-color: #ffd2b7; +} + +.menu-row:nth-of-type(5) .menu-label img { + background: #fff0bc; + border-color: #f3d978; +} + +.menu-label span { + min-width: 0; + font-size: 1em; + font-weight: 600; + color: #244735; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.menu-row > img { + display: block; + width: 1.3em; + aspect-ratio: 1 / 1; + flex-shrink: 0; + opacity: 0.55; +} + +.divider { + border-bottom: 0; + margin: 8px 0; +} + +.toast { + position: fixed; + left: 50%; + bottom: calc(28px + env(safe-area-inset-bottom)); + z-index: 50; + max-width: 86vw; + transform: translateX(-50%); + padding: 10px 14px; + border-radius: 8px; + color: #fff; + background: rgba(0, 0, 0, 0.75); + font-size: 13px; + font-weight: 500; + text-align: center; +} + +[dir="rtl"] .flip-img { + transform: scaleX(-1); +} + +[dir="rtl"] .menu-row { + text-align: right; +} + +@media screen and (max-width: 360px) { + .bd-center { + font-size: 10px; + } +} + +@media screen and (min-width: 360px) { + .bd-center { + font-size: 12px; + } +} + +@media screen and (min-width: 768px) { + .bd-center { + font-size: 24px; + } +} + +@media screen and (min-width: 1024px) { + .bd-center { + font-size: 32px; + } +} diff --git a/h5/bd-center/bd-center.js b/h5/bd-center/bd-center.js new file mode 100644 index 0000000..78cd962 --- /dev/null +++ b/h5/bd-center/bd-center.js @@ -0,0 +1,331 @@ +import { _ as policyIcon, a as bankIcon, b as giftIcon } from "../js/database-export-CGwyHyM--1776148658686.js"; +import { _ as arrowIcon } from "../js/arrow-Cf0JWzXk-1776148658686.js"; +import { _ as inviteIcon } from "../js/users-plus-BsDDiQEG-1776148658686.js"; + +const API_BASE_URL = "https://jvapi.haiyihy.com"; + +const labels = { + en: { + bd_center: "BD Center", + my_available_salary: "My available salary", + bd_salary_link: "BD salary", + bd_policy_link: "BD policy", + agency_list_link: "Agency list", + invite_become_agent: "Invite to become agent", + bank_cards_link: "Bank cards", + send_welcome_gift: "Send welcome gift", + failed_to_load_balance: "Failed to load balance. Please try again.", + failed_to_load_permission: "Failed to load permission. Please try again." + }, + ar: { + bd_center: "BD Center", + my_available_salary: "My available salary", + bd_salary_link: "BD salary", + bd_policy_link: "BD policy", + agency_list_link: "Agency list", + invite_become_agent: "Invite to become agent", + bank_cards_link: "Bank cards", + send_welcome_gift: "Send welcome gift", + failed_to_load_balance: "Failed to load balance. Please try again.", + failed_to_load_permission: "Failed to load permission. Please try again." + }, + tr: { + bd_center: "BD Center", + my_available_salary: "My available salary", + bd_salary_link: "BD salary", + bd_policy_link: "BD policy", + agency_list_link: "Agency list", + invite_become_agent: "Invite to become agent", + bank_cards_link: "Bank cards", + send_welcome_gift: "Send welcome gift", + failed_to_load_balance: "Failed to load balance. Please try again.", + failed_to_load_permission: "Failed to load permission. Please try again." + }, + bn: { + bd_center: "BD Center", + my_available_salary: "My available salary", + bd_salary_link: "BD salary", + bd_policy_link: "BD policy", + agency_list_link: "Agency list", + invite_become_agent: "Invite to become agent", + bank_cards_link: "Bank cards", + send_welcome_gift: "Send welcome gift", + failed_to_load_balance: "Failed to load balance. Please try again.", + failed_to_load_permission: "Failed to load permission. Please try again." + } +}; + +let commonHeaders = { + authorization: "Bearer undefined", + "req-app-intel": "version=1.0.0;build=1;model=SM-G9550;sysVersion=9;channel=Google", + "req-client": "Android", + "req-imei": "8fa54d728ab449e04f9292329ed44bda", + "req-lang": "id-ID", + "req-sys-origin": "origin=ATYOU;originChild=ATYOU", + "req-version": "V2", + "req-zone": "Asia/Shanghai" +}; + +const state = { + lang: resolveLanguage(), + balance: 0, + hasGiftPermission: false +}; + +function resolveLanguage() { + const params = new URLSearchParams(window.location.search); + const hashQuery = window.location.hash.includes("?") ? window.location.hash.split("?")[1] : ""; + const hashParams = new URLSearchParams(hashQuery); + const lang = params.get("lang") || hashParams.get("lang") || navigator.language || "en"; + + if (lang.startsWith("ar")) return "ar"; + if (lang.startsWith("tr")) return "tr"; + if (lang.startsWith("bn")) return "bn"; + return "en"; +} + +function t(key) { + return (labels[state.lang] && labels[state.lang][key]) || labels.en[key] || key; +} + +function setLanguage() { + document.documentElement.lang = state.lang; + document.documentElement.dir = state.lang === "ar" ? "rtl" : "ltr"; + document.querySelector("[data-action='language']").textContent = state.lang.toUpperCase(); + document.querySelectorAll("[data-i18n]").forEach((node) => { + node.textContent = t(node.dataset.i18n); + }); +} + +function setIcons() { + const iconMap = { + policy: policyIcon, + bank: bankIcon, + gift: giftIcon, + arrow: arrowIcon, + invite: inviteIcon + }; + + document.querySelectorAll("[data-icon]").forEach((img) => { + img.src = iconMap[img.dataset.icon] || ""; + }); +} + +function formatMoney(value) { + if (value === null || value === undefined || value === "") return "0"; + const number = Number(value); + if (Number.isNaN(number)) return String(value); + return Number.isInteger(number) ? String(number) : number.toFixed(2); +} + +function render() { + document.getElementById("availableBalance").textContent = `$${formatMoney(state.balance)}`; + document.querySelectorAll(".gift-permission").forEach((node) => { + node.hidden = !state.hasGiftPermission; + }); +} + +function showToast(message) { + const toast = document.getElementById("toast"); + toast.textContent = message; + toast.hidden = false; + window.clearTimeout(showToast.timer); + showToast.timer = window.setTimeout(() => { + toast.hidden = true; + }, 2500); +} + +function isMobileDevice() { + return /Android|iPad|iPhone|iPod/.test(navigator.userAgent); +} + +function isAppEnvironment() { + return Boolean(window.app || window.webkit || window.FlutterPageControl); +} + +function splitHeaderPairs(value) { + const result = {}; + if (!value) return result; + value.split(";").forEach((item) => { + const index = item.indexOf("="); + if (index > -1) { + result[item.slice(0, index)] = item.slice(index + 1); + } + }); + return result; +} + +function parseAccessOrigin(raw) { + const data = JSON.parse(raw); + const appIntel = splitHeaderPairs(data["Req-App-Intel"]); + const sysOrigin = splitHeaderPairs(data["Req-Sys-Origin"]); + + return { + reqLang: data["Req-Lang"], + authorization: data.Authorization, + buildVersion: appIntel.build, + appVersion: appIntel.version, + appChannel: appIntel.channel, + reqImei: appIntel["Req-Imei"], + sysOrigin: sysOrigin.origin, + sysOriginChild: sysOrigin.child + }; +} + +function setHeadersFromApp(headers) { + const next = {}; + if (headers.authorization) next.authorization = headers.authorization; + if (headers.reqLang) next["req-lang"] = headers.reqLang; + if (headers.appVersion || headers.buildVersion || headers.appChannel) { + const intel = []; + if (headers.appVersion) intel.push(`version=${headers.appVersion}`); + if (headers.buildVersion) intel.push(`build=${headers.buildVersion}`); + if (headers.appChannel) intel.push(`channel=${headers.appChannel}`); + next["req-app-intel"] = intel.join(";"); + } + if (headers.reqImei) next["req-imei"] = headers.reqImei; + if (headers.sysOrigin) { + const origin = [`origin=${headers.sysOrigin}`]; + if (headers.sysOriginChild) origin.push(`child=${headers.sysOriginChild}`); + next["req-sys-origin"] = origin.join(";"); + } + commonHeaders = { ...commonHeaders, ...next }; +} + +function requestAccessOrigin() { + return new Promise((resolve) => { + window.renderData = resolve; + window.getIosAccessOriginParam = resolve; + + if (!isAppEnvironment()) { + setHeadersFromApp({ + authorization: "", + reqLang: state.lang, + appVersion: "1.0.0", + buildVersion: "1", + appChannel: "Web", + reqImei: "H5-STATIC", + sysOrigin: "LIKEI", + sysOriginChild: "LIKEI" + }); + resolve(null); + return; + } + + let attempt = 0; + const maxAttempts = 50; + const poll = () => { + attempt += 1; + if (window.app && typeof window.app.getAccessOrigin === "function") { + resolve(window.app.getAccessOrigin()); + return; + } + if (attempt < maxAttempts) { + window.setTimeout(poll, 100); + return; + } + if (window.FlutterApp && typeof window.FlutterApp.postMessage === "function") { + window.FlutterApp.postMessage("requestAccessOrigin"); + } + }; + + if (isMobileDevice()) { + poll(); + } else { + resolve(null); + } + }); +} + +async function connectToApp() { + const raw = await requestAccessOrigin(); + if (!raw) return; + setHeadersFromApp(parseAccessOrigin(raw)); +} + +async function apiGet(path) { + const response = await fetch(`${API_BASE_URL}${path}`, { + method: "GET", + headers: commonHeaders + }); + + const data = await response.json().catch(() => ({})); + if (!response.ok || data.status === false) { + const error = new Error(data.errorMsg || data.message || `Request failed: ${response.status}`); + error.response = data; + throw error; + } + return data; +} + +async function fetchBalance() { + const result = await apiGet("/wallet/salary-account/balance?salaryType=BD_SALARY"); + if (result.status && result.body) { + state.balance = result.body.availableBalance || 0; + } +} + +async function fetchGiftPermission() { + const result = await apiGet("/sys/bd/own-permission"); + if (result.status) { + state.hasGiftPermission = Boolean(result.body); + } +} + +function navigateTo(target) { + const url = new URL(target, window.location.origin); + const currentLang = new URLSearchParams(window.location.search).get("lang"); + if (currentLang && !url.searchParams.has("lang")) { + url.searchParams.set("lang", currentLang); + } + window.location.href = `${url.pathname}${url.search}${url.hash}`; +} + +function bindEvents() { + document.querySelector("[data-action='back']").addEventListener("click", () => { + if (window.history.length > 1) { + window.history.back(); + return; + } + if (window.app && typeof window.app.closePage === "function") { + window.app.closePage(); + return; + } + if (window.FlutterPageControl && typeof window.FlutterPageControl.postMessage === "function") { + window.FlutterPageControl.postMessage("close_page"); + } + }); + + document.querySelector("[data-action='language']").addEventListener("click", () => { + navigateTo("/language"); + }); + + document.querySelectorAll("[data-route]").forEach((node) => { + node.addEventListener("click", () => navigateTo(node.dataset.route)); + }); +} + +async function init() { + setLanguage(); + setIcons(); + bindEvents(); + render(); + localStorage.setItem("identity", JSON.stringify({ identity: "BD" })); + + try { + await connectToApp(); + const results = await Promise.allSettled([fetchBalance(), fetchGiftPermission()]); + results.forEach((result) => { + if (result.status === "rejected") { + console.warn("BD center data request failed:", result.reason); + } + }); + } catch (error) { + console.warn("BD center initialization failed:", error); + showToast(error.response?.errorMsg || error.message || t("failed_to_load_balance")); + } finally { + render(); + } +} + +init(); diff --git a/h5/bd-center/index.html b/h5/bd-center/index.html index c4da441..d43533d 100644 --- a/h5/bd-center/index.html +++ b/h5/bd-center/index.html @@ -13,23 +13,85 @@ - Yumi H5 - - - - - + BD Center + -
+
+ + +
+
+
+ My available salary + +
+
$0
+
+ + +
+
+ + + diff --git a/h5/favicon.ico b/h5/favicon.ico index 3195079..166548e 100644 Binary files a/h5/favicon.ico and b/h5/favicon.ico differ diff --git a/h5/ranking/index.html b/h5/ranking/index.html index 69475b7..bf149f5 100644 --- a/h5/ranking/index.html +++ b/h5/ranking/index.html @@ -22,7 +22,7 @@ -webkit-overflow-scrolling: touch; } - + diff --git a/h5/ranking/ranking.css b/h5/ranking/ranking.css index fb7a5bb..6d1e115 100644 --- a/h5/ranking/ranking.css +++ b/h5/ranking/ranking.css @@ -6,6 +6,8 @@ body, margin: 0; padding: 0; max-width: none; + + font-family: 'Courier New', Courier, monospace; } main{ @@ -228,6 +230,7 @@ body { display: flex; justify-content: space-around; margin-top: 0; + transform: translateY(-26px); } .top-user { @@ -280,7 +283,6 @@ body { flex-direction: column; justify-content: flex-end; align-items: center; - gap: 1vw; } .top-name-box { @@ -300,6 +302,11 @@ body { .top1-text { font-size: 0.9em; } +.top1-text.quantity-text { + font-size: 1.5em; + font-family: 'Courier New', Courier, monospace; +} + .top-text { font-size: 0.7em; @@ -308,8 +315,8 @@ body { .quantity-pill { position: relative; border-radius: 80px; - border: 1px solid #ffdf36; - background: linear-gradient(270deg, #000 0%, #3b3b3b 47.45%, #000 100%); + /* border: 1px solid #ffdf36; */ + /* background: linear-gradient(270deg, #000 0%, #3b3b3b 47.45%, #000 100%); */ box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.4) inset; } @@ -317,8 +324,6 @@ body { display: flex; justify-content: center; align-items: center; - gap: 2px; - padding: 3px 5px; } .coin-icon { @@ -340,7 +345,9 @@ body { padding: 3vw 3vw 0; display: flex; flex-direction: column; - gap: 2vw; + gap: 1vw; + padding-top: 0; + transform: translateY(-32px); } .item-center { @@ -462,9 +469,8 @@ body { } .my-ranking .item-content { - padding: 0 4vw 0; + padding: 0 1vw 0; justify-content: space-between; - gap: 8px; } .my-ranking .mine-rank div, diff --git a/h5/ranking/ranking.js b/h5/ranking/ranking.js index 29cf5bb..ae4d404 100644 --- a/h5/ranking/ranking.js +++ b/h5/ranking/ranking.js @@ -5,7 +5,7 @@ var ASSET_BASE = "/assets/yumi-ranking/Ranking/Overall/"; var BG_VERSION = "20260424c"; var DEFAULT_AVATAR = "/assets/da.png"; - var COIN_ICON = "/assets/coin-lz3Tp0nX-1776148661447.png"; + var COIN_ICON = ""; var LOADING_GIF = "/assets/loading-ranking.gif"; var BACK_ICON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADxSURBVHgB7dvBDYJAFEXRHyuhBEuzA+3EWAmlUIJ2MDJCNATy5m1I1H9PwoZhww3Mgh8iAAAAAACllG48joGlOUxfPoZ6LvCOM5S1PrITcV4is1acuhY7O8SXmveX+gp14rJbZGQ8OdUlMiKOQByBOAJxBOIIxBGIIxBHII5AHIE4AnEE4gjEEYgjEKeBOMJ488d/irPHN+lHYz33JKIqywHflnNkZm7SRCJSA5EMRDIQyUAkA5EMRDIQyUAkA5EMRDIQyUAkA5EMRDIQyWBGOkVmRqR7ZNeKFJCRroHJRqS+8DvUWpkGk10AAAAAwO96AiOznp1YXpZWAAAAAElFTkSuQmCC"; @@ -488,13 +488,13 @@ function topLayout(isTopOne) { return { - width: isTopOne ? "52%" : "34%", - minHeight: isTopOne ? "82vw" : "55vw", + width: isTopOne ? "44%" : "34%", + minHeight: isTopOne ? "66vw" : "55vw", avatarLayer: "height:55%", avatarWidth: isTopOne ? "45%" : "47%", nameBox: isTopOne ? "height:6vw;width:55%" : "height:4.5vw;width:65%", pillWidth: isTopOne ? "55%" : "70%", - infoStyle: isTopOne ? "bottom:12%" : "bottom:11%" + infoStyle: isTopOne ? "bottom:27%" : "bottom:29%" }; } @@ -519,7 +519,7 @@ function renderLoading() { return '
' + - '
' + + '
' + renderBgLayer() + '' + '

' + escapeHtml(t("loading")) + '...

' + @@ -610,7 +610,6 @@ function renderQuantityPill(quantity, width, isTopOne) { return '
' + '
' + - '' + '
' + escapeHtml(quantity) + '
' + @@ -645,7 +644,6 @@ '
' + escapeHtml(name) + '
' + '
' + '
' + - '' + '
' + escapeHtml(quantity) + '
' + '
'; return renderItemCenter( @@ -669,7 +667,6 @@ '
' + escapeHtml(name) + '
' + '
' + '
' + - '' + '
' + escapeHtml(String(quantity)) + '
' + '
'; return renderItemCenter("my-ranking", "", asset("myRankingBg"), content);