Feat(商品详情):增加分享朋友圈

This commit is contained in:
lifizer
2025-11-14 17:58:37 +08:00
parent bc5f60d58c
commit 19b9a26811
+37
View File
@@ -688,6 +688,43 @@ export default {
}
})
},
onShareTimeline() {
uni.updateShareMenu({
isPrivateMessage: false,
withShareTicket: false
})
const storeName = this.storeInfo.storeName
const promise = new Promise(async (resolve, reject) => {
let result = null
let query = `id=${this.id}&partnerId=${this.userInfo.uid}`
if (this.source === 'famous') {
result = await famousGoodsShareImage(this.id)
}
if (this.source === 'kill') {
result = await secKillGoodsShareImage(this.activityId)
query += `&activityId=${this.activityId}`
}
if (result && result.status === 200) {
resolve({
title: storeName,
query,
imageUrl: result.data
})
} else {
resolve({
title: storeName,
query,
imageUrl: this.storeInfo.image
})
}
})
return {
title: storeName,
query: `id=${this.id}&partnerId=${this.userInfo.uid}`,
imageUrl: this.storeInfo.image,
promise
}
},
onLoad(options) {
// test data
console.log("getLaunchOptionsSync", uni.getLaunchOptionsSync())