fmk
4 years ago
40 changed files with 2447 additions and 1193 deletions
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 7.1 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,205 @@
|
||||
//
|
||||
// WXApi.h
|
||||
// 所有Api接口
|
||||
//
|
||||
// Created by Wechat on 12-2-28.
|
||||
// Copyright (c) 2012年 Tencent. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h> |
||||
#import "WXApiObject.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
#pragma mark - WXApiDelegate |
||||
/*! @brief 接收并处理来自微信终端程序的事件消息
|
||||
* |
||||
* 接收并处理来自微信终端程序的事件消息,期间微信界面会切换到第三方应用程序。 |
||||
* WXApiDelegate 会在handleOpenURL:delegate:中使用并触发。 |
||||
*/ |
||||
@protocol WXApiDelegate <NSObject> |
||||
@optional |
||||
|
||||
/*! @brief 收到一个来自微信的请求,第三方应用程序处理完后调用sendResp向微信发送结果
|
||||
* |
||||
* 收到一个来自微信的请求,异步处理完成后必须调用sendResp发送处理结果给微信。 |
||||
* 可能收到的请求有GetMessageFromWXReq、ShowMessageFromWXReq等。 |
||||
* @param req 具体请求内容,是自动释放的 |
||||
*/ |
||||
- (void)onReq:(BaseReq*)req; |
||||
|
||||
|
||||
|
||||
/*! @brief 发送一个sendReq后,收到微信的回应
|
||||
* |
||||
* 收到一个来自微信的处理结果。调用一次sendReq后会收到onResp。 |
||||
* 可能收到的处理结果有SendMessageToWXResp、SendAuthResp等。 |
||||
* @param resp具体的回应内容,是自动释放的 |
||||
*/ |
||||
- (void)onResp:(BaseResp*)resp; |
||||
|
||||
@end |
||||
|
||||
#pragma mark - WXApiLogDelegate |
||||
|
||||
@protocol WXApiLogDelegate <NSObject> |
||||
|
||||
- (void)onLog:(NSString*)log logLevel:(WXLogLevel)level; |
||||
|
||||
@end |
||||
|
||||
|
||||
#pragma mark - WXApi |
||||
|
||||
/*! @brief 微信Api接口函数类
|
||||
* |
||||
* 该类封装了微信终端SDK的所有接口 |
||||
*/ |
||||
@interface WXApi : NSObject |
||||
|
||||
/*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。
|
||||
* |
||||
* 需要在每次启动第三方应用程序时调用。 |
||||
* @attention 请保证在主线程中调用此函数 |
||||
* @param appid 微信开发者ID |
||||
* @param universalLink 微信开发者Universal Link |
||||
* @return 成功返回YES,失败返回NO。 |
||||
*/ |
||||
+ (BOOL)registerApp:(NSString *)appid universalLink:(NSString *)universalLink; |
||||
|
||||
|
||||
/*! @brief 处理旧版微信通过URL启动App时传递的数据
|
||||
* |
||||
* 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用。 |
||||
* @param url 微信启动第三方应用时传递过来的URL |
||||
* @param delegate WXApiDelegate对象,用来接收微信触发的消息。 |
||||
* @return 成功返回YES,失败返回NO。 |
||||
*/ |
||||
+ (BOOL)handleOpenURL:(NSURL *)url delegate:(nullable id<WXApiDelegate>)delegate; |
||||
|
||||
|
||||
/*! @brief 处理微信通过Universal Link启动App时传递的数据
|
||||
* |
||||
* 需要在 application:continueUserActivity:restorationHandler:中调用。 |
||||
* @param userActivity 微信启动第三方应用时系统API传递过来的userActivity |
||||
* @param delegate WXApiDelegate对象,用来接收微信触发的消息。 |
||||
* @return 成功返回YES,失败返回NO。 |
||||
*/ |
||||
+ (BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity delegate:(nullable id<WXApiDelegate>)delegate; |
||||
|
||||
|
||||
/*! @brief 检查微信是否已被用户安装
|
||||
* |
||||
* @return 微信已安装返回YES,未安装返回NO。 |
||||
*/ |
||||
+ (BOOL)isWXAppInstalled; |
||||
|
||||
|
||||
|
||||
/*! @brief 判断当前微信的版本是否支持OpenApi
|
||||
* |
||||
* @return 支持返回YES,不支持返回NO。 |
||||
*/ |
||||
+ (BOOL)isWXAppSupportApi; |
||||
|
||||
|
||||
/*! @brief 判断当前微信的版本是否支持分享微信状态功能
|
||||
* |
||||
* @attention 需在工程LSApplicationQueriesSchemes配置中添加weixinStateAPI |
||||
* @return 支持返回YES,不支持返回NO。 |
||||
*/ |
||||
+ (BOOL)isWXAppSupportStateAPI; |
||||
|
||||
|
||||
/*! @brief 获取微信的itunes安装地址
|
||||
* |
||||
* @return 微信的安装地址字符串。 |
||||
*/ |
||||
+ (NSString *)getWXAppInstallUrl; |
||||
|
||||
|
||||
|
||||
/*! @brief 获取当前微信SDK的版本号
|
||||
* |
||||
* @return 返回当前微信SDK的版本号 |
||||
*/ |
||||
+ (NSString *)getApiVersion; |
||||
|
||||
|
||||
|
||||
/*! @brief 打开微信
|
||||
* |
||||
* @return 成功返回YES,失败返回NO。 |
||||
*/ |
||||
+ (BOOL)openWXApp; |
||||
|
||||
|
||||
|
||||
/*! @brief 发送请求到微信,等待微信返回onResp
|
||||
* |
||||
* 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持以下类型 |
||||
* SendAuthReq、SendMessageToWXReq、PayReq等。 |
||||
* @param req 具体的发送请求。 |
||||
* @param completion 调用结果回调block |
||||
*/ |
||||
+ (void)sendReq:(BaseReq *)req completion:(void (^ __nullable)(BOOL success))completion; |
||||
|
||||
/*! @brief 收到微信onReq的请求,发送对应的应答给微信,并切换到微信界面
|
||||
* |
||||
* 函数调用后,会切换到微信的界面。第三方应用程序收到微信onReq的请求,异步处理该请求,完成后必须调用该函数。可能发送的相应有 |
||||
* GetMessageFromWXResp、ShowMessageFromWXResp等。 |
||||
* @param resp 具体的应答内容 |
||||
* @param completion 调用结果回调block |
||||
*/ |
||||
+ (void)sendResp:(BaseResp*)resp completion:(void (^ __nullable)(BOOL success))completion; |
||||
|
||||
|
||||
/*! @brief 发送Auth请求到微信,支持用户没安装微信,等待微信返回onResp
|
||||
* |
||||
* 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持SendAuthReq类型。 |
||||
* @param req 具体的发送请求。 |
||||
* @param viewController 当前界面对象。 |
||||
* @param delegate WXApiDelegate对象,用来接收微信触发的消息。 |
||||
* @param completion 调用结果回调block |
||||
*/ |
||||
+ (void)sendAuthReq:(SendAuthReq *)req viewController:(UIViewController*)viewController delegate:(nullable id<WXApiDelegate>)delegate completion:(void (^ __nullable)(BOOL success))completion; |
||||
|
||||
|
||||
/*! @brief 测试函数,用于排查当前App通过Universal Link方式分享到微信的流程
|
||||
注意1: 调用自检函数之前必须要先调用registerApp:universalLink接口, 并确认调用成功 |
||||
注意2: 自检过程中会有Log产生,可以先调用startLogByLevel函数,根据Log排查问题 |
||||
注意3: 会多次回调block |
||||
注意4: 仅用于新接入SDK时调试使用,请勿在正式环境的调用 |
||||
* |
||||
* 当completion回调的step为WXULCheckStepFinal时,表示检测通过,Universal Link接入成功 |
||||
* @param completion 回调Block |
||||
*/ |
||||
+ (void)checkUniversalLinkReady:(nonnull WXCheckULCompletion)completion; |
||||
|
||||
|
||||
/*! @brief WXApi的成员函数,接受微信的log信息。byBlock
|
||||
注意1:SDK会强引用这个block,注意不要导致内存泄漏,注意不要导致内存泄漏 |
||||
注意2:调用过一次startLog by block之后,如果再调用一次任意方式的startLoad,会释放上一次logBlock,不再回调上一个logBlock |
||||
* |
||||
* @param level 打印log的级别 |
||||
* @param logBlock 打印log的回调block |
||||
*/ |
||||
|
||||
+ (void)startLogByLevel:(WXLogLevel)level logBlock:(WXLogBolock)logBlock; |
||||
|
||||
/*! @brief WXApi的成员函数,接受微信的log信息。byDelegate
|
||||
注意1:sdk会弱引用这个delegate,这里可加任意对象为代理,不需要与WXApiDelegate同一个对象 |
||||
注意2:调用过一次startLog by delegate之后,再调用一次任意方式的startLoad,不会再回调上一个logDelegate对象 |
||||
* @param level 打印log的级别 |
||||
* @param logDelegate 打印log的回调代理, |
||||
*/ |
||||
+ (void)startLogByLevel:(WXLogLevel)level logDelegate:(id<WXApiLogDelegate>)logDelegate; |
||||
|
||||
/*! @brief 停止打印log,会清理block或者delegate为空,释放block
|
||||
* @param
|
||||
*/ |
||||
+ (void)stopLog; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,68 @@
|
||||
//
|
||||
// WechatAuthSDK.h
|
||||
// WechatAuthSDK
|
||||
//
|
||||
// Created by 李凯 on 13-11-29.
|
||||
// Copyright (c) 2013年 Tencent. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h> |
||||
#import <UIKit/UIKit.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
enum AuthErrCode { |
||||
WechatAuth_Err_Ok = 0, //Auth成功
|
||||
WechatAuth_Err_NormalErr = -1, //普通错误
|
||||
WechatAuth_Err_NetworkErr = -2, //网络错误
|
||||
WechatAuth_Err_GetQrcodeFailed = -3, //获取二维码失败
|
||||
WechatAuth_Err_Cancel = -4, //用户取消授权
|
||||
WechatAuth_Err_Timeout = -5, //超时
|
||||
}; |
||||
|
||||
@protocol WechatAuthAPIDelegate<NSObject> |
||||
@optional |
||||
|
||||
- (void)onAuthGotQrcode:(UIImage *)image; //得到二维码
|
||||
- (void)onQrcodeScanned; //二维码被扫描
|
||||
- (void)onAuthFinish:(int)errCode AuthCode:(nullable NSString *)authCode; //成功登录
|
||||
|
||||
@end |
||||
|
||||
@interface WechatAuthSDK : NSObject{ |
||||
NSString *_sdkVersion; |
||||
__weak id<WechatAuthAPIDelegate> _delegate; |
||||
} |
||||
|
||||
@property(nonatomic, weak, nullable) id<WechatAuthAPIDelegate> delegate; |
||||
@property(nonatomic, readonly) NSString *sdkVersion; //authSDK版本号
|
||||
|
||||
/*! @brief 发送登录请求,等待WechatAuthAPIDelegate回调
|
||||
* |
||||
* @param appId 微信开发者ID |
||||
* @param nonceStr 一个随机的尽量不重复的字符串,用来使得每次的signature不同 |
||||
* @param timeStamp 时间戳 |
||||
* @param scope 应用授权作用域,拥有多个作用域用逗号(,)分隔 |
||||
* @param signature 签名 |
||||
* @param schemeData 会在扫码后拼在scheme后 |
||||
* @return 成功返回YES,失败返回NO |
||||
注:该实现只保证同时只有一个Auth在运行,Auth未完成或未Stop再次调用Auth接口时会返回NO。 |
||||
*/ |
||||
|
||||
- (BOOL)Auth:(NSString *)appId |
||||
nonceStr:(NSString *)nonceStr |
||||
timeStamp:(NSString *)timeStamp |
||||
scope:(NSString *)scope |
||||
signature:(NSString *)signature |
||||
schemeData:(nullable NSString *)schemeData; |
||||
|
||||
|
||||
/*! @brief 暂停登录请求
|
||||
* |
||||
* @return 成功返回YES,失败返回NO。 |
||||
*/ |
||||
- (BOOL)StopAuth; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
Binary file not shown.
@ -1,765 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||
|
||||
part of 'retrofit_api.dart'; |
||||
|
||||
// ************************************************************************** |
||||
// RetrofitGenerator |
||||
// ************************************************************************** |
||||
|
||||
class _ApiService implements ApiService { |
||||
_ApiService(this._dio, {this.baseUrl}) { |
||||
ArgumentError.checkNotNull(_dio, '_dio'); |
||||
baseUrl ??= 'http://platform.test.api.lotus-wallet.com/app/'; |
||||
} |
||||
|
||||
final Dio _dio; |
||||
|
||||
String baseUrl; |
||||
|
||||
@override |
||||
Future<BaseData> upload(data, folderId) async { |
||||
ArgumentError.checkNotNull(data, 'data'); |
||||
ArgumentError.checkNotNull(folderId, 'folderId'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = FormData(); |
||||
_data.files.add(MapEntry( |
||||
'file', |
||||
MultipartFile.fromFileSync(data.path, |
||||
filename: data.path.split(Platform.pathSeparator).last))); |
||||
if (folderId != null) { |
||||
_data.fields.add(MapEntry('folderId', folderId.toString())); |
||||
} |
||||
final _result = await _dio.request<Map<String, dynamic>>('/file/upload', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<dynamic> searchPoi(lat, lng, keywords, size, page) async { |
||||
ArgumentError.checkNotNull(lat, 'lat'); |
||||
ArgumentError.checkNotNull(lng, 'lng'); |
||||
ArgumentError.checkNotNull(keywords, 'keywords'); |
||||
ArgumentError.checkNotNull(size, 'size'); |
||||
ArgumentError.checkNotNull(page, 'page'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request( |
||||
'https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location=$lat,$lng&keywords=$keywords&offset={size}&page={page}&extensions=all', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = _result.data; |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> memberLogin(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/auth/platform/memberLogin', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> sendVerify(mobile) async { |
||||
ArgumentError.checkNotNull(mobile, 'mobile'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/auth/sendVerify/$mobile', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> creditGoods(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/creditGoods/list', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> creditGoodsById(id) async { |
||||
ArgumentError.checkNotNull(id, 'id'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>('/creditGoods/$id', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> queryInfo() async { |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>('/member/info', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> editInfo(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/member/editMemberInfo', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> signInInfo() async { |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/member/signInInfo', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> signIn() async { |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>('/member/signIn', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> recharge(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>('/member/recharge', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> receiveCoupon(couponId) async { |
||||
ArgumentError.checkNotNull(couponId, 'couponId'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/coupon/receive?couponId=$couponId', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> creditOrderList(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/creditOrder/list', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> creditOrder(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/creditOrder/create', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> addAddress(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>('/address/add', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> deleteAddress(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>('/address/delete', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> queryAddress(id) async { |
||||
ArgumentError.checkNotNull(id, 'id'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/address/detail/$id', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> queryMemberAddress() async { |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/address/queryMemberAddress', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> updateAddress(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>('/address/update', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> queryCoupon(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/coupon/centreList', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> queryCard(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/coupon/packageList', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> queryStore(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>('/store/list', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> informationList(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/information/list', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> informationInfo(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/information/{id}', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> creditOrderReceive(id) async { |
||||
ArgumentError.checkNotNull(id, 'id'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/creditOrder/receive/$id', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> queryHome() async { |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>('/home/home', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> queryStoreInfo(id) async { |
||||
ArgumentError.checkNotNull(id, 'id'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>('/store/$id', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> queryArticle(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/information/list', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> queryBanner(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>('/banner/page', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> queryHomeBrand() async { |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>('/home/brand', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> minLogin(storeId) async { |
||||
ArgumentError.checkNotNull(storeId, 'storeId'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/auth/mini/login/$storeId', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> queryBillInfo(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>('/member/listBill', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> rankList() async { |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>('/member/rankList', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> orderList(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>('/order/list', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> orderDetail(id) async { |
||||
ArgumentError.checkNotNull(id, 'id'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/order/orderDetail?id=$id', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> continuePay(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/order/continuePay', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> receiveToCard(id) async { |
||||
ArgumentError.checkNotNull(id, 'id'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/creditOrder/receive/$id', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> vipList() async { |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>('/member/vipList', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData> vipDetail(id) async { |
||||
ArgumentError.checkNotNull(id, 'id'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/member/vipDetail/$id', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData.fromJson(_result.data); |
||||
return value; |
||||
} |
||||
} |
@ -0,0 +1,128 @@
|
||||
|
||||
|
||||
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/view_widget/border_text.dart'; |
||||
import 'package:huixiang/view_widget/round_button.dart'; |
||||
import 'package:shared_preferences/shared_preferences.dart'; |
||||
|
||||
class LoginTips extends StatelessWidget { |
||||
|
||||
final Function click; |
||||
|
||||
LoginTips({this.click}); |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return WillPopScope( |
||||
child: Material( |
||||
type: MaterialType.transparency, |
||||
child: Center( |
||||
child: Container( |
||||
width: 0.7867.sw, |
||||
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(8), |
||||
), |
||||
child: AspectRatio( |
||||
aspectRatio: 0.9, |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
mainAxisSize: MainAxisSize.max, |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/icon_login_tips.png", |
||||
width: 0.7867.sw * 0.6, |
||||
height: 0.7867.sw * 0.6 * 0.7, |
||||
fit: BoxFit.fill, |
||||
), |
||||
SizedBox( |
||||
height: 20.w, |
||||
), |
||||
Container( |
||||
alignment: Alignment.centerLeft, |
||||
child: Text( |
||||
S.of(context).ninweidenglu, |
||||
textAlign: TextAlign.start, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: FontWeight.bold, |
||||
color: Colors.black, |
||||
), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 3.w, |
||||
), |
||||
Text( |
||||
S.of(context).weilegeiningenghaodefuwu, |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF727272), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 20.w, |
||||
), |
||||
Row( |
||||
mainAxisSize: MainAxisSize.max, |
||||
children: [ |
||||
Expanded( |
||||
child: InkWell( |
||||
onTap: () { |
||||
SmartDialog.dismiss(); |
||||
}, |
||||
child: BorderText( |
||||
text: S |
||||
.of(context) |
||||
.quxiao, |
||||
textColor: Color(0xFF32A060), |
||||
borderWidth: 1.w, |
||||
borderColor: Color(0xFF32A060), |
||||
padding: EdgeInsets.all(12.w), |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.bold, |
||||
radius: 4, |
||||
), |
||||
), |
||||
flex: 1, |
||||
), |
||||
SizedBox( |
||||
width: 13.w, |
||||
), |
||||
Expanded( |
||||
child: InkWell( |
||||
onTap: () { |
||||
click(); |
||||
SmartDialog.dismiss(); |
||||
}, |
||||
child: RoundButton( |
||||
text: S.of(context).qudenglu, |
||||
textColor: Colors.white, |
||||
padding: EdgeInsets.all(12.w), |
||||
fontSize: 16.sp, |
||||
backgroup: Color(0xFF32A060), |
||||
fontWeight: FontWeight.bold, |
||||
radius: 4, |
||||
), |
||||
), |
||||
flex: 1, |
||||
), |
||||
], |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
), |
||||
), onWillPop: () async { |
||||
return Future.value(false); |
||||
}); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue