|
@@ -131,7 +131,8 @@ export default {
|
|
|
couponInfo: {}, // 优惠券相关
|
|
|
goodsCarouselPictures: [], // 商品轮播图
|
|
|
goodsDetailPictures: [], // 商品详情图片
|
|
|
- copyPopup: false // 淘口令复制提示
|
|
|
+ copyPopup: false, // 淘口令复制提示
|
|
|
+ isFetchLock: false // 是否调用过分享配置
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -154,7 +155,6 @@ export default {
|
|
|
try {
|
|
|
const { status, data, msg } = await apiGoodsDetail(this.source, this.goodsId)
|
|
|
if (status) {
|
|
|
- let coverImg = ''
|
|
|
this.goodsInfo = data
|
|
|
this.couponInfo = data.coupon_info
|
|
|
if (Array.isArray(data.goods_carousel_pictures)) {
|
|
@@ -163,22 +163,28 @@ export default {
|
|
|
if (Array.isArray(data.goods_detail_pictures)) {
|
|
|
this.goodsDetailPictures = data.goods_detail_pictures
|
|
|
}
|
|
|
- if (this.goodsCarouselPictures.length) {
|
|
|
- coverImg = this.goodsCarouselPictures[0]
|
|
|
- } else if (this.goodsDetailPictures.length) {
|
|
|
- coverImg = this.goodsDetailPictures[0]
|
|
|
- }
|
|
|
- platform.isWeixin && funWxShare('返不停', data.goods_name, coverImg, data.url)
|
|
|
} else {
|
|
|
Toast(msg)
|
|
|
}
|
|
|
} catch (e) {}
|
|
|
},
|
|
|
showShareTip () {
|
|
|
- if (!(Object.keys(this.goodsInfo).length)) {
|
|
|
+ const id = this.$store.getters['common/userinfo'].id
|
|
|
+ let coverImg = ''
|
|
|
+ if (!(Object.keys(this.goodsInfo).length) || id === '') {
|
|
|
Toast('数据加载中,稍后重试')
|
|
|
return
|
|
|
}
|
|
|
+ if (this.goodsCarouselPictures.length) {
|
|
|
+ coverImg = this.goodsCarouselPictures[0]
|
|
|
+ } else if (this.goodsDetailPictures.length) {
|
|
|
+ coverImg = this.goodsDetailPictures[0]
|
|
|
+ }
|
|
|
+ // 处理用户ID未获取成功的场景
|
|
|
+ if (!this.isFetchLock) {
|
|
|
+ platform.isWeixin && funWxShare('返不停', this.goodsInfo.goods_name, coverImg, this.source === 'taobao' ? `${location.origin}/tbLandingPage/${id}/${this.goodsId}` : this.goodsInfo.url)
|
|
|
+ this.isFetchLock = true
|
|
|
+ }
|
|
|
this.$refs.fbtShareTipInWechat.init()
|
|
|
},
|
|
|
jumpShops () {
|