|
@@ -105,6 +105,10 @@ 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
|
|
|
|
|
+ // 兼容旧分享链接:inviteCode 参数(shareMixin onLoad 也会处理,此处显式兜底)
|
|
|
|
|
+ if (options && options.inviteCode) {
|
|
|
|
|
+ this.autoBindInviteCode(options.inviteCode)
|
|
|
|
|
+ }
|
|
|
var aid = ''
|
|
var aid = ''
|
|
|
if (options && options.id) {
|
|
if (options && options.id) {
|
|
|
aid = options.id
|
|
aid = options.id
|
|
@@ -113,6 +117,8 @@ export default {
|
|
|
var sceneDecoded = decodeURIComponent(options.scene)
|
|
var sceneDecoded = decodeURIComponent(options.scene)
|
|
|
var idMatch = sceneDecoded.match(/id=(\d+)/)
|
|
var idMatch = sceneDecoded.match(/id=(\d+)/)
|
|
|
if (idMatch && idMatch[1]) aid = idMatch[1]
|
|
if (idMatch && idMatch[1]) aid = idMatch[1]
|
|
|
|
|
+ var refMatch = sceneDecoded.match(/ref=([^&]+)/)
|
|
|
|
|
+ if (refMatch && refMatch[1]) this.autoBindInviteCode(refMatch[1])
|
|
|
} catch (e) {}
|
|
} catch (e) {}
|
|
|
}
|
|
}
|
|
|
if (aid) { this.articleId = aid; this.loadDetail(aid) }
|
|
if (aid) { this.articleId = aid; this.loadDetail(aid) }
|
|
@@ -219,7 +225,14 @@ export default {
|
|
|
if (!this.articleId) return
|
|
if (!this.articleId) return
|
|
|
uni.showLoading({ title: '生成海报中...' })
|
|
uni.showLoading({ title: '生成海报中...' })
|
|
|
try {
|
|
try {
|
|
|
- var res = await getShareQrCode('pages/article-center/article-detail', 'id=' + this.articleId)
|
|
|
|
|
|
|
+ if (!this.referralCode) {
|
|
|
|
|
+ await this.loadReferralCode()
|
|
|
|
|
+ }
|
|
|
|
|
+ var scene = 'id=' + this.articleId + (this.referralCode ? '&ref=' + this.referralCode : '')
|
|
|
|
|
+ if (scene.length > 32) {
|
|
|
|
|
+ scene = scene.substring(0, 32)
|
|
|
|
|
+ }
|
|
|
|
|
+ var res = await getShareQrCode('pages/article-center/article-detail', scene)
|
|
|
if (res && res.data) {
|
|
if (res && res.data) {
|
|
|
this.posterQrCode = res.data.qrCodeBase64 || ''
|
|
this.posterQrCode = res.data.qrCodeBase64 || ''
|
|
|
this.posterDimension = this.getMainDimension()
|
|
this.posterDimension = this.getMainDimension()
|