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 = {
'process.env.Staging': JSON.stringify(process.env.Staging || false),
'process.env.DEV_SERVER': JSON.stringify(process.env.DEV_SERVER || ''),
'process.env.SERVER_ENDPOINT': JSON.stringify(process.env.SERVER_ENDPOINT || ''),
'process.env.TARO_STORAGE_KEY': JSON.stringify(process.env.TARO_STORAGE_KEY || ''),
...envMap
},
copy: {
......
{
"name": "learn-math-weapp",
"version": "1.0.6",
"version": "1.0.9",
"private": true,
"description": "",
"scripts": {
......
......@@ -26,7 +26,7 @@ module.exports = function configEnv () {
}
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-${process.env.SERVER_ENDPOINT || ''}`)
process.env.TARO_STORAGE_KEY = hash.digest('base64').substring(0, 5)
......
......@@ -2,11 +2,11 @@
import { requestAfterSilentLogin } from '@/utils/request'
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 => ({
url: '/service-idea/stage/startStage',
method: 'GET',
data: { stageId, userId: userInfo?.userId }
data: { stageId, userId: userInfo?.userId, normal }
}))
}
......
......@@ -44,6 +44,7 @@
align-items: center;
border: 6px solid transparent;
box-sizing: border-box;
padding-left: 28px;
&.is_active {
background: #FFF5E3;
......@@ -72,16 +73,20 @@
font-weight: 500;
color: #465164;
line-height: 56px;
padding: 10px 12px 10px 28px;
position: relative;
width: 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 {
content: " ";
position: absolute;
right: 0;
right: -12px;
top: 50%;
width: 2px;
height: 28px;
......
......@@ -286,7 +286,11 @@ const gameModel: GameModel = {
getQuestionList: thunk(async (actions, round, helpers) => {
try {
// 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({
questionList: questionList.map(convertQuestion),
currentInputIndex: 0,
......
......@@ -41,6 +41,7 @@
background: #F0F2F9;
border-radius: 24px;
display: flex;
padding-left: 28px;
align-items: center;
border: 6px solid transparent;
box-sizing: border-box;
......@@ -71,17 +72,21 @@
font-size: 36px;
font-weight: 500;
color: #465164;
line-height: 50px;
padding: 10px 12px 10px 28px;
position: relative;
width: 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 {
content: " ";
position: absolute;
right: 0;
right: -12px;
top: 50%;
width: 2px;
height: 28px;
......
......@@ -71,6 +71,9 @@
.clear {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
align-items: center;
}
.clearIcon {
......
......@@ -16,28 +16,49 @@ const ModalResult = (props: ModalResultProps) => {
return grade === '一年级'
}, [grade])
const isLevel2 = useMemo(() => {
return grade === '二年级'
}, [grade])
const renderContent = () => {
if (isLevel1) {
return (
<RootPortal>
<View className={styles.mask} catchMove></View>
<View className={styles.result_wrap} catchMove>
<Image src={tutorialAssets['cat.png'].u} className={styles.result_cat} />
<View className={styles.result_main}>
<View className={classNames(styles.dialog, isLevel1 && styles.is_lower)} onClick={() => onConfirm()}>
{isLevel1
? (
<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 (
<RootPortal>
<View className={styles.mask} catchMove></View>
<View className={styles.result_wrap} catchMove>
<Image src={tutorialAssets['cat.png'].u} className={styles.result_cat} />
<View className={styles.result_main}>
<View className={classNames(styles.dialog, isLevel1 && styles.is_lower)} onClick={() => onConfirm()}>
{renderContent()}
<View className={styles.continue}>
<View className={styles.continue_btn}>
继续<Image src={tutorialAssets['continue-arrow.png'].u} className={styles.continue_icon} />
......
......@@ -67,11 +67,12 @@
.guide_content {
position: absolute;
top: 0;
top: 16px;
left: 0;
right: 0;
transform: translateY(-100%);
display: flex;
z-index: 1;
}
.card-body {
......@@ -94,7 +95,7 @@
right: -8px;
bottom: -8px;
border-radius: 32px;
border: 4px dashed #FFFFFF;
border: 8px dashed #FFFFFF;
}
}
}
......
......@@ -106,6 +106,12 @@ const Prepare = () => {
const completeGuide = useStoreActions(actions => actions.prepareModel.completeGuide)
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 () => {
/** 首次闯关引导完成 */
!guideComplete && await completeGuide()
......@@ -113,7 +119,7 @@ const Prepare = () => {
/** 首次闯关失败引导完成 */
isSubmit && !failGuideComplete && await completeFailGuide()
if (cardNum < 1 && !stageDetail?.firstTime) {
if (cardNum < 1 && !stageDetail?.firstTime && isNormal) {
setTrue()
} else {
if (isClickRef.current) return
......@@ -150,7 +156,7 @@ const Prepare = () => {
<Text className={styles.challenge_text}>开始闯关</Text>
<View className={styles.card} style={{ position: 'absolute', right: 60 }}>
<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>
{stageDetail?.firstTime && <View className={styles.tip}>
<Text className={styles.tip_text}>首次免答题卡</Text>
......@@ -219,10 +225,12 @@ const Prepare = () => {
image={classNames(!hasNextBtn ? styles.image : styles.long_image)}
hoverImage={classNames(!hasNextBtn ? styles.hover_image : styles.long_hover_image)}
>
{isNormal && (
<View className={styles.card} style={{ marginRight: 12 }}>
<Image className={styles.card_icon} src={require('@/pages/main/assets/ph.png')} />
<Text className={styles.card_text}>-1</Text>
</View>
)}
<Text className={styles.challenge_text}>再次提升</Text>
</Button>
</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