yishou.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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" @scrolltolower="onScrolltolower"
  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 onScrolltolower() {
  59. getMore()
  60. }
  61. function maskClick() {
  62. console.log('chufa')
  63. }
  64. function goUpPage() {
  65. uni.redirectTo({
  66. url: '/pages/admin/ShouYe/shouye'
  67. })
  68. }
  69. function refreshData() {
  70. const opt = {
  71. realName: data.realName, // 姓名
  72. userName: data.userName, // 手机号
  73. page: 1,
  74. size: 10, // 固定查询10条
  75. }
  76. data.list = [];
  77. // 数学
  78. data.state = 'loading';
  79. data.page++;
  80. opt.page = data.page;
  81. getKechengYishou(opt).then(res => {
  82. data.list = data.list.concat(res.data.data);
  83. data.loading = false;
  84. if (res.data.total > data.list.length) {
  85. data.state = 'more';
  86. data.loading = false;
  87. } else {
  88. data.state = 'no-more';
  89. data.loading = false;
  90. }
  91. }).catch(err => {
  92. data.state = 'more';
  93. data.loading = false;
  94. })
  95. }
  96. function getMore() {
  97. const opt = {
  98. realName: data.realName, // 姓名
  99. userName: data.userName, // 手机号
  100. page: 1,
  101. size: 10, // 固定查询10条
  102. }
  103. if (data.state == 'no-more') return;
  104. data.state = 'loading';
  105. data.page++;
  106. opt.page = data.page;
  107. getKechengYishou(opt).then(res => {
  108. data.list = data.list.concat(res.data.data);
  109. data.loading = false;
  110. if (res.data.total > data.list.length) {
  111. data.state = 'more';
  112. data.loading = false;
  113. } else {
  114. data.state = 'no-more';
  115. data.loading = false;
  116. }
  117. }).catch(err => {
  118. data.state = 'more';
  119. data.loading = false;
  120. })
  121. }
  122. function onRefresh() {
  123. data.page = 0;
  124. data.list = [];
  125. data.loading = true;
  126. refreshData();
  127. }
  128. function dialogSearchReset() {
  129. data.userName = '';
  130. data.realName = '';
  131. }
  132. function deleteQuerenBtn() {
  133. getUserGuanliDelete({
  134. userId: deletUserId.value
  135. }).then(res => {
  136. if (res.code == 0) {
  137. uni.showToast({
  138. title: '成功'
  139. })
  140. data.page = 0;
  141. refreshData();
  142. } else {
  143. uni.showToast({
  144. title: '失败'
  145. })
  146. }
  147. })
  148. }
  149. onLoad(() => {
  150. getMore()
  151. })
  152. </script>
  153. <style>
  154. </style>