index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="act-ward">
  3. <view
  4. v-for="item in actList"
  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>
  31. </template>
  32. <script>
  33. import { getActList, getLinkCode } from "@/utils/act";
  34. export default {
  35. data() {
  36. return {
  37. actList: [],
  38. param: {},
  39. total: 0,
  40. };
  41. },
  42. methods: {
  43. getActList() {
  44. getActList(this.param).then((res) => {
  45. this.actList.push(...res.rows);
  46. this.total = res.total;
  47. });
  48. },
  49. reset() {
  50. this.actList = [];
  51. this.param = {
  52. pageNum: 1,
  53. pageSize: 10,
  54. };
  55. },
  56. makePoster(distributionId) {
  57. getLinkCode({ distributionId }).then((res) => {
  58. uni.navigateTo({
  59. url:
  60. "/pages/bill/index?distributionId=" +
  61. distributionId +
  62. "&linkCode=" +
  63. res +
  64. "&shareCode=" +
  65. this.$store.state.userInfo.shareCode,
  66. });
  67. });
  68. },
  69. toDetail(distributionId) {
  70. uni.navigateTo({
  71. url: "/pages/actdetail/index?id=" + distributionId,
  72. });
  73. },
  74. },
  75. onLoad(option) {},
  76. onShow() {
  77. this.reset();
  78. this.getActList();
  79. },
  80. onReachBottom() {
  81. if (this.actList.length >= this.total) {
  82. return;
  83. }
  84. this.param.pageNum++;
  85. this.getActList();
  86. },
  87. };
  88. </script>
  89. <style lang="scss" scoped>
  90. page {
  91. background: #f6f7fb;
  92. }
  93. .act-ward {
  94. padding: 24rpx;
  95. .act-ward-box {
  96. background: #ffffff;
  97. border-radius: 16rpx;
  98. padding: 32rpx;
  99. margin-bottom: 24rpx;
  100. & > view {
  101. display: flex;
  102. justify-content: space-between;
  103. }
  104. .act-ward-box-top {
  105. align-items: flex-start;
  106. .title {
  107. width: 80%;
  108. font-weight: bold;
  109. color: #24263d;
  110. font-size: 32rpx;
  111. line-height: 46rpx;
  112. }
  113. .act-status {
  114. background: #44ca7d;
  115. padding: 6rpx 12rpx;
  116. border-radius: 20rpx 20rpx 0 20rpx;
  117. font-weight: bold;
  118. color: #ffffff;
  119. font-size: 24rpx;
  120. }
  121. .grey {
  122. background: #c0cad9;
  123. }
  124. }
  125. .act-ward-box-time {
  126. margin-top: 24rpx;
  127. text {
  128. font-size: 26rpx;
  129. font-weight: 500;
  130. color: #999999;
  131. }
  132. view {
  133. font-weight: 500;
  134. color: #24263d;
  135. font-size: 28rpx;
  136. margin-top: 8rpx;
  137. }
  138. }
  139. .line {
  140. height: 2rpx;
  141. background: #e5e5e5;
  142. margin: 32rpx 0;
  143. }
  144. .act-ward-box-btn {
  145. view {
  146. border: 1px solid #3f8dfd;
  147. padding: 10rpx 20rpx;
  148. border-radius: 72rpx;
  149. color: #3f8dfd;
  150. font-size: 26rpx;
  151. }
  152. }
  153. }
  154. }
  155. </style>