index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.params" :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. // +----------------------------------------------------------------------
  20. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  21. // +----------------------------------------------------------------------
  22. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  23. // +----------------------------------------------------------------------
  24. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  25. // +----------------------------------------------------------------------
  26. // | Author: CRMEB Team <admin@crmeb.com>
  27. // +----------------------------------------------------------------------
  28. export default {
  29. props: {
  30. specsInfo: {
  31. type: Object,
  32. default: () => {}
  33. },
  34. },
  35. data() {
  36. return {};
  37. },
  38. mounted() {},
  39. methods: {
  40. closeSpecs(){
  41. this.$emit('myevent');
  42. }
  43. }
  44. }
  45. </script>
  46. <style scoped lang="scss">
  47. .specs{
  48. position: fixed;
  49. bottom: 0;
  50. width: 100%;
  51. left: 0;
  52. background-color: #fff;
  53. z-index: 280;
  54. border-radius: 16rpx 16rpx 0 0;
  55. transform: translate3d(0, 100%, 0);
  56. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  57. padding-bottom: 22rpx;
  58. padding-bottom: calc(22rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  59. padding-bottom: calc(22rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  60. .title{
  61. font-size: 32rpx;
  62. color: #282828;
  63. text-align: center;
  64. margin: 38rpx 0 36rpx 0;
  65. position: relative;
  66. font-weight: bold;
  67. .iconfont{
  68. position: absolute;
  69. right: 30rpx;
  70. top:0;
  71. font-size: 36rpx;
  72. font-weight: normal;
  73. color: #999999;
  74. }
  75. }
  76. .list{
  77. height: 750rpx;
  78. margin: 0 30rpx;
  79. color: #999999;
  80. overflow-x: hidden;
  81. overflow-y: auto;
  82. .item{
  83. padding: 30rpx 0;
  84. border-bottom: 1px solid #eee;
  85. .name{
  86. width: 160rpx;
  87. margin-right: 10rpx;
  88. word-break: break-all;
  89. }
  90. .val{
  91. width: 510rpx;
  92. word-break: break-all;
  93. }
  94. }
  95. }
  96. .bnt{
  97. width: 690rpx;
  98. height: 86rpx;
  99. text-align: center;
  100. line-height: 86rpx;
  101. border-radius: 43rpx;
  102. background-color: var(--view-theme);
  103. font-size: 30rpx;
  104. color: #fff;
  105. margin: 0 auto;
  106. }
  107. }
  108. .specs.on{
  109. transform: translate3d(0, 0, 0);
  110. }
  111. </style>