home.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view class="container">
  3. <view class="navigation-bar">燃脂功能训练帮手</view>
  4. <view class="block">
  5. <view class="item" style="background-color: rgb(255,61,104);" @click="onClick(0, $event)">基础代谢率</view>
  6. <view class="item" style="background-color: rgb(250,157,153);" @click="onClick(1, $event)">每天消耗总热量</view>
  7. </view>
  8. <view class="block">
  9. <view class="item" style="background-color: rgb(250,204,177);" @click="onClick(2, $event)">有氧运动心律</view>
  10. <view class="item" style="background-color: rgb(201,199,171);" @click="onClick(3, $event)">体脂率</view>
  11. </view>
  12. <!-- <view class="block">
  13. <view class="item" style="background-color: rgb(132,175,155);" @click="onClick(4, $event)">E</view>
  14. <view class="item" style="background-color: rgb(46,32,52);" @click="onClick(5, $event)">F</view>
  15. </view> -->
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. // block-color:
  23. }
  24. },
  25. onLoad() {
  26. },
  27. methods: {
  28. onClick: function(id,e) {
  29. // console.log(id); // 1
  30. // console.log(e); // 事件对象
  31. switch (id){
  32. case 0:
  33. {
  34. uni.navigateTo({
  35. url: "/pages/basalMetabolism/basalMetabolism",
  36. });
  37. }
  38. break;
  39. case 1:
  40. {
  41. uni.navigateTo({
  42. url: "/pages/dayCalorie/dayCalorie",
  43. });
  44. }
  45. break;
  46. case 2:
  47. {
  48. uni.navigateTo({
  49. url: "/pages/heartRhythms/heartRhythms",
  50. });
  51. }
  52. break;
  53. case 3:
  54. {
  55. uni.navigateTo({
  56. url: "/pages/bodyFatRatio/bodyFatRatio",
  57. });
  58. }
  59. break;
  60. default:
  61. break;
  62. }
  63. },
  64. }
  65. }
  66. </script>
  67. <style lang="scss">
  68. .container {
  69. display: flex;
  70. flex-direction: column;
  71. align-items: center;
  72. justify-content: center;
  73. height: 100%;
  74. width:100%;
  75. // 测试
  76. // border: 1px solid rgb(255,0,0);
  77. // box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 1);
  78. // border-bottom: 1px solid #DDDDDD;
  79. }
  80. .navigation-bar
  81. {
  82. display: flex;
  83. align-items: center;
  84. justify-content: center;
  85. width:100%;
  86. height: 15%;
  87. font-weight: 700;
  88. color: white;
  89. background-color: rgb(115,164,164);
  90. }
  91. .block{
  92. display: flex;
  93. flex-direction: row;
  94. align-items: center;
  95. justify-content: center;
  96. width:100%;
  97. height: 100%;
  98. // 测试
  99. // margin: 10rpx;
  100. // border: 3px solid rgb(144,238,144);
  101. }
  102. .item{
  103. display: flex;
  104. align-items: center;
  105. justify-content: center;
  106. height: 100%;
  107. width: 100%;
  108. color: white;
  109. // 测试
  110. // margin: 10rpx;
  111. // border: 1px solid rgb(0,0,255);
  112. }
  113. /* 解决⼩程序和app滚动条的问题 */
  114. /* #ifdef MP-WEIXIN || APP-PLUS */
  115. ::-webkit-scrollbar {
  116. display: none;
  117. width: 0 !important;
  118. height: 0 !important;
  119. -webkit-appearance: none;
  120. background: transparent;
  121. color: transparent;
  122. }
  123. /* #endif */
  124. /* 解决H5 的问题 */
  125. /* #ifdef H5 */
  126. uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
  127. /* 隐藏滚动条,但依旧具备可以滚动的功能 */
  128. display: none;
  129. width: 0 !important;
  130. height: 0 !important;
  131. -webkit-appearance: none;
  132. background: transparent;
  133. color: transparent;
  134. }
  135. /* #endif */
  136. </style>