detail-cell-params.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view>
  3. <detail-cell
  4. v-if="modelValue.length > 0"
  5. label="参数"
  6. :value="state.paramsTitle"
  7. @click="state.show = true"
  8. ></detail-cell>
  9. <su-popup :show="state.show" round="10" :showClose="true" @close="close">
  10. <view class="ss-modal-box bg-white">
  11. <view class="modal-header">产品参数</view>
  12. <scroll-view
  13. class="modal-content ss-p-t-50"
  14. scroll-y="true"
  15. :scroll-with-animation="true"
  16. :show-scrollbar="false"
  17. @touchmove.stop
  18. >
  19. <view class="sale-item ss-flex ss-col-top" v-for="item in modelValue" :key="item.title">
  20. <view class="item-title">{{ item.title }}</view>
  21. <view class="item-value">{{ item.content }}</view>
  22. </view>
  23. </scroll-view>
  24. <view class="modal-footer ss-flex ss-row-center ss-m-b-20">
  25. <button class="ss-reset-button save-btn ui-Shadow-Main" @tap="state.show = false"
  26. >确定</button
  27. >
  28. </view>
  29. </view>
  30. </su-popup>
  31. </view>
  32. </template>
  33. <script setup>
  34. import { reactive, computed } from 'vue';
  35. import detailCell from './detail-cell.vue';
  36. const props = defineProps({
  37. modelValue: {
  38. type: Object,
  39. default() {
  40. return [];
  41. },
  42. },
  43. });
  44. const state = reactive({
  45. show: false,
  46. paramsTitle: computed(() => {
  47. let titleArray = [];
  48. props.modelValue.map((item) => {
  49. titleArray.push(item.title);
  50. });
  51. return titleArray.join(' · ');
  52. }),
  53. });
  54. function close() {
  55. state.show = false;
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .ss-modal-box {
  60. border-radius: 30rpx 30rpx 0 0;
  61. max-height: 730rpx;
  62. .modal-header {
  63. position: relative;
  64. padding: 30rpx 20rpx 40rpx;
  65. font-size: 36rpx;
  66. font-weight: bold;
  67. }
  68. .modal-content {
  69. padding: 0 30rpx;
  70. max-height: 500rpx;
  71. box-sizing: border-box;
  72. .sale-item {
  73. margin-bottom: 24rpx;
  74. padding-bottom: 24rpx;
  75. border-bottom: 2rpx solid rgba(#dfdfdf, 0.4);
  76. .item-title {
  77. font-size: 28rpx;
  78. font-weight: 500;
  79. line-height: 42rpx;
  80. width: 120rpx;
  81. white-space: normal;
  82. }
  83. .item-value {
  84. font-size: 26rpx;
  85. font-weight: 400;
  86. color: $dark-9;
  87. line-height: 42rpx;
  88. flex: 1;
  89. margin-left: 20rpx;
  90. }
  91. }
  92. }
  93. .modal-footer {
  94. height: 120rpx;
  95. .save-btn {
  96. width: 710rpx;
  97. height: 80rpx;
  98. border-radius: 40rpx;
  99. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  100. color: $white;
  101. }
  102. }
  103. }
  104. </style>