index.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <style>
  2. .table-body {
  3. padding: 20px;
  4. background-color: #fff;
  5. }
  6. .input-item {
  7. width: 250px;
  8. margin: 0 0 20px;
  9. }
  10. .input-item .el-input__inner {
  11. border-right: 0;
  12. }
  13. .input-item .el-input__inner:hover{
  14. border: 1px solid #dcdfe6;
  15. border-right: 0;
  16. outline: 0;
  17. }
  18. .input-item .el-input__inner:focus{
  19. border: 1px solid #dcdfe6;
  20. border-right: 0;
  21. outline: 0;
  22. }
  23. .input-item .el-input-group__append {
  24. background-color: #fff;
  25. border-left: 0;
  26. width: 10%;
  27. padding: 0;
  28. }
  29. .input-item .el-input-group__append .el-button {
  30. padding: 0;
  31. }
  32. .input-item .el-input-group__append .el-button {
  33. margin: 0;
  34. }
  35. .table-body .el-button {
  36. padding: 0!important;
  37. border: 0;
  38. margin: 0 5px;
  39. }
  40. /*头像样式 start*/
  41. .default-avatar{
  42. width: 50px;
  43. height: 50px;
  44. border-radius: 50%;
  45. }
  46. .user_img{
  47. position: relative;
  48. margin-right: 8px;
  49. height: 50px;
  50. width: 50px;
  51. }
  52. .el-table_1_column_2 .cell { /*-2 表示在第二行*/
  53. display: flex;
  54. }
  55. /*头像样式 end*/
  56. </style>
  57. <div id="app" v-cloak>
  58. <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  59. <div slot="header">
  60. <span>抽奖记录</span>
  61. </div>
  62. <div class="table-body el-input--small">
  63. <el-form size="small" :inline="true" :model="search">
  64. <!-- <el-form-item>
  65. <el-select style="width: 100px" v-model="search.status1">
  66. <el-option label="全部用户" value="0"></el-option>
  67. <el-option label="微信" value="1"></el-option>
  68. <el-option label="支付宝" value="2"></el-option>
  69. </el-select>
  70. </el-form-item> -->
  71. <el-form-item>
  72. <el-select style="width: 100px" @change="typeSearch(search.type)" v-model="search.type">
  73. <el-option label="全部" value="0" ></el-option>
  74. <el-option label="余额红包" value="1"></el-option>
  75. <el-option label="优惠券" value="2"></el-option>
  76. <el-option label="积分" value="3"></el-option>
  77. <el-option label="赠品" value="4"></el-option>
  78. <el-option label="谢谢参与" value="5"></el-option>
  79. </el-select>
  80. </el-form-item>
  81. <el-form-item>
  82. <div class="input-item">
  83. <el-input @keyup.enter.native="idSearch(search.user_id)" size="small" placeholder="请输入用户ID" v-model="search.user_id" clearable @clear='idSearch(search.user_id)'>
  84. <el-button slot="append" icon="el-icon-search" @click="idSearch(search.user_id)"></el-button>
  85. </el-input>
  86. </div>
  87. </el-form-item>
  88. <el-form-item>
  89. <div class="input-item">
  90. <el-input @keyup.enter.native="pondSearch(search.keyword)" size="small" placeholder="请输入用户手机号/昵称" v-model="search.keyword" clearable @clear='pondSearch(search.keyword)'>
  91. <el-button slot="append" icon="el-icon-search" @click="pondSearch(search.keyword)"></el-button>
  92. </el-input>
  93. </div>
  94. </el-form-item>
  95. </el-form>
  96. <el-table v-loading="loading" :data="list" stripe style="width: 100%">
  97. <el-table-column prop="id" label="ID" width="100"></el-table-column>
  98. <el-table-column label="会员" width="200">
  99. <template slot-scope="scope">
  100. <div class="table-info-img-text" v-if="scope.row.user">
  101. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  102. <div slot="error" class="image-slot">
  103. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  104. </div>
  105. </el-image>
  106. <div class="table-info-text">
  107. <div>{{scope.row.user.nickname}}</div>
  108. <div>{{scope.row.user.mobile}}</div>
  109. </div>
  110. </div>
  111. </template>
  112. </el-table-column>
  113. <el-table-column prop="status" label="物品" width="330">
  114. <template slot-scope="scope">
  115. <div class="table-info-img-text" v-if="scope.row.goods">
  116. <el-image class="table-info-img" :src="scope.row.goods.cover_pic" v-if="scope.row.goods.cover_pic"></el-image>
  117. <div class="table-info-text">
  118. <div v-if="scope.row.order" style="cursor: pointer; color: #00a0e9;" @click="handle('detail',scope.row.order)">{{scope.row.order.order_no}}</div>
  119. <com-ellipsis :line="1" :title="scope.row.goods.goods_name">{{scope.row.goods.goods_name}}</com-ellipsis>
  120. <div v-if="scope.row.order">状态:
  121. <span v-if="scope.row.order.order_status=='0'">待付款</span>
  122. <span v-if="scope.row.order.order_status=='1'">待发货</span>
  123. <span v-if="scope.row.order.order_status=='2'">待收货</span>
  124. <span v-if="scope.row.order.order_status=='3'">已收货</span>
  125. <span v-if="scope.row.order.order_status=='4'">已完成</span>
  126. <span v-if="scope.row.order.order_status=='-4'">售后订单</span>
  127. </div>
  128. </div>
  129. </div>
  130. <div class="table-info-img-text" v-else >
  131. <el-image class="table-info-img" :src="scope.row.sudoku.image_url" ></el-image>
  132. <div class="table-info-text">
  133. <div @click="handle('detail',scope.row.order)">{{scope.row.prize_name}}</div>
  134. </div>
  135. </div>
  136. </template>
  137. </el-table-column>
  138. <el-table-column prop="status" label="领取状态">
  139. <template slot-scope="scope">
  140. <!-- <el-switch v-model="scope.row.status" active-value="1" inactive-value="0" disabled> </el-switch> -->
  141. <div v-if="scope.row.prize_name == '谢谢参与'">--</div>
  142. <div v-else-if="scope.row.status == 1">已领取</div>
  143. <div v-else-if="scope.row.status == 0">未领取</div>
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="抽奖时间">
  147. <template slot-scope="scope">
  148. <div>{{scope.row.created_at | dateTimeFormat("Y-m-d H:i:s")}}</div>
  149. </template>
  150. </el-table-column>
  151. <el-table-column prop="raffled_at" label="领取时间">
  152. <template slot-scope="scope">
  153. <span v-if="scope.row.prize_name == '谢谢参与'">--</span>
  154. <span v-else-if="scope.row.receive_at != 0">{{ scope.row.receive_at | dateTimeFormat("Y-m-d H:i:s") }}</span>
  155. </template>
  156. </el-table-column>
  157. </el-table>
  158. <div flex="box:last cross:center">
  159. <div style="visibility: hidden">
  160. <el-button plain type="primary" size="small">批量操作1</el-button>
  161. <el-button plain type="primary" size="small">批量操作2</el-button>
  162. </div>
  163. <div>
  164. <el-pagination v-if="pagination"
  165. :page-size="pagination.pageSize"
  166. background @current-change="pageChange"
  167. layout="prev, pager, next"
  168. :total="pagination.total_count">
  169. </el-pagination>
  170. </div>
  171. </div>
  172. </div>
  173. </el-card>
  174. </div>
  175. <script>
  176. const app = new Vue({
  177. el: '#app',
  178. data() {
  179. return {
  180. search: {
  181. type:'0',
  182. user_id:'',
  183. keyword: '',
  184. page:1
  185. },
  186. prize_list:[],
  187. loading: false,
  188. list: [],
  189. pagination: null,
  190. page:1,
  191. };
  192. },
  193. methods: {
  194. //分页
  195. pageChange(page) {
  196. this.search.page = page;
  197. this.getList();
  198. },
  199. // 选择器筛选
  200. typeSearch(val) {
  201. this.search.type = val;
  202. this.getList();
  203. },
  204. // 关键词搜索
  205. pondSearch(val) {
  206. this.search.keyword = val;
  207. this.getList();
  208. },
  209. idSearch(val) {
  210. this.search.user_id = val;
  211. this.getList();
  212. },
  213. handle(type, data = null) {
  214. let id = data ? parseInt(data.id) : '';
  215. switch (type) {
  216. // 订单详情
  217. case 'detail':
  218. let params = {
  219. r: 'mall/order/detail'
  220. };
  221. if (id) params = Object.assign(params, {
  222. id: id
  223. });
  224. navigateTo(params);
  225. break;
  226. }
  227. },
  228. getList() {
  229. //this.loading = true;
  230. request({
  231. params: {
  232. r: '/sudoku/log/index',
  233. ...this.search
  234. },
  235. }).then(e => {
  236. if (e.data.code == 0) {
  237. this.loading = false;
  238. this.list = e.data.data.list;
  239. this.prize_list = e.data.data.prize_list;
  240. this.pagination = e.data.data.pagination;
  241. this.pagination.pageSize = e.data.data.page_size;
  242. this.pagination.total_count = e.data.data.count;
  243. }
  244. }).catch(e => {
  245. });
  246. },
  247. },
  248. created() {
  249. this.getList();
  250. }
  251. })
  252. </script>