stat-data.php 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-image');
  4. ?>
  5. <div id="app" class="content" v-cloak>
  6. <div class="list">
  7. <div class="list-item" v-for="(item,index) in activityStatisticsDatas">
  8. <div class="title">{{item.title}}</div>
  9. <div class="num">{{item.value}}</div>
  10. </div>
  11. </div>
  12. <!-- 拼团明细 -->
  13. <div class="detailtitle">
  14. <div class="border"></div>
  15. <div class="title">拼团明细</div>
  16. </div>
  17. <!-- 表格 -->
  18. <div class="table-body">
  19. <el-form size="small" :inline="true" flex="dir:left cross:center">
  20. <div class="item-box" flex="dir:left cross:center">
  21. <div style="margin-right: 5px; margin-left: 25px;">拼团商品</div>
  22. <el-select v-model="searchData.goods_id" @change='search' class="select" size="small" clearable @clear='search'>
  23. <el-option :key="item.id" :label="item.goods_name" :value="item.id" v-for="item in goodsList"></el-option>
  24. </el-select>
  25. </div>
  26. <!-- <div class="item-box" flex="dir:left cross:center" v-if="searchData.activity_status || searchData.title || searchData.start_time || searchData.end_time">
  27. <el-button size="small" type="warning" style="padding: 9px 15px !important;" @click="clearSearch">清除搜索条件
  28. </el-button>
  29. </div> -->
  30. </el-form>
  31. <el-table v-loading="groupLoading" :data="lottery_period_lists" stripe style="width: 100%">
  32. <el-table-column prop="number" label="成团期数" width="80" align="center"> </el-table-column>
  33. <el-table-column prop="group_amounts" label="成团金额" width="150" align="center"></el-table-column>
  34. <el-table-column prop="deplete_scores" label="消耗积分" width="150" title="" align="center"></el-table-column>
  35. <el-table-column prop="deplete_balances" label="消耗余额" width="150" title="" align="center"></el-table-column>
  36. <el-table-column prop="win_reward_balances" label="拼中奖励余额" width="150" title="" align="center"></el-table-column>
  37. <el-table-column prop="win_reward_scores" label="拼中奖励积分" width="150" title="" align="center"></el-table-column>
  38. <el-table-column prop="bonus_pool_amounts" label="分配奖金池金额" width="150" title="" align="center"></el-table-column>
  39. <el-table-column label="开团时间" align="center">
  40. <template slot-scope="scope">
  41. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="状态" align="center">
  45. <template slot-scope="scope" v-if="scope.row.status==1"> 成功 </template>
  46. <template slot-scope="scope" v-else> 失败 </template>
  47. </el-table-column>
  48. <el-table-column label="操作" width="250" align="center">
  49. <template slot-scope="scope">
  50. <el-button circle size="small" type="text" @click="showModal(scope.row.number)">拼团人数</el-button>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. </div>
  55. <!-- 弹窗 -->
  56. <div class="modal">
  57. </div>
  58. <el-dialog :visible.sync="groupModal" width="33%" title="拼团人数">
  59. <el-table class="modaltable" v-loading="groupLoading" :data="attendUserLists" stripe style="width: 100%">
  60. <el-table-column prop="id" label="会员id" width="150" title="" align="center"></el-table-column>
  61. <el-table-column label="会员名称" align="center" width="150">
  62. <template slot-scope="scope">
  63. <div class="member">
  64. <div class="image">
  65. <com-image :src="scope.row.avatar_url" style="width: 100%;height: 100%;"></com-image>
  66. </div>
  67. <div class="name">{{scope.row.nickname}}</div>
  68. </div>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="加入拼团时间" width="300" align="center">
  72. <template slot-scope="scope">
  73. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  74. </template>
  75. </el-table-column>
  76. </el-table>
  77. </el-dialog>
  78. </div>
  79. <script>
  80. const app = new Vue({
  81. el: '#app',
  82. data: {
  83. statusMap: [],
  84. // 开奖期数列表
  85. lottery_period_lists: [],
  86. searchData: {
  87. goods_id: '',
  88. },
  89. groupModal: false,
  90. groupLoading: false,
  91. attendUserLists: [],
  92. activityStatisticsDatas: [
  93. {title: '成团金额', name: 'group_amounts', value: 0},
  94. {title: '成团人数', name: 'group_peoples', value: 0},
  95. {title: '成团期数', name: 'group_periods', value: 0},
  96. {title: '拼团失败次数', name: 'group_failed_times', value: 0},
  97. {title: '累计消耗积分', name: 'deplete_scores', value: 0},
  98. {title: '累计消耗余额', name: 'deplete_balances', value: 0},
  99. {title: '拼中奖励余额', name: 'win_reward_balances', value: 0},
  100. {title: '拼中奖励积分', name: 'win_reward_scores', value: 0},
  101. {title: '分配奖金金额', name: 'distribute_bonus_pool_amounts', value: 0},
  102. ],
  103. goodsList: [],
  104. },
  105. mounted: function() {
  106. this.getList(getQuery('activity_id'));
  107. },
  108. methods: {
  109. // 拼团人数
  110. showModal(number) {
  111. let self = this
  112. self.groupModal = true;
  113. // self.groupLoading = true;
  114. request({
  115. params: {
  116. r: 'lucky-group/group-activity/attend-user-list',
  117. number: number,
  118. activity_id: getQuery('activity_id'),
  119. },
  120. method: 'get'
  121. }).then(e => {
  122. self.groupLoading = false;
  123. if (e.data.code == 0) {
  124. self.attendUserLists = e.data.data;
  125. } else {
  126. self.$message.error(e.data.msg);
  127. return false;
  128. }
  129. }).catch(e => {
  130. console.log(e);
  131. self.$message.error('网络错误');
  132. })
  133. },
  134. //搜索
  135. search() {
  136. // console.log(this.searchData);
  137. this.getList(getQuery('activity_id'));
  138. },
  139. getList(id) {
  140. this.listLoading = true;
  141. request({
  142. params: {
  143. r: 'lucky-group/group-activity/activity-data',
  144. activity_id: id,
  145. // pagesize: 10,
  146. // page: this.page,
  147. // ...this.searchData,
  148. goods_id: this.searchData.goods_id,
  149. },
  150. method: 'get',
  151. }).then(e => {
  152. // console.log('等级列表=='+JSON.stringify(e))
  153. this.listLoading = false;
  154. if (e.data.code == 0) {
  155. this.statusMap = e.data.data.status_map;
  156. this.lottery_period_lists = e.data.data.lottery_periods;
  157. this.pageCount = e.data.data.page_count;
  158. if (e.data.data.activity_statistics) {
  159. // this.activityStatisticsDatas = e.data.data.activity_statistics;
  160. let forNum = this.activityStatisticsDatas.length;
  161. for (let i = 0; i < forNum; i++) {
  162. this.activityStatisticsDatas[i].value = e.data.data.activity_statistics[this.activityStatisticsDatas[i].name];
  163. }
  164. }
  165. if (e.data.data.goods.length) {
  166. this.goodsList = e.data.data.goods;
  167. }
  168. } else {
  169. this.$message.error(e.data.msg)
  170. }
  171. }).catch(e => {
  172. console.log(e);
  173. });
  174. },
  175. }
  176. });
  177. </script>
  178. <style>
  179. .modal {
  180. position: fixed;
  181. top: 200px;
  182. left: 0;
  183. width: 100%;
  184. display: flex;
  185. align-items: center;
  186. justify-content: center;
  187. }
  188. .modaltable .member {
  189. display: flex;
  190. }
  191. .modaltable .member .image {
  192. width: 50px;
  193. height: 50px;
  194. }
  195. .modaltable .member .image img {
  196. border-radius: 50%;
  197. }
  198. .modaltable .member .name {
  199. display: flex;
  200. justify-content: center;
  201. align-items: center;
  202. margin-left: 10px;
  203. }
  204. .modalcontent {
  205. display: inline-flex;
  206. width: 50%;
  207. }
  208. page {
  209. background: #fff;
  210. }
  211. .content {
  212. background: #fff;
  213. }
  214. .content .list {
  215. display: flex;
  216. padding: 0 5% 15px 15px;
  217. flex-wrap: wrap;
  218. }
  219. .content .list .list-item {
  220. background: #F2F2F2;
  221. width: 15%;
  222. font-weight: 600;
  223. font-size: 16px;
  224. padding: 20px 0 0 20px;
  225. margin: 20px 10px 10px 30px;
  226. height: 111px;
  227. }
  228. .content .list .list-item .num {
  229. font-size: 30px;
  230. padding: 5px 0 0 20px;
  231. }
  232. .detailtitle {
  233. background: #F2F2f2;
  234. padding: 10px 0 10px 10px;
  235. display: flex;
  236. }
  237. .detailtitle .border {
  238. width: 7px;
  239. height: 30px;
  240. background: #1479f0;
  241. }
  242. .detailtitle .title {
  243. display: flex;
  244. justify-content: center;
  245. align-items: center;
  246. padding-left: 10px;
  247. }
  248. </style>