order-list.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <style>
  2. .el-table th>.cell {
  3. color: #333;
  4. font-weight: bold;
  5. font-size: 14px;
  6. }
  7. .table1 .el-table__footer-wrapper,
  8. .table1 .el-table__header-wrapper {
  9. border-bottom: 1.4px solid #D6D6D6;
  10. }
  11. .user_img {
  12. position: relative;
  13. margin-right: 8px;
  14. /* height: 50px;
  15. width: 50px; */
  16. }
  17. .default-avatar {
  18. width: 50px;
  19. height: 50px;
  20. border-radius: 50%;
  21. margin-right: 8px;
  22. }
  23. .uer-nickname {
  24. flex: 1;
  25. }
  26. </style>
  27. <div id="app">
  28. <div class="table-body" style="min-width: 1000px;">
  29. <div slot="header" class="clearfix" style="height: 20px;">
  30. <span>拼团订单</span>
  31. </div>
  32. <div slot="header" class="clearfix" style="margin-top: 20px;">
  33. <el-button :type="LoadDataType==-1?'primary':''" size="small" @click="getLoadData(-1)">全部</el-button>
  34. <el-button :type="LoadDataType==0?'primary':''" size="small" @click="getLoadData(0)">待支付</el-button>
  35. <el-button :type="LoadDataType==1?'primary':''" size="small" @click="getLoadData(1)">参团中</el-button>
  36. <el-button :type="LoadDataType==2?'primary':''" size="small" @click="getLoadData(2)">拼团成功</el-button>
  37. <el-button :type="LoadDataType==3?'primary':''" size="small" @click="getLoadData(3)">拼团失败</el-button>
  38. <div class="demo-input-suffix" style="margin-top: 20px;margin-bottom: 10px;">
  39. <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:300px;margin-right: 20px;" placeholder="昵称" v-model="search.nickname" clearable></el-input>
  40. <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:300px;margin-right: 20px;" placeholder="手机号" v-model="search.mobile" clearable></el-input>
  41. <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:300px;margin-right: 20px;" placeholder="订单号" v-model="search.order_no" clearable></el-input>
  42. <el-button type="primary" size="small" @click="toSearchActivity">搜索</el-button>
  43. </div>
  44. </div>
  45. <template>
  46. <el-table :data="list" stripe style="width: 100%" v-loading="listLoading" class="table1">
  47. <!-- <el-table-column prop="id" label="id" width="100" align="center"></el-table-column> -->
  48. <el-table-column label="会员id" width="100">
  49. <template slot-scope="scope">
  50. <div class="table-info-img-text">
  51. <div class="table-info-text">
  52. <div>{{scope.row.user.id}}</div>
  53. </div>
  54. </div>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="会员" width="180">
  58. <template slot-scope="scope">
  59. <div class="table-info-img-text">
  60. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  61. <div slot="error" class="image-slot">
  62. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  63. </div>
  64. </el-image>
  65. <div class="table-info-text">
  66. <div>{{scope.row.user.nickname}}</div>
  67. <div>{{scope.row.user.mobile}}</div>
  68. <span v-html="scope.row.is_commander=='1'?'团长':'团员'"></span>
  69. </div>
  70. </div>
  71. </template>
  72. </el-table-column>
  73. <el-table-column prop="order_no" label="订单号" width="220" align="center">
  74. <template slot-scope="scope">
  75. <el-button v-if="scope.row.order_status==2" @click="toOrderList(scope.row.order_no)" type="text" size="small">{{scope.row.order_no}}</el-button>
  76. <span v-else>{{scope.row.order_no}}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column prop="goods.name,goods.cover_pic" label="商品名称" width="210">
  80. <template slot-scope="scope">
  81. <div flex="box:first cross:top cross:center">
  82. <div style="padding-right: 10px;">
  83. <com-image mode="aspectFill" :src="scope.row.pic_url"></com-image>
  84. </div>
  85. <div>
  86. {{scope.row.goods_name}}
  87. </div>
  88. </div>
  89. </template>
  90. </el-table-column>
  91. <el-table-column prop="price" label="原价" align="center"></el-table-column>
  92. <el-table-column prop="group_buy_price" label="拼团价" align="center"></el-table-column>
  93. <el-table-column prop="shipping_money" label="运费" align="center"></el-table-column>
  94. <el-table-column prop="total_pay_price" label="订单金额" align="center"></el-table-column>
  95. <el-table-column prop="order_status" label="状态" align="center">
  96. <template slot-scope="scope">
  97. <el-tag effect="dark" size="small" type="info" v-if="scope.row.order_status==0">待支付</el-tag>
  98. <el-tag effect="dark" size="small" type="" v-if="scope.row.order_status==1">参团中</el-tag>
  99. <el-tag effect="dark" size="small" type="success" v-if="scope.row.order_status==2">成功</el-tag>
  100. <el-tag effect="dark" size="small" type="warning" v-if="scope.row.order_status==3">失败</el-tag>
  101. <el-tag effect="dark" size="small" type="danger" v-if="scope.row.order_status==4">已关闭</el-tag>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="支付时间" width="150" align="center">
  105. <template slot-scope="scope">
  106. <span> {{scope.row.pay_time|dateTimeFormat('Y-m-d H:i:s')}}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="下单时间" width="150" align="center">
  110. <template slot-scope="scope">
  111. <span> {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="操作" align="center">
  115. <template slot-scope="scope">
  116. <el-button v-if="scope.row.groupBuyActive.is_virtual==1&&scope.row.order_status==1" @click="finish(scope.row)" type="text" size="small">结束拼团</el-button>
  117. <el-button v-if="scope.row.order_status==2" @click="toOrderDetail(scope.row.order_id)" type="text" size="small">订单详情</el-button>
  118. <!-- <el-button v-if="scope.row.order_status==3" @click="queryRefund(scope.row)" type="primary" size="small">查询退款</el-button>-->
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. <div flex="main:right cross:center" style="margin-top: 20px;">
  123. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize" style="display: inline-block;float: right;" background @current-change="pageChange" layout="prev, pager, next" :total="pagination.totalCount">
  124. </el-pagination>
  125. </div>
  126. </template>
  127. </div>
  128. </div>
  129. <script>
  130. const app = new Vue({
  131. el: '#app',
  132. data() {
  133. return {
  134. listLoading: false,
  135. list: [],
  136. pagination: {
  137. total: 0
  138. },
  139. loading: false,
  140. LoadDataType: -1, //默认显示全部数据
  141. dialogFormVisible: false, //默认不显示弹窗
  142. group_buy_attr_list: [],
  143. goodsDetail: {},
  144. order_status_map: {},
  145. dialogLoading: false,
  146. search: {
  147. nickname: '',
  148. mobile: '',
  149. order_no: '',
  150. order_status: -1,
  151. page: 1,
  152. },
  153. }
  154. },
  155. methods: {
  156. //状态按钮的点击事件
  157. getLoadData(e) {
  158. this.search.order_status = e;
  159. this.loadData()
  160. },
  161. toSearchActivity() {
  162. this.loadData()
  163. },
  164. pageChange(page) {
  165. this.search.page = page;
  166. this.loadData();
  167. },
  168. // 跳转到订单详情
  169. toOrderDetail(order_id) {
  170. navigateTo({
  171. r: 'mall/order/detail',
  172. id: order_id, //直接跳转到订单详情页,但是要确保获取时字段统一
  173. })
  174. },
  175. toOrderList(order_no) {
  176. navigateTo({
  177. r: 'mall/order/index',
  178. order_no: order_no, //直接跳转到订单详情页,但是要确保获取时字段统一
  179. })
  180. },
  181. // 请求获取数据--获取拼团商品列表
  182. loadData() {
  183. this.listLoading = true;
  184. let params = {
  185. r: 'group-buy/default/order-list'
  186. };
  187. params = Object.assign(params, this.search);
  188. request({
  189. params: params,
  190. method: 'get',
  191. }).then(e => {
  192. let res = e.data;
  193. this.listLoading = false;
  194. if (res.code === 0) {
  195. this.list = res.data.list;
  196. this.order_status_map = res.data.order_status_map;
  197. this.pagination = res.data.pagination; //拿到关于页码页容量的数据
  198. } else {
  199. this.$message.error(res.msg);
  200. }
  201. }).catch(e => {});
  202. },
  203. finish(row) {
  204. this.loading = true;
  205. request({
  206. params: {
  207. r: 'group-buy/default/finish',
  208. open_group_id: row.id
  209. },
  210. method: 'get',
  211. }).then(e => {
  212. let res = e.data;
  213. this.listLoading = false;
  214. if (res.code === 0) {
  215. let others = {
  216. group_buy_active_id: this.group_buy_active_id
  217. }
  218. this.loadData(this.current_page, others, this.search);
  219. this.$message.success(res.msg);
  220. } else {
  221. this.$message.error(res.msg);
  222. }
  223. }).catch(e => {});
  224. },
  225. queryRefund(row) {
  226. this.loading = true;
  227. request({
  228. params: {
  229. r: 'group-buy/default/query-refund',
  230. id: row.id
  231. },
  232. method: 'get',
  233. }).then(e => {
  234. let res = e.data;
  235. this.listLoading = false;
  236. if (res.code === 0) {
  237. this.$message.success(res.msg);
  238. } else {
  239. this.$message.error(res.msg);
  240. }
  241. }).catch(e => {});
  242. },
  243. },
  244. // 加载的时候获取到列表页
  245. mounted() {
  246. // 数据初始化
  247. this.LoadDataType = -1;
  248. this.loadData();
  249. }
  250. })
  251. </script>