Commit 3cca7b02 authored by raca's avatar raca

feat: update

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