cm-product-params.vue 2.5 KB

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