project init

This commit is contained in:
2023-01-28 14:37:45 +08:00
parent fa1176f658
commit 3a134326e7
83 changed files with 1482 additions and 140 deletions

32
app.js
View File

@@ -1,10 +1,40 @@
// app.js
import api from './utils/api.js';
import utils from './utils/util.js';
App({
onLaunch() {
},
globalData: {
billIcon : [
{label: '度假', icon: '/image/bill/0.png'},
{label: '电影', icon: '/image/bill/1.png'},
{label: '聚餐', icon: '/image/bill/2.png'},
{label: '网购', icon: '/image/bill/3.png'},
{label: '医疗', icon: '/image/bill/4.png'},
{label: '游戏', icon: '/image/bill/5.png'},
{label: '孩子', icon: '/image/bill/6.png'},
{label: '化妆品', icon: '/image/bill/7.png'},
{label: '生日', icon: '/image/bill/8.png'},
{label: '车票', icon: '/image/bill/9.png'},
{label: '水果', icon: '/image/bill/10.png'},
{label: '红包', icon: '/image/bill/11.png'},
{label: '借钱', icon: '/image/bill/11.png'}
],
accountIcon : [
{label: '工商银行', icon: '/image/account/0.png'},
{label: '基金', icon: '/image/account/1.png'},
{label: '交通银行', icon: '/image/account/2.png'},
{label: '农信社', icon: '/image/account/3.png'},
{label: '农业银行', icon: '/image/account/4.png'},
{label: '建设银行', icon: '/image/account/5.png'},
{label: '招商银行', icon: '/image/account/6.png'},
{label: '中国银行', icon: '/image/account/7.png'},
{label: '现金', icon: '/image/account/8.png'},
{label: '微信', icon: '/image/account/9.png'},
{label: '负债', icon: '/image/account/10.png'},
{label: '支付宝', icon: '/image/account/11.png'}
]
},
$api: api,
$utils: utils
})

View File

@@ -1,9 +1,20 @@
{
"pages": [
"pages/index/index",
"pages/chart/index",
"pages/account/index",
"pages/myself/index"
"pages/index/index",
"pages/chart/index",
"pages/account/index",
"pages/myself/index",
"pages/budget/index",
"pages/settings/account/index",
"pages/settings/expend/index",
"pages/settings/income/index",
"pages/about/about",
"pages/bill/index",
"pages/bill/edit/index",
"pages/bill/add/index",
"pages/account/detail/index",
"pages/settings/edit/index",
"pages/chart/group/index"
],
"usingComponents": {
"foot-tab" : "pages/foot-tab/foot-tab",
@@ -17,7 +28,15 @@
"t-tabs": "miniprogram_npm/tdesign-miniprogram/tabs/tabs",
"t-tab-panel": "miniprogram_npm/tdesign-miniprogram/tabs/tab-panel",
"t-empty": "miniprogram_npm/tdesign-miniprogram/empty/empty",
"t-progress": "miniprogram_npm/tdesign-miniprogram/progress/progress"
"t-progress": "miniprogram_npm/tdesign-miniprogram/progress/progress",
"t-dialog": "miniprogram_npm/tdesign-miniprogram/dialog/dialog",
"t-input": "miniprogram_npm/tdesign-miniprogram/input/input",
"t-fab": "miniprogram_npm/tdesign-miniprogram/fab/fab",
"t-action-sheet": "miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet",
"t-tag": "miniprogram_npm/tdesign-miniprogram/tag/tag",
"t-textarea": "miniprogram_npm/tdesign-miniprogram/textarea/textarea",
"t-radio": "miniprogram_npm/tdesign-miniprogram/radio/radio",
"t-radio-group": "miniprogram_npm/tdesign-miniprogram/radio-group/radio-group"
},
"window": {
"backgroundTextStyle": "dark",

View File

@@ -17,6 +17,7 @@ page {
--td-bg-color-fade: red;
--td-bg-color-block: #2B2B2B;
--td-color-block-check: #777777;
--td-dialog-title-color: none;
}
/* 记账类型颜色 */
.t-color-income {
@@ -32,6 +33,9 @@ page {
color: yellow;
}
/* 记账类型颜色 */
t-cell {
--td-cell-note-color: orange;
}
.t-cell-income {
--td-cell-note-color: red;
}
@@ -45,6 +49,9 @@ page {
--td-cell-note-color: yellow;
}
/* 字体大小 */
.font_large {
font-size: 50rpx;
}
.font_big {
font-size: 35rpx;
}
@@ -56,15 +63,80 @@ page {
display: flex;
justify-content: flex-start;
}
.space_box {
.space_box_no_padding {
padding: 0 20rpx;
display: flex;
justify-content: space-between;
}
.space_box {
padding: 20rpx;
display: flex;
justify-content: space-between;
}
.padding_box {
padding: 0 20rpx;
}
.bottom_box {
width: 100%;
position: absolute;
bottom:50rpx;
}
/* 占位置 */
.placeholder {
height: 168rpx;
}
/* 日历 */
.t-calendar__dates-item--centre {
--td-calendar-item-centre-color:lightsalmon;
}
/* 标签 */
.t-tabs__item {
--td-tab-item-color:none;
}
/* 对话框输入框 */
.t-dialog input {
color: whitesmoke;
--td-dialog-input-bg-color: #111111
}
.t-dialog__body {
--td-dialog-content-color: red;
}
/* 输入框 */
.t-input__control {
--td-input-default-text-color: orange;
}
.t-input__tips {
--td-input-default-tips-color: red
}
.t-input__wrap--suffix {
--td-input-suffix-text-color: whitesmoke
}
.t-input__label {
--td-input-label-text-color: whitesmoke
}
.t-input__placeholder {
--td-input-placeholder-text-color: #777777
}
/* 宫格 */
.t-grid-item__text {
color: whitesmoke !important;
}
/*文本域*/
.t-textarea__label {
--td-font-size-base: 32rpx;
--td-textarea-label-color:none
}
.t-textarea__wrapper-inner {
--td-textarea-text-color: orange
}
.t-textarea__placeholder {
--td-textarea-placeholder-color: #777777
}
.t-textarea__indicator {
--td-textarea-indicator-text-color : none
}
/* 下拉框 */
.t-collapse-panel__content {
--td-collapse-content-text-color: none;
--td-collapse-content-padding: 0;
}

BIN
image/account/0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
image/account/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
image/account/10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
image/account/11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
image/account/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
image/account/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

BIN
image/account/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
image/account/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
image/account/6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
image/account/7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
image/account/8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
image/account/9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@@ -30,7 +30,7 @@
display: flex;
box-sizing: border-box;
width: 100%;
padding: var(--td-cell-vertical-padding, 32rpx) var(--td-cell-horizontal-padding, 32rpx);
padding: var(--td-cell-vertical-padding, 20rpx) var(--td-cell-horizontal-padding, 20rpx);
font-size: var(--td-cell-font-size, var(--td-font-size-m, 32rpx));
line-height: var(--td-cell-line-height, 48rpx);
/*color: var(--td-cell-text-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));*/

View File

@@ -41,8 +41,8 @@
color: var(--td-input-prefix-icon-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
}
.t-input__label:not(:empty) {
min-width: 96rpx;
max-width: 162rpx;
min-width: 150rpx;
max-width: 150rpx;
font-size: var(--td-font-size-m, 32rpx);
line-height: 48rpx;
color: var(--td-input-label-text-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));

View File

@@ -32,7 +32,7 @@
box-sizing: border-box;
}
.t-tab-panel {
background: var(--td-bg-color,#fff);
background: var(--td-bg-color);
height: inherit;
width: inherit;
}

View File

@@ -160,18 +160,20 @@ let Tabs = class Tabs extends SuperComponent {
return offset + targetLeft - (1 / 2) * containerWidth + targetWidth / 2;
}
getTrackSize() {
// return new Promise((resolve) => {
// if (this.trackWidth) {
// resolve(this.trackWidth);
// return;
// }
// getRect(this, `.${prefix}-tabs__track`).then((res) => {
// if (res) {
// this.trackWidth = res.width;
// resolve(this.trackWidth);
// }
// });
// });
return new Promise((resolve) => {
if (this.trackWidth) {
resolve(this.trackWidth);
return;
}
getRect(this, `.${prefix}-tabs__track`).then((res) => {
if (res) {
this.trackWidth = res.width;
resolve(this.trackWidth);
}
}).catch(reason => {
console.log(reason)
});
});
}
setTrack() {
return __awaiter(this, void 0, void 0, function* () {

6
pages/about/about.js Normal file
View File

@@ -0,0 +1,6 @@
Page({
data: {},
onLoad: function (options) {
}
});

4
pages/about/about.json Normal file
View File

@@ -0,0 +1,4 @@
{
"usingComponents": {
}
}

13
pages/about/about.wxml Normal file
View File

@@ -0,0 +1,13 @@
<view class="main_look">
<view class="pay_look">
Quinn记账
</view>
<view class="detail_look font_big">
<text>千里之行,始于足下</text>
<text>release 1.0</text>
<text>感谢TDesign组件框架</text>
</view>
</view>
<view class="padding_box">
<t-button open-type="contact" theme="primary" shape="round" block>联系我们</t-button>
</view>

20
pages/about/about.wxss Normal file
View File

@@ -0,0 +1,20 @@
.main_look {
font-weight: bold;
}
.pay_look {
margin-top: 50rpx;
display: flex;
flex-direction: row;
justify-content: center;
font-size: 50rpx;
}
.detail_look {
margin-top: 100rpx;
padding: 0 30rpx;
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.padding_box {
margin-top: 100rpx;
}

View File

@@ -0,0 +1,72 @@
const app = getApp();
Page({
data: {
showSetMoney: false,
currentMoney: 0.00,
currentMoneyText: "8754.09",
priceError: false,
visible : false,
dateRangeText : '请选择日期区间',
dateRange : [new Date().getTime()- 24 * 60 * 60 * 1000,new Date().getTime()],
minDate: new Date().getTime() - 365 * 24 * 60 * 60 * 1000,
maxDate: new Date().getTime(),
incomeList : [
{"title":"电脑","type":"income","dateTime":"01-06","from":"银行卡","money":"+4500.00"}
],
payList : [
{"title":"狗粮","type":"expend","dateTime":"01-06","from":"支付宝","money":"-35.00"},
{"title":"狗粮","type":"expend","dateTime":"01-06","from":"支付宝","money":"-35.00"},
{"title":"狗粮","type":"expend","dateTime":"01-06","from":"支付宝","money":"-35.00"},
{"title":"狗粮","type":"expend","dateTime":"01-06","from":"支付宝","money":"-35.00"},
{"title":"狗粮","type":"expend","dateTime":"01-06","from":"支付宝","money":"-35.00"},
{"title":"狗粮","type":"expend","dateTime":"01-06","from":"支付宝","money":"-35.00"}
]
},
onLoad: function (options) {
},
handleCalendar() {
this.setData({ visible: true });
},
handleConfirm(e) {
const { value } = e.detail;
console.log(value);
let valueText = app.$utils.formatDate(new Date(value[0])) + '至' +
(value[1] ? app.$utils.formatDate(new Date(value[1])) : app.$utils.formatDate(new Date()));
this.setData({
visible: false,
dateRange: value,
dateRangeText: valueText
});
},
showDialog() {
this.setData({
showSetMoney: true,
currentMoney: this.data.currentMoneyText
})
},
onPriceInput(e) {
this.setData({
currentMoney: e.detail.value
})
},
onConfirm () {
const isNumber = /^\d+(\.\d+)?$/.test(this.data.currentMoney);
if (!isNumber) {
this.setData({
priceError: true
})
return;
}
this.setData({
currentMoneyText: this.data.currentMoney,
priceError: false
})
this.closeDialog()
},
closeDialog() {
this.setData({
showSetMoney: false
})
}
});

View File

@@ -0,0 +1,7 @@
{
"usingComponents": {
"t-collapse": "/miniprogram_npm/tdesign-miniprogram/collapse/collapse",
"t-collapse-panel": "/miniprogram_npm/tdesign-miniprogram/collapse/collapse-panel",
"t-calendar": "/miniprogram_npm/tdesign-miniprogram/calendar/calendar"
}
}

View File

@@ -0,0 +1,57 @@
<view class="main_look">
<view class="look_content">
<view class="pay_look">
<view data-type="count" class="inline_box font_large">
账户余额<t-icon bind:tap="showDialog" name="edit"/>
</view>
</view>
<view class="pay_look">
<text class="center_look font_large">{{ currentMoneyText }}</text>
</view>
</view>
</view>
<view class="space_box_no_padding font_big">
<text class="t-color-expend">支出{{1203.00}}</text>
<text class="t-color-income">收入{{1203.00}}</text>
</view>
<view class="padding_box">
<t-divider content="{{dateRangeText}}" bind:tap="handleCalendar"/>
</view>
<t-collapse theme="card" defaultValue="{{[0]}}" expandMutex expandIcon>
<t-collapse-panel header="收入" value="{{0}}">
<view wx:if="{{incomeList != null && incomeList.length > 0}}">
<t-cell wx:for="{{incomeList}}" wx:key="index"
title="{{item.title}}"
description="{{item.dateTime}} • {{item.from}}"
align="top"
image="/image/bill/4.png"
note="{{item.money}}"
class="t-cell-{{item.type}}"
url="{{'/pages/bill/index?id=' + item.id}}"
/>
</view>
</t-collapse-panel>
<t-collapse-panel header="支出" value="{{1}}">
<t-cell wx:for="{{payList}}" wx:key="index"
title="{{item.title}}"
description="{{item.dateTime}} • {{item.from}}"
align="top"
image="/image/bill/4.png"
note="{{item.money}}"
class="t-cell-{{item.type}}"
url="{{'/pages/bill/index?id=' + item.id}}"
/>
</t-collapse-panel>
</t-collapse>
<t-calendar visible="{{visible}}" bind:confirm="handleConfirm" value="{{dateRange}}" type="range" max-date="{{maxDate}}" min-date="{{minDate}}" />
<t-dialog
visible="{{showSetMoney}}"
title="修改余额"
content="请慎重,可能无法收支平衡!"
confirm-btn="{{ { content: '确定', variant: 'base'} }}"
cancel-btn="取消"
bind:confirm="onConfirm"
bind:cancel="closeDialog"
>
<t-input bindchange="onPriceInput" value="{{currentMoney}}" tips="{{priceError ? '请输入正确金额' : ''}}" slot="content" type="number" placeholder="0.00"/>
</t-dialog>

View File

@@ -0,0 +1,18 @@
.main_look {
padding: 0 20rpx;
}
.look_content {
display: flex;
flex-direction: column;
justify-content: center;
height: 200rpx;
background-color: #111111;
background-size:100% 100%;
font-weight: bold;
}
.pay_look {
padding: 0 20rpx;
display: flex;
flex-direction: row;
justify-content: center;
}

View File

@@ -6,17 +6,9 @@ Page({
{"name":"现金","money":"2000.00"},
{"name":"银行卡","money":"30500.03"}
],
visualAccountList : [
{"name":"支付宝","money":"200.00"},
{"name":"微信","money":"00.03"}
],
oweAccountList : [
{"name":"信用卡","money":"-200.00"},
],
payAccountList : [
{"name":"基金","money":"31200.00"},
{"name":"长江证券","money":"200.00"},
],
]
},
onLoad: function (options) {

View File

@@ -12,34 +12,28 @@
</view>
</view>
<view class="padding_box">
<t-divider dashed content="金账户"/>
<t-cell wx:for="{{cashAccountList}}" wx:key="index"
title="{{item.name}}"
align="top"
image="https://tdesign.gtimg.com/mobile/%E5%9B%BE%E7%89%87.png"
note="{{hiddenMoney ? noMoney : item.money}}"
/>
<t-divider dashed content="虚拟账户"/>
<t-cell wx:for="{{visualAccountList}}" wx:key="index"
title="{{item.name}}"
align="top"
image="https://tdesign.gtimg.com/mobile/%E5%9B%BE%E7%89%87.png"
note="{{hiddenMoney ? noMoney : item.money}}"
/>
<t-divider dashed content="负债账户"/>
<t-cell wx:for="{{oweAccountList}}" wx:key="index"
title="{{item.name}}"
align="top"
image="https://tdesign.gtimg.com/mobile/%E5%9B%BE%E7%89%87.png"
note="{{hiddenMoney ? noMoney : item.money}}"
/>
<t-divider dashed content="投资账户"/>
<t-cell wx:for="{{payAccountList}}" wx:key="index"
title="{{item.name}}"
align="top"
image="https://tdesign.gtimg.com/mobile/%E5%9B%BE%E7%89%87.png"
note="{{hiddenMoney ? noMoney : item.money}}"
/>
<view class="placeholder"/>
<t-divider dashed content="金账户"/>
</view>
<t-cell-group theme="card">
<t-cell wx:for="{{cashAccountList}}" wx:key="index"
title="{{item.name}}"
align="top"
image="/image/account/5.png"
url="/pages/account/detail/index"
note="{{hiddenMoney ? noMoney : item.money}}"
/>
</t-cell-group>
<view class="padding_box">
<t-divider dashed content="负债账户"/>
</view>
<t-cell-group theme="card">
<t-cell wx:for="{{oweAccountList}}" wx:key="index"
title="{{item.name}}"
align="top"
image="/image/account/10.png"
url="/pages/account/detail/index"
note="{{hiddenMoney ? noMoney : item.money}}"
/>
</t-cell-group>
<view class="placeholder"/>
<foot-tab value="label_3"/>

View File

@@ -21,6 +21,3 @@
.t-divider__content {
--td-divider-content-font-size:25rpx;
}
t-cell {
--td-cell-note-color: orange;
}

6
pages/bill/add/index.js Normal file
View File

@@ -0,0 +1,6 @@
Page({
data: {},
onLoad: function (options) {
}
});

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {
"expenses": "../types/expenses",
"transfer": "../types/transfer"
}
}

14
pages/bill/add/index.wxml Normal file
View File

@@ -0,0 +1,14 @@
<t-tabs defaultValue="{{0}}" t-class="custom-tabs" theme="card">
<t-tab-panel label="支出" value="0">
<expenses/>
</t-tab-panel>
<t-tab-panel label="收入" value="1">
<expenses/>
</t-tab-panel>
<t-tab-panel label="转账" value="2">
<transfer/>
</t-tab-panel>
<t-tab-panel label="还款" value="3">
<transfer changeType="repayment"/>
</t-tab-panel>
</t-tabs>

View File

6
pages/bill/edit/index.js Normal file
View File

@@ -0,0 +1,6 @@
Page({
data: {},
onLoad: function (options) {
}
});

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {
"expenses": "../types/expenses",
"transfer": "../types/transfer"
}
}

View File

@@ -0,0 +1,4 @@
<view class="padding_box">
<expenses/>
<!-- <transfer/>-->
</view>

View File

29
pages/bill/index.js Normal file
View File

@@ -0,0 +1,29 @@
Page({
data: {
showDeleteConfirm: false,
title : "账单名称",
money : "2000"
},
onLoad: function (options) {
},
editBill() {
wx.navigateTo({
url: './edit/index'
})
},
deleteBill() {
this.setData({
showDeleteConfirm: true
})
},
onConfirm (e) {
wx.navigateBack();
this.closeDialog()
},
closeDialog() {
this.setData({
showDeleteConfirm: false
})
}
});

4
pages/bill/index.json Normal file
View File

@@ -0,0 +1,4 @@
{
"usingComponents": {
}
}

37
pages/bill/index.wxml Normal file
View File

@@ -0,0 +1,37 @@
<view class="space_box view_bg">
<view class="inline_box font_large">
<image src="https://tdesign.gtimg.com/site/miniprogram-doc/doc-actionsheet.png"/>
{{title}}
</view>
<view class="{{money > 0 ? 't-color-income' : 't-color-expend'}} font_large">{{money > 0 ? "+" + money : money}}</view>
</view>
<view class="padding_box">
<t-divider dashed/>
</view>
<t-cell title="分类" note="收入/薪资收入">
<t-icon name="view-module" slot="left-icon" />
</t-cell>
<t-cell title="账户" note="负债账户/信用卡">
<t-icon name="creditcard" slot="left-icon" />
</t-cell>
<t-cell title="余额" note="123.43">
<t-icon name="root-list" slot="left-icon" />
</t-cell>
<t-cell title="时间" note="2022/12/32 21:12">
<t-icon name="calendar" slot="left-icon" />
</t-cell>
<view class="bottom_box">
<view class="space_box">
<t-button theme="danger" variant="outline" block bind:tap="deleteBill">删除</t-button>
<t-button theme="primary" variant="outline" block bind:tap="editBill">编辑</t-button>
</view>
</view>
<t-dialog
visible="{{showDeleteConfirm}}"
title="删除该笔记账?"
confirm-btn="{{ { content: '确定', variant: 'base'} }}"
cancel-btn="取消"
bind:confirm="onConfirm"
bind:cancel="closeDialog"
>
</t-dialog>

17
pages/bill/index.wxss Normal file
View File

@@ -0,0 +1,17 @@
.view_bg {
background: #2B2B2B;
}
image {
width: 68rpx;
height: 68rpx;
}
.bottom_button {
position: absolute;
width: 96%;
bottom:66rpx;
left: 50%;
transform: translateX(-50%);
}
t-button {
width: 50%;
}

View File

@@ -0,0 +1,171 @@
const app = getApp();
import ActionSheet, { ActionSheetTheme } from '../../../miniprogram_npm/tdesign-miniprogram/action-sheet/index';
let handler = null;
const firstGrid = [
{
label: '红包',
icon: 'star',
},
{
label: '数码',
icon: 'star',
},
{
label: '虚拟',
icon: 'star',
},
{
label: '游戏',
icon: 'star',
},
{
label: '包包',
icon: 'star',
},
{
label: '手机',
icon: 'refresh',
},
{
label: '话费',
icon: 'download',
},
{
label: '技术',
icon: 'queue',
},
];
const secondGrid = [
{
label: '银行卡',
icon: 'star',
},
{
label: '支付宝',
icon: 'star',
},
{
label: '微信',
icon: 'star',
},
{
label: '信用卡',
icon: 'star',
}
];
Component({
properties: {
/* income & out */
changeType: {
type: String,
value: 'income'
},
},
data: {
price: '10.2',
priceError: false,
grid: '',
outText: '',
inText: '',
mode: '',
dateVisible: false,
date: new Date().getTime(), // 支持时间戳传入
dateText: '',
// 指定选择区间起始值
start: '2000-01-01 00:00:00',
end: '2030-09-09 12:12:12',
},
methods: {
onPriceInput(e) {
const { priceError } = this.data;
const isNumber = /^\d+(\.\d+)?$/.test(e.detail.value);
if (priceError === isNumber) {
this.setData({
priceError: !isNumber,
});
}
},
handleMultiAction(e) {
const { grid } = e.currentTarget.dataset;
this.setData({
grid
})
if (grid == 'type') {
handler = ActionSheet.show({
theme: ActionSheetTheme.Grid,
selector: '#t-action-sheet',
context: this,
items: firstGrid.concat(
new Array(8).fill({
label: '标题文字',
icon: 'star',
}),
),
});
}else {
handler = ActionSheet.show({
theme: ActionSheetTheme.Grid,
selector: '#t-action-sheet',
context: this,
items: secondGrid.concat(
new Array(8).fill({
label: '标题文字',
icon: 'star',
}),
),
});
}
},
onCancel(){
handler.close();
},
handleSelected(e) {
const {grid} = this.data
this.setData({
[`${grid}Text`]: e.detail.selected.label,
});
},
showPicker(e) {
const { mode } = e.currentTarget.dataset;
this.setData({
mode,
[`${mode}Visible`]: true,
});
},
hidePicker() {
const { mode } = this.data;
this.setData({
[`${mode}Visible`]: false,
});
},
onConfirm(e) {
const { value } = e.detail;
const { mode } = this.data;
this.setData({
[mode]: value,
[`${mode}Text`]: value,
});
this.hidePicker();
},
bYesterday () {
let preDate = new Date(new Date().getTime() - 24 * 60 * 60 * 1000 * 2);
this.setData({
dateText: app.$utils.formatDate(preDate)
})
},
yesterday() {
let preDate = new Date(new Date().getTime() - 24 * 60 * 60 * 1000);
this.setData({
dateText: app.$utils.formatDate(preDate)
})
},
today () {
this.setData({
dateText: app.$utils.formatDate(new Date())
})
},
saveBill () {
wx.navigateBack();
}
}
});

View File

@@ -0,0 +1,5 @@
{
"component": true,
"usingComponents": {
}
}

View File

@@ -0,0 +1,44 @@
<t-input
label="金额"
placeholder="0.00"
suffix="元"
align="right"
type="number"
bindchange="onPriceInput"
value="{{price}}"
tips="{{priceError ? '请输入正确的价格' : ''}}"
t-class-tips="tips"
/>
<t-input label="分类" disabled>
<text slot="suffix" class="t-color-input" data-grid="type" bind:tap="handleMultiAction">{{typeText ? typeText : '请选择分类'}}</text>
</t-input>
<t-input label="账户" disabled>
<text slot="suffix" class="t-color-input" data-grid="account" bind:tap="handleMultiAction">{{accountText ? accountText : '请选择账户'}}</text>
</t-input>
<t-input label="日期" disabled>
<text slot="suffix" class="t-color-input" data-mode="date" bind:tap="showPicker">{{dateText ? dateText : '请选择日期'}}</text>
</t-input>
<view class="right_box">
<t-tag size="large" bind:tap="bYesterday" variant="light">前天</t-tag>
<view class="placeholder_line"></view>
<t-tag size="large" bind:tap="yesterday" variant="light">昨天</t-tag>
<view class="placeholder_line"></view>
<t-tag size="large" bind:tap="today" variant="light">今天</t-tag>
</view>
<t-textarea label="备注" placeholder="请输入该账单说明..." maxlength="200" indicator />
<view class="view_button">
<t-button theme="primary" block bind:tap="saveBill">保存</t-button>
</view>
<!-- 年月日 -->
<t-date-time-picker
title="选择日期"
visible="{{dateVisible}}"
mode="date"
defaultValue="{{date}}"
format="YYYY-MM-DD"
bindchange="onConfirm"
bindcancel="hidePicker"
start="{{start}}"
end="{{end}}"
/>
<t-action-sheet id="t-action-sheet" bind:selected="handleSelected" bind:cancel="onCancel"/>

View File

@@ -0,0 +1,15 @@
.view_button {
margin-top: 20rpx;
}
.placeholder_line {
width: 20rpx;
}
.right_box {
margin: 20rpx 0;
width: 100%;
display: flex;
justify-content: flex-end;
}
.t-color-input {
color: orange;
}

View File

@@ -0,0 +1,154 @@
const app = getApp();
import ActionSheet, { ActionSheetTheme } from '../../../miniprogram_npm/tdesign-miniprogram/action-sheet/index';
let handler = null;
const firstGrid = [
{
label: '银行卡',
icon: 'star',
},
{
label: '支付宝',
icon: 'star',
},
{
label: '微信',
icon: 'star',
},
{
label: '信用卡',
icon: 'star',
}
];
const secondGrid = [
{
label: '银行卡',
icon: 'star',
},
{
label: '支付宝',
icon: 'star',
},
{
label: '微信',
icon: 'star',
},
{
label: '信用卡',
icon: 'star',
}
];
Component({
properties: {
/* normal & repayment */
changeType: {
type: String,
value: 'normal'
},
},
data: {
priceError: false,
grid: '',
typeText: '',
accountText: '',
mode: '',
dateVisible: false,
date: new Date().getTime(), // 支持时间戳传入
dateText: '',
// 指定选择区间起始值
start: '2000-01-01 00:00:00',
end: '2030-09-09 12:12:12'
},
methods: {
onPriceInput(e) {
const { priceError } = this.data;
const isNumber = /^\d+(\.\d+)?$/.test(e.detail.value);
if (priceError === isNumber) {
this.setData({
priceError: !isNumber,
});
}
},
handleMultiAction(e) {
const { grid } = e.currentTarget.dataset;
this.setData({
grid
})
if (grid == 'out') {
handler = ActionSheet.show({
theme: ActionSheetTheme.Grid,
selector: '#t-action-sheet',
context: this,
items: firstGrid.concat(
new Array(8).fill({
label: '标题文字',
icon: 'star',
}),
),
});
}else {
handler = ActionSheet.show({
theme: ActionSheetTheme.Grid,
selector: '#t-action-sheet',
context: this,
items: secondGrid.concat(
new Array(8).fill({
label: '标题文字',
icon: 'star',
}),
),
});
}
},
onCancel(){
handler.close();
},
handleSelected(e) {
const {grid} = this.data
this.setData({
[`${grid}Text`]: e.detail.selected.label,
});
},
showPicker(e) {
const { mode } = e.currentTarget.dataset;
this.setData({
mode,
[`${mode}Visible`]: true,
});
},
hidePicker() {
const { mode } = this.data;
this.setData({
[`${mode}Visible`]: false,
});
},
onConfirm(e) {
const { value } = e.detail;
const { mode } = this.data;
this.setData({
[mode]: value,
[`${mode}Text`]: value,
});
this.hidePicker();
},
bYesterday () {
let preDate = new Date(new Date().getTime() - 24 * 60 * 60 * 1000 * 2);
this.setData({
dateText: app.$utils.formatDate(preDate)
})
},
yesterday() {
let preDate = new Date(new Date().getTime() - 24 * 60 * 60 * 1000);
this.setData({
dateText: app.$utils.formatDate(preDate)
})
},
today () {
this.setData({
dateText: app.$utils.formatDate(new Date())
})
},
saveBill () {
wx.navigateBack();
}
}
});

View File

@@ -0,0 +1,5 @@
{
"component": true,
"usingComponents": {
}
}

View File

@@ -0,0 +1,44 @@
<t-input
label="金额"
placeholder="0.00"
suffix="元"
align="right"
type="number"
bindchange="onPriceInput"
value="{{price}}"
tips="{{priceError ? '请输入正确的价格' : ''}}"
t-class-tips="tips"
/>
<t-input label="{{'repayment' === changeType ? '还款账户' : '转出账户'}}" disabled>
<text slot="suffix" class="t-color-input" data-grid="out" bind:tap="handleMultiAction">{{outText ? outText : '请选择账户'}}</text>
</t-input>
<t-input label="{{'repayment' === changeType ? '负债账户' : '转入账户'}}" disabled>
<text slot="suffix" class="t-color-input" data-grid="in" bind:tap="handleMultiAction">{{inText ? inText : '请选择账户'}}</text>
</t-input>
<t-input label="日期" disabled>
<text slot="suffix" class="t-color-input" data-mode="date" bind:tap="showPicker">{{dateText ? dateText : '请选择日期'}}</text>
</t-input>
<view class="right_box">
<t-tag size="large" bind:tap="bYesterday" variant="light">前天</t-tag>
<view class="placeholder_line"></view>
<t-tag size="large" bind:tap="yesterday" variant="light">昨天</t-tag>
<view class="placeholder_line"></view>
<t-tag size="large" bind:tap="today" variant="light">今天</t-tag>
</view>
<t-textarea label="备注" placeholder="请输入该账单说明..." maxlength="200" indicator />
<view class="view_button">
<t-button theme="primary" block bind:tap="saveBill">保存</t-button>
</view>
<!-- 年月日 -->
<t-date-time-picker
title="选择日期"
visible="{{dateVisible}}"
mode="date"
defaultValue="{{date}}"
format="YYYY-MM-DD"
bindchange="onConfirm"
bindcancel="hidePicker"
start="{{start}}"
end="{{end}}"
/>
<t-action-sheet id="t-action-sheet" bind:selected="handleSelected" bind:cancel="onCancel"/>

View File

@@ -0,0 +1,15 @@
.view_button {
margin-top: 20rpx;
}
.placeholder_line {
width: 20rpx;
}
.right_box {
margin: 20rpx 0;
width: 100%;
display: flex;
justify-content: flex-end;
}
.t-color-input {
color: orange;
}

73
pages/budget/index.js Normal file
View File

@@ -0,0 +1,73 @@
Page({
data: {
showSetBudget : false,
mainMoney: "200.00",
changeType: "main",
changeItem: 0,
currentMoney: "0.00",
priceError: false,
payTypeList : [
{"id":1,"name":"娱乐","money":"2000.00"},
{"id":2,"name":"干饭","money":""},
{"id":3,"name":"游戏","money":"2000.00"},
{"id":4,"name":"其它","money":"400"}
],
},
onLoad: function (options) {
},
changeBudget(e) {
let {type,id} = e.currentTarget.dataset
let tCurrentMoney = 0.00;
if (type == 'count'){
tCurrentMoney = this.data.mainMoney
}else {
tCurrentMoney = this.data.payTypeList[id - 1].money;
}
this.setData({
showSetBudget: true,
changeType: type,
changeItem: id,
currentMoney: tCurrentMoney
})
},
onPriceInput(e) {
this.setData({
currentMoney: e.detail.value
})
},
onConfirm (e) {
const { priceError } = this.data;
const isNumber = /^\d+(\.\d+)?$/.test(this.data.currentMoney);
if (priceError === isNumber) {
this.setData({
priceError: !isNumber,
});
}
if (this.data.priceError) {
this.setData({
currentMoney: "0.00",
priceError: false
})
return;
}
if (this.data.changeType == 'count') {
this.setData({
mainMoney: this.data.currentMoney
})
}else {
let cPayTypeList = this.data.payTypeList
let cPayType = cPayTypeList[this.data.changeItem - 1]
cPayType.money = this.data.currentMoney;
this.setData({
payTypeList : cPayTypeList
})
}
this.closeDialog()
},
closeDialog() {
this.setData({
showSetBudget: false
})
}
});

4
pages/budget/index.json Normal file
View File

@@ -0,0 +1,4 @@
{
"usingComponents": {
}
}

36
pages/budget/index.wxml Normal file
View File

@@ -0,0 +1,36 @@
<view class="main_look">
<view class="look_content">
<view class="pay_look">
<view bind:tap="changeBudget" data-type="count" class="inline_box font_big">总预算<t-icon name="tools"/></view>
</view>
<view class="pay_look">
<text class="center_look font_big">{{ mainMoney }}</text>
</view>
<view class="balance_look">
<text>当月使用: {{ 900.00 }}</text>
<text>预算剩余: {{ 1200.00 }}</text>
</view>
</view>
</view>
<t-cell wx:for="{{payTypeList}}" wx:key="index"
title="{{item.name}}"
align="top"
image="/image/bill/3.png"
note="{{item.money}}"
bind:tap="changeBudget"
data-type="item"
data-id="{{item.id}}"
>
<t-progress wx:if="{{item.money}}" slot="description" percentage="{{25}}" />
<text class="error_msg" wx:else slot="description">未设置预算</text>
</t-cell>
<t-dialog
visible="{{showSetBudget}}"
title="设置预算"
confirm-btn="{{ { content: '确定', variant: 'base'} }}"
cancel-btn="取消"
bind:confirm="onConfirm"
bind:cancel="closeDialog"
>
<t-input bindchange="onPriceInput" value="{{currentMoney}}" tips="{{priceError ? '请输入正确金额' : ''}}" slot="content" type="number" placeholder="0.00"/>
</t-dialog>

28
pages/budget/index.wxss Normal file
View File

@@ -0,0 +1,28 @@
.main_look {
display: flex;
flex-direction: column;
justify-content: flex-end;
height: 200rpx;
background-color: #111111;
background-size:100% 100%;
}
.look_content {
font-weight: bold;
}
.pay_look {
padding: 0 20rpx;
display: flex;
flex-direction: row;
justify-content: center;
}
.balance_look {
padding: 20rpx;
display: flex;
justify-content: space-evenly;
}
.t-progress__info {
--td-progress-info-dark-color: whitesmoke
}
.error_msg {
color: #777777;
}

View File

@@ -0,0 +1,6 @@
Page({
data: {},
onLoad: function (options) {
}
});

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {
}
}

View File

View File

View File

@@ -19,7 +19,8 @@ function initPieChart(canvas, width, height, dpr) {
radius: ['0%', '70%'],
data: [{
value: 55,
name: '数码产品'
name: '数码产品',
id: 1
}, {
value: 20,
name: '零食'
@@ -35,8 +36,10 @@ function initPieChart(canvas, width, height, dpr) {
}]
}]
};
chart.setOption(option);
chart.on('click', 'series.pie', function(param) {
console.log(param.data)
});
return chart;
}

View File

@@ -11,19 +11,21 @@
</view>
<view class="padding_box">
<t-divider dashed content="账单明细"/>
<view wx:if="{{accountList != null && accountList.length > 0}}">
<t-cell wx:for="{{accountList}}" wx:key="index"
title="{{item.title}}"
description="{{item.dateTime}} • {{item.from}}"
align="top"
image="https://tdesign.gtimg.com/mobile/%E5%9B%BE%E7%89%87.png"
note="{{item.money}}"
class="t-cell-{{item.type}}"
/>
</view>
<view wx:else class="empty-view" >
<t-empty icon="chart-bubble" description="今日还未记账" />
</view>
</view>
<view wx:if="{{accountList != null && accountList.length > 0}}">
<t-cell-group theme="card">
<t-cell wx:for="{{accountList}}" wx:key="index"
title="{{item.title}}"
description="{{item.dateTime}} • {{item.from}}"
align="top"
image="/image/bill/4.png"
note="{{item.money}}"
class="t-cell-{{item.type}}"
/>
</t-cell-group>
</view>
<view wx:else class="empty-view" >
<t-empty icon="chart-bubble" description="今日还未记账" />
</view>
</t-tab-panel>
<t-tab-panel label="支出分类" value="1">
@@ -31,15 +33,14 @@
<ec-canvas id="mychart-dom-pie" canvas-id="mychart-pie" ec="{{ ecPie }}"></ec-canvas>
<view class="padding_box">
<t-progress label="数码产品55%" theme="plump" percentage="{{55}}" status="{{55 > 80 ? 'error' : 'success' }}" />
<t-divider/>
<view class="tabs_crevice"/>
<t-progress label="零食20%" theme="plump" percentage="{{20}}" status="{{81 > 80 ? 'error' : 'success' }}" />
<t-divider/>
<view class="tabs_crevice"/>
<t-progress label="娱乐10%" theme="plump" percentage="{{10}}" status="{{10 > 80 ? 'error' : 'success' }}" />
<t-divider/>
<view class="tabs_crevice"/>
<t-progress label="房贷20%" theme="plump" percentage="{{20}}" status="{{20 > 80 ? 'error' : 'success' }}" />
<t-divider/>
<view class="tabs_crevice"/>
<t-progress label="房租38%" theme="plump" percentage="{{38}}" status="{{38 > 80 ? 'error' : 'success' }}" />
<t-divider/>
</view>
</view>
</t-tab-panel>
@@ -49,20 +50,22 @@
</view>
</t-tab-panel>
<t-tab-panel label="排行" value="3">
<t-divider/>
<t-tabs defaultValue="{{0}}" t-class="custom-tabs" theme="card">
<t-tab-panel label="支出" value="0">
<t-divider/>
<view class="test">
<view class="tabs_crevice"/>
<view class="padding_box big_progress">
<t-progress label="数码产品45%" theme="plump" percentage="{{45}}" status="error" />
<view class="tabs_crevice"/>
<t-progress label="房租25%" theme="plump" percentage="{{25}}" status="error" />
<view class="tabs_crevice"/>
<t-progress label="干饭10%" theme="plump" percentage="{{15}}" status="error" />
</view>
</t-tab-panel>
<t-tab-panel label="收入" value="1">
<t-divider/>
<view class="test">
<view class="tabs_crevice"/>
<view class="padding_box big_progress">
<t-progress label="工资收入80%" theme="plump" percentage="{{80}}" status="success" />
<view class="tabs_crevice"/>
<t-progress label="捡钱20%" theme="plump" percentage="{{20}}" status="success" />
</view>
</t-tab-panel>

View File

@@ -11,15 +11,14 @@ ec-canvas {
width: 100%;
height: 100%;
}
.test .t-progress--plump {
.tabs_crevice {
height: 30rpx;
}
.big_progress .t-progress--plump {
height: 100rpx !important;
border-bottom: 2rpx solid orange;
border-radius: 0 !important;
/*--td-font-size-s: 28rpx;*/
}
.test .t-progress__inner {
.big_progress .t-progress__inner {
--td-radius-round: 0;
}
.test .t-progress__bar {
--td-progress-track-bg-color: --td-bg-color;
}

View File

@@ -22,9 +22,19 @@ Page({
}
let isRun = wx.getStorageSync("isRun");
if (!isRun) {
this.startInter();
// this.startInter();
}
},
modifyBudget (){
wx.navigateTo({
url : '/pages/budget/index'
})
},
addBill() {
wx.navigateTo({
url : '/pages/bill/add/index'
})
},
/**
* 启动定时器
*/

View File

@@ -12,7 +12,7 @@
</view>
<view class="space_box font_small">
<text>当月预算消费情况</text>
<view class="inline_box"><t-icon name="tools" size="28rpx"/>调整</view>
<view bind:tap="modifyBudget" class="inline_box"><t-icon name="tools" size="28rpx"/>调整</view>
</view>
<view class="padding_box">
<t-progress theme="plump" percentage="{{progress}}" status="{{progress > 80 ? 'error' : 'success' }}" />
@@ -22,22 +22,25 @@
<text>已消费:777.80</text>
</view>
<view class="padding_box">
<t-button theme="primary" size="medium" block>记一笔</t-button>
<t-button theme="primary" size="medium" block bind:tap="addBill">记一笔</t-button>
<t-divider dashed content="今日记账清单"/>
<view wx:if="{{todayList != null && todayList.length > 0}}">
<t-cell wx:for="{{todayList}}" wx:key="index"
title="{{item.title}}"
description="{{item.dateTime}} • {{item.from}}"
align="top"
image="https://tdesign.gtimg.com/mobile/%E5%9B%BE%E7%89%87.png"
note="{{item.money}}"
class="t-cell-{{item.type}}"
/>
</view>
<view wx:else class="empty-view" >
<t-empty icon="chart-bubble" description="今日还未记账" />
</view>
<!-- <t-empty wx:else t-class="empty-cls" t-class-image="t-empty__image" image="{{image}}" description="描述文字" />-->
</view>
<view wx:if="{{todayList != null && todayList.length > 0}}">
<t-cell-group theme="card">
<t-cell wx:for="{{todayList}}" wx:key="index"
title="{{item.title}}"
description="{{item.dateTime}} • {{item.from}}"
align="top"
image="/image/bill/5.png"
note="{{item.money}}"
class="t-cell-{{item.type}}"
url="{{'/pages/bill/index?id=' + item.id}}"
/>
</t-cell-group>
</view>
<view wx:else class="empty-view" >
<t-empty icon="chart-bubble" description="今日还未记账" />
</view>
<!-- <t-empty wx:else t-class="empty-cls" t-class-image="t-empty__image" image="{{image}}" description="描述文字" />-->
<view class="placeholder"/>
<foot-tab value="label_1"/>

View File

@@ -1,26 +1,25 @@
<t-cell-group theme="card">
<t-cell title="浙A88FU7" description="下午好!">
<view class="avatar" slot="left-icon">
<open-data type="userAvatarUrl" />
</view>
</t-cell>
<t-cell title="预算管理" arrow>
<t-icon name="tools" slot="left-icon" />
</t-cell>
<t-cell title="资产分类管理" arrow>
<t-icon name="tools" slot="left-icon" />
</t-cell>
<t-cell title="支出分类管理" arrow>
<t-icon name="tools" slot="left-icon" />
</t-cell>
<t-cell title="收入分类管理" arrow>
<t-icon name="tools" slot="left-icon" />
</t-cell>
<t-cell title="反馈建议" arrow>
<t-icon name="chat" slot="left-icon" />
</t-cell>
<t-cell title="关于我们" arrow>
<t-icon name="gift" slot="left-icon" />
</t-cell>
</t-cell-group>
<view class="my_look">
<t-cell-group theme="card">
<t-cell title="浙A88FU7" description="下午好!">
<view class="avatar" slot="left-icon">
<open-data type="userAvatarUrl" />
</view>
</t-cell>
<t-cell title="预算管理" arrow url="/pages/budget/index" >
<t-icon name="tools" slot="left-icon" />
</t-cell>
<t-cell title="资产分类管理" arrow url="/pages/settings/account/index" >
<t-icon name="setting" slot="left-icon" />
</t-cell>
<t-cell title="支出分类管理" arrow url="/pages/settings/expend/index" >
<t-icon name="setting" slot="left-icon" />
</t-cell>
<t-cell title="收入分类管理" arrow url="/pages/settings/income/index" >
<t-icon name="setting" slot="left-icon" />
</t-cell>
<t-cell title="关于我们" arrow url="/pages/about/about" >
<t-icon name="gift" slot="left-icon" />
</t-cell>
</t-cell-group>
</view>
<foot-tab value="label_4"/>

View File

@@ -4,3 +4,6 @@
border-radius: 50%;
overflow: hidden;
}
.my_look {
margin-top: 100rpx;
}

View File

@@ -0,0 +1,19 @@
Page({
data: {
cashAccountList : [
{"name":"现金","money":"2000.00"},
{"name":"银行卡","money":"30500.03"}
],
oweAccountList : [
{"name":"信用卡","money":"-200.00"},
],
},
onLoad: function (options) {
},
handleClick() {
wx.navigateTo({
url : "../edit/index?isAccount=1&isIncome=0&isAdd=1"
})
}
});

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {
}
}

View File

@@ -0,0 +1,23 @@
<view class="padding_box">
<t-divider dashed content="资金账户"/>
</view>
<t-cell-group theme="card">
<t-cell wx:for="{{cashAccountList}}" wx:key="index"
title="{{item.name}}"
align="top"
image="/image/account/11.png"
url="../edit/index?isAccount=true"
/>
</t-cell-group>
<view class="padding_box">
<t-divider dashed content="负债账户"/>
</view>
<t-cell-group theme="card">
<t-cell wx:for="{{oweAccountList}}" wx:key="index"
title="{{item.name}}"
align="top"
image="/image/account/4.png"
url="../edit/index?isAccount=1&isIncome=0&isAdd=0"
/>
</t-cell-group>
<t-fab icon="add" bind:click="handleClick" aria-label="新增账户"/>

View File

View File

@@ -0,0 +1,60 @@
import ActionSheet, { ActionSheetTheme } from '../../../miniprogram_npm/tdesign-miniprogram/action-sheet/index';
let handler = null;
const app = getApp();
Page({
data: {
isAccount: 0,
isIncome: 0,
isAdd: 0,
showDeleteConfirm: false,
icon : null
},
onLoad: function (options) {
this.setData({
isAccount : options.isAccount,
isIncome : options.isIncome,
isAdd : options.isAdd
})
},
handleMultiAction(e) {
if (this.data.isAccount == 1) {
handler = ActionSheet.show({
theme: ActionSheetTheme.Grid,
selector: '#t-action-sheet',
context: this,
items: app.globalData.accountIcon
});
}else {
handler = ActionSheet.show({
theme: ActionSheetTheme.Grid,
selector: '#t-action-sheet',
context: this,
items: app.globalData.billIcon
});
}
},
onCancel(){
handler.close();
},
handleSelected(e) {
let {icon} = e.detail.selected
this.setData({icon})
},
saveSetting () {
wx.navigateBack();
},
deleteSetting() {
this.setData({
showDeleteConfirm: true
})
},
onConfirm (e) {
wx.navigateBack();
this.closeDialog()
},
closeDialog() {
this.setData({
showDeleteConfirm: false
})
}
});

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {
}
}

View File

@@ -0,0 +1,33 @@
<t-input
label="名称"
placeholder="请输入名称"
align="right"
bindchange="onPriceInput"
value="{{ '假的名称' }}"
/>
<t-input wx:if="{{ isAccount == 1 }}" label="分类" disabled>
<t-radio-group slot="suffix" default-value="0" borderless t-class="box">
<t-radio block="{{ false }}" label="资产账户" value="0" />
<t-radio block="{{ false }}" label="负债账户" value="1" />
</t-radio-group>
</t-input>
<t-input label="图标" disabled >
<t-icon wx:if="{{icon}}" name="{{icon}}" slot="suffix" size="32" bind:tap="handleMultiAction" />
<text wx:else slot="suffix" class="t-color-input" bind:tap="handleMultiAction">{{'请选择图标'}}</text>
</t-input>
<view class="bottom_box">
<view class="space_box">
<t-button wx:if="{{ isAdd == 0 }}" bind:tap="deleteSetting" theme="danger" variant="outline" block >删除</t-button>
<t-button bind:tap="saveSetting" theme="primary" variant="outline" block >保存</t-button>
</view>
</view>
<t-action-sheet id="t-action-sheet" bind:selected="handleSelected" bind:cancel="onCancel"/>
<t-dialog
visible="{{showDeleteConfirm}}"
title="确认删除?"
confirm-btn="{{ { content: '确定', variant: 'base'} }}"
cancel-btn="取消"
bind:confirm="onConfirm"
bind:cancel="closeDialog"
>
</t-dialog>

View File

@@ -0,0 +1,16 @@
.bottom_box {
width: 100%;
position: absolute;
bottom:50rpx;
}
.space_box {
padding: 20rpx;
display: flex;
justify-content: space-between;
}
t-button {
width: 100%;
}
.t-color-input {
color: orange;
}

View File

@@ -0,0 +1,17 @@
Page({
data: {
payList: [
{"name":"数码产品","money":"5000.00"},
{"name":"虚拟产品","money":"2000.00"},
{"name":"红包","money":"0.23"}
]
},
onLoad: function (options) {
},
handleClick() {
wx.navigateTo({
url : "../edit/index?isAccount=0&isIncome=0&isAdd=1"
})
}
});

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {
}
}

View File

@@ -0,0 +1,20 @@
<view class="main_look">
<view class="look_content">
<view class="pay_look">
<view bind:tap="changeBudget" data-type="count" class="inline_box font_big">年度总支出</view>
</view>
<view class="pay_look">
<text class="center_look font_big">{{ 7000.23 }}</text>
</view>
</view>
</view>
<t-cell-group theme="card">
<t-cell wx:for="{{payList}}" wx:key="index"
title="{{item.name}}"
align="top"
image="/image/bill/7.png"
note="{{item.money}}"
url="../edit/index?isAccount=0&isIncome=0&isAdd=0"
/>
</t-cell-group>
<t-fab icon="add" bind:click="handleClick" aria-label="新增支出类型"/>

View File

@@ -0,0 +1,19 @@
.main_look {
padding: 0 30rpx;
margin-bottom: 20rpx;
}
.look_content {
display: flex;
flex-direction: column;
justify-content: center;
height: 200rpx;
background-color: #111111;
background-size:100% 100%;
font-weight: bold;
}
.pay_look {
padding: 0 20rpx;
display: flex;
flex-direction: row;
justify-content: center;
}

View File

@@ -0,0 +1,16 @@
Page({
data: {
incomeList: [
{"name":"薪资","money":"89310.00"},
{"name":"红包","money":"0.23"}
]
},
onLoad: function (options) {
},
handleClick() {
wx.navigateTo({
url : "../edit/index?isAccount=0&isIncome=1&isAdd=1"
})
}
});

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {
}
}

View File

@@ -0,0 +1,20 @@
<view class="main_look">
<view class="look_content">
<view class="pay_look">
<view bind:tap="changeBudget" data-type="count" class="inline_box font_big">年度总收入</view>
</view>
<view class="pay_look">
<text class="center_look font_big">{{ 89310.23 }}</text>
</view>
</view>
</view>
<t-cell-group theme="card">
<t-cell wx:for="{{incomeList}}" wx:key="index"
title="{{item.name}}"
align="top"
image="/image/bill/11.png"
note="{{item.money}}"
url="../edit/index?isAccount=0&isIncome=1&isAdd=0"
/>
</t-cell-group>
<t-fab icon="add" bind:click="handleClick" aria-label="新增收入类型"/>

View File

@@ -0,0 +1,19 @@
.main_look {
padding: 0 30rpx;
margin-bottom: 20rpx;
}
.look_content {
display: flex;
flex-direction: column;
justify-content: center;
height: 200rpx;
background-color: #111111;
background-size:100% 100%;
font-weight: bold;
}
.pay_look {
padding: 0 20rpx;
display: flex;
flex-direction: row;
justify-content: center;
}

View File

@@ -39,7 +39,7 @@
"showES6CompileOption": false
},
"compileType": "miniprogram",
"libVersion": "2.28.1",
"libVersion": "2.29.1",
"appid": "wxb1f499f0a173865b",
"projectname": "quinn-accounts",
"editorSetting": {

View File

@@ -6,7 +6,14 @@ const formatTime = date => {
const minute = date.getMinutes()
const second = date.getSeconds()
return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
return `${[year, month, day].map(formatNumber).join('-')} ${[hour, minute, second].map(formatNumber).join(':')}`
}
const formatDate = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
return `${[year, month, day].map(formatNumber).join('-')}`
}
const formatNumber = n => {
@@ -15,5 +22,6 @@ const formatNumber = n => {
}
module.exports = {
formatTime
formatTime,
formatDate
}