index.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <style>
  2. .label{
  3. margin-right: 10px;
  4. }
  5. .table-body {
  6. padding: 20px;
  7. background-color: #fff;
  8. }
  9. .input-item {
  10. display: inline-block;
  11. width: 250px;
  12. margin: 0 0 20px;
  13. }
  14. .input-item .el-input__inner {
  15. border-right: 0;
  16. }
  17. .input-item .el-input__inner:hover {
  18. border: 1px solid #dcdfe6;
  19. border-right: 0;
  20. outline: 0;
  21. }
  22. .input-item .el-input__inner:focus {
  23. border: 1px solid #dcdfe6;
  24. border-right: 0;
  25. outline: 0;
  26. }
  27. .input-item .el-input-group__append {
  28. background-color: #fff;
  29. border-left: 0;
  30. width: 10%;
  31. padding: 0;
  32. }
  33. .input-item .el-input-group__append .el-button {
  34. padding: 0;
  35. }
  36. .input-item .el-input-group__append .el-button {
  37. margin: 0;
  38. }
  39. .table-body .el-button {
  40. padding: 0 !important;
  41. border: 0;
  42. margin: 0 5px;
  43. }
  44. .el-table th > .cell {
  45. color: #333;
  46. font-weight: bold;
  47. font-size: 14px;
  48. }
  49. .el-table__footer-wrapper, .el-table__header-wrapper {
  50. border-bottom: 1.4px solid #D6D6D6;
  51. }
  52. .el-button--primary2 {
  53. color: #FFF;
  54. background-color: #03C5FF;
  55. border-color: #03C5FF;
  56. }
  57. /*头像样式 start*/
  58. .default-avatar{
  59. width: 50px;
  60. height: 50px;
  61. border-radius: 50%;
  62. }
  63. .user_img{
  64. position: relative;
  65. margin-right: 8px;
  66. height: 50px;
  67. width: 50px;
  68. }
  69. .el-table_1_column_3 .cell { /*-2 表示在第二行*/
  70. display: flex;
  71. }
  72. /*头像样式 end*/
  73. </style>
  74. <div id="app" v-cloak>
  75. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  76. <div slot="header">
  77. <div>
  78. <span>参与记录</span>
  79. </div>
  80. </div>
  81. <div class="table-body">
  82. <div size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
  83. <div class="item-box" flex="dir:left cross:center" style="margin-left: 10px;">
  84. <div class="label">支付时间: </div>
  85. <el-date-picker
  86. size="small"
  87. v-model="search.create_time"
  88. type="datetimerange"
  89. value-format="yyyy-MM-dd HH:mm:ss"
  90. range-separator="至"
  91. start-placeholder="开始日期"
  92. end-placeholder="结束日期">
  93. </el-date-picker>
  94. </div>
  95. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
  96. <div class="label">会员ID: </div>
  97. <el-input size="small" style="width: 210px" v-model="search.user_id" placeholder="请输入会员ID"></el-input>
  98. </div>
  99. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
  100. <div class="label">会员: </div>
  101. <el-input size="small" style="width: 210px" v-model="search.user_keyword" placeholder="会员昵称/手机号码"></el-input>
  102. </div>
  103. <div class="item-box" flex="dir:left cross:center">
  104. <el-button type="primary" style="padding: 8px 34px !important;" @click="searchs">搜索
  105. </el-button>
  106. <el-button type="danger" style="padding: 12px 34px !important;" size="small" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
  107. </div>
  108. </div>
  109. <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
  110. <el-table-column prop="id" label="ID" min-width="80" align="center"></el-table-column>
  111. <el-table-column
  112. label="会员ID"
  113. min-width="50"
  114. align="center">
  115. <template slot-scope="scope">
  116. <com-ellipsis :line="1">{{scope.row.user.id}}</com-ellipsis>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="会员" width="180" >
  120. <template slot-scope="scope">
  121. <div class="user_img" v-if="scope.row.user_id>0">
  122. <el-image class="default-avatar" :src="scope.row.user.avatar_url">
  123. <div slot="error" class="image-slot">
  124. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  125. </div>
  126. </el-image>
  127. </div>
  128. <div class="user_img" v-else>
  129. <el-image class="default-avatar" :src="scope.row.user_avatar_url">
  130. <div slot="error" class="image-slot">
  131. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  132. </div>
  133. </el-image>
  134. </div>
  135. <div>
  136. <div style="color:#000;" v-if="scope.row.user_id>0">{{scope.row.user.nickname}}</div>
  137. <div style="color:#000;" v-else>{{scope.row.user_name}}</div>
  138. <div style="font-size: 13px;" v-if="scope.row.user_id>0">{{scope.row.user.mobile}}</div>
  139. </div>
  140. </template>
  141. </el-table-column>
  142. <el-table-column label="活动名称" align="center">
  143. <template slot-scope="scope">
  144. <com-ellipsis :line="1">{{scope.row.recommen.name}}</com-ellipsis>
  145. </template>
  146. </el-table-column>
  147. <el-table-column label="活动类型" align="center">
  148. <template slot-scope="scope">
  149. <span v-if="scope.row.recommen.type == 2">阶梯奖励</span>
  150. <span v-else>条件奖励</span>
  151. </template>
  152. </el-table-column>
  153. <el-table-column label="奖励类型" align="center">
  154. <template slot-scope="scope">
  155. <span v-if="scope.row.be_reward == 2">推荐奖励</span>
  156. <span v-else>被推荐奖励</span>
  157. </template>
  158. </el-table-column>
  159. <el-table-column label="赠送内容" align="center">
  160. <template slot-scope="scope">
  161. <span style="cursor: pointer">
  162. <el-tooltip class="item" effect="dark" :content="scope.row.reward" placement="bottom">
  163. <com-ellipsis :line="1" >{{scope.row.reward}}</com-ellipsis>
  164. </el-tooltip>
  165. </span>
  166. </template>
  167. </el-table-column>
  168. <el-table-column prop="scope" width="180" label="创建时间">
  169. <template slot-scope="scope">
  170. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  171. </template>
  172. </el-table-column>
  173. </el-table>
  174. <div style="text-align: right;margin: 20px 0;">
  175. <el-pagination v-if="pagination" :page-size="pagination.pageSize"
  176. style="display: inline-block;float: right;" background @current-change="pageChange"
  177. layout="prev, pager, next" :total="pagination.total_count">
  178. </el-pagination>
  179. </div>
  180. </div>
  181. </el-card>
  182. </div>
  183. <script>
  184. const app = new Vue({
  185. el: '#app',
  186. data() {
  187. return {
  188. list: [],
  189. cate_list:[],
  190. listLoading: false,
  191. btnLoading: false,
  192. pagination:null,
  193. page: 1,
  194. active_id: '',
  195. pageCount: 0,
  196. dataList: [],
  197. search: {
  198. user_id:'',
  199. user_keyword:'',
  200. cate_id:'',
  201. name:'',
  202. use_status:'',
  203. create_time:'',
  204. },
  205. // 对话框显示与否
  206. dialogVisible: false,
  207. dataloading: false,
  208. addGroupVisible: false,
  209. };
  210. },
  211. computed: {
  212. show_clear_search_btn: function() {
  213. return !isEmpty(this.search.user_id)
  214. ||!isEmpty(this.search.user_keyword)
  215. ||!isEmpty(this.search.name)
  216. ||!isEmpty(this.search.create_time)
  217. }
  218. },
  219. methods: {
  220. resetSearch(){
  221. this.search = {
  222. user_id:'',
  223. user_keyword:'',
  224. name:'',
  225. create_time:'',
  226. }
  227. },
  228. searchs() {
  229. this.page = 1;
  230. this.getList();
  231. },
  232. pageChange(currentPage) {
  233. let self = this;
  234. self.page = currentPage; //console.log(currentPage,999999);
  235. self.getList();
  236. },
  237. getList() {
  238. let self = this;
  239. self.listLoading = true;
  240. request({
  241. params: {
  242. r: 'recommen/reward/index',
  243. page: self.page,
  244. name: this.search.name,
  245. user_id: this.search.user_id,
  246. user_keyword: this.search.user_keyword,
  247. create_time: this.search.create_time,
  248. active_id:this.active_id,
  249. },
  250. method: 'get',
  251. }).then(e => {
  252. self.listLoading = false;
  253. self.list = e.data.data.list;
  254. this.pagination = e.data.data.pagination;
  255. this.pagination.pageSize = e.data.data.page_size;
  256. this.cate_list = e.data.data.cate;
  257. this.pagination.total_count = e.data.data.count;
  258. }).catch(e => {
  259. console.log(e);
  260. });
  261. },
  262. },
  263. mounted: function () {
  264. if(getQuery('active_id')){
  265. this.active_id = getQuery('active_id');
  266. }
  267. this.getList();
  268. }
  269. });
  270. </script>