th-line.vue 1.8 KB

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