yishou.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view class="phone-list-page phone-banzheng-page">
  3. <view class="phone-navBar-box">
  4. <view @click="goUpPage" class="nav-bar-icon"></view>
  5. <text class="nav-bar-title">已售记录</text>
  6. <view></view>
  7. </view>
  8. <view class="banzheng-search-box">
  9. <uni-datetime-picker v-model="data.range" type="daterange" @maskClick="maskClick" style="flex: 1" />
  10. </view>
  11. <!-- 课程列表 -->
  12. <scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
  13. :refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"
  14. class="phone-scroll-saixuan-view">
  15. <uni-list>
  16. <uni-list-item v-for="item in data.list" class="banzheng-list-item-box">
  17. <template v-slot:body>
  18. <view>
  19. </view>
  20. </template>
  21. </uni-list-item>
  22. <uni-load-more :status="data.state" @click="getMore(0)" :contentText="data.contentText"></uni-load-more>
  23. </uni-list>
  24. </scroll-view>
  25. <!-- 页面底端 -->
  26. <customTabbarClientVue :current-tab="0"></customTabbarClientVue>
  27. </view>
  28. </template>
  29. <script setup>
  30. import searchDialog from "@/pages/admin/banzheng/search.vue";
  31. import commonDialog from '@/components/dialog/commonDialog.vue';
  32. import customTabbarClientVue from "@/components/custom-tabbar/custom-tabbar-admin.vue";
  33. import {
  34. reactive,
  35. ref
  36. } from "vue";
  37. import {
  38. onLoad
  39. } from "@dcloudio/uni-app"
  40. import {
  41. getKechengYishou,
  42. } from "@/api/zizhanghao.js"
  43. const data = reactive({
  44. list: [], // 办证列表
  45. loading: false,
  46. page: 0,
  47. size: 10,
  48. state: 'more',
  49. contentText: {
  50. contentdown: '查看更多',
  51. contentrefresh: '加载中',
  52. contentnomore: '没有更多'
  53. },
  54. userName: '', // 手机号
  55. realName: '', // 姓名
  56. range: []
  57. })
  58. function maskClick() {
  59. console.log('chufa')
  60. }
  61. function goUpPage() {
  62. uni.redirectTo({
  63. url: '/pages/admin/ShouYe/shouye'
  64. })
  65. }
  66. function refreshData() {
  67. const opt = {
  68. realName: data.realName, // 姓名
  69. userName: data.userName, // 手机号
  70. page: 1,
  71. size: 10, // 固定查询10条
  72. }
  73. data.list = [];
  74. // 数学
  75. data.state = 'loading';
  76. data.page++;
  77. opt.page = data.page;
  78. getKechengYishou(opt).then(res => {
  79. data.list = data.list.concat(res.data.data);
  80. data.loading = false;
  81. if (res.data.total > data.list.length) {
  82. data.state = 'more';
  83. data.loading = false;
  84. } else {
  85. data.state = 'no-more';
  86. data.loading = false;
  87. }
  88. }).catch(err => {
  89. data.state = 'more';
  90. data.loading = false;
  91. })
  92. }
  93. function getMore() {
  94. const opt = {
  95. realName: data.realName, // 姓名
  96. userName: data.userName, // 手机号
  97. page: 1,
  98. size: 10, // 固定查询10条
  99. }
  100. if (data.state == 'no-more') return;
  101. data.state = 'loading';
  102. data.page++;
  103. opt.page = data.page;
  104. getKechengYishou(opt).then(res => {
  105. data.list = data.list.concat(res.data.data);
  106. data.loading = false;
  107. if (res.data.total > data.list.length) {
  108. data.state = 'more';
  109. data.loading = false;
  110. } else {
  111. data.state = 'no-more';
  112. data.loading = false;
  113. }
  114. }).catch(err => {
  115. data.state = 'more';
  116. data.loading = false;
  117. })
  118. }
  119. function onRefresh() {
  120. data.page = 0;
  121. data.list = [];
  122. data.loading = true;
  123. refreshData();
  124. }
  125. function dialogSearchReset() {
  126. data.userName = '';
  127. data.realName = '';
  128. }
  129. function deleteQuerenBtn() {
  130. getUserGuanliDelete({
  131. userId: deletUserId.value
  132. }).then(res => {
  133. if (res.code == 0) {
  134. uni.showToast({
  135. title: '成功'
  136. })
  137. data.page = 0;
  138. refreshData();
  139. } else {
  140. uni.showToast({
  141. title: '失败'
  142. })
  143. }
  144. })
  145. }
  146. onLoad(() => {
  147. getMore()
  148. })
  149. </script>
  150. <style>
  151. </style>