order_pink.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. <script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
  4. <script src="{__PLUG_PATH}moment.js"></script>
  5. <link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
  6. <script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
  7. {/block}
  8. {block name="content"}
  9. <div class="row">
  10. <div class="col-sm-12">
  11. <div class="ibox">
  12. <div class="ibox-content">
  13. <div class="row">
  14. </div>
  15. <div class="table-responsive" style="overflow:visible">
  16. <table class="table table-striped table-bordered">
  17. <thead>
  18. <tr>
  19. <th class="text-center">编号</th>
  20. <th class="text-center">用户名称</th>
  21. <th class="text-center">用户头像</th>
  22. <th class="text-center">订单编号</th>
  23. <th class="text-center">金额</th>
  24. <th class="text-center">订单状态</th>
  25. </thead>
  26. <tbody class="">
  27. {volist name="list" id="vo"}
  28. <tr>
  29. <td class="text-center">
  30. {$vo.id}
  31. </td>
  32. <td class="text-center">
  33. {$vo.nickname}/{$vo.uid}
  34. </td>
  35. <td class="text-center">
  36. <img class="open_image" style="max-width: 80px;" data-image="{$vo.avatar}" src="{$vo.avatar}" alt="{$vo.nickname}">
  37. </td>
  38. <td class="text-center">
  39. <a href="{:Url('order.storeOrder/index')}?real_name={$vo.order_id}">{$vo.order_id}</a>
  40. </td>
  41. <td class="text-center">
  42. ¥{$vo.price}
  43. </td>
  44. <td class="text-center">
  45. {if condition="$vo['is_refund']"}
  46. 已退款
  47. {else/}
  48. 未退款
  49. {/if}
  50. </td>
  51. </tr>
  52. {/volist}
  53. </tbody>
  54. </table>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. {/block}
  61. {block name="script"}
  62. <script>
  63. $(".open_image").on('click',function (e) {
  64. var image = $(this).data('image');
  65. $eb.openImage(image);
  66. })
  67. $('.btn-danger').on('click',function (e) {
  68. window.t = $(this);
  69. var _this = $(this),url =_this.data('url');
  70. $eb.$swal('delete',function(){
  71. $eb.axios.get(url).then(function(res){
  72. if(res.status == 200 && res.data.code == 200) {
  73. $eb.$swal('success',res.data.msg);
  74. }else
  75. return Promise.reject(res.data.msg || '收货失败')
  76. }).catch(function(err){
  77. $eb.$swal('error',err);
  78. });
  79. },{'title':'您确定要修改收货状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
  80. })
  81. $('.offline_btn').on('click',function (e) {
  82. window.t = $(this);
  83. var _this = $(this),url =_this.data('url'),pay_price =_this.data('pay');
  84. $eb.$swal('delete',function(){
  85. $eb.axios.get(url).then(function(res){
  86. if(res.status == 200 && res.data.code == 200) {
  87. $eb.$swal('success',res.data.msg);
  88. }else
  89. return Promise.reject(res.data.msg || '收货失败')
  90. }).catch(function(err){
  91. $eb.$swal('error',err);
  92. });
  93. },{'title':'您确定要修改已支付'+pay_price+'元的状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
  94. })
  95. $('.add_mark').on('click',function (e) {
  96. var _this = $(this),url =_this.data('url'),id=_this.data('id');
  97. $eb.$alert('textarea',{},function (result) {
  98. if(result){
  99. $.ajax({
  100. url:url,
  101. data:'remark='+result+'&id='+id,
  102. type:'post',
  103. dataType:'json',
  104. success:function (res) {
  105. console.log(res);
  106. if(res.code == 200) {
  107. $eb.$swal('success',res.msg);
  108. }else
  109. $eb.$swal('error',res.msg);
  110. }
  111. })
  112. }else{
  113. $eb.$swal('error','请输入要备注的内容');
  114. }
  115. });
  116. })
  117. $('.save_mark').on('click',function (e) {
  118. var _this = $(this),url =_this.data('url'),id=_this.data('id'),make=_this.data('make');
  119. $eb.$alert('textarea',{title:'请修改内容',value:make},function (result) {
  120. if(result){
  121. $.ajax({
  122. url:url,
  123. data:'remark='+result+'&id='+id,
  124. type:'post',
  125. dataType:'json',
  126. success:function (res) {
  127. console.log(res);
  128. if(res.code == 200) {
  129. $eb.$swal('success',res.msg);
  130. }else
  131. $eb.$swal('error',res.msg);
  132. }
  133. })
  134. }else{
  135. $eb.$swal('error','请输入要备注的内容');
  136. }
  137. });
  138. })
  139. var dateInput =$('.datepicker');
  140. dateInput.daterangepicker({
  141. autoUpdateInput: false,
  142. "opens": "center",
  143. "drops": "down",
  144. "ranges": {
  145. '今天': [moment(), moment().add(1, 'days')],
  146. '昨天': [moment().subtract(1, 'days'), moment()],
  147. '上周': [moment().subtract(6, 'days'), moment()],
  148. '前30天': [moment().subtract(29, 'days'), moment()],
  149. '本月': [moment().startOf('month'), moment().endOf('month')],
  150. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  151. },
  152. "locale" : {
  153. applyLabel : '确定',
  154. cancelLabel : '清空',
  155. fromLabel : '起始时间',
  156. toLabel : '结束时间',
  157. format : 'YYYY/MM/DD',
  158. customRangeLabel : '自定义',
  159. daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
  160. monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
  161. '七月', '八月', '九月', '十月', '十一月', '十二月' ],
  162. firstDay : 1
  163. }
  164. });
  165. dateInput.on('cancel.daterangepicker', function(ev, picker) {
  166. $("#data").val('');
  167. });
  168. dateInput.on('apply.daterangepicker', function(ev, picker) {
  169. $("#data").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
  170. });
  171. </script>
  172. {/block}