index.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <?php
  2. /*
  3. * @Descripttion:
  4. * @copyright: Copyright (c) 2021 广东七件事集团
  5. * @Author: lun
  6. * @Date: 2021-12-28 23:01:04
  7. */
  8. ?>
  9. <style>
  10. .link_url {
  11. text-align: left;
  12. font-size: 14px;
  13. }
  14. .showqr .el-dialog__body {
  15. text-align: center;
  16. padding-bottom: 10px;
  17. }
  18. .el-dialog {
  19. min-width: 400px;
  20. }
  21. </style>
  22. <div id="app" v-cloak>
  23. <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  24. <div slot="header">
  25. <span>领取明细</span>
  26. </div>
  27. <div class="search-box">
  28. <!-- 搜索 -->
  29. <el-form :inline="true" :model="searchForm" size="small" class="demo-form-inline">
  30. <el-form-item label="会员编号">
  31. <el-input placeholder="请输入会员编号" v-model="searchForm.user_id"></el-input>
  32. </el-form-item>
  33. <el-form-item label="活动编号">
  34. <el-input placeholder="请输入活动编号" v-model="searchForm.activities_number"></el-input>
  35. </el-form-item>
  36. <el-form-item label="活动名称">
  37. <el-input placeholder="请输入活动名称" v-model="searchForm.activities_name"></el-input>
  38. </el-form-item>
  39. <el-form-item>
  40. <el-button type="primary" @click="search">搜索</el-button>
  41. <el-button type="danger" size="small" style="padding: 9px 15px !important;" @click="resetSearch" v-if="search.goods_id != ''">清除条件</el-button>
  42. </el-form-item>
  43. </el-form>
  44. </div>
  45. <div class="table-body">
  46. <el-tabs>
  47. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
  48. <el-table-column prop="user.id" min-width="30" label="会员编号" align="center"></el-table-column>
  49. <el-table-column label="会员" >
  50. <template slot-scope="scope">
  51. <div flex="box:first">
  52. <div style="padding-right: 10px;">
  53. <com-image mode="aspectFill" :src="scope.row.user.avatar_url"></com-image>
  54. </div><br>
  55. <div flex="cross:top cross:center">
  56. {{scope.row.user.nickname}}
  57. <br>
  58. {{scope.row.user.mobile}}
  59. </div>
  60. </div>
  61. </template>
  62. </el-table-column>
  63. <el-table-column prop="randomRedPacket.activities_number" min-width="30" label="活动编号" align="center"></el-table-column>
  64. <el-table-column prop="randomRedPacket.activities_name" min-width="30" label="活动名称" align="center"></el-table-column>
  65. <el-table-column prop="randomRedPacket.reward_type" label="类型" align="center">
  66. <template slot-scope="scope">
  67. {{ type_arr[scope.row.randomRedPacket.reward_type] }}
  68. </template>
  69. </el-table-column>
  70. <el-table-column prop="reward_value" min-width="30" label="奖励值" align="center"></el-table-column>
  71. <el-table-column label="领取时间" min-width="90" align="center">
  72. <template slot-scope="scope">
  73. {{ scope.row.created_at | dateTimeFormat('Y-m-d H:i') }}
  74. </template>
  75. </el-table-column>
  76. </el-table>
  77. <div style="text-align: right;margin: 20px 0;">
  78. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  79. </div>
  80. </el-tabs>
  81. </div>
  82. </el-card>
  83. </div>
  84. <script>
  85. const app = new Vue({
  86. el: '#app',
  87. data: {
  88. loading: false,
  89. delLoading: false,
  90. page: 1,
  91. pageCount: 0,
  92. list: [],
  93. type_arr: {
  94. 1: '激活积分',
  95. 2: '贡献值',
  96. 3: '红包',
  97. 4: '余额',
  98. },
  99. status_arr: {
  100. 0: '全部',
  101. 1: '进行中',
  102. 2: '已过期',
  103. 3: '已失效',
  104. 4: '未开始',
  105. },
  106. now_time: 0,
  107. searchForm:{
  108. user_id:null,
  109. activities_name:null,
  110. activities_number:null,
  111. // type:null,
  112. },
  113. },
  114. mounted() {
  115. this.getList();
  116. },
  117. computed: {
  118. show_clear_search_btn: function() {
  119. return this.searchForm.user_id != null ||
  120. this.searchForm.activities_name != null ||
  121. this.searchForm.activities_number != null;
  122. },
  123. },
  124. methods: {
  125. pagination(currentPage) {
  126. let self = this;
  127. self.page = currentPage;
  128. self.getList();
  129. },
  130. handle(type, data = null) {
  131. let id = data ? parseInt(data.id) : '';
  132. switch (type) {
  133. case 'edit':
  134. let params = {
  135. r: 'random-red-packet/index/edit'
  136. };
  137. if (id) params = Object.assign(params, {
  138. id: id
  139. });
  140. navigateTo(params);
  141. break;
  142. // case 'log':
  143. // param = {
  144. // r: 'rebate/index/reward-log'
  145. // };
  146. // if (id) param = Object.assign(param, {
  147. // rid: id
  148. // });
  149. // navigateTo(param);
  150. // break;
  151. case 'destroy':
  152. param = {id: data.id,status: -1};
  153. this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {type: 'warning'}).then(() => {this.send('random-red-packet/index/handle',param)})
  154. break;
  155. case 'operate':
  156. param = {id: data.id, status:data.status};
  157. console.log(data,'param');
  158. this.$confirm('是否继续'+data.name+'该活动?', '警告', {type: 'warning'}).then(() => {this.send('random-red-packet/index/handle',param)})
  159. break;
  160. }
  161. },
  162. send(url, params, callback = null) {
  163. let self = this;
  164. request({
  165. params: {
  166. r: url,
  167. },
  168. method: 'post',
  169. data: params
  170. }).then(e => {
  171. if (e.data.code == 0) {
  172. self.$message.success(e.data.msg);
  173. self.getList();
  174. } else {
  175. self.$message.error(e.data.msg);
  176. }
  177. }).catch(e => {
  178. console.log(e);
  179. });
  180. if(callback) return e.data;
  181. },
  182. search() {// 清空查询条件
  183. this.page = 1;
  184. this.getList(this.searchForm);
  185. },
  186. resetSearch() {// 清空查询条件
  187. this.searchForm = {
  188. user_id: null,
  189. activities_name:null,
  190. activities_number:null,
  191. };
  192. this.page = 1;
  193. this.getList();
  194. },
  195. getList(search = {}) {
  196. let self = this;
  197. self.loading = true;
  198. let basic_params = {
  199. page: self.page,
  200. };
  201. params = Object.assign(basic_params, search);
  202. request({
  203. params: {
  204. r: 'random-red-packet/record/index'
  205. },
  206. method: 'post',
  207. data: params
  208. }).then(e => {
  209. this.loading = false;
  210. if (e.data.code == 0) {
  211. self.list = e.data.data.list.list;
  212. self.now_time = e.data.data.now_time;
  213. self.pageCount = e.data.data.list.page_count;
  214. } else {
  215. self.$message.error(e.data.msg);
  216. }
  217. }).catch(e => {
  218. self.loading = false;
  219. });
  220. },
  221. }
  222. });
  223. </script>
  224. <style>
  225. .el-tabs__header {
  226. font-size: 16px;
  227. }
  228. .table-body {
  229. padding: 20px;
  230. background-color: #fff;
  231. }
  232. .table-body .el-button {
  233. padding: 0 !important;
  234. border: 0;
  235. margin: 0 5px;
  236. }
  237. .input-item {
  238. width: 250px;
  239. margin: 0 0 20px;
  240. display: inline-block;
  241. }
  242. .input-item .el-input__inner {
  243. border-right: 0;
  244. }
  245. .input-item .el-input__inner:hover {
  246. border: 1px solid #dcdfe6;
  247. border-right: 0;
  248. outline: 0;
  249. }
  250. .input-item .el-input__inner:focus {
  251. border: 1px solid #dcdfe6;
  252. border-right: 0;
  253. outline: 0;
  254. }
  255. .input-item .el-input-group__append {
  256. background-color: #fff;
  257. border-left: 0;
  258. width: 10%;
  259. padding: 0;
  260. }
  261. .input-item .el-input-group__append .el-button {
  262. padding: 0;
  263. }
  264. .input-item .el-input-group__append .el-button {
  265. margin: 0;
  266. }
  267. .batch {
  268. margin: 0 0 20px;
  269. display: inline-block;
  270. }
  271. .batch .el-button {
  272. padding: 9px 15px !important;
  273. }
  274. .el-table th>.cell{
  275. color: #333;
  276. font-weight: bold;
  277. font-size: 14px;
  278. }
  279. .el-table__footer-wrapper, .el-table__header-wrapper{
  280. border-bottom: 1.4px solid #D6D6D6;
  281. }
  282. .search-box {
  283. padding: 10px 0 0 10px;
  284. background-color: #fff;
  285. margin-bottom: 10px;
  286. }
  287. </style>