search.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <view class="alldata flexc">
  3. <!-- :start="startDate" :end="endDate" -->
  4. <!-- <view class="list">
  5. <picker :value="className" range-key="className" :range="tablist" @change="bindDateChange" >
  6. <view class="flexc">
  7. <view class="alldatain f15 cofe f500" :style="'text-align:'+textAlign">{{date||'考试班级'}}</view>
  8. <image :src="upimg"></image>
  9. </view>
  10. </picker>
  11. </view> -->
  12. <view class="list">
  13. <picker mode="date" :value="date" @change="bindDateChangea">
  14. <view class="flexc">
  15. <view class="alldatain f15 cofe f500" :style="'text-align:'+textAlign">{{date||'考试时间'}}</view>
  16. <image :src="upimg"></image>
  17. </view>
  18. </picker>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. //:fields="fields" 表示选择器的粒度,默认为 day,App
  24. export default{
  25. props:{
  26. textAlign:{
  27. type: String,
  28. default () {
  29. return 'left'
  30. }
  31. },
  32. fields:{
  33. type: String,
  34. default () {
  35. return 'year'
  36. }
  37. },
  38. timedate:{
  39. type: String,
  40. default () {
  41. return ''
  42. }
  43. },
  44. tablist:{
  45. type: Array,
  46. default () {
  47. return []
  48. }
  49. },
  50. className:{
  51. type: Array,
  52. default () {
  53. return []
  54. }
  55. }
  56. },
  57. data(){
  58. return{
  59. upimg:require("@/mine/static/score/up.png"),
  60. date:''
  61. }
  62. },
  63. mounted() {
  64. if(this.timedate){
  65. this.date=this.timedate;
  66. }
  67. },
  68. methods:{
  69. bindDateChange(e){
  70. var val=e.detail.value
  71. this.date=e.detail.value;
  72. this.$emit("bindDateChange",val)
  73. },
  74. bindDateChangea(e){
  75. var val=e.detail.value
  76. this.date=e.detail.value;
  77. this.$emit("getSearch",this.date)
  78. },
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. // 选择年份
  84. .alldata{padding: 20rpx 36rpx;height: 100rpx;box-sizing: border-box;
  85. .list{width: 33.3%;}
  86. image{width: 22rpx;height: 16rpx;margin-left: 14rpx;}
  87. .alldatain{min-width: 124rpx;}
  88. }
  89. </style>