|
@@ -105,7 +105,17 @@ export default {
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
|
this.mascotIcon = this.mascotList[Math.floor(Math.random() * 2)].icon
|
|
this.mascotIcon = this.mascotList[Math.floor(Math.random() * 2)].icon
|
|
|
this.mascotName = this.mascotList[Math.floor(Math.random() * 2)].name
|
|
this.mascotName = this.mascotList[Math.floor(Math.random() * 2)].name
|
|
|
- if (options && options.id) { this.articleId = options.id; this.loadDetail(options.id) }
|
|
|
|
|
|
|
+ var aid = ''
|
|
|
|
|
+ if (options && options.id) {
|
|
|
|
|
+ aid = options.id
|
|
|
|
|
+ } else if (options && options.scene) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ var sceneDecoded = decodeURIComponent(options.scene)
|
|
|
|
|
+ var idMatch = sceneDecoded.match(/id=(\d+)/)
|
|
|
|
|
+ if (idMatch && idMatch[1]) aid = idMatch[1]
|
|
|
|
|
+ } catch (e) {}
|
|
|
|
|
+ }
|
|
|
|
|
+ if (aid) { this.articleId = aid; this.loadDetail(aid) }
|
|
|
else { this.error = true; this.errorMsg = '参数错误'; this.loading = false }
|
|
else { this.error = true; this.errorMsg = '参数错误'; this.loading = false }
|
|
|
},
|
|
},
|
|
|
onShow() { if (this.article && !this.error) this.startNewReadingSession() },
|
|
onShow() { if (this.article && !this.error) this.startNewReadingSession() },
|