Commit 9f004b7c authored by hewenhao's avatar hewenhao

feat: 拥有星星数量

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