mypoint.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <div class="sld_myPoint_wrapper">
  3. <MemberTitle memberTitle="积分" style="padding-left: 20px"></MemberTitle>
  4. <div class="pointCon">
  5. <div class="jifen_top">
  6. <div class="itg">
  7. <span>{{ L["可用积分"] }}:</span>
  8. <span class="colr">{{ pointAva }}</span>
  9. </div>
  10. </div>
  11. <div class="content_tit">
  12. <ul class="tabsTitle">
  13. <li
  14. :class="{ current: indexNum == 0 }"
  15. id="all"
  16. @click="handleSwitch(0)"
  17. >
  18. {{ L["全部"] }}
  19. </li>
  20. <li
  21. :class="{ current: indexNum == 1 }"
  22. id="income"
  23. @click="handleSwitch(1)"
  24. >
  25. {{ L["收入"] }}
  26. </li>
  27. <li
  28. :class="{ current: indexNum == 2 }"
  29. id="expend"
  30. @click="handleSwitch(2)"
  31. >
  32. {{ L["支出"] }}
  33. </li>
  34. </ul>
  35. </div>
  36. <div class="point_list">
  37. <table class="point_table">
  38. <tbody>
  39. <tr class="voucher_tabeltitle">
  40. <th style="width: 30%">{{ L["日期"] }}</th>
  41. <th style="width: 30%">{{ L["收入/支出"] }}</th>
  42. <th style="width: 40%">{{ L["详细说明"] }}</th>
  43. </tr>
  44. <tr v-for="(item, index) in pointList.list" :key="index">
  45. <td>{{ item.createTime }}</td>
  46. <td>
  47. <span
  48. class="colr"
  49. v-if="
  50. item.type == 6 ||
  51. item.type == 7 ||
  52. item.type == 9 ||
  53. item.type == 12 ||
  54. item.type == 13 ||
  55. item.type == 14
  56. "
  57. >-{{ item.value }}</span
  58. >
  59. <span class="colr1" v-else>+{{ item.value }}</span>
  60. </td>
  61. <td>{{ item.description }}</td>
  62. </tr>
  63. </tbody>
  64. </table>
  65. <SldCommonEmpty
  66. v-if="!pointList.list.length"
  67. totalHeight="587"
  68. totalWidth="1003"
  69. tip="暂无积分记录~"
  70. />
  71. </div>
  72. <div class="flex_row_end_center sld_pagination">
  73. <el-pagination
  74. @current-change="handleCurrentChange"
  75. v-model:currentPage="pageData.page.current"
  76. :page-size="pageData.page.pageSize"
  77. layout="prev, pager, next, jumper"
  78. :total="pageData.page.total"
  79. :hide-on-single-page="true"
  80. >
  81. </el-pagination>
  82. </div>
  83. </div>
  84. </div>
  85. </template>
  86. <script setup>
  87. import { reactive, onMounted, getCurrentInstance, ref } from "vue";
  88. // import { lang_zn } from "@/assets/language/zh";
  89. import { getCurLanguage } from '@/composables/common.js';
  90. // const L = lang_zn;
  91. const L = getCurLanguage();
  92. definePageMeta({
  93. layout: "member",
  94. middleware: ["auth"],
  95. });
  96. const { proxy } = getCurrentInstance();
  97. const pointAva = ref(0);
  98. const pointList = reactive({ list: [] });
  99. const pageData = reactive({ page: {} });
  100. const indexNum = ref(0);
  101. const params = reactive({
  102. current: 1,
  103. pageSize: 20,
  104. type: "",
  105. });
  106. const getInitPoint = () => {
  107. get("v3/member/front/integralLog/getMemberIntegral").then((res) => {
  108. if (res.state == 200) {
  109. pointAva.value = res.data.memberIntegral;
  110. }
  111. });
  112. };
  113. const getPointList = () => {
  114. post("v3/member/front/integralLog/list", params).then((res) => {
  115. if (res.state == 200) {
  116. pointList.list = res.data.list;
  117. pageData.page = res.data.pagination;
  118. }
  119. });
  120. };
  121. const handleSwitch = (index) => {
  122. indexNum.value = index;
  123. params.type = index;
  124. params.current = 1;
  125. getPointList();
  126. };
  127. const handlePrevCilickChange = (e) => {
  128. params.current = e;
  129. getPointList();
  130. };
  131. const handleNextCilickChange = (e) => {
  132. params.current = e;
  133. getPointList();
  134. };
  135. const handleCurrentChange = (e) => {
  136. params.current = e;
  137. getPointList();
  138. };
  139. onMounted(() => {
  140. getInitPoint();
  141. getPointList();
  142. });
  143. </script>
  144. <style lang="scss">
  145. @use "@/assets/style/member/myPoint.scss" as *;
  146. @use "@/assets/style/base.scss" as *;
  147. .sld_pagination {
  148. margin-right: 40px;
  149. margin-bottom: 20px;
  150. }
  151. </style>