App.vue 977 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. //#ifdef APP-PLUS
  5. // console.log('App Launch')
  6. //判断客户端类别
  7. if (/MicroMessenger/.test(window.navigator.userAgent)) {
  8. uni.setStorage({
  9. key:'userAgent',
  10. data:'wxAgent'
  11. });
  12. // console.log('handleAliPay 微信客户端');
  13. } else if (/AlipayClient/.test(window.navigator.userAgent)) {
  14. uni.setStorage({
  15. key:'userAgent',
  16. data:'aliAgent'
  17. });
  18. // console.log('handleAliPay 支付宝客户端');
  19. } else {
  20. uni.setStorage({
  21. key:'userAgent',
  22. data:'otherAgent'
  23. });
  24. // console.log('handleAliPay 其他浏览器');
  25. };
  26. //#endif
  27. // this.$wxApi.config();
  28. },
  29. onShow: function() {
  30. // console.log('App Show')
  31. },
  32. onHide: function() {
  33. // console.log('App Hide')
  34. }
  35. }
  36. </script>
  37. <style lang="scss">
  38. @import "./static/css/iconfont.css";
  39. @import "uview-ui/index.scss";
  40. @import "./mycss.scss";
  41. /*每个页面公共css */
  42. </style>