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> </a>
<navbar ref="nav" :isHome.sync="isHome"></navbar> <navbar ref="nav" :isHome.sync="isHome"></navbar>
<div class="tools"> <div class="tools">
<img class="search" :src="require('@/assets/images/search' + (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="showSearch = !showSearch"> <img :src="require('@/assets/images/cn' + (isHome ? '-white' : '') + '.png')" alt="" @click="toggleSearch">
<div v-if="showSearch" class="search-wrap"> <div v-if="showSearch" class="search-wrap">
<i class="el-icon-search icon"></i> <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> </div>
</div> </div>
</template> </template>
<script> <script>
import { mapState, mapMutations, mapActions } from 'vuex' import { mapMutations } from 'vuex'
import Setting from '@/setting' import Setting from '@/setting'
import util from '@/libs/util' import util from '@/libs/util'
import navbar from '../navbar' import navbar from '../navbar'
@ -29,7 +29,8 @@ export default {
return { return {
isHome: this.$route.path === '/home', isHome: this.$route.path === '/home',
showSearch: false, showSearch: false,
title: '' title: '',
searchTimer: null
}; };
}, },
components: { components: {
@ -38,15 +39,25 @@ export default {
watch: { watch: {
'$route'() { '$route'() {
this.isHome = this.$route.path === '/home' this.isHome = this.$route.path === '/home'
},
title: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.handleSearch()
}, 500)
} }
}, },
beforeDestroy () { beforeDestroy () {
window.removeEventListener('scroll', this.handleScroll) window.removeEventListener('scroll', this.handleScroll)
}, },
mounted() { mounted() {
this.setKeyword('')
window.addEventListener('scroll', this.handleScroll) // window.addEventListener('scroll', this.handleScroll) //
}, },
methods: { methods: {
...mapMutations('content', [
'setKeyword'
]),
toIndex() { toIndex() {
this.$refs.nav.jump({ this.$refs.nav.jump({
index: '/index/list' 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> </script>

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

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

@ -92,7 +92,7 @@ export default {
this.routes = [ this.routes = [
{ {
name: columnName || data.columnName, name: columnName || data.columnName,
path: '/' + path, path: path ? '/' + path : '',
query: { query: {
id: id || data.columnId id: id || data.columnId
} }
@ -105,7 +105,7 @@ export default {
this.$router.back() this.$router.back()
} else { } else {
if (data.articleTemplate === 25) { // 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 { } else {
this.form = data this.form = data
this.columnId = data.columnId this.columnId = data.columnId

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

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

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

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

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

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

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

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

Loading…
Cancel
Save