1 Star 1 Fork 0

nothing / flutter_alibc_extend

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

flutter_alibc

Flutter版本的阿里百川 V4.0.8版本

pub地址:flutter_alibc github地址:flutter_alibc

可以给个star🐴,混口饭吃

支持Android和iOS

邮箱:

Android:983598009@qq.com

iOS:329106954@qq.com P.S:另有开普勒插件flutter_kepler

Getting Started

工程性配置

参考阿里百川官网

引入

如何引入项目

方法说明

  • 头文件引入
import 'package:flutter_alibc/flutter_alibc.dart';
  • 初始化
 /**
   * 初始化
   * version:当前app版本
   * appName:当前app名称
   * result:{
   * errorCode,     //0为初始化成功,其他为失败
   * errorMessage,  //message
   * }
   */
var result = await FlutterAlibc.initAlibc(version:"",appName:"");
  • 登录淘宝
/**
   * 登录淘宝
   * version:当前app版本
   * appName:当前app名称
   * result:{
   * errorCode,     //0为初始化成功,其他为失败
   * errorMessage,  //message
   * data:{					//登录成功的情况下返回data,为用户数据
   * 	//nick 用户昵称,avatarUrl 头像地址
	 *  nick,avatarUrl,openId,openSid,topAccessToken,topAuthCode
   * 	}
   * }
   * 备注:登录过会直接返回淘宝用户的信息,不会多次唤醒淘宝,请放心
   */
var result = await FlutterAlibc.loginTaoBao();
  • 淘宝登出
FlutterAlibc.loginOut();
  • 淘客登录,二次授权获取access_token
 /**
   * @description: 获取access_token
   * @param 
   * url:用于授权登录的url
   * openType:打开类型,默认auto
   * isNeedCustomNativeFailMode:是否需要设置唤端失败策略,默认false
   * nativeFailMode:唤端失败策略,默认None
   * schemeType:唤起哪个端,默认天猫
   * taokeParams:淘客数据
   * backUrl: 跳转回来的url
   * @return: {accessToken:""}//获取成功为token,获取失败为空字符串
   */
 var result = await FlutterAlibc.taoKeLogin(
                    url:"",	//必须参数,用于授权登录的url
                    openType : AlibcOpenType.AlibcOpenTypeAuto,
                    isNeedCustomNativeFailMode : false,
                    nativeFailMode :    AlibcNativeFailMode.AlibcNativeFailModeNone,
                    schemeType : AlibcSchemeType.AlibcSchemeTmall,
                    taokeParams : {},
                    backUrl:"",
                    );
  • 唤起淘宝,openByUrl方式
 /**
   * @description: 通过url打开,包括h5,唤起手淘等
   * @param 
   * url:目标url
   * openType:打开类型,默认auto
   * isNeedCustomNativeFailMode:是否需要设置唤端失败策略,默认false
   * nativeFailMode:唤端失败策略,默认None
   * schemeType:唤起哪个端,默认天猫
   * taokeParams:淘客数据
   * backUrl: 跳转回来的url
   * @return: {
   *		errorCode,
   *		errorMessage,
   *		type,			//0为添加购物车,1为付款成功
   *		payResult,	//type为1时返回
   *  }
   */
 var result = await FlutterAlibc.openByUrl(
                    url:"",	//必须参数
                    openType : AlibcOpenType.AlibcOpenTypeAuto,
                    isNeedCustomNativeFailMode : false,
                    nativeFailMode :    AlibcNativeFailMode.AlibcNativeFailModeNone,
                    schemeType : AlibcSchemeType.AlibcSchemeTmall,
                    taokeParams : {},
                    backUrl:"",
                    );
  • 唤起淘宝,openItemDetail方式
/**
   * @description: 打开商品详情
   * @param 
   * itemID 商品id,可以是真实的也可以是混淆的,必须参数
   * trackParam	需要额外追踪的业务数据
   * 其他同上
   * @return: 同openByUrl
   */
var result = await FlutterAlibc.openItemDetail(
										itemID:"",	//必须参数
                    openType : AlibcOpenType.AlibcOpenTypeAuto,
                    isNeedCustomNativeFailMode : false,
                    nativeFailMode :    AlibcNativeFailMode.AlibcNativeFailModeNone,
                    schemeType : AlibcSchemeType.AlibcSchemeTmall,
                    taokeParams : {},
                    trackParam : {}, //需要额外追踪的业务数据
                    backUrl:"",
);
  • 打开店铺,openShop方式
/**
   * @description: 打开店铺
   * @param 
   * shopId 店铺id,必须参数
   * 其他同上
   * @return: 同openByUrl
   */
var result = await FlutterAlibc.openShop(
										shopId:"",	//必须参数
                    openType : AlibcOpenType.AlibcOpenTypeAuto,
                    isNeedCustomNativeFailMode : false,
                    nativeFailMode :    AlibcNativeFailMode.AlibcNativeFailModeNone,
                    schemeType : AlibcSchemeType.AlibcSchemeTmall,
                    taokeParams : {},
                    trackParam : {}, //需要额外追踪的业务数据
                    backUrl:"",
);
  • 打开购物车,openCart方式
/**
   * @description: 打开购物车
   * @param 
   * 无必须参数
   * 其他同上
   * @return: 同openByUrl
   */
var result = await FlutterAlibc.openCart(
                    openType : AlibcOpenType.AlibcOpenTypeAuto,
                    isNeedCustomNativeFailMode : false,
                    nativeFailMode :    AlibcNativeFailMode.AlibcNativeFailModeNone,
                    schemeType : AlibcSchemeType.AlibcSchemeTmall,
                    taokeParams : {},
                    trackParam : {}, //需要额外追踪的业务数据
                    backUrl:"",
);
  • 是否设置同步打点
FlutterAlibc.syncForTaoke(true);
  • 是否使用Native Alipay
FlutterAlibc.useAlipayNative(true);
MIT License Copyright (c) 2019 FlutterTaoBaoKe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
Dart
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Dart
1
https://gitee.com/ccnothing/flutter_alibc_extend.git
git@gitee.com:ccnothing/flutter_alibc_extend.git
ccnothing
flutter_alibc_extend
flutter_alibc_extend
master

搜索帮助