App.vue 944 B

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