Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maoxiaoquan committed Oct 29, 2019
1 parent 91c31ca commit 8186500
Show file tree
Hide file tree
Showing 65 changed files with 180 additions and 165 deletions.
1 change: 0 additions & 1 deletion admin/src/containers/DynamicComment/view/DynamicComment.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ class DynamicComment extends React.Component {
}

commentRender = val => {
console.log('val', val)
let newComment = val
faceqq.map(faceItem => {
newComment = newComment.replace(
Expand Down
4 changes: 2 additions & 2 deletions client/src/assets/css/other.scss
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
position: absolute;
left: 0;
top: 0;
z-index: 100;
z-index: 220;
background-color: rgba(255, 255, 255, 0.95);
overflow: hidden;
}
Expand All @@ -184,7 +184,7 @@
width: 30px;
height: 30px;
border-radius: 50%;
border: 4px solid purple;
border: 4px solid #f1f1f1;
border-left-color: transparent;
animation: custom-loading-rotate 1s linear infinite;
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Face/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
v-for="(item,key) in faceqq"
@click="changeFace(item)"
:key="key">
<img :src="item.face_url"
<img v-lazy="item.face_url"
:alt="item.face_text">
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/MarkDown/components/mdHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<!-- 缩略图展示 -->
<img class="image-show"
:class="{'transition': transition}"
:src="item[1].miniurl"
v-lazy="item[1].miniurl"
alt="none">
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion client/src/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const loading = {
}
} */
const curStyle = window.getComputedStyle(el)
console.log('curStyle', curStyle)
const position = curStyle.position
if (position === 'absolute' || position === 'relative') {
el.style.position = position
Expand Down
10 changes: 10 additions & 0 deletions client/src/entryClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Vue from 'vue'
import { createApp } from './app'
import NProgress from 'nprogress'
import { loading } from './directive'

import VueLazyload from 'vue-lazyload'
const { app, router, store } = createApp()
NProgress.configure({
easing: 'ease', // 动画方式
Expand All @@ -11,6 +13,14 @@ NProgress.configure({
minimum: 0.3 // 初始化时的最小百分比
})

// or with options
Vue.use(VueLazyload, {
preLoad: 1.3,
error: '/default/img/loadingfail.png',
loading: '/default/img/loadingimg.png',
attempt: 1
})

Vue.mixin({
beforeRouteUpdate (to, from, next) {
const { asyncData } = this.$options
Expand Down
10 changes: 5 additions & 5 deletions client/src/router/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ export default [
//动态 2019.8.1 12:11开发
path: 'dynamics/:dynamicTopicId',
name: 'dynamics',
component: require('@views/Dynamic/index').default // 动态首页
component: () => import('@views/Dynamic/index') // 动态首页
},
{
path: 'dynamic/:dynamicId',
name: 'dynamicView',
component: require('@views/Dynamic/dynamicView').default // 动态内容页
component: () => import('@views/Dynamic/dynamicView') // 动态内容页
},
{
path: 'topics',
Expand All @@ -106,7 +106,7 @@ export default [
{
path: 'topic/:dynamicTopicId',
name: 'dynamicTopicView',
component: require('@views/Dynamic/dynamicTopicView').default // 动态专题内容页
component: () => import('@views/Dynamic/dynamicTopicView') // 动态专题内容页
},
// {
// path: 'blogs/:columnEnName', 屏蔽,此功能不开放
Expand All @@ -121,7 +121,7 @@ export default [
{
path: 'books-write/:type',
name: 'booksWrite',
component: require('@views/Books/WriteBooks').default // 小书创建修改
component: () => import('@views/Books/WriteBooks') // 小书创建修改
},
{
path: 'books/:columnEnName',
Expand All @@ -143,7 +143,7 @@ export default [
{
path: '/book/:books_id/write/:book_id',
name: 'WriteBookView',
component: require('@views/BookView/WriteBookView').default // 编辑小书内容
component: () => import('@views/BookView/WriteBookView') // 编辑小书内容
},
{
path: '/sign/in',
Expand Down
25 changes: 1 addition & 24 deletions client/src/store/module/articleComment.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
import { fetch } from '@request'

const state = () => ({
article_comment: {
comment_list: [],
count: 0,
page: 1,
pageSize: 10
}
})

const mutations = {
SET_ARTICLE_COMMENT_UNSHIFT (state, data) {
// 追加评论
state.article_comment.comment_list.unshift(data)
},
SET_ARTICLE_COMMENT_LIST (state, data) {
// 设置评论列表
state.article_comment = data
},
SET_ARTICLE_COMMENT_COUNT_ADD (state, data) {
// 追加评论
state.article_comment.count = state.article_comment.count + 1
}
}
const state = () => ({})

const actions = {
ARTICLE_COMMENT_LIST ({ commit, dispatch, state }, parameter) {
Expand Down Expand Up @@ -59,7 +37,6 @@ const getters = {}
export default {
namespaced: true,
state,
mutations,
actions,
getters
}
8 changes: 8 additions & 0 deletions client/src/store/module/dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ const mutations = {
SET_RECOMMEND_DYNAMIC_LIST (state, data) {
// 设置推荐动态列表
state.recommendDynamicList = data
},
SET_RSS_DYNAMIC_TOPIC ({ commit, dispatch, state }, parameter) {
// 订阅动态话题
return fetch({
url: '/subscribe/dynamic_topic',
method: 'post',
parameter: parameter
})
}
}

Expand Down
2 changes: 0 additions & 2 deletions client/src/store/module/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import setting from './setting'
import search from './search'
import website from './website'
import dynamic from './dynamic'
import rss from './rss'
import books from './books'
import book from './book'

Expand All @@ -31,7 +30,6 @@ export default {
search,
website,
dynamic,
rss,
books,
book
}
26 changes: 0 additions & 26 deletions client/src/store/module/rss.js

This file was deleted.

3 changes: 1 addition & 2 deletions client/src/views/Article/Article.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="author">
<router-link :to="{name:'user',params:{uid:article.user.uid,routeType:'article'}}"
class="avatar">
<img :src="article.user.avatar"
<img v-lazy="article.user.avatar"
alt />
</router-link>
<div class="info">
Expand Down Expand Up @@ -171,7 +171,6 @@ export default {
this.$store.dispatch("article/GET_ARTICLE", { aid: this.$route.params.aid })
},
isCollect (item) { // 是否收藏
console.log('item', item)
let likeUserIds = []
if (item.likeUserIds && item.likeUserIds.length > 0) {
item.likeUserIds.map(item => {
Expand Down
4 changes: 2 additions & 2 deletions client/src/views/Article/component/ArticleItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
v-if="articleItem.article_blog">
<router-link :to="{name:'user',params:{uid:articleItem.user.uid,routeType:'article'}}"
class="avatar">
<img :src="articleItem.user.avatar"
<img v-lazy="articleItem.user.avatar"
alt="">
</router-link>
<router-link :to="{name:'user',params:{uid:articleItem.user.uid,routeType:'article'}}"
Expand All @@ -67,7 +67,7 @@
<div class="thumb"
v-if="articleItem.cover_img">
<img class="box-image"
:src="articleItem.cover_img"
v-lazy="articleItem.cover_img"
alt="">
</div>
</article>
Expand Down
4 changes: 2 additions & 2 deletions client/src/views/ArticleBlog/BlogView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="user-article-blog-top">
<div class="article-blog-icon">
<img class="box-image"
:src="articleBlog.blogInfo.icon"
v-lazy="articleBlog.blogInfo.icon"
alt="">
</div>

Expand Down Expand Up @@ -67,7 +67,7 @@
<ul>
<li class="item item-icon read-count">
<img class="user-avatar"
:src="articleBlog.blogInfo.user.avatar"
v-lazy="articleBlog.blogInfo.user.avatar"
alt="">
<router-link :to='{name:"user",params:{uid:articleBlog.blogInfo.user.uid}}'
class="nickname">{{articleBlog.blogInfo.user.nickname}}</router-link>
Expand Down
2 changes: 1 addition & 1 deletion client/src/views/ArticleBlog/component/blogArticleItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</div>
<div class="thumb"
v-if="articleItem.cover_img">
<img :src="articleItem.cover_img"
<img v-lazy="articleItem.cover_img"
class="box-image"
alt="">
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/views/ArticleTag/ArticleTag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
v-if="articleTag">
<div class="main-top">
<div class="thumb">
<img :src="articleTag.icon"
<img v-lazy="articleTag.icon"
class="box-image"
alt="">
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/views/ArticleTag/component/ArticleTagItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<router-link :to='{name:"article_tag",params:{en_name:articleTagItem.en_name}}'>
<div class="thumb">
<img :src="articleTagItem.icon"
<img v-lazy="articleTagItem.icon"
class="box-image"
alt="">
</div>
Expand Down
4 changes: 2 additions & 2 deletions client/src/views/Book/Book.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="client-card">
<div class="book-info">
<div class="poster">
<img :src="books.booksInfo.cover_img||''">
<img v-lazy="books.booksInfo.cover_img||''">
</div>
<div class="info">
<div class="title-line">
Expand All @@ -26,7 +26,7 @@
<router-link :to="{name:'user',params:{uid:books.booksInfo.user.uid,routeType:'article'}}"
class="user">
<img class="lazy avatar hero loaded"
:src="books.booksInfo.user.avatar"
v-lazy="books.booksInfo.user.avatar"
alt="">
<span class="username username">
{{books.booksInfo.user.nickname}}
Expand Down
2 changes: 1 addition & 1 deletion client/src/views/BookView/BookView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<div class="el-dropdown-link"
slot="button">
<div class="avatar-img">
<img :src="personalInfo.user.avatar"
<img v-lazy="personalInfo.user.avatar"
class="box-image"
alt="">
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/views/BookView/WriteBookView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<div class="el-dropdown-link"
slot="button">
<div class="avatar-img">
<img :src="personalInfo.user.avatar"
<img v-lazy="personalInfo.user.avatar"
class="box-image"
alt="">
</div>
Expand Down
3 changes: 1 addition & 2 deletions client/src/views/Books/Books.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<div class="library-item clearfix client-card">
<div class="library-item__thumb">
<router-link :to="{name:'book',params:{books_id:booksItem.books_id}}">
<img :src="booksItem.cover_img"
<img v-lazy="booksItem.cover_img"
class="img-full"
lazy="loaded">
</router-link>
Expand Down Expand Up @@ -236,7 +236,6 @@ export default {
},
switchColumn (val) {
this.articleColumn.homeColumn.map(item => {
console.log(item.en_name, val)
if (item.en_name === val) {
this.childNavItem = item || {}
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/views/Books/WriteBooks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="row mrg-bm20 books-write-content">
<div class="col-xs-12 col-sm-4 col-md-3 box-form-group">
<div class="cover-img">
<img :src="write.cover_img"
<img v-lazy="write.cover_img"
v-if="write.cover_img"
class="cover-img-view"
alt="">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="comment-item"
:id="'comment'+childCommentItem.id">
<div class="avatar">
<img :src="childCommentItem.user.avatar"
<img v-lazy="childCommentItem.user.avatar"
class="box-image"
alt="">
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/views/Comment/ArticleComment/CommentForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
id="comment_form">
<div class="comment-avatar">
<img v-if="personalInfo.islogin"
:src="personalInfo.user.avatar"
v-lazy="personalInfo.user.avatar"
class="box-image"
alt="">
<img v-else
Expand Down
2 changes: 1 addition & 1 deletion client/src/views/Comment/ArticleComment/CommentItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:id="'comment'+commentItem.id"
ref="comment_list">
<div class="avatar">
<img :src="commentItem.user.avatar"
<img v-lazy="commentItem.user.avatar"
class="box-image"
alt="">
</div>
Expand Down
Loading

0 comments on commit 8186500

Please sign in to comment.