Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图表页功能改进 #27

Merged
merged 5 commits into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add account_book page
  • Loading branch information
yigger committed Oct 26, 2019
commit a2add7fc4a184a8bd7323ee3834137f48abaaecb
1 change: 1 addition & 0 deletions src/app.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default class extends wepy.app {
"pages/settings/super_statement",
"pages/settings/about",
"pages/settings/search",
"pages/settings/account_book",

// 账单墙
"pages/statements/images",
Expand Down
4 changes: 4 additions & 0 deletions src/pages/index.wpy
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<view class="container">
<view class="statement-category">
生活账本
</view>

<view class="header">
<image class="bg" src="{{ header.bg_avatar }}"></image>
<view class="level-2">
Expand Down
6 changes: 6 additions & 0 deletions src/pages/setting.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@

<view class="setting-container">
<i-cell-group>
<i-cell
title="账本列表"
label="未开启多账本"
is-link url="/pages/settings/account_book">
</i-cell>

<i-cell
title="账单图库"
is-link url="/pages/statements/images">
Expand Down
43 changes: 43 additions & 0 deletions src/pages/settings/account_book.wpy
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<template>
<view class="container">
<view wx:for="{{ accountBooks }}">
<i-card title="{{ item.name }}" extra="默认" thumb="https://i.loli.net/2017/08/21/599a521472424.jpg">
<view slot="content">
设为默认
</view>
<!-- <view slot="footer">设为默认</view> -->
</i-card>
</view>
</view>
</template>

<script>
import wepy from 'wepy'
import wxRequest from '@/utils/wxRequest'
import tip from '../../utils/tip'
import Session from '@/utils/session'

export default class SettingsAccountBook extends wepy.page {
config = {
navigationBarTitleText: '账本列表',
"usingComponents": {
"i-card": "../../public/iview/card/index"
}
}

data = {
accountBooks: []
}

onShow () {
this.getAccountBooks()
}

async getAccountBooks() {
const data = await wxRequest.Get('account_books')
this.accountBooks = data
this.$apply()
}
}
</script>
<style lang="scss" src="@/public/styles/about.scss"></style>
7 changes: 7 additions & 0 deletions src/public/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ page, .container{
}
}

.statement-category {
position: absolute;
top: 12px;
left: 12px;
color: white;
}

.statements {
.statement-title {
position: relative;
Expand Down