Commit b0e175db authored by Damon's avatar Damon

fix: 【ID1001428】【小程序-题库-模拟考试】:第一次进入分享后的成绩页面时报错,提示“传入的ID与预期的不符···”

parent c4e5825e
...@@ -97,6 +97,7 @@ export default { ...@@ -97,6 +97,7 @@ export default {
}, },
data() { data() {
return { return {
id: '',
info: {}, info: {},
show: false, show: false,
} }
...@@ -172,22 +173,35 @@ export default { ...@@ -172,22 +173,35 @@ export default {
return this.$u.random(random[0], random[1]) return this.$u.random(random[0], random[1])
}, },
}, },
onLoad() { onShareAppMessage(res) {
let options = wx.getLaunchOptionsSync() return {
if (!options.query?.id) { title: '模考大师',
path: `/pages/learn/score?id=${this.id}`
}
},
onLoad(options) {
if (options) {
this.id = options.id
} else {
let option = wx.getLaunchOptionsSync()
this.id = option.query.id
}
if (!this.id) {
this.$u.route({ this.$u.route({
url: 'pages/index/index', url: 'pages/index/index',
type: 'tab', type: 'tab',
}) })
return
} }
this.init(options.query?.id) this.init()
}, },
methods: { methods: {
init(id) { init() {
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
}) })
this.$u.api.queryExamRecordOne({ id: id }).then((res) => { this.$u.api.queryExamRecordOne({ id: this.id }).then((res) => {
uni.hideLoading() uni.hideLoading()
if (res) { if (res) {
const echoMap = res.echoMap const echoMap = res.echoMap
......
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