cell.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="relative" @click="showDetail">
  3. <image :src="resource.bgGoods" class="bg" />
  4. <view class="mall-cell marginB10">
  5. <image :src="data.cover" class="image" />
  6. <view class="paddingX8 paddingT8 font1 pre-wrap bold relative">
  7. <view class="">{{ data.name }}</view>
  8. </view>
  9. <view class="flex-center-start paddingX8 paddingT5 paddingB7 width100">
  10. <view v-if="data.sellType == 2" class="color-red font3 bold marginR2">定金</view>
  11. <view class="color-red font1">¥</view>
  12. <view v-if="data.sellType == 2" class="color-red font6 bold paddingL1 flex1">
  13. {{ data.deposit }}
  14. </view>
  15. <view v-else class="color-red font6 bold paddingL1 flex1">
  16. {{ data.price }}
  17. </view>
  18. <image v-if="data.sellType == 2" class="presell" :src="resource.presale"></image>
  19. <image v-if="data.sellType == 1" class="presell" :src="resource.spots"></image>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import resource from '@/utils/resource'
  26. export default {
  27. props: {
  28. data: Object
  29. },
  30. data() {
  31. return {
  32. resource
  33. }
  34. },
  35. computed: {},
  36. methods: {
  37. showDetail() {
  38. this.$router.push('product', {
  39. id: this.data.id
  40. })
  41. }
  42. }
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. .mall-cell {
  47. position: relative;
  48. color: #fff;
  49. // overflow: hidden;
  50. border-radius: 26rpx;
  51. background: #000;
  52. display: inline-block;
  53. width: 326rpx;
  54. border: 2px solid #0b6e8f;
  55. margin-left: 20rpx;
  56. .image {
  57. height: 0;
  58. width: 326rpx;
  59. height: 326rpx;
  60. }
  61. .presell {
  62. width: 164rpx;
  63. height: 69rpx;
  64. }
  65. }
  66. .bg {
  67. position: absolute;
  68. z-index: 1;
  69. top: -22rpx;
  70. width: 396rpx;
  71. height: 516rpx;
  72. }
  73. </style>