sign_up_history.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <!-- 报名历史 -->
  3. <view class="sign">
  4. <view class="list_con" v-for="(item, index) in signList" :key="index">
  5. <view class="list_title">
  6. <text>第{{ item.season}}届大卫博士创业{{ item.type == 1 ? '密训' : '实战' }}营</text>
  7. </view>
  8. <view>
  9. <text class="gray">支付金额:</text>
  10. <text>¥{{ item.money }}</text>
  11. </view>
  12. <view class="time">
  13. <view>
  14. <text class="gray">支付时间:</text>
  15. <text>{{ item.pay_time }}</text>
  16. </view>
  17. </view>
  18. <view class="state" :class="{ finish_bg: item.status == 0 || item.status == 2, offline_bg: item.status == 1 }">
  19. <text v-if="item.status == 0">已结束</text>
  20. <text v-if="item.status == 1">开启中</text>
  21. <text v-if="item.status == 2">未开启</text>
  22. </view>
  23. </view>
  24. <view class="nodata" v-if="signList.length == 0">---暂无更多报名记录---</view>
  25. </view>
  26. </template>
  27. <script>
  28. import { signList, seasonLog } from '../../api/sign.js';
  29. export default {
  30. data() {
  31. return {
  32. signList: [], //报名列表
  33. userInfo: {}
  34. };
  35. },
  36. onLoad() {
  37. if (!uni.getStorageSync('userInfo')) {
  38. uni.redirectTo({
  39. url: '../index/index'
  40. });
  41. return false;
  42. }
  43. this.userInfo = uni.getStorageSync('userInfo');
  44. this.getList();
  45. },
  46. onShow() {
  47. if (uni.getStorageSync('userInfo')) {
  48. this.userInfo = uni.getStorageSync('userInfo');
  49. }
  50. },
  51. methods: {
  52. getList() {
  53. let that = this;
  54. signList().then(res => {
  55. if (res.code == 200) {
  56. let list = res.data.list;
  57. list.map(i => {
  58. if (i.season == this.userInfo.season) {
  59. let { time_end, time_start } = this.userInfo;
  60. if (time_end * 1000 > Date.now() && time_start * 1000 < Date.now()) {
  61. //活动中
  62. this.$set(i, 'status', 1);
  63. return false;
  64. }
  65. if (time_start * 1000 > Date.now()) {
  66. //活动未开始
  67. this.$set(i, 'status', 2);
  68. return false;
  69. }
  70. this.$set(i, 'status', 0); //活动已结束
  71. } else {
  72. this.$set(i, 'status', 0);
  73. }
  74. });
  75. that.signList = list;
  76. console.log(list);
  77. } else {
  78. uni.showModal({
  79. content: res.message || '请求失败',
  80. showCancel: false
  81. });
  82. }
  83. });
  84. },
  85. // 查看详情
  86. skipDetail(item) {
  87. uni.navigateTo({
  88. url: '../written_off/written_off?type=' + item.type + '&season=' + item.season + '&pay_time=' + item.pay_time + '&path=' + 1
  89. });
  90. }
  91. }
  92. };
  93. </script>
  94. <style lang="scss" scoped>
  95. .sign {
  96. padding-bottom: 40rpx;
  97. }
  98. .list_con {
  99. width: 690rpx;
  100. margin: 20rpx auto 0;
  101. background-color: #fff;
  102. font-size: 28rpx;
  103. padding: 0 20rpx 20rpx;
  104. box-sizing: border-box;
  105. border-radius: 8rpx;
  106. position: relative;
  107. .list_title {
  108. font-size: 32rpx;
  109. color: #333;
  110. padding: 37rpx 0 42rpx;
  111. font-weight: 500;
  112. }
  113. .gray {
  114. color: #999;
  115. }
  116. .time {
  117. margin-top: 20rpx;
  118. display: flex;
  119. align-items: center;
  120. .list_detail {
  121. width: 181rpx;
  122. height: 54rpx;
  123. border-radius: 27rpx;
  124. text-align: center;
  125. line-height: 54rpx;
  126. margin-left: 49rpx;
  127. }
  128. .offline {
  129. box-shadow: 0px 3rpx 15rpx 1rpx #ff5432;
  130. color: #ff5432;
  131. }
  132. .online {
  133. box-shadow: 0px 3rpx 15rpx 1px rgba(252, 190, 24, 0.35);
  134. color: #fcbe18;
  135. }
  136. .finish {
  137. box-shadow: 0px 3rpx 15rpx 1rpx rgba(102, 102, 102, 0.35);
  138. color: #666666;
  139. }
  140. }
  141. .state {
  142. width: 138rpx;
  143. height: 48rpx;
  144. border-radius: 0px 8rpx 0px 48rpx;
  145. position: absolute;
  146. top: 0;
  147. right: 0;
  148. color: #fff;
  149. text-align: center;
  150. line-height: 48rpx;
  151. }
  152. .offline_bg {
  153. background: #ff5432;
  154. }
  155. .online_bg {
  156. background: #fcbe18;
  157. }
  158. .finish_bg {
  159. background: #cccccc;
  160. }
  161. }
  162. .nodata {
  163. width: 100%;
  164. text-align: center;
  165. color: #ccc;
  166. font-size: 24rpx;
  167. margin-top: 44rpx;
  168. }
  169. </style>