goods-params-section.vue 3.7 KB

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