吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 4795|回复: 70
收起左侧

[Android] 余额宝收益计算器1.0

  [复制链接]
头像被屏蔽
feng5249462 发表于 2026-3-27 10:05
提示: 作者被禁止或删除 内容自动屏蔽

发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

mj2013ly 发表于 2026-3-27 10:15
不缺计算器,缺的是钱啊,四大皆空
Mr.Lemon 发表于 2026-5-25 11:21
[HTML] 纯文本查看 复制代码
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>利息计算器</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f4f4f9;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        .calculator-card {
            background-color: #fff;
            padding: 2rem;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
            width: 100%;
            max-width: 400px;
        }
        h2 {
            text-align: center;
            color: #333;
            margin-bottom: 1.5rem;
        }
        .input-group {
            margin-bottom: 1rem;
        }
        label {
            display: block;
            margin-bottom: 0.5rem;
            color: #666;
            font-size: 0.9rem;
        }
        input[type="number"] {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            box-sizing: border-box;
            font-size: 1rem;
        }
        input:focus {
            border-color: #007BFF;
            outline: none;
        }
        .result-area {
            margin-top: 1.5rem;
            padding: 1rem;
            background-color: #e9ecef;
            border-radius: 5px;
            text-align: center;
        }
        .result-label {
            color: #555;
            font-size: 0.9rem;
        }
        .result-value {
            color: #007BFF;
            font-size: 1.8rem;
            font-weight: bold;
            margin-top: 5px;
        }
        .formula-hint {
            font-size: 0.8rem;
            color: #999;
            text-align: center;
            margin-top: 1rem;
        }
        .tab-container {
            display: flex;
            margin-bottom: 1rem;
        }
        .tab {
            flex: 1;
            text-align: center;
            padding: 0.5rem;
            background-color: #eee;
            cursor: pointer;
            border-radius: 5px 5px 0 0;
        }
        .tab.active {
            background-color: #007BFF;
            color: white;
        }
        .tab-content {
            display: none;
        }
        .tab-content.active {
            display: block;
        }
        .seven-day-inputs {
            display: flex;
            gap: 8px;
            margin-top: 5px;
        }
        .day-input {
            flex: 1;
            min-width: 0;
            padding: 8px;
            text-align: center;
            border: 1px solid #ddd;
            border-radius: 4px;
        }
        input::selection {
            background-color: #007BFF;
            color: white;
        }
        input[type="number"]::-webkit-inner-spin-button,
        input[type="number"]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        input[type="number"] {
            -moz-appearance: textfield;
        }
    </style>
</head>
<body>
<div class="calculator-card">
    <h2>利息计算器</h2>

    <div class="tab-container">
        <div class="tab active" onclick="switchTab('standard')">标准利息</div>
        <div class="tab" onclick="switchTab('sevenDay')">七日年化</div>
    </div>

    <!-- 标准利息计算部分 -->
    <div id="standard" class="tab-content active">
        <div class="input-group">
            <label for="principal">本金 (元)</label>
            <input type="number" id="principal" placeholder="例如:10000" oninput="calculateStandard()">
        </div>
        <div class="input-group">
            <label for="rate">年利率 (%)</label>
            <input type="number" id="rate" placeholder="例如:2.8" step="0.01" oninput="calculateStandard()">
        </div>
        <div class="input-group">
            <label for="days">天数</label>
            <input type="number" id="days" value="30" placeholder="默认365" oninput="calculateStandard()">
        </div>
        <div class="result-area">
            <div class="result-label">预计利息 (保留两位小数)</div>
            <div class="result-value" id="result-standard">0.00</div>
        </div>
        <div class="formula-hint">
            公式:本金 × 年利率% × 天数 ÷ 365
        </div>
    </div>

    <!-- 七日年化计算部分 -->
    <div id="sevenDay" class="tab-content">
        <div class="input-group">
            <label for="sevenDayPrincipal">本金 (元)</label>
            <input type="number" id="sevenDayPrincipal" placeholder="例如:10000" 
                   onkeydown="if(event.key==='Enter')document.querySelector('.day-input').focus()">
        </div>
        <div class="input-group">
            <label>每日收益(元)</label>
            <div class="seven-day-inputs">
                <input type="number" class="day-input" placeholder="1st" data-day="1" onkeydown="handleDayInput(event, 1)">
                <input type="number" class="day-input" placeholder="2nd" data-day="2" onkeydown="handleDayInput(event, 2)">
                <input type="number" class="day-input" placeholder="3rd" data-day="3" onkeydown="handleDayInput(event, 3)">
                <input type="number" class="day-input" placeholder="4th" data-day="4" onkeydown="handleDayInput(event, 4)">
                <input type="number" class="day-input" placeholder="5th" data-day="5" onkeydown="handleDayInput(event, 5)">
                <input type="number" class="day-input" placeholder="6th" data-day="6" onkeydown="handleDayInput(event, 6)">
                <input type="number" class="day-input" placeholder="7th" data-day="7" onkeydown="handleDayInput(event, 7)">
            </div>
        </div>
        <div class="result-area">
            <div class="result-label">七日总收益</div>
            <div class="result-value" id="total-sevenDay-earnings">0.00 元</div>
            <div class="result-label" style="margin-top: 10px;">七日年化收益率</div>
            <div class="result-value" id="result-sevenDay">0.00%</div>
        </div>
        <div class="formula-hint">
            公式:(七日总收益 ÷ 本金 ÷ 7) × 365 × 100%
        </div>
    </div>
</div>

<script>
    function handleFocus(event) {
        event.target.select();
    }

    function switchTab(tabId) {
        document.querySelectorAll('.tab').forEach(tab => tab.classList.remove('active'));
        document.querySelectorAll('.tab-content').forEach(content => content.classList.remove('active'));
        document.querySelector(`.tab[onclick="switchTab('${tabId}')"]`).classList.add('active');
        document.getElementById(tabId).classList.add('active');

        setTimeout(() => {
            const firstInput = document.querySelector(`#${tabId} input`);
            if (firstInput) firstInput.focus();
        }, 50);
    }

    function setupStandardInterestFocus() {
        const inputs = document.querySelectorAll('#standard input');
        inputs.forEach((input, index) => {
            input.addEventListener('keydown', function(e) {
                if (e.key === 'Enter') {
                    e.preventDefault();
                    const nextIndex = (index + 1) % inputs.length;
                    
                    if (nextIndex === 0) {
                        calculateStandard();
                        setTimeout(() => inputs[0].focus(), 300);
                    } else {
                        inputs[nextIndex].focus();
                    }
                }
            });
        });
    }

    function setupSevenDayFocus() {
        const principalInput = document.getElementById('sevenDayPrincipal');
        const dayInputs = document.querySelectorAll('.day-input');
        
        principalInput.addEventListener('keydown', function(e) {
            if (e.key === 'Enter') {
                e.preventDefault();
                dayInputs[0].focus();
            }
        });

        dayInputs.forEach((input, index) => {
            input.addEventListener('keydown', function(e) {
                if (e.key === 'Enter') {
                    e.preventDefault();
                    const isLastInput = (index === dayInputs.length - 1);
                    
                    if (isLastInput) {
                        calculateSevenDay();
                        setTimeout(() => principalInput.focus(), 300);
                    } else {
                        dayInputs[index + 1].focus();
                    }
                }
            });
        });
    }

    document.addEventListener('DOMContentLoaded', function() {
        document.querySelectorAll('input').forEach(input => {
            input.addEventListener('focus', handleFocus);
            input.addEventListener('click', handleFocus);
        });
        
        setupStandardInterestFocus();
        setupSevenDayFocus();
    });

    function calculateStandard() {
        const principal = parseFloat(document.getElementById('principal').value);
        const rate = parseFloat(document.getElementById('rate').value);
        const days = parseFloat(document.getElementById('days').value);
        if (isNaN(principal) || isNaN(rate) || isNaN(days)) {
            document.getElementById('result-standard').innerText = "0.00";
            return;
        }
        const interest = (principal * (rate / 100) * days) / 365;
        document.getElementById('result-standard').innerText = interest.toFixed(2);
    }

    function calculateSevenDay() {
        const principal = parseFloat(document.getElementById('sevenDayPrincipal').value);
        let totalEarnings = 0;
        let allDaysFilled = true;
        for (let day = 1; day <= 7; day++) {
            const dayEarning = parseFloat(document.querySelector(`.day-input[data-day="${day}"]`).value);
            if (!isNaN(dayEarning)) {
                totalEarnings += dayEarning;
            } else {
                allDaysFilled = false;
            }
        }
        document.getElementById('total-sevenDay-earnings').innerText = totalEarnings.toFixed(2) + ' 元';
        if (allDaysFilled && !isNaN(principal) && principal > 0) {
            const sevenDayYield = ((totalEarnings / principal / 7) * 365 * 100).toFixed(2);
            document.getElementById('result-sevenDay').innerText = `${sevenDayYield}%`;
        } else {
            document.getElementById('result-sevenDay').innerText = "0.00%";
        }
    }
</script>
</body>
</html>
eskyboy 发表于 2026-3-27 10:12
hunfeifei 发表于 2026-3-27 10:14
感谢分享。搞个web就更好了。
FeACuM 发表于 2026-3-27 10:14
现在收益太低了
98079807 发表于 2026-3-27 10:22
mj2013ly 发表于 2026-3-27 10:15
不缺计算器,缺的是钱啊,四大皆空

对 四大皆空  平平凡凡在世间
fengqingzhi11 发表于 2026-3-27 10:26
他那个融资公司是腾讯的本家吗?
douyacai 发表于 2026-3-27 10:34
不缺计算器,缺钱啊。余利宝好像要高那么一点点,高风险的不买选,选了怕本金都没了
ctt727 发表于 2026-3-27 10:35
算来算去,结果钱越算越少
yiyi465465 发表于 2026-3-27 10:35
收益太低了,缺钱缺钱
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - 52pojie.cn ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2026-9-30 21:09

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表