MCPcopy
hub / github.com/dcloudio/mui / open

Function open

plugin/share/plusShare.js:65–108  ·  view source on GitHub ↗
(msg, callback)

Source from the content-addressed store, hash-verified

63 }
64 }
65 var open = function(msg, callback) {
66 if (shareServices.weixin && isWechatInstalled()) {
67 plus.nativeUI.actionSheet({
68 title: '分享到',
69 cancel: "取消",
70 buttons: [{
71 title: "微信消息"
72 }, {
73 title: "微信朋友圈"
74 }, {
75 title: "更多分享"
76 }]
77 }, function(e) {
78 var index = e.index;
79 switch (index) {
80 case 1: //分享到微信好友
81 msg.extra = {
82 scene: 'WXSceneSession'
83 };
84 share('weixin', msg, callback);
85 break;
86 case 2: //分享到微信朋友圈
87 msg.title = msg.content;
88 msg.extra = {
89 scene: 'WXSceneTimeline'
90 };
91 share('weixin', msg, callback);
92 break;
93 case 3: //更多分享
94 var url = msg.href ? ('( ' + msg.href + ' )') : '';
95 msg.title = msg.title + url;
96 msg.content = msg.content + url;
97 openSystem(msg, callback);
98 break;
99 }
100 })
101 } else {
102 //系统分享
103 var url = msg.href ? ('( ' + msg.href + ' )') : '';
104 msg.title = msg.title + url;
105 msg.content = msg.content + url;
106 openSystem(msg, callback);
107 }
108 };
109 plusReady(init);
110 window.plusShare = open;
111})();

Callers

nothing calls this directly

Calls 3

isWechatInstalledFunction · 0.85
shareFunction · 0.85
openSystemFunction · 0.85

Tested by

no test coverage detected