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