分享功能开发
This commit is contained in:
@@ -16,8 +16,12 @@
|
||||
<view class="invitation-text-sub">邀请好友增加共力分增长</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="invitation-btn">分享邀请</button>
|
||||
<button class="invitation-btn" @click="onShare">分享邀请</button>
|
||||
</view>
|
||||
<!-- 分享 -->
|
||||
<uni-popup ref="popupShare" type="share" background-color="#fff">
|
||||
<uni-popup-share title="分享到" @select="select"></uni-popup-share>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -52,7 +56,56 @@
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 分享
|
||||
onShare(){
|
||||
this.$refs.popupShare.open();
|
||||
},
|
||||
// 分享选项
|
||||
select(e){
|
||||
switch(e.item.name){
|
||||
case 'wxchum':
|
||||
console.log('wxchum')
|
||||
uni.share({
|
||||
provider: 'weixin',
|
||||
scene : 'WXSceneSession',
|
||||
type : 0,
|
||||
href : 'https://www.baidu.com',
|
||||
title : '共力生态',
|
||||
summary : '共力生态 共力 共赢 共享 带你进入web3.0!',
|
||||
imageUrl: 'https://gl-ecological.oss-cn-zhangjiakou.aliyuncs.com/images/2022/06/10/e763ae96ce9d0b4407b68e66963c7cb2.jpg',
|
||||
fail(err) {
|
||||
uni.showToast({
|
||||
title: err.errMsg,
|
||||
icon : 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
break;
|
||||
case 'wxcircle':
|
||||
uni.share({
|
||||
provider: 'weixin',
|
||||
scene : 'WXSceneTimeline',
|
||||
type : 0,
|
||||
href : 'https://www.baidu.com',
|
||||
title : '共力生态 共力 共赢 共享',
|
||||
imageUrl: 'https://gl-ecological.oss-cn-zhangjiakou.aliyuncs.com/images/2022/06/10/e763ae96ce9d0b4407b68e66963c7cb2.jpg',
|
||||
fail(err) {
|
||||
uni.showToast({
|
||||
title: err.errMsg,
|
||||
icon : 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
break;
|
||||
case 'qq':
|
||||
uni.showToast({
|
||||
title: 'qq好友分享近期开放,敬请期待',
|
||||
icon : 'none'
|
||||
})
|
||||
break;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user