project init
This commit is contained in:
19
pages/settings/account/index.js
Normal file
19
pages/settings/account/index.js
Normal 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"
|
||||
})
|
||||
}
|
||||
});
|
||||
4
pages/settings/account/index.json
Normal file
4
pages/settings/account/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
}
|
||||
}
|
||||
23
pages/settings/account/index.wxml
Normal file
23
pages/settings/account/index.wxml
Normal 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="新增账户"/>
|
||||
0
pages/settings/account/index.wxss
Normal file
0
pages/settings/account/index.wxss
Normal file
60
pages/settings/edit/index.js
Normal file
60
pages/settings/edit/index.js
Normal 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
|
||||
})
|
||||
}
|
||||
});
|
||||
4
pages/settings/edit/index.json
Normal file
4
pages/settings/edit/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
}
|
||||
}
|
||||
33
pages/settings/edit/index.wxml
Normal file
33
pages/settings/edit/index.wxml
Normal 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>
|
||||
16
pages/settings/edit/index.wxss
Normal file
16
pages/settings/edit/index.wxss
Normal 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;
|
||||
}
|
||||
17
pages/settings/expend/index.js
Normal file
17
pages/settings/expend/index.js
Normal 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"
|
||||
})
|
||||
}
|
||||
});
|
||||
4
pages/settings/expend/index.json
Normal file
4
pages/settings/expend/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
}
|
||||
}
|
||||
20
pages/settings/expend/index.wxml
Normal file
20
pages/settings/expend/index.wxml
Normal 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="新增支出类型"/>
|
||||
19
pages/settings/expend/index.wxss
Normal file
19
pages/settings/expend/index.wxss
Normal 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;
|
||||
}
|
||||
16
pages/settings/income/index.js
Normal file
16
pages/settings/income/index.js
Normal 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"
|
||||
})
|
||||
}
|
||||
});
|
||||
4
pages/settings/income/index.json
Normal file
4
pages/settings/income/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
}
|
||||
}
|
||||
20
pages/settings/income/index.wxml
Normal file
20
pages/settings/income/index.wxml
Normal 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="新增收入类型"/>
|
||||
19
pages/settings/income/index.wxss
Normal file
19
pages/settings/income/index.wxss
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user