project init
This commit is contained in:
@@ -1,5 +1,23 @@
|
||||
Page({
|
||||
data: {},
|
||||
data: {
|
||||
noMoney : "****",
|
||||
hiddenMoney: false,
|
||||
cashAccountList : [
|
||||
{"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) {
|
||||
|
||||
},
|
||||
@@ -8,4 +26,11 @@ Page({
|
||||
wx.hideHomeButton()
|
||||
}
|
||||
},
|
||||
changeHidden () {
|
||||
let isHidden = this.data.hiddenMoney;
|
||||
this.setData({
|
||||
hiddenMoney : !isHidden
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -1,2 +1,45 @@
|
||||
账户
|
||||
<view class="main_look">
|
||||
<view class="look_content">
|
||||
<view class="pay_look">
|
||||
<view class="inline_box font_big">净资产<t-icon bind:tap="changeHidden" name="{{ hiddenMoney ? 'browse' : 'browse-off'}}"/></view>
|
||||
<text class="font_big">{{ hiddenMoney ? noMoney : 1200.00 }}</text>
|
||||
</view>
|
||||
<view class="balance_look">
|
||||
<text>总资产: {{ hiddenMoney ? noMoney : 900.00 }}</text>
|
||||
<text> | </text>
|
||||
<text>总负债: {{ hiddenMoney ? noMoney : -300.00 }}</text>
|
||||
</view>
|
||||
</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"/>
|
||||
</view>
|
||||
<foot-tab value="label_3"/>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
.main_look {
|
||||
margin: 0 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
height: 200rpx;
|
||||
background-image: url("https://yigger.cn/covers/default-7.jpeg");
|
||||
background-size:100% 100%;
|
||||
}
|
||||
.look_content {
|
||||
font-weight: bold;
|
||||
}
|
||||
.pay_look {
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
.balance_look {
|
||||
padding: 20rpx;
|
||||
/*display: flex;*/
|
||||
/*justify-content: space-between;*/
|
||||
}
|
||||
.t-divider__content {
|
||||
--td-divider-content-font-size:25rpx;
|
||||
}
|
||||
t-cell {
|
||||
--td-cell-note-color: orange;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,113 @@
|
||||
import * as echarts from '../../ec-canvas/echarts';
|
||||
function initPieChart(canvas, width, height, dpr) {
|
||||
const chart = echarts.init(canvas, null, {
|
||||
width: 400,
|
||||
height: 250,
|
||||
devicePixelRatio: dpr // new
|
||||
});
|
||||
canvas.setChart(chart);
|
||||
var option = {
|
||||
backgroundColor: "#3C4043",
|
||||
series: [{
|
||||
label: {
|
||||
normal: {
|
||||
fontSize: 14
|
||||
}
|
||||
},
|
||||
type: 'pie',
|
||||
center: ['50%', '50%'],
|
||||
radius: ['0%', '70%'],
|
||||
data: [{
|
||||
value: 55,
|
||||
name: '数码产品'
|
||||
}, {
|
||||
value: 20,
|
||||
name: '零食'
|
||||
}, {
|
||||
value: 10,
|
||||
name: '娱乐'
|
||||
}, {
|
||||
value: 20,
|
||||
name: '房贷'
|
||||
}, {
|
||||
value: 38,
|
||||
name: '房租'
|
||||
}]
|
||||
}]
|
||||
};
|
||||
|
||||
chart.setOption(option);
|
||||
return chart;
|
||||
}
|
||||
|
||||
function initLineChart(canvas, width, height, dpr) {
|
||||
const chart = echarts.init(canvas, null, {
|
||||
width: 400,
|
||||
height: 300,
|
||||
devicePixelRatio: dpr // new
|
||||
});
|
||||
canvas.setChart(chart);
|
||||
|
||||
var option = {
|
||||
title: {
|
||||
text: '的撒打',
|
||||
left: 'center'
|
||||
},
|
||||
legend: {
|
||||
data: ['支出', '收入', '转账','还款'],
|
||||
top: 20,
|
||||
left: 'center',
|
||||
backgroundColor: 'white',
|
||||
z: 100
|
||||
},
|
||||
grid: {
|
||||
containLabel: true
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
trigger: 'axis'
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
|
||||
// show: false
|
||||
},
|
||||
yAxis: {
|
||||
x: 'center',
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
}
|
||||
// show: false
|
||||
},
|
||||
series: [{
|
||||
name: '支出',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
data: [18, 36, 65, 30, 78, 40, 33]
|
||||
}, {
|
||||
name: '收入',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
data: [12, 50, 51, 35, 70, 30, 20]
|
||||
}, {
|
||||
name: '转账',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
data: [10, 30, 31, 50, 40, 20, 10]
|
||||
}, {
|
||||
name: '还款',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
data: [50, 80, 11, 25, 30, 110, 20]
|
||||
}]
|
||||
};
|
||||
chart.setOption(option);
|
||||
return chart;
|
||||
}
|
||||
Page({
|
||||
data: {
|
||||
// 指定选择区间起始值
|
||||
@@ -5,6 +115,16 @@ Page({
|
||||
end: '2030-09-09 12:12:12',
|
||||
showDateVisible:false,
|
||||
showDate:'2022-01',
|
||||
accountList: [
|
||||
{"title":"电脑","type":"income","dateTime":"01-06","from":"银行卡","money":"4500.00"},
|
||||
{"title":"狗粮","type":"expend","dateTime":"01-06","from":"支付宝","money":"35.00"},
|
||||
],
|
||||
ecPie: {
|
||||
onInit: initPieChart
|
||||
},
|
||||
ecLine: {
|
||||
onInit: initLineChart
|
||||
}
|
||||
},
|
||||
onLoad: function (options) {
|
||||
|
||||
@@ -15,8 +135,6 @@ Page({
|
||||
}
|
||||
},
|
||||
showPicker(e) {
|
||||
console.log('12312312')
|
||||
console.log(e.currentTarget.dataset)
|
||||
const { mode } = e.currentTarget.dataset;
|
||||
this.setData({
|
||||
mode,
|
||||
@@ -37,7 +155,6 @@ Page({
|
||||
[mode]: value
|
||||
// [`${mode}Text`]: value,
|
||||
});
|
||||
|
||||
this.hidePicker();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"ec-canvas": "/ec-canvas/ec-canvas"
|
||||
},
|
||||
"navigationBarTitleText": "统计"
|
||||
}
|
||||
|
||||
@@ -3,22 +3,70 @@
|
||||
</view>
|
||||
<t-tabs defaultValue="{{0}}" t-class="custom-tabs" theme="card">
|
||||
<t-tab-panel label="总览" value="0" class="tab_content">
|
||||
<view class="space_box">
|
||||
<text>总资产\n {{1203.00}}</text>
|
||||
<text>总资产\n {{1203.00}}</text>
|
||||
<text>总资产\n {{1203.00}}</text>
|
||||
<text>总资产\n {{1203.00}}</text>
|
||||
<text>总资产\n {{1203.00}}</text>
|
||||
<view class="space_box font_big">
|
||||
<text class="t-color-expend">支出\n {{1203.00}}</text>
|
||||
<text class="t-color-income">收入\n {{1203.00}}</text>
|
||||
<text class="t-color-transfer">转账\n {{1203.00}}</text>
|
||||
<text class="t-color-repayment">还款\n {{1203.00}}</text>
|
||||
</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>
|
||||
</t-tab-panel>
|
||||
<t-tab-panel label="分类" value="1" class="tab_content">
|
||||
Jodijawoidjwoaidjwaoij
|
||||
<t-tab-panel label="支出分类" value="1">
|
||||
<view class="chart-box">
|
||||
<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/>
|
||||
<t-progress label="零食20%" theme="plump" percentage="{{20}}" status="{{81 > 80 ? 'error' : 'success' }}" />
|
||||
<t-divider/>
|
||||
<t-progress label="娱乐10%" theme="plump" percentage="{{10}}" status="{{10 > 80 ? 'error' : 'success' }}" />
|
||||
<t-divider/>
|
||||
<t-progress label="房贷20%" theme="plump" percentage="{{20}}" status="{{20 > 80 ? 'error' : 'success' }}" />
|
||||
<t-divider/>
|
||||
<t-progress label="房租38%" theme="plump" percentage="{{38}}" status="{{38 > 80 ? 'error' : 'success' }}" />
|
||||
<t-divider/>
|
||||
</view>
|
||||
</view>
|
||||
</t-tab-panel>
|
||||
<t-tab-panel label="趋势" value="2" class="tab_content">
|
||||
|
||||
<t-tab-panel label="趋势" value="2">
|
||||
<view class="chart-box">
|
||||
<ec-canvas id="mychart-dom-line" canvas-id="mychart-line" ec="{{ ecLine }}"></ec-canvas>
|
||||
</view>
|
||||
</t-tab-panel>
|
||||
<t-tab-panel label="排行" value="3" class="tab_content">
|
||||
|
||||
<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">
|
||||
<t-progress label="数码产品45%" theme="plump" percentage="{{45}}" status="error" />
|
||||
<t-progress label="房租25%" theme="plump" percentage="{{25}}" status="error" />
|
||||
<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">
|
||||
<t-progress label="工资收入80%" theme="plump" percentage="{{80}}" status="success" />
|
||||
<t-progress label="捡钱20%" theme="plump" percentage="{{20}}" status="success" />
|
||||
</view>
|
||||
</t-tab-panel>
|
||||
</t-tabs>
|
||||
</t-tab-panel>
|
||||
</t-tabs>
|
||||
<view class="placeholder"/>
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
.tab_content {
|
||||
height: 100%;
|
||||
background: #3C4043 !important;
|
||||
.chart-box {
|
||||
width:100%;
|
||||
height:500rpx;
|
||||
position: absolute;
|
||||
top: 100rpx;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
ec-canvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.test .t-progress--plump {
|
||||
height: 100rpx !important;
|
||||
border-bottom: 2rpx solid orange;
|
||||
border-radius: 0 !important;
|
||||
/*--td-font-size-s: 28rpx;*/
|
||||
}
|
||||
.test .t-progress__inner {
|
||||
--td-radius-round: 0;
|
||||
}
|
||||
.test .t-progress__bar {
|
||||
--td-progress-track-bg-color: --td-bg-color;
|
||||
}
|
||||
|
||||
@@ -15,11 +15,27 @@ Page({
|
||||
]
|
||||
},
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
onShow: function () {
|
||||
if (wx.canIUse('hideHomeButton')) {
|
||||
wx.hideHomeButton()
|
||||
}
|
||||
let isRun = wx.getStorageSync("isRun");
|
||||
if (!isRun) {
|
||||
this.startInter();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 启动定时器
|
||||
*/
|
||||
startInter : function(){
|
||||
wx.setStorageSync("isRun",true);
|
||||
let times = 1;
|
||||
setInterval(
|
||||
function () {
|
||||
times ++;
|
||||
// 提交远程服务器修改的内容,降低服务器压力,如果网络异常,也可以正常操作
|
||||
console.log('setInterval 每过500毫秒执行一次任务' + times)
|
||||
}, 5000);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"t-progress": "/miniprogram_npm/tdesign-miniprogram/progress/progress"
|
||||
},
|
||||
"navigationBarTitleText": "首页"
|
||||
}
|
||||
|
||||
@@ -24,14 +24,20 @@
|
||||
<view class="padding_box">
|
||||
<t-button theme="primary" size="medium" block>记一笔</t-button>
|
||||
<t-divider dashed content="今日记账清单"/>
|
||||
<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_{{item.type}}"
|
||||
/>
|
||||
<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 class="placeholder"/>
|
||||
<foot-tab value="label_1"/>
|
||||
|
||||
@@ -18,4 +18,7 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.empty-view {
|
||||
margin-top: 200rpx;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,26 @@
|
||||
我的
|
||||
<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>
|
||||
<foot-tab value="label_4"/>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
.avatar {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user