开发一款集账户管理、理财规划和生活辅助于一体的移动应用卡片

应用场景介绍

随着移动互联网的普及,人们越来越习惯于通过手机管理自己的生活。因此,一款集账户管理、理财规划和生活辅助于一体的移动应用卡片应运而生。该卡片可以帮助用户轻松管理自己的财务状况,制定理财计划,并提供丰富的辅助功能,如记账、日程管理、地图导航等。

代码基本功能介绍

本卡片功能包括:

  • **账户管理:**查看账户余额、明细、交易记录等信息,并支持转账、充值、提现等操作。
  • **理财规划:**制定理财目标,设定理财计划,并跟踪理财进度。
  • **生活辅助:**提供记账、日程管理、地图导航、天气预报等功能,帮助用户轻松管理生活。

功能实现步骤及关键代码分析

账户管理

<div class="bg-white rounded-t-3xl px-4 pt-4 pb-8">
  <div class="flex items-center justify-between">
    <div class="text-gray-500 text-sm">Balance</div>
    <div class="text-purple-600 text-lg font-bold">Rp 1.000.000</div>
    <van-icon name="arrow-right" size="20px" color="#999" />
  </div>
  <div class="text-gray-500 text-sm mt-2">Account details 2167-890-123</div>
  <div class="flex items-center justify-between mt-4">
    <div class="text-gray-500 text-sm">Interest Rate</div>
    <div class="text-purple-600 text-lg font-bold">6.5% / year</div>
  </div>
  <div class="flex items-center justify-between mt-2">
    <div class="text-gray-500 text-sm">Your Interest</div>
    <div class="text-purple-600 text-lg font-bold">Rp 150.000</div>
  </div>
  <div class="flex items-center justify-around mt-6">
    <van-button round type="primary" size="mini" class="w-24 h-8"
      >Add Fund</van-button
    >
    <van-button round type="warning" size="mini" class="w-24 h-8"
      >Withdraw</van-button
    >
    <van-button round type="success" size="mini" class="w-24 h-8"
      >Top Up</van-button
    >
  </div>
</div>

关键代码分析:

  • 使用 Vue 框架构建卡片界面,采用 Flex 布局实现页面布局。
  • 使用 VanUI 组件库中的按钮、图标等组件,增强卡片的交互性和视觉效果。
  • 通过插槽机制,动态渲染账户余额、利率、利息等数据。

理财规划

<div class="bg-white rounded-t-3xl px-4 pt-4 pb-8 mt-4">
  <div class="text-gray-500 text-sm">My Goals</div>
  <div class="relative mt-4">
    <img
      class="w-full h-40 rounded-lg object-cover"
      src="https://source.unsplash.com/random/300x150"
      alt=""
    />
    <div
      class="absolute top-0 left-0 w-full h-full bg-gradient-to-b from-transparent to-black opacity-20"
    />
    <div
      class="absolute bottom-0 left-0 w-full flex items-center justify-between px-4 pb-4"
    >
      <div class="text-white text-sm">Japan Trip</div>
      <div class="flex items-center">
        <van-icon name="ellipsis" size="16px" color="#fff" />
        <div class="text-white text-sm ml-1">Ongoing</div>
      </div>
    </div>
  </div>
  <div class="flex items-center justify-between mt-4">
    <div class="text-gray-500 text-sm">
      Let's save for family trip next year
    </div>
    <div class="text-purple-600 text-lg font-bold">Rp 91.500</div>
  </div>
  <div class="flex items-center justify-between mt-2">
    <div class="text-gray-500 text-sm">Rp 91.500 / Rp 100.000</div>
    <div class="w-2/3 h-1 bg-gray-200 rounded-full">
      <div class="w-1/2 h-1 bg-purple-600 rounded-full"></div>
    </div>
  </div>
  <div class="flex items-center justify-between mt-4">
    <div class="text-gray-500 text-sm">Periodic Transfer</div>
    <div class="text-gray-500 text-sm">Every month</div>
  </div>
</div>

关键代码分析:

  • 使用 Flex 布局和绝对定位实现卡片布局,营造出层次感和视觉冲击力。
  • 使用 ECharts 组件绘制进度条,直观地展示理财目标的完成情况。
  • 通过插槽机制,动态渲染理财目标、进度、周期等数据。

生活辅助

<div class="bg-gray-100 h-screen">
  <div class="bg-purple-600 h-16 flex items-center justify-between px-4">
    <van-icon name="arrow-left" size="20px" color="#fff" />
    <div class="text-white font-bold text-lg">My Saving</div>
    <van-icon name="more-o" size="20px" color="#fff" />
  </div>
  <div class="bg-white rounded-t-3xl px-4 pt-4 pb-8">
    <div class="flex items-center justify-between">
      <div class="text-gray-500 text-sm">Balance</div>
      <div class="text-purple-600 text-lg font-bold">Rp 1.000.000</div>
      <van-icon name="arrow-right" size="20px" color="#999" />
    </div>
    <div class="text-gray-500 text-sm mt-2">Account details 2167-890-123</div>
    <div class="flex items-center justify-between mt-4">
      <div class="text-gray-500 text-sm">Interest Rate</div>
      <div class="text-purple-600 text-lg font-bold">6.5% / year</div>
    </div>
    <div class="flex items-center justify-between mt-2">
      <div class="text-gray-500 text-sm">Your Interest</div>
      <div class="text-purple-600 text-lg font-bold">Rp 150.000</div>
    </div>
    <div class="flex items-center justify-around mt-6">
      <van-button round type="primary" size="mini" class="w-24 h-8"
        >Add Fund</van-button
      >
      <van-button round type="warning" size="mini" class="w-24 h-8"
        >Withdraw</van-button
      >
      <van-button round type="success" size="mini" class="w-24 h-8"
        >Top Up</van-button
      >
    </div>
  </div>
  <div class="bg-white rounded-t-3xl px-4 pt-4 pb-8 mt-4">
    <div class="text-gray-500 text-sm">My Goals</div>
    <div class="relative mt-4">
      <img
        class="w-full h-40 rounded-lg object-cover"
        src="https://source.unsplash.com/random/300x150"
        alt=""
      />
      <div
        class="absolute top-0 left-0
Login
ECHO recommendation
ScriptEcho.ai

User Annotations

“我的储蓄”