flutter_taobao_page 0.3.1 copy "flutter_taobao_page: ^0.3.1" to clipboard
flutter_taobao_page: ^0.3.1 copied to clipboard

outdated

Scrape personal data from taobao(淘宝) by webview in a application.

taobao_page #

A flutter package 淘宝个人数据抓取.

flutter_taobao_page是一个通过Webview来抓取淘宝数据的Flutter插件。

特性 #

  • Flutter 插件
  • 原始 Webview 淘宝登录
  • 提供数据API
  • 数据驱动

数据项 #

  • ❌ 数据接口
    • ✅ 订单列表
    • ✅ 订单详情
    • ✅ 订单物流信息
  • ❌ 主要功能
    • ❌ 多种Webview插件支持
    • ❌ 数据驱动

如有更多接口需求欢迎提issue.

依赖 #

  • flutter_webview

要求 #

准备 #

iOS

Info.plist 文件中添加

<key>io.flutter.embedded_views_preview</key>
<true/>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

Android

AndroidManifest.xml 文件中添加

android:usesCleartextTraffic="true"

使用 #

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  TaobaoPageController _controller;

  int _currentPage = 0;

  @override
  Widget build(BuildContext context) {
      return Scaffold(
          body: TaobaoPage(
            onCreated: (TaobaoPageController controller) {
                _controller = controller;
            },
            child: ... // 调用 _controller.getOrder(_currentPage, count: 5) 获取订单
          )
      )
  }
}
  • 订单详情

    _controller.apiOrderDetail("xxxx")

  • 订单物流

    _controller.apiTradeDetail("xxxx")

    更详细的收获地址信息,如收货人可在订单详情内获得.

详细内容参考示例: example/lib/main.dart

:attention: 注意 #

目前存在比较大的问题:

  • webview在未激活的情况下,物流详情等h5类请求会异常

目前的解决方案是:

  • HackKeepAlive组件一直在激活的状态,比如在渲染PageTitle中
  • 缩短超时时间,并重试
1
likes
30
pub points
0%
popularity

Publisher

verified publisherzoe.im

Scrape personal data from taobao(淘宝) by webview in a application.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_inappwebview, gbk2utf8, http, universal_html

More

Packages that depend on flutter_taobao_page