|
@@ -5,8 +5,8 @@ const requestUrlConfig = {
|
|
|
};
|
|
|
|
|
|
const articleList = new Vue({
|
|
|
- el: '#articleList',
|
|
|
- mixins: [cmSysVitaMixins],
|
|
|
+ el: '#ArticleContent',
|
|
|
+ mixins: [cmSysVitaMixins,searchMixins],
|
|
|
filters: {
|
|
|
keywordSlice: function (keyword) {
|
|
|
return keyword.length > 6 ? keyword.slice(0, 6) + '…' : keyword;
|
|
@@ -78,7 +78,6 @@ const articleList = new Vue({
|
|
|
self.initAuthInputComplete();
|
|
|
this.getNewList()
|
|
|
},
|
|
|
-
|
|
|
methods: {
|
|
|
// init auto-input complete
|
|
|
initAuthInputComplete() {
|
|
@@ -403,115 +402,6 @@ const articleList = new Vue({
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
-const infoNotice = new Vue({
|
|
|
- el: "#infoNotice",
|
|
|
- data: {
|
|
|
- newsList: [],
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.getNewList()
|
|
|
- },
|
|
|
- methods: {
|
|
|
- hanldDetails(id) {
|
|
|
- window.open('/news/details.html?id='+id);
|
|
|
- },
|
|
|
- getNewList() {
|
|
|
- PublicApi.GetHomeInit({ source: 1 },({ data }) => {
|
|
|
- if (isPC) {
|
|
|
- this.newsList = data.annlist
|
|
|
- } else {
|
|
|
- this.newsList = data.annlist.slice(0,1)
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-})
|
|
|
-
|
|
|
-const searchTop = new Vue({
|
|
|
- el: "#info-header",
|
|
|
- data: {
|
|
|
- show: false,
|
|
|
- searchKeys: "",
|
|
|
- right_drawer: false,
|
|
|
- activeNames: '', // active names
|
|
|
- keywords: '',
|
|
|
- keywordsList: [],
|
|
|
- selectUlKeys: null,
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- },
|
|
|
- watch: {
|
|
|
- // 关键词搜索
|
|
|
- keywords(val) {
|
|
|
- if (val) {
|
|
|
- setTimeout(() => {
|
|
|
- this.getKeywordsList(val)
|
|
|
- }, 500)
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
- methods: {
|
|
|
- async getKeywordsList(key) {
|
|
|
- const {data} = await PublicApi.fetchQueryKeywordList({keyword: key})
|
|
|
- this.keywordsList = data
|
|
|
- this.selectUlKeys = document.getElementsByClassName('auto-select-list')[0]
|
|
|
- if (data.length > 0) {
|
|
|
- this.renderList()
|
|
|
- this.selectUlKeys.style.display = 'block'
|
|
|
- } else {
|
|
|
- this.selectUlKeys.style.display = 'none'
|
|
|
- }
|
|
|
- },
|
|
|
- renderList() {
|
|
|
- this.selectUlKeys.innerHTML = ''
|
|
|
- this.keywordsList.forEach((text) => {
|
|
|
- const li = document.createElement('li');
|
|
|
- li.innerHTML = text.keyword.replace(new RegExp(this.keywords, 'ig'), (match)=> '<span style="color: #FF5B00;">' + match + '</span>');
|
|
|
- li.addEventListener('click', () => this.listItemClick(text));
|
|
|
- this.selectUlKeys.appendChild(li);
|
|
|
- })
|
|
|
- },
|
|
|
- listItemClick(text) {
|
|
|
- this.keywords = text.keyword
|
|
|
- this.selectUlKeys.innerHTML = ''
|
|
|
- this.selectUlKeys.style.display = 'none'
|
|
|
- this.itemClick(text.keyword)
|
|
|
- },
|
|
|
- itemClick: function (keyword) {
|
|
|
- window.location.href = '/info/search-1.html?keyword='+keyword + '&linkageFlag=1';
|
|
|
- },
|
|
|
- // h5弹窗搜索
|
|
|
- handlerH5Search() {
|
|
|
- let tip = this.searchKeys === '' ? '请输入文章关键字!' : this.searchKeys.length < 2 ? '请至少输入两个关键字!' : true;
|
|
|
- if(!tip) {
|
|
|
- $.confirm({
|
|
|
- useBootstrap: false,
|
|
|
- boxWidth: (isPC ? '300px' : '70%'),
|
|
|
- title: '提示',
|
|
|
- content: tip,
|
|
|
- closeIcon: true,
|
|
|
- animation: 'opacity',
|
|
|
- closeAnimation: 'opacity',
|
|
|
- animateFromElement: false,
|
|
|
- buttons: {
|
|
|
- close: {
|
|
|
- text: '确定',
|
|
|
- btnClass: 'btn-confirm'
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.show = !this.show;
|
|
|
- window.location.href = '/info/search-1.html?keyword=' + this.searchKeys
|
|
|
- }
|
|
|
- },
|
|
|
- handleOpenLink() {
|
|
|
- window.location.href = '/info/center-3-1.html'
|
|
|
- }
|
|
|
- }
|
|
|
-})
|
|
|
-
|
|
|
function initFilterSort(option = {}) {
|
|
|
var sortControl = $(option.el);
|
|
|
var sortItem = sortControl.find('.search__sort_select li');
|