index.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;" v-loading="loading">
  3. <div slot="header">
  4. <span>订单详情</span>
  5. </div>
  6. <div class="table-body">
  7. <div class="search-item">
  8. <el-input size="small" placeholder="请输入订单号" v-model="search.order_no"
  9. clearable @clear="toSearch">
  10. </el-input>
  11. </div>
  12. <div class="search-item">
  13. <el-input size="small" placeholder="请输入手机号" v-model="search.mobile"
  14. clearable @clear="toSearch">
  15. </el-input>
  16. </div>
  17. <div class="search-item">
  18. <el-input size="small" placeholder="请输入ID" v-model="search.user_id"
  19. clearable @clear="toSearch">
  20. </el-input>
  21. </div>
  22. <div class="search-item">
  23. <el-date-picker v-model="time" type="daterange" range-separator="至"
  24. start-placeholder="开始日期" end-placeholder="结束日期" @change="timeChange" value-format="yyyy-MM-dd HH:mm:ss">
  25. </el-date-picker>
  26. </div>
  27. <el-button type="primary" size="small" icon="el-icon-search" style="padding: 9px 15px !important;" @click="toSearch">搜索</el-button>
  28. <el-button size="small" icon="el-icon-refresh-right" style="padding: 9px 15px !important;" @click="reset">重置</el-button>
  29. <el-table :data="list" stripe v-loading="loading" size="small" style="margin: 15px 0;">
  30. <el-table-column prop="order_no" label="订单号" align="center"></el-table-column>
  31. <el-table-column prop="activity_title" label="活动名称" align="center"></el-table-column>
  32. <el-table-column prop="detail[0].goods_name" label="商品信息" align="center">
  33. </el-table-column>
  34. <el-table-column prop="activity_price" label="秒杀价格" align="center">
  35. </el-table-column>
  36. <el-table-column prop="detail[0].num" label="购买数量" align="center"></el-table-column>
  37. <el-table-column prop="goods_price" label="实付价格" align="center"></el-table-column>
  38. <el-table-column prop="updated_at" label="修改时间" align="center">
  39. <template slot-scope="scope">
  40. {{timeformat(scope.row.updated_at)}}
  41. </template>
  42. </el-table-column>
  43. <el-table-column prop="user_id" label="用户信息" align="center">
  44. <template slot-scope="scope">
  45. {{scope.row.base_user.nickname}} {{scope.row.base_user.mobile}}
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. <div flex="box:last cross:center">
  50. <div></div>
  51. <div>
  52. <el-pagination
  53. v-if="list.length > 0"
  54. style="display: inline-block;float: right;"
  55. background :page-size="pageSize"
  56. @current-change="pageChange"
  57. layout="prev, pager, next" :current-page="current_page"
  58. :total="totalCount">
  59. </el-pagination>
  60. </div>
  61. </div>
  62. </div>
  63. </el-card>
  64. </div>
  65. <script>
  66. const app = new Vue({
  67. el: '#app',
  68. data: {
  69. loading:false,
  70. search: {
  71. activity_id:'',
  72. order_no:'',
  73. mobile:'',
  74. user_id:"",
  75. begin:'',
  76. end:'',
  77. page:null
  78. },
  79. loading: false,
  80. time:[],
  81. list:[],
  82. pageSize:20,
  83. current_page:1,
  84. totalCount:0,
  85. },
  86. // created() {
  87. // },
  88. mounted() {
  89. console.log(getQuery('id'));
  90. if(getQuery('id')) {
  91. this.search.activity_id = getQuery('id')
  92. }else {
  93. }
  94. this.getDataList(this.search)
  95. },
  96. methods: {
  97. // 获取数据
  98. getDataList(search = {}) {
  99. this.loading = true;
  100. request({
  101. params: {
  102. r: '/seckill/order/list',
  103. ...search
  104. },
  105. method: 'get',
  106. }).then(e => {
  107. console.log(e,'77777777777');
  108. this.loading = false;
  109. this.list = e.data.data.list
  110. }).catch(e => {
  111. this.loading = false;
  112. });
  113. },
  114. //重置
  115. reset() {
  116. if(getQuery('id')) {
  117. this.search.user_id = getQuery('id')
  118. this.getDataList(this.search)
  119. }else {
  120. this.getDataList()
  121. }
  122. },
  123. pageChange(v) {
  124. this.search.page = v
  125. this.getDataList(this.search)
  126. },
  127. // 搜索
  128. toSearch() {
  129. this.getDataList(this.search)
  130. },
  131. timeChange(v) {
  132. console.log(v,'time99999999999');
  133. if(v) {
  134. this.search.begin = v[0]
  135. this.search.end = v[1]
  136. }else {
  137. this.search.begin = ''
  138. this.search.end = ''
  139. }
  140. },
  141. timeformat(v) {
  142. let time = new Date(v*1000)
  143. return time.getFullYear() +'/'+(time.getUTCMonth()+1)+'/'+time.getDate() + ' '+ (time.getHours()<10?'0' +time.getHours():time.getHours()) +':'+ (time.getMinutes()<10?'0'+time.getMinutes():time.getMinutes()) + ':'+ (time.getSeconds()<10?'0'+time.getSeconds():time.getSeconds())
  144. },
  145. }
  146. })
  147. </script>
  148. <style>
  149. .search-item {
  150. display: inline-block;
  151. margin: 0 20px 0 0 ;
  152. }
  153. </style>