From fbfd4752467e0813ffb8e7a90403d45cd66f350c Mon Sep 17 00:00:00 2001 From: sunlizhou <296190577@qq.com> Date: Tue, 22 Aug 2023 17:02:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.config.ts | 1 + src/pages/home/components/feature.tsx | 2 +- .../preview/brand/article/article.module.scss | 34 +++++++++++++++++++ src/pages/preview/brand/article/article.tsx | 26 ++++++++++++-- src/pages/preview/illness/article/article.tsx | 2 +- 5 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 src/pages/preview/brand/article/article.module.scss diff --git a/src/app.config.ts b/src/app.config.ts index 35b5f24..95305a4 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -88,6 +88,7 @@ export default defineAppConfig({ 'videoFull/videoFull', // 资源id 视频全屏 'illness/sort/sort', 'illness/list/list', + 'illness/article/article', ] }, ], diff --git a/src/pages/home/components/feature.tsx b/src/pages/home/components/feature.tsx index 9f1a6f0..ecf3565 100644 --- a/src/pages/home/components/feature.tsx +++ b/src/pages/home/components/feature.tsx @@ -22,7 +22,7 @@ const Feature: FC = () => { { list.map(d => jump(d.url)}> - + {d.text} ) } diff --git a/src/pages/preview/brand/article/article.module.scss b/src/pages/preview/brand/article/article.module.scss new file mode 100644 index 0000000..da98846 --- /dev/null +++ b/src/pages/preview/brand/article/article.module.scss @@ -0,0 +1,34 @@ +.fixedBox{ + position: absolute; + width: 100vw; + height: 100vh; + background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1), rgba(255, 255, 255, 1)); + &-inner{ + position: absolute; + width: 100vw; + top:45vh; + display: flex; + flex-direction: column; + align-items: center; + &-icon{ + image{ + width: 32rpx; + height: 32rpx; + } + } + &-box{ + margin-top: 24rpx; + width: 680rpx; + left:35rpx; + height: 76rpx; + background-color: #45D4A8; + color:#fff; + line-height: 76rpx; + text-align: center; + font-size: 32rpx; + font-weight: 500; + border-radius: 8rpx 8rpx 8rpx 8rpx; + } + + } +} diff --git a/src/pages/preview/brand/article/article.tsx b/src/pages/preview/brand/article/article.tsx index e2b3556..1d8a1b0 100644 --- a/src/pages/preview/brand/article/article.tsx +++ b/src/pages/preview/brand/article/article.tsx @@ -1,10 +1,14 @@ import {FC, useEffect, useState} from "react"; -import {View} from "@tarojs/components"; +import {Image, Text, View} from "@tarojs/components"; import Taro, {useRouter} from "@tarojs/taro"; import {ArticleRecord, brandApi} from "@/api"; +import styles from "@/pages/preview/illness/article/article.module.scss"; +import down from "@/static/img/doubleDown.png"; +import {Profile} from "@/store"; const article:FC = () => { + const {token} = Profile.useContainer() const {id} = useRouter().params as unknown as { id: number} const [articleInfo,setArticleInfo] = useState() useEffect(() => { @@ -21,7 +25,25 @@ const article:FC = () => { } function helloWorld() { const html = articleInfo?.content; - return + return ( + <> + + { + !token && + + + + + + + 登录查看更多内容 + + + + } + + ) + } return helloWorld() } diff --git a/src/pages/preview/illness/article/article.tsx b/src/pages/preview/illness/article/article.tsx index 476807c..b1d5468 100644 --- a/src/pages/preview/illness/article/article.tsx +++ b/src/pages/preview/illness/article/article.tsx @@ -28,7 +28,7 @@ const article:FC = () => { const html = articleInfo?.content; return ( <> - + { !token &&