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>
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-wrapmain.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;

View File

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