美文网首页
uni-app App端跳转微信小程序

uni-app App端跳转微信小程序

作者: 郭的妻 | 来源:发表于2022-05-17 16:03 被阅读0次

    1.在manifest.json 配置 App模板配置

    image.png

    2.使用

    getPlus() {
        //获取当前显示的webview
        var pages = getCurrentPages()
        var page = pages[pages.length - 1]
        var currentWebview = page.$getAppWebview()
        //调用H5+APP的扩展API
        var shares = null;
        let that = this
        var pusher = plus.share.getServices(function(s) {
            shares = {};
            for (var i in s) {
                var t = s[i];
                shares[t.id] = t;
            }
            that.sweixin = shares['weixin'];
        }, function(e) {
            console.log("获取分享服务列表失败:" + e.message);
        });
        //放入当前的webview
        currentWebview.append(pusher);
    },
    /* 点击 跳转 小程序 */
    checkWeChat() {
        //调用微信小程序
        this.sweixin.launchMiniProgram({
            id: 'gh_95534902f0d8' //要跳转小程序的原始ID
        })
    },
    
    

    相关文章

      网友评论

          本文标题:uni-app App端跳转微信小程序

          本文链接:https://www.haomeiwen.com/subject/ssrnurtx.html