Commit c9bbc44f authored by hewenhao's avatar hewenhao

feat: 优化

parent 583aed3c
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
// justify-content: center; // justify-content: center;
align-items: center; align-items: center;
background-image: url(../assets/head-bg.png); background-image: url(../assets/head-bg.png);
&_bg { &_bg {
position: absolute; position: absolute;
z-index: 1; z-index: 1;
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
right: 0; right: 0;
width: 100%; width: 100%;
} }
.inner { .inner {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -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;
...@@ -55,4 +73,4 @@ ...@@ -55,4 +73,4 @@
height: 32PX; height: 32PX;
margin-right: 4PX; margin-right: 4PX;
} }
} }
\ No newline at end of file
...@@ -13,29 +13,39 @@ const goStore = () => { ...@@ -13,29 +13,39 @@ 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 className={styles.score} onClick={goStore}> <View style={rightStyle} className={styles.left}></View>
<Image src={require('@/pages/main/assets/score.png')} className={styles.icon} /> <View className={styles.main}>
<Text>{point}</Text> <View className={styles.score} onClick={goStore}>
</View> <Image src={require('@/pages/main/assets/score.png')} className={styles.icon} />
<View className={styles.ph} onClick={goStore}> <Text>{point}</Text>
<Image src={require('@/pages/main/assets/ph.png')} className={styles.icon} /> </View>
<Text>{cardNum}</Text> <View className={styles.ph} onClick={goStore}>
<Image src={require('@/pages/main/assets/ph.png')} className={styles.icon} />
<Text>{cardNum}</Text>
</View>
</View> </View>
<View style={rightStyle} className={styles.right}></View>
</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