good-list.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!-- 商品列表组件 <good-list :list="xx"></good-list> -->
  2. <template>
  3. <view>
  4. <view class="padding-sm bg-white" v-if="list.length != 0"
  5. style=" width: 100%;column-count: 2;column-gap: 10px;margin: 0 auto;">
  6. <view class="bg-white radius margin-bottom-sm"
  7. style="width: 100%;overflow: hidden;box-shadow: 0rpx 0rpx 10rpx #e5e5e5;break-inside: avoid;"
  8. v-for="(item, index) in list" :key="index" @click="goHouseDet(item)">
  9. <image :src="item.titleImg?item.titleImg: '../../../static/logo.png'"
  10. style="width: 100%;height: 280rpx;" mode="aspectFill"></image>
  11. <view>
  12. <view class="padding-lr-sm">
  13. <view class="text-lg text-bold "
  14. style="overflow: hidden;text-overflow: ellipsis;-webkit-line-clamp:2;display:-webkit-box;-webkit-box-orient: vertical;">
  15. {{item.name}}
  16. </view>
  17. <view class="flex flex-wrap" v-if="item.label != ''" style="width: 100%;">
  18. <view v-if="ite" v-for="(ite,ind) in item.label" :key="ind"
  19. class='cu-tag radius bg-orange light' style="margin-top: 4px;">{{ite}}</view>
  20. </view>
  21. <view class="text-orange text-bold flex" v-if="item.price" style="margin-top: 10px;">
  22. <view class="text-sm" style="line-height:46upx;margin-right: 4upx;">¥</view>
  23. <view class="text-lg">{{item.price}}</view>
  24. </view>
  25. </view>
  26. <view class="padding-lr-sm padding-bottom-sm" style="margin-top: 5px;">
  27. <view style="height: 1px;background-color: #F7F7F7;"></view>
  28. <view class="text-gray"
  29. style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;margin-top: 8px;">
  30. <text class='cuIcon-location' style="margin-right: 4px;font-size: 16px;"></text>
  31. {{item.address}}
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <empty v-if="list.length === 0" des="暂无数据" show="false"></empty>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. props: {
  43. list: {
  44. type: Array,
  45. default () {
  46. return []
  47. }
  48. }
  49. },
  50. methods: {
  51. goHouseDet(e) {
  52. console.log(e)
  53. let token = uni.getStorageSync('token')
  54. if (token) {
  55. uni.navigateTo({
  56. url: "/pages/locality/houseDet?id=" + e.id + "&name=" + e.classifyName
  57. })
  58. } else {
  59. uni.navigateTo({
  60. url: '/pages/public/login'
  61. });
  62. }
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss">
  68. .cu-tag {
  69. height: 36rpx;
  70. }
  71. .radius {
  72. border-radius: 4rpx;
  73. }
  74. </style>