fix: 共性能力暂时用模拟数据

This commit is contained in:
liulujian 2026-06-16 03:54:45 +08:00
parent ebea68ebd1
commit 404bb58464
2 changed files with 87 additions and 79 deletions

View File

@ -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-wrapmain.vue // .content-wrapmain.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;

View File

@ -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);
}, },