index.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <!-- 产品参数 -->
  3. <view>
  4. <view class="specs" :class="specsInfo.show === true ? 'on' : ''">
  5. <view class="title">产品参数<text class="iconfont icon-guanbi5" @click="closeSpecs"></text></view>
  6. <view class="list">
  7. <view class="item acea-row" v-for="(item,index) in specsInfo.specs" :key="index">
  8. <view class="name">{{item.name}}</view>
  9. <view class="val">{{item.value}}</view>
  10. </view>
  11. </view>
  12. <view class="bnt" @click="closeSpecs">完成</view>
  13. <slot name="bottom"></slot>
  14. </view>
  15. <view class="mask" @touchmove.prevent :hidden="specsInfo.show === false" @click="closeSpecs"></view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. specsInfo: {
  22. type: Object,
  23. default: () => {}
  24. },
  25. },
  26. data() {
  27. return {};
  28. },
  29. mounted() {},
  30. methods: {
  31. closeSpecs(){
  32. this.$emit('myevent');
  33. }
  34. }
  35. }
  36. </script>
  37. <style scoped lang="scss">
  38. .specs{
  39. position: fixed;
  40. bottom: 0;
  41. width: 100%;
  42. left: 0;
  43. background-color: #fff;
  44. z-index: 280;
  45. border-radius: 16rpx 16rpx 0 0;
  46. transform: translate3d(0, 100%, 0);
  47. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  48. padding-bottom: 22rpx;
  49. padding-bottom: calc(22rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  50. padding-bottom: calc(22rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  51. .title{
  52. font-size: 32rpx;
  53. color: #282828;
  54. text-align: center;
  55. margin: 38rpx 0 36rpx 0;
  56. position: relative;
  57. .iconfont{
  58. position: absolute;
  59. right: 30rpx;
  60. top:0;
  61. font-size: 36rpx;
  62. }
  63. }
  64. .list{
  65. height: 750rpx;
  66. margin: 0 30rpx;
  67. overflow-x: hidden;
  68. overflow-y: auto;
  69. .item{
  70. padding: 30rpx 0;
  71. border-bottom: 1px solid #eee;
  72. .name{
  73. width: 160rpx;
  74. color: #999999;
  75. margin-right: 10rpx;
  76. word-break: break-all;
  77. }
  78. .val{
  79. width: 510rpx;
  80. word-break: break-all;
  81. }
  82. }
  83. }
  84. .bnt{
  85. width: 690rpx;
  86. height: 86rpx;
  87. text-align: center;
  88. line-height: 86rpx;
  89. border-radius: 43rpx;
  90. background-color: var(--view-theme);
  91. font-size: 30rpx;
  92. color: #fff;
  93. margin: 0 auto;
  94. }
  95. }
  96. .specs.on{
  97. transform: translate3d(0, 0, 0);
  98. }
  99. </style>