order-list.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <style>
  2. .vue-line-clamp p {
  3. line-height: 22px;
  4. }
  5. .demo-form-inline .el-select .el-input {
  6. width: 100px;
  7. }
  8. /* 订单表格 start */
  9. .width-pre10 {
  10. width: 12%;
  11. text-align: center;
  12. }
  13. .width-50 {
  14. width: 50px;
  15. }
  16. .width-400 {
  17. width: 700px;
  18. }
  19. .order-table {
  20. overflow-x: scroll;
  21. }
  22. .tab-title,
  23. .tab-cont {
  24. width: 100%;
  25. min-width: 1290px;
  26. font-size: 13px;
  27. }
  28. .tab-title {
  29. padding: 20px 0;
  30. }
  31. .tab-title>li {
  32. padding: 0 10px;
  33. }
  34. .tab-cont {
  35. border: 1px solid #F2F2F2;
  36. margin-bottom: 20px;
  37. }
  38. .tab-cont-row {
  39. padding: 10px 0 10px 10px;
  40. background-color: #F7F7F7;
  41. }
  42. .tab-cont-info {
  43. height: 100px;
  44. }
  45. .tab-cont-info>li {
  46. /* display: flex;
  47. flex-direction: column;
  48. justify-content: center; */
  49. height: 100%;
  50. padding: 16px 10px;
  51. }
  52. .tab-btns {
  53. width: 320px;
  54. margin-right: 20px;
  55. }
  56. .tab-goods-name {
  57. margin: 0 10px;
  58. }
  59. .border-right {
  60. border-right: 1px solid #f2f2f2;
  61. }
  62. .border-bottom {
  63. border-bottom: 1px solid #f2f2f2;
  64. }
  65. .no-border-bottom {
  66. border-bottom: none !important;
  67. }
  68. .cursor {
  69. cursor: pointer;
  70. }
  71. .edit-icon {
  72. color: #03c5ff;
  73. cursor: pointer;
  74. }
  75. .popover-btn {
  76. font-size: 12px;
  77. padding: 0 10px;
  78. border-right: 1px solid var(--primary, #03c5ff);
  79. cursor: pointer;
  80. display: inline-block;
  81. line-height: 1;
  82. color: #03c5ff;
  83. }
  84. .popover-btn:last-child {
  85. border-right: none;
  86. }
  87. .width-s {
  88. width: 200px;
  89. text-align: center;
  90. }
  91. .el-button--text {
  92. padding: 0 !important;
  93. }
  94. .com-order-refund-status {
  95. position: absolute;
  96. bottom: 18px;
  97. left: 0px;
  98. height: 20px;
  99. width: 50px;
  100. background-color: #FF7171;
  101. color: #fff;
  102. text-align: center;
  103. border-radius: 0 0 5px 5px;
  104. font-size: 12px;
  105. }
  106. .fenRunData .el-dialog__body{
  107. padding: 0px 10px 0 10px;
  108. }
  109. .change_price p{
  110. padding: 5px;
  111. font-size: 15px;
  112. width: 200px;
  113. }
  114. .change_price{
  115. width: 200px;
  116. margin: 0px 0 0px 81%;
  117. }
  118. .change_price label{
  119. float:left;
  120. width: 100px;
  121. text-align: right;
  122. padding-right: 20px;
  123. }
  124. .change_formula{
  125. float: left;
  126. width: 300px;
  127. color: #6c6969;
  128. font-size: 12px;
  129. }
  130. /* 订单表格 end */
  131. </style>
  132. <div id="app" v-cloak>
  133. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;" v-loading="listLoading">
  134. <div slot="header">
  135. <span>购买记录</span>
  136. </div>
  137. <div class="table-body">
  138. <el-tabs v-model="activeName">
  139. <el-form :inline="true" :model="search_data" size="small" class="demo-form-inline">
  140. <el-form-item label="下单时间">
  141. <el-date-picker style="margin-top: 1px;" @change="changeTime" v-model="search_data.datetime" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"></el-date-picker>
  142. </el-form-item>
  143. <el-form-item label="订单状态">
  144. <el-select v-model="search_data.order_status" placeholder="请选择">
  145. <el-option label="待支付" value="0"></el-option>
  146. <el-option label="已完成" value="4"></el-option>
  147. <el-option label="已关闭" value="-4"></el-option>
  148. </el-select>
  149. </el-form-item>
  150. <el-form-item>
  151. <el-button type="primary" @click="search">搜索</el-button>
  152. <el-button type="danger" @click="clearSearch" v-if="show_clear_search_btn">清除条件</el-button>
  153. </el-form-item>
  154. </el-form>
  155. <!-- 订单表格 start -->
  156. <div class="order-table">
  157. <ul class="tab-title" flex="dir:left cross:center" style="margin-bottom: 5px; background-color: #F7F7F7;">
  158. <li class="width-400">应用信息</li>
  159. <li class="width-pre10">周期</li>
  160. <li class="width-pre10">单价</li>
  161. <li class="width-pre10">数量</li>
  162. <li class="width-s">实付</li>
  163. </ul>
  164. <div class="tab-cont" v-for="(item, index) in list" :key="index">
  165. <div class="tab-cont-row" flex="main:justify cross:center">
  166. <div flex="dir:left cross:center">
  167. <div style="padding-right: 20px;">订单({{ item.id }})编号:{{ item.order_no || '-' }}</div>
  168. <div style="padding-right: 20px;">操作账号:{{ item.operator_username }}</div>
  169. <div style="padding-right: 20px;">下单时间:{{ item.created_at|dateTimeFormat('Y-m-d H:i:s') }}</div>
  170. </div>
  171. </div>
  172. <ul class="tab-cont-info" flex="dir:left cross:center" v-if="item.addons">
  173. <li class="tab-shop-info width-400" flex="dir:left">
  174. <div style="position: relative;">
  175. <el-image style="width: 50px; height: 50px; border-radius: 5px;" :src="item.addons.cover">
  176. <div slot="error" class="image-slot">
  177. <com-image :src="item.addons.default_cover"></com-image>
  178. </div>
  179. </el-image>
  180. </div>
  181. <div class="tab-goods-name" style="line-height: 26px;">
  182. <div style="font-size: 16px;">{{ item.addons.title }}</div>
  183. <div style="color: #8E8C8B;">{{ item.addons.brief_introduction }}</div>
  184. </div>
  185. </li>
  186. <li class="width-pre10">
  187. <p v-if="item.unit == 0">永久有效</p>
  188. <p v-if="item.unit > 0">{{ item.duration }}{{ unit_arr[item.unit] }}</p>
  189. </li>
  190. <li class="width-pre10">
  191. <p>¥{{ item.order_price }}</p>
  192. </li>
  193. <li class="width-pre10 border-right">
  194. <p>x1</p>
  195. </li>
  196. <li class="width-s" style="line-height: 18px;">
  197. <p>¥{{ item.pay_money }}</p>
  198. <p style="color: #F65610;">{{ status_arr[item.order_status] }} </p>
  199. <p v-if="item.order_status == 0">{{ item.expire_time|dateTimeFormat('Y-m-d H:i:s') }} 前有效</p>
  200. <el-button type="text" @click="handle('detail', item)">查看详情</el-button>
  201. </li>
  202. </ul>
  203. </div>
  204. </div>
  205. <div style="text-align: right;margin: 20px 0;">
  206. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  207. </div>
  208. <!-- 订单表格 end -->
  209. </el-tabs>
  210. </div>
  211. </el-card>
  212. </div>
  213. <script>
  214. const app = new Vue({
  215. el: '#app',
  216. data() {
  217. return {
  218. order_status: null,
  219. activeName: '999',
  220. list: [],
  221. listLoading: false,
  222. page: 1,
  223. pageCount: 0,
  224. search_data: { // 筛选条件
  225. order_status: null,
  226. datetime:[],
  227. },
  228. unit_arr:{
  229. 1: '月',
  230. 2: '年',
  231. },
  232. status_arr:{
  233. '0': '待付款',
  234. '4': '已完成',
  235. '-4': '已关闭',
  236. }
  237. };
  238. },
  239. mounted: function() {
  240. this.getList();
  241. },
  242. computed: {
  243. show_clear_search_btn: function() {
  244. return !isEmpty(this.search_data.order_status) || !isEmpty(this.search_data.datetime);
  245. }
  246. },
  247. methods: {
  248. search() {
  249. this.page = 1;
  250. this.getList(this.search_data);
  251. },
  252. clearSearch() {
  253. this.search_data.order_status = null;
  254. this.search_data.datetime = [];
  255. this.getList();
  256. },
  257. handle(type, data = null) {
  258. let id = data ? parseInt(data.id) : '';
  259. switch (type) {
  260. // 订单详情
  261. case 'detail':
  262. let params = {
  263. r: 'mall/addons/order-detail'
  264. };
  265. if (id) params = Object.assign(params, {
  266. id: id
  267. });
  268. navigateTo(params);
  269. break;
  270. }
  271. },
  272. send(url, params, callback) {
  273. let self = this;
  274. request({
  275. params: {
  276. r: url,
  277. },
  278. method: 'post',
  279. data: params
  280. }).then(e => {
  281. if (e.data.code == 0) {
  282. self.$message.success(e.data.msg);
  283. self.getList(this.search_data);
  284. } else {
  285. self.$message.error(e.data.msg);
  286. }
  287. if (callback) callback(e.data);
  288. }).catch(e => {
  289. console.log(e);
  290. });
  291. },
  292. pagination(currentPage) {
  293. let self = this;
  294. self.page = currentPage;
  295. self.getList(this.search_data);
  296. },
  297. changeTime(e) {
  298. },
  299. // 获取商品列表
  300. getList(params = {}) {
  301. let self = this;
  302. let basic_params = {
  303. page: self.page,
  304. };
  305. params = Object.assign(basic_params, params);
  306. if (self.listLoading == false) {
  307. self.listLoading = true;
  308. request({
  309. params: {
  310. r: 'mall/addons/order-list',
  311. },
  312. method: 'post',
  313. data:params
  314. }).then(e => {
  315. self.listLoading = false;
  316. if (e.data.code == 0) {
  317. this.handleData(e.data.data.list)
  318. self.list = e.data.data.list;
  319. self.pageCount = e.data.data.page_count;
  320. } else {
  321. self.$message.error(e.data.msg);
  322. }
  323. }).catch(e => {
  324. self.$message.error(e.data.msg);
  325. self.listLoading = false;
  326. });
  327. }
  328. },
  329. handleData(data){
  330. if(data){
  331. for(let order in data){
  332. if(data[order].addons){
  333. data[order].addons.default_cover = _diy_img_prefix+'/static/addons/icon/'+data[order].addons.name+'.png'
  334. }
  335. }
  336. }
  337. },
  338. }
  339. });
  340. </script>