openExternalUrl.js 291 B

12345678910111213
  1. export function openExternalUrl(url) {
  2. // #ifdef APP-PLUS
  3. plus.runtime.openURL(url, (error) => {
  4. if (error) {
  5. uni.showToast({ title: '打开失败', icon: 'none' });
  6. }
  7. });
  8. // #endif
  9. // #ifdef H5
  10. window.open(url, '_blank');
  11. // #endif
  12. }