fix(share): 按钮android兼容 reviewed by zhiminghu
Showing
1 changed file
with
11 additions
and
5 deletions
@@ -33,7 +33,9 @@ const xianyu = { | @@ -33,7 +33,9 @@ const xianyu = { | ||
33 | closeNavRightItem() { | 33 | closeNavRightItem() { |
34 | 34 | ||
35 | if (this.isAliApp && window.WindVane) { | 35 | if (this.isAliApp && window.WindVane) { |
36 | - window.WindVane.call('WVIdleFishApi', 'setHideNavigatorRightItem', {},()=>{},()=>{}) | 36 | + window.WindVane.call('WVIdleFishApi', 'setHideNavigatorRightItem', {},()=>{ |
37 | + },()=>{ | ||
38 | + }) | ||
37 | } | 39 | } |
38 | }, | 40 | }, |
39 | 41 | ||
@@ -47,12 +49,16 @@ const xianyu = { | @@ -47,12 +49,16 @@ const xianyu = { | ||
47 | window._xianyuShare = () => { | 49 | window._xianyuShare = () => { |
48 | this.setXianyuShare(shareParam, handler); | 50 | this.setXianyuShare(shareParam, handler); |
49 | } | 51 | } |
50 | - // console.log('this.isAliApp && window.WindVane', this.isAliApp , window.WindVane); | ||
51 | - if (this.isAliApp && window.WindVane) { | ||
52 | - window.WindVane.call('WVIdleFishApi', 'setNavigatorRightItem', { | 52 | + // xianyu android bug: title必传切不能为空字符串,icon才能展示 |
53 | + // xianyu ios bug: 图片按钮无法隐藏 TOTO ali修复 | ||
54 | + const param = { | ||
53 | title: '∙∙∙', // 按钮名称 | 55 | title: '∙∙∙', // 按钮名称 |
56 | + icon: this.isAndroid ? ' http://cdn.yoho.cn/xianyu/share-btn.png': '', | ||
54 | func: '_xianyuShare' // func: 'test' //点击调用函数 注意调用的函数必须挂载在window上 | 57 | func: '_xianyuShare' // func: 'test' //点击调用函数 注意调用的函数必须挂载在window上 |
55 | - }, function(data) { | 58 | + } |
59 | + // console.log('this.isAliApp && window.WindVane', this.isAliApp , window.WindVane); | ||
60 | + if (this.isAliApp && window.WindVane) { | ||
61 | + window.WindVane.call('WVIdleFishApi', 'setNavigatorRightItem',param, function(data) { | ||
56 | console.log('setNavigatorRightItem success:',data); | 62 | console.log('setNavigatorRightItem success:',data); |
57 | }, function(e) { | 63 | }, function(e) { |
58 | console.log('setNavigatorRightItem error:',e); | 64 | console.log('setNavigatorRightItem error:',e); |
-
Please register or login to post a comment