goods-list.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view class="list-container">
  3. <view class="list-item" @click="gotoDetail(item.goodsId)" v-for="item in list" :key="item.noticeId">
  4. <view class="title"> {{ item.goodsName }} </view>
  5. <view class="author" v-if="item.remark"> 备注:{{ item.remark }} </view>
  6. <view class="author" v-if="item.categoryName"> 分类:{{ item.categoryName }} </view>
  7. <view class="author"> 创建时间:{{ item.createTime }} </view>
  8. </view>
  9. </view>
  10. </template>
  11. <script setup>
  12. const props = defineProps({
  13. marginTop: {
  14. type: String,
  15. default: '0',
  16. },
  17. list: {
  18. type: Array,
  19. default: [],
  20. },
  21. });
  22. function gotoDetail(goodsId) {
  23. uni.navigateTo({ url: '/pages/goods/goods-detail?noticeId=' + goodsId });
  24. }
  25. </script>
  26. <style lang="scss" scoped>
  27. .list-container {
  28. margin-top: v-bind(marginTop);
  29. padding: 20rpx 10rpx;
  30. }
  31. .list-item {
  32. box-sizing: border-box;
  33. margin: 0 30rpx;
  34. padding: 30rpx 0;
  35. border-bottom: #cdcdcd 1px solid;
  36. .title {
  37. display: flex;
  38. justify-content: space-between;
  39. align-items: center;
  40. margin-bottom: 20rpx;
  41. font-size: 16px;
  42. text-overflow: ellipsis;
  43. white-space: nowrap;
  44. overflow: hidden;
  45. }
  46. .author {
  47. margin-bottom: 14rpx;
  48. color: #999999;
  49. font-size: 12px;
  50. text-overflow: ellipsis;
  51. }
  52. .publish-time {
  53. font-size: 12px;
  54. color: #999999;
  55. display: flex;
  56. flex-direction: row;
  57. justify-content: space-between;
  58. .un-read {
  59. color: $uni-color-primary;
  60. }
  61. }
  62. }
  63. </style>