index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <view class="act-ward">
  3. <view
  4. v-for="item in list"
  5. :key="item.distributionId"
  6. class="act-ward-box"
  7. @click="toDetail(item.distributionId)"
  8. >
  9. <view class="act-ward-box-top fl_b">
  10. <view class="title">{{ item.name }}</view>
  11. <view class="act-status" v-if="item.status == 1">进行中</view>
  12. <view class="act-status grey" v-else>已结束</view>
  13. </view>
  14. <view class="act-ward-box-time">
  15. <view>
  16. <text>开始时间</text>
  17. <view>{{ item.startTime | formate("yyyy-mm-dd hh:mm") }}</view>
  18. </view>
  19. <view>
  20. <text>结束时间</text>
  21. <view>{{ item.endTime | formate("yyyy-mm-dd hh:mm") }}</view>
  22. </view>
  23. </view>
  24. <view class="line"></view>
  25. <view class="act-ward-box-btn">
  26. <text></text>
  27. <view @click.stop="makePoster(item.distributionId)">生成海报</view>
  28. </view>
  29. </view>
  30. <view class="nomore" v-if="total && list.length == total">
  31. 已显示全部
  32. </view>
  33. <view class="nomore" v-if="!total"> 暂无数据 </view>
  34. </view>
  35. </template>
  36. <script>
  37. import { getActList, getLinkCode } from "@/utils/act";
  38. export default {
  39. data() {
  40. return {
  41. list: [],
  42. param: {},
  43. total: 0,
  44. };
  45. },
  46. methods: {
  47. getActList() {
  48. getActList(this.param).then((res) => {
  49. this.list.push(...res.rows);
  50. this.total = res.total;
  51. });
  52. },
  53. reset() {
  54. this.list = [];
  55. this.param = {
  56. pageNum: 1,
  57. pageSize: 10,
  58. };
  59. },
  60. makePoster(distributionId) {
  61. getLinkCode({ distributionId }).then(({ linkCode, shareCode }) => {
  62. uni.navigateTo({
  63. url:
  64. "/pages/bill/index?distributionId=" +
  65. distributionId +
  66. "&linkCode=" +
  67. linkCode +
  68. "&shareCode=" +
  69. shareCode,
  70. });
  71. });
  72. },
  73. toDetail(distributionId) {
  74. uni.navigateTo({
  75. url: "/pages/actdetail/index?id=" + distributionId,
  76. });
  77. },
  78. },
  79. onLoad(option) {},
  80. onShow() {
  81. this.reset();
  82. this.getActList();
  83. },
  84. onReachBottom() {
  85. if (this.list.length >= this.total) {
  86. return;
  87. }
  88. this.param.pageNum++;
  89. this.getActList();
  90. },
  91. };
  92. </script>
  93. <style lang="scss" scoped>
  94. page {
  95. background: #f6f7fb;
  96. }
  97. .act-ward {
  98. padding: 24rpx;
  99. .act-ward-box {
  100. background: #ffffff;
  101. border-radius: 16rpx;
  102. padding: 32rpx;
  103. margin-bottom: 24rpx;
  104. & > view {
  105. display: flex;
  106. justify-content: space-between;
  107. }
  108. .act-ward-box-top {
  109. align-items: flex-start;
  110. .title {
  111. width: 80%;
  112. font-weight: bold;
  113. color: #24263d;
  114. font-size: 32rpx;
  115. line-height: 46rpx;
  116. }
  117. .act-status {
  118. background: #44ca7d;
  119. padding: 6rpx 12rpx;
  120. border-radius: 20rpx 20rpx 0 20rpx;
  121. font-weight: bold;
  122. color: #ffffff;
  123. font-size: 24rpx;
  124. }
  125. .grey {
  126. background: #c0cad9;
  127. }
  128. }
  129. .act-ward-box-time {
  130. margin-top: 24rpx;
  131. text {
  132. font-size: 26rpx;
  133. font-weight: 500;
  134. color: #999999;
  135. }
  136. view {
  137. font-weight: 500;
  138. color: #24263d;
  139. font-size: 28rpx;
  140. margin-top: 8rpx;
  141. }
  142. }
  143. .line {
  144. height: 2rpx;
  145. background: #e5e5e5;
  146. margin: 32rpx 0;
  147. }
  148. .act-ward-box-btn {
  149. view {
  150. border: 1px solid #3f8dfd;
  151. padding: 10rpx 20rpx;
  152. border-radius: 72rpx;
  153. color: #3f8dfd;
  154. font-size: 26rpx;
  155. }
  156. }
  157. }
  158. }
  159. </style>