Commit 5fcaa7b4 authored by 刘文虎's avatar 刘文虎

账单页面

parent 1ec834a4
Pipeline #2768 canceled with stages
......@@ -67,7 +67,7 @@ export default {
data() {
return {
billingTypeOptions,
show: true,
show: false,
customStyle: {
width: '104rpx',
height: '48rpx',
......
<template>
<view>
<view class="account">
<picker mode="date" :value="form.date" fields="month" @change="chooseMonth">
<view class="account-date" @click="openCalendarPopup">
<text>{{ form.date }}</text>
<u-icon name="arrow-down-fill" class="account-date-icon"></u-icon>
</view>
</picker>
</view>
<mid-popup ref="midPopup"></mid-popup>
<u-tabbar :list="tabbar" :mid-button="true" :mid-button-size="80" :before-switch="beforeSwitch"></u-tabbar>
</view>
......@@ -14,10 +22,18 @@ export default {
},
data() {
return {
tabbar
tabbar,
form: {
date: ''
}
};
},
methods: {
chooseMonth(e){
console.log(e.detail)
let { value } = e.detail;
this.form.date=value
},
beforeSwitch(index) {
if (index === 2) {
this.$refs['midPopup'].open();
......@@ -29,4 +45,23 @@ export default {
};
</script>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.account {
&-date {
width: 196upx;
height: 48upx;
background: #FFFFFF;
border-radius: 8upx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24upx;
color: $default-color;
&-icon {
color: #8d8d8d;
margin-left: 16upx;
}
}
}
</style>
<template>
<view>
<view class="bill">
<view class="bill-head">
<picker mode="date" :value="defaultDate" fields="month" @change="chooseMonth">
<view class="bill-date">
<view class="bill-date-text">{{ form.date }}</view>
<u-icon name="arrow-down-fill" class="bill-date-icon"></u-icon>
</view>
</picker>
</view>
<view class="bill-count">
<bill-count ref="bill-count"></bill-count>
</view>
</view>
<mid-popup ref="midPopup"></mid-popup>
<u-tabbar :list="tabbar" :mid-button="true" :mid-button-size="80" :before-switch="beforeSwitch"></u-tabbar>
</view>
......@@ -7,17 +20,35 @@
<script>
import MidPopup from '@/components/mid-popup/mid-popup.vue';
import BillCount from './components/bill-count.vue';
import { tabbar } from '@/utils/settings.js';
export default {
components: {
MidPopup
MidPopup,
BillCount
},
data() {
return {
tabbar
tabbar,
defaultDate:"",
form: {
date: ''
}
};
},
onLoad() {
this.initDate()
},
methods: {
initDate() {
this.form.date=this.parseTime(new Date(),"{y}年{m}月")
this.defaultDate=this.parseTime(new Date(),"{y}-{m}")
},
chooseMonth(e){
let { value } = e.detail;
this.defaultDate=value
this.form.date=this.parseTime(value+'-01',"{y}年{m}月")
},
beforeSwitch(index) {
if (index === 2) {
this.$refs['midPopup'].open();
......@@ -25,8 +56,33 @@ export default {
}
return true;
}
}
},
};
</script>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.bill {
padding: 24upx;
&-date {
width: 210upx;
height: 48upx;
background: #FFFFFF;
border-radius: 8upx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24upx;
color: $default-color;
padding: 0 16upx;
&-text{
flex: 1;
}
&-icon {
margin-left: 8upx;
}
}
}
</style>
<template>
<view class="bill-count">
<view class="bill-count-item" v-for="(item, index) in list" :key="index">
<view class="bill-count-item-icon"><image :src="item.icon" mode="" v-if="item.icon"></image></view>
<view class="bill-count-item-value ellipsis">{{ form[item.value] }}</view>
<view class="bill-count-item-label">{{ item.label }}</view>
<view class="bill-count-item-line" v-if="index !== list.length - 1"></view>
</view>
</view>
</template>
<script>
import { billCountOptions } from '@/utils/options/bill/index.js';
export default {
data() {
return {
list: billCountOptions,
form: {
income: '6546546456446.00',
disbursement: '55.00',
surplus: '79.00'
}
};
}
};
</script>
<style lang="scss" scoped>
.bill-count {
margin: 24upx 0;
height: 204upx;
display: flex;
// padding: 32upx 0;
background: #ffffff;
border-radius: 16upx;
&-item {
width: 33%;
height: 100%;
padding: 0 24upx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
&-icon {
width: 40upx;
height: 40upx;
}
&-value {
width: 100%;
text-align: center;
margin-top: 32upx;
margin-bottom: 16upx;
line-height: 32upx;
font-size: 32upx;
font-weight: bold;
}
&-label {
font-size: 20upx;
color: #8d8d8d;
}
&-line{
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: 2upx;
height: 120upx;
background: #F6F7FA;
}
}
}
</style>
export const billCountOptions = [{
value: "income",
label: "本月总收入(元)",
icon:""
},
{
value: "disbursement",
label: "本月总支出(元)",
icon:""
},
{
value: "surplus",
label: "本月总结余(元)",
icon:""
},
]
export const billingCategoryOptions = [{
value: "1",
label: "交通",
icon:''
},
{
value: "2",
label: "餐饮",
icon:''
},
{
value: "3",
label: "服饰",
icon:''
},
{
value: "4",
label: "购物",
icon:''
},
{
value: "5",
label: "娱乐",
icon:''
},
{
value: "6",
label: "教育",
icon:''
},
{
value: "7",
label: "材料",
icon:''
},
{
value: "8",
label: "设置",
icon:''
},
]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment