cm-product-params.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <cm-drawer title="商品参数" :visible="visible" @close="$emit('close')" position="bottom">
  3. <scroll-view scroll-y="true" class="cm-product-params">
  4. <view class="content-tr">
  5. <view class="content-td">品牌:</view>
  6. <view class="content-th">{{ productInfo.brandName == null ? '其他' : productInfo.brandName }}</view>
  7. </view>
  8. <view class="content-tr">
  9. <view class="content-td">包装规格:</view> <view class="content-th">{{ productInfo.unit }}</view>
  10. </view>
  11. <view class="content-tr">
  12. <view class="content-td">库存:</view> <view class="content-th">{{ productInfo.stock }}</view>
  13. </view>
  14. <view
  15. class="content-tr"
  16. v-if="productInfo.parametersList.length > 0"
  17. v-for="(item, index) in productInfo.parametersList"
  18. :key="index"
  19. >
  20. <view class="content-td">{{ item.paramsName }}:</view>
  21. <view class="content-th">{{ item.paramsContent }}</view>
  22. </view>
  23. <view class="btn" @click="$emit('close')">了解</view>
  24. </scroll-view>
  25. </cm-drawer>
  26. </template>
  27. <script>
  28. import CmDrawer from '../cm-drawer/cm-drawer.vue'
  29. export default {
  30. components: {
  31. CmDrawer
  32. },
  33. props: {
  34. productInfo: {
  35. type: Object,
  36. default: () => {}
  37. },
  38. visible: {
  39. type: Boolean,
  40. default: false
  41. }
  42. }
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. .cm-product-params {
  47. width: 100%;
  48. padding-top: 24rpx;
  49. height: 320rpx;
  50. .content-tr {
  51. width: 100%;
  52. min-height: 58rpx;
  53. line-height: 58rpx;
  54. display: flex;
  55. .content-td {
  56. display: flex;
  57. flex: 3;
  58. font-size: 26rpx;
  59. color: #999999;
  60. line-height: 58rpx;
  61. text-align: right;
  62. }
  63. .content-th {
  64. display: flex;
  65. flex: 7;
  66. font-size: 26rpx;
  67. color: #333333;
  68. line-height: 58rpx;
  69. text-align: left;
  70. padding-left: 10rpx;
  71. }
  72. }
  73. }
  74. .btn {
  75. width: 100%;
  76. height: 88rpx;
  77. margin-top: 32px;
  78. background: #ff457b;
  79. line-height: 88rpx;
  80. text-align: center;
  81. color: #ffffff;
  82. font-size: 28rpx;
  83. border-radius: 44rpx;
  84. }
  85. </style>