样式调整

main
一杯沧海 1 year ago
parent 8180bffb43
commit fbfd475246
  1. 1
      src/app.config.ts
  2. 2
      src/pages/home/components/feature.tsx
  3. 34
      src/pages/preview/brand/article/article.module.scss
  4. 26
      src/pages/preview/brand/article/article.tsx
  5. 2
      src/pages/preview/illness/article/article.tsx

@ -88,6 +88,7 @@ export default defineAppConfig({
'videoFull/videoFull', // 资源id 视频全屏 'videoFull/videoFull', // 资源id 视频全屏
'illness/sort/sort', 'illness/sort/sort',
'illness/list/list', 'illness/list/list',
'illness/article/article',
] ]
}, },
], ],

@ -22,7 +22,7 @@ const Feature: FC = () => {
<View className='flex justify-around mt-4'> <View className='flex justify-around mt-4'>
{ {
list.map(d => <View className='text-center' onClick={() => jump(d.url)}> list.map(d => <View className='text-center' onClick={() => jump(d.url)}>
<Image src={d.image} style={{width: '40px'}} mode='widthFix'/> <Image src={d.image} style={{width: '40px',height: '40px'}} />
<View className='mt-1 text-dark font-26 mt-1'>{d.text}</View> <View className='mt-1 text-dark font-26 mt-1'>{d.text}</View>
</View>) </View>)
} }

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

@ -1,10 +1,14 @@
import {FC, useEffect, useState} from "react"; 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 Taro, {useRouter} from "@tarojs/taro";
import {ArticleRecord, brandApi} from "@/api"; 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 article:FC = () => {
const {token} = Profile.useContainer()
const {id} = useRouter().params as unknown as { id: number} const {id} = useRouter().params as unknown as { id: number}
const [articleInfo,setArticleInfo] = useState<ArticleRecord>() const [articleInfo,setArticleInfo] = useState<ArticleRecord>()
useEffect(() => { useEffect(() => {
@ -21,7 +25,25 @@ const article:FC = () => {
} }
function helloWorld() { function helloWorld() {
const html = articleInfo?.content; const html = articleInfo?.content;
return <View dangerouslySetInnerHTML={{ __html: html! }}></View> return (
<>
<View style={{padding:'10px'}} dangerouslySetInnerHTML={{ __html: html! }}></View>
{
!token &&
<View className={styles.fixedBox}>
<View className={styles['fixedBox-inner']}>
<View className={styles['fixedBox-inner-icon']}>
<Image src={down}></Image>
</View>
<View className={styles['fixedBox-inner-box']}>
<Text></Text>
</View>
</View>
</View>
}
</>
)
} }
return helloWorld() return helloWorld()
} }

@ -28,7 +28,7 @@ const article:FC = () => {
const html = articleInfo?.content; const html = articleInfo?.content;
return ( return (
<> <>
<View dangerouslySetInnerHTML={{ __html: html! }}></View> <View style={{padding:'10px'}} dangerouslySetInnerHTML={{ __html: html! }}></View>
{ {
!token && !token &&
<View className={styles.fixedBox}> <View className={styles.fixedBox}>

Loading…
Cancel
Save