我的页面调整,搜索页面输入框范围调大

v2
一杯沧海 1 year ago
parent 6b052df04c
commit 5af5eb80da
  1. 32
      src/pages/my/components/header/header.tsx
  2. 24
      src/pages/my/components/header/service.tsx
  3. 4
      src/pages/my/components/header/time.tsx
  4. 12
      src/pages/my/my.tsx
  5. 1
      src/pages/preview/search/search/index.module.scss
  6. 2
      src/pages/preview/search/search/index.tsx

@ -5,25 +5,37 @@ import avatar from "@/static/img/avatar.png"
import blacktriang from "@/static/img/blacktriangle.png"
const Header = ({showCompany}:{showCompany:()=> void}) => {
const {user,company} = Profile.useContainer()
const {token,user,company,empty} = Profile.useContainer()
return (
<View className={styles.header}>
<View className='flex'>
<Image src={avatar} className={styles.avatar}/>
<View className='flex-1'>
<View className='font-32'>{user?.name}</View>
{
token ?
<Image src={user?.avatar || avatar} className={styles.avatar}/>:
<Image src={avatar} className={styles.avatar}/>
}
{ token ?
<View className='flex-1'>
<View className='font-32'>{user?.name}</View>
<View className='flex align-center mt-2' onClick={()=>{
showCompany()
}}>
<Text style={{fontSize:'24rpx',fontWeight:'500',color:'#323635'}}>{company?.name}</Text>
<Image src={blacktriang} style={{width:'20rpx',height:'20rpx'}}></Image>
<View className='flex align-center mt-2' onClick={()=>{
showCompany()
}}>
<Text style={{fontSize:'24rpx',fontWeight:'500',color:'#323635'}}>{company?.name}</Text>
<Image src={blacktriang} style={{width:'20rpx',height:'20rpx'}}></Image>
</View>
</View>:
<View className='flex-1'>
<View className='font-32 mt-2' onClick={()=>{
empty()
}}>/</View>
</View>
}
{/*<View className='login font-24 mt-2 text-secondary flex justify-between content-start'>*/}
{/* <Text>手机号:{user?.phone_number}</Text>*/}
{/*</View>*/}
</View>
</View>
</View>
)

@ -22,7 +22,7 @@ const Service = () => {
{title: '个人中心', src: userInfo, router: '/pages/business/userInfo/userInfo'},
])
const {user, setUser} = Profile.useContainer()
const {token,user, setUser} = Profile.useContainer()
Taro.useDidShow(async () => {
if (user?.id) {
@ -33,18 +33,24 @@ const Service = () => {
useEffect(() => {
const oldList: List[] = JSON.parse(JSON.stringify(list))
if ([1, 2].includes(user?.role_type || 0)) {
oldList.unshift(...[
{title: '部门管理', src: dep, router: '/pages/manage/depAdmin/depAdmin'},
// {title: '课程市场', src: buy, router: '/pages/manage/curriculum/curriculum'},
{title: '现场会', src: spotMeeting, router: '/pages/manage/spotMeeting/spotMeeting'},
{title: '课程管理', src: course, router: '/pages/manage/courseAdmin/courseAdmin'},
])
setList(oldList)
if(token){
if ([1, 2].includes(user?.role_type || 0)) {
oldList.unshift(...[
{title: '部门管理', src: dep, router: '/pages/manage/depAdmin/depAdmin'},
// {title: '课程市场', src: buy, router: '/pages/manage/curriculum/curriculum'},
{title: '现场会', src: spotMeeting, router: '/pages/manage/spotMeeting/spotMeeting'},
{title: '课程管理', src: course, router: '/pages/manage/courseAdmin/courseAdmin'},
])
setList(oldList)
}
}
}, [])
function jump(url: string) {
if(!token){
Taro.navigateTo({url:'/pages/login/login'})
return
}
Taro.navigateTo({url})
}

@ -10,6 +10,7 @@ import time1 from "@/static/img/time1.png";
import time2 from "@/static/img/time2.png";
import over from '@/static/img/over.png'
import incomplete from '@/static/img/incomplete.png'
import {Profile} from "@/store";
interface List {
title: string
@ -19,6 +20,7 @@ interface List {
}
const Time: FC = () => {
const {token} = Profile.useContainer()
const [list, setList] = useState<List[]>([
{title: '今日时长', time: '00:00', src: time1},
{title: '累计时长', time: '00:00', src: time2},
@ -59,7 +61,7 @@ const Time: FC = () => {
<View className={styles.timeBoxFlex}>
<View>
<View className='mb-2'>{d.title}</View>
<View className='text-muted font-26'>{d.time}</View>
{ token && <View className='text-muted font-26'>{d.time}</View>}
</View>
<Image src={d.src} mode='aspectFit' className={styles.timeImag}/>
</View>

@ -5,7 +5,6 @@ import Header from "./components/header/header";
import {FC, useState} from "react";
import Time from "@/pages/my/components/header/time";
import Service from "@/pages/my/components/header/service";
import LoginView from "@/components/loginView";
import {Profile} from "@/store";
import Img from "@/components/image/image";
import GreenNike from "@/static/img/greenNike.png"
@ -30,16 +29,13 @@ const My: FC = () => {
return (
<View className={styles.content} style={`paddingTop:${globalData.statusBarHeight}px`}>
{ !token ?
<LoginView></LoginView>
:
<>
<Header showCompany={()=>{setCompanyShow(true)}}/>
<Header showCompany={()=>{
companyList.length >= 2 && setCompanyShow(true)
}}/>
<Time/>
<Service/>
</>
}
<PageContainer overlayStyle={'background:rgba(0,0,0,0.3)'} position={'bottom'} round={true} show={companyShow}
onClickOverlay={() => setCompanyShow(false)}>

@ -14,6 +14,7 @@ page{
font-size: 28rpx;
font-weight: 500;
margin-left: 24rpx;
flex:1;
}
}
.titleBox{

@ -63,7 +63,7 @@ const Search:FC = () => {
<AtIcon value='search' size='20' color='#ccc'></AtIcon>
{ show ?
<Text className={styles.input} >{value}</Text>:
<Input className={styles.input} placeholder="输入关键字搜索课程" type={'text'} confirmType={'search'} onInput={inpFn} onConfirm={searchInput} />
<Input className={styles.input} placeholder="输入关键字搜索" type={'text'} confirmType={'search'} onInput={inpFn} onConfirm={searchInput} />
}
</View>

Loading…
Cancel
Save