exportStatisticsHour导出的数据如何发送到其他app

小程序开发相关产品技术讨论,包括面板、智能小程序、React Native、Ray跨端框架、Panel SDK、微信小程序、小程序开发工具(IDE)及其他开发技术相关等话题


Post Reply
silverlight
Posts: 150

目前这个api只能导出到邮箱里,但是我发现有款小程序,可以将数据分享到其他app中,我想知道是怎么实现的

Attachments
导出3.png
导出2.png
导出1.png

Tags:
crisiron
Posts: 117

Re: exportStatisticsHour导出的数据如何发送到其他app

调用 share, 可调起 app的分享方法, https://developer.tuya.com/cn/miniapp/d ... iner/share

silverlight
Posts: 150

Re: exportStatisticsHour导出的数据如何发送到其他app

crisiron 2025年 Apr 1日 15:29

调用 share, 可调起 app的分享方法, https://developer.tuya.com/cn/miniapp/d ... iner/share

你好,share可以分享文件这些,但是数据统计exportStatisticsDay导出的文件好像只能发往邮箱。share分享文件需要文件地址,我想知道exportStatisticsDay导出的文件存放在哪里

crisiron
Posts: 117

Re: exportStatisticsHour导出的数据如何发送到其他app

使用https://developer.tuya.com/cn/miniapp/develop/ray/api/meature/getStatisticsRangDay 获取到数据后,传入 share

silverlight
Posts: 150

Re: exportStatisticsHour导出的数据如何发送到其他app

crisiron 2025年 Apr 2日 09:27

使用https://developer.tuya.com/cn/miniapp/develop/ray/api/meature/getStatisticsRangDay 获取到数据后,传入 share

你好,我代码如下,在数据成功获取的情况下,并没能打开分享界面。我看了share的示例,还是原生小程序写法,是还没有封装进ray嘛?

Code: Select all

  const handleGetAndShare = () => {
    getStatisticsRangDay({
      devId: devInfo.devId,
      dpId: 106,
      startDay: '20250401',
      endDay: '20250401',
      type: 'avg',
    })
      .then((response) => {
        console.log('导出的数据', response);
  
share({ type: 'WeChat', title: '分享统计数据', message: `统计数据: ${JSON.stringify(response)}`, contentType: 'text', success(info) { console.log('微信分享成功', info); }, fail(error) { console.error('微信分享失败', error); }, complete(info){ console.log('微信分享完成', info); } }); }) .catch((error) => { console.error('获取统计数据失败', error); }); };
crisiron
Posts: 117

Re: exportStatisticsHour导出的数据如何发送到其他app

提供下机型与系统版本以及 APP 版本, 可先看看 文档中提供的示例 https://developer.tuya.com/cn/miniapp/d ... hare#share

silverlight
Posts: 150

Re: exportStatisticsHour导出的数据如何发送到其他app

crisiron 2025年 Apr 2日 11:51

提供下机型与系统版本以及 APP 版本, 可先看看 文档中提供的示例 https://developer.tuya.com/cn/miniapp/d ... hare#share

机型为iphone13 ,系统为18.3.2,智能生活版本为6.4.0。
目前能正确触发打开分享界面,但是存在以下两个个问题。
1:contentType为text的时候,获取到的数据在我iPhone13无法转发到微信里,安卓端则是以文本形式转发出去了
2:getStatisticsRangDay无法将数据以excel文件形式传出,并让我share进行转发

ios分享到微信的界面

分享1.jpg

安卓成功分享出去

分享2.jpg
Post Reply