time-box.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="time-box">
  3. <view class="list">
  4. <picker-view class="picker-view" @change="changetime">
  5. <picker-view-column>
  6. <view class="item" v-for="(item,index) in list" :key="index">{{item.name}}</view>
  7. </picker-view-column>
  8. </picker-view>
  9. </view>
  10. <view class="bottom hflex acenter jcenter">
  11. <view class="btn1" @click="close">取消</view>
  12. <view class="btn2" @click="sure">确定</view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import $api from '@/static/js/api.js'
  18. export default {
  19. props: {
  20. list: {
  21. typeof: Array,
  22. default: []
  23. }
  24. },
  25. data() {
  26. return {
  27. active: 0
  28. }
  29. },
  30. onLoad() {
  31. },
  32. onShow() {
  33. },
  34. onPullDownRefresh() {
  35. },
  36. onReachBottom() {
  37. },
  38. methods: {
  39. changetime(e) {
  40. this.active = e.detail.value[0]
  41. },
  42. close() {
  43. this.$emit('close')
  44. },
  45. sure() {
  46. this.$emit('sure',this.active)
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss">
  52. .time-box::v-deep {
  53. background: #FFFFFF;
  54. border-radius: 28rpx 28rpx 0rpx 0rpx;
  55. padding: 0 28rpx 86rpx;
  56. .uni-picker-view-content {
  57. padding-bottom: 0 !important;
  58. }
  59. .list{
  60. .picker-view {
  61. width: 100%;
  62. height: 500rpx;
  63. margin-top: 20rpx;
  64. }
  65. .item {
  66. line-height: 68rpx;
  67. text-align: center;
  68. }
  69. }
  70. .bottom {
  71. margin: 50rpx 0 0;
  72. z-index: 999;
  73. .btn1 {
  74. width: 276rpx;
  75. height: 80rpx;
  76. background: #E5E5E5;
  77. border-radius: 40rpx;
  78. font-size: 32rpx;
  79. font-family: PingFangSC, PingFang SC;
  80. font-weight: 500;
  81. color: #777777;
  82. line-height: 80rpx;
  83. text-align: center;
  84. margin: 0 46rpx 0 0;
  85. }
  86. .btn2 {
  87. width: 276rpx;
  88. height: 80rpx;
  89. background: #00B0B0;
  90. border-radius: 40rpx;
  91. font-size: 32rpx;
  92. font-family: PingFangSC, PingFang SC;
  93. font-weight: 500;
  94. color: #FFFFFF;
  95. line-height: 80rpx;
  96. text-align: center;
  97. }
  98. }
  99. }
  100. </style>