润邦云
润邦云
  • 发布:2025-02-10 20:06
  • 更新:2025-02-11 09:05
  • 阅读:93

uniapp开发的微信小程序,首页不能添加按钮直接调用分享吗?

分类:uni-app
        sharemp() {  
            uni.share({  
                provider: 'weixin',  
                scene: "WXSceneSession",  
                type: 5,  
                imageUrl: app.globalData.config.app_logo,  
                title: '润邦云',  
                miniProgram: {  
                    id: 'xxxxx',  
                    path: 'pages/home/index/index',  
                    type: 1,  
                    webUrl: app.globalData.web_url  
                },  
                success: ret => {  
                    console.log(JSON.stringify(ret));  
                }  
            });  

        },
2025-02-10 20:06 负责人:无 分享
已邀请:
晓寒1987

晓寒1987 - 相濡以沫不如相忘于江湖

可以加按钮的方式,不支持直接调用API,button上 type=share

蔡cai

蔡cai

你要看uni.share的兼容性啊,uni.share就只能在app用;微信小程序用button,文档地址:https://uniapp.dcloud.net.cn/component/button.html#open-type-%E6%9C%89%E6%95%88%E5%80%BC,open-type的值为share

  • 蔡cai

    uni.share文档地址:https://uniapp.dcloud.net.cn/api/plugins/share.html#share

    2025-02-11 09:06

要回复问题请先登录注册