From 278a4081370a61ba7d20bf2ed15cb71843cfc935 Mon Sep 17 00:00:00 2001 From: king <2229249788@qq.com> Date: Fri, 8 Sep 2023 17:42:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E9=BB=98=E8=AE=A4=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/image/image.tsx | 5 +++++ .../videoInfo/components/catalogue.tsx | 1 + src/pages/business/videoInfo/videoInfo.tsx | 2 +- .../home/components/feature_recommended.tsx | 21 +++++++++++------- src/pages/preview/brand/list/list.tsx | 3 ++- .../img/{组 499@2x.png => brandSecond.png} | Bin types/curriculum.d.ts | 1 + types/user.d.ts | 1 + 8 files changed, 24 insertions(+), 10 deletions(-) rename src/static/img/{组 499@2x.png => brandSecond.png} (100%) diff --git a/src/components/image/image.tsx b/src/components/image/image.tsx index 9f8a290..80abee8 100644 --- a/src/components/image/image.tsx +++ b/src/components/image/image.tsx @@ -5,6 +5,7 @@ import Taro from "@tarojs/taro"; import avatar from '@/static/img/avatar.png' import healthShard from '@/static/img/healthShard.png' import professionShard from '@/static/img/professionShard.png' +import brandSecond from '@/static/img/brandSecond.png' interface Props extends ImageProps { width?: number | string @@ -41,6 +42,9 @@ const Img: FC = ({src, mode = 'aspectFill', width, height, fallback = sha case 'profession': setErrorUrl(professionShard) break + case 'brand': + setErrorUrl(brandSecond) + break } }, [props.errorType]) @@ -60,6 +64,7 @@ const Img: FC = ({src, mode = 'aspectFill', width, height, fallback = sha return ( = ({data, setHors, id, playId}) => { setShow(true)}> diff --git a/src/pages/business/videoInfo/videoInfo.tsx b/src/pages/business/videoInfo/videoInfo.tsx index 517cc04..3c6de8a 100644 --- a/src/pages/business/videoInfo/videoInfo.tsx +++ b/src/pages/business/videoInfo/videoInfo.tsx @@ -106,7 +106,7 @@ const VideoInfo: FC = () => { { playId ? - : + : } diff --git a/src/pages/home/components/feature_recommended.tsx b/src/pages/home/components/feature_recommended.tsx index 443ff6b..ddcdb2e 100644 --- a/src/pages/home/components/feature_recommended.tsx +++ b/src/pages/home/components/feature_recommended.tsx @@ -26,12 +26,13 @@ interface Data { url: string detailsUrl: string data: DataContent[] + errorType: ImgErrType type?: 'health' | 'kill' } interface Props { - skill: Kill[] // 技能 - health: Health[] // 健康 + skill: VideList[] // 技能 + health: VideList[] // 健康 brand: Brand[] // 品牌 illness: Illness[] // 疾病 } @@ -42,27 +43,31 @@ const FeatureRecommended: FC = (props) => { titleUrl: brandTop, url: '/pages/preview/brand/list/list', detailsUrl: '/pages/preview/brand/info/info', - data: [] + data: [], + errorType: 'brand', }, { titleUrl: healthTop, url: '/pages/preview/health/health', detailsUrl: '/pages/preview/videoFull/videoFull', data: [], - type: "health" + type: "health", + errorType: 'health' }, { titleUrl: professionTop, url: '/pages/preview/profession/profession', detailsUrl: '/pages/preview/videoFull/videoFull', data: [], - type: 'kill' + type: 'kill', + errorType: 'profession' }, { titleUrl: illnessTop, url: '/pages/preview/illness/sort/sort', detailsUrl: '/pages/preview/illness/list/list', - data: [] + data: [], + errorType: 'health' }, ]) @@ -153,7 +158,7 @@ const FeatureRecommended: FC = (props) => { { - data.filter(d=>d.data.length === 3).map(d => + data.filter(d => d.data.length === 3).map(d => = (props) => { onClick={() => jump(d.detailsUrl + c.path, c.id, d.type)}> - + diff --git a/src/pages/preview/brand/list/list.tsx b/src/pages/preview/brand/list/list.tsx index dc43706..780416b 100644 --- a/src/pages/preview/brand/list/list.tsx +++ b/src/pages/preview/brand/list/list.tsx @@ -20,6 +20,7 @@ const BrandItem: FC<{ data: BrandRecord; onClick: VoidFunction }> = ({data, onCl } else if (data.brand_album) { media = = ({data, onCl height={76} src={data.logo} mode='aspectFill' - errorType='avatar' + errorType='brand' className="rounded-10 clip" style={{background: '#ededed'}} /> diff --git a/src/static/img/组 499@2x.png b/src/static/img/brandSecond.png similarity index 100% rename from src/static/img/组 499@2x.png rename to src/static/img/brandSecond.png diff --git a/types/curriculum.d.ts b/types/curriculum.d.ts index 4b05e7d..acf284d 100644 --- a/types/curriculum.d.ts +++ b/types/curriculum.d.ts @@ -8,6 +8,7 @@ interface Curriculum { id: number; title: string; charge: number; + collect:boolean /** 课时 */ class_hour: number; created_at: string; diff --git a/types/user.d.ts b/types/user.d.ts index 4522fc1..bf03a84 100644 --- a/types/user.d.ts +++ b/types/user.d.ts @@ -113,5 +113,6 @@ type ImgErrType = "acquiesce" // 默认 | 'avatar' // 头像 | 'health' // 健康 | 'profession' // 技能 + | 'brand' // 品牌