My SMM panel
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

147 lignes
4.6 KiB

  1. <template>
  2. <div>
  3. <section class="pending-pane">
  4. <div class="actions">
  5. <a class="new-order" href="#new-order">New</a
  6. ><a class="new-order" href="#credits">Add Credits</a>
  7. </div>
  8. <h4>Pending Orders</h4>
  9. <ul>
  10. <template v-bind:key="order.id" v-for="order in orders">
  11. <div class="pending-item" v-if="order.status == 'pending'">
  12. <div class="pending-heading">
  13. <li @click="togglePending($event)">
  14. {{ order.service.name }} ({{
  15. order.updated_at
  16. }})
  17. </li>
  18. <img
  19. class="chevron"
  20. src="../../images/chevron-down.svg"
  21. alt=""
  22. />
  23. </div>
  24. <div class="pending-content">
  25. <p>
  26. ID: {{ order.id }}<br />URL: {{ order.url
  27. }}<br />Quantity: {{ order.quantity
  28. }}<br />Note: {{ order.note }}
  29. </p>
  30. </div>
  31. </div>
  32. </template>
  33. </ul>
  34. </section>
  35. <div class="info-grey">
  36. <p>Orders are typically completed within 1-5 days.</p>
  37. <div></div>
  38. </div>
  39. <section class="history-pane">
  40. <h4>Order History</h4>
  41. <div class="table-scroller">
  42. <table>
  43. <thead>
  44. <th>Date</th>
  45. <th>ID</th>
  46. <th>Name</th>
  47. <th>Status</th>
  48. <th>Quantity</th>
  49. </thead>
  50. <tbody>
  51. <tr
  52. v-bind:key="order.id"
  53. v-for="order in orders.slice(
  54. historyPage * 10 - 10,
  55. historyPage * 10
  56. )"
  57. >
  58. <td>{{ order.updated_at }}</td>
  59. <td>{{ order.id }}</td>
  60. <td>{{ order.service.name }}</td>
  61. <td :class="order.status" class="status">
  62. <span>{{
  63. order.status.charAt(0).toUpperCase() +
  64. order.status.slice(1)
  65. }}</span>
  66. </td>
  67. <td>{{ order.quantity }}</td>
  68. <td><eye @click="select(order)"></eye></td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. </div>
  73. <img
  74. @click="moveHistory(false)"
  75. class="nav-btn left"
  76. src="../../images/arrow-left-circle-fill.svg"
  77. alt=""
  78. />
  79. <p class="nav-legend">
  80. {{ historyPage }}/{{ Math.ceil(orders.length / 10) }}
  81. </p>
  82. <img
  83. @click="moveHistory(true)"
  84. class="nav-btn right"
  85. src="../../images/arrow-right-circle-fill.svg"
  86. alt=""
  87. />
  88. </section>
  89. <order-item
  90. v-if="selected"
  91. @close="close"
  92. :selected="selected"
  93. :token="token"
  94. @change-url="(url) => (selected.url = url)"
  95. ></order-item>
  96. </div>
  97. </template>
  98. <script>
  99. import Eye from "../icons/eye-fill.vue";
  100. import OrderItem from "./order-item.vue";
  101. function togglePending(event) {
  102. event.target.parentNode.parentNode.classList.toggle("selected");
  103. }
  104. function moveHistory(forward) {
  105. if (forward) {
  106. this.historyPage += 1;
  107. } else {
  108. this.historyPage -= 1;
  109. }
  110. if (this.historyPage < 1) {
  111. this.historyPage = 1;
  112. return;
  113. } else if (this.historyPage > this.orders.length / 10 + 1) {
  114. this.historyPage -= 1;
  115. return;
  116. }
  117. }
  118. function close() {
  119. this.selected = null;
  120. }
  121. function select(order) {
  122. this.selected = order;
  123. }
  124. export default {
  125. components: { Eye, OrderItem },
  126. data() {
  127. return { historyPage: 1, selected: null };
  128. },
  129. methods: {
  130. togglePending,
  131. moveHistory,
  132. close,
  133. select,
  134. },
  135. props: ["orders", "token"],
  136. };
  137. </script>