Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zbl91555 committed May 17, 2017
1 parent 9814af7 commit dcb54c3
Show file tree
Hide file tree
Showing 6 changed files with 296 additions and 159 deletions.
367 changes: 274 additions & 93 deletions .idea/workspace.xml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion build/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var proxyTable = config.dev.proxyTable;
var app = express();


//发生数据请求
/*//发生数据请求
var content = require('../mock/home/content');
var banner = require('../mock/home/banner');
var upload = require('../mock/home/upload');
Expand Down Expand Up @@ -78,6 +78,7 @@ apiRouter.get('/topic/chapterList', function (req, res) {
app.use('/api', apiRouter);
*/

var compiler = webpack(webpackConfig);

Expand Down
45 changes: 0 additions & 45 deletions src/components/common/pageTransition.vue

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div class="upload-wrap">
<div class="update-wrap">
<!--color="#696969" rippleOpacity="'0.3'"-->
<div class="guess">猜你喜欢</div>
<div v-for="book in uploadData" class="book-list clearfix" @click="goDetail(book.id)">
<div v-for="book in updateData" class="book-list clearfix" @click="goDetail(book.id)">
<a :href="book.shareUrl" class="link" @click.prevent="">
<div class="avatar">
<img v-lazy="book.images[0].imgUrl" width="104" height="80" class="icon">
Expand All @@ -18,8 +18,8 @@
</div>
</a>
</div>
<mu-raised-button :label="progressShow?'正在努力加载中,请稍等...':'点击加载更多'" class="upload-btn"
@click="upload" :rippleOpacity="0.2" fullWidth/>
<mu-raised-button :label="progressShow?'正在努力加载中,请稍等...':'点击加载更多'" class="update-btn"
@click="update" :rippleOpacity="0.2" fullWidth/>
<mu-linear-progress :size="8" v-if="progressShow" color="#d500f9"/>
</div>
</template>
Expand All @@ -30,31 +30,31 @@
export default {
data(){
return {
uploadData: [],
updateData: [],
progressShow: false //进度条显示状态
}
},
computed: {
...mapState(['guessContent'])
},
methods: {
upload() {
update() {
if (this.progressShow) { //防止多次次点击加载按钮
console.log(this.progressShow);
return;
}
this.progressShow = true;
this.$store.dispatch(types.UPLOAD_GUESS).then(() => {
this.guessContent.list.forEach((item) => {
this.uploadData.push(item);
this.updateData.push(item);
});
this.progressShow = false;
});
// guessApi.then((res)=> {
// if (res.data.status === ERRNO) {
// console.log(res.data);
// res.data.data.list.forEach((item) => {
// this.uploadData.push(item);
// this.updateData.push(item);
// });
// }
// });
Expand All @@ -67,7 +67,7 @@
created() {
this.$store.dispatch(types.UPLOAD_GUESS).then(() => {
this.guessContent.list.forEach((item) => {
this.uploadData.push(item);
this.updateData.push(item);
});
});
}
Expand All @@ -78,7 +78,7 @@
<style lang="less" rel="stylesheet/less" scoped>
@import "../../../static/less/index";
.upload-wrap {
.update-wrap {
background-color: #fff;
.guess {
height: 26px;
Expand Down Expand Up @@ -166,7 +166,7 @@
}
}
.upload-btn {
.update-btn {
height: 40px;
border-radius: 6px;
}
Expand Down
6 changes: 3 additions & 3 deletions src/page/home/children/content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
</li>
</ul>
</div>
<r-upload></r-upload>
<r-update></r-update>
</div>
</template>

<script type="text/ecmascript-6">
import * as types from '../../../store/mutationsTypes';
import upload from './../../../components/common/upload';
import update from './../../../components/common/update';
import loading from './../../../components/common/loading';
import api from '../../../api';
Expand All @@ -48,7 +48,7 @@
}
},
components: {
'rUpload': upload,
'rUpdate': update,
'rLoading': loading
},
computed: {
Expand Down
12 changes: 6 additions & 6 deletions src/page/search/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<input type="search" ref="search" class="search-input" placeholder="请输入搜索关键字">
<span class="text" @click="search">搜索</span>
</div>
<div class="upload-wrap">
<div class="update-wrap">
<!--color="#696969" rippleOpacity="'0.3'"-->
<div v-for="book in uploadData" class="book-list clearfix" @click="goDetail(book.id)">
<div v-for="book in updateData" class="book-list clearfix" @click="goDetail(book.id)">
<a :href="book.shareUrl" class="link" @click.prevent="">
<div class="avatar">
<img v-lazy="book.images[0].imgUrl" width="104" height="80" class="icon">
Expand Down Expand Up @@ -35,7 +35,7 @@
export default {
data() {
return {
uploadData: [],
updateData: [],
isErrorData: false
}
},
Expand All @@ -48,10 +48,10 @@
api.searchApi(keyword).then((data) => {
if (data.data.data.length === 0) {
this.isErrorData = true;
this.uploadData = [];
this.updateData = [];
} else {
this.isErrorData = false;
this.uploadData = data.data.data;
this.updateData = data.data.data;
}
});
},
Expand Down Expand Up @@ -92,7 +92,7 @@
align-self: center;
}
}
.upload-wrap {
.update-wrap {
background-color: #fff;
padding: 0 14px;
.guess {
Expand Down

0 comments on commit dcb54c3

Please sign in to comment.