爱简收旧衣按件回收前端代码仓库
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.

102 lines
2.3 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
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. console.log('App Show')
  23. },
  24. onHide: function() {
  25. console.log('App Hide')
  26. },
  27. methods: {
  28. getBannerList() {
  29. // 假设 this.$api 可用
  30. this.$api && this.$api('getBanner', {}, res => {
  31. if (res && res.code === 200 && Array.isArray(res.result)) {
  32. getApp().globalData.bannerList = res.result
  33. console.log(getApp().globalData.bannerList,'bannerList')
  34. uni.$emit('bannerListUpdated')
  35. }
  36. })
  37. },
  38. getPricePreviewList() {
  39. this.$api && this.$api('getPricePreviewClassList', {}, res => {
  40. if (res && res.success && Array.isArray(res.result)) {
  41. getApp().globalData.pricePreviewList = res.result
  42. uni.$emit('pricePreviewListUpdated')
  43. }
  44. })
  45. },
  46. getConfigData() {
  47. this.$api('getConfig', {}, res => {
  48. // console.log('Config data response:', JSON.parse(JSON.stringify(res)) )
  49. if (res && res.success && Array.isArray(res.result)) {
  50. getApp().globalData.configData = res.result
  51. // console.log('Config data set:', JSON.parse(JSON.stringify(this.configData)) )
  52. }
  53. })
  54. },
  55. }
  56. }
  57. </script>
  58. <style >
  59. /* // @import "./uni_modules/vk-uview-ui/index.scss"; */
  60. /*每个页面公共css */
  61. .uni-tabbar-bottom{
  62. display: none;
  63. }
  64. .icon {
  65. width: 50rpx;
  66. height: 50rpx;
  67. }
  68. .nav-bar{
  69. /* margin-top: calc(70rpx + env(safe-area-inset-top)); */
  70. height: 30%;
  71. display: flex;
  72. justify-content: center;
  73. }
  74. /* 每个页面公共css */
  75. /* 解决小程序和app滚动条的问题 */
  76. ::-webkit-scrollbar {
  77. display: none;
  78. width: 0 !important;
  79. height: 0 !important;
  80. -webkit-appearance: none;
  81. background: transparent;
  82. color: transparent;
  83. }
  84. /* 解决H5的问题 */
  85. uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
  86. display: none;
  87. width: 0 !important;
  88. height: 0 !important;
  89. -webkit-appearance: none;
  90. background: transparent;
  91. color: transparent;
  92. }
  93. </style>