Commit 17208565 authored by m's avatar m

feat: update ui

parent 7bd6a206
...@@ -25,7 +25,7 @@ export const enum StageType { ...@@ -25,7 +25,7 @@ export const enum StageType {
export const enum StageLevel { export const enum StageLevel {
S = 'S', S = 'S',
A = 'A', A = 'A',
B = 'B' B = 'B',
} }
export interface Stage { export interface Stage {
......
.head { .head {
background-image: linear-gradient(to bottom, #B7CDEB 0%, #F1FAFF 87.0301573% , #FFFFFF 100%);
padding-bottom: 64px; padding-bottom: 64px;
position: relative; position: relative;
&.S {
background-image: linear-gradient(to bottom, #FFE4A1 0%, #FFFEF3 87.0301573% , #FFFFFF 100%);
}
&.A {
background-image: linear-gradient(to bottom, #B7CDEB 0%, #F1FAFF 87.0301573% , #FFFFFF 100%);
}
&.B {
background-image: linear-gradient(to bottom, #F4C09C 0%, #FFF7F2 87.0301573% , #FFFFFF 100%);
}
&.fail {
background-image: linear-gradient(to bottom, #CECECE 0%, #F1F2F3 87.0301573% , #FFFFFF 100%);
}
} }
.bg { .bg {
......
...@@ -57,6 +57,19 @@ const getLevelText = (s?: StageLevel | null) => { ...@@ -57,6 +57,19 @@ const getLevelText = (s?: StageLevel | null) => {
} }
} }
const getInearGradient = (s?: StageLevel | null) => {
switch (s) {
case StageLevel.S:
return styles.S
case StageLevel.A:
return styles.A
case StageLevel.B:
return styles.B
default:
return styles.fail
}
}
const GameCompleteHead = () => { const GameCompleteHead = () => {
const nav = useMemo(getMenuButtonBoundingClientRect, []) const nav = useMemo(getMenuButtonBoundingClientRect, [])
const gameResult = useStoreState(state => state.gameModel.gameResult) const gameResult = useStoreState(state => state.gameModel.gameResult)
...@@ -72,8 +85,16 @@ const GameCompleteHead = () => { ...@@ -72,8 +85,16 @@ const GameCompleteHead = () => {
return getLevelBigBg(gameResult?.level) return getLevelBigBg(gameResult?.level)
}, [gameResult]) }, [gameResult])
const linearGradient = useMemo(() => {
return getInearGradient(gameResult?.level)
}, [gameResult])
const text = useMemo(() => { const text = useMemo(() => {
return getLevelText(gameResult?.level) const { text: _text, second, color } = getLevelText(gameResult?.level)
if (gameResult?.levelBefore !== gameResult?.level) {
return { text: second, color }
}
return { text: _text, color }
}, [gameResult]) }, [gameResult])
const style = useMemo(() => { const style = useMemo(() => {
...@@ -87,7 +108,7 @@ const GameCompleteHead = () => { ...@@ -87,7 +108,7 @@ const GameCompleteHead = () => {
} }
return ( return (
<View style={style} className={styles.head}> <View style={style} className={classNames(styles.head, linearGradient)}>
<Image src={bg} className={styles.bg}></Image> <Image src={bg} className={styles.bg}></Image>
<View style={{ color: text.color }} className={styles.tips}>{text.text}</View> <View style={{ color: text.color }} className={styles.tips}>{text.text}</View>
<View className={styles.item_wrap}> <View className={styles.item_wrap}>
......
...@@ -69,7 +69,7 @@ const gameModel: GameModel = { ...@@ -69,7 +69,7 @@ const gameModel: GameModel = {
upGearReward: 40, upGearReward: 40,
errNum: 0, errNum: 0,
/** 成就等级:SAB */ /** 成就等级:SAB */
level: StageLevel.S, level: StageLevel.B,
levelTime: 50, levelTime: 50,
/** 排名 */ /** 排名 */
ranks: [], ranks: [],
......
...@@ -147,7 +147,6 @@ ...@@ -147,7 +147,6 @@
color: #fff; color: #fff;
} }
} }
} }
@supports (bottom: constant(safe-area-inset-bottom)) or (bottom: env(safe-area-inset-bottom)) { @supports (bottom: constant(safe-area-inset-bottom)) or (bottom: env(safe-area-inset-bottom)) {
.members_invite { .members_invite {
......
...@@ -22,8 +22,9 @@ const Group = () => { ...@@ -22,8 +22,9 @@ const Group = () => {
const [isVisible, { setTrue, setFalse }] = useBoolean(false) const [isVisible, { setTrue, setFalse }] = useBoolean(false)
const [groupNo, setGroupNo] = useState<string>('') const [groupNo, setGroupNo] = useState<string>('')
const fetchTribeInfo = useStoreActions(actions => actions.groupModel.fetchTribeInfo)
const { tribeInfo, loading } = useStoreState(state => state.groupModel) const { tribeInfo, loading } = useStoreState(state => state.groupModel)
const userId = useStoreState(state => state.userModel.userInfo.userId)
const fetchTribeInfo = useStoreActions(actions => actions.groupModel.fetchTribeInfo)
const tabBarHeight = useMemo(() => { const tabBarHeight = useMemo(() => {
return nav.height + nav.top + 5 return nav.height + nav.top + 5
...@@ -37,7 +38,7 @@ const Group = () => { ...@@ -37,7 +38,7 @@ const Group = () => {
useShareAppMessage(() => { useShareAppMessage(() => {
return { return {
title: '来看看这个有趣的页面!', title: '来看看这个有趣的页面!',
path: '/pages/main/main', path: `pages/main/main?code=${userId}`,
imageUrl: 'https://picx.zhimg.com/v2-7b7b072d4bebd5ccf48c04ec1146e844_1440w.jpg?', imageUrl: 'https://picx.zhimg.com/v2-7b7b072d4bebd5ccf48c04ec1146e844_1440w.jpg?',
} }
}) })
......
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