Skip to content

Commit

Permalink
complete project
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangtong committed Jul 21, 2018
1 parent 57a37d6 commit f0d1d2a
Show file tree
Hide file tree
Showing 17 changed files with 1,202 additions and 336 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ module.exports = {
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'no-console': 0,
'comma-dangle': 0
'comma-dangle': 0,
'no-underscore-dangle': 0
},
globals: {
App: true,
Expand Down
4 changes: 2 additions & 2 deletions project.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"miniprogramRoot": "./dist/",
"compileType": "miniprogram",
"appid": "11223344",
"projectname": "wx-book",
"appid": "wxd79a740cabcc7d2d",
"projectname": "text-book",
"condition": {
"search": {
"current": -1,
Expand Down
16 changes: 14 additions & 2 deletions src/components/BookItem.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<template>
<div class="book-item" @click="onClick">
<div class="book-item" @click="onClick" @longpress="onLongpress">
<image class="book-item_cover" mode="aspectFill" :src="cover" />
<div class="book-item_body">
<text class="book-item_title">{{title}}</text>
<text class="book-item_text">{{content}}</text>
</div>
<i class="update-tip" v-if="hasUpdated" />
<slot></slot>
</div>
</template>

<script>
export default {
props: ['title', 'content', 'cover'],
props: ['title', 'content', 'cover', 'hasUpdated'],
methods: {
onClick() {
this.$emit('click');
},
onLongpress() {
this.$emit('longpress');
}
}
};
Expand Down Expand Up @@ -43,5 +47,13 @@ export default {
color: #666;
display: block;
}
.update-tip{
position: absolute;
right: 20px;
width: 6px;
height: 6px;
border-radius: 50%;
background-color: #4393e2;
}
}
</style>
6 changes: 5 additions & 1 deletion src/components/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:placeholder="placeholder"
:disabled="readonly"
:focus="focus"
:value="value"
@confirm="onSearch"
/>
</div>
Expand All @@ -27,11 +28,14 @@
focus: {
type: Boolean,
default: false
},
value: {
type: String
}
},
methods: {
onSearch(e) {
this.$emit('search', e);
this.$emit('search', e.target.value);
},
onClick(e) {
this.$emit('click', e);
Expand Down
5 changes: 4 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import Promise from 'bluebird';
import Vue from 'vue';
import App from './App';

Vue.config.productionTip = false;
App.mpType = 'app';

global.Promise = Promise;

const app = new Vue(App);
app.$mount();

Expand All @@ -22,7 +25,7 @@ export default {
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#4393e2',
navigationBarTitleText: '小说阅读器',
navigationBarTitleText: 'Deny阅读',
navigationBarTextStyle: 'white',
},
},
Expand Down
410 changes: 227 additions & 183 deletions src/mock.js

Large diffs are not rendered by default.

Loading

0 comments on commit f0d1d2a

Please sign in to comment.