Commit fa11ce92 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 9121ee6d b6efbee3
...@@ -306,6 +306,9 @@ ...@@ -306,6 +306,9 @@
"心善的", "心善的",
"谦虚的", "谦虚的",
"低调的", "低调的",
"疯狂的",
"狂野的",
"奔放的",
"好客的", "好客的",
"热心的", "热心的",
"敬业的", "敬业的",
......
{ {
"name": "learn-math-weapp", "name": "learn-math-weapp",
"version": "1.0.5", "version": "1.0.6",
"private": true, "private": true,
"description": "", "description": "",
"scripts": { "scripts": {
......
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
z-index: 9999998; z-index: 9999998;
opacity: 1; opacity: 1;
box-shadow: rgba(0,0,0, .6) 0px 0px 0px 5000PX; box-shadow: rgba(0,0,0, .6) 0px 0px 0px 5000PX;
animation-name: fadeIn_2;
animation-duration: .5s;
animation-timing-function: ease-out;
animation-iteration-count: 1;
animation-fill-mode: backwards;
animation-delay: 0s;
} }
.content { .content {
...@@ -17,4 +23,19 @@ ...@@ -17,4 +23,19 @@
top: 0; top: 0;
bottom: 0; bottom: 0;
z-index: 9999997; z-index: 9999997;
animation-name: fadeIn_2;
animation-duration: .5s;
animation-timing-function: ease-out;
animation-iteration-count: 1;
animation-fill-mode: backwards;
animation-delay: 0s;
}
@keyframes fadeIn_2 {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
} }
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
top: -16px; top: -16px;
bottom: -16px; bottom: -16px;
pointer-events: none; pointer-events: none;
border: 4px dashed #fff; border: 8px dashed #fff;
border-radius: 58px; border-radius: 58px;
} }
} }
......
...@@ -217,12 +217,12 @@ const GameCompleteHead = () => { ...@@ -217,12 +217,12 @@ const GameCompleteHead = () => {
<View className={styles.guide}> <View className={styles.guide}>
<View className={styles.guide_inner}> <View className={styles.guide_inner}>
<Image src={tutorialAssets['cat.png'].u} className={styles.guide_icon}></Image> <Image src={tutorialAssets['cat.png'].u} className={styles.guide_icon}></Image>
<View className={styles.guide_modal}> <View className={styles.guide_modal} onClick={completeGuide}>
<View> <View>
点击此处,可以查看<Text className={styles.em}>本次闯关的错题</Text>哦~ 点击此处,可以查看<Text className={styles.em}>本次闯关的错题</Text>哦~
</View> </View>
<View className={styles.continue}> <View className={styles.continue}>
<View className={styles.continue_btn} onClick={completeGuide}> <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} />
</View> </View>
</View> </View>
......
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
top: -16px; top: -16px;
bottom: -16px; bottom: -16px;
pointer-events: none; pointer-events: none;
border: 4px dashed #fff; border: 8px dashed #fff;
border-radius: 32px; border-radius: 32px;
} }
} }
......
...@@ -89,10 +89,10 @@ const Creator = ({ onClick }: { onClick: () => void }) => { ...@@ -89,10 +89,10 @@ const Creator = ({ onClick }: { onClick: () => void }) => {
guideContent={( guideContent={(
<View className={styles.guide_content}> <View className={styles.guide_content}>
<Image src={tutorialAssets['cat-2.png'].u} className={styles.guide_cat} /> <Image src={tutorialAssets['cat-2.png'].u} className={styles.guide_cat} />
<View className={classNames(styles.dialog, item.guideModalLow && styles.is_lower)}> <View className={classNames(styles.dialog, item.guideModalLow && styles.is_lower)} onClick={() => nextGroupGuide()}>
{item.guideTips} {item.guideTips}
<View className={styles.continue}> <View className={styles.continue}>
<View className={styles.continue_btn} onClick={() => nextGroupGuide()}> <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} />
</View> </View>
</View> </View>
......
...@@ -7,8 +7,15 @@ ...@@ -7,8 +7,15 @@
background: rgba(0, 0, 0, 0.7); background: rgba(0, 0, 0, 0.7);
z-index: 99999; z-index: 99999;
opacity: 1; opacity: 1;
animation-name: fadeIn_2;
animation-duration: .5s;
animation-timing-function: ease-out;
animation-iteration-count: 1;
animation-fill-mode: backwards;
animation-delay: 0s;
} }
.result_wrap { .result_wrap {
position: fixed; position: fixed;
z-index: 100000; z-index: 100000;
...@@ -17,6 +24,12 @@ ...@@ -17,6 +24,12 @@
right: 0; right: 0;
display: flex; display: flex;
padding: 0 16px; padding: 0 16px;
animation-name: fadeIn_2;
animation-duration: .5s;
animation-timing-function: ease-out;
animation-iteration-count: 1;
animation-fill-mode: backwards;
animation-delay: 0s;
} }
.slogen { .slogen {
...@@ -97,3 +110,12 @@ ...@@ -97,3 +110,12 @@
display: block; display: block;
margin-left: 4px; margin-left: 4px;
} }
@keyframes fadeIn_2 {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
...@@ -30,7 +30,7 @@ const GuideModal = () => { ...@@ -30,7 +30,7 @@ const GuideModal = () => {
<View>部落PK大赛</View> <View>部落PK大赛</View>
</View> </View>
</View> </View>
<View className={classNames(styles.dialog)}> <View className={classNames(styles.dialog)} onClick={() => completeGroupGuide()}>
<View> <View>
让我们先从基本功开始。已经为你准备好了打好基本功所必须掌握的 让我们先从基本功开始。已经为你准备好了打好基本功所必须掌握的
<Text className={styles.em}>计算达标</Text>、 <Text className={styles.em}>计算达标</Text>、
...@@ -38,7 +38,7 @@ const GuideModal = () => { ...@@ -38,7 +38,7 @@ const GuideModal = () => {
以及<Text className={styles.em}>附加思维题</Text>哦。 以及<Text className={styles.em}>附加思维题</Text>哦。
</View> </View>
<View className={styles.continue}> <View className={styles.continue}>
<View className={styles.continue_btn} onClick={() => completeGroupGuide()}> <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} />
</View> </View>
</View> </View>
......
...@@ -32,10 +32,10 @@ const MainPage = () => { ...@@ -32,10 +32,10 @@ const MainPage = () => {
const point = useStoreState(state => state.userModel.point) const point = useStoreState(state => state.userModel.point)
const isGroupGuideComplete = useStoreState(state => state.guideModel.isGroupGuideComplete) const isGroupGuideComplete = useStoreState(state => state.guideModel.isGroupGuideComplete)
const isMainGuideComplete = useStoreState(state => state.guideModel.isMainGuideComplete) const isMainGuideComplete = useStoreState(state => state.guideModel.isMainGuideComplete)
const isStoreGuideComplete = useStoreState(state => state.guideModel.isStoreGuideComplete)
const fetchAccount = useStoreActions(actions => actions.userModel.fetchAccount) const fetchAccount = useStoreActions(actions => actions.userModel.fetchAccount)
const updateGroupGuideActive = useStoreActions(actions => actions.guideModel.updateGroupGuideActive) const updateGroupGuideActive = useStoreActions(actions => actions.guideModel.updateGroupGuideActive)
const fetchTribeInfo = useStoreActions(actions => actions.groupModel.fetchTribeInfo) const fetchTribeInfo = useStoreActions(actions => actions.groupModel.fetchTribeInfo)
const userInfo = useStoreState(state => state.userModel.userInfo)
const nav = useMemo(getMenuButtonBoundingClientRect, []) const nav = useMemo(getMenuButtonBoundingClientRect, [])
...@@ -48,12 +48,21 @@ const MainPage = () => { ...@@ -48,12 +48,21 @@ const MainPage = () => {
}) })
}, []) }, [])
const isFocus = useFocus()
// 激活部落引导
useEffect(() => { useEffect(() => {
if (isGroupGuideComplete || !isMainGuideComplete || !isStoreGuideComplete) { const fn = async () => {
if (
!isFocus ||
isGroupGuideComplete ||
userInfo.pointReceive === 'N' ||
!userInfo.city ||
!userInfo.grade
) {
return return
} }
const fn = async () => {
const currentIndex = stageList.findIndex(c => c.status === StageStatus.CURRENT) const currentIndex = stageList.findIndex(c => c.status === StageStatus.CURRENT)
if (point < 50 || currentIndex >= 3) { if (point < 50 || currentIndex >= 3) {
...@@ -64,20 +73,12 @@ const MainPage = () => { ...@@ -64,20 +73,12 @@ const MainPage = () => {
} }
} }
fn() fn()
}, [point, isGroupGuideComplete, stageList, updateGroupGuideActive, fetchTribeInfo, isMainGuideComplete, isStoreGuideComplete]) }, [point, isGroupGuideComplete, stageList, updateGroupGuideActive, userInfo, fetchTribeInfo, isMainGuideComplete, isFocus])
const isFocus = useFocus()
onAppHide(() => { onAppHide(() => {
player.pause() player.pause()
}) })
useEffect(() => {
if (isFocus) {
fetchTribeInfo()
}
}, [isFocus, fetchTribeInfo])
useEffect(() => { useEffect(() => {
if (isFocus) { if (isFocus) {
player.play() player.play()
...@@ -85,7 +86,7 @@ const MainPage = () => { ...@@ -85,7 +86,7 @@ const MainPage = () => {
}, [player, isFocus]) }, [player, isFocus])
useEffect(() => { useEffect(() => {
if (isFocus) { if (isFocus && userInfo.city) {
fetchAccount() fetchAccount()
const tabbar = getTabBar<TabbarRef>(page) const tabbar = getTabBar<TabbarRef>(page)
...@@ -112,7 +113,7 @@ const MainPage = () => { ...@@ -112,7 +113,7 @@ const MainPage = () => {
}, 200) }, 200)
}) })
} }
}, [isFocus, fetchAccount, fetchStage, page, scrollToCurrent, updateReady]) }, [isFocus, fetchAccount, fetchStage, page, scrollToCurrent, updateReady, userInfo.city])
return ( return (
<> <>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
top: -16px; top: -16px;
bottom: -16px; bottom: -16px;
pointer-events: none; pointer-events: none;
border: 4px dashed #fff; border: 8px dashed #fff;
border-radius: 50%; border-radius: 50%;
} }
} }
......
...@@ -103,6 +103,8 @@ const getIconClassNames = (type?: StageType, extra: string[] = []) => { ...@@ -103,6 +103,8 @@ const getIconClassNames = (type?: StageType, extra: string[] = []) => {
return classNames(styles.icon, type === StageType.OneStop && styles.isOneStop, ...extra) return classNames(styles.icon, type === StageType.OneStop && styles.isOneStop, ...extra)
} }
const isProduction = process.env.SERVER_ENDPOINT === 'https://geek.jkwljy.com'
const StageComp = (props: StageProps) => { const StageComp = (props: StageProps) => {
const { stage } = props const { stage } = props
const updateState = useStoreActions(actions => actions.gameModel.updateState) const updateState = useStoreActions(actions => actions.gameModel.updateState)
...@@ -112,7 +114,7 @@ const StageComp = (props: StageProps) => { ...@@ -112,7 +114,7 @@ const StageComp = (props: StageProps) => {
const mainGuideActive = useStoreState(state => state.guideModel.mainGuideActive) const mainGuideActive = useStoreState(state => state.guideModel.mainGuideActive)
const handleClick = () => { const handleClick = () => {
if (stage.status !== StageStatus.DISABLED) { if (stage.status !== StageStatus.DISABLED || !isProduction) {
/** 从首页进入更新状态 */ /** 从首页进入更新状态 */
updateState({ isSubmit: false }) updateState({ isSubmit: false })
navigateTo({ url: `/pages/prepare/index?id=${stage.id}` }) navigateTo({ url: `/pages/prepare/index?id=${stage.id}` })
...@@ -185,7 +187,7 @@ const StageComp = (props: StageProps) => { ...@@ -185,7 +187,7 @@ const StageComp = (props: StageProps) => {
onClick={handleClick} onClick={handleClick}
> >
{renderRound(isReady)} {renderRound(isReady)}
<View className={styles.roundName}>{stage.name}</View> <View className={styles.roundName}>{!isProduction ? `${stage.id}.` : ''}{stage.name}</View>
</View> </View>
) )
} }
......
import { useState, useCallback, useEffect } from 'react' import { useState, useCallback, useEffect, useRef } from 'react'
import { getAreaAndGrades, type AreaAndGrades } from '@/api' import { getAreaAndGrades, type AreaAndGrades, StageStatus } from '@/api'
import { useStoreState, useStoreActions } from '@/store/hooks' import { useStoreState, useStoreActions } from '@/store/hooks'
import { useFocus } from '@/hooks' import { useFocus } from '@/hooks'
import ModalArea from './modal-area' import ModalArea from './modal-area'
...@@ -22,11 +22,13 @@ const Tutorial = () => { ...@@ -22,11 +22,13 @@ const Tutorial = () => {
const groupGuideActive = useStoreState(state => state.guideModel.groupGuideActive) const groupGuideActive = useStoreState(state => state.guideModel.groupGuideActive)
const groupGuideStep = useStoreState(state => state.guideModel.groupGuideStep) const groupGuideStep = useStoreState(state => state.guideModel.groupGuideStep)
const isGroupGuideComplete = useStoreState(state => state.guideModel.isGroupGuideComplete) const isGroupGuideComplete = useStoreState(state => state.guideModel.isGroupGuideComplete)
const stageList = useStoreState(state => state.mainModel.stageList)
const nextGroupGuide = useStoreActions(actions => actions.guideModel.nextGroupGuide) const nextGroupGuide = useStoreActions(actions => actions.guideModel.nextGroupGuide)
const [step, setStep] = useState(0) const [step, setStep] = useState(0)
const [selected, setSelected] = useState({ area: '', grade: '' }) const [selected, setSelected] = useState({ area: '', grade: '' })
const [enable, setEnable] = useState(false) const [enable, setEnable] = useState(false)
const isLoadRef = useRef(false)
const isFocus = useFocus() const isFocus = useFocus()
useEffect(() => { useEffect(() => {
...@@ -47,10 +49,11 @@ const Tutorial = () => { ...@@ -47,10 +49,11 @@ const Tutorial = () => {
const handleConfirm = useCallback(() => { const handleConfirm = useCallback(() => {
setStep(0) setStep(0)
if (!isMainGuideComplete) { const index = stageList.findIndex(c => c.status === StageStatus.CURRENT)
if (!isMainGuideComplete && index === 0) {
updateGuideActive(true) updateGuideActive(true)
} }
}, [updateGuideActive, isMainGuideComplete]) }, [updateGuideActive, isMainGuideComplete, stageList])
const loadData = useCallback(() => { const loadData = useCallback(() => {
return getAreaAndGrades() return getAreaAndGrades()
...@@ -86,6 +89,10 @@ const Tutorial = () => { ...@@ -86,6 +89,10 @@ const Tutorial = () => {
if (!data.areas.length) { if (!data.areas.length) {
loadData() loadData()
} }
if (isLoadRef.current) {
return
}
isLoadRef.current = true
// 没选择城市 // 没选择城市
if (!userInfo.city) { if (!userInfo.city) {
setStep(1) setStep(1)
...@@ -93,12 +100,14 @@ const Tutorial = () => { ...@@ -93,12 +100,14 @@ const Tutorial = () => {
setStep(2) setStep(2)
} else { } else {
setStep(0) setStep(0)
if (!isMainGuideComplete) { // 只有第一关才有
const index = stageList.findIndex(c => c.status === StageStatus.CURRENT)
if (!isMainGuideComplete && index === 0) {
updateGuideActive(true) updateGuideActive(true)
} }
} }
} }
}, [isFocus, data.areas, isMainGuideComplete, updateGuideActive, loadData, userInfo.city, userInfo.grade]) }, [isFocus, data.areas, isMainGuideComplete, updateGuideActive, loadData, userInfo.city, userInfo.grade, stageList])
if (!enable) { if (!enable) {
return null return null
...@@ -109,7 +118,7 @@ const Tutorial = () => { ...@@ -109,7 +118,7 @@ const Tutorial = () => {
{step === 1 && <ModalArea options={data.areas} onConfirm={handleConfirmArea} loading={updating} />} {step === 1 && <ModalArea options={data.areas} onConfirm={handleConfirmArea} loading={updating} />}
{step === 2 && !userInfo.grade && <ModalGrade options={data.grades} onConfirm={handleConfirmGrade} loading={updating} />} {step === 2 && !userInfo.grade && <ModalGrade options={data.grades} onConfirm={handleConfirmGrade} loading={updating} />}
{step === 3 && <ModalResult grade={selected.grade} onConfirm={handleConfirm} />} {step === 3 && <ModalResult grade={selected.grade} onConfirm={handleConfirm} />}
{groupGuideActive && !isGroupGuideComplete && groupGuideStep === 0 && <ModalGroupGuide onConfirm={nextGroupGuide} />} {step === 0 && groupGuideActive && !isGroupGuideComplete && groupGuideStep === 0 && <ModalGroupGuide onConfirm={nextGroupGuide} />}
</> </>
) )
} }
......
...@@ -16,13 +16,13 @@ const ModalGroupGuide = (props: ModalGroupGuideProps) => { ...@@ -16,13 +16,13 @@ const ModalGroupGuide = (props: ModalGroupGuideProps) => {
<View className={styles.result_wrap} catchMove> <View className={styles.result_wrap} catchMove>
<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)}> <View className={classNames(styles.dialog)} onClick={() => onConfirm()}>
<View> <View>
阿喵老师很高兴看到你在不断进步,接下来我要传授你一个 阿喵老师很高兴看到你在不断进步,接下来我要传授你一个
<Text className={styles.em}>得到大量水晶的好方法</Text>。 <Text className={styles.em}>得到大量水晶的好方法</Text>。
</View> </View>
<View className={styles.continue}> <View className={styles.continue}>
<View className={styles.continue_btn} onClick={() => onConfirm()}> <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} />
</View> </View>
</View> </View>
......
...@@ -22,7 +22,7 @@ const ModalResult = (props: ModalResultProps) => { ...@@ -22,7 +22,7 @@ const ModalResult = (props: ModalResultProps) => {
<View className={styles.result_wrap} catchMove> <View className={styles.result_wrap} catchMove>
<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)}> <View className={classNames(styles.dialog, isLevel1 && styles.is_lower)} onClick={() => onConfirm()}>
{isLevel1 {isLevel1
? ( ? (
<View> <View>
...@@ -39,7 +39,7 @@ const ModalResult = (props: ModalResultProps) => { ...@@ -39,7 +39,7 @@ const ModalResult = (props: ModalResultProps) => {
</View> </View>
)} )}
<View className={styles.continue}> <View className={styles.continue}>
<View className={styles.continue_btn} onClick={() => onConfirm()}> <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} />
</View> </View>
</View> </View>
......
...@@ -36,17 +36,19 @@ const ExchangeItem = (props: ExchangeItemProps) => { ...@@ -36,17 +36,19 @@ const ExchangeItem = (props: ExchangeItemProps) => {
}, [val]) }, [val])
useEffect(() => { useEffect(() => {
if (!visible) { if (visible) {
setTimeout(() => { if (maxValue > stepValue) {
setVal(1) setVal(1)
}, 1000) } else {
setVal(0)
} }
}, [visible]) }
}, [visible, stepValue, maxValue])
const handleAdd = useCallback(() => { const handleAdd = useCallback(() => {
const next = val + 1 const next = val + 1
if (next * stepValue > maxValue) { if (next * stepValue > maxValue) {
return showToast({ title: '学分不足~', icon: 'none' }) return showToast({ title: '水晶不足~', icon: 'none' })
} }
setVal(next) setVal(next)
}, [val, stepValue, maxValue]) }, [val, stepValue, maxValue])
...@@ -69,6 +71,8 @@ const ExchangeItem = (props: ExchangeItemProps) => { ...@@ -69,6 +71,8 @@ const ExchangeItem = (props: ExchangeItemProps) => {
}).then(() => { }).then(() => {
if (isGuideActive) { if (isGuideActive) {
nextStoreGuide(val) nextStoreGuide(val)
} else {
showToast({ title: '兑换成功', icon: 'success' })
} }
onCancel && onCancel() onCancel && onCancel()
}).catch(() => { }).catch(() => {
......
import { View, Text, Button, Input } from '@tarojs/components'
import Modal from '@/components/Modal'
import { useBoolean } from '@/hooks/use-boolean'
import CardMain from './card-main'
const MysteryBox = () => {
const [isVisible, { toggle }] = useBoolean(false)
const onClick = () => {
toggle()
}
return (
<View className="card-body">
<CardMain
title="神秘大礼"
subtitle="兑换神秘大礼,线下领取超级大礼"
extra={<Text className="card-stock">本月库存10</Text>}
onClick={toggle}
/>
<Modal isVisible={isVisible} onClose={toggle}>
<View>
<Input type="number" />
<Text>兑换礼物</Text>
<Button size="mini" onClick={onClick}>兑换</Button>
</View>
</Modal>
</View>
)
}
export default MysteryBox
...@@ -21,6 +21,7 @@ import styles from './index.module.scss' ...@@ -21,6 +21,7 @@ import styles from './index.module.scss'
type ExchangeGoods = { type ExchangeGoods = {
title?: string; title?: string;
subTitle: string; subTitle: string;
isUpComing?: boolean;
description: string; description: string;
price: number; price: number;
isGuideCard?: boolean; isGuideCard?: boolean;
...@@ -36,6 +37,7 @@ const itemList: ExchangeGoods[] = [ ...@@ -36,6 +37,7 @@ const itemList: ExchangeGoods[] = [
price: 600, price: 600,
isGuideCard: true, isGuideCard: true,
stock: null, stock: null,
isUpComing: true,
img: assets['item-1.png'].u, img: assets['item-1.png'].u,
}, },
{ {
...@@ -43,6 +45,7 @@ const itemList: ExchangeGoods[] = [ ...@@ -43,6 +45,7 @@ const itemList: ExchangeGoods[] = [
description: '让元气满满的向日葵,陪伴你一起向阳而生吧。', description: '让元气满满的向日葵,陪伴你一起向阳而生吧。',
price: 600, price: 600,
stock: null, stock: null,
isUpComing: true,
img: assets['item-2.png'].u, img: assets['item-2.png'].u,
}, },
{ {
...@@ -50,6 +53,7 @@ const itemList: ExchangeGoods[] = [ ...@@ -50,6 +53,7 @@ const itemList: ExchangeGoods[] = [
description: '播下种子,浇水施肥,收获属于你的酸甜小小西红柿。', description: '播下种子,浇水施肥,收获属于你的酸甜小小西红柿。',
price: 600, price: 600,
stock: null, stock: null,
isUpComing: true,
img: assets['item-3.png'].u, img: assets['item-3.png'].u,
}, },
{ {
...@@ -57,6 +61,7 @@ const itemList: ExchangeGoods[] = [ ...@@ -57,6 +61,7 @@ const itemList: ExchangeGoods[] = [
description: '用心拼一朵玫瑰,送给为你辛苦的妈妈。', description: '用心拼一朵玫瑰,送给为你辛苦的妈妈。',
price: 700, price: 700,
stock: null, stock: null,
isUpComing: true,
img: assets['item-4.png'].u, img: assets['item-4.png'].u,
}, },
{ {
...@@ -64,6 +69,7 @@ const itemList: ExchangeGoods[] = [ ...@@ -64,6 +69,7 @@ const itemList: ExchangeGoods[] = [
description: '自带颜料的创意绘画本,让你随地作画,随时随地开启小画家模式。', description: '自带颜料的创意绘画本,让你随地作画,随时随地开启小画家模式。',
price: 700, price: 700,
stock: null, stock: null,
isUpComing: true,
img: assets['item-5.png'].u, img: assets['item-5.png'].u,
}, },
] ]
...@@ -137,7 +143,7 @@ const StudyMarket = () => { ...@@ -137,7 +143,7 @@ const StudyMarket = () => {
const pric = item.price const pric = item.price
let disabledText = '积分不足' let disabledText = '积分不足'
let disabled = point < pric || (item.stock !== null && item.stock < 1) let disabled = point < pric || (item.stock !== null && item.stock < 1)
if (item.subTitle === '神秘大礼') { if (item.isUpComing) {
disabled = true disabled = true
if (point >= pric) { if (point >= pric) {
disabledText = '敬请期待' disabledText = '敬请期待'
...@@ -151,13 +157,13 @@ const StudyMarket = () => { ...@@ -151,13 +157,13 @@ const StudyMarket = () => {
<View className={styles.guide_content}> <View className={styles.guide_content}>
<Image src={tutorialAssets['cat-2.png'].u} className={styles.guide_cat} /> <Image src={tutorialAssets['cat-2.png'].u} className={styles.guide_cat} />
<View className={styles.guide_main}> <View className={styles.guide_main}>
<View className={classNames(styles.dialog)}> <View className={classNames(styles.dialog)} onClick={() => nextStoreGuide()}>
<View> <View>
在这里,可以兑换闯关消耗的<Text className={styles.em}>答题卡</Text>,以及 在这里,可以兑换闯关消耗的<Text className={styles.em}>答题卡</Text>,以及
<Text className={styles.em}>成长奖励</Text>哦~ <Text className={styles.em}>成长奖励</Text>哦~
</View> </View>
<View className={styles.continue}> <View className={styles.continue}>
<View className={styles.continue_btn} onClick={() => nextStoreGuide()}> <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} />
</View> </View>
</View> </View>
...@@ -171,7 +177,7 @@ const StudyMarket = () => { ...@@ -171,7 +177,7 @@ const StudyMarket = () => {
cover={item.img} cover={item.img}
stock={item.stock} stock={item.stock}
price={pric} price={pric}
disabled={disabled} disabled={(!(item.isGuideCard && isStep1Active)) && disabled}
subtitle={item.description} subtitle={item.description}
disabledText={disabledText} disabledText={disabledText}
isGuideActive={isMaskActive && storeGuideStep === 2 && index === 0} isGuideActive={isMaskActive && storeGuideStep === 2 && index === 0}
......
...@@ -29,6 +29,7 @@ export const Scene = ({ children, onClickConent }: { onClickConent: () => void, ...@@ -29,6 +29,7 @@ export const Scene = ({ children, onClickConent }: { onClickConent: () => void,
className={classNames(wrapStyles.score, showMask ? styles.bordered : null)} className={classNames(wrapStyles.score, showMask ? styles.bordered : null)}
isActive={showMask} isActive={showMask}
onClickConent={handleCompleteGuide} onClickConent={handleCompleteGuide}
onClick={onClickConent}
guideContent={( guideContent={(
<View className={styles.guide}> <View className={styles.guide}>
<Image className={styles.guideCat} src={tutorialAssets['cat-3.png'].u} /> <Image className={styles.guideCat} src={tutorialAssets['cat-3.png'].u} />
......
...@@ -121,7 +121,6 @@ const userModel: UserModel = { ...@@ -121,7 +121,6 @@ const userModel: UserModel = {
const point = list?.find(c => c.accountType === 'POINT')?.amount ?? 0 const point = list?.find(c => c.accountType === 'POINT')?.amount ?? 0
actions.updateState({ cardNum, point }) actions.updateState({ cardNum, point })
hideLoading() hideLoading()
showToast({ title: '兑换成功', icon: 'success' })
} catch (err) { } catch (err) {
hideLoading() hideLoading()
showModal({ showModal({
...@@ -129,6 +128,7 @@ const userModel: UserModel = { ...@@ -129,6 +128,7 @@ const userModel: UserModel = {
content: err.message, content: err.message,
showCancel: false showCancel: false
}) })
throw err
} }
}), }),
......
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