1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import config from '../config.js';
- export default {
- data() {
- return {
- share: {}
- }
- },
- onShareAppMessage(res) { //发送给朋友
- //禁止二次转发--
- uni.showShareMenu({
- withShareTicket: true
- });
- wx.updateShareMenu({
- isPrivateMessage: true,
- withShareTicket: true,
- success(res) {
- console.log('updateShareMenu: ', res);
- },
- fail() {}
- });
- return {
- title: config.share.title,
- path: config.share.path,
- imageUrl: config.share.imageUrl,
- success(res) {
- uni.showToast({
- title: '分享成功'
- })
- },
- fail(res) {
- uni.showToast({
- title: '分享失败',
- icon: 'none'
- })
- }
- }
- },
- onShareTimeline(res) { //分享到朋友圈
- return {
- title: config.share.title,
- path: config.share.path,
- imageUrl: config.share.imageUrl,
- success(res) {
- uni.showToast({
- title: '分享成功'
- })
- },
- fail(res) {
- uni.showToast({
- title: '分享失败',
- icon: 'none'
- })
- }
- }
- },
- }
|