detail.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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. use common\helpers\ComponentHelper;
  11. ComponentHelper::loadComponentView('com-export-dialog', '@backend/views/components/common');
  12. ?>
  13. <style>
  14. .order_stat{
  15. background: #FFF;
  16. padding: 10px 10px 0;
  17. margin-bottom: 10px;
  18. }
  19. .title{
  20. font-size: 18px;
  21. font-weight: bold;
  22. display: flex;
  23. align-items: center;
  24. height: 40px;
  25. display: flex;
  26. justify-content: space-between;
  27. }
  28. .order_stat > .title > .time{
  29. font-size: 13px;
  30. font-weight: 400;
  31. color: #BFBFBF;
  32. margin-left: 20px;
  33. flex: 1;
  34. }
  35. .order_stat .stat_details{
  36. padding: 30px 0;
  37. display: flex;
  38. }
  39. .default-avatar{
  40. width: 50px;
  41. height: 50px;
  42. border-radius: 50%;
  43. margin-right: 8px;
  44. }
  45. .uer-nickname {
  46. flex: 1;
  47. }
  48. .user_img{
  49. position: relative;
  50. margin-right: 8px;
  51. /* height: 50px;
  52. width: 50px; */
  53. }
  54. </style>
  55. <div id="app" v-cloak>
  56. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  57. <div slot="header" class="title">
  58. <span>查看详情</span>
  59. <com-export-dialog :field_list='exportList' :action_url="export_url" :params="search" @selected="exportConfirm"></com-export-dialog>
  60. </div>
  61. <div class="table-body">
  62. <el-form size="small" :inline="true" flex="dir:left cross:center">
  63. <div class="item-box" flex="dir:left cross:center">
  64. <div class="label">会员:</div>
  65. <el-input size="small" style="width: 200px" v-model="search.keyword" placeholder="请输入会员昵称、id、手机号"></el-input>
  66. </div>
  67. <div class="item-box" flex="dir:left cross:center">
  68. <div class="label">订单编号:</div>
  69. <el-input size="small" style="width: 200px" v-model="search.order_no" placeholder="请输入订单编号"></el-input>
  70. </div>
  71. <div class="item-box" flex="dir:left cross:center">
  72. <div class="label">创建时间:</div>
  73. <el-date-picker
  74. size="small"
  75. v-model="time"
  76. type="datetimerange"
  77. value-format="yyyy-MM-dd HH:mm:ss"
  78. range-separator="至"
  79. start-placeholder="开始日期"
  80. end-placeholder="结束日期">
  81. </el-date-picker>
  82. </div>
  83. <div class="item-box" flex="dir:left cross:center">
  84. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="searchs">搜索
  85. </el-button>
  86. </div>
  87. </el-form>
  88. <el-tabs v-model="activeName" @tab-click="handleClick">
  89. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;"
  90. @selection-change="handleSelectionChange">
  91. <el-table-column label="会员ID" prop="user_id" align="center">
  92. <template slot-scope="scope">
  93. <div>{{scope.row.user.id}}</div>
  94. </template>
  95. </el-table-column>
  96. <el-table-column
  97. label="会员信息"
  98. min-width="150"
  99. >
  100. <template slot-scope="scope">
  101. <div class="table-info-img-text">
  102. <el-image class="table-info-img circle" v-if="scope.row.user.avatar_url" :src="scope.row.user.avatar_url">
  103. <div slot="error" class="image-slot">
  104. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  105. </div>
  106. </el-image>
  107. <div class="table-info-text">
  108. <div v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  109. <div>{{scope.row.user.mobile}}</div>
  110. </div>
  111. </div>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="商品名称" prop="goods_name" align="center" min-width="200">
  115. <template slot-scope="scope">
  116. <div>{{scope.row.goods_name}}</div>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="订单金额" prop="pay_money" align="center" min-width="200">
  120. <template slot-scope="scope">
  121. <div>{{scope.row.pay_money}}</div>
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="订单编号" prop="order_no" align="center" min-width="200">
  125. <template slot-scope="scope">
  126. <div>{{scope.row.order_no}}</div>
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="创建时间" prop="created_at" min-width="160" align="center">
  130. <template slot-scope="scope">
  131. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  132. </template>
  133. </el-table-column>
  134. </el-table>
  135. </el-tabs>
  136. <!-- 分页器 -->
  137. <div flex="box:last cross:center">
  138. <div></div>
  139. <div>
  140. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  141. style="display: inline-block;float: right;" background @current-change="pageChange"
  142. layout="prev, pager, next" :total="pagination.totalCount">
  143. </el-pagination>
  144. </div>
  145. </div>
  146. </div>
  147. </el-card>
  148. </div>
  149. <script>
  150. const app = new Vue({
  151. el: '#app',
  152. data: {
  153. page:1,
  154. time:[], //本地存时间,请求时不发送
  155. search: {
  156. user_id : '',
  157. keyword:'',
  158. date_end : '', //否 int 搜索结束时间(例如 2020-12-1-02 12:22:33 用插件的时间就可以)搜索时,开始时间和结束时间要一起传过来
  159. date_start : '',
  160. order_no: '',
  161. created_at:'',
  162. },
  163. loading: false,
  164. activeName: '-1',
  165. list: [], //列表数据
  166. pagination: null,
  167. export_url: 'write-off/achievement/detail',
  168. exportList:{},
  169. },
  170. mounted() {
  171. this.search.user_id = getQuery('user_id');
  172. this.search.created_at = getQuery('created_at');
  173. // 获取列表首页数据
  174. this.loadData(this.page,this.search); //获取列表数据
  175. },
  176. methods: {
  177. // 1.0 获取列表
  178. loadData(page,others) {
  179. this.loading = true;
  180. console.log(this.search);
  181. if(!this.time){
  182. this.search.date_start = '';
  183. this.search.date_end = '';
  184. }else{
  185. this.search.date_start = this.time[0];
  186. this.search.date_end = this.time[1];
  187. }
  188. request({
  189. method: 'get',
  190. params: {
  191. r: 'write-off/achievement/detail',
  192. page: page,
  193. ...others, //其他搜索字段
  194. },
  195. }).then(e => {
  196. this.loading = false;
  197. if (e.data.code === 0) {
  198. this.list = e.data.data.list;
  199. this.exportList = e.data.data.export_list;
  200. this.pagination = e.data.data.pagination;
  201. } else {
  202. this.$message.error(e.data.msg);
  203. }
  204. }).catch(e => {
  205. });
  206. },
  207. pageChange(page) {
  208. this.page = page;
  209. this.loadData(this.page,this.search);
  210. },
  211. handleClick(tab, event) {
  212. this.page = 1;
  213. this.search.status = this.activeName;
  214. this.loadData(this.page,this.search)
  215. },
  216. handleSelectionChange(val) {
  217. let self = this;
  218. self.choose_list = [];
  219. val.forEach(function (item) {
  220. self.choose_list.push(item.id);
  221. })
  222. },
  223. searchs() {
  224. this.page = 1;
  225. this.loadData(this.page,this.search);
  226. },
  227. exportConfirm() {
  228. if(this.selectData2 && this.selectData2[0]){
  229. this.search.start = this.selectData2[0];
  230. this.search.end = this.selectData2[1];
  231. }else{
  232. this.search.start = '';
  233. this.search.end = '';
  234. }
  235. },
  236. }
  237. });
  238. </script>
  239. <style>
  240. .el-tabs__header {
  241. font-size: 16px;
  242. }
  243. .table-body {
  244. padding: 20px;
  245. background-color: #fff;
  246. }
  247. .table-body .el-button {
  248. padding: 0 !important;
  249. border: 0;
  250. margin: 0 5px;
  251. }
  252. .input-item {
  253. width: 250px;
  254. margin: 0 0 20px;
  255. display: inline-block;
  256. }
  257. .input-item .el-input__inner {
  258. border-right: 0;
  259. }
  260. .input-item .el-input__inner:hover {
  261. border: 1px solid #dcdfe6;
  262. border-right: 0;
  263. outline: 0;
  264. }
  265. .input-item .el-input__inner:focus {
  266. border: 1px solid #dcdfe6;
  267. border-right: 0;
  268. outline: 0;
  269. }
  270. .input-item .el-input-group__append {
  271. background-color: #fff;
  272. border-left: 0;
  273. width: 10%;
  274. padding: 0;
  275. }
  276. .input-item .el-input-group__append .el-button {
  277. padding: 0;
  278. }
  279. .input-item .el-input-group__append .el-button {
  280. margin: 0;
  281. }
  282. .batch {
  283. margin: 0 0 20px;
  284. display: inline-block;
  285. }
  286. .batch .el-button {
  287. padding: 9px 15px !important;
  288. }
  289. .item-box{
  290. margin-right: 20px;
  291. }
  292. .item-box .label{
  293. margin-right: 8px;
  294. }
  295. .form-nickname{
  296. width: 180px;
  297. white-space:nowrap;
  298. overflow:hidden;
  299. text-overflow:ellipsis;
  300. }
  301. .index-video-url{
  302. width: 300px;
  303. }
  304. .index-video-url video{
  305. width: 100%;
  306. }
  307. .index-related-info{
  308. width: 500px;
  309. }
  310. .video-top{
  311. width: 100%;
  312. display: flex;
  313. align-items: flex-start;
  314. box-sizing: border-box;
  315. padding: 20px;
  316. /* opacity: .5; */
  317. background-color: #FFFFFF;
  318. }
  319. .video-top .top-right{
  320. line-height: 26px;
  321. }
  322. .video-top .top-right .top-title{
  323. font-size: 18px;
  324. white-space:nowrap;
  325. overflow:hidden;
  326. text-overflow:ellipsis;
  327. width: 360px;
  328. }
  329. .video-top .top-right .wrapper{
  330. display: flex;
  331. /* align-items: flex-start; */
  332. }
  333. .video-top .top-right .wrapper .to-copy{
  334. /* color: #03C5FF; */
  335. margin-left: 20px;
  336. }
  337. .video-top .top-right .detail-price{
  338. color: #BC0100;
  339. font-size: 18px;
  340. font-family: Microsoft YaHei;
  341. font-weight: bold;
  342. }
  343. /* .atooltip {
  344. background: #FFFFFF !important;
  345. border: none !important;
  346. } */
  347. .el-table th>.cell{
  348. color: #333;
  349. font-weight: bold;
  350. font-size: 14px;
  351. }
  352. .el-table__footer-wrapper, .el-table__header-wrapper{
  353. border-bottom: 1.4px solid #D6D6D6;
  354. }
  355. .award-money{
  356. color: #BC0100;
  357. }
  358. </style>