group_list.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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-color: #f5f5f5;
  16. }
  17. </style>
  18. {/block}
  19. {block name="content"}
  20. <div v-cloak id="app">
  21. <div :style="{ backgroundImage: 'url(' + backgroundImage + ')' }" class="group-list-page">
  22. <ul v-if="groupList.length">
  23. <li v-for="item in groupList" :key="item.id">
  24. <a :href="(item.is_light ? '{:url('special/single_details')}' : '{:url('special/details')}') + '?id=' + item.id">
  25. <img :src="item.image">
  26. <div class="text">
  27. <div class="name">{{ item.title }}</div>
  28. <div class="info">
  29. <div class="people">
  30. <span class="iconfont iconpintuan"></span>{{ item.pink_number }}人团
  31. </div>
  32. 已拼{{ item.count }}件
  33. </div>
  34. <div class="wrap">
  35. <div class="money">¥<span>{{ item.pink_money }}</span></div>
  36. <div class="button">去拼团</div>
  37. </div>
  38. </div>
  39. </a>
  40. </li>
  41. </ul>
  42. <img v-else-if="!loading && page === 2" class="empty" src="/wap/first/zsff/images/no_data_available.png">
  43. </div>
  44. <quick-menu></quick-menu>
  45. </div>
  46. <script>
  47. var backgroundImage = "{$group_background}";
  48. require(['vue', 'helper', 'store', 'quick'], function (Vue, $h, api) {
  49. var app = new Vue({
  50. el: '#app',
  51. data: {
  52. backgroundImage: backgroundImage,
  53. groupList: [],
  54. page: 1,
  55. limit: 15,
  56. loading: false,
  57. finished: false
  58. },
  59. created: function() {
  60. this.getGroupList();
  61. },
  62. mounted: function () {
  63. var that = this;
  64. that.$nextTick(function() {
  65. $h.EventUtil.listenTouchDirection(document, function() {
  66. !that.loading && that.getGroupList();
  67. }, false);
  68. });
  69. },
  70. methods: {
  71. // 获取拼团列表
  72. getGroupList: function() {
  73. var that = this;
  74. if (that.loading || that.finished) {
  75. return;
  76. }
  77. that.loading = true;
  78. $h.loadFFF();
  79. api.baseGet($h.U({
  80. c: 'special',
  81. a: 'groupProjectList',
  82. q: {
  83. page: that.page++,
  84. limit: that.limit
  85. }
  86. }), function (res) {
  87. var data = res.data.data;
  88. that.loading = false;
  89. $h.loadClear();
  90. that.groupList = that.groupList.concat(data);
  91. that.finished = that.limit > data.length;
  92. }, function (err) {
  93. that.loading = false;
  94. $h.loadClear();
  95. });
  96. }
  97. }
  98. });
  99. });
  100. </script>
  101. {/block}