Commit 3cca7b02 authored by raca's avatar raca

feat: update

parent 77d23314
...@@ -28,14 +28,15 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => { ...@@ -28,14 +28,15 @@ const CroupHeader = ({ groupNo }: { groupNo: string }) => {
const [hideIndex, setHideIndex] = useState(-1) const [hideIndex, setHideIndex] = useState(-1)
const queryTribePoint = useStoreActions(actions => actions.groupModel.queryTribePoint) const queryTribePoint = useStoreActions(actions => actions.groupModel.queryTribePoint)
const points = useStoreState(state => state.groupModel.points) const points = useStoreState(state => state.groupModel.points)
const getSetting = useStoreActions(actions => actions.userModel.getSetting) const fetchAccount = useStoreActions(actions => actions.userModel.fetchAccount)
const { run, loading } = useRequest(postTribePoint, { const { run, loading } = useRequest(postTribePoint, {
immediate: false, immediate: false,
throttleDelay: 1000, throttleDelay: 1000,
onSuccess: () => { onSuccess: () => {
showToast({ title: '领取成功' }) showToast({ title: '领取成功' })
queryTribePoint() queryTribePoint()
getSetting() fetchAccount()
} }
}) })
......
...@@ -39,6 +39,7 @@ const Group = () => { ...@@ -39,6 +39,7 @@ const Group = () => {
const tribeInfo = useStoreState(state => state.groupModel.tribeInfo) const tribeInfo = useStoreState(state => state.groupModel.tribeInfo)
const fetchTribeInfo = useStoreActions(actions => actions.groupModel.fetchTribeInfo) const fetchTribeInfo = useStoreActions(actions => actions.groupModel.fetchTribeInfo)
const queryTribePoint = useStoreActions(actions => actions.groupModel.queryTribePoint) const queryTribePoint = useStoreActions(actions => actions.groupModel.queryTribePoint)
const fetchAccount = useStoreActions(actions => actions.userModel.fetchAccount)
const tabBarHeight = useMemo(() => { const tabBarHeight = useMemo(() => {
return nav.height + nav.top + 5 return nav.height + nav.top + 5
...@@ -62,7 +63,7 @@ const Group = () => { ...@@ -62,7 +63,7 @@ const Group = () => {
useDidShow(async () => { useDidShow(async () => {
const tabbar = getTabBar<TabbarRef>(page) const tabbar = getTabBar<TabbarRef>(page)
tabbar?.setSelected(1) tabbar?.setSelected(1)
Promise.all([queryTribePoint(), fetchTribeInfo()]) Promise.all([queryTribePoint(), fetchTribeInfo(), fetchAccount()])
}) })
const getShareParams = useCallback(() => { const getShareParams = useCallback(() => {
...@@ -103,7 +104,7 @@ const Group = () => { ...@@ -103,7 +104,7 @@ const Group = () => {
const onRefresher = async () => { const onRefresher = async () => {
try { try {
toggle() toggle()
await Promise.all([fetchTribeInfo(), queryTribePoint()]) await Promise.all([fetchTribeInfo(), queryTribePoint(), fetchAccount()])
} finally { } finally {
setTimeout(() => toggle(), 100) setTimeout(() => toggle(), 100)
} }
......
...@@ -101,15 +101,25 @@ ...@@ -101,15 +101,25 @@
} }
} }
.noneDetails {
animation: fadeOut 1.6s ease-in-out forwards;
animation-delay: 1.3s;
}
.beforeDetails { .beforeDetails {
position: absolute; position: absolute;
right: 0; right: 0;
left: 0; left: 0;
.logo { .logo {
// visibility: hidden;
opacity: 0;
}
.show {
animation: fadeUp 1.3s ease-out forwards; animation: fadeUp 1.3s ease-out forwards;
animation-delay: 1s; animation-delay: 1s;
opacity: 0; visibility: visible;
} }
} }
} }
...@@ -288,4 +298,14 @@ ...@@ -288,4 +298,14 @@
opacity: 1; opacity: 1;
transform: scale(1) translateY(-44PX); transform: scale(1) translateY(-44PX);
} }
}
@keyframes fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
} }
\ No newline at end of file
...@@ -11,7 +11,6 @@ import { formatNextStep, formatLevelAchieve, formatTopAchieve, formatType } from ...@@ -11,7 +11,6 @@ import { formatNextStep, formatLevelAchieve, formatTopAchieve, formatType } from
const MainHeader = () => { const MainHeader = () => {
const stageDetail = useStoreState(state => state.gameModel.stageDetail) const stageDetail = useStoreState(state => state.gameModel.stageDetail)
const stageDetailPre = useStoreState(state => state.gameModel.stageDetailPre) const stageDetailPre = useStoreState(state => state.gameModel.stageDetailPre)
// const stageDetailPre = { level: 'S', gear: 50, upGear: false }
const isKing = useMemo(() => { // 王者 const isKing = useMemo(() => { // 王者
return stageDetail?.level === StageLevel.S && String(stageDetail?.gear) === StageGear.TOP10 return stageDetail?.level === StageLevel.S && String(stageDetail?.gear) === StageGear.TOP10
...@@ -81,6 +80,8 @@ const MainHeader = () => { ...@@ -81,6 +80,8 @@ const MainHeader = () => {
return null return null
} }
console.log('stageDetailPre', stageDetailPre)
return ( return (
<View className={styles.wrapper}> <View className={styles.wrapper}>
<View className={styles.title}>{stageDetail.name || '-'}</View> <View className={styles.title}>{stageDetail.name || '-'}</View>
...@@ -109,15 +110,37 @@ const MainHeader = () => { ...@@ -109,15 +110,37 @@ const MainHeader = () => {
{stageDetailPre {stageDetailPre
? ( ? (
<> <>
<View className={styles.details}> <View className={classNames(styles.details,)}>
<Image src={formatLevelAchieve(stageDetailPre?.level)} className={styles.logo} /> <Image src={formatLevelAchieve(stageDetailPre.firstTime ? stageDetail?.level : stageDetailPre?.level)} className={styles.logo} />
<Image src={formatTopAchieve(stageDetailPre?.gear.toString())} className={styles.logo} /> <Image src={formatTopAchieve(stageDetailPre.firstTime ? stageDetail?.gear?.toString() : stageDetailPre?.gear?.toString())} className={styles.logo} />
<Image src={(isKing || stageDetailPre?.upGear) ? assets['upgear.png'].u : assets['upgear-un.png'].u} className={styles.logo} /> <Image src={(isKing || (stageDetailPre.firstTime ? stageDetail?.upGear : stageDetailPre?.upGear)) ? assets['upgear.png'].u : assets['upgear-un.png'].u} className={styles.logo} />
</View> </View>
<View className={styles.beforeDetails}> <View className={styles.beforeDetails}>
{stageDetailPre?.level !== stageDetail?.level && <Image src={formatLevelAchieve(stageDetail?.level)} className={classNames(styles.logo, styles.level)} />} <Image
{stageDetailPre?.gear !== stageDetail?.gear && <Image src={formatTopAchieve(stageDetail?.gear.toString())} className={classNames(styles.logo, styles.gear)} />} src={formatLevelAchieve(stageDetail?.level)}
{stageDetailPre?.upGear !== stageDetail?.upGear && <Image src={assets['upgear.png'].u} className={classNames(styles.logo, styles.upgear)} />} className={classNames(
styles.logo, {
[styles.show]: stageDetailPre.level && stageDetail?.level !== stageDetailPre?.level
})
}
/>
<Image
src={formatTopAchieve(stageDetail.gear?.toString())}
className={classNames(
styles.logo, {
[styles.show]: stageDetailPre.gear && stageDetail?.gear <= 30 && stageDetail?.gear < stageDetailPre?.gear
})
}
/>
<Image
src={assets['upgear.png'].u}
className={classNames(
styles.logo, {
[styles.show]: stageDetail?.upGear !== stageDetailPre?.upGear
})
}
/>
</View> </View>
</> </>
) )
......
...@@ -21,17 +21,17 @@ export const formatNextStep = (item: NextStep) => { ...@@ -21,17 +21,17 @@ export const formatNextStep = (item: NextStep) => {
} }
case StageGear.TOP10: case StageGear.TOP10:
return { return {
t: `TOP${StageGear.TOP10}`, t: `TOP${StageGear.TOP10}%`,
u: assets['top-big-10.png'].u u: assets['top-big-10.png'].u
} }
case StageGear.TOP20: case StageGear.TOP20:
return { return {
t: `TOP${StageGear.TOP20}`, t: `TOP${StageGear.TOP20}%`,
u: assets['top-big-20.png'].u u: assets['top-big-20.png'].u
} }
case StageGear.TOP30: case StageGear.TOP30:
return { return {
t: `TOP${StageGear.TOP30}`, t: `TOP${StageGear.TOP30}%`,
u: assets['top-big-30.png'].u u: assets['top-big-30.png'].u
} }
case 'upGear': case 'upGear':
......
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