部分代码问题优化

This commit is contained in:
黄心宇 2025-12-30 10:03:45 +08:00
parent 65962d2fda
commit 615c6dcf2f
5 changed files with 8 additions and 9 deletions

View File

@ -6,7 +6,7 @@ import KFIcon from '../../../components/KFIcon';
import back1 from '../../../images/factory/back1.png'
import tagIcon from '../../../images/factory/lessons-tag-icon.webp'
import '../../common.scss'
import { getSourceList } from '../../api'
import { getSourceList, httpUrl } from '../../api';
import { factoryZoneId, manualId, standardId, lessonId } from '../../../constants/factory'
import { downloadFunc } from '../../../forge/Utils/utils'
@ -108,7 +108,7 @@ const Resource2 = forwardRef(({ zoneId }, ref) => {
<div className="item-info">
<h4>{ item.name }</h4>
<p>{item.summary}</p>
<button className="shiny-button" onClick={() => { window.open(item.extendDataUrl) }}>查看详情</button>
<button className="shiny-button" onClick={() => { window.open(standard.extendDataUrl) }}>查看详情</button>
</div>
</div>
})

View File

@ -1,14 +1,12 @@
import React, { useEffect, useState, useRef } from 'react';
import './index.scss';
import { TPMIndexHOC } from '../../../modules/tpm/TPMIndexHOC';
import imageBack1 from '../../../images/factory/news/news-default.webp'
import { Link } from 'react-router-dom';
import RenderHtml from '../../../components/render-html';
import { Breadcrumb } from 'antd';
import { getNewsDetail } from '../../api';
import headerMp4 from '../../../images/factory/news/detail-head-bg.mp4';
import { getDefaultImage } from '../../../forge/Utils/utils'
import { Base64 } from 'js-base64';
function Index(props) {

View File

@ -120,7 +120,7 @@ function Index(props) {
{/* 左边:前一项的图片 */}
<div>
<img
src={topList[prevIndex].headImg || backList[prevIndex % 3]}
src={topList[prevIndex].headImg || getDefaultImage(topList[prevIndex].id)}
alt=""
/>
</div>
@ -128,7 +128,7 @@ function Index(props) {
{/* 中间:当前项的图片 */}
<div>
<img
src={item.headImg || backList[index % 3]}
src={item.headImg || getDefaultImage(item.id)}
alt=""
/>
</div>
@ -136,7 +136,7 @@ function Index(props) {
{/* 右边:后一项的图片 */}
<div>
<img
src={topList[nextIndex].headImg || backList[nextIndex % 3]}
src={topList[nextIndex].headImg || getDefaultImage([nextIndex].id)}
alt=""
/>
</div>

View File

@ -11,7 +11,7 @@ import { getSourceDetail, httpUrl, getSourceList } from '../../../api';
import { downloadFunc } from '../../../../forge/Utils/utils'
import { factoryZoneId, } from '../../../../constants/factory'
import '../../../common.scss'
import { Base64 } from 'js-base64';
function Index(props) {

View File

@ -8,6 +8,7 @@ import RenderHtml from '../../components/render-html';
import { Breadcrumb } from 'antd';
import { getSourceDetail, getSourceList } from '../api'
import { factoryZoneId, sceneId } from '../../constants/factory'
import { Base64 } from 'js-base64';
function Index(props) {
const id = props.match.params.sceneId