My SMM panel
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

72 строки
2.1 KiB

  1. <template>
  2. <div>
  3. <section class="pending-pane">
  4. <div class="actions"><a class="new-order" href="#new-order">New</a><a class="new-order" href="#credits">Add Credits</a></div>
  5. <h4>Pending Orders</h4>
  6. <ul>
  7. <template v-bind:key='order.id' v-for="order in orders">
  8. <div class="pending-item" v-if="order.status == 'pending'">
  9. <div class="pending-heading">
  10. <li @click="togglePending($event)">{{order.service.name}} ({{order.updated_at}})</li>
  11. <img class="chevron" src="../../images/chevron-down.svg" alt="">
  12. </div>
  13. <div class="pending-content">
  14. <p>ID: {{order.id}}<br>URL: {{order.url}}<br>Quantity: {{order.quantity}}<br>Note: {{order.note}}</p>
  15. </div>
  16. </div>
  17. </template>
  18. </ul>
  19. </section>
  20. <div class="info-grey"><p>Orders are typically completed within 1-5 days.</p><div></div></div>
  21. <section class="history-pane">
  22. <h4>Order History</h4>
  23. <table>
  24. <thead><th>Date</th><th>ID</th><th>Name</th><th>Status</th> <th>Quantity</th></thead>
  25. <tbody>
  26. <tr v-bind:key='order.id' v-for='order in orders.slice(historyPage*10-10, historyPage*10)'>
  27. <td>{{order.updated_at}}</td>
  28. <td>{{order.id}}</td>
  29. <td>{{order.service.name}}</td>
  30. <td :class="order.status"
  31. class="status"><span>{{order.status.charAt(0).toUpperCase() +
  32. order.status.slice(1)}}</span></td>
  33. <td>{{order.quantity}}</td>
  34. </tr>
  35. </tbody>
  36. </table>
  37. <img @click="moveHistory(false)" class="nav-btn left" src="../../images/arrow-left-circle-fill.svg" alt=""/>
  38. <p class="nav-legend">{{historyPage}}/{{Math.ceil(orders.length/10)}}</p>
  39. <img @click="moveHistory(true)" class="nav-btn right" src="../../images/arrow-right-circle-fill.svg" alt=""/>
  40. </section>
  41. </div>
  42. </template>
  43. <script>
  44. function togglePending(event) {
  45. event.target.parentNode.parentNode.classList.toggle('selected')
  46. }
  47. function moveHistory(forward) {
  48. if (forward) {
  49. this.historyPage += 1
  50. } else {
  51. this.historyPage -= 1
  52. }
  53. if (this.historyPage < 1) {
  54. this.historyPage = 1
  55. return
  56. } else if (this.historyPage > this.orders.length/10+1) {
  57. this.historyPage -= 1
  58. return
  59. }
  60. }
  61. export default {
  62. data() {return {historyPage: 1}},
  63. methods: {
  64. togglePending, moveHistory
  65. },
  66. props: ['orders']
  67. }
  68. </script>