Commit c9bbc44f authored by hewenhao's avatar hewenhao

feat: 优化

parent 583aed3c
...@@ -25,20 +25,23 @@ ...@@ -25,20 +25,23 @@
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #FFFFFF;
padding: 0 10PX; padding: 0 10PX;
width: 100vw;
box-sizing: border-box;
.back_icon { .back_icon {
position: relative; position: absolute;
z-index: 10; z-index: 10;
width: 30PX; width: 30PX;
width: 30PX; width: 30PX;
left: 10PX;
} }
} }
} }
.score { .score {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 40PX; margin-right: 12PX;
margin-left: 58PX; margin-left: -10px;
.icon { .icon {
width: 32PX; width: 32PX;
...@@ -47,6 +50,21 @@ ...@@ -47,6 +50,21 @@
} }
} }
.right {
flex-shrink: 0;
}
.left {
flex-shrink: 1;
}
.main {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.ph { .ph {
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -13,21 +13,29 @@ const goStore = () => { ...@@ -13,21 +13,29 @@ const goStore = () => {
export default () => { export default () => {
const nav = useMemo(getMenuButtonBoundingClientRect, []) const nav = useMemo(getMenuButtonBoundingClientRect, [])
const sys = useMemo(getSystemInfoSync, [])
const cardNum = useStoreState(state => state.userModel.cardNum) const cardNum = useStoreState(state => state.userModel.cardNum)
const point = useStoreState(state => state.userModel.point) const point = useStoreState(state => state.userModel.point)
const sys = useMemo(getSystemInfoSync, [])
const rightStyle = useMemo(() => {
return {
width: `${nav.width + (sys.windowWidth - nav.right) * 2}px`
}
}, [sys, nav])
const topBarStyle = useMemo(() => { const topBarStyle = useMemo(() => {
return { return {
height: `${nav.height + 10}px`, height: `${nav.height + 10}px`,
paddingTop: `${nav.top - 5}px` paddingTop: `${nav.top - 5}px`
} }
}, [sys, nav]) }, [nav])
return ( return (
<View className={styles.topBar} style={topBarStyle}> <View className={styles.topBar} style={topBarStyle}>
<View className={styles.inner}> <View className={styles.inner}>
<Image className={styles.back_icon} src={require('../assets/back.png')} mode="widthFix" onClick={() => navigateBack()} /> <Image className={styles.back_icon} src={require('../assets/back.png')} mode="widthFix" onClick={() => navigateBack()} />
<View style={rightStyle} className={styles.left}></View>
<View className={styles.main}>
<View className={styles.score} onClick={goStore}> <View className={styles.score} onClick={goStore}>
<Image src={require('@/pages/main/assets/score.png')} className={styles.icon} /> <Image src={require('@/pages/main/assets/score.png')} className={styles.icon} />
<Text>{point}</Text> <Text>{point}</Text>
...@@ -37,6 +45,8 @@ export default () => { ...@@ -37,6 +45,8 @@ export default () => {
<Text>{cardNum}</Text> <Text>{cardNum}</Text>
</View> </View>
</View> </View>
<View style={rightStyle} className={styles.right}></View>
</View>
</View> </View>
) )
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment