class MiniStartOptions {/// 小程序的进入路径String? entryPath;/// 启动时始终更新小程序bool? isForceUpdate;/// 启动时传递给小程序的字符串参数String? params;}
class ScanResult {/// qrcode 或条形码的结果字符串包含String? result;/// 代码类型String? scanType;/// 结果字符串的字符编码String? charset;}
class AppInfo {/// 小程序idString appId;/// 小程序包类型(发行版、开发版等)。请参阅 [AppVerType]int appVerType;/// 小程序版本String version;/// 小程序名称String? name;/// 小程序 icon 链接String? iconUrl;/// 小程序说明String? appIntro;/// 小程序开发员String? appDeveloper;/// 小程序发布时间int time;}
/// 小程序软件包类型的常数,查看 [AppInfo]class AppVerType {static const int online = 0;static const int develop = 1;static const int preview = 2;static const int experience = 3;}
class AccountInfo {/// 活期账户的唯一 IDString? uid;/// 头像的链接String? avatarUrl;/// 往来帐户名称String? accountName;}
abstract class OpenApiHandler {//当小程序调用 wx.requestPayment,请求第三方支付操作时调用Future<Map<String, dynamic>> requestPayment(AppInfo appInfo, Map<Object?, Object?> params);/// 当小程序调用 wx.getUserProfile 请求主机应用程序的用户信息时调用///Future<Map<String, dynamic>> getUserProfile(AppInfo appInfo, Map<Object?, Object?> params);/// 当小程序调用 wx.login 时调用,请求主机应用程序的登录证书///Future<Map<String, dynamic>> login(AppInfo appInfo, Map<Object?, Object?> params);/// 当小程序调用 wx.checkSession 时调用,请求主机应用程序的登录状态/// 检查登录是否已过期///Future<Map<String, dynamic>> checkSession(AppInfo appInfo, Map<Object?, Object?> params);/// 当小程序调用 wx.getUserInfo 时调用,已被 wx.getUserProfile 过时/// 兼容早期的小程序 api///Future<Map<String, dynamic>> getUserInfo(AppInfo appInfo, Map<Object?, Object?> params);/// 当小程序调用 wx.getPhoneNumber 时调用,获取当前用户的电话号码///Future<Map<String, dynamic>> getPhoneNumber(AppInfo appInfo, Map<Object?, Object?> params);}
abstract class TcmppPlatformEventHandler {Future<String> getAppName() async {return "";}Future<String> getAppVersion() async {return "";}Future<List<CustomMenu>> getCustomMenus() async {return [];}Future<void> customMenuClick(String menuId, ShareData? shareMenu) async {}Future<void> onMiniProgramStateChange(String appId, MiniProgramState state) async {}Future<bool> reportEvent(int eventId, String eventName, AppInfo appInfo,Map<Object?, Object?> params) async {return false;}}
本页内容是否解决了您的问题?