zoukankan      html  css  js  c++  java
  • react 调用 native 的callShareAllFunc()方法,实现分享


    let shareName = {
    '0': '微信',
    '1': '朋友圈',
    '2': '新浪微博',
    '3': ' QQ',
    '4': 'QQ空间'
    };

    render(){
    //分享
    YztApp.configureShare({
    "title": encodeURIComponent(this.props.title),
    "content": encodeURIComponent(
    `${this.props.text && this.props.text.replace(/<[^>]+>/g, "").substring(0, 40)}...`),
    "href": window.location.href,
    "imgUrl": ''
    }, true,
    function (data) {
    App.call(['getPeasForSharing'], null, null, {'activeId': 'ACT16062414010469018'});
    YztApp.ubt('财经快讯', '选择分享渠道_点击_渠道', {'渠道': shareName[data.type], '分享结果': '成功'});
    }, function (data) {
    data = JSON.parse(data);
    YztApp.ubt('财经快讯', '选择分享渠道_点击_渠道', {'渠道': shareName[data.type], '分享结果': '失败'});
    });
    }
    <InputBox
    onPressShare={() => {YztApp.callShareAllFunc();}}
    />
     
  • 相关阅读:
    总结随笔
    Beta冲刺第七天
    Beta冲刺第六天
    Beta冲刺第五天
    Beta冲刺第四天
    Beta冲刺第三天
    POJ 2240 Arbitrage
    POJ 3660 Cow Contest
    POJ 1797 Heavy Transportation
    LightOJ 1123 Trail Maintenance
  • 原文地址:https://www.cnblogs.com/y-lin/p/6005576.html
Copyright © 2011-2022 走看看