diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 21b54b9..9d8de18 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -22,15 +22,6 @@ $(MARKETING_VERSION) CFBundleSignature ???? - LSApplicationQueriesSchemes - - wechat - weixin - weixinULAPI - weixinURLParamsAPI - alipay - alipayshare - CFBundleURLTypes @@ -68,6 +59,16 @@ $(CURRENT_PROJECT_VERSION) LSApplicationCategoryType + LSApplicationQueriesSchemes + + tel + wechat + weixin + weixinULAPI + weixinURLParamsAPI + alipay + alipayshare + LSRequiresIPhoneOS NSAppTransportSecurity diff --git a/lib/pages/user/user_page.dart b/lib/pages/user/user_page.dart index 5c73518..4387097 100644 --- a/lib/pages/user/user_page.dart +++ b/lib/pages/user/user_page.dart @@ -14,6 +14,7 @@ import 'package:wow_english/models/user_entity.dart'; import 'package:wow_english/pages/user/bloc/user_bloc.dart'; import 'package:wow_english/route/route.dart'; import 'package:wow_english/utils/image_util.dart'; +import 'package:url_launcher/url_launcher.dart'; class UserPage extends StatelessWidget { const UserPage({super.key}); @@ -190,6 +191,17 @@ class _UserView extends StatelessWidget { 12.verticalSpace, OutlinedButton( onPressed: () { + String phone ='tel:+8618856084180'; + _launchPhone(phone); + }, + style: normalButtonStyle, + child: Text( + "联系客服", + style: textStyle21sp, + )), + 12.verticalSpace, + OutlinedButton( + onPressed: () { pushNamed(AppRouteName.setting); }, style: normalButtonStyle, @@ -246,4 +258,12 @@ class _UserView extends StatelessWidget { )); }, ); + + void _launchPhone(String phone) async { + if (await canLaunchUrl(Uri.parse(phone))) { + await launchUrl(Uri.parse(phone)); + } else { + throw 'Could not phone $phone'; + } + } }