My SMM panel
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

80 líneas
2.2 KiB

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