Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
lls_program
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2026-05-20 18:09:16 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c15c89445b3abc88856d8b3be4cb8146ea57bdc6
c15c8944
1 parent
c5743d40
fix: 扫码打卡详情页兼容 scene 参数入口
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
3 deletions
src/pages/ScanCheckinDetail/index.vue
src/utils/scanCheckin.js
src/pages/ScanCheckinDetail/index.vue
View file @
c15c894
...
...
@@ -59,7 +59,7 @@ import { getCurrentPageFullPath } from '@/utils/authRedirect'
import { getMyFamiliesAPI } from '@/api/family'
import { getScanStageDetailAPI, submitScanCheckinAPI } from '@/api/map'
import { verifyCheckinRangeWithCurrentLocation } from '@/utils/checkinLocation'
import { parseScanCheckinParams } from '@/utils/scanCheckin'
import { parseScanCheckinParams
, parseScanCheckinSceneParams
} from '@/utils/scanCheckin'
const defaultCover =
'https://cdn.ipadbiz.cn/lls_prog/images/check_detail_img.png?imageMogr2/strip/quality/60'
...
...
@@ -276,8 +276,10 @@ const applyStageDetail = stageDetail => {
}
useLoad(options => {
detail.activityId = options.activityId || options.activity_id || ''
const detailId = options.detailId || options.id || ''
const sceneParams = parseScanCheckinSceneParams(options.scene || '')
detail.activityId = sceneParams.activityId || options.activityId || options.activity_id || ''
const detailId = sceneParams.detailId || options.detailId || options.id || ''
detail.regSource = options.reg_source || ''
detail.regStageId = options.reg_stage_id || ''
// 当前页路径会透传给补资料页,提交成功后用于回跳续扫。
...
...
src/utils/scanCheckin.js
View file @
c15c894
/**
* @description 解析小程序码进入扫码打卡详情页时的 scene 参数
* @param {string} rawScene - scene 原始值,兼容 `detailId,activityId` 和 querystring 两种格式
* @returns {{activityId:string, detailId:string, rawScene:string}}
*/
export
const
parseScanCheckinSceneParams
=
(
rawScene
=
''
)
=>
{
const
normalizedScene
=
safeDecodeURIComponent
(
String
(
rawScene
||
''
).
trim
())
if
(
!
normalizedScene
)
{
return
{
activityId
:
''
,
detailId
:
''
,
rawScene
:
''
,
}
}
if
(
!
normalizedScene
.
includes
(
'='
)
&&
normalizedScene
.
includes
(
','
))
{
const
[
detailId
=
''
,
activityId
=
''
]
=
normalizedScene
.
split
(
','
).
map
(
item
=>
item
.
trim
())
return
{
activityId
,
detailId
,
rawScene
:
normalizedScene
,
}
}
const
rawParams
=
parseQueryString
(
normalizedScene
)
return
{
activityId
:
pickFirstAvailableValue
(
rawParams
,
[
'activity_id'
,
'activityId'
,
'id'
]),
detailId
:
pickFirstAvailableValue
(
rawParams
,
[
'detail_id'
,
'detailId'
,
'stage_id'
,
'stageId'
]),
rawScene
:
normalizedScene
,
}
}
/**
* @description 从扫码结果中提取打卡接口所需参数
* @param {string} rawScanResult - 微信扫码返回的原始结果,可能是完整URL,也可能是纯查询串
* @returns {{activityId:string, detailId:string, rawParams:Object}}
...
...
Please
register
or
login
to post a comment