App.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <script>
  2. import {
  3. getGoodsTypeObj,
  4. getUserDetail
  5. } from '@/api/common.js';
  6. export default {
  7. onLaunch: function() {
  8. console.log('App Launch')
  9. },
  10. onShow: function() {
  11. console.log('App Show')
  12. // 获取商品类型字段
  13. // getGoodsTypeObj().then(res => {
  14. // if (res.state == 'Success') {
  15. // uni.setStorageSync('goodsTypeObj',JSON.stringify(res.content))
  16. // }
  17. // })
  18. },
  19. onHide: function() {
  20. console.log('App Hide')
  21. // 解决我的页面多个登录窗堆叠问题
  22. let pages = getCurrentPages()
  23. let currentPage = pages[pages.length - 1]
  24. if(currentPage.route == 'pages/my/index'){
  25. uni.reLaunch({
  26. url:'/pages/index/index'
  27. })
  28. }
  29. },
  30. }
  31. </script>
  32. <style lang="scss">
  33. /*每个页面公共css */
  34. @import "@/uni_modules/uview-ui/index.scss";
  35. .tag1{
  36. display: inline-block;
  37. width: 70rpx;
  38. height: 24rpx;
  39. line-height: 24rpx;
  40. text-align: center;
  41. background: #E4F5FF;
  42. border-radius: 4rpx 4rpx 12rpx 4rpx;
  43. font-size: 16rpx;
  44. color: #222222;
  45. margin-left: 8rpx;
  46. }
  47. .tag2{
  48. display: inline-block;
  49. width: 70rpx;
  50. height: 24rpx;
  51. line-height: 24rpx;
  52. text-align: center;
  53. background: #FAEBFF;
  54. border-radius: 4rpx 4rpx 12rpx 4rpx;
  55. font-size: 16rpx;
  56. color: #222222;
  57. margin-left: 8rpx;
  58. }
  59. .tag3{
  60. display: inline-block;
  61. width: 70rpx;
  62. height: 24rpx;
  63. line-height: 24rpx;
  64. text-align: center;
  65. background: linear-gradient( 180deg, #272624 0%, #FFE1A5 100%);
  66. border-radius: 4rpx 4rpx 12rpx 4rpx;
  67. font-size: 16rpx;
  68. color: #FFE1A5;
  69. margin-left: 8rpx;
  70. }
  71. </style>