Flutter 开发工具包 apifm-flutter 1.1.0 发布

栏目: 软件资讯 · 发布时间: 6年前

内容简介:Flutter 开发工具包 apifm-flutter 1.1.0 发布,更新如下: 设置 JSON 数据 Apifm.jsonSet(Map<String, String> params) 参数说明: type 自定义类型,最大长度为32个字 refId 关联数据编号(数字类型) conten...

Flutter 开发 工具 包 apifm-flutter 1.1.0 发布,更新如下:

设置 JSON 数据

Apifm.jsonSet(Map<String, String> params)

参数说明:

  1. type 自定义类型,最大长度为32个字
  2. refId 关联数据编号(数字类型)
  3. content Json 数据内容(必传)

如果要修改某一条 Json 记录,则需要再传一个参数 (id) ,代表你要修改的记录 ID

读取设置的 JSON 数据列表

Apifm.jsonList([Map<String, String> params])

支持以下参数:

  1. page 读取第几页数据,不传该参数默认为 1;
  2. pageSize 每页读取几条数据,不传该参数默认取 50;
  3. type 只读取该类型的 Json 记录;
  4. refId 只读取该数据的所有 Json 记录;

删除 JSON 数据

Apifm.jsonDelete(int id[, String token])

删除指定 id 的 Json 记录

邮箱注册

Apifm.registerEmail(Map<String, String> params)

QQ 互联一键注册

 Apifm.registerQQConnect(Map<String, String> params)

QQ 互联的一键注册功能,需要以下参数:

QQ 授权后返回的参数:

oauthConsumerKey、openid、accessToken

具体请查阅 QQ 互联的接口文档说明

可选参数:

referrer 邀请人,邀请你注册的用户 id postJsonString 注册的扩展信息,Json 数据格式

微信一键注册

 Apifm.registerWX(Map<String, String> params)

微信的一键注册功能,需要以下参数:

授权后返回的参数:

code

可选参数:

referrer 邀请人,邀请你注册的用户 id postJsonString 注册的扩展信息,Json数据格式

邮箱登录

Apifm.loginEmail(String email, String pwd, String deviceId, String deviceName)

示例代码:

var res = await Apifm.loginEmail('zansan@163.com', '123456', '33010500879931234', 'iphone8 Plus');
int uid = res['data']['uid'];
String token = res['data']['token'];
print('uid: $uid, token is : $token');

deviceId 建议读取手机序列号;

deviceName 建议读取手机型号;

QQ互联一键登录

 Apifm.loginQQConnect(String oauthConsumerKey, String openid, String accessToken)

登录的3个参数,请查阅QQ互联的接口文档返回值说明

微信一键登录

 Apifm.loginWX(String code)

code 为授权成功后返回的临时凭证

商品分类

 Apifm.goodsCategory()

读取后台设置的所有分类数据,分类之间的上下级关系请使用 level 和 pid 进行管理

level = 1 表示 1级类目;2 表示 2级类目,以此类推

pid 代表该类目的上级类目ID(一级类目的 pid = 0)

分类的目录树,可以根据上述2个字段,采用 js 在本地实现

接口返回示例:

{
  "code": 0,
  "data": [
    {
      "dateAdd": "2017-09-12 11:07:32",
      "dateUpdate": "2019-04-10 11:24:32",
      "icon": "https://cdn.it120.cc/apifactory/2019/04/09/f89753a227d26a3fe9ccc6f975857bb6.png",
      "id": 1872,
      "isUse": true,
      "key": "1",
      "level": 1,
      "name": "上装",
      "paixu": 0,
      "pid": 0,
      "type": "",
      "userId": 951
    }
  ],
  "msg": "success"
}

获取商品列表

 Apifm.goods([Map<String, String> params])

读取所有的商品数据,以分页的形式展示,支持按照多种方式进行排序

接口返回示例:

{
  "code": 0,
  "data": [
    {
      "categoryId": 1875,
      "characteristic": "享受vip尊享服务,使用专业版后台,功能更强,体验更好",
      "commission": 0,
      "commissionType": 0,
      "dateAdd": "2019-03-19 09:51:08",
      "dateUpdate": "2019-08-14 09:49:34",
      "gotScore": 0,
      "gotScoreType": 0,
      "id": 124305,
      "kanjia": true,
      "kanjiaPrice": 49,
      "limitation": false,
      "logisticsId": 0,
      "miaosha": false,
      "minPrice": 198,
      "minScore": 0,
      "name": "api工厂1年vip会员",
      "numberFav": 0,
      "numberGoodReputation": 1,
      "numberOrders": 1,
      "numberSells": 1,
      "originalPrice": 198,
      "paixu": 0,
      "pic": "https://cdn.it120.cc/apifactory/2019/03/19/6828c1ced4a74e11b532c8cbd864245a.png",
      "pingtuan": false,
      "pingtuanPrice": 0,
      "recommendStatus": 1,
      "recommendStatusStr": "推荐",
      "shopId": 0,
      "status": 0,
      "statusStr": "上架",
      "stores": 9999998,
      "userId": 951,
      "views": 15955,
      "weight": 0
    }
  ],
  "msg": "success"
}

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

HTTP Essentials

HTTP Essentials

Stephen A. Thomas、Stephen Thomas / Wiley / 2001-03-08 / USD 34.99

The first complete reference guide to the essential Web protocol As applications and services converge and Web technologies not only assume HTTP but require developers to manipulate it, it is be......一起来看看 《HTTP Essentials》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具