Commit 9f004b7c authored by hewenhao's avatar hewenhao

feat: 拥有星星数量

parent 971a0708
...@@ -72,6 +72,9 @@ export interface Stage { ...@@ -72,6 +72,9 @@ export interface Stage {
/** 星星限制数量 */ /** 星星限制数量 */
limitStar: number; limitStar: number;
/** 拥有星星数量 */
holdStar: number;
/** pk负 */ /** pk负 */
pkLoseNum: number | null; pkLoseNum: number | null;
/** pk胜场 */ /** pk胜场 */
......
...@@ -153,7 +153,6 @@ const StageComp = (props: StageProps) => { ...@@ -153,7 +153,6 @@ const StageComp = (props: StageProps) => {
const nextPkGuide = useStoreActions(state => state.guideModel.nextPkGuide) const nextPkGuide = useStoreActions(state => state.guideModel.nextPkGuide)
const showPkGuideFromHis = useStoreState(state => state.guideModel.showPkGuideFromHis) const showPkGuideFromHis = useStoreState(state => state.guideModel.showPkGuideFromHis)
const updateGuideState = useStoreActions(state => state.guideModel.updateState) const updateGuideState = useStoreActions(state => state.guideModel.updateState)
const pkDetails = useStoreState(state => state.userModel.pkDetails)
const isSpecialRound = useMemo(() => { const isSpecialRound = useMemo(() => {
return stage.type === StageType.Special return stage.type === StageType.Special
...@@ -174,7 +173,7 @@ const StageComp = (props: StageProps) => { ...@@ -174,7 +173,7 @@ const StageComp = (props: StageProps) => {
const handleClick = () => { const handleClick = () => {
if (stage.status !== StageStatus.DISABLED || !isProduction) { if (stage.status !== StageStatus.DISABLED || !isProduction) {
if (isSpecialRound) { if (isSpecialRound) {
if ((pkDetails?.stars ?? 0) < stage.limitStar) { if ((stage.holdStar ?? 0) < stage.limitStar) {
showToast({ title: '星星数量不够,快去收集吧~', icon: 'none' }) showToast({ title: '星星数量不够,快去收集吧~', icon: 'none' })
return return
} }
...@@ -218,7 +217,7 @@ const StageComp = (props: StageProps) => { ...@@ -218,7 +217,7 @@ const StageComp = (props: StageProps) => {
} }
case StageStatus.CURRENT: { case StageStatus.CURRENT: {
if (isSpecialRound && (pkDetails?.stars ?? 0) < stage.limitStar) { if (isSpecialRound && (stage.holdStar ?? 0) < stage.limitStar) {
return ( return (
<Image src={getLockedIcon(stage.type).u} className={getIconClassNames(stage.type)} /> <Image src={getLockedIcon(stage.type).u} className={getIconClassNames(stage.type)} />
) )
...@@ -301,7 +300,7 @@ const StageComp = (props: StageProps) => { ...@@ -301,7 +300,7 @@ const StageComp = (props: StageProps) => {
{isSpecialRound ? ( {isSpecialRound ? (
<View className={styles.special_name}> <View className={styles.special_name}>
<Image src={assetsMainNext['star.png'].u} className={styles.special_star} /> <Image src={assetsMainNext['star.png'].u} className={styles.special_star} />
星星 {pkDetails?.stars ?? 0}/{stage.limitStar} 星星 {stage.holdStar ?? 0}/{stage.limitStar}
</View> </View>
) : ( ) : (
<View>{!isProduction ? `${stage.id}.` : ''}{stage.name}</View> <View>{!isProduction ? `${stage.id}.` : ''}{stage.name}</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