|
|
/* eslint-disable guard-for-in */
|
|
|
/**
|
|
|
* Xianyu-SDK
|
|
|
*
|
...
|
...
|
@@ -23,6 +24,42 @@ const xianyu = { |
|
|
}
|
|
|
},
|
|
|
|
|
|
/*
|
|
|
* @ description: 打开webview右上角自定义按钮并拉起分享弹窗
|
|
|
* @ author: huzhiming
|
|
|
* @ date: 2019-11-05 10:38:24
|
|
|
* @ 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: '你可记得家里堆积的闲置物,你可知他们正在黯然神伤。让他们来闲鱼卖身吧,即可'
|
|
|
};
|
|
|
|
|
|
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);
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
|
|
|
finishXianyuPage() {
|
|
|
if (this.isAliApp && window.WindVane) {
|
|
|
window.WindVane.call('WVIdleFishApi', 'finish', {}, () => {
|
...
|
...
|
@@ -95,6 +132,7 @@ const xianyu = { |
|
|
}
|
|
|
|
|
|
let arr = [];
|
|
|
|
|
|
if (Object.keys(pageParams)[0] === 'openby:yohobuy') {
|
|
|
for (let key in pageParams) {
|
|
|
arr.push(pageParams[key]);
|
...
|
...
|
@@ -129,6 +167,7 @@ const xianyu = { |
|
|
if (pageName) {
|
|
|
|
|
|
let paramsV = {};
|
|
|
|
|
|
if (pageName === 'List') {
|
|
|
paramsV.query = pageParams;
|
|
|
} else {
|
...
|
...
|
|