product_b.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <view class="paddingY20 radius10" style="background: #26273B">
  3. <view class="paddingX14 font4 bold color-white">商品详情</view>
  4. <view v-for="item in products" :key="item.spuId" class="item color-white2">
  5. <view class="font4 paddingX14 ">{{LEVEL_MAP[item.level].title}}: {{item.name}}</view>
  6. <template v-if="item.spu && item.spu.parameter">
  7. <view v-for="param in JSON.parse(item.spu.parameter)" :key="param.label" class="paddingX14 font4 marginT4">
  8. {{param.label}}: {{param.value}}
  9. </view>
  10. </template>
  11. <view class="flex-align-center paddingT20">
  12. <image-fit :src="item.spu.cover" :offset="150" :ratio="1.25"/>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import { LEVEL_MAP } from '@/utils/config'
  19. import imageFit from '@/components/image-fit'
  20. export default {
  21. components: { imageFit },
  22. props: {
  23. products: Array
  24. },
  25. data() {
  26. return {
  27. LEVEL_MAP
  28. }
  29. }
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. .item {
  34. margin-top: 30rpx;
  35. .image {
  36. width: 100%;
  37. height: 548rpx;
  38. }
  39. }
  40. </style>