爱简收旧衣按件回收前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
2.4 KiB

2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <script>
  2. import routerInterception from '@/utils/router-interception.js'
  3. export default {
  4. globalData: {
  5. flag: 1,
  6. login_status:true,
  7. phone:null,
  8. bannerList: [],
  9. pricePreviewList: [],
  10. configData: [],
  11. },
  12. onLaunch: function() {
  13. routerInterception()
  14. this.getBannerList()
  15. this.getPricePreviewList()
  16. this.getConfigData()
  17. // console.log(this.$utils)
  18. console.log('App Launch')
  19. },
  20. onLoad: function() {
  21. this.getBannerList()
  22. this.getConfigData()
  23. console.log('App Show')
  24. },
  25. onHide: function() {
  26. console.log('App Hide')
  27. },
  28. methods: {
  29. getBannerList() {
  30. // 假设 this.$api 可用
  31. this.$api && this.$api('getBanner', {}, res => {
  32. if (res && res.code === 200 && Array.isArray(res.result)) {
  33. getApp().globalData.bannerList = res.result
  34. console.log(getApp().globalData.bannerList,'bannerList')
  35. uni.$emit('bannerListUpdated')
  36. }
  37. })
  38. },
  39. getPricePreviewList() {
  40. this.$api && this.$api('getPricePreviewClassList', {}, res => {
  41. if (res && res.success && Array.isArray(res.result)) {
  42. getApp().globalData.pricePreviewList = res.result
  43. uni.$emit('pricePreviewListUpdated')
  44. }
  45. })
  46. },
  47. getConfigData() {
  48. this.$api('getConfig', {}, res => {
  49. // console.log('Config data response:', JSON.parse(JSON.stringify(res)) )
  50. if (res && res.success && Array.isArray(res.result)) {
  51. getApp().globalData.configData = res.result
  52. // console.log('Config data set:', JSON.parse(JSON.stringify(this.configData)) )
  53. }
  54. })
  55. },
  56. }
  57. }
  58. </script>
  59. <style >
  60. /* // @import "./uni_modules/vk-uview-ui/index.scss"; */
  61. /*每个页面公共css */
  62. .uni-tabbar-bottom{
  63. display: none;
  64. }
  65. .icon {
  66. width: 50rpx;
  67. height: 50rpx;
  68. }
  69. .nav-bar{
  70. /* margin-top: calc(70rpx + env(safe-area-inset-top)); */
  71. height: 30%;
  72. display: flex;
  73. justify-content: center;
  74. }
  75. /* 每个页面公共css */
  76. /* 解决小程序和app滚动条的问题 */
  77. ::-webkit-scrollbar {
  78. display: none;
  79. width: 0 !important;
  80. height: 0 !important;
  81. -webkit-appearance: none;
  82. background: transparent;
  83. color: transparent;
  84. }
  85. /* 解决H5的问题 */
  86. uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
  87. display: none;
  88. width: 0 !important;
  89. height: 0 !important;
  90. -webkit-appearance: none;
  91. background: transparent;
  92. color: transparent;
  93. }
  94. </style>