Skip to content

Commit 04ef968

Browse files
committed
update:完善分享,禁用图文分享到QQ
1 parent 10d21e1 commit 04ef968

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎pages/API/share/share.vue‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</view>
3232
<view class="uni-btn-v uni-common-mt" v-if="providerList.length > 0">
3333
<block v-for="(value,index) in providerList" :key="index">
34-
<button type="primary" v-if="value" :disabled="shareType === 5 && value.name !== '分享到微信好友'" @tap="share(value)">{{value.name}}</button>
34+
<button type="primary" v-if="value" :disabled="isDisableButton(value)" @tap="share(value)">{{value.name}}</button>
3535
</block>
3636
</view>
3737
<!-- #endif -->
@@ -55,6 +55,19 @@
5555
providerList: []
5656
}
5757
},
58+
computed:{
59+
isDisableButton() {
60+
return function(item) {
61+
if(this.shareType === 0 && item.id === 'qq'){
62+
return true;
63+
}
64+
if(this.shareType === 5 && item.name !== '分享到微信好友'){
65+
return true;
66+
}
67+
return false;
68+
}
69+
}
70+
},
5871
onShareAppMessage() {
5972
return {
6073
title: this.shareText ? this.shareText : "欢迎体验uni-app",

0 commit comments

Comments
 (0)