diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index c548f123..9b9d5e51 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -40,7 +40,7 @@ android:icon="@mipmap/ic_launcher"> + android:resource="@drawable/launch_background"/> diff --git a/android/app/src/main/kotlin/com/zsw/huixiang/BridgePlugin.kt b/android/app/src/main/kotlin/com/zsw/huixiang/BridgePlugin.kt new file mode 100644 index 00000000..279e101e --- /dev/null +++ b/android/app/src/main/kotlin/com/zsw/huixiang/BridgePlugin.kt @@ -0,0 +1,43 @@ +package com.zsw.huixiang + +import android.content.Context +import android.net.Uri +import android.text.TextUtils +import android.util.Log +import io.flutter.embedding.engine.plugins.FlutterPlugin +import io.flutter.plugin.common.MethodCall +import io.flutter.plugin.common.MethodChannel + +class BridgePlugin : FlutterPlugin, MethodChannel.MethodCallHandler { + + var intentAction : Uri? = null + + private lateinit var channel : MethodChannel + private lateinit var context : Context; + + override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) { + context = binding.applicationContext; + channel = MethodChannel(binding.binaryMessenger, "bridge") + channel.setMethodCallHandler(this) + } + + override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { + channel.setMethodCallHandler(null) + } + + override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { + if (call.method == "action") { + if (intentAction != null) { + val custom = intentAction?.getQueryParameter("custom") + Log.e("bridge", "bridge:$custom") + if (!TextUtils.isEmpty(custom)) { + result.success(custom) + intentAction = null + return + } + } + result.success("") + } + } + +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/zsw/huixiang/MainActivity.kt b/android/app/src/main/kotlin/com/zsw/huixiang/MainActivity.kt index 1667e29d..c249d05c 100644 --- a/android/app/src/main/kotlin/com/zsw/huixiang/MainActivity.kt +++ b/android/app/src/main/kotlin/com/zsw/huixiang/MainActivity.kt @@ -1,5 +1,6 @@ package com.zsw.huixiang +import android.content.Intent import android.os.Bundle import android.util.Log import io.dcloud.feature.sdk.DCUniMPSDK @@ -15,8 +16,15 @@ class MainActivity: FlutterActivity() { Log.e("intentUrl:", "url: ${intent.data}" ) flutterEngine?.plugins?.add(MinPlugin()) + flutterEngine?.plugins?.add(BridgePlugin().apply { + intentAction = intent.data + }) } + override fun onNewIntent(intent: Intent) { + super.onNewIntent(intent) + Log.e("intentUrl:", "onNewIntent: ${intent.data}" ) + } override fun onDestroy() { super.onDestroy() diff --git a/ios/Runner/AppDelegate.mm b/ios/Runner/AppDelegate.mm index 6b75bbb1..11b6cc96 100644 --- a/ios/Runner/AppDelegate.mm +++ b/ios/Runner/AppDelegate.mm @@ -4,6 +4,7 @@ #import "UniappPlugin.h" #import "WXApi.h" + @implementation AppDelegate - (BOOL)application:(UIApplication *)application @@ -11,6 +12,7 @@ [GeneratedPluginRegistrant registerWithRegistry:self]; // Override point for customization after application launch. + // 配置参数 NSMutableDictionary *options = [NSMutableDictionary dictionaryWithDictionary:launchOptions]; @@ -69,7 +71,18 @@ //result(FlutterMethodNotImplemented); }]; + // 消息内容获取 + NSDictionary *remoteNotification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; + NSLog(@"notification dic: %@", remoteNotification); + FlutterMethodChannel* bridgeAppChannel = [FlutterMethodChannel methodChannelWithName:@"bridge" binaryMessenger:(NSObject *)controller]; + [bridgeAppChannel setMethodCallHandler:^(FlutterMethodCall * _Nonnull call, FlutterResult _Nonnull result) { + NSString * method = call.method; + if ([method isEqual:@"action"]) { + result([NSNumber numberWithBool:YES]); + } + //result(FlutterMethodNotImplemented); + }]; return [super application:application didFinishLaunchingWithOptions:launchOptions]; } diff --git a/ios/Runner/Bridge.swift b/ios/Runner/Bridge.swift new file mode 100644 index 00000000..dbad8889 --- /dev/null +++ b/ios/Runner/Bridge.swift @@ -0,0 +1,13 @@ +// +// Bridge.swift +// Runner +// +// Created by 冯美坎 on 2021/8/9. +// +import Flutter +import UIKit + +class Bridge: NSObject, FlutterPlugin { + + +} diff --git a/lib/main.dart b/lib/main.dart index ebed8b0e..c18695fe 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -52,6 +52,7 @@ import 'package:huixiang/union/store_details_page.dart'; import 'package:huixiang/union/union_details_page.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/utils/bridge.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:sharesdk_plugin/sharesdk_interface.dart'; diff --git a/lib/main_page.dart b/lib/main_page.dart index 7805564b..0ea03477 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -11,6 +11,7 @@ import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/union/union_page.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/utils/bridge.dart'; import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/native_event_handler.dart'; import 'package:permission_handler/permission_handler.dart'; @@ -107,8 +108,17 @@ class _MainPage extends State { } pushRoute() async { + + String startIntent = await Bridge.getStartIntent(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); - String pushData = sharedPreferences.getString("pushData"); + print("intent:$startIntent"); + String pushData = ""; + if (startIntent != null && startIntent != "") { + pushData = startIntent; + // pushData = """{"typed":1,"info":"1420304936817655808"}"""; + } else { + pushData = sharedPreferences.getString("pushData"); + } if (pushData == null || pushData == "") return; Map pushMap = jsonDecode(pushData); if (pushMap != null) { diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 700e9905..3f560aa5 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -14,11 +14,11 @@ import 'package:shared_preferences/shared_preferences.dart'; part 'retrofit_api.g.dart'; -const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -// const base_url = "http://192.168.10.236:8766/app/"; -// const baseUrl = "http://192.168.10.236:8766/app/";/// 本地 +const base_url = "http://192.168.10.236:8766/app/"; +const baseUrl = "http://192.168.10.236:8766/app/";/// 本地 @RestApi(baseUrl: baseUrl) abstract class ApiService { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart deleted file mode 100644 index 5b770fec..00000000 --- a/lib/retrofit/retrofit_api.g.dart +++ /dev/null @@ -1,820 +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 ??= 'https://pos.platform.lotus-wallet.com/app/'; - } - - final Dio _dio; - - String baseUrl; - - @override - Future upload(data, folderId) async { - ArgumentError.checkNotNull(data, 'data'); - ArgumentError.checkNotNull(folderId, 'folderId'); - const _extra = {}; - final queryParameters = {}; - 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>('/file/upload', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future 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 = {}; - final queryParameters = {}; - final _data = {}; - 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: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = _result.data; - return value; - } - - @override - Future memberLogin(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/auth/platform/memberLogin', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future sendVerify(mobile) async { - ArgumentError.checkNotNull(mobile, 'mobile'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/auth/sendVerify/$mobile', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditGoods(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditGoods/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future goodsCategory(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditGoodsCategory/page', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditGoodsById(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/creditGoods/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryInfo() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/info', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future editInfo(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/member/editMemberInfo', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future signInInfo() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/member/signInInfo', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future signIn() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/signIn', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future recharge(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/wallet/recharge', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future receiveCoupon(couponId) async { - ArgumentError.checkNotNull(couponId, 'couponId'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/coupon/receive?couponId=$couponId', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditOrderList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditOrder/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditOrder(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditOrder/create', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future addAddress(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/address/add', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future deleteAddress(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/address/delete', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryAddress(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/address/detail/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryMemberAddress() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/address/queryMemberAddress', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future updateAddress(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/address/update', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryCoupon(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/coupon/centreList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryCard(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/coupon/packageList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryStore(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/store/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future informationList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/information/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future informationInfo(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/information/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future creditOrderReceive(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/creditOrder/receive/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryHome() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/home/home', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryStoreInfo(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/store/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryArticle(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/information/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryBanner(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/banner/page', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryHomeBrand() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/home/brand', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future minLogin(storeId) async { - ArgumentError.checkNotNull(storeId, 'storeId'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/auth/mini/login/$storeId', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryBillInfo(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/member/listBill', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future rankList() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/rankList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future orderList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/order/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future orderDetail(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/order/orderDetail?id=$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future continuePay(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/order/continuePay', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future receiveToCard(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/creditOrder/receive/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future vipList() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/vipList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future vipDetail(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/member/vipDetail/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future msgList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/app-msg/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } - - @override - Future queryMsg(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/app-msg/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson(_result.data); - return value; - } -} diff --git a/lib/utils/bridge.dart b/lib/utils/bridge.dart new file mode 100644 index 00000000..a458f0ef --- /dev/null +++ b/lib/utils/bridge.dart @@ -0,0 +1,17 @@ + + + +import 'package:flutter/services.dart'; + +class Bridge { + + static const MethodChannel _channel1 = const MethodChannel('bridge'); + + static Future getStartIntent() async { + return await _channel1.invokeMethod('action'); + } + + + +} +