index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="activity">
  3. <zs-list mt="0" @load="loadMore" :status="status">
  4. <view class="item" v-for="item in list" :key="item.id" @click="goDetail(item.id)">
  5. <zs-img :src="item.activityCover" width="710rpx" height="320rpx"></zs-img>
  6. <view class="info">
  7. <view class="title">
  8. {{item.activityName}}
  9. </view>
  10. <view class="desc">
  11. 活动时间: {{ item.activityStartTime }} 至 {{ item.activityEndTime }}
  12. </view>
  13. </view>
  14. </view>
  15. </zs-list>
  16. </view>
  17. </template>
  18. <script>
  19. import {activityList} from '@/api/activity'
  20. export default {
  21. data() {
  22. return {
  23. status: 'more',
  24. list:[],
  25. query:{
  26. currentPage:1,
  27. pageSize:10,
  28. shopId:0,
  29. state:2
  30. }
  31. }
  32. },
  33. methods: {
  34. loadMore(){
  35. this.activityList()
  36. },
  37. goDetail(id){
  38. uni.navigateTo({
  39. url:'/signUp/index?scene='+id
  40. })
  41. },
  42. activityList(){
  43. this.status = 'loading'
  44. activityList(this.query).then(res=>{
  45. if(res.state == 'Success'){
  46. this.list = this.list.concat(res.content.records)
  47. if (this.list.length >= res.content.total) {
  48. this.status = 'noMore'
  49. } else {
  50. this.status = 'more'
  51. this.query.pageCurrent++
  52. }
  53. }
  54. })
  55. }
  56. },
  57. onLoad() {
  58. // this.activityList()
  59. },
  60. onShareTimeline() {
  61. return {
  62. title: "慧研学惠生活",
  63. query: "id=1",
  64. };
  65. },
  66. onShareAppMessage() {
  67. return {
  68. title: "慧研学惠生活",
  69. path: "/pages/activity/index",
  70. };
  71. },
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .activity {
  76. padding: 20rpx;
  77. background: #F9F9F9;
  78. min-height: 100vh;
  79. .zs-list {
  80. .item{
  81. margin-bottom: 20rpx;
  82. border-radius: 16rpx 16rpx 16rpx 16rpx;
  83. .info{
  84. background: #fff;
  85. padding: 20rpx 24rpx;
  86. .title{
  87. font-size: 28rpx;
  88. color: #222222;
  89. width: 640rpx;
  90. white-space: nowrap;
  91. overflow: hidden;
  92. text-overflow: ellipsis;
  93. }
  94. .desc{
  95. font-size: 24rpx;
  96. color: #AAAAAA;
  97. overflow: hidden;
  98. text-overflow: ellipsis;
  99. /* 弹性伸缩盒子模型显示 */
  100. display: -webkit-box;
  101. /* 限制在一个块元素显示的文本的行数 */
  102. -webkit-line-clamp: 2;
  103. /* 设置或检索伸缩盒对象的子元素的排列方式 */
  104. -webkit-box-orient: vertical;
  105. margin-top: 20rpx;
  106. }
  107. }
  108. }
  109. }
  110. }
  111. </style>