Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
xianyu-ufo-app-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
huzhiming
5 years ago
Commit
80f2cc204a67027404b514c6865f9aa039a845b1
1 parent
2c6875b5
feat(分享): 添加分享测试代码
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
24 deletions
apps/common/xianyu.js
apps/common/xianyu.js
View file @
80f2cc2
...
...
@@ -31,33 +31,40 @@ const xianyu = {
* @ version: V1.0.5
*/
setXianyuShare
()
{
window
.
_xianyuShare
=
()
=>
{
var
param
=
{
shareType
:
'activity'
,
// 类型,默认activity
image
:
'http://gw.alicdn.com/tps/i1/TB1Nep5FVXXXXXDaXXXE799_VXX-800-800.jpg'
,
url
:
'http://h5.xianyu.tb.cn/xianyu/maishen.html?wxIsAvailable'
,
// 分享链接
link
:
'http://h5.xianyu.tb.cn/xianyu/maishen.html?wxIsAvailable'
,
// 和url保持
title
:
'下载闲鱼App'
,
// 分享标题
text
:
'你可记得家里堆积的闲置物,你可知他们正在黯然神伤。让他们来闲鱼卖身吧,即可'
console
.
log
(
'开始调用分享'
);
if
(
this
.
isAliApp
&&
window
.
WindVane
)
{
window
.
_xianyuShare
=
()
=>
{
var
param
=
{
shareType
:
'activity'
,
// 类型,默认activity
image
:
'http://gw.alicdn.com/tps/i1/TB1Nep5FVXXXXXDaXXXE799_VXX-800-800.jpg'
,
url
:
'http://h5.xianyu.tb.cn/xianyu/maishen.html?wxIsAvailable'
,
// 分享链接
link
:
'http://h5.xianyu.tb.cn/xianyu/maishen.html?wxIsAvailable'
,
// 和url保持
title
:
'下载闲鱼App'
,
// 分享标题
text
:
'你可记得家里堆积的闲置物,你可知他们正在黯然神伤。让他们来闲鱼卖身吧,即可'
};
window
.
WindVane
.
call
(
'WVIdleFishApi'
,
'showShareMenu'
,
param
,
(
data
)
=>
{
// alert('success:' + JSON.stringify(data));
console
.
log
(
'success:'
,
JSON
.
stringify
(
data
));
},
function
(
e
)
{
// alert('fail:' , JSON.stringify(e));
console
.
log
(
'fail:'
,
JSON
.
stringify
(
e
));
});
};
window
.
WindVane
.
call
(
'WVIdleFishApi'
,
'showShareMenu'
,
param
,
(
data
)
=>
{
// alert('success:' + JSON.stringify(data));
},
function
(
e
)
{
// alert('fail:' + JSON.stringify(e));
});
};
return
new
Promise
((
resolve
,
reject
)
=>
{
window
.
WindVane
.
call
(
'WVIdleFishApi'
,
'setNavigatorRightItem'
,
{
title
:
'∙∙∙'
,
// 按钮名称 func:'test' //点击调用函数
func
:
'_xianyuShare'
// func: 'test' //点击调用函数 注意调用的函数必须挂载在window上
},
function
(
data
)
{
resolve
(
data
);
},
function
(
e
)
{
reject
(
e
);
return
new
Promise
((
resolve
,
reject
)
=>
{
window
.
WindVane
.
call
(
'WVIdleFishApi'
,
'setNavigatorRightItem'
,
{
title
:
'∙∙∙'
,
// 按钮名称 func:'test' //点击调用函数
func
:
'_xianyuShare'
// func: 'test' //点击调用函数 注意调用的函数必须挂载在window上
},
function
(
data
)
{
console
.
log
(
'setNavigatorRightItem'
,
data
);
resolve
(
data
);
},
function
(
e
)
{
reject
(
e
);
console
.
log
(
'setNavigatorRightItem'
,
e
);
});
});
}
);
}
},
finishXianyuPage
()
{
...
...
Please
register
or
login
to post a comment