fix: 共性能力暂时用模拟数据
This commit is contained in:
parent
ebea68ebd1
commit
404bb58464
@ -290,7 +290,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import GxnlptCardTags from '@/pages/index/views/gxnlpt/components/GxnlptCardTags.vue';
|
import GxnlptCardTags from '@/pages/index/views/gxnlpt/components/GxnlptCardTags.vue';
|
||||||
import api from '@/pages/index/api/gxnl/index.js';
|
// import api from '@/pages/index/api/gxnl/index.js'; // TODO 前端模拟数据,暂不请求后端
|
||||||
// 兜底数据:204 条共性能力链接
|
// 兜底数据:204 条共性能力链接
|
||||||
// 来源:可信碳共性能力网站导航.xlsx
|
// 来源:可信碳共性能力网站导航.xlsx
|
||||||
// 按表格实际分类(Sheet1 3 类 + Sheet2 15 类 = 18 个分类)自动归类
|
// 按表格实际分类(Sheet1 3 类 + Sheet2 15 类 = 18 个分类)自动归类
|
||||||
@ -1129,34 +1129,37 @@ export default {
|
|||||||
},
|
},
|
||||||
async loadAllSections() {
|
async loadAllSections() {
|
||||||
this.pageLoading = true;
|
this.pageLoading = true;
|
||||||
this.useDemoData = false;
|
// TODO 前端模拟数据,暂不请求后端接口
|
||||||
if (FORCE_DEMO_PREVIEW) {
|
// this.useDemoData = false;
|
||||||
this.applyDemoFallback();
|
// if (FORCE_DEMO_PREVIEW) {
|
||||||
this.pageLoading = false;
|
// this.applyDemoFallback();
|
||||||
return;
|
// this.pageLoading = false;
|
||||||
}
|
// return;
|
||||||
try {
|
// }
|
||||||
const res = await api.wzxxList({
|
// try {
|
||||||
pageNo: 1,
|
// const res = await api.wzxxList({
|
||||||
pageSize: 200,
|
// pageNo: 1,
|
||||||
});
|
// pageSize: 200,
|
||||||
const data = res && res.data;
|
// });
|
||||||
const records = ((data && data.records) || []).map((r) => this.normalizeRecord(r));
|
// const data = res && res.data;
|
||||||
if (!records.length) {
|
// const records = ((data && data.records) || []).map((r) => this.normalizeRecord(r));
|
||||||
this.applyDemoFallback();
|
// if (!records.length) {
|
||||||
return;
|
// this.applyDemoFallback();
|
||||||
}
|
// return;
|
||||||
this.assignCategoryCards(records);
|
// }
|
||||||
const hasCards = this.categoryList.some((c) => c.displayList.length);
|
// this.assignCategoryCards(records);
|
||||||
if (!hasCards) {
|
// const hasCards = this.categoryList.some((c) => c.displayList.length);
|
||||||
this.applyDemoFallback();
|
// if (!hasCards) {
|
||||||
}
|
// this.applyDemoFallback();
|
||||||
} catch (e) {
|
// }
|
||||||
console.error('共性能力列表加载失败', e);
|
// } catch (e) {
|
||||||
this.applyDemoFallback();
|
// console.error('共性能力列表加载失败', e);
|
||||||
} finally {
|
// this.applyDemoFallback();
|
||||||
this.pageLoading = false;
|
// } finally {
|
||||||
}
|
// this.pageLoading = false;
|
||||||
|
// }
|
||||||
|
this.applyDemoFallback();
|
||||||
|
this.pageLoading = false;
|
||||||
},
|
},
|
||||||
getScrollRoot() {
|
getScrollRoot() {
|
||||||
// 门户落地页共用滚动容器为 .content-wrap(main.vue 唯一滚动区),
|
// 门户落地页共用滚动容器为 .content-wrap(main.vue 唯一滚动区),
|
||||||
@ -1304,23 +1307,24 @@ export default {
|
|||||||
},
|
},
|
||||||
async loadFavorites() {
|
async loadFavorites() {
|
||||||
this.favoritesLoading = true;
|
this.favoritesLoading = true;
|
||||||
try {
|
// TODO 前端模拟数据,暂不请求后端接口
|
||||||
const res = await api.myFavoriteList({ pageNo: 1, pageSize: 200 });
|
// try {
|
||||||
const data = res && res.data;
|
// const res = await api.myFavoriteList({ pageNo: 1, pageSize: 200 });
|
||||||
const records = ((data && data.records) || []).map((r) => this.normalizeRecord(r));
|
// const data = res && res.data;
|
||||||
this.favoriteList = records.map((card) => {
|
// const records = ((data && data.records) || []).map((r) => this.normalizeRecord(r));
|
||||||
card.scbz = 'Y';
|
// this.favoriteList = records.map((card) => {
|
||||||
return card;
|
// card.scbz = 'Y';
|
||||||
});
|
// return card;
|
||||||
} catch (e) {
|
// });
|
||||||
if (isUnauthorizedError(e)) {
|
// } catch (e) {
|
||||||
showLoginGuide({ actionText: '查看我的收藏' });
|
// if (isUnauthorizedError(e)) {
|
||||||
return;
|
// showLoginGuide({ actionText: '查看我的收藏' });
|
||||||
}
|
// return;
|
||||||
this.$message.warning('我的收藏加载失败');
|
// }
|
||||||
} finally {
|
// this.$message.warning('我的收藏加载失败');
|
||||||
|
// } finally {
|
||||||
this.favoritesLoading = false;
|
this.favoritesLoading = false;
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
resetSubmitForm() {
|
resetSubmitForm() {
|
||||||
this.submitForm = SUBMIT_FORM_EMPTY();
|
this.submitForm = SUBMIT_FORM_EMPTY();
|
||||||
@ -1380,25 +1384,26 @@ export default {
|
|||||||
this.contentView = 'list';
|
this.contentView = 'list';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
// TODO 前端模拟数据,暂不请求后端接口
|
||||||
await api.submitSlxx({
|
// try {
|
||||||
bt: this.submitForm.bt1,
|
// await api.submitSlxx({
|
||||||
wzLj: this.submitForm.lj,
|
// bt: this.submitForm.bt1,
|
||||||
jj: this.submitForm.jj,
|
// wzLj: this.submitForm.lj,
|
||||||
gxnlFlDm: flTitleToDm(this.submitForm.fl),
|
// jj: this.submitForm.jj,
|
||||||
bqjh: this.submitForm.bq,
|
// gxnlFlDm: flTitleToDm(this.submitForm.fl),
|
||||||
});
|
// bqjh: this.submitForm.bq,
|
||||||
this.$message.success('提交成功,请等待审核');
|
// });
|
||||||
this.resetSubmitForm();
|
// this.$message.success('提交成功,请等待审核');
|
||||||
this.contentView = 'list';
|
// this.resetSubmitForm();
|
||||||
await this.loadAllSections();
|
// this.contentView = 'list';
|
||||||
} catch (e) {
|
// await this.loadAllSections();
|
||||||
if (isUnauthorizedError(e)) {
|
// } catch (e) {
|
||||||
showLoginGuide({ actionText: '提交收录' });
|
// if (isUnauthorizedError(e)) {
|
||||||
return;
|
// showLoginGuide({ actionText: '提交收录' });
|
||||||
}
|
// return;
|
||||||
this.$message.warning('提交失败,请稍后重试');
|
// }
|
||||||
}
|
// this.$message.warning('提交失败,请稍后重试');
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 平滑滚动到指定分类区块。
|
* 平滑滚动到指定分类区块。
|
||||||
@ -1863,19 +1868,20 @@ export default {
|
|||||||
card.scbz = card.scbz === 'Y' ? 'N' : 'Y';
|
card.scbz = card.scbz === 'Y' ? 'N' : 'Y';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
// TODO 前端模拟数据,暂不请求后端接口
|
||||||
const type = card.scbz === 'Y' ? 'remove' : 'add';
|
// try {
|
||||||
await api.toggleGxsc({ wzUuid: card.gxUuid, type });
|
// const type = card.scbz === 'Y' ? 'remove' : 'add';
|
||||||
const next = card.scbz === 'Y' ? 'N' : 'Y';
|
// await api.toggleGxsc({ wzUuid: card.gxUuid, type });
|
||||||
card.scbz = next;
|
// const next = card.scbz === 'Y' ? 'N' : 'Y';
|
||||||
this.syncFavoriteListAfterToggle(card, next);
|
// card.scbz = next;
|
||||||
} catch (e) {
|
// this.syncFavoriteListAfterToggle(card, next);
|
||||||
if (isUnauthorizedError(e)) {
|
// } catch (e) {
|
||||||
showLoginGuide({ actionText: '收藏' });
|
// if (isUnauthorizedError(e)) {
|
||||||
return;
|
// showLoginGuide({ actionText: '收藏' });
|
||||||
}
|
// return;
|
||||||
this.$message.warning('收藏操作失败');
|
// }
|
||||||
}
|
// this.$message.warning('收藏操作失败');
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
/** 收藏切换后同步本地 favoriteList,避免再次进入「我的收藏」时与服务端不一致 */
|
/** 收藏切换后同步本地 favoriteList,避免再次进入「我的收藏」时与服务端不一致 */
|
||||||
syncFavoriteListAfterToggle(card, nextScbz) {
|
syncFavoriteListAfterToggle(card, nextScbz) {
|
||||||
@ -2153,6 +2159,7 @@ html.portal-figma-scale-active .gxnlpt-page {
|
|||||||
|
|
||||||
/* 激活项左侧条形指示器(高度 0 → 60% 动画) */
|
/* 激活项左侧条形指示器(高度 0 → 60% 动画) */
|
||||||
&::before {
|
&::before {
|
||||||
|
display: none;
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|||||||
@ -67,7 +67,7 @@
|
|||||||
<div class="card-title">碳数字身份证</div>
|
<div class="card-title">碳数字身份证</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="card-btn" @click="handleIframeNavigate(certStoragePath)">开始办证</div>
|
<div class="card-btn" @click="handleIframeNavigate(buttonLinks['开始办证'])">开始办证</div>
|
||||||
<div class="card-btn" @click="handleIframeNavigate(buttonLinks['碳证查询'])">碳证查询</div>
|
<div class="card-btn" @click="handleIframeNavigate(buttonLinks['碳证查询'])">碳证查询</div>
|
||||||
<div class="card-btn" @click="handleIframeNavigate(buttonLinks['碳证核验'])">碳证核验</div>
|
<div class="card-btn" @click="handleIframeNavigate(buttonLinks['碳证核验'])">碳证核验</div>
|
||||||
<div class="card-btn" @click="handleNavigate(buttonLinks['场景推介'])">场景推介</div>
|
<div class="card-btn" @click="handleNavigate(buttonLinks['场景推介'])">场景推介</div>
|
||||||
@ -486,6 +486,7 @@ export default {
|
|||||||
buttonLinkHost: 'https://ctn-web-pre.lingshu.net',
|
buttonLinkHost: 'https://ctn-web-pre.lingshu.net',
|
||||||
buttonLinks: {
|
buttonLinks: {
|
||||||
// 碳数字身份证
|
// 碳数字身份证
|
||||||
|
'开始办证': '/carbon-report-cert',
|
||||||
'办证指南': '/mdviewer?file=docs%2Fcarbon-guide.md',
|
'办证指南': '/mdviewer?file=docs%2Fcarbon-guide.md',
|
||||||
'碳证查询': '/trustedCarbonQuery/list?type=carbon-query',
|
'碳证查询': '/trustedCarbonQuery/list?type=carbon-query',
|
||||||
'碳证核验': '/carbon-verify',
|
'碳证核验': '/carbon-verify',
|
||||||
@ -720,7 +721,7 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 已登录:iframe 跳转到碳证中心存证页面(/carbon-index?page=%2Fweb%2Fcarbon-report-cert)
|
// 已登录:iframe 跳转到碳证中心存证页面(/carbon-index?page=%2Fweb%2Fcarbon-report-cert)
|
||||||
const url = `${this.buttonLinkHost}${this.certStoragePath}`;
|
const url = `${this.buttonLinkHost}${this.buttonLinks['开始办证']}`;
|
||||||
this.$emit('gotoIfreamPage', url);
|
this.$emit('gotoIfreamPage', url);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user