|
- import 'package:flutter/material.dart';
- import 'package:flutter_alibc/alibc_model.dart';
- import 'package:flutter_alibc/flutter_alibc.dart';
- import 'package:zhiying_comm/util/taobao/taobao_auth_alert.dart';
- import 'package:zhiying_comm/zhiying_comm.dart';
-
- class TaobaoAuth {
- // 淘宝授权
- static auth(BuildContext context) async {
- bool isConfirm = await showDialog(
- context: context,
- builder: (BuildContext context) {
- return TaobaoAuthAlert();
- });
- if (isConfirm != null && isConfirm == true) {
- TradeResult result = await FlutterAlibc.openByUrl(
- url:
- 'https://uland.taobao.com/coupon/edetail?e=3HzI2W1Beb8GQASttHIRqXnNjWpDy9mhXwL7S63FIwYKZE0HebgG45okpD6aY36atPRANf7tQQAMfuX5VbbjJDEhJpUUrcnYl02IO45oPAVVa4HVocdYY3Y9x3IctcCWLspxGy3zBjY8IeN8lvhRA2lzrR4%2BfrcbCbBkjRdlgvJ932VMXbyLuXFtBQJOD%2BAi1xjdOwSZLqE%3D&traceId=0bb623e116004208111058861eea6c&relationId=528397833&union_lens=lensId:TAPI@1600420811@0b8fdc87_0dbb_174a0839173_b4fc@01&relationId=528397833');
- // TradeResult result = await FlutterAlibc.openByUrl(
- // url:
- // 'http://www.izhim.com/comm/tb_callback.php?_ctrl=domain&domain_return_url=aHR0cDovL3d3dy5oYWlydXlpLmNvbS9jb21tL3RicmVkaXJlY3QucGhwP3RyYWNrX2lkPQ%3D%3D&domain_state=r_NTEwMw');
- Logger.debug('${result.errorCode} ${result.errorMessage} ');
- }
- }
-
- // 返回是否授权
- static Future<bool> isAuth() {
- return Future.delayed(Duration.zero, () => false);
- }
- }
|