Commit 9e5f0f18 authored by hewenhao's avatar hewenhao

Feature/2023 06 12 v1.1

parent f6055f3d
......@@ -18,3 +18,4 @@ _testing
/gen-mini-qr.js
.prettierrc
.vscode
/hue.sql
{
"banner.png": {
"u": "https://cdn.jkwljy.com/passing-stage/3Rvm4hGGicy67vyZAV1WebSRh2KT/690x180",
"w": 690,
"h": 180,
"ossName": "/passing-stage/3Rvm4hGGicy67vyZAV1WebSRh2KT/690x180"
},
"go.png": {
"u": "https://cdn.jkwljy.com/passing-stage/3xjcJGxa7kkAQk4nXdZkJ2K1xos2/120x120",
"w": 120,
"h": 120,
"ossName": "/passing-stage/3xjcJGxa7kkAQk4nXdZkJ2K1xos2/120x120"
},
"guide.png": {
"u": "https://cdn.jkwljy.com/passing-stage/dB5mPgn1oNkX2NfAPf1UkPPBACb/520x204",
"w": 520,
"h": 204,
"ossName": "/passing-stage/dB5mPgn1oNkX2NfAPf1UkPPBACb/520x204"
},
"download.png": {
"u": "https://cdn.jkwljy.com/passing-stage/3e3wCmnn2uzpFE28ULKVFBo8R1Zt/60x60",
"w": 60,
"h": 60,
"ossName": "/passing-stage/3e3wCmnn2uzpFE28ULKVFBo8R1Zt/60x60"
},
"loading.gif": {
"u": "https://cdn.jkwljy.com/passing-stage/L9YkRy6y6FfxN2c1vhdtTKMiy5r/300x300",
"w": 300,
"h": 300,
"ossName": "/passing-stage/L9YkRy6y6FfxN2c1vhdtTKMiy5r/300x300"
}
}
{
"name": "learn-math-weapp",
"version": "1.1.2",
"version": "1.1.4",
"private": true,
"description": "",
"scripts": {
......
......@@ -166,13 +166,17 @@ function getFileName (relativePath, absolutPath, dimensions) {
.update(fs.readFileSync(absolutPath, { encoding: 'binary' }))
.digest()
const key = bs58.encode(buffer)
let prefix = '/pk-math'
if (subFolder === '_passing-stage') {
prefix = '/passing-stage'
}
if (dimensions) {
return `/pk-math/${key}/${dimensions.width}x${dimensions.height}`
return `${prefix}/${key}/${dimensions.width}x${dimensions.height}`
}
const dot = absolutPath.lastIndexOf('.')
if (dot < -1) {
throw Error('File name is not right!')
}
const suffix = absolutPath.substr(dot + 1)
return `/pk-math/${key}.${suffix}`
return `${prefix}/${key}.${suffix}`
}
/* eslint-disable quotes */
/* eslint-disable quote-props */
export default {
"banner.png": {
"u": "https://cdn.jkwljy.com/passing-stage/3Rvm4hGGicy67vyZAV1WebSRh2KT/690x180",
"w": 690,
"h": 180
},
"go.png": {
"u": "https://cdn.jkwljy.com/passing-stage/3xjcJGxa7kkAQk4nXdZkJ2K1xos2/120x120",
"w": 120,
"h": 120
},
"guide.png": {
"u": "https://cdn.jkwljy.com/passing-stage/dB5mPgn1oNkX2NfAPf1UkPPBACb/520x204",
"w": 520,
"h": 204
},
"download.png": {
"u": "https://cdn.jkwljy.com/passing-stage/3e3wCmnn2uzpFE28ULKVFBo8R1Zt/60x60",
"w": 60,
"h": 60
},
"loading.gif": {
"u": "https://cdn.jkwljy.com/passing-stage/L9YkRy6y6FfxN2c1vhdtTKMiy5r/300x300",
"w": 300,
"h": 300
}
} as const
......@@ -23,6 +23,7 @@ const Battles = () => {
const getSetting = useStoreActions((state) => state.userModel.getSetting)
const setting = useStoreState((state) => state.userModel.setting)
const stageList = useStoreState(state => state.mainModel.stageList)
const updateMainState = useStoreActions(actions => actions.mainModel.updateState)
const hasPassed = useMemo(() => {
return stageList.findIndex(c => c.status === StageStatus.PASSED && c.type !== StageType.Special) !== -1
......@@ -34,6 +35,7 @@ const Battles = () => {
const handleClick = () => {
addPkGuideTimes()
updateMainState({ isCreatePkShow: false })
navigateBack()
}
......
......@@ -120,7 +120,7 @@ const gameModel: GameModel = {
const answers = state.questionList[state.currentQuestionIndex]?.answers
const val = answers?.[index]
if (answers && val) {
val.userAnswer = `${val.userAnswer === '0' ? '' : (val.userAnswer || '')}${detail}`
val.userAnswer = `${val.userAnswer === '0' && detail !== '.' ? '' : (val.userAnswer || '')}${detail}`
const maxLen = answers.length
state.questionList = state.questionList.slice()
if (answers.length > 1 && index < maxLen - 1) {
......
......@@ -70,7 +70,7 @@ const guideModel: GuideModel = {
pkGuideStep: 0,
activePkGuideFromHis: false,
showPkGuideFromHis: false,
pkGuideTimes: getStorage(StorageKeys.pkGuideTimes),
pkGuideTimes: getStorage(StorageKeys.pkGuideTimes) ?? 0,
isAddDeskTopGuideComplete: getStorage(StorageKeys.isAddDeskTopGuideComplete),
isStoreGuideComplete: getStorage(StorageKeys.isStoreGuideComplete),
......@@ -84,19 +84,18 @@ const guideModel: GuideModel = {
}),
addPkGuideTimes: action((state) => {
let next
let nextVal = 1
if (state.pkGuideTimes) {
/** 只显示3次pk历史pk引导 */
if (state.pkGuideTimes >= 8) {
return
}
next = (+state.pkGuideTimes) + 1
} else {
next = 1
nextVal = (+state.pkGuideTimes) + 1
}
state.pkGuideTimes = next
state.pkGuideTimes = nextVal
state.showPkGuideFromHis = true
updateStorage(StorageKeys.pkGuideTimes, next)
updateStorage(StorageKeys.pkGuideTimes, nextVal)
}),
updatePkGuideActive: action((state, payload) => {
......
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