Commit 17208565 authored by m's avatar m

feat: update ui

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