cm-product-params.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. </scroll-view>
  24. </cm-drawer>
  25. </template>
  26. <script>
  27. import CmDrawer from '../cm-drawer/cm-drawer.vue'
  28. export default {
  29. components: {
  30. CmDrawer
  31. },
  32. props: {
  33. productInfo: {
  34. type: Object,
  35. default: () => {}
  36. },
  37. visible: {
  38. type: Boolean,
  39. default: false
  40. }
  41. },
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .cm-product-params {
  46. width: 100%;
  47. padding-top: 24rpx;
  48. height: 320rpx;
  49. .content-tr {
  50. width: 100%;
  51. min-height: 58rpx;
  52. line-height: 58rpx;
  53. display: flex;
  54. .content-td {
  55. display: flex;
  56. flex: 3;
  57. font-size: 26rpx;
  58. color: #999999;
  59. line-height: 58rpx;
  60. text-align: right;
  61. }
  62. .content-th {
  63. display: flex;
  64. flex: 7;
  65. font-size: 26rpx;
  66. color: #333333;
  67. line-height: 58rpx;
  68. text-align: left;
  69. padding-left: 10rpx;
  70. }
  71. }
  72. }
  73. </style>