|
首先我先发一下我写的代码:
.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);
};
|
|