App.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <style lang="scss">
  2. /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
  3. @import "@/uni_modules/uview-ui/index.scss";
  4. </style>
  5. <script>
  6. import * as API from '@/apis/weixin.js'
  7. import './config/.env.js'
  8. export default {
  9. onLaunch: function() {
  10. console.log('App Launch')
  11. var getOpenId =this.carhelp.getOpenId()
  12. if(getOpenId){
  13. // #ifdef MP-WEIXIN
  14. API.saveLoginRecord({
  15. openId:getOpenId
  16. }).then((res) => {
  17. console.log('App Launch 记录用户登陆')
  18. }).catch(error => {
  19. console.log('App Launch 记录用户登陆 失败')
  20. })
  21. // #endif
  22. }
  23. },
  24. onShow: function() {
  25. console.log('App Show')
  26. },
  27. onHide: function() {
  28. console.log('App Hide')
  29. }
  30. }
  31. </script>
  32. <style>
  33. /*每个页面公共css */
  34. html,body{
  35. margin: 0;
  36. padding: 0;
  37. font-family: 'PingFang Regular';
  38. }
  39. /* 导航栏返回文字 */
  40. /deep/.u-back-text{
  41. font-size: 36rpx !important;
  42. margin-left: 16rpx;
  43. }
  44. </style>