登录视图高度调整

v2
一杯沧海 1 year ago
parent 3fe6226304
commit 1cd8fba6a3
  1. 3
      src/app.tsx
  2. 2
      src/components/loginView/index.module.scss
  3. 5
      src/components/loginView/index.tsx
  4. 4
      src/pages/index/index.config.ts
  5. 12
      src/pages/index/index.tsx
  6. 2
      src/pages/my/my.tsx

@ -46,11 +46,12 @@ function App(props) {
screenHeight: res.screenHeight,
windowHeight: res.windowHeight,
safeArea: res.safeArea,
menu:Taro.getMenuButtonBoundingClientRect(),
}
console.log(Taro.getApp().globalData)
}
})
// 对应 onShow
useDidShow(() => {
})

@ -23,7 +23,7 @@
margin-bottom: 40rpx;
}
.button{
width: 70%;
width: 520rpx;
height: 76rpx;
background: #45D4A8;
border-radius: 38rpx 38rpx 38rpx 38rpx;

@ -12,9 +12,10 @@ interface Props {
const LoginView: FC<Props> = (props) => {
const {empty} = Profile.useContainer()
const text = props.tips ?? '登录后可查看更多内容'
const size: string = props.height? `${props.height}px`:'750rpx'
const size: string = props.height? `${props.height}px`:'0rpx'
const sizeStyle: CSSProperties = {
height:size,
height:'1000rpx',
paddingTop:size,
}

@ -1,5 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '学习课程',
navigationBarBackgroundColor: '#92ecc5',
navigationBarTextStyle: 'white',
navigationStyle: 'custom'
})

@ -1,5 +1,5 @@
import {FC, useState} from "react";
import {View} from "@tarojs/components";
import {View, Text} from "@tarojs/components";
import styles from './index.module.scss'
import {VideoList} from "@/pages/index/components/videoList";
import Tabs, {OnChangOpt, TabList} from "@/components/tabs/tabs";
@ -25,19 +25,19 @@ const Index: FC = () => {
return (
<>
<View className={styles.content}>
<View className={styles.content} style={`paddingTop:${globalData.statusBarHeight}px`}>
{ !token ?
<LoginView height={globalData.windowHeight-100}></LoginView>
<LoginView></LoginView>
:
<>
<View className="flex justify-center align-center" style={{height:`${(globalData.menu.top-globalData.statusBarHeight)*2+globalData.menu.height}px`}}>
<Text className="font-28 text-white"></Text>
</View>
<Tabs tabList={category} onChange={tabChange} current={categoryKey}/>
<VideoList categoryKey={categoryKey} setCategoryKey={(categoryKey) => setCategoryKey(categoryKey)}/>
</>
}
</View>
</>
)
}

@ -28,7 +28,7 @@ const My: FC = () => {
return (
<View className={styles.content} style={`paddingTop:${globalData.statusBarHeight}px`}>
{ !token ?
<LoginView height={globalData.windowHeight-100}></LoginView>
<LoginView></LoginView>
:
<>
<Header showCompany={()=>{setCompanyShow(true)}}/>

Loading…
Cancel
Save