index.vue 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view class="content">
  3. <view class="content_top">
  4. <view class="text_width" style="">选择性别</view>
  5. <view class="sex_box" style="">
  6. <van-radio-group v-model="checked" direction="horizontal">
  7. <van-radio class="radio" name="1" style="">男</van-radio>
  8. <van-radio name="2">女</van-radio>
  9. </van-radio-group>
  10. </view>
  11. <view class="text_width" style="">身高体重</view>
  12. <view class="hw_eight" style="">
  13. <view class="height" style="">
  14. <view class="margin">
  15. <text>身高:</text>
  16. </view>
  17. <view class="">
  18. <input class="input" style="" type="text" />
  19. </view>
  20. cm
  21. </view>
  22. <view class="height">
  23. <view class="margin">
  24. <text>体重:</text>
  25. </view>
  26. <view class="">
  27. <input class="input" style="" type="text" />
  28. </view>
  29. kg
  30. </view>
  31. </view>
  32. <view class="text_width" style="">选择生日</view>
  33. <view class="" style="">
  34. <van-datetime-picker
  35. :value="currentDate"
  36. type="date"
  37. :min-date="minDate"
  38. :max-date="maxDate"
  39. @change="onChange()"
  40. @confirm = "confirm"
  41. />
  42. </view>
  43. </view>
  44. <view class="content_bottom" style="">
  45. <view class="button_box" style="" @click="next_click">
  46. <view class="button" style="">下一步</view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import moment from 'moment'
  53. export default {
  54. data() {
  55. return {
  56. checked:1,
  57. currentDate: new Date(1974,0,1).getTime(),
  58. minDate: new Date(1924,0,1).getTime(),
  59. maxDate: new Date().getTime(),
  60. date:new Date(),
  61. }
  62. },
  63. methods: {
  64. // 选择时间确认
  65. confirm(e){
  66. this.currentDate = e.detail
  67. // let year = new Date(e.detail).getFullYear()
  68. // let month = new Date(e.detail).getMonth() + 1
  69. // let day = new Date(e.detail).getDate()
  70. // if (month >= 1 && month <= 9) {
  71. // month = `0${month}`
  72. // }
  73. // if (day >= 1 && day <= 9) {
  74. // day = `0${day}`
  75. // }
  76. // this.currentDate = `${year}-${month}-${day}`
  77. console.log('11111',this.currentDate);
  78. },
  79. onChange(e){
  80. console.log('22222',this.currentDate);
  81. },
  82. next_click(){
  83. wx.navigateTo({
  84. url:'/pages/Health_record/disease'
  85. })
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .content{
  92. .content_top{
  93. padding: 50rpx;
  94. .text_width{
  95. font-weight: 900;
  96. }
  97. .sex_box{
  98. padding: 40rpx 0;
  99. .radio{
  100. margin-right: 80rpx;
  101. }
  102. }
  103. .hw_eight{
  104. padding: 40rpx 0;
  105. display: flex;
  106. .height{
  107. flex:1;
  108. display: flex;
  109. .margin{
  110. padding-right: 10rpx;
  111. }
  112. .input{
  113. // display:inline-block;
  114. // border: 1px solid black;
  115. width: 150rpx;
  116. }
  117. }
  118. }
  119. }
  120. .content_bottom{
  121. width: 100%;
  122. position: fixed;
  123. bottom: 30rpx;
  124. .button_box{
  125. margin: 0 auto;
  126. width: 80%;
  127. background:linear-gradient(#4dc691,#66cfa1,#7ad7ae);
  128. border-radius: 100rpx;
  129. display: flex;
  130. .button{
  131. flex: 1;
  132. line-height:90rpx;
  133. color: white;
  134. text-align: center;
  135. }
  136. }
  137. }
  138. }
  139. </style>