list-1.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <div id="list-1">
  3. <van-row>
  4. <van-col span="24" class="main">
  5. <van-col span="24" class="list" v-for="(item, index) in list" :key="index">
  6. <van-col span="24" class="title textOver">
  7. {{ item.name }}
  8. </van-col>
  9. <van-col span="24" class="other">
  10. <van-col span="24" class="otherInfo">
  11. 活动时间:<span>{{ item.timestr || '暂无' }}</span>
  12. </van-col>
  13. <van-col span="24" class="otherInfo">
  14. 参与对象及人数:<span>{{ item.numbers || '暂无' }}</span>
  15. </van-col>
  16. </van-col>
  17. <van-col span="24" class="btn">
  18. <van-button type="info" size="small" @click="toView(item)">详细信息</van-button>
  19. </van-col>
  20. </van-col>
  21. </van-col>
  22. </van-row>
  23. </div>
  24. </template>
  25. <script>
  26. import { mapState, createNamespacedHelpers } from 'vuex';
  27. export default {
  28. name: 'list-1',
  29. props: {
  30. list: { type: Array },
  31. },
  32. components: {},
  33. data: function () {
  34. return {};
  35. },
  36. created() {},
  37. methods: {
  38. // 查看详情
  39. toView(data) {
  40. this.$emit('toView', data);
  41. },
  42. },
  43. computed: {
  44. ...mapState(['user']),
  45. },
  46. metaInfo() {
  47. return { title: this.$route.meta.title };
  48. },
  49. watch: {
  50. test: {
  51. deep: true,
  52. immediate: true,
  53. handler(val) {},
  54. },
  55. },
  56. };
  57. </script>
  58. <style lang="less" scoped>
  59. .main {
  60. .list {
  61. background-color: #fff;
  62. margin: 0 0 8px 0;
  63. padding: 8px;
  64. border-radius: 5px;
  65. .title {
  66. font-size: 16px;
  67. font-weight: bold;
  68. margin: 0 0 5px 0;
  69. }
  70. .other {
  71. margin: 0 0 5px 0;
  72. .otherInfo {
  73. font-size: 14px;
  74. color: #666;
  75. margin: 0 0 5px 0;
  76. span {
  77. color: #000;
  78. }
  79. }
  80. }
  81. .btn {
  82. text-align: center;
  83. .van-button {
  84. margin: 0 5px;
  85. }
  86. }
  87. }
  88. }
  89. </style>