From d1c6ee4e4e793f7177c3ebe76eb8bba4ff17e0b7 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 21 Aug 2023 11:54:08 +0800 Subject: [PATCH] fix --- src/libs/util.js | 1 - src/pages/article/index.vue | 21 +++-- src/pages/iasf/index.vue | 142 +++++++++++++++++-------------- src/pages/lightSources/index.vue | 70 ++++++++------- 4 files changed, 134 insertions(+), 100 deletions(-) diff --git a/src/libs/util.js b/src/libs/util.js index 406faf1..9a95e88 100644 --- a/src/libs/util.js +++ b/src/libs/util.js @@ -150,7 +150,6 @@ const util = { // 传入站点id,判断是否英文 getLang(id) { let siteId = util.getQuery('siteId') -console.log("🚀 ~ file: main.js:42 ~ siteId:", siteId) return Setting.enIds.includes(siteId ? +siteId : store.state.content.site) ? 'en' : 'zh' }, }; diff --git a/src/pages/article/index.vue b/src/pages/article/index.vue index d85fa2c..4d51777 100644 --- a/src/pages/article/index.vue +++ b/src/pages/article/index.vue @@ -79,12 +79,24 @@ export default { // 获取文章详情 getInfo () { // 预览直接取缓存数据,不然就调接口 - if (this.preview) { - const data = localStorage.getItem('article') - this.form = data + let cache = localStorage.getItem('article') + if (this.preview && cache) { + cache = JSON.parse(cache) + const temId = cache.articleTemplate + this.form = cache + this.routes = [ + { + name: cache.columnName, + }, + { + name: cache.title + } + ] if (temId == 69) this.isParty = 1 // 组织架构(articleTemplate=69)是另一套主题,加个class即可 if (temId == 72) this.isPeople = 1 // 人物详情(articleTemplate=72)要隐藏除了正文和摘要以外的所有字段 - data.releaseTime = data.releaseTime.split(' ')[0] + if (cache.releaseTime) cache.releaseTime = cache.releaseTime.split(' ')[0] + this.loaded = true + console.log("🚀 ~ file: index.vue:90 ~ getInfo ~ cache:", this.form, cache) } else { this.$post(`${this.api.findArticle}?id=${this.id}`).then(async ({ data }) => { // 设置面包屑 @@ -138,7 +150,6 @@ export default { }, // 列表详情 getColumnInfo () { - console.log("🚀 ~ file: index.vue:125 ~ getColumnInfo ~ this.columnId:", this.columnId) this.columnId && this.$post(`${this.api.findColumn}?id=${this.columnId}`) .then(({ data }) => { if (data.detailStyleId == 69) this.isParty = 1 diff --git a/src/pages/iasf/index.vue b/src/pages/iasf/index.vue index 49a8c59..1c1e53a 100644 --- a/src/pages/iasf/index.vue +++ b/src/pages/iasf/index.vue @@ -116,73 +116,88 @@ @@ -674,7 +689,7 @@ export default { left: 0; width: 100%; height: 100%; - padding: 50px; + padding: 50px 30px; color: #fff; background-color: rgba(0, 0, 0, 0.3); } @@ -710,6 +725,7 @@ export default { margin-bottom: 5px; } .des-wrap { + max-width: calc(100% - 100px); height: auto; margin: 0; } diff --git a/src/pages/lightSources/index.vue b/src/pages/lightSources/index.vue index 8beb301..eaa10d6 100644 --- a/src/pages/lightSources/index.vue +++ b/src/pages/lightSources/index.vue @@ -50,21 +50,27 @@ + + 暂无数据 + @@ -84,25 +90,27 @@ + colspan="20">暂无数据
暂无数据
@@ -208,7 +216,7 @@ export default { } } .copyright { - margin-top: 10px; + margin-top: 25px; font-size: 0.7rem; line-height: 1.6; color: #8d8d8d;