login.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view class="container">
  3. <view class="navigation-bar">燃脂功能训练帮手</view>
  4. <view class="bg">
  5. <image class="bg-img" src="../../static/login/Bg.png" mode="aspectFit"></image>
  6. <view class="boy">
  7. <image class="logo" src="/static/login/Beard.png" mode="aspectFit" @click="onClick(0, $event)"></image>
  8. <view class="boy-title">我是男生</view>
  9. </view>
  10. <view class="girl" >
  11. <image class="logo" src="/static/login/Lips.png" mode="aspectFit" @click="onClick(1, $event)"></image>
  12. <view class="girl-title">我是女生</view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. }
  22. },
  23. onLoad() {
  24. },
  25. methods: {
  26. onClick: function(id,e) {
  27. getApp().globalData.gender = id;
  28. console.log('getApp().globalData.gender=',getApp().globalData.gender)
  29. uni.navigateTo({
  30. url: '/pages/home/home',
  31. animationType: 'slide-in-left',
  32. /*
  33. slide-in-right 右侧
  34. slide-in-left 左侧
  35. slide-in-top 顶部
  36. slide-in-bottom 底部
  37. pop-in 新窗体从左侧进入,且老窗体被挤压而出
  38. fade-in 新窗体从透明到不透明逐渐显示
  39. zoom-out 新窗体从小到大缩放显示
  40. zoom-fade-out 新窗体从小到大逐渐放大并且从透明到不透明逐渐显示
  41. none 无动画
  42. */
  43. animationDuration: 2000,
  44. success: res => {},
  45. fail: () => {},
  46. complete: () => {}
  47. });
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss">
  53. .container {
  54. display: flex;
  55. flex-direction: column;
  56. align-items: center;
  57. justify-content: center;
  58. width:100%;
  59. height: 100vh;
  60. // testing
  61. //border: 1px solid rgb(0,0,0);
  62. }
  63. .navigation-bar
  64. {
  65. display: flex;
  66. align-items: center;
  67. justify-content: center;
  68. width:100%;
  69. height: 6%;
  70. font-weight: 700;
  71. color: black;
  72. font-size: 54rpx;
  73. background-color: white;
  74. // testing
  75. // border: 1px solid rgb(255,0,0);
  76. // background-color: rgb(253,222,157);
  77. }
  78. .bg
  79. {
  80. display: flex;
  81. flex-direction: column;
  82. align-items: center;
  83. justify-content: center;
  84. width:100%;
  85. height: 100%;
  86. .bg-img{
  87. position: absolute;
  88. width:100%;
  89. height: 100%;
  90. top:0;
  91. left:0;
  92. z-index: 0;
  93. }
  94. // testing
  95. // border: 13px solid rgb(253,222,157);
  96. // background-color: rgb(253,222,157);
  97. }
  98. .boy{
  99. display: flex;
  100. flex-direction: column;
  101. align-items: center;
  102. justify-content: center;
  103. width:50%;
  104. height:50%;
  105. z-index: 1;
  106. // 测试
  107. // margin: 10rpx;
  108. // border: 3px solid rgb(144,238,144);
  109. }
  110. .girl{
  111. display: flex;
  112. flex-direction: column;
  113. align-items: center;
  114. justify-content: center;
  115. width:50%;
  116. height:100%;
  117. }
  118. .logo
  119. {
  120. margin: 75rpx;
  121. width: 230rpx;
  122. height: 230rpx;
  123. }
  124. .boy-title {
  125. color: #4D857C;
  126. font-weight: 700;
  127. font-size: 54rpx;
  128. z-index: 1;
  129. }
  130. .girl-title {
  131. color: #B35D5C;
  132. font-weight: 700;
  133. font-size: 54rpx;
  134. z-index: 1;
  135. }
  136. </style>