|
|
|
@ -25,7 +25,8 @@ |
|
|
|
|
<navigator :url="'/pages/goods_details/index?id='+store_info.id" hover-class="none" class="label"><text class="span">查看商品</text></navigator> |
|
|
|
|
</view> |
|
|
|
|
<!-- #ifdef H5 --> |
|
|
|
|
<button class="bnt bg-color" hover-class='none' @click="listenerActionSheet" v-if="this.$wechat.isWeixin()">和好友一起分享</button> |
|
|
|
|
<!-- <button class="bnt bg-color" hover-class='none' @click="listenerActionSheet" v-if="this.$wechat.isWeixin()">和好友一起分享</button> --> |
|
|
|
|
<button class="bnt bg-color" hover-class='none' @click="listenerActionSheet">和好友一起分享</button> |
|
|
|
|
<!-- #endif --> |
|
|
|
|
<!-- #ifdef MP --> |
|
|
|
|
<button class="bnt bg-color" open-type="share" hover-class='none'>和好友一起分享</button> |
|
|
|
@ -51,6 +52,7 @@ |
|
|
|
|
import { |
|
|
|
|
getArticleDetails,shareArticle |
|
|
|
|
} from '@/api/api.js'; |
|
|
|
|
import { getCheck } from '@/api/user.js'; |
|
|
|
|
import shareInfo from '@/components/shareInfo'; |
|
|
|
|
import home from '@/components/home'; |
|
|
|
|
import authorize from '@/components/Authorize'; |
|
|
|
@ -73,8 +75,10 @@ |
|
|
|
|
tagStyle: { |
|
|
|
|
img: 'width:100%;display:block;' |
|
|
|
|
}, |
|
|
|
|
type:'', |
|
|
|
|
isAuto: false, //没有授权的不会自动授权 |
|
|
|
|
isShowAuth: false, //是否隐藏授权 |
|
|
|
|
realInfo:{}, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed:{ |
|
|
|
@ -84,6 +88,7 @@ |
|
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
|
*/ |
|
|
|
|
onLoad: function(options) { |
|
|
|
|
this.getCheck(); |
|
|
|
|
if (options.hasOwnProperty('id')) { |
|
|
|
|
this.id = options.id; |
|
|
|
|
} else { |
|
|
|
@ -101,6 +106,23 @@ |
|
|
|
|
this.getArticleOne(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getCheck:function(){ |
|
|
|
|
let that = this; |
|
|
|
|
getCheck().then(res =>{ |
|
|
|
|
that.$set(that, 'realInfo', res.data); |
|
|
|
|
if(that.realInfo.real_name.length == 0 || that.realInfo.card.length == 0 || that.realInfo.age.length == 0 || that.realInfo.spread_phone.length == 0){ |
|
|
|
|
that.$util.Tips({ |
|
|
|
|
title: '请补全身份信息', |
|
|
|
|
icon: 'error' |
|
|
|
|
}); |
|
|
|
|
setTimeout(function(){ |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '/pages/users/user_modify_mes/index' |
|
|
|
|
}); |
|
|
|
|
},500) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getArticleOne: function() { |
|
|
|
|
let that = this; |
|
|
|
|
if (that.isLogin === false) { |
|
|
|
@ -135,19 +157,24 @@ |
|
|
|
|
}, |
|
|
|
|
listenerActionSheet() { |
|
|
|
|
let that = this; |
|
|
|
|
that.getCheck(); |
|
|
|
|
that.shareInfoStatus = true |
|
|
|
|
if(that.articleInfo.articleCategory.title === '视频'){ |
|
|
|
|
that.type = '3' |
|
|
|
|
}else if(that.articleInfo.articleCategory.title === '推文'){ |
|
|
|
|
that.type = '4' |
|
|
|
|
} |
|
|
|
|
// 在这里调用 shareArticle 方法 |
|
|
|
|
shareArticle(3,that.articleInfo.id).then(res =>{ |
|
|
|
|
shareArticle(that.type).then(res =>{ |
|
|
|
|
that.$util.Tips({ |
|
|
|
|
title:res.message |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
.catch(res=>{ |
|
|
|
|
.catch(err=>{ |
|
|
|
|
that.$util.Tips({ |
|
|
|
|
title: res.message |
|
|
|
|
title: err |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
// alert('test'); |
|
|
|
|
}, |
|
|
|
|
setShareInfoStatus() { |
|
|
|
|
this.shareInfoStatus = false |
|
|
|
@ -162,18 +189,18 @@ |
|
|
|
|
success: function() { |
|
|
|
|
// 在这里调用 shareArticle 方法 |
|
|
|
|
// this.shareArticle(this.articleInfo.id); |
|
|
|
|
conso.log('test'); |
|
|
|
|
// conso.log('test'); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
this.$wechat.wechatEvevt([ |
|
|
|
|
"updateAppMessageShareData", |
|
|
|
|
"updateTimelineShareData" |
|
|
|
|
], configAppMessage).then(res => { |
|
|
|
|
this.shareArticle(this.articleInfo.id); |
|
|
|
|
console.log('test shareArticle'); |
|
|
|
|
// this.shareArticle(this.articleInfo.id); |
|
|
|
|
// console.log('test shareArticle'); |
|
|
|
|
}).catch(err => { |
|
|
|
|
// console.log(err); |
|
|
|
|
console.log('2'); |
|
|
|
|
// console.log('2'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|