起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4526|回复: 0

[未处理] 关于app不能微信分享的问题

[复制链接]

6

主题

11

帖子

122

积分

初级会员

Rank: 2

积分
122
QQ
发表于 2021-1-6 15:53:47 | 显示全部楼层 |阅读模式
首先我先发一下我写的代码:
.w中:<a component="$UI/system/components/justep/button/button" style="border:1 px solid #000"
              class="btn btn-default " xid="onMenuShareAppMessage">分享至微信</a>
js :   先引入: var share = require('$UI/system/api/native/share');
                     require("cordova!com.justep.cordova.plugin.weixin.v3");
     再调用:Model.prototype.weixinClick = function(event) {
    function success(result) {
        alert(JSON.stringify(result));
    }
    function error(result) {
        alert(JSON.stringify(result));
    }
    console.log(navigator.weixin);
    navigator.weixin.share({
        message : {
            title : "WeX5开发指南",
            description : "分享到微信",
            mediaTagName : "Media Tag Name(optional)",
            thumb : "http://YOUR_THUMBNAIL_IMAGE",
            media : {
                // type: weixin.Type.WEBPAGE, // webpage
                webpageUrl : window.location.href
            // webpage
            }
        },
        scene : navigator.weixin.Scene.SESSION
    }, success, error);
};
微信图片_20210106155158.jpg
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-5-2 20:50 , Processed in 0.100712 second(s), 26 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表