goods-params-section.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="params-section" v-if="paramList">
  3. <view class="section" @click="onShowDetail">
  4. <view class="label">参数:</view>
  5. <view class="list">
  6. <text>品牌</text>
  7. <text>分类...</text>
  8. </view>
  9. <view class="iconfont icon-chakangengduo"></view>
  10. </view>
  11. <uni-popup ref="popup" type="bottom">
  12. <view class="popup-content" :style="{ paddingBottom: safeArea ? 0 : '32rpx' }">
  13. <view class="close iconfont icon-iconfontguanbi" @click="$refs.popup.close()"></view>
  14. <view class="title">商品参数</view>
  15. <view class="content">
  16. <view class="params-list">
  17. <view class="row" v-for="item in paramList" :key="item.id">
  18. <text class="label" v-text="item.paramsName"></text>
  19. <text class="content" v-text="item.paramsContent"></text>
  20. </view>
  21. </view>
  22. <tui-button
  23. type="base"
  24. width="600rpx"
  25. height="90rpx"
  26. @click="$refs.popup.close()"
  27. shape="circle"
  28. :size="26"
  29. >
  30. 了解
  31. </tui-button>
  32. </view>
  33. </view>
  34. </uni-popup>
  35. </view>
  36. </template>
  37. <script>
  38. import { mapGetters } from 'vuex'
  39. export default {
  40. name: 'goods-params-section',
  41. props: {
  42. paramList: {
  43. type: [Array, Object],
  44. default: null
  45. }
  46. },
  47. computed: {
  48. ...mapGetters(['safeArea'])
  49. },
  50. methods: {
  51. onShowDetail() {
  52. this.$refs.popup.open()
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="scss" scoped>
  58. .params-section {
  59. padding: 24rpx;
  60. background-color: #fff;
  61. .section {
  62. @extend .cm-flex-between;
  63. font-size: 28rpx;
  64. .label {
  65. color: #666;
  66. }
  67. .list {
  68. flex: 1;
  69. margin: 0 24rpx;
  70. color: #333;
  71. text {
  72. margin-right: 24rpx;
  73. }
  74. }
  75. .iconfont {
  76. font-size: 28rpx;
  77. color: #666;
  78. }
  79. }
  80. }
  81. .popup-content {
  82. position: relative;
  83. padding: 32rpx;
  84. background-color: #fff;
  85. border-radius: 16rpx 16rpx 0 0;
  86. &::after {
  87. position: absolute;
  88. content: '';
  89. width: 100%;
  90. height: 80rpx;
  91. bottom: -80rpx;
  92. left: 0;
  93. background-color: #fff;
  94. }
  95. .close {
  96. position: absolute;
  97. right: 24rpx;
  98. top: 24rpx;
  99. color: #999;
  100. font-size: 32rpx;
  101. }
  102. .title {
  103. text-align: center;
  104. font-size: 32rpx;
  105. color: #333;
  106. }
  107. .content {
  108. @extend .cm-flex-center;
  109. flex-direction: column;
  110. .params-list {
  111. width: 100%;
  112. padding: 24rpx 0;
  113. .row {
  114. @extend .cm-flex-between;
  115. justify-content: flex-start;
  116. padding: 12rpx 0;
  117. line-height: 1.6;
  118. font-size: 24rpx;
  119. .label {
  120. width: 160rpx;
  121. color: #999;
  122. &::after {
  123. content: ':';
  124. }
  125. }
  126. .content {
  127. color: #333;
  128. }
  129. }
  130. }
  131. }
  132. }
  133. </style>