Commit dfd4d15d7221ca6f4db2d99d4c9e365b2a64e1ac
1 parent
de2a6c02
添加联系客服功能
Showing
2 changed files
with
30 additions
and
9 deletions
ios/Runner/Info.plist
... | ... | @@ -22,15 +22,6 @@ |
22 | 22 | <string>$(MARKETING_VERSION)</string> |
23 | 23 | <key>CFBundleSignature</key> |
24 | 24 | <string>????</string> |
25 | - <key>LSApplicationQueriesSchemes</key> | |
26 | - <array> | |
27 | - <string>wechat</string> | |
28 | - <string>weixin</string> | |
29 | - <string>weixinULAPI</string> | |
30 | - <string>weixinURLParamsAPI</string> | |
31 | - <string>alipay</string> | |
32 | - <string>alipayshare</string> | |
33 | - </array> | |
34 | 25 | <key>CFBundleURLTypes</key> |
35 | 26 | <array> |
36 | 27 | <dict> |
... | ... | @@ -68,6 +59,16 @@ |
68 | 59 | <string>$(CURRENT_PROJECT_VERSION)</string> |
69 | 60 | <key>LSApplicationCategoryType</key> |
70 | 61 | <string></string> |
62 | + <key>LSApplicationQueriesSchemes</key> | |
63 | + <array> | |
64 | + <string>tel</string> | |
65 | + <string>wechat</string> | |
66 | + <string>weixin</string> | |
67 | + <string>weixinULAPI</string> | |
68 | + <string>weixinURLParamsAPI</string> | |
69 | + <string>alipay</string> | |
70 | + <string>alipayshare</string> | |
71 | + </array> | |
71 | 72 | <key>LSRequiresIPhoneOS</key> |
72 | 73 | <true/> |
73 | 74 | <key>NSAppTransportSecurity</key> | ... | ... |
lib/pages/user/user_page.dart
... | ... | @@ -14,6 +14,7 @@ import 'package:wow_english/models/user_entity.dart'; |
14 | 14 | import 'package:wow_english/pages/user/bloc/user_bloc.dart'; |
15 | 15 | import 'package:wow_english/route/route.dart'; |
16 | 16 | import 'package:wow_english/utils/image_util.dart'; |
17 | +import 'package:url_launcher/url_launcher.dart'; | |
17 | 18 | |
18 | 19 | class UserPage extends StatelessWidget { |
19 | 20 | const UserPage({super.key}); |
... | ... | @@ -190,6 +191,17 @@ class _UserView extends StatelessWidget { |
190 | 191 | 12.verticalSpace, |
191 | 192 | OutlinedButton( |
192 | 193 | onPressed: () { |
194 | + String phone ='tel:+8618856084180'; | |
195 | + _launchPhone(phone); | |
196 | + }, | |
197 | + style: normalButtonStyle, | |
198 | + child: Text( | |
199 | + "联系客服", | |
200 | + style: textStyle21sp, | |
201 | + )), | |
202 | + 12.verticalSpace, | |
203 | + OutlinedButton( | |
204 | + onPressed: () { | |
193 | 205 | pushNamed(AppRouteName.setting); |
194 | 206 | }, |
195 | 207 | style: normalButtonStyle, |
... | ... | @@ -246,4 +258,12 @@ class _UserView extends StatelessWidget { |
246 | 258 | )); |
247 | 259 | }, |
248 | 260 | ); |
261 | + | |
262 | + void _launchPhone(String phone) async { | |
263 | + if (await canLaunchUrl(Uri.parse(phone))) { | |
264 | + await launchUrl(Uri.parse(phone)); | |
265 | + } else { | |
266 | + throw 'Could not phone $phone'; | |
267 | + } | |
268 | + } | |
249 | 269 | } | ... | ... |