Commit efdaff1f authored by raca's avatar raca

Merge branch 'feature/2023-04-19-iter' of…

Merge branch 'feature/2023-04-19-iter' of https://118.24.71.244/hewenhao/GeekLearnMathWeapp into feature/2023-04-19-iter
parents 9fc88413 6e3182c6
...@@ -62,6 +62,7 @@ const config = { ...@@ -62,6 +62,7 @@ const config = {
'process.env.Staging': JSON.stringify(process.env.Staging || false), 'process.env.Staging': JSON.stringify(process.env.Staging || false),
'process.env.DEV_SERVER': JSON.stringify(process.env.DEV_SERVER || ''), 'process.env.DEV_SERVER': JSON.stringify(process.env.DEV_SERVER || ''),
'process.env.SERVER_ENDPOINT': JSON.stringify(process.env.SERVER_ENDPOINT || ''), 'process.env.SERVER_ENDPOINT': JSON.stringify(process.env.SERVER_ENDPOINT || ''),
'process.env.TARO_STORAGE_KEY': JSON.stringify(process.env.TARO_STORAGE_KEY || ''),
...envMap ...envMap
}, },
copy: { copy: {
......
{ {
"name": "learn-math-weapp", "name": "learn-math-weapp",
"version": "1.0.6", "version": "1.0.9",
"private": true, "private": true,
"description": "", "description": "",
"scripts": { "scripts": {
......
...@@ -26,7 +26,7 @@ module.exports = function configEnv () { ...@@ -26,7 +26,7 @@ module.exports = function configEnv () {
} }
const hash = crypto.createHash('md5') const hash = crypto.createHash('md5')
hash.update('GEEK-PK-MATH-WEAPP-V1') hash.update('GEEK-PK-MATH-WEAPP-V1.9')
hash.update(`build-${env}`) hash.update(`build-${env}`)
hash.update(`build-${process.env.SERVER_ENDPOINT || ''}`) hash.update(`build-${process.env.SERVER_ENDPOINT || ''}`)
process.env.TARO_STORAGE_KEY = hash.digest('base64').substring(0, 5) process.env.TARO_STORAGE_KEY = hash.digest('base64').substring(0, 5)
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
import { requestAfterSilentLogin } from '@/utils/request' import { requestAfterSilentLogin } from '@/utils/request'
import { QuestionItem, type QuestionType } from '@/pages/game/play/types' import { QuestionItem, type QuestionType } from '@/pages/game/play/types'
export const getQuestionList = (stageId: number) => { export const getQuestionList = (stageId: number, normal: boolean = true) => {
return requestAfterSilentLogin<QuestionType[], { stageId: number, userId?: number }>(userInfo => ({ return requestAfterSilentLogin<QuestionType[], { stageId: number, userId?: number }>(userInfo => ({
url: '/service-idea/stage/startStage', url: '/service-idea/stage/startStage',
method: 'GET', method: 'GET',
data: { stageId, userId: userInfo?.userId } data: { stageId, userId: userInfo?.userId, normal }
})) }))
} }
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
align-items: center; align-items: center;
border: 6px solid transparent; border: 6px solid transparent;
box-sizing: border-box; box-sizing: border-box;
padding-left: 28px;
&.is_active { &.is_active {
background: #FFF5E3; background: #FFF5E3;
...@@ -72,16 +73,20 @@ ...@@ -72,16 +73,20 @@
font-weight: 500; font-weight: 500;
color: #465164; color: #465164;
line-height: 56px; line-height: 56px;
padding: 10px 12px 10px 28px;
position: relative; position: relative;
width: 64px; width: 64px;
height: 64px; height: 64px;
text-align: center; display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
flex-shrink: 0;
margin-right: 12px;
&::after { &::after {
content: " "; content: " ";
position: absolute; position: absolute;
right: 0; right: -12px;
top: 50%; top: 50%;
width: 2px; width: 2px;
height: 28px; height: 28px;
......
...@@ -286,7 +286,11 @@ const gameModel: GameModel = { ...@@ -286,7 +286,11 @@ const gameModel: GameModel = {
getQuestionList: thunk(async (actions, round, helpers) => { getQuestionList: thunk(async (actions, round, helpers) => {
try { try {
// showLoading() // showLoading()
const { data: questionList } = await getQuestionList(round) const stageList = helpers.getStoreState().mainModel.stageList
const isFirstStage = stageList.findIndex(c => String(c.id) === String(round)) === 0
const stageDetail = helpers.getState().stageDetail
const isNormal = !isFirstStage || !!stageDetail?.level
const { data: questionList } = await getQuestionList(round, isNormal)
actions.updateState({ actions.updateState({
questionList: questionList.map(convertQuestion), questionList: questionList.map(convertQuestion),
currentInputIndex: 0, currentInputIndex: 0,
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
background: #F0F2F9; background: #F0F2F9;
border-radius: 24px; border-radius: 24px;
display: flex; display: flex;
padding-left: 28px;
align-items: center; align-items: center;
border: 6px solid transparent; border: 6px solid transparent;
box-sizing: border-box; box-sizing: border-box;
...@@ -71,17 +72,21 @@ ...@@ -71,17 +72,21 @@
font-size: 36px; font-size: 36px;
font-weight: 500; font-weight: 500;
color: #465164; color: #465164;
line-height: 50px;
padding: 10px 12px 10px 28px;
position: relative; position: relative;
width: 64px; width: 64px;
height: 64px; height: 64px;
text-align: center; text-align: center;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
flex-shrink: 0;
margin-right: 12px;
&::after { &::after {
content: " "; content: " ";
position: absolute; position: absolute;
right: 0; right: -12px;
top: 50%; top: 50%;
width: 2px; width: 2px;
height: 28px; height: 28px;
......
...@@ -71,6 +71,9 @@ ...@@ -71,6 +71,9 @@
.clear { .clear {
position: relative; position: relative;
z-index: 1; z-index: 1;
display: flex;
flex-direction: column;
align-items: center;
} }
.clearIcon { .clearIcon {
......
...@@ -16,6 +16,41 @@ const ModalResult = (props: ModalResultProps) => { ...@@ -16,6 +16,41 @@ const ModalResult = (props: ModalResultProps) => {
return grade === '一年级' return grade === '一年级'
}, [grade]) }, [grade])
const isLevel2 = useMemo(() => {
return grade === '二年级'
}, [grade])
const renderContent = () => {
if (isLevel1) {
return (
<View>
一年级匹配的内容还在准备中,如果孩子比较优秀,也
<Text className={styles.em}>可以来试试</Text>哦。
</View>
)
}
if (isLevel2) {
return (
<View>
已经为你准备好了二年级(下学期)所必须掌握的
<Text className={styles.em}>计算达标</Text>、
<Text className={styles.em}>常考的应用题</Text>、
以及<Text className={styles.em}>附加思维题</Text>哦。
</View>
)
}
return (
<View>
让我们先从基本功开始。已经为你准备好了打好基本功所必须掌握的
<Text className={styles.em}>计算达标</Text>、
<Text className={styles.em}>常考的应用题</Text>、
以及<Text className={styles.em}>附加思维题</Text>哦。
</View>
)
}
return ( return (
<RootPortal> <RootPortal>
<View className={styles.mask} catchMove></View> <View className={styles.mask} catchMove></View>
...@@ -23,21 +58,7 @@ const ModalResult = (props: ModalResultProps) => { ...@@ -23,21 +58,7 @@ const ModalResult = (props: ModalResultProps) => {
<Image src={tutorialAssets['cat.png'].u} className={styles.result_cat} /> <Image src={tutorialAssets['cat.png'].u} className={styles.result_cat} />
<View className={styles.result_main}> <View className={styles.result_main}>
<View className={classNames(styles.dialog, isLevel1 && styles.is_lower)} onClick={() => onConfirm()}> <View className={classNames(styles.dialog, isLevel1 && styles.is_lower)} onClick={() => onConfirm()}>
{isLevel1 {renderContent()}
? (
<View>
一年级匹配的内容还在准备中,如果孩子比较
<Text className={styles.em}>可以来试试</Text>哦。
</View>
)
: (
<View>
让我们先从基本功开始。已经为你准备好了打好基本功所必须掌握的
<Text className={styles.em}>计算达标</Text>、
<Text className={styles.em}>常考的应用题</Text>、
以及<Text className={styles.em}>附加思维题</Text>哦。
</View>
)}
<View className={styles.continue}> <View className={styles.continue}>
<View className={styles.continue_btn}> <View className={styles.continue_btn}>
继续<Image src={tutorialAssets['continue-arrow.png'].u} className={styles.continue_icon} /> 继续<Image src={tutorialAssets['continue-arrow.png'].u} className={styles.continue_icon} />
......
...@@ -67,11 +67,12 @@ ...@@ -67,11 +67,12 @@
.guide_content { .guide_content {
position: absolute; position: absolute;
top: 0; top: 16px;
left: 0; left: 0;
right: 0; right: 0;
transform: translateY(-100%); transform: translateY(-100%);
display: flex; display: flex;
z-index: 1;
} }
.card-body { .card-body {
...@@ -94,7 +95,7 @@ ...@@ -94,7 +95,7 @@
right: -8px; right: -8px;
bottom: -8px; bottom: -8px;
border-radius: 32px; border-radius: 32px;
border: 4px dashed #FFFFFF; border: 8px dashed #FFFFFF;
} }
} }
} }
......
...@@ -106,6 +106,12 @@ const Prepare = () => { ...@@ -106,6 +106,12 @@ const Prepare = () => {
const completeGuide = useStoreActions(actions => actions.prepareModel.completeGuide) const completeGuide = useStoreActions(actions => actions.prepareModel.completeGuide)
const completeFailGuide = useStoreActions(actions => actions.prepareModel.completeFailGuide) const completeFailGuide = useStoreActions(actions => actions.prepareModel.completeFailGuide)
const isNormal = useMemo(() => {
const isFirstStage = stageList.findIndex(stage => stage.id === +router.params.id) === 0
const isPassed = !!stageDetail?.level
return !isFirstStage || isPassed
}, [stageDetail, stageList, router])
const handleClick = async () => { const handleClick = async () => {
/** 首次闯关引导完成 */ /** 首次闯关引导完成 */
!guideComplete && await completeGuide() !guideComplete && await completeGuide()
...@@ -113,7 +119,7 @@ const Prepare = () => { ...@@ -113,7 +119,7 @@ const Prepare = () => {
/** 首次闯关失败引导完成 */ /** 首次闯关失败引导完成 */
isSubmit && !failGuideComplete && await completeFailGuide() isSubmit && !failGuideComplete && await completeFailGuide()
if (cardNum < 1 && !stageDetail?.firstTime) { if (cardNum < 1 && !stageDetail?.firstTime && isNormal) {
setTrue() setTrue()
} else { } else {
if (isClickRef.current) return if (isClickRef.current) return
...@@ -150,7 +156,7 @@ const Prepare = () => { ...@@ -150,7 +156,7 @@ const Prepare = () => {
<Text className={styles.challenge_text}>开始闯关</Text> <Text className={styles.challenge_text}>开始闯关</Text>
<View className={styles.card} style={{ position: 'absolute', right: 60 }}> <View className={styles.card} style={{ position: 'absolute', right: 60 }}>
<Image className={styles.card_icon} src={require('@/pages/main/assets/ph.png')} /> <Image className={styles.card_icon} src={require('@/pages/main/assets/ph.png')} />
{!stageDetail?.firstTime && <Text className={styles.card_text}>-1</Text>} {!stageDetail?.firstTime && isNormal && <Text className={styles.card_text}>-1</Text>}
</View> </View>
{stageDetail?.firstTime && <View className={styles.tip}> {stageDetail?.firstTime && <View className={styles.tip}>
<Text className={styles.tip_text}>首次免答题卡</Text> <Text className={styles.tip_text}>首次免答题卡</Text>
...@@ -219,10 +225,12 @@ const Prepare = () => { ...@@ -219,10 +225,12 @@ const Prepare = () => {
image={classNames(!hasNextBtn ? styles.image : styles.long_image)} image={classNames(!hasNextBtn ? styles.image : styles.long_image)}
hoverImage={classNames(!hasNextBtn ? styles.hover_image : styles.long_hover_image)} hoverImage={classNames(!hasNextBtn ? styles.hover_image : styles.long_hover_image)}
> >
<View className={styles.card} style={{ marginRight: 12 }}> {isNormal && (
<Image className={styles.card_icon} src={require('@/pages/main/assets/ph.png')} /> <View className={styles.card} style={{ marginRight: 12 }}>
<Text className={styles.card_text}>-1</Text> <Image className={styles.card_icon} src={require('@/pages/main/assets/ph.png')} />
</View> <Text className={styles.card_text}>-1</Text>
</View>
)}
<Text className={styles.challenge_text}>再次提升</Text> <Text className={styles.challenge_text}>再次提升</Text>
</Button> </Button>
</View> </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