index.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <?php
  2. /**
  3. * @link:http://www.goodmall.com/
  4. * @copyright: Copyright (c) 2020
  5. * 名片
  6. * Author: james
  7. * Date: 2020-07-10
  8. * Time: 15:48
  9. */
  10. ?>
  11. <div id="app" v-cloak>
  12. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  13. <div slot="header">
  14. <span>观看奖励</span>
  15. </div>
  16. <div class="table-body">
  17. <el-form size="small" :inline="true" flex="dir:left cross:center">
  18. <div class="item-box" flex="dir:left cross:center">
  19. <div class="label">视频ID</div>
  20. <el-input size="small" style="width: 200px" v-model="search.video_id" placeholder="请输入视频ID"></el-input>
  21. </div>
  22. <div class="item-box" flex="dir:left cross:center">
  23. <div class="label">会员呢称</div>
  24. <el-input size="small" style="width: 200px" v-model="search.nickname" placeholder="请输入会员呢称"></el-input>
  25. </div>
  26. <div class="item-box" flex="dir:left cross:center">
  27. <div class="label">创建时间</div>
  28. <el-date-picker @change="selectedDateTime" size="small" v-model="time" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="center" clearable>
  29. </el-date-picker>
  30. </div>
  31. <div class="item-box" flex="dir:left cross:center">
  32. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="searchs">搜索
  33. </el-button>
  34. </div>
  35. <div class="item-box" flex="dir:left cross:center" v-if="search.video_id || search.nickname || search.start_time || search.end_time">
  36. <el-button size="small" type="warning" style="padding: 9px 15px !important;" @click="clearSearchs">清除搜索条件
  37. </el-button>
  38. </div>
  39. </el-form>
  40. <el-tabs v-model="activeName" @tab-click="handleClick">
  41. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
  42. <el-table-column prop="video_id" label="视频ID" min-width="150" align="center"></el-table-column>
  43. <el-table-column prop="avatar_url,nickname" label="会员" min-width="200">
  44. <template slot-scope="scope">
  45. <div class="table-info-img-text">
  46. <el-image class="table-info-img circle" :src="scope.row.avatar_url">
  47. <div slot="error" class="image-slot">
  48. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  49. </div>
  50. </el-image>
  51. <div class="table-info-text">
  52. <div v-if="scope.row.nickname">{{scope.row.nickname}} [ID: {{scope.row.user_id}}]</div>
  53. <div>{{scope.row.mobile}}</div>
  54. </div>
  55. </div>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="奖励" prop="award_type,award_integral,award_money" min-width="200" align="center">
  59. <template slot-scope="scope">
  60. <div v-if="scope.row.award_type==0">{{scope.row.award_integral}}积分</div>
  61. <div v-else-if="scope.row.award_type==1">{{scope.row.award_money}}元</div>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="发布时间" prop="created_at" min-width="200" align="center">
  65. <template slot-scope="scope">
  66. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  67. </template>
  68. </el-table-column>
  69. </el-table>
  70. </el-tabs>
  71. <!-- 分页器 -->
  72. <div flex="box:last cross:center">
  73. <div></div>
  74. <div>
  75. <el-pagination v-if="list.length > 0" style="display: inline-block;float: right;" background :page-size="pagination.pageSize" @current-change="pageChange" layout="prev, pager, next" :current-page="pagination.current_page" :page-count="pageCount">
  76. </el-pagination>
  77. </div>
  78. </div>
  79. </div>
  80. </el-card>
  81. </div>
  82. <script>
  83. const app = new Vue({
  84. el: '#app',
  85. data: {
  86. page: 1,
  87. time: [], //本地存时间,请求时不发送
  88. search: {
  89. video_id: null, //视频id
  90. nickname: '', //昵称
  91. start_time: '',
  92. end_time: '',
  93. },
  94. loading: false,
  95. activeName: '-1',
  96. list: [], //列表数据
  97. pagination: null,
  98. pageCount: 1,
  99. },
  100. mounted() {
  101. this.loadData(this.page, this.search); //获取列表数据
  102. },
  103. methods: {
  104. // 1.0 获取观看奖励列表
  105. loadData(page, others) {
  106. this.loading = true;
  107. request({
  108. params: {
  109. r: 'short-video/default/browse-reward-list',
  110. page: page,
  111. ...others, //其他搜索字段
  112. },
  113. method: 'get',
  114. }).then(e => {
  115. this.loading = false;
  116. if (e.data.code === 0) {
  117. this.list = e.data.data.list;
  118. this.pagination = e.data.data.pagination;
  119. this.pageCount = e.data.data.page_count;
  120. } else {
  121. this.$message.error(e.data.msg);
  122. }
  123. }).catch(e => {});
  124. },
  125. pageChange(page) {
  126. this.page = page;
  127. this.loadData(this.page, this.search);
  128. },
  129. handleClick(tab, event) {
  130. this.page = 1;
  131. this.search.status = this.activeName;
  132. this.loadData(this.page, this.search)
  133. },
  134. searchs() {
  135. this.page = 1;
  136. this.loadData(this.page, this.search);
  137. },
  138. clearSearchs() {
  139. this.search.video_id = 0;
  140. this.search.nickname = '';
  141. this.search.start_time = '';
  142. this.search.end_time = '';
  143. this.time = [];
  144. this.loadData(this.page, this.search);
  145. },
  146. // 时间搜索选中
  147. selectedDateTime(val) {
  148. console.log(val);
  149. if (this.time) {
  150. this.search.start_time = this.time[0];
  151. this.search.end_time = this.time[1];
  152. } else {
  153. this.time = [];
  154. this.search.start_time = '';
  155. this.search.end_time = '';
  156. }
  157. this.loadData(1, this.search);
  158. },
  159. }
  160. });
  161. </script>
  162. <style>
  163. .el-tabs__header {
  164. font-size: 16px;
  165. }
  166. .table-body {
  167. padding: 20px;
  168. background-color: #fff;
  169. }
  170. .table-body .el-button {
  171. padding: 0 !important;
  172. border: 0;
  173. margin: 0 5px;
  174. }
  175. .input-item {
  176. width: 250px;
  177. margin: 0 0 20px;
  178. display: inline-block;
  179. }
  180. .input-item .el-input__inner {
  181. border-right: 0;
  182. }
  183. .input-item .el-input__inner:hover {
  184. border: 1px solid #dcdfe6;
  185. border-right: 0;
  186. outline: 0;
  187. }
  188. .input-item .el-input__inner:focus {
  189. border: 1px solid #dcdfe6;
  190. border-right: 0;
  191. outline: 0;
  192. }
  193. .input-item .el-input-group__append {
  194. background-color: #fff;
  195. border-left: 0;
  196. width: 10%;
  197. padding: 0;
  198. }
  199. .input-item .el-input-group__append .el-button {
  200. padding: 0;
  201. }
  202. .input-item .el-input-group__append .el-button {
  203. margin: 0;
  204. }
  205. .batch {
  206. margin: 0 0 20px;
  207. display: inline-block;
  208. }
  209. .batch .el-button {
  210. padding: 9px 15px !important;
  211. }
  212. .item-box {
  213. margin-right: 20px;
  214. }
  215. .item-box .label {
  216. margin-right: 8px;
  217. }
  218. .el-table th>.cell {
  219. color: #333;
  220. font-weight: bold;
  221. font-size: 14px;
  222. }
  223. .el-table__footer-wrapper,
  224. .el-table__header-wrapper {
  225. border-bottom: 1.4px solid #D6D6D6;
  226. }
  227. </style>