Commit cb4c5302 authored by hewenhao's avatar hewenhao

feat: update

parent 87931d7e
......@@ -94,5 +94,11 @@
"w": 440,
"h": 400,
"ossName": "/pk-math/2nnqRto1cBuiZVjgSgA3ZVFgBgRP/440x400"
},
"fail-ip-1.png": {
"u": "https://cdn.jkwljy.com/pk-math/36jdXR2vuZH8FpKTZAji36dtpFfr/686x320",
"w": 686,
"h": 320,
"ossName": "/pk-math/36jdXR2vuZH8FpKTZAji36dtpFfr/686x320"
}
}
......@@ -160,5 +160,29 @@
"w": 64,
"h": 64,
"ossName": "/pk-math/3vsWjE3z8sWZh1xg9pa5cFh48ANZ/64x64"
},
"cat-2.png": {
"u": "https://cdn.jkwljy.com/pk-math/2vuUKhVcvXW95JWog9yd9g7JeNhw/300x300",
"w": 300,
"h": 300,
"ossName": "/pk-math/2vuUKhVcvXW95JWog9yd9g7JeNhw/300x300"
},
"cat-3.png": {
"u": "https://cdn.jkwljy.com/pk-math/2c9Po46b3UTCjKNNVskjt8Vr3Qns/300x300",
"w": 300,
"h": 300,
"ossName": "/pk-math/2c9Po46b3UTCjKNNVskjt8Vr3Qns/300x300"
},
"cat-4.png": {
"u": "https://cdn.jkwljy.com/pk-math/4J8xBHWsx9jQZC8Y4x9A2ysVxJ2e/300x300",
"w": 300,
"h": 300,
"ossName": "/pk-math/4J8xBHWsx9jQZC8Y4x9A2ysVxJ2e/300x300"
},
"cat-5.png": {
"u": "https://cdn.jkwljy.com/pk-math/3YWpuPxzmfnebWaxqu36TTT4biLx/300x300",
"w": 300,
"h": 300,
"ossName": "/pk-math/3YWpuPxzmfnebWaxqu36TTT4biLx/300x300"
}
}
......@@ -80,5 +80,10 @@ export default {
"u": "https://cdn.jkwljy.com/pk-math/2nnqRto1cBuiZVjgSgA3ZVFgBgRP/440x400",
"w": 440,
"h": 400
},
"fail-ip-1.png": {
"u": "https://cdn.jkwljy.com/pk-math/36jdXR2vuZH8FpKTZAji36dtpFfr/686x320",
"w": 686,
"h": 320
}
} as const
......@@ -135,5 +135,25 @@ export default {
"u": "https://cdn.jkwljy.com/pk-math/3vsWjE3z8sWZh1xg9pa5cFh48ANZ/64x64",
"w": 64,
"h": 64
},
"cat-2.png": {
"u": "https://cdn.jkwljy.com/pk-math/2vuUKhVcvXW95JWog9yd9g7JeNhw/300x300",
"w": 300,
"h": 300
},
"cat-3.png": {
"u": "https://cdn.jkwljy.com/pk-math/2c9Po46b3UTCjKNNVskjt8Vr3Qns/300x300",
"w": 300,
"h": 300
},
"cat-4.png": {
"u": "https://cdn.jkwljy.com/pk-math/4J8xBHWsx9jQZC8Y4x9A2ysVxJ2e/300x300",
"w": 300,
"h": 300
},
"cat-5.png": {
"u": "https://cdn.jkwljy.com/pk-math/3YWpuPxzmfnebWaxqu36TTT4biLx/300x300",
"w": 300,
"h": 300
}
} as const
......@@ -164,16 +164,31 @@
}
}
.fail {
display: flex;
align-items: center;
justify-content: center;
padding-top: 10vh;
.fail_icon {
width: 686px;
height: 320px;
position: absolute;
top: -304px;
left: 0;
animation-name: fadeInUp;
animation-duration: .5s;
animation-timing-function: ease-out;
animation-fill-mode: backwards;
animation-delay: .5s;
animation-iteration-count: 1;
z-index: 1;
}
.fail_icon {
width: 498px;
height: 96px;
@keyframes fadeInUp {
0% {
opacity: 0;
transform: translateY(112px) scale(0.5, 0.5);
}
100% {
opacity: 1;
transform: translateY(0) scale(1, 1);
}
}
.gap {
......@@ -193,5 +208,7 @@
font-weight: 600;
color: #FFFFFF;
line-height: 56px;
position: relative;
z-index: 2;
}
......@@ -73,8 +73,13 @@ const GameCompleteAchieve = () => {
navigateBack()
}, [])
const renderBtn = () => (
if (!gameResult) {
return null
}
const renderBtn = (ar?) => (
<View className={styles.footer}>
{ar}
<View
className={styles.btn_continue}
hoverClass={styles.is_active}
......@@ -85,17 +90,12 @@ const GameCompleteAchieve = () => {
</View>
)
if (!gameResult) {
return null
}
if (gameResult.errNum > 0 || !gameResult.level) {
return (
<>
<View className={classNames(styles.wrap, styles.fail)}>
<Image src={require('../assets/fail.png')} className={styles.fail_icon}></Image>
</View>
{renderBtn()}
{renderBtn((
<Image src={assets['fail-ip-1.png'].u} className={styles.fail_icon}></Image>
))}
</>
)
}
......
......@@ -62,6 +62,33 @@
display: flex;
align-items: center;
justify-content: center;
animation-name: fadeInUp;
animation-duration: .5s;
animation-timing-function: ease-out;
animation-fill-mode: backwards;
animation-iteration-count: 1;
&:nth-child(1) {
animation-delay: 0;
}
&:nth-child(2) {
animation-delay: .3s;
}
&:nth-child(3) {
animation-delay: .6s;
}
}
@keyframes fadeInUp {
0% {
opacity: 0;
transform: translateY(82px) scale(0.5, 0.5);
}
100% {
opacity: 1;
transform: translateY(0) scale(1, 1);
}
}
.icon {
......
import { useState, useMemo } from 'react'
import { useState, useMemo, useEffect } from 'react'
import { getMenuButtonBoundingClientRect } from '@tarojs/taro'
import { preloadImage } from '@/utils/preload-image'
import assets from '@/assets/oss/assets-guide'
import Scene1 from './scene-1'
import Scene2 from './scene-2'
import Scene3 from './scene-3'
......@@ -7,6 +9,18 @@ import Scene4 from './scene-4'
import Scene5 from './scene-5'
import Scene6 from './scene-6'
let isLoad = false
const preloadGuideImages = () => {
if (isLoad) return
isLoad = true
const items: string[] = []
for (const key in assets) {
items.push(assets[key].u)
}
preloadImage(items)
}
type GuideProps = {
onDone: () => void;
}
......@@ -17,6 +31,10 @@ const Guide = (props: GuideProps) => {
const nav = useMemo(getMenuButtonBoundingClientRect, [])
const [time, setTime] = useState(0)
useEffect(() => {
preloadGuideImages()
}, [])
const spriteTop = useMemo(() => {
if (step > 0) {
return nav.top + 5 + 24
......
import { ScrollView, View, Image } from '@tarojs/components'
import { useState, useCallback } from 'react'
import classNames from 'classnames'
import assets from '@/assets/oss/assets-guide'
import TextPrinter from './text-printer'
import cs from './index.module.scss'
......@@ -55,7 +56,15 @@ const Scene1 = ({ onNext }: Scene1Props) => {
<View className={cs.viewport_body}>
<ScrollView className={cs.viewport_body_inner} scrollY>
<View className={cs.sprite}>
<Image src="https://cdn.jkwljy.com/pk-math/4Bzk3ySpYgXbHLZLhbn4Xdwu3cpE/300x300" className={cs.cat} />
{current === 0 && (
<Image src={assets['cat.png'].u} className={cs.cat} />
)}
{current === 1 && (
<Image src={assets['cat-2.png'].u} className={cs.cat} />
)}
{(current === 2 || current === 3) && (
<Image src={assets['cat-3.png'].u} className={cs.cat} />
)}
<View className={styles.dialog}>
{current === 0 && (
<View className={styles.modal_1}>
......
......@@ -50,7 +50,7 @@ const Scene2 = (props: Scene2Props) => {
<View className={cs.viewport_body}>
<ScrollView className={cs.viewport_body_inner} scrollY>
<View className={classNames(cs.sprite, cs.step_static)} style={{ paddingTop: `${spriteTop}px` }}>
<Image src="https://cdn.jkwljy.com/pk-math/4Bzk3ySpYgXbHLZLhbn4Xdwu3cpE/300x300" className={cs.cat} />
<Image src={assets['cat-3.png'].u} className={cs.cat} />
<View className={styles.modal_4} style={{ marginTop: `${spriteTop}px` }}>
<Text>请问同学有哪些<Text className={styles.em}>计算问题</Text>需要提高呢?<Text className={styles.select}>多选</Text></Text>
</View>
......
import { View, Text, Image, ScrollView } from '@tarojs/components'
import { View, Image, ScrollView } from '@tarojs/components'
import { useLocalStore, action, Action, Thunk, thunk, State } from 'easy-peasy'
import classNames from 'classnames'
import { useMemo } from 'react'
import assets from '@/assets/oss/assets-guide'
import { getCurrentInstance } from '@tarojs/taro'
import NumberKeyboard from '@/pages/game/play/components/number-keyboard'
import MathSymbol from '@/pages/game/play/components/math-symbol'
......@@ -115,7 +116,7 @@ const Scene3 = (props: Scene3Props) => {
<View className={cs.viewport_body}>
<ScrollView className={cs.viewport_body_inner} scrollY>
<View className={classNames(cs.sprite, cs.step_static)} style={{ paddingTop: `${spriteTop}px` }}>
<Image src="https://cdn.jkwljy.com/pk-math/4Bzk3ySpYgXbHLZLhbn4Xdwu3cpE/300x300" className={cs.cat} />
<Image src={assets['cat-2.png'].u} className={cs.cat} />
<View className={styles.modal_4} style={{ marginTop: `${spriteTop}px` }}>
<View>我们来试试吧! </View>
<View>请在输入框填写答案</View>
......
......@@ -61,7 +61,7 @@ const Scene4 = (props: Scene4Props) => {
<View className={cs.viewport_body}>
<ScrollView className={cs.viewport_body_inner} scrollY>
<View className={classNames(cs.sprite, cs.step_static)} style={{ paddingTop: `${spriteTop}px` }}>
<Image src="https://cdn.jkwljy.com/pk-math/4Bzk3ySpYgXbHLZLhbn4Xdwu3cpE/300x300" className={cs.cat} />
<Image src={assets['cat-4.png'].u} className={cs.cat} />
<View className={styles.modal_4} style={{ marginTop: `${spriteTop}px` }}>
<Text>恭喜你,表内乘除法,你掌握得不错哦</Text>
</View>
......
......@@ -2,7 +2,7 @@
position: absolute;
top: 64px;
width: 468px;
height: 168px;
height: 224px;
left: 250px;
background-image: url(https://cdn.jkwljy.com/pk-math/2LAQN5FBeoW6UrQEaRVQVP6HTU25/468x224);
background-size: 100% 100%;
......
......@@ -33,11 +33,11 @@ const Scene5 = (props: Scene5Props) => {
<View className={cs.viewport_body}>
<ScrollView className={cs.viewport_body_inner} scrollY>
<View className={classNames(cs.sprite, cs.step_static)} style={{ paddingTop: `${spriteTop}px` }}>
<Image src="https://cdn.jkwljy.com/pk-math/4Bzk3ySpYgXbHLZLhbn4Xdwu3cpE/300x300" className={cs.cat} />
<Image src={assets['cat-3.png'].u} className={cs.cat} />
<View className={styles.modal_4} style={{ marginTop: `${spriteTop}px` }}>
{isSubmit
? (
<Text>各类题型,已经为你准备好啦。我这个数学大</Text>
<Text>各类题型,已经为你准备好啦。我这个数学大师不错吧!</Text>
)
: (
<Text>请问同学有哪些<Text className={styles.em}>计算问题</Text>需要提高呢?<Text className={styles.select}>多选</Text></Text>
......
......@@ -73,7 +73,7 @@ const Scene6 = (props: Scene6Props) => {
<ScrollView className={cs.viewport_body_inner} scrollY>
<View className={styles.full}>
<View className={classNames(cs.sprite, cs.step_static)} style={{ paddingTop: `${spriteTop}px` }}>
<Image src="https://cdn.jkwljy.com/pk-math/4Bzk3ySpYgXbHLZLhbn4Xdwu3cpE/300x300" className={cs.cat} />
<Image src={assets['cat-5.png'].u} className={cs.cat} />
<View className={styles.modal_4} style={{ marginTop: `${spriteTop}px` }}>
<View>请选择你的昵称</View>
<View className={styles.tips}>*仅用于排行榜展示哦</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