globalFunctionsForApp.ts 790 B

12345678910111213141516171819202122232425262728293031323334
  1. import {
  2. isWeiXinBrowser
  3. } from './globalFunctions'
  4. declare const JyObj: any
  5. const inWeiXinBrowser = isWeiXinBrowser()
  6. // 是否是微信浏览器
  7. // 参数0隐藏底部导航,参数1,显示底部导航
  8. export function hiddenBottomBar (params = 0) {
  9. // 如果是app端,隐藏底部导航
  10. if (!inWeiXinBrowser) {
  11. try {
  12. JyObj.hiddenBottom(params + '')
  13. } catch (error) {
  14. console.log(error)
  15. }
  16. }
  17. }
  18. // 分享封装
  19. export function shareToOthers (options: any = {}) {
  20. if (inWeiXinBrowser) {
  21. // 微信分享
  22. } else {
  23. // app分享
  24. try {
  25. // options.type--1微信分享,2qq分享,3朋友圈分享
  26. JyObj.share(options.type, options.title, options.content, options.link)
  27. } catch (error) {
  28. console.log(error)
  29. }
  30. }
  31. }