th-line.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <view class="th-line" v-if="lineShow" @click="checkModel">
  3. <view :class="[lineShow?'open-line':'close-line']" @click.stop="()=>{}">
  4. <view class="line-head">线条选择器</view>
  5. <view class="line-box">
  6. <view v-for="(item,index) in lineData" :key="item"
  7. @click="checkline(item)"
  8. :style="{'height':item+'px'}"></view>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. lineShow:false,
  18. lineData:[4,8,12,16,18]
  19. }
  20. },
  21. methods:{
  22. checkModel() {
  23. this.lineShow = !this.lineShow;
  24. },
  25. checkline(item) {
  26. this.lineShow = false;
  27. this.$emit('setLine',item)
  28. }
  29. }
  30. }
  31. </script>
  32. <style scoped lang="scss">
  33. .th-line{
  34. width: 100%;
  35. height: 100%;
  36. background-color: rgba(0,0,0,0.5);
  37. position: fixed;
  38. bottom: 0;
  39. left: 0;
  40. z-index: 100;
  41. display: flex;
  42. align-items: flex-end;
  43. >view{
  44. width: 100%;
  45. height: 500upx;
  46. background: #FFFFFF;
  47. box-shadow: 0 0 10upx #999999;
  48. border-radius: 60upx 60upx 0 0;
  49. .line-head{
  50. text-align: center;
  51. font-size: 30upx;
  52. height: 100upx;
  53. display: flex;
  54. align-items: center;
  55. justify-content: center;
  56. margin-bottom: 20upx;
  57. }
  58. .line-box{
  59. box-sizing: border-box;
  60. padding: 0 70upx;
  61. >view{
  62. margin-bottom:56upx;
  63. width: 100%;
  64. background-color: #000;
  65. }
  66. }
  67. }
  68. }
  69. .open-line{
  70. animation:fadeInUp 0.4s ;
  71. }
  72. .close-line{
  73. animation:fadeInDown 0.5s ;
  74. }
  75. @keyframes fadeInUp {
  76. 0% {
  77. opacity: 0;
  78. -webkit-transform: translate3d(0, 100%, 0);
  79. transform: translate3d(0, 100%, 0)
  80. }
  81. to {
  82. opacity: 1;
  83. -webkit-transform: translateZ(0);
  84. transform: translateZ(0)
  85. }
  86. }
  87. @keyframes fadeInDown {
  88. 0% {
  89. opacity: 0;
  90. -webkit-transform: translate3d(0, -100%, 0);
  91. transform: translate3d(0, -100%, 0)
  92. }
  93. to {
  94. opacity: 1;
  95. -webkit-transform: translateZ(0);
  96. transform: translateZ(0)
  97. }
  98. }
  99. </style>