order_pink.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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. {if $vo.is_false}
  40. 虚拟拼团暂无订单
  41. {else}
  42. <a href="{:Url('order.storeOrder/index')}?real_name={$vo.order_id_key|getOrderId}">{$vo.order_id}</a>
  43. {/if}
  44. </td>
  45. <td class="text-center">
  46. ¥{$vo.total_price}
  47. </td>
  48. <td class="text-center">
  49. {if condition="$vo['is_refund']"}
  50. 已退款
  51. {else/}
  52. 未退款
  53. {/if}
  54. </td>
  55. </tr>
  56. {/volist}
  57. </tbody>
  58. </table>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. {/block}
  65. {block name="script"}
  66. <script>
  67. $(".open_image").on('click',function (e) {
  68. var image = $(this).data('image');
  69. $eb.openImage(image);
  70. })
  71. $('.btn-danger').on('click',function (e) {
  72. window.t = $(this);
  73. var _this = $(this),url =_this.data('url');
  74. $eb.$swal('delete',function(){
  75. $eb.axios.get(url).then(function(res){
  76. if(res.status == 200 && res.data.code == 200) {
  77. $eb.$swal('success',res.data.msg);
  78. }else
  79. return Promise.reject(res.data.msg || '收货失败')
  80. }).catch(function(err){
  81. $eb.$swal('error',err);
  82. });
  83. },{'title':'您确定要修改收货状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
  84. })
  85. $('.offline_btn').on('click',function (e) {
  86. window.t = $(this);
  87. var _this = $(this),url =_this.data('url'),pay_price =_this.data('pay');
  88. $eb.$swal('delete',function(){
  89. $eb.axios.get(url).then(function(res){
  90. if(res.status == 200 && res.data.code == 200) {
  91. $eb.$swal('success',res.data.msg);
  92. }else
  93. return Promise.reject(res.data.msg || '收货失败')
  94. }).catch(function(err){
  95. $eb.$swal('error',err);
  96. });
  97. },{'title':'您确定要修改已支付'+pay_price+'元的状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
  98. })
  99. $('.add_mark').on('click',function (e) {
  100. var _this = $(this),url =_this.data('url'),id=_this.data('id');
  101. $eb.$alert('textarea',{},function (result) {
  102. if(result){
  103. $.ajax({
  104. url:url,
  105. data:'remark='+result+'&id='+id,
  106. type:'post',
  107. dataType:'json',
  108. success:function (res) {
  109. console.log(res);
  110. if(res.code == 200) {
  111. $eb.$swal('success',res.msg);
  112. }else
  113. $eb.$swal('error',res.msg);
  114. }
  115. })
  116. }else{
  117. $eb.$swal('error','请输入要备注的内容');
  118. }
  119. });
  120. })
  121. $('.save_mark').on('click',function (e) {
  122. var _this = $(this),url =_this.data('url'),id=_this.data('id'),make=_this.data('make');
  123. $eb.$alert('textarea',{title:'请修改内容',value:make},function (result) {
  124. if(result){
  125. $.ajax({
  126. url:url,
  127. data:'remark='+result+'&id='+id,
  128. type:'post',
  129. dataType:'json',
  130. success:function (res) {
  131. console.log(res);
  132. if(res.code == 200) {
  133. $eb.$swal('success',res.msg);
  134. }else
  135. $eb.$swal('error',res.msg);
  136. }
  137. })
  138. }else{
  139. $eb.$swal('error','请输入要备注的内容');
  140. }
  141. });
  142. })
  143. var dateInput =$('.datepicker');
  144. dateInput.daterangepicker({
  145. autoUpdateInput: false,
  146. "opens": "center",
  147. "drops": "down",
  148. "ranges": {
  149. '今天': [moment(), moment().add(1, 'days')],
  150. '昨天': [moment().subtract(1, 'days'), moment()],
  151. '上周': [moment().subtract(6, 'days'), moment()],
  152. '前30天': [moment().subtract(29, 'days'), moment()],
  153. '本月': [moment().startOf('month'), moment().endOf('month')],
  154. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  155. },
  156. "locale" : {
  157. applyLabel : '确定',
  158. cancelLabel : '清空',
  159. fromLabel : '起始时间',
  160. toLabel : '结束时间',
  161. format : 'YYYY/MM/DD',
  162. customRangeLabel : '自定义',
  163. daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
  164. monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
  165. '七月', '八月', '九月', '十月', '十一月', '十二月' ],
  166. firstDay : 1
  167. }
  168. });
  169. dateInput.on('cancel.daterangepicker', function(ev, picker) {
  170. $("#data").val('');
  171. });
  172. dateInput.on('apply.daterangepicker', function(ev, picker) {
  173. $("#data").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
  174. });
  175. </script>
  176. {/block}