yujialong 2 years ago
parent ea46fbc8f0
commit 51e2105c94
  1. 33
      src/layouts/header/index.vue
  2. 1
      src/layouts/navbar/index.vue
  3. 4
      src/pages/article/activity.vue
  4. 4
      src/pages/article/index.vue
  5. 66
      src/pages/column/index.vue
  6. 1
      src/pages/edu/index.vue
  7. 15
      src/pages/news/index.vue
  8. 4
      src/pages/newsPress/index.vue
  9. 4
      src/pages/newsProcurement/index.vue
  10. 2
      src/pages/research/index.vue
  11. 4
      src/store/modules/content.js
  12. 4
      src/styles/common.scss
  13. BIN
      src/styles/font/PingFangTC-Semibold.ttf

@ -10,17 +10,17 @@
</a>
<navbar ref="nav" :isHome.sync="isHome"></navbar>
<div class="tools">
<img class="search" :src="require('@/assets/images/search' + (isHome ? '-white' : '') + '.png')" alt="" @click="showSearch = !showSearch">
<img :src="require('@/assets/images/cn' + (isHome ? '-white' : '') + '.png')" alt="" @click="showSearch = !showSearch">
<img class="search" :src="require('@/assets/images/search' + (isHome ? '-white' : '') + '.png')" alt="" @click="toggleSearch">
<img :src="require('@/assets/images/cn' + (isHome ? '-white' : '') + '.png')" alt="" @click="toggleSearch">
<div v-if="showSearch" class="search-wrap">
<i class="el-icon-search icon"></i>
<input type="text" placeholder="请输入文章标题" v-model="title">
<input ref="search" type="text" placeholder="请输入文章标题" v-model="title">
</div>
</div>
</div>
</template>
<script>
import { mapState, mapMutations, mapActions } from 'vuex'
import { mapMutations } from 'vuex'
import Setting from '@/setting'
import util from '@/libs/util'
import navbar from '../navbar'
@ -29,7 +29,8 @@ export default {
return {
isHome: this.$route.path === '/home',
showSearch: false,
title: ''
title: '',
searchTimer: null
};
},
components: {
@ -38,15 +39,25 @@ export default {
watch: {
'$route'() {
this.isHome = this.$route.path === '/home'
},
title: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.handleSearch()
}, 500)
}
},
beforeDestroy () {
window.removeEventListener('scroll', this.handleScroll)
},
mounted() {
this.setKeyword('')
window.addEventListener('scroll', this.handleScroll) //
},
methods: {
...mapMutations('content', [
'setKeyword'
]),
toIndex() {
this.$refs.nav.jump({
index: '/index/list'
@ -61,6 +72,18 @@ export default {
}
}
},
//
toggleSearch() {
this.showSearch = !this.showSearch
this.$nextTick(() => {
this.$refs.search.focus()
})
},
//
handleSearch() {
this.setKeyword(this.title)
this.title && this.$router.push(`/column`)
}
}
};
</script>

@ -59,7 +59,6 @@ export default {
const menu = document.querySelectorAll('.el-submenu')
for (let i = 0; i < menu.length; i++) {
menu[i].onclick = e => {
console.log(33, e.target)
// id
let id = e.target.getAttribute('id')
if (!id) {

@ -82,7 +82,7 @@ export default {
this.routes = [
{
name: columnName || data.columnName,
path: '/' + path,
path: path ? '/' + path : '',
query: {
id: id || data.columnId
}
@ -172,7 +172,7 @@ export default {
}
.meta {
margin: 10px 0;
font-size: 14px;
font-size: 16px;
font-weight: 600;
color: #333;
}

@ -92,7 +92,7 @@ export default {
this.routes = [
{
name: columnName || data.columnName,
path: '/' + path,
path: path ? '/' + path : '',
query: {
id: id || data.columnId
}
@ -105,7 +105,7 @@ export default {
this.$router.back()
} else {
if (data.articleTemplate === 25) { //
this.$router.replace(`/article/activity?articleId=${this.id}&id=${id}&columnName=${columnName}&path=${path}`)
this.$router.replace(`/article/activity?articleId=${this.id}&id=${id}&columnName=${columnName || ''}&path=${path || ''}`)
} else {
this.form = data
this.columnId = data.columnId

@ -115,6 +115,7 @@
</template>
<script>
import { mapState } from 'vuex'
import Setting from '@/setting'
import Util from '@/libs/util'
import Breadcrumb from '@/components/breadcrumb'
@ -151,7 +152,6 @@ export default {
classifications: [],
labels: [],
columns: [],
all: null,
infoColumns: [],
sameStyle: 1,
allColumnId: [],
@ -170,6 +170,11 @@ export default {
hots: []
}
},
computed: {
...mapState('content', [
'keyword'
])
},
components: {
Breadcrumb
},
@ -179,22 +184,34 @@ export default {
this.init()
},
'form.title': function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.filter()
}, 500)
}
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.filter()
}, 500)
},
keyword() {
this.init()
}
},
mounted() {
this.init()
},
methods: {
init() {
this.getLeftColumn()
this.getInfo()
this.getColumn()
this.getNews()
this.getLabel()
//
if (this.keyword) {
this.form = {
classificationId: null,
title: this.keyword,
convokeType: null
}
} else {
this.getLeftColumn()
this.getInfo()
}
this.getColumn()
this.getNews()
this.getLabel()
},
//
getInfo() {
@ -316,12 +333,26 @@ export default {
// path
this.$router.push(`/${to.path}?id=${to.id}`).catch(err => {})
} else if (left && (typeId === 1 || (typeId === 4 && !to.children.length))) {
// column
this.$router.push(`/column?id=${to.id + (left && (to.level !== 1 || !this.sameStyle) ? '&column=1' : '')}`).catch(err => {})
// column
this.$router.push(`/column?id=${to.id + ((to.level !== 1 || !this.sameStyle) ? '&column=1' : '')}`).catch(err => {})
} else if (left && typeId === 4 && to.children.length) {
//
const el = this.$refs.leftColumn
if (el) {
this.$refs.leftColumn.store.nodesMap[to.id].expanded = !this.$refs.leftColumn.store.nodesMap[to.id].expanded //
this.getArticle([to.children[0].id])
}
}
},
//
getArticle(columnIds) {
// id
if (this.keyword) {
this.loaded = true
this.page = 1
columnIds = []
this.labelId = []
}
const labelName = []
//
this.labels.map(e => {
@ -329,13 +360,14 @@ export default {
})
this.$post(this.api.newlyPublishedArticles, {
siteId: this.$route.query.siteId || this.site,
columnIds: columnIds.length ? columnIds : [this.id],
columnIds,
pageNum: this.page,
pageSize: this.pageSize,
labelName,
...this.form
}).then(({ data }) => {
this.articles = Util.removeTag(data.records)
console.log("🚀 ~ file: index.vue:369 ~ getArticle ~ this.articles", this.articles)
this.total = +data.total
//
// this.total == 1 && this.info.showWithDetails && this.$router.push(`/article?articleId=${this.articles[0].id}&id=${this.articles[0].columnId}`)
@ -351,9 +383,9 @@ export default {
//
filter() {
this.page = 1
this.isFilter = !!(this.form.classificationId || this.form.title || this.form.convokeType || this.lableId.length)
this.isFilter = !!(this.form.classificationId || this.form.title || this.form.convokeType || this.lableId.length) //
let id = []
if (this.isFilter || this.all) {
if (this.isFilter) {
this.getIds(this.columns, id)
} else if (this.columns.length) {
id = [this.columns[0].id]
@ -364,7 +396,7 @@ export default {
this.page = val
this.isFilter = !!(this.form.classificationId || this.form.title || this.form.convokeType || this.lableId.length)
let id = []
if (this.isFilter || this.all) {
if (this.isFilter) {
this.getIds(this.columns, id)
} else if (this.columns.length) {
id = [this.$refs.leftColumn.getCurrentKey()]

@ -98,6 +98,7 @@ export default {
text-align: right;
.texts {
left: 0;
text-align: left;
}
}
}

@ -118,15 +118,15 @@
<div class="texts">
<h6>{{ item.title }}</h6>
<p v-if="item.keynoteSpeaker" class="text">
<i class="el-icon-user icon"></i>
<img class="icon" src="@/assets/images/mine.png" alt="">
{{ item.keynoteSpeaker }}
</p>
<p v-if="item.activityStartTime" class="text">
<i class="el-icon-alarm-clock icon"></i>
<img class="icon" src="@/assets/images/time.png" alt="">
Time: {{ item.activityStartTime + ' ~ ' + item.activityEndTime }}
</p>
<p v-if="item.onlineLocation" class="text">
<i class="el-icon-position icon"></i>
<img class="icon" src="@/assets/images/online.png" alt="">
Address: {{ item.onlineLocation }}
</p>
</div>
@ -476,14 +476,16 @@ export default {
margin-right: 60px;
}
h6 {
margin-bottom: 10px;
font-size: 20px;
color: #272727;
}
.des {
margin-top: 15px;
font-size: 14px;
color: #666;
line-height: 24px;
text-shadow: 0px 0px 30px rgba(48,48,48,0.08);
-webkit-line-clamp: 2;
}
.arrow {
width: 36px;
@ -544,6 +546,9 @@ export default {
background-color: #fff;
cursor: pointer;
transition: .3s;
&:last-child {
margin-bottom: 0;
}
&:hover {
transform: translateX(20px);
}
@ -564,9 +569,7 @@ export default {
margin: 10px 0;
}
.icon {
width: 15px;
margin-right: 5px;
color: #1583FF;
}
}
}

@ -135,11 +135,15 @@ export default {
}
h6 {
font-size: 40px;
font-family: SFProDisplay-Bold, SFProDisplay;
font-weight: bold;
color: #3C3C3C;
}
.sub {
margin: 20px 0;
font-size: 24px;
font-weight: 600;
font-family: PingFangSC-Semibold, PingFang SC;
color: #1C1C1C;
line-height: 33px;
}

@ -131,11 +131,15 @@ export default {
}
h6 {
font-size: 40px;
font-family: SFProDisplay-Bold, SFProDisplay;
font-weight: bold;
color: #3C3C3C;
}
.sub {
margin: 20px 0;
font-size: 24px;
font-weight: 600;
font-family: PingFangSC-Semibold, PingFang SC;
color: #1C1C1C;
line-height: 33px;
}

@ -187,7 +187,7 @@ export default {
line-height: 40px;
text-align: center;
color: #272727;
background-color: #F5F5F5;
background-color: #fff;
}
}
.news-inner {

@ -7,6 +7,7 @@
namespaced: true,
state: {
site: 1,
keyword: ''
},
getters: {
site: state => {
@ -17,6 +18,9 @@
setSite: (state, site) => {
state.site = +site
},
setKeyword: (state, keyword) => {
state.keyword = keyword
},
},
actions: {

@ -9,6 +9,10 @@
font-family: PingFangSC-Medium;
src: url('font/PingFangSC-Medium.otf');
}
@font-face {
font-family: PingFangSC-Semibold;
src: url('font/PingFangTC-Semibold.ttf');
}
@font-face {
font-family: SFProDisplay-Bold;
src: url('font/SF-Pro-Display-Bold.otf');

Loading…
Cancel
Save