Commit 97841175 authored by raca's avatar raca

Merge branch 'feature/2023-06-12-v1.1' of…

Merge branch 'feature/2023-06-12-v1.1' of https://118.24.71.244/hewenhao/GeekLearnMathWeapp into feature/2023-06-12-v1.1
parents 5367faf4 15a5d29b
......@@ -3,16 +3,20 @@ import assetsGame from '@/assets/oss/assets-game'
import assetsPrepare from '@/assets/oss/assets-prepare'
import assetsPk from '@/assets/oss/assets-pk'
import classNames from 'classnames'
import { reLaunch } from '@tarojs/taro'
import { useStoreState } from '@/store/hooks'
import styles from './battle-complete.module.scss'
type BattleCompleteProps = {
}
const BattleComplete = (props: BattleCompleteProps) => {
const BattleComplete = () => {
const pkResult = useStoreState(states => states.gameModel.pkResult)
const upSelf = () => {
reLaunch({
url: '/pages/main/main'
})
}
if (!pkResult) {
return null
}
......@@ -27,30 +31,30 @@ const BattleComplete = (props: BattleCompleteProps) => {
</View>
<View className={styles.game_role}>
<View className={styles.game_role_left}>
<View className={styles.user_name}>用户名称用户名</View>
<View className={styles.user_name}>{pkResult.initiatorName}</View>
<View className={styles.user_level}>
<Image src={assetsPk['bronze.png'].u} className={styles.level_icon}></Image>青铜Ⅰ
</View>
<View className={styles.info}>答题对错:全对</View>
<View className={classNames(styles.info, styles.is_info_2)}>答题用时:21.3s</View>
<View className={classNames(styles.info, styles.is_info_2)}>答题用时:{pkResult.initiatorResultTime}s</View>
</View>
<View className={classNames(styles.game_role_right, styles.is_fail)}>
<View className={styles.user_name}>用户名称用户名</View>
<View className={styles.user_name}>{pkResult.recipientName}</View>
<View className={styles.user_level}>
<Image src={assetsPk['bronze.png'].u} className={styles.level_icon}></Image>青铜Ⅰ
</View>
<View className={styles.info}>答题对错:全对</View>
<View className={classNames(styles.info, styles.is_info_2)}>答题用时:21.3s</View>
<View className={styles.info}>答题对错:{pkResult.recipientErrNum > 0 ? `错${pkResult.recipientErrNum}题` : '全对'}</View>
<View className={classNames(styles.info, styles.is_info_2)}>答题用时:{pkResult.recipientResultTime}s</View>
</View>
</View>
<View className={styles.gap_2}></View>
<View className={styles.footer}>
<View className={styles.share}>分享结果</View>
<View className={styles.back_main}>提升自己</View>
<View className={styles.back_main} onClick={upSelf}>提升自己</View>
</View>
<View className={styles.gap_3}></View>
</View>
......
......@@ -2,7 +2,8 @@ import { Action, Computed, Thunk } from 'easy-peasy'
import { AppStoreModel } from '@/store/store-model'
import {
type StageDetail,
type CompleteStageOut
type CompleteStageOut,
type PkResult
} from '@/api'
import {
QuestionType,
......@@ -41,6 +42,8 @@ export interface GameModelState {
rightIcon: string | null;
isBattle: boolean;
pkResult: PkResult | null;
}
export interface GameModel extends GameModelState {
......
......@@ -103,7 +103,7 @@ const Tutorial = () => {
loadData()
preloadGuideImages()
}
if (isLoadRef.current || stageList.length < 1) {
if (isLoadRef.current) {
return
}
isLoadRef.current = true
......@@ -115,6 +115,9 @@ const Tutorial = () => {
} else {
setStep(0)
// 只有第一关才有
if (stageList.length < 1) {
return
}
const index = stageList.findIndex(c => c.status === StageStatus.CURRENT)
if (!isMainGuideComplete && index === 0) {
updateGuideActive(true)
......
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