sign_list.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <!-- +---------------------------------------------------------------------- -->
  2. <!-- | CRMEB [ CRMEB赋能开发者,助力企业发展 ] -->
  3. <!-- +---------------------------------------------------------------------- -->
  4. <!-- | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. -->
  5. <!-- +---------------------------------------------------------------------- -->
  6. <!-- | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 -->
  7. <!-- +---------------------------------------------------------------------- -->
  8. <!-- | Author: CRMEB Team <admin@crmeb.com> -->
  9. <!-- +---------------------------------------------------------------------- -->
  10. {extend name="public/container"}
  11. {block name="title"}我的报名{/block}
  12. {block name="head"}
  13. <style>
  14. body {
  15. background: #F5F5F5;
  16. }
  17. .price-wrap {
  18. display: flex;
  19. align-items: center;
  20. font-size: .24rem;
  21. line-height: .33rem;
  22. color: #FF6B00;
  23. }
  24. .price-wrap .price {
  25. flex: 1;
  26. font-weight: bold;
  27. font-size: .24rem;
  28. line-height: .45rem;
  29. color: #FF6B00;
  30. }
  31. .price-wrap .price span {
  32. font-size: .32rem;
  33. }
  34. .activity-list li > div > div > div:last-child {
  35. font-weight: normal;
  36. }
  37. </style>
  38. {/block}
  39. {block name="content"}
  40. <div class="activity-list" v-cloak id="app">
  41. <div class="tab">
  42. <div v-for="(item, index) in navs" :key="index" :class="{ on: navActive === index }" @click="navActives(index)">{{ item }}</div>
  43. </div>
  44. <div class="content">
  45. <ul v-if="activityList.length">
  46. <li v-for="(item, index) in activityList" :key="index" @click="activityDetails(item.order_id)">
  47. <div>
  48. <div>单号:{{item.order_id}}</div>
  49. <div v-if="item.status==0">待核销</div>
  50. <div v-else-if="item.status==1">已核销</div>
  51. </div>
  52. <div>
  53. <div>
  54. <img :src="item.image" alt="">
  55. </div>
  56. <div>
  57. <div>{{ item.title }}</div>
  58. <div><i class="iconfont icondidian"></i>{{ item.province }}{{ item.city }}{{ item.district }}{{ item.detail }}</div>
  59. <div class="price-wrap">
  60. <div class="price">¥<span>{{ item.pay_price }}</span></div>
  61. <!-- <div>{{ item.upUnmber }}人参加</div> -->
  62. </div>
  63. </div>
  64. </div>
  65. </li>
  66. </ul>
  67. <div v-if="!activityList.length && loadend" class="empty">
  68. <img src="{__WAP_PATH}zsff/images/empty.png" alt="暂无数据">
  69. <div>暂无数据</div>
  70. </div>
  71. </div>
  72. <quick-menu></quick-menu>
  73. </div>
  74. {/block}
  75. {block name="foot"}
  76. <script>
  77. require(['vue', 'store', 'helper', '{__WAP_PATH}zsff/js/quick.js'], function (Vue, store, $h) {
  78. var app = new Vue({
  79. el: '#app',
  80. data: {
  81. navs: ['全部', '待核销', '已核销'],
  82. navActive: 0,
  83. activityList: [],
  84. loading: false,
  85. loadend: false,
  86. page: 1,
  87. limit: 20,
  88. loadTitle:''
  89. },
  90. mounted: function () {
  91. this.getActivitySignList();
  92. this.$nextTick(function () {
  93. this.init();
  94. });
  95. },
  96. methods: {
  97. navActives: function (index) {
  98. var that = this;
  99. that.navActive = index;
  100. that.page = 1;
  101. that.loading = false;
  102. that.loadend = false;
  103. that.activityList = [];
  104. that.getActivitySignList();
  105. },
  106. init: function () {
  107. var that = this;
  108. window.addEventListener('scroll', function () {
  109. var clientHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
  110. scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight,
  111. scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
  112. if (clientHeight + scrollTop >= scrollHeight) {
  113. that.getActivitySignList();
  114. }
  115. });
  116. },
  117. activityDetails: function (order_id) {
  118. return window.location.href=$h.U({ c: 'my', a: 'sign_my_order', q: {order_id: order_id } });
  119. },
  120. // 获取活动列表
  121. getActivitySignList: function () {
  122. var that = this;
  123. if (that.loading) return;
  124. if (that.loadend) return;
  125. that.loading = true;
  126. store.baseGet($h.U({ c: 'activity', a: 'activitySignInList', p: { page: that.page, limit: that.limit, navActive: that.navActive } }), function (res) {
  127. var list = res.data.data;
  128. that.activityList.push.apply(that.activityList, list);
  129. that.loadend = list.length < that.limit;
  130. that.loadTitle = that.loadend ? '已全部加载完' : '上拉加载更多';
  131. that.page = that.page + 1;
  132. that.loading = false;
  133. that.$set(this, 'activityList', that.activityList);
  134. }, function (res) {
  135. that.loadTitle = '上拉加载更多';
  136. that.loading = false;
  137. });
  138. }
  139. }
  140. });
  141. });
  142. </script>
  143. {/block}