See more on gzhiyi.top.
gzhiyi / dandan-account Goto Github PK
View Code? Open in Web Editor NEW【此版本不是线上版本】🐷 不记录任何用户身份信息;专注记账的目的;账单清晰自然,报表易懂易分析;助你理财之路轻松有意义,小程序【单单记账】。
License: MIT License
【此版本不是线上版本】🐷 不记录任何用户身份信息;专注记账的目的;账单清晰自然,报表易懂易分析;助你理财之路轻松有意义,小程序【单单记账】。
License: MIT License
See more on gzhiyi.top.
点击饼图想查看子类的账单数据,发现请求的列表数据不正确,缺少了账单。
找不到对应的FunctionName.
初拟表结构, 欢迎修改
Create Collection DANDAN_NOTE_ACCOUNT {
_id : 系统生成,
accountDate String (账单日期 yyyy-MM-dd)
income Double (收入),
Expenditure Double (支出),
netIncome Double (净收入),
createTime Date (创建时间),
updateTime Date (修改时间),
openId String (用户ID)
}
/**
以下可支持修改当天的数据
可以通过聚合函数addField().match()匹配到对应的日期
year String(年 yyyy)
month String (月 MM)
day String (日 dd)
*/
目前一个账单绑定一个openId。
如果需要实现多人共享账单(包括创建、删除、修改、查询共享账单),则需要一个集合去储存共享关系。
该集合包含如下字段:
createdBy: 创建人的openId,String;
relateUsers: 关联账单的用户列表,Array;
startDate: 关联账单的开始时间,Date;
endDate: 关联账单的结束时间,Date;
name: 组名,String;
createDate: 创建时间,Date;
用户请求所有相关账单列表之前,需要匹配relateUsers的所有用户的账单并集合起来。
relateUsers内的所有用户都可以随时解除关联,解除需要将移除relateUsers对应的用户的openId。
对于克隆下来发现没有分类,我这里有一份默认的分类集合提供导入。在云开发控制台导入到分类表即可。
云开发控制台-数据库-DANDAN_NOTE_CATEGORY(如无需新建)-导入-选择json文件即可。
对于json内的数据可以根据需要进行修改。
因为json就这么一段,所以就直接贴上来,保存为json后在导入时选择。
{
"_id": "food_and_drink_breakfast",
"categoryName": "早餐",
"categoryIcon": "icon",
"description": "早餐",
"flow": 0,
"type": 0,
"parentId": "food_and_drink_total",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "food_and_drink_dinner",
"categoryName": "晚餐",
"categoryIcon": "icon",
"description": "晚餐",
"flow": 0,
"type": 0,
"parentId": "food_and_drink_total",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "food_and_drink_lunch",
"categoryName": "午餐",
"categoryIcon": "icon",
"description": "午餐",
"flow": 0,
"type": 0,
"parentId": "food_and_drink_total",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "food_and_drink_night_snack",
"categoryName": "宵夜",
"categoryIcon": "icon",
"description": "宵夜",
"flow": 0,
"type": 0,
"parentId": "food_and_drink_total",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "food_and_drink_snack",
"categoryName": "零食",
"categoryIcon": "icon",
"description": "零食",
"flow": 0,
"type": 0,
"parentId": "food_and_drink_total",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "food_and_drink_total",
"categoryName": "餐饮",
"categoryIcon": "icon",
"description": "餐饮",
"flow": 0,
"type": 0,
"parentId": "",
"isSelectable": false,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "income",
"categoryName": "收入",
"categoryIcon": "icon",
"description": "收入",
"flow": 1,
"type": 0,
"parentId": "",
"isSelectable": false,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "income_ETFs",
"categoryName": "基金",
"categoryIcon": "icon",
"description": "基金",
"flow": 1,
"type": 0,
"parentId": "income",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "income_bonus",
"categoryName": "奖金",
"categoryIcon": "icon",
"description": "奖金",
"flow": 1,
"type": 0,
"parentId": "income",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "income_debt_collect",
"categoryName": "收债",
"categoryIcon": "icon",
"description": "收债",
"flow": 1,
"type": 0,
"parentId": "income",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "income_gifts",
"categoryName": "礼金",
"categoryIcon": "icon",
"description": "礼金",
"flow": 1,
"type": 0,
"parentId": "income",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "income_living",
"categoryName": "生活费",
"categoryIcon": "icon",
"description": "生活费",
"flow": 1,
"type": 0,
"parentId": "income",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "income_red_packet",
"categoryName": "红包",
"categoryIcon": "icon",
"description": "红包",
"flow": 1,
"type": 0,
"parentId": "income",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "income_refund",
"categoryName": "退款",
"categoryIcon": "icon",
"description": "退款",
"flow": 1,
"type": 0,
"parentId": "income",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "income_salary",
"categoryName": "工资",
"categoryIcon": "icon",
"description": "工资",
"flow": 1,
"type": 0,
"parentId": "income",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "income_stocks",
"categoryName": "股票",
"categoryIcon": "icon",
"description": "股票",
"flow": 1,
"type": 0,
"parentId": "income",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "medicine",
"categoryName": "医疗",
"categoryIcon": "icon",
"description": "医疗",
"flow": 0,
"type": 0,
"parentId": "",
"isSelectable": false,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "medicine_doctor",
"categoryName": "看病",
"categoryIcon": "icon",
"description": "看病",
"flow": 0,
"type": 0,
"parentId": "medicine",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "medicine_medicine",
"categoryName": "药物",
"categoryIcon": "icon",
"description": "药物",
"flow": 0,
"type": 0,
"parentId": "medicine",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "money_management",
"categoryName": "理财",
"categoryIcon": "icon",
"description": "理财",
"flow": 0,
"type": 0,
"parentId": "",
"isSelectable": false,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "money_management_ETFs",
"categoryName": "基金",
"categoryIcon": "icon",
"description": "基金",
"flow": 0,
"type": 0,
"parentId": "money_management",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "money_management_stocks",
"categoryName": "股票",
"categoryIcon": "icon",
"description": "股票",
"flow": 0,
"type": 0,
"parentId": "money_management",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "others",
"categoryName": "杂项",
"categoryIcon": "icon",
"description": "杂项",
"flow": 0,
"type": 0,
"parentId": "",
"isSelectable": false,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "others_sub",
"categoryName": "杂项",
"categoryIcon": "icon",
"description": "杂项",
"flow": 0,
"type": 0,
"parentId": "others",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "skin_care",
"categoryName": "护理",
"categoryIcon": "icon",
"description": "护理",
"flow": 0,
"type": 0,
"parentId": "",
"isSelectable": false,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "skin_care_makeup",
"categoryName": "化妆品",
"categoryIcon": "icon",
"description": "化妆品",
"flow": 0,
"type": 0,
"parentId": "skin_care",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "stored_value",
"categoryName": "储值",
"categoryIcon": "icon",
"description": "储值",
"flow": 0,
"type": 0,
"parentId": "",
"isSelectable": false,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "stored_value_bus_card",
"categoryName": "公交卡",
"categoryIcon": "icon",
"description": "公交卡",
"flow": 0,
"type": 0,
"parentId": "stored_value",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "stored_value_call_credit",
"categoryName": "话费",
"categoryIcon": "icon",
"description": "话费",
"flow": 0,
"type": 0,
"parentId": "stored_value",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "stored_value_membership_card",
"categoryName": "会员卡",
"categoryIcon": "icon",
"description": "会员卡",
"flow": 0,
"type": 0,
"parentId": "stored_value",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "stored_value_virtual",
"categoryName": "虚拟物品",
"categoryIcon": "icon",
"description": "虚拟物品",
"flow": 0,
"type": 0,
"parentId": "stored_value",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "transportation",
"categoryName": "出行",
"categoryIcon": "icon",
"description": "出行",
"flow": 0,
"type": 0,
"parentId": "",
"isSelectable": false,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "transportation_airplane",
"categoryName": "飞机",
"categoryIcon": "icon",
"description": "飞机",
"flow": 0,
"type": 0,
"parentId": "transportation",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "transportation_high_speed_rail",
"categoryName": "高铁",
"categoryIcon": "icon",
"description": "高铁",
"flow": 0,
"type": 0,
"parentId": "transportation",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
} {
"_id": "transportation_online_car",
"categoryName": "网约车",
"categoryIcon": "icon",
"description": "网约车",
"flow": 0,
"type": 0,
"parentId": "transportation",
"isSelectable": true,
"createTime": {
"$date": "2019-08-21T08:02:30.448Z"
},
"openId": "SYSTEM",
"isDel": false
}
请问有部署文档吗
按目前的规划,分类应该设置一个大类,一个小类的形式。
大类用于统计数据、关联小类以及好排列分类等。小类提供用户选择。
早餐、午餐、晚餐、零食
高铁、飞机、网约车
公交卡、会员卡、话费、虚拟商品
生活用品
衣服、裤子、鞋子
化妆品
书、电影
生病、药品
红包、借钱
基金、股票
杂项
官方文档很模糊,搜索到了几条关于小程序环境分离的问题,大部分吐槽官方怎么没有一个好的办法分离开发和生产环境。
const wxContext = cloud.getWXContext()
cloud.updateConfig({
env: wxContext.ENV
})
// 初始化数据库
const db = cloud.database({
env: wxContext.ENV
})
wx.cloud.init({
traceUser: true,
env: 'release-wifo3', // 测试环境
// env: 'dandan-zdm86' // 正式环境
})
预览小程序的时候开启测试环境的env,在部署上线发布的时候再切换为正式环境。
为便于函数数据对接,这里约束下前后端关于数据折线图的格式:
chartData: {
categories: ['横坐标1', '横坐标2', '横坐标3', '横坐标4', '横坐标5', '横坐标6'],
series: [{
name: '线1名称',
data: [35, 20, 25, 37, 4, 20]
}, {
name: '线2名称',
data: [70, 40, 65, 100, 44, 68]
}, {
name: '线3名称',
data: [100, 80, 95, 150, 112, 132]
}]
}
以上表示折线图有五个坐标,实际可以按需求进行坐标个数调整,只要数据个数对的上就可以了。
对于折线图的需求,可以看实际情况下需要展示多少数据。
// TODO
这个版本主要增加功能:
带账本的一起记账。
在search的json那里引入dialog发现不能使用。这是什么问题呢?
可以查看当天或者当月的最高支出
chart组件内的年份不要从第一年开始。戳
日历样式数字不居中
月份下划线样式调整
图表处,“余”改为“月余”
弹窗动画
饼图浮点优化
账单分页处理
节流账单获取失败时的再次请求
chart组件内账单列表出现无账单的提示信息
发现将未绑定在 WXML
的变量传入 setData
调用
点击分类栏即可跳转到分类页面
限制选择日期间隔,减少性能损耗
IOS13升级后,图表那居然透明了
列表难以点击最后一个的问题
切换饼图增加节流
饼图默认颜色扩展
如题,比如我家里多个用户,想记在一起,就是数据互享,有什么简便的方法改造呢。我是后端开发,前端不太了解
来源于用户反馈:
首次进去记录正常,登记第二个项目时,无法输入数字金额,需重新进去小程序后才可正常记录
我部署了一个,有点问题删除已记账会显示删除失败,请重试,得重新载入小程序,才会看到删除了记录
请问 云开发要怎么迁移呢?
目前线上的饼图数据均是通过账单列表进行处理后渲染的,大致的逻辑是:
现在由于没法完整列出一个月所有账单数据的问题(假设账单数据多,需要分页处理),需要重新规划接口数据模式。
为节省时间和以后维护方便,统一下数据需求。
chart页需要两个接口进行数据呈现
饼图需要的数据接口如下数组所示,字段名也需要依照下面返回:
[{
name: 父分类名字,
data: 该父分类下子分类支出/收入的数值和,
category: 父分类的数据结构【数据库的数据,id之类的】
}, {
// ...
}]
默认情况下进入页面时将不再主动触发查询账单数据,只有在点击饼图的某块,或者在已选分类上作出选择后,我再请求列表数据回来。列表数据必须支持分页,分页建议50每页。
请求数据的参数可以如下:
要清楚知道,该接口查询的是某个父分类下的数据。
支付方式增加招商银行、空值。【一个人的需求】。
常用分类删除按钮默认显示问题。
搜索增加重置按钮。
折线图高度调整下。
在当前的搜索结果中简单计算一些参数,在猪上显示。
日历栏本月支出会有溢出的情况。
用echarts图表uchart
首页需要一个展示数据的banner,这里商量需要展示什么数据。
饼图数值存在浮点溢出。
切换收入和支出后,选择分类的栏未切换。
安卓机存在输入金额那在弹出键盘的时候偏移的问题。
个别时候出现饼图无法点击的问题。
单日首笔账单是收入在左边统计页面会显示为支出的问题。
账单项右侧有多余空白。
记账后提示时间过短。
在分类选择页面不选择分类没有默认选择默认分类的问题。
饼图点击限流。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.