uniapp 开发一个密码管理app

密码管理app

介绍

最近发现自己的账号密码真的是太多了,各种网站,系统,公司内网的,很多站点在登陆的时候都要重新设置密码或者通过短信或者邮箱重新设置密码,真的很麻烦

所以准备开发一个app用来记录这些站好和密码

uniapp

经过初步筛选,准备使用uniapp,比较简单,

开发步骤

  1. 注册dcloud账号
  2. 下载开发工具hbuilderx
  3. 创建项目
  4. 云打包
  5. 安装到手机

这就完事了,是不是很简单

下面分享下核心代码

路由
json 复制代码
{
	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
		{
			"path" : "pages/tab/home/home",
			"style" : 
			{
				"navigationBarTitleText" : "密码管理",
				"enablePullDownRefresh" : false
			}
		},
		{
			"path" : "pages/tab/my/my",
			"style" : 
			{
				"navigationBarTitleText" : "我的",
				"enablePullDownRefresh" : false
			}
		},
		{
			"path" : "pages/tab/home/add",
			"style" : 
			{
				"navigationBarTitleText" : "添加内容",
				"enablePullDownRefresh" : false
			}
		},
		{
			"path" : "pages/tab/home/show",
			"style" : 
			{
				"navigationBarTitleText" : "查看内容",
				"enablePullDownRefresh" : false
			}
		}
	
	],
	"tabBar": {
		"color": "#CCC",
		"selectedColor": "#3cc51f",
		"borderStyle": "black",
		"backgroundColor": "#ffffff",
		"list": [{
			"pagePath": "pages/tab/home/home",
			"iconPath": "static/image/shouye.png",
			"selectedIconPath": "static/image/shouye_1.png",
			"text": "管理"
		}, {
			"pagePath": "pages/tab/my/my",
			"iconPath": "static/image/wode.png",
			"selectedIconPath": "static/image/wode_1.png",
			"text": "我的"
		}]
	},
	"globalStyle": {
		"navigationBarTextStyle": "#FFFFFF",
		"navigationBarTitleText": "密码管理",
		"navigationBarBackgroundColor": "#32CD32",
		"backgroundColor": "#32CD32"
	},
	"uniIdRouter": {}
}
主页
js 复制代码
<template>
	<view class="content">
		<view class="allNum">
			总数量{{list.length}}
		</view>
		<view class="list">
			<view class="list-item"  v-for="(item,index) in list">
				<view class="item-text" @click="show(item)">
					{{item.name}}
				</view>
				<view class="time">
					时间:{{item.time}}
				</view>
				<view class="deleteBtn" @click="deleteById(index)">
					删除
				</view>
			</view>
		</view>
	</view>
	<view class="bottom">
		<view class="addBtn" @click="add">+</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		onLoad() {
			this.read()
		},
		onShow() {
			this.read()
		},
		methods: {
			read() {
				var _that = this
				uni.getStorage({
					key:"datajson",
					success(res) {
						var _list = res.data
						_list.sort((e1,e2)=>e2.id - e1.id)
						_that.list = _list
					},fail(err) {
					}
				})

		},
		add() {
			uni.navigateTo({
				url: 'add'
			})
		},
		show(item) {
			var param = ''
			param += '?name=' + item.name
			param += '&id=' + item.id
			param += '&account=' + item.account
			param += '&password=' + item.password
			param += '&remark=' + item.remark
			uni.navigateTo({
				url: 'show' + param
			})
		},
		deleteById(index){
			this.list.splice(index,1)
			var _that = this
			uni.setStorage({
				key: 'datajson',
				data: _that.list
			})
		}

	}
	}
</script>

<style>
	.content {
		height: 100%;
		background-color: #ccc;
	}

	.list-item {
		width: 100%;
		background-color: #fff;
		box-shadow: 5px 5px 5px #c3c3c3;
		margin: 0.5rem 0rem;
		padding: 0.5rem 1rem;
		position: relative;
	}

	.item-text {
		padding: 1rem 0rem;
	}

	.time {
		font-size: 15px;
		color: #ccc;
	}

	.allNum {
		background-color: coral;
		font-size: 26px;
		width: auto;
		padding: 15px;
		text-align: center;
		margin: 5px;
	}

	.bottom {
		position: fixed;
		bottom: 0px;
		left: 0px;
		height: 50px;
		width: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.addBtn {
		color: #fff;
		font-size: 40px;
		width: 50px;
		height: 50px;
		background-color: green;
		border-radius: 50%;
		text-align: center;
	}
	.deleteBtn{
		position: absolute;
		top: 30%;
		right: 15%;
		color: red;
		font-size: 18px;
		background-color: #c3c3c3;
		padding: 3% 5%;
		
	}
</style>

代码仓库

pass-mgr: 密码管理app (gitee.com)

app 预览


相关推荐
摆烂工程师2 小时前
(5千字总结)国内如何安装和使用 Claude Code 的保姆级教程 - 支持Mac和Windows用户
windows·macos·claude
Bruce_Liuxiaowei8 小时前
Netstat高级分析工具:Windows与Linux双系统兼容的精准筛查利器
linux·运维·网络·windows·安全
Par@ish9 小时前
【网络安全】恶意 Python 包“psslib”仿冒 passlib,可导致 Windows 系统关闭
windows·python·web安全
emplace_back18 小时前
C# 集合表达式和展开运算符 (..) 详解
开发语言·windows·c#
米粒宝的爸爸19 小时前
uniapp在app端,在导航栏设置自定义按钮
uni-app
dssxyz19 小时前
uniapp打包微信小程序主包过大问题_uniapp 微信小程序时主包太大和vendor.js过大
javascript·微信小程序·uni-app
xw520 小时前
我犯了错,我于是为我的uni-app项目引入环境标志
前端·uni-app
!win !20 小时前
被老板怼后,我为uni-app项目引入环境标志
前端·小程序·uni-app
一禅(OneZen)1 天前
「Windows/Mac OS」AIGC图片生成视频 ,webui + stable-diffusion环境部署教程
windows·stable diffusion
AirDroid_cn1 天前
OPPO手机怎样被其他手机远程控制?两台OPPO手机如何相互远程控制?
android·windows·ios·智能手机·iphone·远程工作·远程控制