login.vue 3.1 KB

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